Skip to content

Commit ff5bde7

Browse files
NEDJIMAbelgacemnyalldawson
authored andcommittedJan 12, 2022
rename stuff
1 parent f54136e commit ff5bde7

File tree

9 files changed

+84
-85
lines changed

9 files changed

+84
-85
lines changed
 

‎python/core/auto_generated/project/qgsmapviewsmanager.sip.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,28 @@ Removes and deletes all views from the manager.
5757

5858

5959

60-
void removeView( const QString &name );
60+
void remove3DView( const QString &name );
6161
%Docstring
62-
Removes the configuration of the view named ``name``
62+
Removes the configuration of the 3D view named ``name``
6363
%End
6464

65-
void renameView( const QString &oldTitle, const QString &newTitle );
65+
void rename3DView( const QString &oldTitle, const QString &newTitle );
6666
%Docstring
67-
Renames the view named ``oldTitle`` to ``newTitle``
67+
Renames the 3D view named ``oldTitle`` to ``newTitle``
6868
%End
6969

70-
void setViewInitiallyVisible( const QString &name, bool visible );
70+
void set3DViewInitiallyVisible( const QString &name, bool visible );
7171
%Docstring
72-
Sets whether the view named ``name`` will be initially visible when the project is opened
72+
Sets whether the 3D view named ``name`` will be initially visible when the project is opened
7373
%End
7474

75-
bool isViewOpen( const QString &name );
75+
bool is3DViewOpen( const QString &name );
7676
%Docstring
77-
Returns whether the view named ``name`` will is opened
77+
Returns whether the 3D view named ``name`` will is opened
7878
%End
7979

8080
signals:
81-
void viewsListChanged();
81+
void views3DListChanged();
8282
%Docstring
8383
Emitted when the views list has changed (whenever a view was removed, added, renamed..)
8484
%End

‎python/core/auto_generated/project/qgsproject.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,9 @@ the project.
745745
%End
746746

747747

748-
QgsMapViewsManager *get3DViewsManager();
748+
QgsMapViewsManager *getViewsManager();
749749
%Docstring
750-
Returns the project's 3D views manager, which manages 3D views
750+
Returns the project's views manager, which manages map views (including 3d maps)
751751
in the project.
752752

753753
.. versionadded:: 3.24

‎src/app/3d/qgs3dviewsmanagerdialog.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ Qgs3DViewsManagerDialog::Qgs3DViewsManagerDialog( QWidget *parent, Qt::WindowFla
4646

4747
connect( m3DViewsListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &Qgs3DViewsManagerDialog::currentChanged );
4848

49-
connect( QgsProject::instance()->get3DViewsManager(), &QgsMapViewsManager::viewsListChanged, this, &Qgs3DViewsManagerDialog::onViewsListChanged );
49+
connect( QgsProject::instance()->get3DViewsManager(), &QgsMapViewsManager::views3DListChanged, this, &Qgs3DViewsManagerDialog::on3DViewsListChanged );
5050
m3DViewsListView->selectionModel()->setCurrentIndex( m3DViewsListView->model()->index( 0, 0 ), QItemSelectionModel::Select );
5151
currentChanged( m3DViewsListView->selectionModel()->currentIndex(), m3DViewsListView->selectionModel()->currentIndex() );
5252
}
5353

54-
void Qgs3DViewsManagerDialog::onViewsListChanged()
54+
void Qgs3DViewsManagerDialog::on3DViewsListChanged()
5555
{
5656
reload();
5757
}
@@ -116,7 +116,7 @@ void Qgs3DViewsManagerDialog::removeClicked()
116116

117117
QString viewName = m3DViewsListView->selectionModel()->selectedRows().at( 0 ).data( Qt::DisplayRole ).toString();
118118

119-
QgsProject::instance()->get3DViewsManager()->removeView( viewName );
119+
QgsProject::instance()->get3DViewsManager()->remove3DView( viewName );
120120
if ( Qgs3DMapCanvasDockWidget *w = QgisApp::instance()->get3DMapViewDock( viewName ) )
121121
{
122122
w->close();
@@ -135,7 +135,7 @@ void Qgs3DViewsManagerDialog::renameClicked()
135135
if ( newTitle.isEmpty() )
136136
return;
137137

138-
QgsProject::instance()->get3DViewsManager()->renameView( oldTitle, newTitle );
138+
QgsProject::instance()->get3DViewsManager()->rename3DView( oldTitle, newTitle );
139139

140140
if ( Qgs3DMapCanvasDockWidget *widget = QgisApp::instance()->get3DMapViewDock( oldTitle ) )
141141
{
@@ -161,15 +161,14 @@ void Qgs3DViewsManagerDialog::currentChanged( const QModelIndex &current, const
161161
}
162162

163163
QString viewName = current.data( Qt::DisplayRole ).toString();
164-
bool isOpen = QgsProject::instance()->get3DViewsManager()->isViewOpen( viewName );
164+
bool isOpen = QgsProject::instance()->get3DViewsManager()->is3DViewOpen( viewName );
165165
mShowButton->setEnabled( !isOpen );
166166
mHideButton->setEnabled( isOpen );
167167
}
168168

169169
void Qgs3DViewsManagerDialog::reload()
170170
{
171-
QStringList names = QgsProject::instance()->get3DViewsManager()->getViewsNames();
172-
qDebug() << __PRETTY_FUNCTION__ << " " << names;
171+
QStringList names = QgsProject::instance()->get3DViewsManager()->get3DViewsNames();
173172
mListModel->setStringList( names );
174173
}
175174

‎src/app/3d/qgs3dviewsmanagerdialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Qgs3DViewsManagerDialog : public QDialog, private Ui::Qgs3DViewsManagerDia
4242

4343
void currentChanged( const QModelIndex &current, const QModelIndex &previous );
4444

45-
void onViewsListChanged();
45+
void on3DViewsListChanged();
4646
private:
4747
QStringListModel *mListModel = nullptr;
4848

‎src/app/qgisapp.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipBadLayers
17461746
setupLayoutManagerConnections();
17471747

17481748
#ifdef HAVE_3D
1749-
connect( QgsProject::instance()->get3DViewsManager(), &QgsMapViewsManager::viewsListChanged, this, &QgisApp::views3DMenuAboutToShow );
1749+
connect( QgsProject::instance()->getViewsManager(), &QgsMapViewsManager::views3DListChanged, this, &QgisApp::views3DMenuAboutToShow );
17501750
#endif
17511751

17521752
setupDuplicateFeaturesAction();
@@ -9903,7 +9903,7 @@ Qgs3DMapCanvasDockWidget *QgisApp::open3DMapView( const QString &viewName )
99039903
QgsReadWriteContext readWriteContext;
99049904
readWriteContext.setPathResolver( QgsProject::instance()->pathResolver() );
99059905

9906-
QDomElement elem3DMap = QgsProject::instance()->get3DViewsManager()->getViewSettings( viewName );
9906+
QDomElement elem3DMap = QgsProject::instance()->getViewsManager()->get3DViewSettings( viewName );
99079907

99089908
if ( elem3DMap.isNull() )
99099909
return nullptr;
@@ -9915,7 +9915,7 @@ Qgs3DMapCanvasDockWidget *QgisApp::open3DMapView( const QString &viewName )
99159915
read3DMapViewSettings( mapCanvasDock3D, elem3DMap );
99169916
mPanelMenu->removeAction( mapCanvasDock3D->toggleViewAction() );
99179917

9918-
QgsProject::instance()->get3DViewsManager()->setViewInitiallyVisible( viewName, true );
9918+
QgsProject::instance()->getViewsManager()->set3DViewInitiallyVisible( viewName, true );
99199919

99209920
return mapCanvasDock3D;
99219921
#else
@@ -9962,7 +9962,7 @@ Qgs3DMapCanvasDockWidget *QgisApp::duplicate3DMapView( const QString &existingVi
99629962
}
99639963
else
99649964
{
9965-
QDomElement elem = QgsProject::instance()->get3DViewsManager()->getViewSettings( existingViewName );
9965+
QDomElement elem = QgsProject::instance()->getViewsManager()->get3DViewSettings( existingViewName );
99669966
elem.setAttribute( QStringLiteral( "name" ), newViewName );
99679967
read3DMapViewSettings( mapCanvasDock3D, elem );
99689968
}
@@ -9973,8 +9973,8 @@ Qgs3DMapCanvasDockWidget *QgisApp::duplicate3DMapView( const QString &existingVi
99739973
elem3DMap = doc.createElement( QStringLiteral( "view" ) );
99749974
write3DMapViewSettings( mapCanvasDock3D, doc, elem3DMap );
99759975

9976-
QgsProject::instance()->get3DViewsManager()->registerViewSettings( newViewName, elem3DMap );
9977-
QgsProject::instance()->get3DViewsManager()->setViewInitiallyVisible( newViewName, true );
9976+
QgsProject::instance()->getViewsManager()->register3DViewSettings( newViewName, elem3DMap );
9977+
QgsProject::instance()->getViewsManager()->set3DViewInitiallyVisible( newViewName, true );
99789978

99799979
mPanelMenu->removeAction( mapCanvasDock3D->toggleViewAction() );
99809980

@@ -10091,7 +10091,7 @@ void QgisApp::populate3DMapviewsMenu( QMenu *menu )
1009110091
#ifdef HAVE_3D
1009210092
menu->clear();
1009310093
QList<QAction *> acts;
10094-
QList< QDomElement > views = QgsProject::instance()->get3DViewsManager()->getViews();
10094+
QList< QDomElement > views = QgsProject::instance()->getViewsManager()->get3DViews();
1009510095
acts.reserve( views.size() );
1009610096
for ( const QDomElement &viewConfig : views )
1009710097
{
@@ -13988,14 +13988,14 @@ Qgs3DMapCanvasDockWidget *QgisApp::createNew3DMapCanvasDock( const QString &name
1398813988
QDomDocument doc( documentType );
1398913989

1399013990
QString viewName = map3DWidget->mapCanvas3D()->objectName();
13991-
if ( !QgsProject::instance()->get3DViewsManager()->getViewSettings( viewName ).isNull() )
13991+
if ( !QgsProject::instance()->getViewsManager()->get3DViewSettings( viewName ).isNull() )
1399213992
{
1399313993
QDomElement elem3DMap;
1399413994
elem3DMap = doc.createElement( QStringLiteral( "view" ) );
1399513995
write3DMapViewSettings( map3DWidget, doc, elem3DMap );
1399613996

13997-
QgsProject::instance()->get3DViewsManager()->registerViewSettings( viewName, elem3DMap );
13998-
QgsProject::instance()->get3DViewsManager()->setViewInitiallyVisible( viewName, false );
13997+
QgsProject::instance()->getViewsManager()->register3DViewSettings( viewName, elem3DMap );
13998+
QgsProject::instance()->getViewsManager()->set3DViewInitiallyVisible( viewName, false );
1399913999
}
1400014000
QgisApp::instance()->mOpen3DDocks.remove( map3DWidget );
1400114001
} );
@@ -14028,7 +14028,7 @@ void QgisApp::new3DMapCanvas()
1402814028
}
1402914029

1403014030
int i = 1;
14031-
const QList< QString > usedCanvasNames = QgsProject::instance()->get3DViewsManager()->getViewsNames();
14031+
const QList< QString > usedCanvasNames = QgsProject::instance()->getViewsManager()->get3DViewsNames();
1403214032
QString name = tr( "3D Map %1" ).arg( i );
1403314033
while ( usedCanvasNames.contains( name ) )
1403414034
{
@@ -14104,8 +14104,8 @@ void QgisApp::new3DMapCanvas()
1410414104

1410514105
write3DMapViewSettings( dock, doc, elem3DMap );
1410614106

14107-
QgsProject::instance()->get3DViewsManager()->registerViewSettings( name, elem3DMap );
14108-
QgsProject::instance()->get3DViewsManager()->setViewInitiallyVisible( name, true );
14107+
QgsProject::instance()->getViewsManager()->register3DViewSettings( name, elem3DMap );
14108+
QgsProject::instance()->getViewsManager()->set3DViewInitiallyVisible( name, true );
1410914109

1411014110
mPanelMenu->removeAction( dock->toggleViewAction() );
1411114111
}
@@ -16813,7 +16813,7 @@ void QgisApp::writeProject( QDomDocument &doc )
1681316813
QDomElement elem3DMap = doc.createElement( QStringLiteral( "view" ) );
1681416814
elem3DMap.setAttribute( QStringLiteral( "isOpen" ), 1 );
1681516815
write3DMapViewSettings( widget, doc, elem3DMap );
16816-
QgsProject::instance()->get3DViewsManager()->registerViewSettings( viewName, elem3DMap );
16816+
QgsProject::instance()->getViewsManager()->register3DViewSettings( viewName, elem3DMap );
1681716817
}
1681816818
#endif
1681916819
projectChanged( doc );
@@ -16924,7 +16924,7 @@ void QgisApp::readProject( const QDomDocument &doc )
1692416924

1692516925
#ifdef HAVE_3D
1692616926
// Open 3D Views that were already open
16927-
for ( QDomElement viewConfig : QgsProject::instance()->get3DViewsManager()->getViews() )
16927+
for ( QDomElement viewConfig : QgsProject::instance()->getViewsManager()->get3DViews() )
1692816928
{
1692916929
QString viewName = viewConfig.attribute( QStringLiteral( "name" ) );
1693016930
bool isOpen = viewConfig.attribute( QStringLiteral( "isOpen" ), QStringLiteral( "1" ) ).toInt() == 1;

‎src/core/project/qgsmapviewsmanager.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bool QgsMapViewsManager::readXml( const QDomElement &element, const QDomDocument
3636
while ( !elem3DMap.isNull() )
3737
{
3838
QString mapName = elem3DMap.attribute( QStringLiteral( "name" ) );
39-
mMapViewsDom.insert( mapName, elem3DMap );
39+
m3DMapViewsDom.insert( mapName, elem3DMap );
4040

4141
elem3DMap = elem3DMap.nextSiblingElement( QStringLiteral( "view" ) );
4242
}
@@ -48,62 +48,62 @@ bool QgsMapViewsManager::readXml( const QDomElement &element, const QDomDocument
4848
QDomElement QgsMapViewsManager::writeXml( QDomDocument &doc ) const
4949
{
5050
QDomElement dom = doc.createElement( "mapViewDocks3D" );
51-
for ( QDomElement d : mMapViewsDom.values() )
51+
for ( QDomElement d : m3DMapViewsDom.values() )
5252
dom.appendChild( d );
5353
return dom;
5454
}
5555

5656
void QgsMapViewsManager::clear()
5757
{
58-
mMapViewsDom.clear();
59-
emit viewsListChanged();
58+
m3DMapViewsDom.clear();
59+
emit views3DListChanged();
6060
}
6161

62-
QDomElement QgsMapViewsManager::getViewSettings( const QString &name ) const
62+
QDomElement QgsMapViewsManager::get3DViewSettings( const QString &name ) const
6363
{
64-
return mMapViewsDom.value( name, QDomElement() );
64+
return m3DMapViewsDom.value( name, QDomElement() );
6565
}
6666

67-
QList<QDomElement> QgsMapViewsManager::getViews() const
67+
QList<QDomElement> QgsMapViewsManager::get3DViews() const
6868
{
69-
return mMapViewsDom.values();
69+
return m3DMapViewsDom.values();
7070
}
7171

72-
void QgsMapViewsManager::registerViewSettings( const QString &name, const QDomElement &dom )
72+
void QgsMapViewsManager::register3DViewSettings( const QString &name, const QDomElement &dom )
7373
{
74-
mMapViewsDom.insert( name, dom );
75-
emit viewsListChanged();
74+
m3DMapViewsDom.insert( name, dom );
75+
emit views3DListChanged();
7676
}
7777

78-
QStringList QgsMapViewsManager::getViewsNames() const
78+
QStringList QgsMapViewsManager::get3DViewsNames() const
7979
{
80-
return mMapViewsDom.keys();
80+
return m3DMapViewsDom.keys();
8181
}
8282

83-
void QgsMapViewsManager::removeView( const QString &name )
83+
void QgsMapViewsManager::remove3DView( const QString &name )
8484
{
85-
mMapViewsDom.remove( name );
86-
emit viewsListChanged();
85+
m3DMapViewsDom.remove( name );
86+
emit views3DListChanged();
8787
}
8888

89-
void QgsMapViewsManager::renameView( const QString &oldTitle, const QString &newTitle )
89+
void QgsMapViewsManager::rename3DView( const QString &oldTitle, const QString &newTitle )
9090
{
91-
QDomElement elem = mMapViewsDom.value( oldTitle );
92-
mMapViewsDom.remove( oldTitle );
93-
mMapViewsDom[ newTitle ] = elem;
94-
mMapViewsDom[ newTitle ].setAttribute( QStringLiteral( "name" ), newTitle );
95-
emit viewsListChanged();
91+
QDomElement elem = m3DMapViewsDom.value( oldTitle );
92+
m3DMapViewsDom.remove( oldTitle );
93+
m3DMapViewsDom[ newTitle ] = elem;
94+
m3DMapViewsDom[ newTitle ].setAttribute( QStringLiteral( "name" ), newTitle );
95+
emit views3DListChanged();
9696
}
9797

98-
void QgsMapViewsManager::setViewInitiallyVisible( const QString &name, bool visible )
98+
void QgsMapViewsManager::set3DViewInitiallyVisible( const QString &name, bool visible )
9999
{
100-
if ( mMapViewsDom.contains( name ) )
100+
if ( m3DMapViewsDom.contains( name ) )
101101
{
102-
mMapViewsDom[ name ].setAttribute( QStringLiteral( "isOpen" ), visible );
102+
m3DMapViewsDom[ name ].setAttribute( QStringLiteral( "isOpen" ), visible );
103103
}
104104
}
105105

106-
bool QgsMapViewsManager::isViewOpen( const QString &name )
106+
bool QgsMapViewsManager::is3DViewOpen( const QString &name )
107107
{
108-
return mMapViewsDom.value( name, QDomElement() ).attribute( QStringLiteral( "isOpen" ), QStringLiteral( "1" ) ).toInt() == 1;
108+
return m3DMapViewsDom.value( name, QDomElement() ).attribute( QStringLiteral( "isOpen" ), QStringLiteral( "1" ) ).toInt() == 1;
109109
}

‎src/core/project/qgsmapviewsmanager.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,51 +66,51 @@ class CORE_EXPORT QgsMapViewsManager : public QObject
6666
void clear();
6767

6868
/**
69-
* Returns the DOM element representing the settings of the view named \a name
69+
* Returns the DOM element representing the settings of the 3D view named \a name
7070
*
7171
* \note Not available in Python bindings
7272
*/
73-
QDomElement getViewSettings( const QString &name ) const SIP_SKIP;
73+
QDomElement get3DViewSettings( const QString &name ) const SIP_SKIP;
7474

7575
/**
76-
* Adds a new view named \a name to the manager with the configuration DOM \a dom
76+
* Adds a new 3D view named \a name to the manager with the configuration DOM \a dom
7777
*
7878
* \note Not available in Python bindings
7979
*/
80-
void registerViewSettings( const QString &name, const QDomElement &dom ) SIP_SKIP;
80+
void register3DViewSettings( const QString &name, const QDomElement &dom ) SIP_SKIP;
8181

8282
/**
83-
* Returns the names of all views added to the manager
83+
* Returns the names of all 3D views added to the manager
8484
*
8585
* \note Not available in Python bindings
8686
*/
87-
QStringList getViewsNames() const SIP_SKIP;
87+
QStringList get3DViewsNames() const SIP_SKIP;
8888

8989
/**
90-
* Returns the list of configurations of views added to the manager
90+
* Returns the list of configurations of 3D views added to the manager
9191
*
9292
* \note Not available in Python bindings
9393
*/
94-
QList<QDomElement> getViews() const SIP_SKIP;
94+
QList<QDomElement> get3DViews() const SIP_SKIP;
9595

96-
//! Removes the configuration of the view named \a name
97-
void removeView( const QString &name );
96+
//! Removes the configuration of the 3D view named \a name
97+
void remove3DView( const QString &name );
9898

99-
//! Renames the view named \a oldTitle to \a newTitle
100-
void renameView( const QString &oldTitle, const QString &newTitle );
99+
//! Renames the 3D view named \a oldTitle to \a newTitle
100+
void rename3DView( const QString &oldTitle, const QString &newTitle );
101101

102-
//! Sets whether the view named \a name will be initially visible when the project is opened
103-
void setViewInitiallyVisible( const QString &name, bool visible );
102+
//! Sets whether the 3D view named \a name will be initially visible when the project is opened
103+
void set3DViewInitiallyVisible( const QString &name, bool visible );
104104

105-
//! Returns whether the view named \a name will is opened
106-
bool isViewOpen( const QString &name );
105+
//! Returns whether the 3D view named \a name will is opened
106+
bool is3DViewOpen( const QString &name );
107107

108108
signals:
109109
//! Emitted when the views list has changed (whenever a view was removed, added, renamed..)
110-
void viewsListChanged();
110+
void views3DListChanged();
111111

112112
private:
113-
QMap<QString, QDomElement> mMapViewsDom;
113+
QMap<QString, QDomElement> m3DMapViewsDom;
114114
};
115115

116116

‎src/core/project/qgsproject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,12 +3172,12 @@ QgsLayoutManager *QgsProject::layoutManager()
31723172
return mLayoutManager.get();
31733173
}
31743174

3175-
const QgsMapViewsManager *QgsProject::get3DViewsManager() const
3175+
const QgsMapViewsManager *QgsProject::getViewsManager() const
31763176
{
31773177
return m3DViewsManager.get();
31783178
}
31793179

3180-
QgsMapViewsManager *QgsProject::get3DViewsManager()
3180+
QgsMapViewsManager *QgsProject::getViewsManager()
31813181
{
31823182
return m3DViewsManager.get();
31833183
}

‎src/core/project/qgsproject.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,19 +757,19 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
757757
QgsLayoutManager *layoutManager();
758758

759759
/**
760-
* Returns the project's 3D views manager, which manages 3D views
760+
* Returns the project's views manager, which manages map views (including 3d maps)
761761
* in the project.
762762
* \note not available in Python bindings
763763
* \since QGIS 3.24
764764
*/
765-
const QgsMapViewsManager *get3DViewsManager() const SIP_SKIP;
765+
const QgsMapViewsManager *getViewsManager() const SIP_SKIP;
766766

767767
/**
768-
* Returns the project's 3D views manager, which manages 3D views
768+
* Returns the project's views manager, which manages map views (including 3d maps)
769769
* in the project.
770770
* \since QGIS 3.24
771771
*/
772-
QgsMapViewsManager *get3DViewsManager();
772+
QgsMapViewsManager *getViewsManager();
773773

774774
/**
775775
* Returns the project's bookmark manager, which manages bookmarks within

0 commit comments

Comments
 (0)
Please sign in to comment.