Commit 1cf5c38a authored by Mike Kremer's avatar Mike Kremer
Browse files

Fixed issue with lacking file open dialogs in case the file extension consists of capitals.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11764 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0382c011
...@@ -65,7 +65,7 @@ FileOptionsDialog::FileOptionsDialog(std::vector<fileTypes>& _supportedTypes, QS ...@@ -65,7 +65,7 @@ FileOptionsDialog::FileOptionsDialog(std::vector<fileTypes>& _supportedTypes, QS
int count = 0; int count = 0;
QStringList names; QStringList names;
for (uint t=0; t < supportedTypes_.size(); t++){ for (unsigned int t=0; t < supportedTypes_.size(); t++){
QString filters; QString filters;
...@@ -73,8 +73,8 @@ FileOptionsDialog::FileOptionsDialog(std::vector<fileTypes>& _supportedTypes, QS ...@@ -73,8 +73,8 @@ FileOptionsDialog::FileOptionsDialog(std::vector<fileTypes>& _supportedTypes, QS
filters = supportedTypes_[t].loadFilters; filters = supportedTypes_[t].loadFilters;
else else
filters = supportedTypes_[t].saveFilters; filters = supportedTypes_[t].saveFilters;
if (filters.contains(ext_[i])){ if (filters.contains("." + ext_[i],Qt::CaseInsensitive)){
count++; count++;
names.push_back( supportedTypes_[t].name ); names.push_back( supportedTypes_[t].name );
usefulPlugins.push_back( t ); usefulPlugins.push_back( t );
...@@ -115,7 +115,7 @@ FileOptionsDialog::FileOptionsDialog(std::vector<fileTypes>& _supportedTypes, QS ...@@ -115,7 +115,7 @@ FileOptionsDialog::FileOptionsDialog(std::vector<fileTypes>& _supportedTypes, QS
//add option widgets from all fileplugins //add option widgets from all fileplugins
for (uint t=0; t < supportedTypes_.size(); t++){ for (unsigned int t=0; t < supportedTypes_.size(); t++){
if ( !usefulPlugins.contains(t) ) if ( !usefulPlugins.contains(t) )
continue; continue;
...@@ -160,7 +160,7 @@ FileOptionsDialog::~FileOptionsDialog() ...@@ -160,7 +160,7 @@ FileOptionsDialog::~FileOptionsDialog()
tabs_.removeTab(i); tabs_.removeTab(i);
//and set parent of widgets to NULL //and set parent of widgets to NULL
for (uint t=0; t < supportedTypes_.size(); t++){ for (unsigned int t=0; t < supportedTypes_.size(); t++){
QWidget* widget; QWidget* widget;
...@@ -186,7 +186,7 @@ void FileOptionsDialog::slotPluginChanged(QString _name){ ...@@ -186,7 +186,7 @@ void FileOptionsDialog::slotPluginChanged(QString _name){
QComboBox* box = dynamic_cast<QComboBox*>(QObject::sender()); QComboBox* box = dynamic_cast<QComboBox*>(QObject::sender());
for (uint t=0; t < supportedTypes_.size(); t++) for (unsigned int t=0; t < supportedTypes_.size(); t++)
if ( supportedTypes_[t].name == _name ){ if ( supportedTypes_[t].name == _name ){
emit setPluginForExtension(box->accessibleName(), t ); //accessibleName contains the extension emit setPluginForExtension(box->accessibleName(), t ); //accessibleName contains the extension
break; break;
......
...@@ -210,10 +210,11 @@ void LoadWidget::loadFile(){ ...@@ -210,10 +210,11 @@ void LoadWidget::loadFile(){
pluginForExtension_.clear(); pluginForExtension_.clear();
for (int i=0; i < ext.size(); i++){ for (int i=0; i < ext.size(); i++){
for (uint t=0; t < supportedTypes_.size(); t++){ for (uint t=0; t < supportedTypes_.size(); t++){
QString filters = supportedTypes_[t].loadFilters; QString filters = supportedTypes_[t].loadFilters;
if (filters.contains(ext[i],Qt::CaseInsensitive)){ if (filters.contains(ext[i],Qt::CaseInsensitive)){
pluginForExtension_[ ext[i] ] = t; pluginForExtension_[ ext[i] ] = t;
break; break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment