diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-09-15 14:30:27 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-10-17 10:48:31 +0800 |
commit | b75b318e1422ca73280b79b297b93e98c31d1a2a (patch) | |
tree | 0bc8ca81497265701634f4b5256bb95daf8f188b /konqueror | |
parent | 8f12bba779b41d43243bed43a0878dcac85fff44 (diff) | |
download | tdebase-b75b318e1422ca73280b79b297b93e98c31d1a2a.tar.gz tdebase-b75b318e1422ca73280b79b297b93e98c31d1a2a.zip |
konqueror & kdesktop: default action for a media encrypted disk is
either lock or unlock based on the current locking status.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'konqueror')
-rw-r--r-- | konqueror/konq_mainwindow.cc | 23 |
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() ) { |