mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Make sure ExtImport override works for meta-filters
This commit is contained in:
parent
db39f6262b
commit
2e4d2f1132
@ -340,11 +340,14 @@ int Importer::Import(wxString fName,
|
|||||||
|
|
||||||
// First, add user-selected filter
|
// First, add user-selected filter
|
||||||
bool usersSelectionOverrides;
|
bool usersSelectionOverrides;
|
||||||
|
// False if override filter is not found
|
||||||
|
bool foundOverride = false;
|
||||||
gPrefs->Read(wxT("/ExtendedImport/OverrideExtendedImportByOpenFileDialogChoice"), &usersSelectionOverrides, false);
|
gPrefs->Read(wxT("/ExtendedImport/OverrideExtendedImportByOpenFileDialogChoice"), &usersSelectionOverrides, false);
|
||||||
wxLogMessage(wxT("LastOpenType is %s"),type.c_str());
|
wxLogMessage(wxT("LastOpenType is %s"),type.c_str());
|
||||||
wxLogMessage(wxT("OverrideExtendedImportByOpenFileDialogChoice is %i"),usersSelectionOverrides);
|
wxLogMessage(wxT("OverrideExtendedImportByOpenFileDialogChoice is %i"),usersSelectionOverrides);
|
||||||
if (usersSelectionOverrides)
|
if (usersSelectionOverrides)
|
||||||
{
|
{
|
||||||
|
|
||||||
importPluginNode = mImportPluginList->GetFirst();
|
importPluginNode = mImportPluginList->GetFirst();
|
||||||
while(importPluginNode)
|
while(importPluginNode)
|
||||||
{
|
{
|
||||||
@ -354,6 +357,7 @@ int Importer::Import(wxString fName,
|
|||||||
// This plugin corresponds to user-selected filter, try it first.
|
// This plugin corresponds to user-selected filter, try it first.
|
||||||
wxLogMessage(wxT("Inserting %s"),plugin->GetPluginStringID().c_str());
|
wxLogMessage(wxT("Inserting %s"),plugin->GetPluginStringID().c_str());
|
||||||
importPlugins.Insert(plugin);
|
importPlugins.Insert(plugin);
|
||||||
|
foundOverride = true;
|
||||||
}
|
}
|
||||||
importPluginNode = importPluginNode->GetNext();
|
importPluginNode = importPluginNode->GetNext();
|
||||||
}
|
}
|
||||||
@ -411,9 +415,10 @@ int Importer::Import(wxString fName,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!foundItem)
|
if (!foundItem || (usersSelectionOverrides && !foundOverride))
|
||||||
{
|
{
|
||||||
bool prioritizeMp3 = false;
|
bool prioritizeMp3 = false;
|
||||||
|
importPlugins.Clear();
|
||||||
wxLogMessage(wxT("Applying default rule"));
|
wxLogMessage(wxT("Applying default rule"));
|
||||||
// Special treatment for mp3 files
|
// Special treatment for mp3 files
|
||||||
if (wxMatchWild (wxT("*.mp3"),fName.Lower(), false))
|
if (wxMatchWild (wxT("*.mp3"),fName.Lower(), false))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user