From 65482fb2e8cf769135095a82002459f91313da6e Mon Sep 17 00:00:00 2001 From: lordmulder Date: Wed, 8 Dec 2010 18:29:31 +0100 Subject: [PATCH] Fix a problem that will cause our CLI tools from working, introduced in Git-40b03002848cad7a745dc445e846c77cb451d89b. --- src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 2 ++ src/Global.cpp | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Config.h b/src/Config.h index 2d0cefda..958e0575 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 132 +#define VER_LAMEXP_BUILD 134 #define VER_LAMEXP_SUFFIX TechPreview /* diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 9cecca05..a4a560e4 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -530,6 +530,8 @@ void MainWindow::windowShown(void) QString messageText; messageText += "The Nero AAC encoder could not be found. AAC encoding support will be disabled.
"; messageText += "Please put 'neroAacEnc.exe', 'neroAacDec.exe' and 'neroAacTag.exe' into the LameXP directory!

"; + messageText += "Your LameXP directory is as follows:
"; + messageText += "
" + QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "

"; messageText += "You can download the Nero AAC encoder for free from the official Nero website at:
"; messageText += "" + LINK(AboutDialog::neroAacUrl) + "
"; QMessageBox::information(this, "AAC Support Disabled", messageText); diff --git a/src/Global.cpp b/src/Global.cpp index 563407ac..01d20c9c 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -608,7 +608,9 @@ QString lamexp_rand_str(void) */ const QString &lamexp_temp_folder(void) { + const GUID LocalAppDataID={0xF1B32785,0x6FBA,0x4FCF,{0x9D,0x55,0x7B,0x8E,0x7F,0x15,0x70,0x91}}; const GUID LocalAppDataLowID={0xA520A1A4,0x1780,0x4FF6,{0xBD,0x18,0x16,0x73,0x43,0xC5,0xAF,0x16}}; + typedef HANDLE (WINAPI *SHGetKnownFolderPathFun)(__in const GUID &rfid, __in DWORD dwFlags, __in HANDLE hToken, __out PWSTR *ppszPath); if(g_lamexp_temp_folder.isEmpty()) @@ -620,22 +622,23 @@ const QString &lamexp_temp_folder(void) if(SHGetKnownFolderPathPtr) { - WCHAR *localAppDataLowPath = NULL; - if(SHGetKnownFolderPathPtr(LocalAppDataLowID, 0x00008000, NULL, &localAppDataLowPath) == S_OK) + WCHAR *localAppDataPath = NULL; + if(SHGetKnownFolderPathPtr(LocalAppDataID, 0x00008000, NULL, &localAppDataPath) == S_OK) { - QDir localAppDataLow = QDir(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast(localAppDataLowPath)))); - if(localAppDataLow.exists()) + MessageBoxW(NULL, localAppDataPath, L"LocalAppData", MB_TOPMOST); + QDir localAppData = QDir(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast(localAppDataPath)))); + if(localAppData.exists()) { - if(!localAppDataLow.entryList(QDir::AllDirs).contains("Temp")) + if(!localAppData.entryList(QDir::AllDirs).contains("Temp")) { - localAppDataLow.mkdir("Temp"); + localAppData.mkdir("Temp"); } - if(localAppDataLow.cd("Temp")) + if(localAppData.cd("Temp")) { - temp.setPath(localAppDataLow.canonicalPath()); + temp.setPath(localAppData.canonicalPath()); } } - CoTaskMemFree(localAppDataLowPath); + CoTaskMemFree(localAppDataPath); } }