summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-11-05 18:58:28 +0800
committerMichele Calgaro <[email protected]>2020-11-05 18:58:43 +0800
commit642bc50e1834a1ed3b49e2a21e8ec38aa7880d20 (patch)
treedc00e774333ab51a5a55d636a6e31f75a11a4644
parent1a97a720e5b84aab02c9dfc8fe0bf504182825af (diff)
downloadtdebase-642bc50e1834a1ed3b49e2a21e8ec38aa7880d20.tar.gz
tdebase-642bc50e1834a1ed3b49e2a21e8ec38aa7880d20.zip
tdeio media slave: added 'Open Real Folder' to tdeio_media_mounthelper.
Signed-off-by: Michele Calgaro <[email protected]>
-rw-r--r--tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp19
-rw-r--r--tdeioslave/media/mounthelper/tdeio_media_mounthelper.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp
index 9d3da6d08..080fe7fa9 100644
--- a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp
+++ b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp
@@ -284,6 +284,19 @@ void MountHelper::safeRemoval(const Medium &medium)
}
}
+void MountHelper::openRealFolder(const Medium &medium)
+{
+ if (!medium.mountPoint().isEmpty())
+ {
+ system((TQString("kfmclient exec file://") + medium.mountPoint()).local8Bit());
+ }
+ else
+ {
+ m_errorStr = i18n("Try to open an unknown medium.");
+ errorAndExit();
+ }
+}
+
MountHelper::MountHelper() : TDEApplication(), m_mediamanager("kded", "mediamanager")
{
TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
@@ -337,6 +350,11 @@ MountHelper::MountHelper() : TDEApplication(), m_mediamanager("kded", "mediamana
eject(device, true);
::exit(0);
}
+ else if (args->isSet("f"))
+ {
+ openRealFolder(medium);
+ ::exit(0);
+ }
else
{
TDECmdLineArgs::usage();
@@ -413,6 +431,7 @@ static TDECmdLineOptions options[] =
{ "l", I18N_NOOP("Lock given URL"), 0 },
{ "e", I18N_NOOP("Eject given URL"), 0},
{ "s", I18N_NOOP("Safely remove (unmount and eject) given URL"), 0},
+ { "f", I18N_NOOP("Open real medium folder"), 0},
{"!+URL", I18N_NOOP("media:/URL to mount/unmount/unlock/lock/eject/remove"), 0 },
TDECmdLineLastOption
};
diff --git a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h
index 59dba6e5a..5bbe594b8 100644
--- a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h
+++ b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.h
@@ -56,6 +56,7 @@ private:
void eject(const TQString &device, bool quiet=false);
void safeRemoval(const Medium &medium);
void releaseHolders(const Medium &medium, bool handleThis = false);
+ void openRealFolder(const Medium &medium);
private slots:
void slotSendPassword();