Commit 76d09920 authored by Jan Möbius's avatar Jan Möbius
Browse files

Accept non-capital file extensions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10166 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fc09467a
...@@ -144,7 +144,7 @@ void Core::slotExecuteAfterStartup() { ...@@ -144,7 +144,7 @@ void Core::slotExecuteAfterStartup() {
// Execute all files ending with ofs // Execute all files ending with ofs
for ( int i = 0 ; i < scriptFiles.size(); ++i ) for ( int i = 0 ; i < scriptFiles.size(); ++i )
if ( scriptFiles[i].endsWith("ofs") ) if ( scriptFiles[i].endsWith("ofs",Qt::CaseInsensitive) )
emit executeFileScript(scriptDir.path() + "/" + scriptFiles[i]); emit executeFileScript(scriptDir.path() + "/" + scriptFiles[i]);
} }
...@@ -154,7 +154,7 @@ void Core::slotExecuteAfterStartup() { ...@@ -154,7 +154,7 @@ void Core::slotExecuteAfterStartup() {
// Skip scripts here as they will be handled by a different function // Skip scripts here as they will be handled by a different function
QString tmp = QString::fromStdString(commandLineFileNames_[i].first); QString tmp = QString::fromStdString(commandLineFileNames_[i].first);
if ( tmp.endsWith("ofs") ) { if ( tmp.endsWith("ofs",Qt::CaseInsensitive) ) {
commandLineScriptNames_.push_back(commandLineFileNames_[i].first); commandLineScriptNames_.push_back(commandLineFileNames_[i].first);
continue; continue;
} }
...@@ -187,7 +187,7 @@ int Core::loadObject ( QString _filename ) { ...@@ -187,7 +187,7 @@ int Core::loadObject ( QString _filename ) {
matching ones. open it with this plugin. matching ones. open it with this plugin.
*/ */
if (_filename.endsWith(".ini")) { if (_filename.endsWith(".ini",Qt::CaseInsensitive)) {
// Load all information from the given ini file // Load all information from the given ini file
openIniFile(_filename,true,true,true); openIniFile(_filename,true,true,true);
...@@ -196,8 +196,7 @@ int Core::loadObject ( QString _filename ) { ...@@ -196,8 +196,7 @@ int Core::loadObject ( QString _filename ) {
coreWidget_->addRecent(_filename, DATA_UNKNOWN); coreWidget_->addRecent(_filename, DATA_UNKNOWN);
return -2; return -2;
} else } else if (_filename.endsWith(".ofs",Qt::CaseInsensitive)) {
if (_filename.endsWith(".ofs")) {
emit log(LOGINFO ,tr("Starting script execution of %1.").arg( _filename)) ; emit log(LOGINFO ,tr("Starting script execution of %1.").arg( _filename)) ;
emit executeFileScript(_filename); emit executeFileScript(_filename);
} else { } else {
...@@ -208,7 +207,7 @@ int Core::loadObject ( QString _filename ) { ...@@ -208,7 +207,7 @@ int Core::loadObject ( QString _filename ) {
QString filters = supportedTypes_[i].plugin->getLoadFilters(); QString filters = supportedTypes_[i].plugin->getLoadFilters();
//check extension //check extension
if ( ! filters.contains( "*." + fi.completeSuffix() ) ) if ( ! filters.contains( "*." + fi.completeSuffix() , Qt::CaseInsensitive) )
continue; continue;
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
...@@ -264,7 +263,7 @@ int Core::loadObject( DataType _type, QString _filename) { ...@@ -264,7 +263,7 @@ int Core::loadObject( DataType _type, QString _filename) {
QString filters = supportedTypes_[i].plugin->getLoadFilters(); QString filters = supportedTypes_[i].plugin->getLoadFilters();
//check extension //check extension
if ( ! filters.contains( "*." + fi.suffix() ) ) if ( ! filters.contains( "*." + fi.suffix() ,Qt::CaseInsensitive ) )
continue; continue;
...@@ -755,7 +754,7 @@ void Core::loadSettings(){ ...@@ -755,7 +754,7 @@ void Core::loadSettings(){
QString newpath = complete_name.section(OpenFlipper::Options::dirSeparator(),0,-2); QString newpath = complete_name.section(OpenFlipper::Options::dirSeparator(),0,-2);
OpenFlipperSettings().setValue("Core/CurrentDir", newpath); OpenFlipperSettings().setValue("Core/CurrentDir", newpath);
if ( complete_name.endsWith("ini") ) { if ( complete_name.endsWith("ini",Qt::CaseInsensitive) ) {
openIniFile( complete_name, openIniFile( complete_name,
loadProgramSettings->isChecked(), loadProgramSettings->isChecked(),
loadPluginSettings->isChecked(), loadPluginSettings->isChecked(),
...@@ -777,11 +776,11 @@ void Core::loadSettings(QString _filename){ ...@@ -777,11 +776,11 @@ void Core::loadSettings(QString _filename){
QString newpath = _filename.section(OpenFlipper::Options::dirSeparator(),0,-2); QString newpath = _filename.section(OpenFlipper::Options::dirSeparator(),0,-2);
OpenFlipperSettings().setValue("Core/CurrentDir", newpath); OpenFlipperSettings().setValue("Core/CurrentDir", newpath);
if ( _filename.endsWith("ini") ) { if ( _filename.endsWith("ini",Qt::CaseInsensitive) ) {
// Loaded function for recent files. Load everything. // Loaded function for recent files. Load everything.
openIniFile(_filename,true,true,true); openIniFile(_filename,true,true,true);
applyOptions(); applyOptions();
} else if ( _filename.endsWith("obj") ) { } else if ( _filename.endsWith("obj",Qt::CaseInsensitive) ) {
loadObject(_filename); loadObject(_filename);
applyOptions(); applyOptions();
} }
......
Markdown is supported
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