mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-09 19:32:03 +02:00
Merge pull request #3038
6898d5d
oshelper: always convert to canonical path in openContainingFolder (xiphon)
This commit is contained in:
commit
e65159163d
@ -92,22 +92,23 @@ QString OSHelper::downloadLocation() const
|
||||
|
||||
bool OSHelper::openContainingFolder(const QString &filePath) const
|
||||
{
|
||||
QString canonicalFilePath = QFileInfo(filePath).canonicalFilePath();
|
||||
#if defined(Q_OS_WIN)
|
||||
if (openFolderAndSelectItem(QDir::toNativeSeparators(filePath)))
|
||||
if (openFolderAndSelectItem(QDir::toNativeSeparators(canonicalFilePath)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#elif defined(Q_OS_MAC)
|
||||
if (MacOSHelper::openFolderAndSelectItem(QUrl::fromLocalFile(filePath)))
|
||||
if (MacOSHelper::openFolderAndSelectItem(QUrl::fromLocalFile(canonicalFilePath)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
QUrl url = QUrl::fromLocalFile(QFileInfo(filePath).absolutePath());
|
||||
QUrl url = QUrl::fromLocalFile(canonicalFilePath);
|
||||
if (!url.isValid())
|
||||
{
|
||||
qWarning() << "Malformed file path" << filePath << url.errorString();
|
||||
qWarning() << "Malformed file path" << canonicalFilePath << url.errorString();
|
||||
return false;
|
||||
}
|
||||
return QDesktopServices::openUrl(url);
|
||||
|
Loading…
Reference in New Issue
Block a user