[Digikam-devel] [Bug 145627] showfoto /path/to/directory doesn't work, while the "open dir" feature exists

Gilles Caulier caulier.gilles at gmail.com
Thu May 24 15:19:05 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=145627         
caulier.gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From caulier.gilles gmail com  2007-05-24 16:19 -------
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();



More information about the Digikam-devel mailing list