Commit 2f0f6fd4 authored by Mario Hlawitschka's avatar Mario Hlawitschka
Browse files

[FIX] OSX at least ensures that the .owproj extension is present if neither...

[FIX] OSX at least ensures that the .owproj extension is present if neither .owp nor .owproj is provided. This lead to some awkward file names.
parent 50b761ef
...@@ -573,6 +573,8 @@ bool WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil ...@@ -573,6 +573,8 @@ bool WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil
fd.setFileMode( QFileDialog::AnyFile ); fd.setFileMode( QFileDialog::AnyFile );
fd.setAcceptMode( QFileDialog::AcceptSave ); fd.setAcceptMode( QFileDialog::AcceptSave );
// My Mac OSX Lion automatically appends .owproj to the file name
// if no extension is given.
QStringList filters; QStringList filters;
filters << "Project File (*.owproj *.owp)"; filters << "Project File (*.owproj *.owp)";
fd.setNameFilters( filters ); fd.setNameFilters( filters );
...@@ -592,8 +594,10 @@ bool WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil ...@@ -592,8 +594,10 @@ bool WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil
for( constIterator = fileNames.constBegin(); constIterator != fileNames.constEnd(); ++constIterator ) for( constIterator = fileNames.constBegin(); constIterator != fileNames.constEnd(); ++constIterator )
{ {
std::string filename = ( *constIterator ).toStdString(); std::string filename = ( *constIterator ).toStdString();
// append owp if suffix is not present, yet // append owp if suffix is not present, yet
if( filename.rfind( ".owp" ) != filename.size() - 4 ) if( filename.rfind( ".owp" ) != filename.size() - 4
&& filename.rfind( ".owproj" ) != filename.size() - 7 )
{ {
filename += ".owp"; filename += ".owp";
} }
......
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