mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-10-04 17:09:25 +00:00
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
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
#include <QSaveFile>
|
||||
#include <QFileInfo>
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
#include <QStandardPaths>
|
||||
|
||||
namespace FS {
|
||||
|
||||
@@ -304,22 +304,6 @@ QString DirNameFromString(QString string, QString inDir)
|
||||
return dirName;
|
||||
}
|
||||
|
||||
void openDirInDefaultProgram(QString path, bool ensureExists)
|
||||
{
|
||||
QDir parentPath;
|
||||
QDir dir(path);
|
||||
if (!dir.exists())
|
||||
{
|
||||
parentPath.mkpath(dir.absolutePath());
|
||||
}
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(dir.absolutePath()));
|
||||
}
|
||||
|
||||
void openFileInDefaultProgram(QString filename)
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(filename));
|
||||
}
|
||||
|
||||
// Does the directory path contain any '!'? If yes, return true, otherwise false.
|
||||
// (This is a problem for Java)
|
||||
bool checkProblemticPathJava(QDir folder)
|
||||
@@ -449,4 +433,4 @@ bool createShortCut(QString location, QString dest, QStringList args, QString na
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user