From 07f96d132e43e4000d4777880bacd61e28afa916 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 22 Nov 2008 19:33:53 +0000 Subject: [PATCH] do not allow to import unhandled file types, e.g. ZynAddSubFX presets if plugin is not available (closes #2326384) (stable backport) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@1844 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ src/gui/file_browser.cpp | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b01ea12f0..b5beea6f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-22 Tobias Doerffel + + * src/gui/file_browser.cpp: + do not allow to import unhandled file types, e.g. ZynAddSubFX presets if + plugin is not available (closes #2326384) + 2008-11-21 Tobias Doerffel * plugins/flp_import/flp_import.h: diff --git a/src/gui/file_browser.cpp b/src/gui/file_browser.cpp index 6175bb1e9..531466005 100644 --- a/src/gui/file_browser.cpp +++ b/src/gui/file_browser.cpp @@ -613,7 +613,7 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item, { handleFile( f, NULL ); } - else + else if( f->handling() != fileItem::NotSupported ) { engine::getMixer()->lock(); instrumentTrack * it = dynamic_cast( @@ -964,11 +964,16 @@ void fileItem::determineFileType( void ) m_type = ProjectFile; m_handling = LoadAsProject; } - else if( ext == "xpf" || ext == "xml" || ext == "xiz" ) + else if( ext == "xpf" || ext == "xml" ) { m_type = PresetFile; m_handling = LoadAsPreset; } + else if( ext == "xiz" && engine::pluginFileHandling().contains( ext ) ) + { + m_type = PresetFile; + m_handling = LoadByPlugin; + } else if( ext == "sf2" ) { m_type = SoundFontFile;