+ return true;
+}
+
+
+/// \brief Calls the /bin/sh shell with the specified command and appends the result to a string variable.
+///
+/// \param[in] command command to execute with <code>/bin/sh -c "command"</code>
+/// \param[out] result The result string where the output is appended at.
+/// \param[out] error error message in error cases
+/// \returns true in case of success.
+bool executeShellCommand(const QString& command, QString& result, QString& errorMsg) {
+ QProcess evalUrl(0);
+ QString cmd = "/bin/sh -c \"" + command + "\"";
+ evalUrl.start(cmd);
+ if (evalUrl.waitForFinished(3000)) {
+ QByteArray newResult = evalUrl.readAllStandardOutput();
+ if (result != newResult) {result += newResult.trimmed();}
+ return true;
+ }
+ errorMsg = QObject::tr("Shell command executed when substituting URL (%1) timed out.").arg(command);
+ return false;
+}
+
+
+/// \brief Evaluates the staticUrl
+///
+/// - Variables of the form ${var} are substituted according the the function ::substituteVars
+/// - If the staticUrl is enclosed by backticks it is evaluated by a shell command (after the substitution mentioned above)
+///
+/// \param[in] staticUrl string where the substitution should be done.
+/// \param[in] date date that should be used when replacing the date dependend variables
+/// \param[out] result The result string is appended here
+/// \param[out] error error message in error cases
+/// \returns true in case of success.
+bool evaluateStaticUrl(const QString& staticUrl, QDate date, QString& result, QString& errorMsg) {
+ QString subst;
+ bool success = substituteVars(staticUrl, date, subst, errorMsg);
+ if (!success) return false;