summaryrefslogtreecommitdiffstats
path: root/digikam/showfoto/showfoto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'digikam/showfoto/showfoto.cpp')
-rw-r--r--digikam/showfoto/showfoto.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/digikam/showfoto/showfoto.cpp b/digikam/showfoto/showfoto.cpp
index 4f1caf2..0b032e5 100644
--- a/digikam/showfoto/showfoto.cpp
+++ b/digikam/showfoto/showfoto.cpp
@@ -269,7 +269,7 @@ ShowFoto::ShowFoto(const KURL::List& urlList)
if (url.isLocalFile())
{
TQFileInfo fi(url.path());
- if (fi.isDir())
+ if (fi.isDir() || urlList.size() == 1)
{
// Local Dir
openFolder(url);
@@ -820,11 +820,15 @@ void ShowFoto::slotOpenFolder(const KURL& url)
toggleNavigation(1);
}
-void ShowFoto::openFolder(const KURL& url)
+void ShowFoto::openFolder(const KURL& iurl)
{
- if (!url.isValid() || !url.isLocalFile())
+ if (!iurl.isValid() || !iurl.isLocalFile())
return;
+ KURL url = iurl;
+ bool isFile = !TQFileInfo(iurl.path()).isDir();
+ if(isFile) url = TQFileInfo(iurl.path()).dirPath(true);
+
// Parse KDE image IO mime types registration to get files filter pattern.
TQStringList mimeTypes = KImageIO::mimeTypes(KImageIO::Reading);
@@ -909,10 +913,12 @@ void ShowFoto::openFolder(const KURL& url)
TQFileInfo* fi;
// And open all items in image editor.
-
- while( (fi = it.current() ) )
- {
- new Digikam::ThumbBarItem( d->thumbBar, KURL(fi->filePath()) );
+ while( (fi = it.current() ) ) {
+ Digikam::ThumbBarItem *tit = new Digikam::ThumbBarItem( d->thumbBar, KURL(fi->filePath()) );
+ if(isFile && fi->filePath() == iurl.path()) {
+ d->thumbBar->setSelected(tit);
+ d->currentItem = d->thumbBar->currentItem();
+ }
++it;
}
}