///////////////////////////////////////////////////////////////////////////////
// Simple x264 Launcher
-// Copyright (C) 2004-2018 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
//MUtils
#include <MUtils/Global.h>
+#include <MUtils/OSSupport.h>
#include <MUtils/Exception.h>
//Qt
checkSourceProperties_init(patterns, cmdLine);
log("Creating process:");
- if(!startProcess(process, getBinaryPath(), cmdLine, true, &getExtraPaths()))
+ if(!startProcess(process, getBinaryPath(), cmdLine, true, &getExtraPaths(), &getExtraEnv()))
{
return false;;
}
buildCommandLine(cmdLine_Input);
log("Creating input process:");
- if(!startProcess(processInput, getBinaryPath(), cmdLine_Input, false, &getExtraPaths()))
+ if(!startProcess(processInput, getBinaryPath(), cmdLine_Input, false, &getExtraPaths(), &getExtraEnv()))
{
return false;
}
{
MUTILS_THROW("[getSourceInfo] This function must be overwritten in sub-classes!");
}
+
+// ------------------------------------------------------------
+// Auxiliary FUnctions
+// ------------------------------------------------------------
+
+QHash<QString, QString> AbstractSource::getExtraEnv(void) const
+{
+ QHash<QString, QString> extraEnv;
+
+ const QString profilePath = MUtils::OS::known_folder(MUtils::OS::FOLDER_PROFILE_USER);
+ if (!profilePath.isEmpty())
+ {
+ extraEnv.insert("USERPROFILE", QDir::toNativeSeparators(profilePath));
+ }
+
+ const QString appDataPath = MUtils::OS::known_folder(MUtils::OS::FOLDER_APPDATA_ROAM);
+ if (!appDataPath.isEmpty())
+ {
+ extraEnv.insert("APPDATA", QDir::toNativeSeparators(appDataPath));
+ }
+
+ return extraEnv;
+}
\ No newline at end of file