[pkg-cinnamon] Bug#761310: cinnamon-common: The digital photo frame desklet does not recurse into subdirectories

Martín Ferrari tincho at debian.org
Fri Sep 12 19:38:33 UTC 2014


Package: cinnamon-common
Version: 2.2.16-3
Severity: wishlist
Tags: patch

Hi, much to my surprise, the photoframe desklet will not show pictures in
subdirectories, which is a useful feature if you want to have all your pictures
shown.

I made a simple patch, but it is probably not the best way, as it takes quite a while to preload all images, but it is a suggestion.

--- /tmp/desklet.js.orig2	2014-09-12 20:32:48.453444788 +0100
+++ /usr/share/cinnamon/desklets/photoframe at cinnamon.org/desklet.js	2014-09-12 20:27:21.077437008 +0100
@@ -113,7 +113,22 @@
             this.dir_monitor_id = null
         }
     },
-
+    _scan_dir: function(dir) {
+        let dir_file =  Gio.file_new_for_path(dir);
+        let fileEnum = dir_file.enumerate_children('standard::*',
+                Gio.FileQueryInfoFlags.NONE, null);
+        let info;
+        while ((info = fileEnum.next_file(null)) != null) {
+            let fileType = info.get_file_type();
+            let fileName = dir + "/" + info.get_name();
+            if (fileType == Gio.FileType.DIRECTORY) {
+                this._scan_dir(fileName);
+            } else {
+                this._loadImage(fileName);
+            }
+        }
+        fileEnum.close(null);
+    },
     setup_display: function() {
         this._photoFrame = new St.Bin({style_class: 'photoframe-box', x_align: St.Align.START});
 
@@ -142,17 +157,7 @@
         }
 
         if (this.dir_file.query_exists(null)) {
-            let fileEnum = this.dir_file.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null);
-            let info;
-            while ((info = fileEnum.next_file(null)) != null) {
-                let fileType = info.get_file_type();
-                if (fileType != Gio.FileType.DIRECTORY) {
-                    this._loadImage(this.dir + "/" + info.get_name());
-                }
-            }
-
-            fileEnum.close(null);
-            
+            this._scan_dir(this.dir);
             this.updateInProgress = false;
             this.currentPicture = null;
             this._update_loop();


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (100, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cinnamon-common depends on:
ii  dconf-gsettings-backend [gsettings-backend]  0.20.0-2
ii  gir1.2-meta-muffin-0.0                       2.2.6-3
ii  python                                       2.7.8-1
ii  python-pil                                   2.5.3-1

cinnamon-common recommends no packages.

cinnamon-common suggests no packages.

-- no debconf information



More information about the pkg-cinnamon-team mailing list