Updated Brazilian Portuguese translation
[platform/upstream/glib.git] / gio / gmountoperation.c
1 /* GIO - GLib Input, Output and Streaming Library
2  * 
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #include "config.h"
24
25 #include <string.h>
26
27 #include "gmountoperation.h"
28 #include "gioenumtypes.h"
29 #include "glibintl.h"
30
31
32 /**
33  * SECTION:gmountoperation
34  * @short_description: Object used for authentication and user interaction
35  * @include: gio/gio.h
36  *
37  * #GMountOperation provides a mechanism for interacting with the user.
38  * It can be used for authenticating mountable operations, such as loop
39  * mounting files, hard drive partitions or server locations. It can
40  * also be used to ask the user questions or show a list of applications
41  * preventing unmount or eject operations from completing.
42  *
43  * Note that #GMountOperation is used for more than just #GMount
44  * objects – for example it is also used in g_drive_start() and
45  * g_drive_stop().
46  *
47  * Users should instantiate a subclass of this that implements all the
48  * various callbacks to show the required dialogs, such as
49  * #GtkMountOperation. If no user interaction is desired (for example
50  * when automounting filesystems at login time), usually %NULL can be
51  * passed, see each method taking a #GMountOperation for details.
52  */
53
54 G_DEFINE_TYPE (GMountOperation, g_mount_operation, G_TYPE_OBJECT);
55
56 enum {
57   ASK_PASSWORD,
58   ASK_QUESTION,
59   REPLY,
60   ABORTED,
61   SHOW_PROCESSES,
62   SHOW_UNMOUNT_PROGRESS,
63   LAST_SIGNAL
64 };
65
66 static guint signals[LAST_SIGNAL] = { 0 };
67
68 struct _GMountOperationPrivate {
69   char *password;
70   char *user;
71   char *domain;
72   gboolean anonymous;
73   GPasswordSave password_save;
74   int choice;
75 };
76
77 enum {
78   PROP_0,
79   PROP_USERNAME,
80   PROP_PASSWORD,
81   PROP_ANONYMOUS,
82   PROP_DOMAIN,
83   PROP_PASSWORD_SAVE,
84   PROP_CHOICE
85 };
86
87 static void 
88 g_mount_operation_set_property (GObject      *object,
89                                 guint         prop_id,
90                                 const GValue *value,
91                                 GParamSpec   *pspec)
92 {
93   GMountOperation *operation;
94
95   operation = G_MOUNT_OPERATION (object);
96
97   switch (prop_id)
98     {
99     case PROP_USERNAME:
100       g_mount_operation_set_username (operation, 
101                                       g_value_get_string (value));
102       break;
103    
104     case PROP_PASSWORD:
105       g_mount_operation_set_password (operation, 
106                                       g_value_get_string (value));
107       break;
108
109     case PROP_ANONYMOUS:
110       g_mount_operation_set_anonymous (operation, 
111                                        g_value_get_boolean (value));
112       break;
113
114     case PROP_DOMAIN:
115       g_mount_operation_set_domain (operation, 
116                                     g_value_get_string (value));
117       break;
118
119     case PROP_PASSWORD_SAVE:
120       g_mount_operation_set_password_save (operation, 
121                                            g_value_get_enum (value));
122       break;
123
124     case PROP_CHOICE:
125       g_mount_operation_set_choice (operation, 
126                                     g_value_get_int (value));
127       break;
128
129     default:
130       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
131       break;
132     }
133 }
134
135
136 static void 
137 g_mount_operation_get_property (GObject    *object,
138                                 guint       prop_id,
139                                 GValue     *value,
140                                 GParamSpec *pspec)
141 {
142   GMountOperation *operation;
143   GMountOperationPrivate *priv;
144
145   operation = G_MOUNT_OPERATION (object);
146   priv = operation->priv;
147   
148   switch (prop_id)
149     {
150     case PROP_USERNAME:
151       g_value_set_string (value, priv->user);
152       break;
153
154     case PROP_PASSWORD:
155       g_value_set_string (value, priv->password);
156       break;
157
158     case PROP_ANONYMOUS:
159       g_value_set_boolean (value, priv->anonymous);
160       break;
161
162     case PROP_DOMAIN:
163       g_value_set_string (value, priv->domain);
164       break;
165
166     case PROP_PASSWORD_SAVE:
167       g_value_set_enum (value, priv->password_save);
168       break;
169
170     case PROP_CHOICE:
171       g_value_set_int (value, priv->choice);
172       break;
173
174     default:
175       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
176       break;
177     }
178 }
179
180
181 static void
182 g_mount_operation_finalize (GObject *object)
183 {
184   GMountOperation *operation;
185   GMountOperationPrivate *priv;
186
187   operation = G_MOUNT_OPERATION (object);
188
189   priv = operation->priv;
190   
191   g_free (priv->password);
192   g_free (priv->user);
193   g_free (priv->domain);
194
195   G_OBJECT_CLASS (g_mount_operation_parent_class)->finalize (object);
196 }
197
198 static gboolean
199 reply_non_handled_in_idle (gpointer data)
200 {
201   GMountOperation *op = data;
202
203   g_mount_operation_reply (op, G_MOUNT_OPERATION_UNHANDLED);
204   return G_SOURCE_REMOVE;
205 }
206
207 static void
208 ask_password (GMountOperation *op,
209               const char      *message,
210               const char      *default_user,
211               const char      *default_domain,
212               GAskPasswordFlags flags)
213 {
214   g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
215                    reply_non_handled_in_idle,
216                    g_object_ref (op),
217                    g_object_unref);
218 }
219   
220 static void
221 ask_question (GMountOperation *op,
222               const char      *message,
223               const char      *choices[])
224 {
225   g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
226                    reply_non_handled_in_idle,
227                    g_object_ref (op),
228                    g_object_unref);
229 }
230
231 static void
232 show_processes (GMountOperation      *op,
233                 const gchar          *message,
234                 GArray               *processes,
235                 const gchar          *choices[])
236 {
237   g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
238                    reply_non_handled_in_idle,
239                    g_object_ref (op),
240                    g_object_unref);
241 }
242
243 static void
244 show_unmount_progress (GMountOperation *op,
245                        const gchar     *message,
246                        gint64           time_left,
247                        gint64           bytes_left)
248 {
249   /* nothing to do */
250 }
251
252 static void
253 g_mount_operation_class_init (GMountOperationClass *klass)
254 {
255   GObjectClass *object_class;
256   
257   g_type_class_add_private (klass, sizeof (GMountOperationPrivate));
258  
259   object_class = G_OBJECT_CLASS (klass);
260   object_class->finalize = g_mount_operation_finalize;
261   object_class->get_property = g_mount_operation_get_property;
262   object_class->set_property = g_mount_operation_set_property;
263   
264   klass->ask_password = ask_password;
265   klass->ask_question = ask_question;
266   klass->show_processes = show_processes;
267   klass->show_unmount_progress = show_unmount_progress;
268   
269   /**
270    * GMountOperation::ask-password:
271    * @op: a #GMountOperation requesting a password.
272    * @message: string containing a message to display to the user.
273    * @default_user: string containing the default user name.
274    * @default_domain: string containing the default domain.
275    * @flags: a set of #GAskPasswordFlags.
276    *
277    * Emitted when a mount operation asks the user for a password.
278    *
279    * If the message contains a line break, the first line should be
280    * presented as a heading. For example, it may be used as the
281    * primary text in a #GtkMessageDialog.
282    */
283   signals[ASK_PASSWORD] =
284     g_signal_new (I_("ask-password"),
285                   G_TYPE_FROM_CLASS (object_class),
286                   G_SIGNAL_RUN_LAST,
287                   G_STRUCT_OFFSET (GMountOperationClass, ask_password),
288                   NULL, NULL,
289                   NULL,
290                   G_TYPE_NONE, 4,
291                   G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_ASK_PASSWORD_FLAGS);
292                   
293   /**
294    * GMountOperation::ask-question:
295    * @op: a #GMountOperation asking a question.
296    * @message: string containing a message to display to the user.
297    * @choices: an array of strings for each possible choice.
298    *
299    * Emitted when asking the user a question and gives a list of
300    * choices for the user to choose from.
301    *
302    * If the message contains a line break, the first line should be
303    * presented as a heading. For example, it may be used as the
304    * primary text in a #GtkMessageDialog.
305    */
306   signals[ASK_QUESTION] =
307     g_signal_new (I_("ask-question"),
308                   G_TYPE_FROM_CLASS (object_class),
309                   G_SIGNAL_RUN_LAST,
310                   G_STRUCT_OFFSET (GMountOperationClass, ask_question),
311                   NULL, NULL,
312                   NULL,
313                   G_TYPE_NONE, 2,
314                   G_TYPE_STRING, G_TYPE_STRV);
315                   
316   /**
317    * GMountOperation::reply:
318    * @op: a #GMountOperation.
319    * @result: a #GMountOperationResult indicating how the request was handled
320    *
321    * Emitted when the user has replied to the mount operation.
322    */
323   signals[REPLY] =
324     g_signal_new (I_("reply"),
325                   G_TYPE_FROM_CLASS (object_class),
326                   G_SIGNAL_RUN_LAST,
327                   G_STRUCT_OFFSET (GMountOperationClass, reply),
328                   NULL, NULL,
329                   g_cclosure_marshal_VOID__ENUM,
330                   G_TYPE_NONE, 1,
331                   G_TYPE_MOUNT_OPERATION_RESULT);
332
333   /**
334    * GMountOperation::aborted:
335    *
336    * Emitted by the backend when e.g. a device becomes unavailable
337    * while a mount operation is in progress.
338    *
339    * Implementations of GMountOperation should handle this signal
340    * by dismissing open password dialogs.
341    *
342    * Since: 2.20
343    */
344   signals[ABORTED] =
345     g_signal_new (I_("aborted"),
346                   G_TYPE_FROM_CLASS (object_class),
347                   G_SIGNAL_RUN_LAST,
348                   G_STRUCT_OFFSET (GMountOperationClass, aborted),
349                   NULL, NULL,
350                   g_cclosure_marshal_VOID__VOID,
351                   G_TYPE_NONE, 0);
352
353   /**
354    * GMountOperation::show-processes:
355    * @op: a #GMountOperation.
356    * @message: string containing a message to display to the user.
357    * @processes: (element-type GPid): an array of #GPid for processes
358    *   blocking the operation.
359    * @choices: an array of strings for each possible choice.
360    *
361    * Emitted when one or more processes are blocking an operation
362    * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
363    *
364    * Note that this signal may be emitted several times to update the
365    * list of blocking processes as processes close files. The
366    * application should only respond with g_mount_operation_reply() to
367    * the latest signal (setting #GMountOperation:choice to the choice
368    * the user made).
369    *
370    * If the message contains a line break, the first line should be
371    * presented as a heading. For example, it may be used as the
372    * primary text in a #GtkMessageDialog.
373    *
374    * Since: 2.22
375    */
376   signals[SHOW_PROCESSES] =
377     g_signal_new (I_("show-processes"),
378                   G_TYPE_FROM_CLASS (object_class),
379                   G_SIGNAL_RUN_LAST,
380                   G_STRUCT_OFFSET (GMountOperationClass, show_processes),
381                   NULL, NULL,
382                   NULL,
383                   G_TYPE_NONE, 3,
384                   G_TYPE_STRING, G_TYPE_ARRAY, G_TYPE_STRV);
385
386   /**
387    * GMountOperation::show-unmount-progress:
388    * @op: a #GMountOperation:
389    * @message: string containing a mesage to display to the user
390    * @time_left: the estimated time left before the operation completes,
391    *     in microseconds, or -1
392    * @bytes_left: the amount of bytes to be written before the operation
393    *     completes (or -1 if such amount is not known), or zero if the operation
394    *     is completed
395    *
396    * Emitted when an unmount operation has been busy for more than some time
397    * (typically 1.5 seconds).
398    *
399    * When unmounting or ejecting a volume, the kernel might need to flush
400    * pending data in its buffers to the volume stable storage, and this operation
401    * can take a considerable amount of time. This signal may be emitted several
402    * times as long as the unmount operation is outstanding, and then one
403    * last time when the operation is completed, with @bytes_left set to zero.
404    *
405    * Implementations of GMountOperation should handle this signal by
406    * showing an UI notification, and then dismiss it, or show another notification
407    * of completion, when @bytes_left reaches zero.
408    *
409    * If the message contains a line break, the first line should be
410    * presented as a heading. For example, it may be used as the
411    * primary text in a #GtkMessageDialog.
412    *
413    * Since: 2.34
414    */
415   signals[SHOW_UNMOUNT_PROGRESS] =
416     g_signal_new (I_("show-unmount-progress"),
417                   G_TYPE_FROM_CLASS (object_class),
418                   G_SIGNAL_RUN_LAST,
419                   G_STRUCT_OFFSET (GMountOperationClass, show_unmount_progress),
420                   NULL, NULL, NULL,
421                   G_TYPE_NONE, 3,
422                   G_TYPE_STRING, G_TYPE_INT64, G_TYPE_INT64);
423
424   /**
425    * GMountOperation:username:
426    *
427    * The user name that is used for authentication when carrying out
428    * the mount operation.
429    */ 
430   g_object_class_install_property (object_class,
431                                    PROP_USERNAME,
432                                    g_param_spec_string ("username",
433                                                         P_("Username"),
434                                                         P_("The user name"),
435                                                         NULL,
436                                                         G_PARAM_READWRITE|
437                                                         G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
438
439   /**
440    * GMountOperation:password:
441    *
442    * The password that is used for authentication when carrying out
443    * the mount operation.
444    */ 
445   g_object_class_install_property (object_class,
446                                    PROP_PASSWORD,
447                                    g_param_spec_string ("password",
448                                                         P_("Password"),
449                                                         P_("The password"),
450                                                         NULL,
451                                                         G_PARAM_READWRITE|
452                                                         G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
453
454   /**
455    * GMountOperation:anonymous:
456    * 
457    * Whether to use an anonymous user when authenticating.
458    */
459   g_object_class_install_property (object_class,
460                                    PROP_ANONYMOUS,
461                                    g_param_spec_boolean ("anonymous",
462                                                          P_("Anonymous"),
463                                                          P_("Whether to use an anonymous user"),
464                                                          FALSE,
465                                                          G_PARAM_READWRITE|
466                                                          G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
467
468   /**
469    * GMountOperation:domain:
470    *
471    * The domain to use for the mount operation.
472    */ 
473   g_object_class_install_property (object_class,
474                                    PROP_DOMAIN,
475                                    g_param_spec_string ("domain",
476                                                         P_("Domain"),
477                                                         P_("The domain of the mount operation"),
478                                                         NULL,
479                                                         G_PARAM_READWRITE|
480                                                         G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
481
482   /**
483    * GMountOperation:password-save:
484    *
485    * Determines if and how the password information should be saved. 
486    */ 
487   g_object_class_install_property (object_class,
488                                    PROP_PASSWORD_SAVE,
489                                    g_param_spec_enum ("password-save",
490                                                       P_("Password save"),
491                                                       P_("How passwords should be saved"),
492                                                       G_TYPE_PASSWORD_SAVE,
493                                                       G_PASSWORD_SAVE_NEVER,
494                                                       G_PARAM_READWRITE|
495                                                       G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
496
497   /**
498    * GMountOperation:choice:
499    *
500    * The index of the user's choice when a question is asked during the 
501    * mount operation. See the #GMountOperation::ask-question signal.
502    */ 
503   g_object_class_install_property (object_class,
504                                    PROP_CHOICE,
505                                    g_param_spec_int ("choice",
506                                                      P_("Choice"),
507                                                      P_("The users choice"),
508                                                      0, G_MAXINT, 0,
509                                                      G_PARAM_READWRITE|
510                                                      G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
511 }
512
513 static void
514 g_mount_operation_init (GMountOperation *operation)
515 {
516   operation->priv = G_TYPE_INSTANCE_GET_PRIVATE (operation,
517                                                  G_TYPE_MOUNT_OPERATION,
518                                                  GMountOperationPrivate);
519 }
520
521 /**
522  * g_mount_operation_new:
523  * 
524  * Creates a new mount operation.
525  * 
526  * Returns: a #GMountOperation.
527  **/
528 GMountOperation *
529 g_mount_operation_new (void)
530 {
531   return g_object_new (G_TYPE_MOUNT_OPERATION, NULL);
532 }
533
534 /**
535  * g_mount_operation_get_username:
536  * @op: a #GMountOperation.
537  * 
538  * Get the user name from the mount operation.
539  *
540  * Returns: a string containing the user name.
541  **/
542 const char *
543 g_mount_operation_get_username (GMountOperation *op)
544 {
545   g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), NULL);
546   return op->priv->user;
547 }
548
549 /**
550  * g_mount_operation_set_username:
551  * @op: a #GMountOperation.
552  * @username: input username.
553  *
554  * Sets the user name within @op to @username.
555  **/
556 void
557 g_mount_operation_set_username (GMountOperation *op,
558                                 const char      *username)
559 {
560   g_return_if_fail (G_IS_MOUNT_OPERATION (op));
561   g_free (op->priv->user);
562   op->priv->user = g_strdup (username);
563   g_object_notify (G_OBJECT (op), "username");
564 }
565
566 /**
567  * g_mount_operation_get_password:
568  * @op: a #GMountOperation.
569  *
570  * Gets a password from the mount operation. 
571  *
572  * Returns: a string containing the password within @op.
573  **/
574 const char *
575 g_mount_operation_get_password (GMountOperation *op)
576 {
577   g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), NULL);
578   return op->priv->password;
579 }
580
581 /**
582  * g_mount_operation_set_password:
583  * @op: a #GMountOperation.
584  * @password: password to set.
585  * 
586  * Sets the mount operation's password to @password.  
587  *
588  **/
589 void
590 g_mount_operation_set_password (GMountOperation *op,
591                                 const char      *password)
592 {
593   g_return_if_fail (G_IS_MOUNT_OPERATION (op));
594   g_free (op->priv->password);
595   op->priv->password = g_strdup (password);
596   g_object_notify (G_OBJECT (op), "password");
597 }
598
599 /**
600  * g_mount_operation_get_anonymous:
601  * @op: a #GMountOperation.
602  * 
603  * Check to see whether the mount operation is being used 
604  * for an anonymous user.
605  * 
606  * Returns: %TRUE if mount operation is anonymous. 
607  **/
608 gboolean
609 g_mount_operation_get_anonymous (GMountOperation *op)
610 {
611   g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), FALSE);
612   return op->priv->anonymous;
613 }
614
615 /**
616  * g_mount_operation_set_anonymous:
617  * @op: a #GMountOperation.
618  * @anonymous: boolean value.
619  * 
620  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
621  **/  
622 void
623 g_mount_operation_set_anonymous (GMountOperation *op,
624                                  gboolean         anonymous)
625 {
626   GMountOperationPrivate *priv;
627   g_return_if_fail (G_IS_MOUNT_OPERATION (op));
628   priv = op->priv;
629
630   if (priv->anonymous != anonymous)
631     {
632       priv->anonymous = anonymous;
633       g_object_notify (G_OBJECT (op), "anonymous");
634     }
635 }
636
637 /**
638  * g_mount_operation_get_domain:
639  * @op: a #GMountOperation.
640  * 
641  * Gets the domain of the mount operation.
642  * 
643  * Returns: a string set to the domain. 
644  **/
645 const char *
646 g_mount_operation_get_domain (GMountOperation *op)
647 {
648   g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), NULL);
649   return op->priv->domain;
650 }
651
652 /**
653  * g_mount_operation_set_domain:
654  * @op: a #GMountOperation.
655  * @domain: the domain to set.
656  * 
657  * Sets the mount operation's domain. 
658  **/  
659 void
660 g_mount_operation_set_domain (GMountOperation *op,
661                               const char      *domain)
662 {
663   g_return_if_fail (G_IS_MOUNT_OPERATION (op));
664   g_free (op->priv->domain);
665   op->priv->domain = g_strdup (domain);
666   g_object_notify (G_OBJECT (op), "domain");
667 }
668
669 /**
670  * g_mount_operation_get_password_save:
671  * @op: a #GMountOperation.
672  * 
673  * Gets the state of saving passwords for the mount operation.
674  *
675  * Returns: a #GPasswordSave flag. 
676  **/  
677
678 GPasswordSave
679 g_mount_operation_get_password_save (GMountOperation *op)
680 {
681   g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), G_PASSWORD_SAVE_NEVER);
682   return op->priv->password_save;
683 }
684
685 /**
686  * g_mount_operation_set_password_save:
687  * @op: a #GMountOperation.
688  * @save: a set of #GPasswordSave flags.
689  * 
690  * Sets the state of saving passwords for the mount operation.
691  * 
692  **/   
693 void
694 g_mount_operation_set_password_save (GMountOperation *op,
695                                      GPasswordSave    save)
696 {
697   GMountOperationPrivate *priv;
698   g_return_if_fail (G_IS_MOUNT_OPERATION (op));
699   priv = op->priv;
700  
701   if (priv->password_save != save)
702     {
703       priv->password_save = save;
704       g_object_notify (G_OBJECT (op), "password-save");
705     }
706 }
707
708 /**
709  * g_mount_operation_get_choice:
710  * @op: a #GMountOperation.
711  * 
712  * Gets a choice from the mount operation.
713  *
714  * Returns: an integer containing an index of the user's choice from 
715  * the choice's list, or %0.
716  **/
717 int
718 g_mount_operation_get_choice (GMountOperation *op)
719 {
720   g_return_val_if_fail (G_IS_MOUNT_OPERATION (op), 0);
721   return op->priv->choice;
722 }
723
724 /**
725  * g_mount_operation_set_choice:
726  * @op: a #GMountOperation.
727  * @choice: an integer.
728  *
729  * Sets a default choice for the mount operation.
730  **/
731 void
732 g_mount_operation_set_choice (GMountOperation *op,
733                               int              choice)
734 {
735   GMountOperationPrivate *priv;
736   g_return_if_fail (G_IS_MOUNT_OPERATION (op));
737   priv = op->priv;
738   if (priv->choice != choice)
739     {
740       priv->choice = choice;
741       g_object_notify (G_OBJECT (op), "choice");
742     }
743 }
744
745 /**
746  * g_mount_operation_reply:
747  * @op: a #GMountOperation
748  * @result: a #GMountOperationResult
749  * 
750  * Emits the #GMountOperation::reply signal.
751  **/
752 void
753 g_mount_operation_reply (GMountOperation *op,
754                          GMountOperationResult result)
755 {
756   g_return_if_fail (G_IS_MOUNT_OPERATION (op));
757   g_signal_emit (op, signals[REPLY], 0, result);
758 }