Commit ffe00fad authored by Dirk Wilden's avatar Dirk Wilden

default to obj if filetype is obj

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@3610 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2f337e0a
......@@ -56,7 +56,7 @@ void Core::saveSettings(){
fileDialog.setAcceptMode ( QFileDialog::AcceptSave );
fileDialog.setFileMode ( QFileDialog::AnyFile );
fileDialog.setDefaultSuffix("ini");
QGridLayout *layout = (QGridLayout*)fileDialog.layout();
QGroupBox* optionsBox = new QGroupBox( &fileDialog ) ;
......@@ -102,6 +102,15 @@ void Core::saveSettings(){
complete_name = fileNames[0];
//check the extension
if ( !complete_name.endsWith(".ini", Qt::CaseInsensitive) && !complete_name.endsWith(".obj", Qt::CaseInsensitive) ){
if ( fileDialog.selectedNameFilter().contains("INI files (*.ini)") )
complete_name += ".ini";
else
complete_name += ".obj";
}
QString newpath = complete_name.section(OpenFlipper::Options::dirSeparator(),0,-2);
OpenFlipper::Options::currentDir(newpath);
......
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