summaryrefslogtreecommitdiffstats
path: root/depends
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-07-30 21:45:12 +0200
committerJan Dalheimer <jan@dalheimer.de>2014-07-30 21:45:12 +0200
commit21597da33d610f5c322c4fcd5317426f7dcf8c28 (patch)
tree9a4a27dfeea890b49e7e17866228dd46b00f7174 /depends
parent151fbde8d09747001b8d212bee4a1c1154e157a7 (diff)
parentc0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f (diff)
downloadMultiMC-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.h4
-rw-r--r--depends/util/src/pathutils.cpp8
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);
+}