diff options
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r-- | src/dolphinview.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 5b0a310..577e546 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -22,6 +22,7 @@ #include <tqlayout.h> #include <kurl.h> +#include <kstandarddirs.h> #include <tdelocale.h> #include <tdeio/netaccess.h> #include <tdeio/renamedlg.h> @@ -691,7 +692,39 @@ void DolphinView::updateURL() return; } - if (fileItem->isDir()) { + if (fileItem->isDir()) + { + TQString itemMimeType = fileItem->mimetype(); + if (itemMimeType.contains("encrypted_locked") || itemMimeType.contains("encrypted_unlocked")) + { + // Default action for media encrypted disks is either lock or unlock based on current status + TQString lockingAction = TQString::null; + if (itemMimeType.contains("encrypted_locked")) + { + lockingAction = "d3lphin/servicemenus/media_unlock.desktop"; + } + else if (itemMimeType.contains("encrypted_unlocked")) + { + lockingAction = "d3lphin/servicemenus/media_lock.desktop"; + } + if (!lockingAction.isEmpty()) + { + TQString lockingService = TDEGlobal::dirs()->findResource("data", lockingAction); + if (!lockingService.isEmpty()) + { + TQValueList<KDEDesktopMimeType::Service> serviceList = KDEDesktopMimeType::userDefinedServices(lockingService, fileItem->url().isLocalFile()); + if (serviceList.count() == 1) + { + KURL::List m_lstURLs; + m_lstURLs.append(fileItem->url()); + KDEDesktopMimeType::executeService(m_lstURLs, serviceList[0]); + Dolphin::mainWin().refreshViews(); + return; + } + } + } + } + // Prefer the local path over the URL. This assures that the // volume space information is correct. Assuming that the URL is media:/sda1, // and the local path is /windows/C: For the URL the space info is related |