Browse Source

Encrypted disks will be locked/unlocked (based on their status) when

executed from the storage media location. This mirrors the functionality
previously added in Konqueror.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
master
Michele Calgaro 1 month ago
parent
commit
306e44e43e
Signed by: MicheleC GPG Key ID: 2A75B7CA8ADED5CF
1 changed files with 34 additions and 1 deletions
  1. +34
    -1
      src/dolphinview.cpp

+ 34
- 1
src/dolphinview.cpp View File

@ -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


Loading…
Cancel
Save