diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-07-30 21:45:12 +0200 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-07-30 21:45:12 +0200 |
commit | 21597da33d610f5c322c4fcd5317426f7dcf8c28 (patch) | |
tree | 9a4a27dfeea890b49e7e17866228dd46b00f7174 /depends | |
parent | 151fbde8d09747001b8d212bee4a1c1154e157a7 (diff) | |
parent | c0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f (diff) | |
download | MultiMC-21597da33d610f5c322c4fcd5317426f7dcf8c28.tar MultiMC-21597da33d610f5c322c4fcd5317426f7dcf8c28.tar.gz MultiMC-21597da33d610f5c322c4fcd5317426f7dcf8c28.tar.lz MultiMC-21597da33d610f5c322c4fcd5317426f7dcf8c28.tar.xz MultiMC-21597da33d610f5c322c4fcd5317426f7dcf8c28.zip |
Merge branch 'Loetkolben-pr_feature_warnProblematicInstPath' into develop
Closes #400
Diffstat (limited to 'depends')
-rw-r--r-- | depends/util/include/pathutils.h | 4 | ||||
-rw-r--r-- | depends/util/src/pathutils.cpp | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/depends/util/include/pathutils.h b/depends/util/include/pathutils.h index 45c2a6de..f5990b85 100644 --- a/depends/util/include/pathutils.h +++ b/depends/util/include/pathutils.h @@ -16,6 +16,7 @@ #pragma once #include <QString> +#include <QDir> #include "libutil_config.h" @@ -57,3 +58,6 @@ LIBUTIL_EXPORT void openFileInDefaultProgram(QString filename); /// Opens the given directory in the default application. LIBUTIL_EXPORT void openDirInDefaultProgram(QString dirpath, bool ensureExists = false); + +/// Checks if the a given Path contains "!" +LIBUTIL_EXPORT bool checkProblemticPathJava(QDir folder); diff --git a/depends/util/src/pathutils.cpp b/depends/util/src/pathutils.cpp index 1d09fe45..ba66898e 100644 --- a/depends/util/src/pathutils.cpp +++ b/depends/util/src/pathutils.cpp @@ -144,3 +144,11 @@ 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) +{ + QString pathfoldername = folder.absolutePath(); + return pathfoldername.contains("!", Qt::CaseInsensitive); +} |