Skip to content

Commit 06bb4d4

Browse files
committed
Fix incorrect member variable names
1 parent 8ecb943 commit 06bb4d4

File tree

2 files changed

+44
-46
lines changed

2 files changed

+44
-46
lines changed

src/app/qgssettingstree.cpp

+35-37
Original file line numberDiff line numberDiff line change
@@ -60,37 +60,35 @@ QgsSettingsTree::QgsSettingsTree( QWidget *parent )
6060
header()->resizeSection( 1, 100 );
6161
header()->resizeSection( 2, 250 );
6262

63-
settings = nullptr;
64-
refreshTimer.setInterval( 2000 );
65-
autoRefresh = false;
63+
mRefreshTimer.setInterval( 2000 );
6664

67-
groupIcon.addPixmap( style()->standardPixmap( QStyle::SP_DirClosedIcon ),
68-
QIcon::Normal, QIcon::Off );
69-
groupIcon.addPixmap( style()->standardPixmap( QStyle::SP_DirOpenIcon ),
70-
QIcon::Normal, QIcon::On );
71-
keyIcon = style()->standardIcon( QStyle::SP_FileIcon );
65+
mGroupIcon.addPixmap( style()->standardPixmap( QStyle::SP_DirClosedIcon ),
66+
QIcon::Normal, QIcon::Off );
67+
mGroupIcon.addPixmap( style()->standardPixmap( QStyle::SP_DirOpenIcon ),
68+
QIcon::Normal, QIcon::On );
69+
mKeyIcon = style()->standardIcon( QStyle::SP_FileIcon );
7270

7371
setEditTriggers( QAbstractItemView::AllEditTriggers );
7472

75-
connect( &refreshTimer, &QTimer::timeout, this, &QgsSettingsTree::maybeRefresh );
73+
connect( &mRefreshTimer, &QTimer::timeout, this, &QgsSettingsTree::maybeRefresh );
7674
}
7775

7876
void QgsSettingsTree::setSettingsObject( QgsSettings *settings )
7977
{
80-
delete this->settings;
81-
this->settings = settings;
78+
delete this->mSettings;
79+
this->mSettings = settings;
8280
clear();
8381

8482
if ( settings )
8583
{
8684
settings->setParent( this );
8785
refresh();
88-
if ( autoRefresh )
89-
refreshTimer.start();
86+
if ( mAutoRefresh )
87+
mRefreshTimer.start();
9088
}
9189
else
9290
{
93-
refreshTimer.stop();
91+
mRefreshTimer.stop();
9492
}
9593
}
9694

@@ -101,17 +99,17 @@ QSize QgsSettingsTree::sizeHint() const
10199

102100
void QgsSettingsTree::setAutoRefresh( bool autoRefresh )
103101
{
104-
this->autoRefresh = autoRefresh;
105-
if ( settings )
102+
this->mAutoRefresh = autoRefresh;
103+
if ( mSettings )
106104
{
107105
if ( autoRefresh )
108106
{
109107
maybeRefresh();
110-
refreshTimer.start();
108+
mRefreshTimer.start();
111109
}
112110
else
113111
{
114-
refreshTimer.stop();
112+
mRefreshTimer.stop();
115113
}
116114
}
117115
}
@@ -124,21 +122,21 @@ void QgsSettingsTree::maybeRefresh()
124122

125123
void QgsSettingsTree::refresh()
126124
{
127-
if ( !settings )
125+
if ( !mSettings )
128126
return;
129127

130128
disconnect( this, &QTreeWidget::itemChanged,
131129
this, &QgsSettingsTree::updateSetting );
132130

133-
settings->sync();
131+
mSettings->sync();
134132

135133
// add any settings not in QgsSettings object, so it will show up in the tree view
136-
QMap<QString, QStringList>::const_iterator it = settingsMap.constBegin();
137-
while ( it != settingsMap.constEnd() )
134+
QMap<QString, QStringList>::const_iterator it = mSettingsMap.constBegin();
135+
while ( it != mSettingsMap.constEnd() )
138136
{
139-
if ( ! settings->contains( it.key() ) )
137+
if ( ! mSettings->contains( it.key() ) )
140138
{
141-
settings->setValue( it.key(), it.value().at( 3 ) );
139+
mSettings->setValue( it.key(), it.value().at( 3 ) );
142140
}
143141
++it;
144142
}
@@ -153,7 +151,7 @@ bool QgsSettingsTree::event( QEvent *event )
153151
{
154152
if ( event->type() == QEvent::WindowActivate )
155153
{
156-
if ( isActiveWindow() && autoRefresh )
154+
if ( isActiveWindow() && mAutoRefresh )
157155
maybeRefresh();
158156
}
159157
return QTreeWidget::event( event );
@@ -165,16 +163,16 @@ void QgsSettingsTree::updateSetting( QTreeWidgetItem *item )
165163
if ( key.isNull() )
166164
return;
167165

168-
settings->setValue( key, item->data( 2, Qt::UserRole ) );
169-
if ( autoRefresh )
166+
mSettings->setValue( key, item->data( 2, Qt::UserRole ) );
167+
if ( mAutoRefresh )
170168
refresh();
171169
}
172170

173171
void QgsSettingsTree::updateChildItems( QTreeWidgetItem *parent )
174172
{
175173
int dividerIndex = 0;
176174

177-
Q_FOREACH ( const QString &group, settings->childGroups() )
175+
Q_FOREACH ( const QString &group, mSettings->childGroups() )
178176
{
179177
QTreeWidgetItem *child = nullptr;
180178
int childIndex = findChild( parent, group, dividerIndex );
@@ -190,15 +188,15 @@ void QgsSettingsTree::updateChildItems( QTreeWidgetItem *parent )
190188
{
191189
child = createItem( group, parent, dividerIndex );
192190
}
193-
child->setIcon( 0, groupIcon );
191+
child->setIcon( 0, mGroupIcon );
194192
++dividerIndex;
195193

196-
settings->beginGroup( group );
194+
mSettings->beginGroup( group );
197195
updateChildItems( child );
198-
settings->endGroup();
196+
mSettings->endGroup();
199197
}
200198

201-
Q_FOREACH ( const QString &key, settings->childKeys() )
199+
Q_FOREACH ( const QString &key, mSettings->childKeys() )
202200
{
203201
QTreeWidgetItem *child = nullptr;
204202
int childIndex = findChild( parent, key, 0 );
@@ -216,15 +214,15 @@ void QgsSettingsTree::updateChildItems( QTreeWidgetItem *parent )
216214
{
217215
child = createItem( key, parent, dividerIndex );
218216
}
219-
child->setIcon( 0, keyIcon );
217+
child->setIcon( 0, mKeyIcon );
220218
++dividerIndex;
221219
}
222220
else
223221
{
224222
child = childAt( parent, childIndex );
225223
}
226224

227-
QVariant value = settings->value( key );
225+
QVariant value = mSettings->value( key );
228226
if ( value.type() == QVariant::Invalid )
229227
{
230228
child->setText( 1, QStringLiteral( "Invalid" ) );
@@ -259,10 +257,10 @@ QTreeWidgetItem *QgsSettingsTree::createItem( const QString &text,
259257

260258
QString key = itemKey( item );
261259
QgsDebugMsgLevel( key, 4 );
262-
if ( settingsMap.contains( key ) )
260+
if ( mSettingsMap.contains( key ) )
263261
{
264-
QgsDebugMsgLevel( "contains!!!!", 4 );
265-
QStringList values = settingsMap[ key ];
262+
QgsDebugMsgLevel( QStringLiteral( "contains!!!!" ), 4 );
263+
QStringList values = mSettingsMap[ key ];
266264
item->setText( 3, values.at( 0 ) );
267265
item->setToolTip( 0, values.at( 1 ) );
268266
item->setToolTip( 2, values.at( 1 ) );

src/app/qgssettingstree.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ class QgsSettingsTree : public QTreeWidget
5454
public:
5555
explicit QgsSettingsTree( QWidget *parent = nullptr );
5656

57-
void setSettingsObject( QgsSettings *settings );
57+
void setSettingsObject( QgsSettings *mSettings );
5858
QSize sizeHint() const override;
5959

60-
void setSettingsMap( QMap< QString, QStringList > &map ) { settingsMap = map; }
60+
void setSettingsMap( QMap< QString, QStringList > &map ) { mSettingsMap = map; }
6161
QString itemKey( QTreeWidgetItem *item );
6262

6363
public slots:
64-
void setAutoRefresh( bool autoRefresh );
64+
void setAutoRefresh( bool mAutoRefresh );
6565
void maybeRefresh();
6666
void refresh();
6767

@@ -80,13 +80,13 @@ class QgsSettingsTree : public QTreeWidget
8080
int findChild( QTreeWidgetItem *parent, const QString &text, int startIndex );
8181
void moveItemForward( QTreeWidgetItem *parent, int oldIndex, int newIndex );
8282

83-
QgsSettings *settings = nullptr;
84-
QTimer refreshTimer;
85-
bool autoRefresh;
86-
QIcon groupIcon;
87-
QIcon keyIcon;
83+
QgsSettings *mSettings = nullptr;
84+
QTimer mRefreshTimer;
85+
bool mAutoRefresh = true;
86+
QIcon mGroupIcon;
87+
QIcon mKeyIcon;
8888

89-
QMap< QString, QStringList > settingsMap;
89+
QMap< QString, QStringList > mSettingsMap;
9090
};
9191

9292
#endif

0 commit comments

Comments
 (0)