Skip to content
Permalink
Browse files

Create some properties on QgsProject

  • Loading branch information
m-kuhn committed Jul 10, 2016
1 parent 3da1918 commit 9a917c4b4882978498c2907a649501f51d79b729
Showing with 18 additions and 0 deletions.
  1. +10 −0 src/core/qgsproject.cpp
  2. +8 −0 src/core/qgsproject.h
@@ -414,7 +414,17 @@ void QgsProject::setDirty( bool b )

void QgsProject::setFileName( const QString& name )
{
if ( name == imp_->file.fileName() )
return;

QString oldHomePath = homePath();

imp_->file.setFileName( name );
emit fileNameChanged();

QString newHomePath = homePath();
if ( newHomePath != oldHomePath )
emit homePathChanged();

setDirty( true );
}
@@ -72,6 +72,8 @@ class CORE_EXPORT QgsProject : public QObject
{
Q_OBJECT
Q_PROPERTY( QStringList nonIdentifiableLayers READ nonIdentifiableLayers WRITE setNonIdentifiableLayers NOTIFY nonIdentifiableLayersChanged )
Q_PROPERTY( QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged )
Q_PROPERTY( QString homePath READ homePath NOTIFY homePathChanged )

public:

@@ -455,6 +457,12 @@ class CORE_EXPORT QgsProject : public QObject
//! Emitted when the list of layer which are excluded from map identification changes
void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );

//! Emitted when the file name of the project changes
void fileNameChanged();

//! Emitted when the home path of the project changes
void homePathChanged();

public slots:

/**

0 comments on commit 9a917c4

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