Skip to content
Permalink
Browse files

Rename QgsProject::projectDirty to isDirtyChanged

Also show unsaved status in title bar even when project has
not been first saved
  • Loading branch information
nyalldawson committed Mar 6, 2018
1 parent 51286d9 commit a30403dcbeb1397502fafcb563f5c7439fbeea80
@@ -1140,7 +1140,7 @@ advertised by this signal.
:param layers: List of QgsMapLayer which were added to the legend.
%End

void projectDirty( const bool dirty );
void isDirtyChanged( bool dirty );
%Docstring
Emitted when the project dirty status changes.

@@ -751,7 +751,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
//listen out to status bar updates from the view
connect( mView, &QgsLayoutView::statusMessage, this, &QgsLayoutDesignerDialog::statusMessageReceived );

connect( QgsProject::instance(), &QgsProject::projectDirty, this, &QgsLayoutDesignerDialog::updateWindowTitle );
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, this, &QgsLayoutDesignerDialog::updateWindowTitle );
}

QgsAppLayoutDesignerInterface *QgsLayoutDesignerDialog::iface()
@@ -476,10 +476,10 @@ static void setTitleBarText_( QWidget &qgisApp )
}
if ( !caption.isEmpty() )
{
if ( QgsProject::instance()->isDirty() )
caption.prepend( '*' );
caption += " - ";
}
if ( QgsProject::instance()->isDirty() )
caption.prepend( '*' );

caption += QgisApp::tr( "QGIS" );

@@ -754,7 +754,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
mMapCanvas->setCanvasColor( QColor( myRed, myGreen, myBlue ) );
endProfile();

connect( QgsProject::instance(), &QgsProject::projectDirty, this, [ = ] { setTitleBarText_( *this ); } );
connect( QgsProject::instance(), &QgsProject::isDirtyChanged, this, [ = ] { setTitleBarText_( *this ); } );

// what type of project to auto-open
mProjOpen = settings.value( QStringLiteral( "qgis/projOpenAtLaunch" ), 0 ).toInt();
@@ -414,7 +414,7 @@ bool QgsProject::isDirty() const
void QgsProject::setDirty( bool b )
{
mDirty = b;
emit projectDirty( mDirty );
emit isDirtyChanged( mDirty );
}

void QgsProject::setFileName( const QString &name )
@@ -1097,7 +1097,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
* \since QGIS 3.2
*
*/
void projectDirty( const bool dirty );
void isDirtyChanged( bool dirty );

public slots:

0 comments on commit a30403d

Please sign in to comment.
You can’t perform that action at this time.