From c7f660e061f92901b80558c2bfe7640944fc1840 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Thu, 8 Mar 2018 15:55:24 -0600 Subject: Remove outdated namespacing and correct the PATH setting to appends dlls --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') 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 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()); } -- cgit v1.3.1