From b19a9dc9033da2bb664cdc27b7d93c54929c7d1b Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 21 Apr 2015 18:09:50 -0400 Subject: [PATCH] Remove Win32 SHGetKnownFolderPath; fix windows builds Due to an upstream bug, mingw has issues building with shlobj.h. This work-around fixes #1952 by falling back to a `getenv()` approach. --- src/core/ConfigManager.cpp | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 2dcbc76cb..f7bc52454 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -252,31 +252,6 @@ void ConfigManager::setValue( const QString & _class, -#ifdef LMMS_BUILD_WIN32 -#include -#include - -// taken from qt-win-opensource-src-4.2.2/src/corelib/io/qsettings.cpp -static QString windowsConfigPath( int _type ) -{ - QString result; - - QLibrary library( "shell32" ); - typedef BOOL( WINAPI* GetSpecialFolderPath )( HWND, char *, int, BOOL ); - GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath) - library.resolve( "SHGetSpecialFolderPathA" ); - if( SHGetSpecialFolderPath ) - { - char path[MAX_PATH]; - SHGetSpecialFolderPath( 0, path, _type, false ); - result = QString::fromLocal8Bit( path ); - } - return result; -} -#endif - - - void ConfigManager::loadConfigFile() { // read the XML file and create DOM tree @@ -381,8 +356,8 @@ void ConfigManager::loadConfigFile() !QDir( m_vstDir ).exists() ) { #ifdef LMMS_BUILD_WIN32 - m_vstDir = windowsConfigPath( CSIDL_PROGRAM_FILES ) + - QDir::separator() + "VstPlugins"; + QString programFiles = getenv("ProgramFiles"); + m_vstDir = programFiles + QDir::separator() + "VstPlugins"; #else m_vstDir = m_workingDir + "plugins/vst" + QDir::separator(); #endif