Fix Qt4 compatibility

This commit is contained in:
Hyunin Song
2017-11-06 22:48:22 +09:00
parent 358a251cff
commit df3c07bbed
2 changed files with 15 additions and 0 deletions

View File

@@ -128,10 +128,21 @@ void VstEffect::openPlugin( const QString & _plugin )
PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 );
QMutexLocker ml( &m_pluginMutex ); Q_UNUSED( ml );
#if QT_VERSION > 0x050000
m_plugin.reset(new VstPlugin( _plugin ));
#else
{
QSharedPointer<VstPlugin> newPlugin(new VstPlugin( _plugin ));
std::swap(m_plugin, newPlugin);
}
#endif
if( m_plugin->failed() )
{
#if QT_VERSION > 0x050000
m_plugin.reset(nullptr);
#else
m_plugin.clear();
#endif
delete tf;
collectErrorForUI( VstPlugin::tr( "The VST plugin %1 could not be loaded." ).arg( _plugin ) );
return;

View File

@@ -1077,7 +1077,11 @@ void SetupDialog::accept()
QString::number( m_disableAutoQuit ) );
ConfigManager::inst()->setValue( "app", "language", m_lang );
ConfigManager::inst()->setValue( "ui", "vstembedmethod",
#if QT_VERSION >= 0x050000
m_vstEmbedComboBox->currentData().toString() );
#else
m_vstEmbedComboBox->itemData(m_vstEmbedComboBox->currentIndex()).toString() );
#endif
ConfigManager::inst()->setWorkingDir(QDir::fromNativeSeparators(m_workingDir));