23 #include "apprunner.h" 25 #include "gui/standardserverconsole.h" 27 #include "serverapi/message.h" 28 #include "strings.hpp" 38 QStringList::iterator it;
39 for (it = args.begin(); it != args.end(); ++it)
41 if (it->contains(
" "))
42 Strings::trim(*it,
"\"");
47 QString AppRunner::findBundleBinary(
const QFileInfo &file)
52 QFile pLists(file.canonicalFilePath() +
"/Contents/Info.plist");
53 if (!pLists.open(QIODevice::ReadOnly | QIODevice::Text))
55 gLog << tr(
"Could not read bundle plist. (%1)").arg(file.canonicalFilePath() +
"/Contents/Info.plist");
60 bool keyFound =
false;
61 while (pLists.readLine(line, 128) != -1)
65 if (QString(line).trimmed() ==
"<key>CFBundleExecutable</key>")
70 QString binaryLine(line);
71 binaryLine = binaryLine.trimmed();
72 if (binaryLine.startsWith(
"<string>") && binaryLine.endsWith(
"</string>"))
73 return QString(
"/Contents/MacOS/") + binaryLine.mid(8, binaryLine.indexOf(
"</string>") - 8);
83 gLog << tr(
"Starting (working dir %1): %2").arg(cmdInfo.
applicationDir.absolutePath()).arg(cmdInfo.
executable.absoluteFilePath());
102 QString error = tr(
"File: %1\ncannot be run").arg(cmdInfo.
executable.absoluteFilePath());
114 gLog << tr(
"Starting (working dir %1): %2").arg(cli.
applicationDir.absolutePath())
117 cleanArguments(args);
Structure holding parameters for application launch.
Message object used to pass messages throughout the Doomseeker's system.
QStringList args
launch parameters
static void runExecutableWrappedInStandardServerConsole(const QIcon &icon, const CommandLineInfo &cli)
Executes predefined command line.
static void cleanArguments(QStringList &args)
On Windows this removes any wrapping " chars.
QDir applicationDir
working directory
QFileInfo executable
path to the executable
static Message customError(const QString &content)
Convenience method. Sets type to Type::CUSTOM_ERROR.
bool isValid() const
It's valid when at least executable is set.