SettingsInfo: open containing folder on wallet log path click

This commit is contained in:
xiphon
2019-12-10 00:42:48 +00:00
parent 46227bdad0
commit ba24fd79bb
3 changed files with 43 additions and 7 deletions

View File

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