1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * SPDX-License-Identifier: LGPL-2.1-or-later
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 * Author: Alexander Larsson <alexl@redhat.com>
27 #include "gmountoperation.h"
28 #include "gioenumtypes.h"
30 #include "gmarshal-internal.h"
34 * SECTION:gmountoperation
35 * @short_description: Object used for authentication and user interaction
38 * #GMountOperation provides a mechanism for interacting with the user.
39 * It can be used for authenticating mountable operations, such as loop
40 * mounting files, hard drive partitions or server locations. It can
41 * also be used to ask the user questions or show a list of applications
42 * preventing unmount or eject operations from completing.
44 * Note that #GMountOperation is used for more than just #GMount
45 * objects – for example it is also used in g_drive_start() and
48 * Users should instantiate a subclass of this that implements all the
49 * various callbacks to show the required dialogs, such as
50 * #GtkMountOperation. If no user interaction is desired (for example
51 * when automounting filesystems at login time), usually %NULL can be
52 * passed, see each method taking a #GMountOperation for details.
54 * The term ‘TCRYPT’ is used to mean ‘compatible with TrueCrypt and VeraCrypt’.
55 * [TrueCrypt](https://en.wikipedia.org/wiki/TrueCrypt) is a discontinued system for
56 * encrypting file containers, partitions or whole disks, typically used with Windows.
57 * [VeraCrypt](https://www.veracrypt.fr/) is a maintained fork of TrueCrypt with various
58 * improvements and auditing fixes.
67 SHOW_UNMOUNT_PROGRESS,
71 static guint signals[LAST_SIGNAL] = { 0 };
73 struct _GMountOperationPrivate {
78 GPasswordSave password_save;
80 gboolean hidden_volume;
81 gboolean system_volume;
93 PROP_IS_TCRYPT_HIDDEN_VOLUME,
94 PROP_IS_TCRYPT_SYSTEM_VOLUME,
98 G_DEFINE_TYPE_WITH_PRIVATE (GMountOperation, g_mount_operation, G_TYPE_OBJECT)
101 g_mount_operation_set_property (GObject *object,
106 GMountOperation *operation;
108 operation = G_MOUNT_OPERATION (object);
113 g_mount_operation_set_username (operation,
114 g_value_get_string (value));
118 g_mount_operation_set_password (operation,
119 g_value_get_string (value));
123 g_mount_operation_set_anonymous (operation,
124 g_value_get_boolean (value));
128 g_mount_operation_set_domain (operation,
129 g_value_get_string (value));
132 case PROP_PASSWORD_SAVE:
133 g_mount_operation_set_password_save (operation,
134 g_value_get_enum (value));
138 g_mount_operation_set_choice (operation,
139 g_value_get_int (value));
142 case PROP_IS_TCRYPT_HIDDEN_VOLUME:
143 g_mount_operation_set_is_tcrypt_hidden_volume (operation,
144 g_value_get_boolean (value));
147 case PROP_IS_TCRYPT_SYSTEM_VOLUME:
148 g_mount_operation_set_is_tcrypt_system_volume (operation,
149 g_value_get_boolean (value));
153 g_mount_operation_set_pim (operation,
154 g_value_get_uint (value));
158 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
165 g_mount_operation_get_property (GObject *object,
170 GMountOperation *operation;
171 GMountOperationPrivate *priv;
173 operation = G_MOUNT_OPERATION (object);
174 priv = operation->priv;
179 g_value_set_string (value, priv->user);
183 g_value_set_string (value, priv->password);
187 g_value_set_boolean (value, priv->anonymous);
191 g_value_set_string (value, priv->domain);
194 case PROP_PASSWORD_SAVE:
195 g_value_set_enum (value, priv->password_save);
199 g_value_set_int (value, priv->choice);
202 case PROP_IS_TCRYPT_HIDDEN_VOLUME:
203 g_value_set_boolean (value, priv->hidden_volume);
206 case PROP_IS_TCRYPT_SYSTEM_VOLUME:
207 g_value_set_boolean (value, priv->system_volume);
211 g_value_set_uint (value, priv->pim);
215 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
222 g_mount_operation_finalize (GObject *object)
224 GMountOperation *operation;
225 GMountOperationPrivate *priv;
227 operation = G_MOUNT_OPERATION (object);
229 priv = operation->priv;
231 g_free (priv->password);
233 g_free (priv->domain);
235 G_OBJECT_CLASS (g_mount_operation_parent_class)->finalize (object);
239 reply_non_handled_in_idle (gpointer data)
241 GMountOperation *op = data;
243 g_mount_operation_reply (op, G_MOUNT_OPERATION_UNHANDLED);
244 return G_SOURCE_REMOVE;
248 ask_password (GMountOperation *op,
250 const char *default_user,
251 const char *default_domain,
252 GAskPasswordFlags flags)
254 g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
255 reply_non_handled_in_idle,
261 ask_question (GMountOperation *op,
263 const char *choices[])
265 g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
266 reply_non_handled_in_idle,
272 show_processes (GMountOperation *op,
273 const gchar *message,
275 const gchar *choices[])
277 g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
278 reply_non_handled_in_idle,
284 show_unmount_progress (GMountOperation *op,
285 const gchar *message,
293 g_mount_operation_class_init (GMountOperationClass *klass)
295 GObjectClass *object_class;
297 object_class = G_OBJECT_CLASS (klass);
298 object_class->finalize = g_mount_operation_finalize;
299 object_class->get_property = g_mount_operation_get_property;
300 object_class->set_property = g_mount_operation_set_property;
302 klass->ask_password = ask_password;
303 klass->ask_question = ask_question;
304 klass->show_processes = show_processes;
305 klass->show_unmount_progress = show_unmount_progress;
308 * GMountOperation::ask-password:
309 * @op: a #GMountOperation requesting a password.
310 * @message: string containing a message to display to the user.
311 * @default_user: string containing the default user name.
312 * @default_domain: string containing the default domain.
313 * @flags: a set of #GAskPasswordFlags.
315 * Emitted when a mount operation asks the user for a password.
317 * If the message contains a line break, the first line should be
318 * presented as a heading. For example, it may be used as the
319 * primary text in a #GtkMessageDialog.
321 signals[ASK_PASSWORD] =
322 g_signal_new (I_("ask-password"),
323 G_TYPE_FROM_CLASS (object_class),
325 G_STRUCT_OFFSET (GMountOperationClass, ask_password),
327 _g_cclosure_marshal_VOID__STRING_STRING_STRING_FLAGS,
329 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_ASK_PASSWORD_FLAGS);
330 g_signal_set_va_marshaller (signals[ASK_PASSWORD],
331 G_TYPE_FROM_CLASS (object_class),
332 _g_cclosure_marshal_VOID__STRING_STRING_STRING_FLAGSv);
335 * GMountOperation::ask-question:
336 * @op: a #GMountOperation asking a question.
337 * @message: string containing a message to display to the user.
338 * @choices: an array of strings for each possible choice.
340 * Emitted when asking the user a question and gives a list of
341 * choices for the user to choose from.
343 * If the message contains a line break, the first line should be
344 * presented as a heading. For example, it may be used as the
345 * primary text in a #GtkMessageDialog.
347 signals[ASK_QUESTION] =
348 g_signal_new (I_("ask-question"),
349 G_TYPE_FROM_CLASS (object_class),
351 G_STRUCT_OFFSET (GMountOperationClass, ask_question),
353 _g_cclosure_marshal_VOID__STRING_BOXED,
355 G_TYPE_STRING, G_TYPE_STRV);
356 g_signal_set_va_marshaller (signals[ASK_QUESTION],
357 G_TYPE_FROM_CLASS (object_class),
358 _g_cclosure_marshal_VOID__STRING_BOXEDv);
361 * GMountOperation::reply:
362 * @op: a #GMountOperation.
363 * @result: a #GMountOperationResult indicating how the request was handled
365 * Emitted when the user has replied to the mount operation.
368 g_signal_new (I_("reply"),
369 G_TYPE_FROM_CLASS (object_class),
371 G_STRUCT_OFFSET (GMountOperationClass, reply),
375 G_TYPE_MOUNT_OPERATION_RESULT);
378 * GMountOperation::aborted:
380 * Emitted by the backend when e.g. a device becomes unavailable
381 * while a mount operation is in progress.
383 * Implementations of GMountOperation should handle this signal
384 * by dismissing open password dialogs.
389 g_signal_new (I_("aborted"),
390 G_TYPE_FROM_CLASS (object_class),
392 G_STRUCT_OFFSET (GMountOperationClass, aborted),
398 * GMountOperation::show-processes:
399 * @op: a #GMountOperation.
400 * @message: string containing a message to display to the user.
401 * @processes: (element-type GPid): an array of #GPid for processes
402 * blocking the operation.
403 * @choices: an array of strings for each possible choice.
405 * Emitted when one or more processes are blocking an operation
406 * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
408 * Note that this signal may be emitted several times to update the
409 * list of blocking processes as processes close files. The
410 * application should only respond with g_mount_operation_reply() to
411 * the latest signal (setting #GMountOperation:choice to the choice
414 * If the message contains a line break, the first line should be
415 * presented as a heading. For example, it may be used as the
416 * primary text in a #GtkMessageDialog.
420 signals[SHOW_PROCESSES] =
421 g_signal_new (I_("show-processes"),
422 G_TYPE_FROM_CLASS (object_class),
424 G_STRUCT_OFFSET (GMountOperationClass, show_processes),
426 _g_cclosure_marshal_VOID__STRING_BOXED_BOXED,
428 G_TYPE_STRING, G_TYPE_ARRAY, G_TYPE_STRV);
429 g_signal_set_va_marshaller (signals[SHOW_PROCESSES],
430 G_TYPE_FROM_CLASS (object_class),
431 _g_cclosure_marshal_VOID__STRING_BOXED_BOXEDv);
434 * GMountOperation::show-unmount-progress:
435 * @op: a #GMountOperation:
436 * @message: string containing a message to display to the user
437 * @time_left: the estimated time left before the operation completes,
438 * in microseconds, or -1
439 * @bytes_left: the amount of bytes to be written before the operation
440 * completes (or -1 if such amount is not known), or zero if the operation
443 * Emitted when an unmount operation has been busy for more than some time
444 * (typically 1.5 seconds).
446 * When unmounting or ejecting a volume, the kernel might need to flush
447 * pending data in its buffers to the volume stable storage, and this operation
448 * can take a considerable amount of time. This signal may be emitted several
449 * times as long as the unmount operation is outstanding, and then one
450 * last time when the operation is completed, with @bytes_left set to zero.
452 * Implementations of GMountOperation should handle this signal by
453 * showing an UI notification, and then dismiss it, or show another notification
454 * of completion, when @bytes_left reaches zero.
456 * If the message contains a line break, the first line should be
457 * presented as a heading. For example, it may be used as the
458 * primary text in a #GtkMessageDialog.
462 signals[SHOW_UNMOUNT_PROGRESS] =
463 g_signal_new (I_("show-unmount-progress"),
464 G_TYPE_FROM_CLASS (object_class),
466 G_STRUCT_OFFSET (GMountOperationClass, show_unmount_progress),
468 _g_cclosure_marshal_VOID__STRING_INT64_INT64,
470 G_TYPE_STRING, G_TYPE_INT64, G_TYPE_INT64);
471 g_signal_set_va_marshaller (signals[SHOW_UNMOUNT_PROGRESS],
472 G_TYPE_FROM_CLASS (object_class),
473 _g_cclosure_marshal_VOID__STRING_INT64_INT64v);
476 * GMountOperation:username:
478 * The user name that is used for authentication when carrying out
479 * the mount operation.
481 g_object_class_install_property (object_class,
483 g_param_spec_string ("username",
488 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
491 * GMountOperation:password:
493 * The password that is used for authentication when carrying out
494 * the mount operation.
496 g_object_class_install_property (object_class,
498 g_param_spec_string ("password",
503 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
506 * GMountOperation:anonymous:
508 * Whether to use an anonymous user when authenticating.
510 g_object_class_install_property (object_class,
512 g_param_spec_boolean ("anonymous",
514 P_("Whether to use an anonymous user"),
517 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
520 * GMountOperation:domain:
522 * The domain to use for the mount operation.
524 g_object_class_install_property (object_class,
526 g_param_spec_string ("domain",
528 P_("The domain of the mount operation"),
531 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
534 * GMountOperation:password-save:
536 * Determines if and how the password information should be saved.
538 g_object_class_install_property (object_class,
540 g_param_spec_enum ("password-save",
542 P_("How passwords should be saved"),
543 G_TYPE_PASSWORD_SAVE,
544 G_PASSWORD_SAVE_NEVER,
546 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
549 * GMountOperation:choice:
551 * The index of the user's choice when a question is asked during the
552 * mount operation. See the #GMountOperation::ask-question signal.
554 g_object_class_install_property (object_class,
556 g_param_spec_int ("choice",
558 P_("The users choice"),
561 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
564 * GMountOperation:is-tcrypt-hidden-volume:
566 * Whether the device to be unlocked is a TCRYPT hidden volume.
567 * See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden%20Volume.html).
571 g_object_class_install_property (object_class,
572 PROP_IS_TCRYPT_HIDDEN_VOLUME,
573 g_param_spec_boolean ("is-tcrypt-hidden-volume",
574 P_("TCRYPT Hidden Volume"),
575 P_("Whether to unlock a TCRYPT hidden volume. See https://www.veracrypt.fr/en/Hidden%20Volume.html."),
578 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
581 * GMountOperation:is-tcrypt-system-volume:
583 * Whether the device to be unlocked is a TCRYPT system volume.
584 * In this context, a system volume is a volume with a bootloader
585 * and operating system installed. This is only supported for Windows
586 * operating systems. For further documentation, see
587 * [the VeraCrypt documentation](https://www.veracrypt.fr/en/System%20Encryption.html).
591 g_object_class_install_property (object_class,
592 PROP_IS_TCRYPT_SYSTEM_VOLUME,
593 g_param_spec_boolean ("is-tcrypt-system-volume",
594 P_("TCRYPT System Volume"),
595 P_("Whether to unlock a TCRYPT system volume. Only supported for unlocking Windows system volumes. See https://www.veracrypt.fr/en/System%20Encryption.html."),
598 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
601 * GMountOperation:pim:
603 * The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See
604 * [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20(PIM).html).
608 g_object_class_install_property (object_class,
610 g_param_spec_uint ("pim",
612 P_("The VeraCrypt PIM value"),
615 G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
619 g_mount_operation_init (GMountOperation *operation)
621 operation->priv = g_mount_operation_get_instance_private (operation);
625 * g_mount_operation_new:
627 * Creates a new mount operation.
629 * Returns: a #GMountOperation.
632 g_mount_operation_new (void)
634 return g_object_new (G_TYPE_MOUNT_OPERATION, NULL);
638 * g_mount_operation_get_username:
639 * @op: a #GMountOperation.
641 * Get the user name from the mount operation.
643 * Returns: (nullable): a string containing the user name.
646 g_mount_operation_get_username (GMountOperation *op)
648 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), NULL);
649 return op->priv->user;
653 * g_mount_operation_set_username:
654 * @op: a #GMountOperation.
655 * @username: (nullable): input username.
657 * Sets the user name within @op to @username.
660 g_mount_operation_set_username (GMountOperation *op,
661 const char *username)
663 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
664 g_free (op->priv->user);
665 op->priv->user = g_strdup (username);
666 g_object_notify (G_OBJECT (op), "username");
670 * g_mount_operation_get_password:
671 * @op: a #GMountOperation.
673 * Gets a password from the mount operation.
675 * Returns: (nullable): a string containing the password within @op.
678 g_mount_operation_get_password (GMountOperation *op)
680 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), NULL);
681 return op->priv->password;
685 * g_mount_operation_set_password:
686 * @op: a #GMountOperation.
687 * @password: (nullable): password to set.
689 * Sets the mount operation's password to @password.
693 g_mount_operation_set_password (GMountOperation *op,
694 const char *password)
696 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
697 g_free (op->priv->password);
698 op->priv->password = g_strdup (password);
699 g_object_notify (G_OBJECT (op), "password");
703 * g_mount_operation_get_anonymous:
704 * @op: a #GMountOperation.
706 * Check to see whether the mount operation is being used
707 * for an anonymous user.
709 * Returns: %TRUE if mount operation is anonymous.
712 g_mount_operation_get_anonymous (GMountOperation *op)
714 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), FALSE);
715 return op->priv->anonymous;
719 * g_mount_operation_set_anonymous:
720 * @op: a #GMountOperation.
721 * @anonymous: boolean value.
723 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
726 g_mount_operation_set_anonymous (GMountOperation *op,
729 GMountOperationPrivate *priv;
730 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
733 if (priv->anonymous != anonymous)
735 priv->anonymous = anonymous;
736 g_object_notify (G_OBJECT (op), "anonymous");
741 * g_mount_operation_get_domain:
742 * @op: a #GMountOperation.
744 * Gets the domain of the mount operation.
746 * Returns: (nullable): a string set to the domain.
749 g_mount_operation_get_domain (GMountOperation *op)
751 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), NULL);
752 return op->priv->domain;
756 * g_mount_operation_set_domain:
757 * @op: a #GMountOperation.
758 * @domain: (nullable): the domain to set.
760 * Sets the mount operation's domain.
763 g_mount_operation_set_domain (GMountOperation *op,
766 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
767 g_free (op->priv->domain);
768 op->priv->domain = g_strdup (domain);
769 g_object_notify (G_OBJECT (op), "domain");
773 * g_mount_operation_get_password_save:
774 * @op: a #GMountOperation.
776 * Gets the state of saving passwords for the mount operation.
778 * Returns: a #GPasswordSave flag.
782 g_mount_operation_get_password_save (GMountOperation *op)
784 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), G_PASSWORD_SAVE_NEVER);
785 return op->priv->password_save;
789 * g_mount_operation_set_password_save:
790 * @op: a #GMountOperation.
791 * @save: a set of #GPasswordSave flags.
793 * Sets the state of saving passwords for the mount operation.
797 g_mount_operation_set_password_save (GMountOperation *op,
800 GMountOperationPrivate *priv;
801 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
804 if (priv->password_save != save)
806 priv->password_save = save;
807 g_object_notify (G_OBJECT (op), "password-save");
812 * g_mount_operation_get_choice:
813 * @op: a #GMountOperation.
815 * Gets a choice from the mount operation.
817 * Returns: an integer containing an index of the user's choice from
818 * the choice's list, or `0`.
821 g_mount_operation_get_choice (GMountOperation *op)
823 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), 0);
824 return op->priv->choice;
828 * g_mount_operation_set_choice:
829 * @op: a #GMountOperation.
830 * @choice: an integer.
832 * Sets a default choice for the mount operation.
835 g_mount_operation_set_choice (GMountOperation *op,
838 GMountOperationPrivate *priv;
839 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
841 if (priv->choice != choice)
843 priv->choice = choice;
844 g_object_notify (G_OBJECT (op), "choice");
849 * g_mount_operation_get_is_tcrypt_hidden_volume:
850 * @op: a #GMountOperation.
852 * Check to see whether the mount operation is being used
853 * for a TCRYPT hidden volume.
855 * Returns: %TRUE if mount operation is for hidden volume.
860 g_mount_operation_get_is_tcrypt_hidden_volume (GMountOperation *op)
862 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), FALSE);
863 return op->priv->hidden_volume;
867 * g_mount_operation_set_is_tcrypt_hidden_volume:
868 * @op: a #GMountOperation.
869 * @hidden_volume: boolean value.
871 * Sets the mount operation to use a hidden volume if @hidden_volume is %TRUE.
876 g_mount_operation_set_is_tcrypt_hidden_volume (GMountOperation *op,
877 gboolean hidden_volume)
879 GMountOperationPrivate *priv;
880 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
883 if (priv->hidden_volume != hidden_volume)
885 priv->hidden_volume = hidden_volume;
886 g_object_notify (G_OBJECT (op), "is-tcrypt-hidden-volume");
891 * g_mount_operation_get_is_tcrypt_system_volume:
892 * @op: a #GMountOperation.
894 * Check to see whether the mount operation is being used
895 * for a TCRYPT system volume.
897 * Returns: %TRUE if mount operation is for system volume.
902 g_mount_operation_get_is_tcrypt_system_volume (GMountOperation *op)
904 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), FALSE);
905 return op->priv->system_volume;
909 * g_mount_operation_set_is_tcrypt_system_volume:
910 * @op: a #GMountOperation.
911 * @system_volume: boolean value.
913 * Sets the mount operation to use a system volume if @system_volume is %TRUE.
918 g_mount_operation_set_is_tcrypt_system_volume (GMountOperation *op,
919 gboolean system_volume)
921 GMountOperationPrivate *priv;
922 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
925 if (priv->system_volume != system_volume)
927 priv->system_volume = system_volume;
928 g_object_notify (G_OBJECT (op), "is-tcrypt-system-volume");
933 * g_mount_operation_get_pim:
934 * @op: a #GMountOperation.
936 * Gets a PIM from the mount operation.
938 * Returns: The VeraCrypt PIM within @op.
943 g_mount_operation_get_pim (GMountOperation *op)
945 g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), 0);
946 return op->priv->pim;
950 * g_mount_operation_set_pim:
951 * @op: a #GMountOperation.
952 * @pim: an unsigned integer.
954 * Sets the mount operation's PIM to @pim.
959 g_mount_operation_set_pim (GMountOperation *op,
962 GMountOperationPrivate *priv;
963 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
965 if (priv->pim != pim)
968 g_object_notify (G_OBJECT (op), "pim");
973 * g_mount_operation_reply:
974 * @op: a #GMountOperation
975 * @result: a #GMountOperationResult
977 * Emits the #GMountOperation::reply signal.
980 g_mount_operation_reply (GMountOperation *op,
981 GMountOperationResult result)
983 g_return_if_fail (G_IS_MOUNT_OPERATION (op));
984 g_signal_emit (op, signals[REPLY], 0, result);