Merge branch 'Loetkolben-pr_feature_warnProblematicInstPath' into develop

Closes #400
This commit is contained in:
Jan Dalheimer
2014-07-30 21:45:12 +02:00
7 changed files with 116 additions and 52 deletions

View File

@ -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);

View File

@ -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);
}