From 7ddca851d1b18bbc64b7d1ee15078b0daa8501c9 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Thu, 26 Jul 2018 14:16:15 +0200 Subject: [PATCH] VstPlugin: Fix detecting machine type with relative paths --- plugins/vst_base/VstPlugin.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/plugins/vst_base/VstPlugin.cpp b/plugins/vst_base/VstPlugin.cpp index 9b2bdc88d..72bad8d60 100644 --- a/plugins/vst_base/VstPlugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -125,11 +125,16 @@ VstPlugin::VstPlugin( const QString & _plugin ) : m_version( 0 ), m_currentProgram() { + if( QDir::isRelativePath( m_plugin ) ) + { + m_plugin = ConfigManager::inst()->vstDir() + m_plugin; + } + setSplittedChannels( true ); PE::MachineType machineType; try { - PE::FileInfo peInfo(_plugin); + PE::FileInfo peInfo(m_plugin); machineType = peInfo.machineType(); } catch (std::runtime_error& e) { qCritical() << "Error while determining PE file's machine type: " << e.what(); @@ -197,16 +202,7 @@ void VstPlugin::tryLoad( const QString &remoteVstPluginExecutable ) default: break; } sendMessage( message( IdVstSetLanguage ).addInt( hlang ) ); - - - QString p = m_plugin; - if( QFileInfo( p ).dir().isRelative() ) - { - p = ConfigManager::inst()->vstDir() + p; - } - - - sendMessage( message( IdVstLoadPlugin ).addString( QSTR_TO_STDSTR( p ) ) ); + sendMessage( message( IdVstLoadPlugin ).addString( QSTR_TO_STDSTR( m_plugin ) ) ); waitForInitDone();