Commit 96c58196 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - owp extension gets added automatically if not present in save dialog for project files.

parent 27d38fcd
...@@ -576,8 +576,7 @@ void WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil ...@@ -576,8 +576,7 @@ void WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil
fd.setAcceptMode( QFileDialog::AcceptSave ); fd.setAcceptMode( QFileDialog::AcceptSave );
QStringList filters; QStringList filters;
filters << "Project File (*.owproj *.owp)" filters << "Project File (*.owproj *.owp)";
<< "Any files (*)";
fd.setNameFilters( filters ); fd.setNameFilters( filters );
fd.setViewMode( QFileDialog::Detail ); fd.setViewMode( QFileDialog::Detail );
QStringList fileNames; QStringList fileNames;
...@@ -589,8 +588,15 @@ void WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil ...@@ -589,8 +588,15 @@ void WMainWindow::projectSave( const std::vector< boost::shared_ptr< WProjectFil
QStringList::const_iterator constIterator; QStringList::const_iterator constIterator;
for( constIterator = fileNames.constBegin(); constIterator != fileNames.constEnd(); ++constIterator ) for( constIterator = fileNames.constBegin(); constIterator != fileNames.constEnd(); ++constIterator )
{ {
std::string filename = ( *constIterator ).toStdString();
// append owp if not existent
if ( filename.rfind( ".owp" ) == std::string::npos )
{
filename += ".owp";
}
boost::shared_ptr< WProjectFile > proj = boost::shared_ptr< WProjectFile >( boost::shared_ptr< WProjectFile > proj = boost::shared_ptr< WProjectFile >(
new WProjectFile( ( *constIterator ).toStdString() ) new WProjectFile( filename )
); );
try try
......
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