Bug 145627 - showfoto /path/to/directory doesn't work, while the "open dir" feature exists
Summary: showfoto /path/to/directory doesn't work, while the "open dir" feature exists
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Showfoto-Directory (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-18 13:48 UTC by Matthieu Moy
Modified: 2022-02-05 05:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Moy 2007-05-18 13:48:30 UTC
Version:           0.9 (using KDE KDE 3.5.5)
Installed from:    Debian stable Packages

To view all the images in a directory, I can already launch showfoto, and then Menu File -> Open Folder.

Unfortunately, this feature is not available from the command line. I can't do "showfoto /path/to/dir", I have to do "showfoto /path/to/dir/*", and I believe this could be fixed very easily.
Comment 1 caulier.gilles 2007-05-24 16:19:04 UTC
SVN commit 667937 by cgilles:

digiKam from trunk : Showfoto: add support to open folders from command line
BUG: 145627

 M  +1 -1      main.cpp  
 M  +19 -6     showfoto.cpp  
 M  +2 -0      showfoto.h  


--- trunk/extragear/graphics/digikam/showfoto/main.cpp #667936:667937
@@ -43,7 +43,7 @@
 
 static KCmdLineOptions options[] =
 {
-    { "+[file(s)]", I18N_NOOP("File(s) to open"), 0 },
+    { "+[file(s) or folder(s)]", I18N_NOOP("File(s) or folder(s) to open"), 0 },
     KCmdLineLastOption
 };
 
--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #667936:667937
@@ -248,8 +248,18 @@
     for (KURL::List::const_iterator it = urlList.begin();
          it != urlList.end(); ++it)
     {
-        new Digikam::ThumbBarItem(d->thumbBar, *it);
-        d->lastOpenedDirectory=(*it);
+        KURL url = *it;
+        if (url.isLocalFile())
+        {
+            QFileInfo fi(url.path());
+            if (fi.isDir())
+                openFolder(url);                 
+        }
+        else
+        {
+            new Digikam::ThumbBarItem(d->thumbBar, url);
+            d->lastOpenedDirectory=(*it);
+        }
     }
 
     if ( urlList.isEmpty() )
@@ -789,7 +799,13 @@
     d->thumbBar->clear(true);
     emit signalNoCurrentItem();
     d->currentItem = 0;
-    
+    openFolder(url);
+    toggleActions(true);
+    toggleNavigation(1);
+}
+
+void ShowFoto::openFolder(const KURL& url)
+{
     if (!url.isValid() || !url.isLocalFile())
        return;
 
@@ -855,9 +871,6 @@
         new Digikam::ThumbBarItem( d->thumbBar, KURL(fi->filePath()) );
         ++it;
     }
-        
-    toggleActions(true);
-    toggleNavigation(1);
 }
     
 void ShowFoto::slotOpenFilesInFolder()
--- trunk/extragear/graphics/digikam/showfoto/showfoto.h #667936:667937
@@ -90,6 +90,8 @@
 
     void slideShow(bool startWithCurrent, Digikam::SlideShowSettings& settings);
 
+    void openFolder(const KURL& url);
+
 private slots:
 
     void slotForward();