summaryrefslogtreecommitdiffstats
path: root/konqueror
diff options
context:
space:
mode:
Diffstat (limited to 'konqueror')
-rw-r--r--konqueror/konq_mainwindow.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/konqueror/konq_mainwindow.cc b/konqueror/konq_mainwindow.cc
index 4ae1f63c1..ebd9ab8df 100644
--- a/konqueror/konq_mainwindow.cc
+++ b/konqueror/konq_mainwindow.cc
@@ -476,11 +476,9 @@ void KonqMainWindow::openURL( KonqView *_view, const KURL &_url,
const TQString &_serviceType, KonqOpenURLRequest& req,
bool trustedSource )
{
-#ifndef NDEBUG // needed for req.debug()
kdDebug(1202) << "KonqMainWindow::openURL : url = '" << _url << "' "
<< "serviceType='" << _serviceType << "' req=" << req.debug()
<< " view=" << _view << endl;
-#endif
KURL url( _url );
if (url.url().startsWith("$(")) {
@@ -543,6 +541,27 @@ void KonqMainWindow::openURL( KonqView *_view, const KURL &_url,
return;
}
+ // Default action for media encrypted disks is either lock or unlock based on current status
+ TQString lockingAction = TQString::null;
+ if (serviceType.contains("encrypted_locked")) {
+ lockingAction = "konqueror/servicemenus/media_unlock.desktop";
+ }
+ else if (serviceType.contains("encrypted_unlocked")) {
+ lockingAction = "konqueror/servicemenus/media_lock.desktop";
+ }
+ if (!lockingAction.isEmpty()) {
+ TQString lockingService = TDEGlobal::dirs()->findResource("data", lockingAction);
+ 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]);
+ return;
+ }
+ }
+ }
+
TQString nameFilter = detectNameFilter( url );
if ( !nameFilter.isEmpty() )
{