Merge lp:~jeremywootten/pantheon-files/fix-load-timeout-during-ask-password into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 2253
Merged at revision: 2254
Proposed branch: lp:~jeremywootten/pantheon-files/fix-load-timeout-during-ask-password
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 62 lines (+20/-6)
1 file modified
libcore/gof-directory-async.vala (+20/-6)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-load-timeout-during-ask-password
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+301006@code.launchpad.net

Commit message

Do not timeout mount operation while asking for password (lp:1597386)

Description of the change

This branch prevents the gof_directory_async from timing out a mount operation between receiving the "ask-password" signal and the "reply" signal.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libcore/gof-directory-async.vala'
2--- libcore/gof-directory-async.vala 2016-06-27 11:11:37 +0000
3+++ libcore/gof-directory-async.vala 2016-07-24 15:56:44 +0000
4@@ -29,7 +29,7 @@
5 private uint mount_timeout_id = 0;
6 private const int ENUMERATE_TIMEOUT_SEC = 15;
7 private const int QUERY_INFO_TIMEOUT_SEC = 5;
8- private const int MOUNT_TIMEOUT_SEC = 5;
9+ private const int MOUNT_TIMEOUT_SEC = 10;
10
11 public GLib.File location;
12 public GLib.File? selected_file = null;
13@@ -238,6 +238,7 @@
14 file.is_connected = false;
15 return false;
16 }
17+
18 if (success) {
19 debug ("got file info");
20 file.update ();
21@@ -253,15 +254,28 @@
22 var mount_op = new Gtk.MountOperation (null);
23 cancellable = new Cancellable ();
24 bool mounting = true;
25+ bool asking_password = false;
26 assert (mount_timeout_id == 0);
27+
28 mount_timeout_id = Timeout.add_seconds (MOUNT_TIMEOUT_SEC, () => {
29- if (mounting) {
30+ if (mounting && !asking_password) {
31 warning ("Cancelled after timeout in mount mountable %s", file.uri);
32 cancellable.cancel ();
33+ mount_timeout_id = 0;
34+ return false;
35+ } else {
36+ return true;
37 }
38- mount_timeout_id = 0;
39- return false;
40- });
41+ });
42+
43+ mount_op.ask_password.connect (() => {
44+ asking_password = true;
45+ });
46+
47+ mount_op.reply.connect (() => {
48+ asking_password = false;
49+ });
50+
51 yield location.mount_enclosing_volume (0, mount_op, cancellable);
52 var mount = location.find_enclosing_mount ();
53
54@@ -1101,7 +1115,7 @@
55 cancel_timeout (ref timeout_thumbsq);
56 cancel_timeout (ref idle_consume_changes_id);
57 cancel_timeout (ref load_timeout_id);
58-
59+ cancel_timeout (ref mount_timeout_id);
60 }
61
62 private bool cancel_timeout (ref uint id) {

Subscribers

People subscribed via source and target branches

to all changes: