Merge lp:~jeremywootten/pantheon-files/fix-1677467-start-with-broken-network-connection into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 2531
Merged at revision: 2535
Proposed branch: lp:~jeremywootten/pantheon-files/fix-1677467-start-with-broken-network-connection
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 74 lines (+12/-10)
3 files modified
libcore/gof-directory-async.vala (+2/-4)
src/View/ViewContainer.vala (+3/-2)
src/View/Window.vala (+7/-4)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-1677467-start-with-broken-network-connection
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+321683@code.launchpad.net

Commit message

Use async query info even for apparently local folders, avoiding a timeout if the network is down in some situations

Description of the change

This branch fixes an issue where Files appears to hang (although it should time out and continue eventually) on startup if there is a remote folder mounted by fstab and the network connection is broken. Folders with an a local uri are no longer assumed to be local by GOFDirectoryAsync on initialization and the asynchronous method for obtaining info (with a shorter timeout) is used to avoid blocking under these circumstances.

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 2017-02-26 04:50:36 +0000
3+++ libcore/gof-directory-async.vala 2017-04-03 11:54:37 +0000
4@@ -210,10 +210,8 @@
5 return false;
6 }
7
8- if (is_local) {
9- debug ("Loading info for local directory");
10- return file.ensure_query_info ();
11- }
12+ /* is_network flag fails to detect remote folders mapped to a local uri through fstab, so treat
13+ * all folders as potentially remote (and disconnected) */
14
15 if (!yield try_query_info ()) { /* may already be mounted */
16 debug ("try query info failed - trying to mount");
17
18=== modified file 'src/View/ViewContainer.vala'
19--- src/View/ViewContainer.vala 2017-02-26 04:50:36 +0000
20+++ src/View/ViewContainer.vala 2017-04-03 11:54:37 +0000
21@@ -213,10 +213,11 @@
22 view_mode = mode;
23 overlay_statusbar.showbar = view_mode != Marlin.ViewMode.LIST;
24
25- if (mode == Marlin.ViewMode.MILLER_COLUMNS)
26+ if (mode == Marlin.ViewMode.MILLER_COLUMNS) {
27 this.view = new Miller (loc, this, mode);
28- else
29+ } else {
30 this.view = new Slot (loc, this, mode);
31+ }
32
33 connect_slot_signals (this.view);
34 directory_is_loading (loc);
35
36=== modified file 'src/View/Window.vala'
37--- src/View/Window.vala 2017-03-07 19:24:18 +0000
38+++ src/View/Window.vala 2017-04-03 11:54:37 +0000
39@@ -883,10 +883,11 @@
40
41 public uint restore_tabs () {
42 /* Do not restore tabs more than once */
43- if (tabs_restored || !is_first_window)
44+ if (tabs_restored || !is_first_window) {
45 return 0;
46- else
47+ } else {
48 tabs_restored = true;
49+ }
50
51 GLib.Variant tab_info_array = Preferences.settings.get_value ("tab-info-list");
52 GLib.VariantIter iter = new GLib.VariantIter (tab_info_array);
53@@ -920,8 +921,9 @@
54
55 add_tab (root_location, mode);
56
57- if (mode == Marlin.ViewMode.MILLER_COLUMNS && tip_uri != root_uri)
58+ if (mode == Marlin.ViewMode.MILLER_COLUMNS && tip_uri != root_uri) {
59 expand_miller_view (tip_uri, root_location);
60+ }
61
62 tabs_added++;
63 mode = Marlin.ViewMode.INVALID;
64@@ -952,8 +954,9 @@
65 if (current_tab != null) {
66 path = current_tab.get_tip_uri ();
67
68- if (path == null || path == "")
69+ if (path == null || path == "") {
70 path = current_tab.get_root_uri ();
71+ }
72 }
73
74 /* Render the final path in the location bar without animation */

Subscribers

People subscribed via source and target branches

to all changes: