summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/urlnavigator.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/urlnavigator.cpp b/src/urlnavigator.cpp
index 47eab75..725c062 100644
--- a/src/urlnavigator.cpp
+++ b/src/urlnavigator.cpp
@@ -22,6 +22,7 @@
#include "urlnavigator.h"
#include <assert.h>
+#include <dcopref.h>
#include <kurl.h>
#include <tqobjectlist.h>
#include <tqcombobox.h>
@@ -39,6 +40,7 @@
#include <kurlcombobox.h>
#include <kurlcompletion.h>
#include <kbookmarkmanager.h>
+#include <kstandarddirs.h>
#include "dolphin.h"
#include "dolphinsettings.h"
@@ -117,7 +119,8 @@ void URLNavigator::setURL(const KURL& url)
{
TQString urlStr(url.prettyURL());
- if (url.protocol() == "zip") {
+ if (url.protocol() == "zip")
+ {
bool stillInside = false;
if( KMimeType::findByPath( url.url(-1) )->is("application/x-zip") ||
KMimeType::findByPath( url.url(-1) )->is("application/x-jar") ) {
@@ -180,6 +183,35 @@ void URLNavigator::setURL(const KURL& url)
urlStr = url.path();
}
}
+ else if (urlStr.startsWith("system:/media") || urlStr.startsWith("media:/"))
+ {
+ DCOPRef mediamanager("kded", "mediamanager");
+ DCOPReply reply = mediamanager.call("mimeType", urlStr );
+ if (reply.isValid())
+ {
+ TQString itemMimeType = reply;
+ if (itemMimeType.contains("encrypted"))
+ {
+ if (itemMimeType.contains("encrypted_locked"))
+ {
+ TQString lockingService = TDEGlobal::dirs()->findResource("data", "d3lphin/servicemenus/media_unlock.desktop");
+ if (!lockingService.isEmpty())
+ {
+ TQValueList<KDEDesktopMimeType::Service> serviceList = KDEDesktopMimeType::userDefinedServices(lockingService, url.isLocalFile());
+ if (serviceList.count() == 1)
+ {
+ KURL::List m_lstURLs;
+ m_lstURLs.append(url);
+ KDEDesktopMimeType::executeService(m_lstURLs, serviceList[0]);
+ }
+ }
+ }
+ setURL(KURL("system:/media"));
+ return;
+ }
+ }
+
+ }
if (urlStr.at(0) == '~') {