diff --git a/python/core/qgsproject.sip b/python/core/qgsproject.sip index bd353871975..f2c59101f09 100644 --- a/python/core/qgsproject.sip +++ b/python/core/qgsproject.sip @@ -62,7 +62,7 @@ public: void setFilename( const QString & name ); /** returns file name */ - QString setFilename() const; + QString fileName() const; //@} diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 7a3e546903a..0ba42182d09 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -224,14 +224,14 @@ static void setTitleBarText_( QWidget & qgisApp ) if ( QgsProject::instance()->title().isEmpty() ) { - if ( QgsProject::instance()->setFilename().isEmpty() ) + if ( QgsProject::instance()->fileName().isEmpty() ) { // no project title nor file name, so just leave caption with // application name and version } else { - QFileInfo projectFileInfo( QgsProject::instance()->setFilename() ); + QFileInfo projectFileInfo( QgsProject::instance()->fileName() ); caption += projectFileInfo.baseName(); } } @@ -2882,7 +2882,7 @@ bool QgisApp::fileSave() // the current project file name is empty bool isNewProject = false; - if ( QgsProject::instance()->setFilename().isNull() ) + if ( QgsProject::instance()->fileName().isNull() ) { isNewProject = true; @@ -2925,7 +2925,7 @@ bool QgisApp::fileSave() if ( QgsProject::instance()->write() ) { setTitleBarText_(*this); // update title bar - statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->setFilename() ); + statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->fileName() ); if (isNewProject) { @@ -2938,13 +2938,13 @@ bool QgisApp::fileSave() { QMessageBox::critical(this, tr("Unable to save project"), - tr("Unable to save project to ") + QgsProject::instance()->setFilename() ); + tr("Unable to save project to ") + QgsProject::instance()->fileName() ); } } catch ( std::exception & e ) { QMessageBox::critical( this, - tr("Unable to save project ") + QgsProject::instance()->setFilename(), + tr("Unable to save project ") + QgsProject::instance()->fileName(), QString::fromLocal8Bit( e.what() ) ); } return true; @@ -3008,7 +3008,7 @@ void QgisApp::fileSaveAs() if ( QgsProject::instance()->write() ) { setTitleBarText_(*this); // update title bar - statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->setFilename() ); + statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->fileName() ); // add this to the list of recently used project files saveRecentProjectPath(fullPath.filePath(), settings); } @@ -3016,13 +3016,13 @@ void QgisApp::fileSaveAs() { QMessageBox::critical(this, tr("Unable to save project"), - tr("Unable to save project to ") + QgsProject::instance()->setFilename() ); + tr("Unable to save project to ") + QgsProject::instance()->fileName() ); } } catch ( std::exception & e ) { QMessageBox::critical( 0x0, - tr("Unable to save project ") + QgsProject::instance()->setFilename(), + tr("Unable to save project ") + QgsProject::instance()->fileName(), QString::fromLocal8Bit( e.what() ), QMessageBox::Ok, Qt::NoButton ); diff --git a/src/core/qgsmaplayer.cpp b/src/core/qgsmaplayer.cpp index 1105026658a..51b3027298a 100644 --- a/src/core/qgsmaplayer.cpp +++ b/src/core/qgsmaplayer.cpp @@ -481,7 +481,7 @@ QString QgsMapLayer::loadNamedStyle ( const QString theURI, bool &theResultFlag) } else { - QFileInfo project( QgsProject::instance()->setFilename() ); + QFileInfo project( QgsProject::instance()->fileName() ); QgsDebugMsg( QString("project filename: %1").arg( project.absoluteFilePath() ) ); QString qml; diff --git a/src/core/qgsproject.cpp b/src/core/qgsproject.cpp index 6112c71eadb..64165f60e4e 100644 --- a/src/core/qgsproject.cpp +++ b/src/core/qgsproject.cpp @@ -411,10 +411,10 @@ QgsProject * QgsProject::theProject_; - QString QgsProject::setFilename() const + QString QgsProject::fileName() const { return imp_->file.fileName(); - } // QString QgsProject::setFilename() const + } // QString QgsProject::fileName() const diff --git a/src/core/qgsproject.h b/src/core/qgsproject.h index ecf1df243f2..762de422b5b 100644 --- a/src/core/qgsproject.h +++ b/src/core/qgsproject.h @@ -95,7 +95,7 @@ public: void setFilename( QString const & name ); /** returns file name */ - QString setFilename() const; + QString fileName() const; //@} diff --git a/tests/algorithms/qgsproject/projecttest.h b/tests/algorithms/qgsproject/projecttest.h index 15a52f28285..83ca8c5d503 100644 --- a/tests/algorithms/qgsproject/projecttest.h +++ b/tests/algorithms/qgsproject/projecttest.h @@ -103,7 +103,7 @@ class ProjectTest : public CppUnit::TestFixture QgsProject::instance()->dirty( false ); QgsProject::instance()->setFilename( mFile ); - CPPUNIT_ASSERT( mFile == QgsProject::instance()->setFilename() ); + CPPUNIT_ASSERT( mFile == QgsProject::instance()->fileName() ); CPPUNIT_ASSERT( QgsProject::instance()->isDirty() ); } // testFileName