+ // dirs could contain URLs that actually point to archives or other files.
+ // Replace them by URLs we can open where possible and filter the rest out.
+ QList<KUrl> urlsToOpen;
+ foreach (const KUrl& rawUrl, dirs) {
+ const KFileItem& item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, rawUrl);
+ item.determineMimeType();
+ const KUrl& url = DolphinView::openItemAsFolderUrl(item);
+ if (!url.isEmpty()) {
+ urlsToOpen.append(url);
+ }
+ }
+
+ if (urlsToOpen.count() == 1) {
+ m_activeViewContainer->setUrl(urlsToOpen.first());