diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-01-05 07:32:52 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-01-05 07:32:52 +0100 |
commit | 4d0caf6254fdb18f4626a3c7937e64422b40d40c (patch) | |
tree | 76b037c8f6b6c73f8438b85e8e05a2f59da89c17 /application/pages | |
parent | d1e344f28f643c9fb0318feea0259be8ac72c8f7 (diff) | |
download | MultiMC-4d0caf6254fdb18f4626a3c7937e64422b40d40c.tar MultiMC-4d0caf6254fdb18f4626a3c7937e64422b40d40c.tar.gz MultiMC-4d0caf6254fdb18f4626a3c7937e64422b40d40c.tar.lz MultiMC-4d0caf6254fdb18f4626a3c7937e64422b40d40c.tar.xz MultiMC-4d0caf6254fdb18f4626a3c7937e64422b40d40c.zip |
GH-1389 wrap QDesktopServices and QProcess::startDetached
Essentially do not pass some environment variables to subprocesses:
* LD_PRELOAD
* LD_LIBRARY_PATH
* LD_DEBUG
* QT_PLUGIN_PATH
* QT_FONTPATH
Diffstat (limited to 'application/pages')
-rw-r--r-- | application/pages/LegacyJarModPage.cpp | 4 | ||||
-rw-r--r-- | application/pages/ModFolderPage.cpp | 5 | ||||
-rw-r--r-- | application/pages/ScreenshotsPage.cpp | 8 | ||||
-rw-r--r-- | application/pages/WorldListPage.cpp | 7 |
4 files changed, 12 insertions, 12 deletions
diff --git a/application/pages/LegacyJarModPage.cpp b/application/pages/LegacyJarModPage.cpp index 2ff6b6de..b329ba70 100644 --- a/application/pages/LegacyJarModPage.cpp +++ b/application/pages/LegacyJarModPage.cpp @@ -25,7 +25,7 @@ #include "minecraft/ModList.h" #include "minecraft/LegacyInstance.h" #include "Env.h" -#include <FileSystem.h> +#include <DesktopServices.h> #include "MultiMC.h" #include <GuiUtil.h> @@ -146,7 +146,7 @@ void LegacyJarModPage::on_rmJarBtn_clicked() void LegacyJarModPage::on_viewJarBtn_clicked() { - FS::openDirInDefaultProgram(m_inst->jarModsDir(), true); + DesktopServices::openDirectory(m_inst->jarModsDir(), true); } void LegacyJarModPage::jarCurrent(QModelIndex current, QModelIndex previous) diff --git a/application/pages/ModFolderPage.cpp b/application/pages/ModFolderPage.cpp index 6791a59e..3c68b23f 100644 --- a/application/pages/ModFolderPage.cpp +++ b/application/pages/ModFolderPage.cpp @@ -19,7 +19,6 @@ #include <QMessageBox> #include <QEvent> #include <QKeyEvent> -#include <QDesktopServices> #include <QAbstractItemModel> #include "MultiMC.h" @@ -29,7 +28,7 @@ #include "minecraft/ModList.h" #include "minecraft/Mod.h" #include "minecraft/VersionFilterData.h" -#include <FileSystem.h> +#include <DesktopServices.h> ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr<ModList> mods, QString id, QString iconName, QString displayName, QString helpPage, @@ -162,7 +161,7 @@ void ModFolderPage::on_rmModBtn_clicked() void ModFolderPage::on_viewModBtn_clicked() { - FS::openDirInDefaultProgram(m_mods->dir().absolutePath(), true); + DesktopServices::openDirectory(m_mods->dir().absolutePath(), true); } void ModFolderPage::modCurrent(const QModelIndex ¤t, const QModelIndex &previous) diff --git a/application/pages/ScreenshotsPage.cpp b/application/pages/ScreenshotsPage.cpp index 2b2fe31f..5b406f3d 100644 --- a/application/pages/ScreenshotsPage.cpp +++ b/application/pages/ScreenshotsPage.cpp @@ -12,7 +12,6 @@ #include <QEvent> #include <QPainter> #include <QClipboard> -#include <QDesktopServices> #include <QKeyEvent> #include <MultiMC.h> @@ -26,6 +25,7 @@ #include "RWStorage.h" #include <FileSystem.h> +#include <DesktopServices.h> typedef RWStorage<QString, QIcon> SharedIconCache; typedef std::shared_ptr<SharedIconCache> SharedIconCachePtr; @@ -271,12 +271,12 @@ void ScreenshotsPage::onItemActivated(QModelIndex index) return; auto info = m_model->fileInfo(index); QString fileName = info.absoluteFilePath(); - FS::openFileInDefaultProgram(info.absoluteFilePath()); + DesktopServices::openFile(info.absoluteFilePath()); } void ScreenshotsPage::on_viewFolderBtn_clicked() { - FS::openDirInDefaultProgram(m_folder, true); + DesktopServices::openDirectory(m_folder, true); } void ScreenshotsPage::on_uploadBtn_clicked() @@ -312,7 +312,7 @@ void ScreenshotsPage::on_uploadBtn_clicked() auto link = QString("https://imgur.com/a/%1").arg(imgurAlbum->id()); QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(link); - QDesktopServices::openUrl(link); + DesktopServices::openUrl(link); CustomMessageBox::selectable( this, tr("Upload finished"), tr("The <a href=\"%1\">link to the uploaded album</a> has been opened in the " diff --git a/application/pages/WorldListPage.cpp b/application/pages/WorldListPage.cpp index 4e7eeedc..befb6b5e 100644 --- a/application/pages/WorldListPage.cpp +++ b/application/pages/WorldListPage.cpp @@ -16,7 +16,7 @@ #include "WorldListPage.h" #include "ui_WorldListPage.h" #include "minecraft/WorldList.h" -#include <FileSystem.h> +#include <DesktopServices.h> #include "dialogs/ModEditDialogCommon.h" #include <QEvent> #include <QKeyEvent> @@ -123,7 +123,7 @@ void WorldListPage::on_rmWorldBtn_clicked() void WorldListPage::on_viewFolderBtn_clicked() { - FS::openDirInDefaultProgram(m_worlds->dir().absolutePath(), true); + DesktopServices::openDirectory(m_worlds->dir().absolutePath(), true); } QModelIndex WorldListPage::getSelectedWorld() @@ -193,7 +193,8 @@ void WorldListPage::on_mcEditBtn_clicked() if(program.size()) { qint64 pid = 0; - QProcess::startDetached(program, QStringList() << fullPath, mceditPath, &pid); + + DesktopServices::openFile(program, fullPath, mceditPath, &pid); if(pid == 0) { QMessageBox::warning(this->parentWidget(), tr("MCEdit failed to start!"), tr("MCEdit failed to start.\nIt may be necessary to reinstall it.")); |