From c1582f8e04d68d3dddc1d789c0a30ba686afcd70 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sat, 18 May 2019 21:41:18 +0200 Subject: [PATCH] Adapt for latest changes in MUtilities library. --- src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 25 +++++++++---------------- src/Dialog_Processing.cpp | 9 +-------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/Config.h b/src/Config.h index 19cdc370..8daa8d42 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 8 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 2216 +#define VER_LAMEXP_BUILD 2219 #define VER_LAMEXP_CONFG 2188 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 53e5e11b..45056225 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -1759,7 +1759,7 @@ void MainWindow::encodeButtonClicked(void) switch(QMessageBox::warning(this, tr("Low Diskspace Warning"), NOBREAK(lowDiskspaceMsg), tr("Abort Encoding Process"), tr("Clean Disk Now"), tr("Ignore"))) { case 1: - QProcess::startDetached(QString("%1/cleanmgr.exe").arg(MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSTEMFOLDER)), QStringList() << "/D" << tempFolderParts.first()); + QProcess::startDetached(QString("%1/cleanmgr.exe").arg(MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSTEM_DEF)), QStringList() << "/D" << tempFolderParts.first()); case 0: return; break; @@ -2642,17 +2642,10 @@ void MainWindow::findFileContextActionTriggered(void) QModelIndex index = ui->sourceFileView->currentIndex(); if(index.isValid()) { - QString systemRootPath; - - QDir systemRoot(MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSTEMFOLDER)); - if(systemRoot.exists() && systemRoot.cdUp()) - { - systemRootPath = systemRoot.canonicalPath(); - } - - if(!systemRootPath.isEmpty()) + const QString systemToolsPath = MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSROOT); + if(!systemToolsPath.isEmpty()) { - QFileInfo explorer(QString("%1/explorer.exe").arg(systemRootPath)); + QFileInfo explorer(QString("%1/explorer.exe").arg(systemToolsPath)); if(explorer.exists() && explorer.isFile()) { QProcess::execute(explorer.canonicalFilePath(), QStringList() << "/select," << QDir::toNativeSeparators(m_fileListModel->getFile(index).filePath())); @@ -2661,7 +2654,7 @@ void MainWindow::findFileContextActionTriggered(void) } else { - qWarning("SystemRoot directory could not be detected!"); + qWarning("System tools directory could not be detected!"); } } } @@ -2922,7 +2915,7 @@ void MainWindow::gotoDesktopButtonClicked(void) return; } - QString desktopPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); + const QString desktopPath = MUtils::OS::known_folder(MUtils::OS::FOLDER_DESKTOP_USER); if(!desktopPath.isEmpty() && QDir(desktopPath).exists()) { @@ -2947,8 +2940,8 @@ void MainWindow::gotoHomeFolderButtonClicked(void) return; } - QString homePath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); - + const QString homePath = MUtils::OS::known_folder(MUtils::OS::FOLDER_PROFILE_USER); + if(!homePath.isEmpty() && QDir(homePath).exists()) { ui->outputFolderView->setCurrentIndex(m_fileSystemModel->index(homePath)); @@ -2972,7 +2965,7 @@ void MainWindow::gotoMusicFolderButtonClicked(void) return; } - QString musicPath = QDesktopServices::storageLocation(QDesktopServices::MusicLocation); + const QString musicPath = MUtils::OS::known_folder(MUtils::OS::FOLDER_MUSIC_USER); if(!musicPath.isEmpty() && QDir(musicPath).exists()) { diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp index 8d24f964..84a905c8 100644 --- a/src/Dialog_Processing.cpp +++ b/src/Dialog_Processing.cpp @@ -871,14 +871,7 @@ void ProcessingDialog::contextMenuShowFileActionTriggered(void) if(QFileInfo(filePath).exists()) { - QString systemRootPath; - - QDir systemRoot(MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSTEMFOLDER)); - if(systemRoot.exists() && systemRoot.cdUp()) - { - systemRootPath = systemRoot.canonicalPath(); - } - + const QString systemRootPath = MUtils::OS::known_folder(MUtils::OS::FOLDER_SYSROOT); if(!systemRootPath.isEmpty()) { QFileInfo explorer(QString("%1/explorer.exe").arg(systemRootPath)); -- 2.11.4.GIT