summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 935b7404..0464ca9a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -402,6 +402,8 @@ void setupPath()
qDebug("MO at: %s", qPrintable(QDir::toNativeSeparators(
QCoreApplication::applicationDirPath())));
+ QCoreApplication::setLibraryPaths(QStringList(QCoreApplication::applicationDirPath() + "/dlls") + QCoreApplication::libraryPaths());
+
boost::scoped_array<TCHAR> oldPath(new TCHAR[BUFSIZE]);
DWORD offset = ::GetEnvironmentVariable(TEXT("PATH"), oldPath.get(), BUFSIZE);
if (offset > BUFSIZE) {
@@ -409,12 +411,10 @@ void setupPath()
::GetEnvironmentVariable(TEXT("PATH"), oldPath.get(), offset);
}
- std::wstring newPath(oldPath.get());
+ std::wstring newPath(ToWString(QDir::toNativeSeparators(
+ QCoreApplication::applicationDirPath())) + L"\\dlls");
newPath += L";";
- newPath += ToWString(QDir::toNativeSeparators(
- QCoreApplication::applicationDirPath()))
- .c_str();
- newPath += L"\\dlls";
+ newPath += oldPath.get();
::SetEnvironmentVariableW(L"PATH", newPath.c_str());
}