Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

samba bookmarks a not displayed in places manu #1287

Closed
daschuer opened this Issue · 3 comments

2 participants

@daschuer

The attached patch solves the problem.

@daschuer
--- placesManager.js
+++ placesManager.js
@@ -290,21 +290,36 @@
             let bookmark = bookmarksOrder[i];
             let label = bookmarksToLabel[bookmark];
             let file = Gio.file_new_for_uri(bookmark);
-            if (!file.query_exists(null))
-                continue;
             if (label == null)
                 label = Cinnamon.util_get_label_for_uri(bookmark);
             if (label == null)
                 continue;
-            let icon = Cinnamon.util_get_icon_for_uri(bookmark);
-
-            let item = new PlaceInfo('bookmark:' + bookmark, label,
-                function(size) {
-                    return St.TextureCache.get_default().load_gicon(null, icon, size);
-                },
-                function(params) {
-                    Gio.app_info_launch_default_for_uri(bookmark, _makeLaunchContext(params));
-                });
+            
+            let item; 
+            if (file.query_exists(null)) {
+                let icon = Cinnamon.util_get_icon_for_uri(bookmark);
+                item = new PlaceInfo('bookmark:' + bookmark, label,
+                        function(size) {
+                            return St.TextureCache.get_default().load_gicon(null, icon, size);
+                        },
+                        function(params) {
+                            Gio.app_info_launch_default_for_uri(bookmark, _makeLaunchContext(params));
+                        });
+            } else {
+                // Asume the bookmark is an unmounted network location
+                // try to mount and open by the default file manager 
+                let icon = Gio.ThemedIcon.new('gnome-fs-network');          
+                item = new PlaceInfo('bookmark:' + bookmark, label,
+                        function(size) {
+                            return St.TextureCache.get_default().load_gicon(null, icon, size);
+                        },
+                        function(params) {
+                            let fileapp = Gio.app_info_get_default_for_uri_scheme('file');
+                            if (fileapp) {    
+                                fileapp.launch_uris([bookmark], _makeLaunchContext(params));
+                            }
+                        });
+            }                  
             this._bookmarks.push(item);
         }
@AlbertJP
Collaborator

Please do a pull request if you want to submit a patch. You can for example press the "Edit" button at a source file here on GitHub, then it's automatically committed and a pull request can be made.

@daschuer daschuer referenced this issue from a commit in daschuer/Cinnamon
@daschuer daschuer Update js/ui/placesManager.js
Made samba bookmarks visible in places menu, fixes issue #1287
df6e198
@AlbertJP
Collaborator

That's ok. I'll close this issue.

@AlbertJP AlbertJP closed this
@autarkper autarkper referenced this issue from a commit in autarkper/Cinnamon
@daschuer daschuer Update js/ui/placesManager.js
Made samba bookmarks visible in places menu, fixes issue #1287
6583f6a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.