Skip to content

Commit 1465e9b

Browse files
committedAug 19, 2015
Deprecate QgsProject::title( QString )
1 parent 33d46d3 commit 1465e9b

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed
 

‎src/core/qgsofflineediting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ bool QgsOfflineEditing::convertToOfflineProject( const QString& offlineDataPath,
165165
projectTitle = QFileInfo( QgsProject::instance()->fileName() ).fileName();
166166
}
167167
projectTitle += " (offline)";
168-
QgsProject::instance()->title( projectTitle );
168+
QgsProject::instance()->setTitle( projectTitle );
169169

170170
QgsProject::instance()->writeEntry( PROJECT_ENTRY_SCOPE_OFFLINE, PROJECT_ENTRY_KEY_OFFLINE_DB_PATH, dbPath );
171171

@@ -295,7 +295,7 @@ void QgsOfflineEditing::synchronize()
295295
// disable offline project
296296
QString projectTitle = QgsProject::instance()->title();
297297
projectTitle.remove( QRegExp( " \\(offline\\)$" ) );
298-
QgsProject::instance()->title( projectTitle );
298+
QgsProject::instance()->setTitle( projectTitle );
299299
QgsProject::instance()->removeEntry( PROJECT_ENTRY_SCOPE_OFFLINE, PROJECT_ENTRY_KEY_OFFLINE_DB_PATH );
300300
remoteLayer->reload(); //update with other changes
301301
}

‎src/core/qgsproject.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,11 @@ QgsProject *QgsProject::instance()
358358
return theProject_;
359359
} // QgsProject *instance()
360360

361-
void QgsProject::title( QString const &title )
361+
void QgsProject::setTitle( const QString &title )
362362
{
363363
imp_->title = title;
364364

365365
dirty( true );
366-
} // void QgsProject::title
367-
368-
void QgsProject::setTitle( const QString &t )
369-
{
370-
title( t );
371366
}
372367

373368

‎src/core/qgsproject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ class CORE_EXPORT QgsProject : public QObject
8282
/**
8383
Every project has an associated title string
8484
85-
### QGIS 3: remove in favor of setTitle(...)
85+
@deprecated Use @link setTitle @endlink instead.
8686
*/
8787
//@{
88-
void title( const QString & title );
88+
Q_DECL_DEPRECATED inline void title( const QString & title ) { setTitle( title ); }
8989

9090
/** Set project title
9191
* @note added in 2.4 */

0 commit comments

Comments
 (0)
Please sign in to comment.