diff options
| author | xiphon <xiphon@protonmail.com> | 2019-12-10 00:42:48 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2019-12-12 00:10:22 +0000 |
| commit | ba24fd79bb50ff82f0fd94a5c0bd06f2130f3bd7 (patch) | |
| tree | 5c400e055ae67c94df1a81d53338665514d35ad7 /src/main/oshelper.cpp | |
| parent | 46227bdad08e191d54e49813ee2f4c0e3c226f95 (diff) | |
| download | monzero-gui-ba24fd79bb50ff82f0fd94a5c0bd06f2130f3bd7.tar.gz monzero-gui-ba24fd79bb50ff82f0fd94a5c0bd06f2130f3bd7.tar.xz monzero-gui-ba24fd79bb50ff82f0fd94a5c0bd06f2130f3bd7.zip | |
SettingsInfo: open containing folder on wallet log path click
Diffstat (limited to 'src/main/oshelper.cpp')
| -rw-r--r-- | src/main/oshelper.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/oshelper.cpp b/src/main/oshelper.cpp index c1326c0f..313fd233 100644 --- a/src/main/oshelper.cpp +++ b/src/main/oshelper.cpp @@ -30,7 +30,10 @@ #include <QTemporaryFile> #include <QDir> #include <QDebug> +#include <QDesktopServices> +#include <QFileInfo> #include <QString> +#include <QUrl> #ifdef Q_OS_MAC #include "qt/macoshelper.h" #endif @@ -51,6 +54,19 @@ OSHelper::OSHelper(QObject *parent) : QObject(parent) } +bool OSHelper::openContainingFolder(const QString &filePath) const +{ + QUrl prepared; + prepared.setScheme("file"); + prepared.setPath(QFileInfo(filePath).absolutePath()); + if (!prepared.isValid()) + { + qWarning() << "malformed file path" << filePath << prepared.errorString(); + return false; + } + return QDesktopServices::openUrl(prepared); +} + QString OSHelper::temporaryFilename() const { QString tempFileName; |
