| Summary: | showfoto /path/to/directory doesn't work, while the "open dir" feature exists | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Matthieu Moy <Matthieu.Moy> |
| Component: | Showfoto-Directory | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | CC: | caulier.gilles |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Debian stable | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 0.9.2 | |
| Sentry Crash Report: | |||
|
Description
Matthieu Moy
2007-05-18 13:48:30 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();
|