diff options
author | Michele Calgaro <[email protected]> | 2021-02-28 19:33:45 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2021-02-28 19:37:28 +0900 |
commit | 7d88509cf8dff70a51e881121136ead59f0eb81f (patch) | |
tree | 2b8ffb5f11dfaa0cf479c60a62eac670e95eb975 /konqueror/konq_mainwindow.cpp | |
parent | 58134f528360f046b62730f994b9e259fa87b616 (diff) | |
download | tdebase-7d88509cf8dff70a51e881121136ead59f0eb81f.tar.gz tdebase-7d88509cf8dff70a51e881121136ead59f0eb81f.zip |
konqueror: if requested to navigate to an encrypted disk from the
location bar or CLI, offer the user the ability to unlock the disk
and subsequently navigate to the "media" folder. This replaces the
odd and non-useful behavior of presenting the "open with" dialog on
an encrypted medium.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'konqueror/konq_mainwindow.cpp')
-rw-r--r-- | konqueror/konq_mainwindow.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/konqueror/konq_mainwindow.cpp b/konqueror/konq_mainwindow.cpp index 90dd451af..72a90d8ba 100644 --- a/konqueror/konq_mainwindow.cpp +++ b/konqueror/konq_mainwindow.cpp @@ -717,6 +717,27 @@ bool KonqMainWindow::openView( TQString serviceType, const KURL &_url, KonqView return false; // execute, don't open // Contract: the caller of this method should ensure the view is stopped first. + // If trying to navigate to an encrypted disk, unlock it if necessary and then navigate to system:/media + if (serviceType.contains("encrypted")) + { + if (serviceType.contains("encrypted_locked")) + { + TQString lockingService = TDEGlobal::dirs()->findResource("data", "konqueror/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]); + } + } + } + slotGoMedia(); + return true; + } + #ifndef NDEBUG kdDebug(1202) << "KonqMainWindow::openView " << serviceType << " " << _url << " " << childView << " req:" << req.debug() << endl; #endif |