Skip to content
Permalink
Browse files
Use fileName() instead of setFilename() for filename accessor
git-svn-id: http://svn.osgeo.org/qgis/trunk@9135 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 23, 2008
1 parent c6fb52f commit 0636f412b2ead68d8ae1306e615eada15314b608
@@ -62,7 +62,7 @@ public:
void setFilename( const QString & name );

/** returns file name */
QString setFilename() const;
QString fileName() const;
//@}


@@ -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,21 +3008,21 @@ 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);
}
else
{
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 );
@@ -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;
@@ -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



@@ -95,7 +95,7 @@ class CORE_EXPORT QgsProject : public QObject
void setFilename( QString const & name );

/** returns file name */
QString setFilename() const;
QString fileName() const;
//@}


@@ -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

0 comments on commit 0636f41

Please sign in to comment.