Skip to content

Commit 7204a92

Browse files
committed
refactor: Fix readability-static-accessed-through-instance warnings
1 parent cc1f119 commit 7204a92

28 files changed

+59
-55
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Checks: >
4949
readability-use-anyofallof,
5050
readability-redundant-member-init,
5151
cppcoreguidelines-init-variables,
52+
readability-static-accessed-through-instance,
5253
5354
CheckOptions:
5455
- key: readability-identifier-naming.ClassCase

src/core/application.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ namespace swift::core
838838
{
839839
const CStatusMessage m = this->supportsContexts() ? this->getIContextApplication()->saveSettings() :
840840
CSettingsCache::instance()->saveToStore();
841-
CLogMessage(this).preformatted(m);
841+
CLogMessage::preformatted(m);
842842
}
843843

844844
// from here on we really rip apart the application object
@@ -870,7 +870,7 @@ namespace swift::core
870870

871871
// clean up all in "deferred delete state"
872872
qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete);
873-
sApp->processEventsFor(500);
873+
processEventsFor(500);
874874

875875
// completed
876876
m_shutdown = true;

src/core/context/contextownaircraftimpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace swift::core::context
142142
ownAircraft.setPilot(m_currentNetworkServer.get().getUser());
143143

144144
// If we already have a model from somehwere, keep it, otherwise init default
145-
ownAircraft.setModel(this->reverseLookupModel(ownAircraft.getModel()));
145+
ownAircraft.setModel(reverseLookupModel(ownAircraft.getModel()));
146146
if (!ownAircraft.getAircraftIcaoCode().hasValidDesignator())
147147
{
148148
ownAircraft.setModel(getDefaultOwnAircraftModel());
@@ -205,7 +205,7 @@ namespace swift::core::context
205205

206206
bool CContextOwnAircraft::updateOwnModel(const CAircraftModel &model, const CIdentifier &identifier)
207207
{
208-
CAircraftModel updateModel(this->reverseLookupModel(model));
208+
CAircraftModel updateModel(reverseLookupModel(model));
209209
{
210210
QWriteLocker l(&m_lockAircraft);
211211
const bool changed = (m_ownAircraft.getModel() != updateModel);

src/core/db/databaseutils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ namespace swift::core::db
179179
if (processEvents && c % 125 == 0)
180180
{
181181
if (!sApp || sApp->isShuttingDown()) { return models; }
182-
sApp->processEventsFor(25);
182+
CApplication::processEventsFor(25);
183183
}
184184

185185
const QString ms(model.getModelString());
@@ -222,7 +222,7 @@ namespace swift::core::db
222222
if (processEvents && c % 125 == 0)
223223
{
224224
if (!sApp || sApp->isShuttingDown()) { return models; }
225-
sApp->processEventsFor(25);
225+
CApplication::processEventsFor(25);
226226
}
227227

228228
const QString ms(model.getModelString());
@@ -268,7 +268,7 @@ namespace swift::core::db
268268
if (modified || model.hasValidDbKey())
269269
{
270270
c++;
271-
if (processEvents && c % 125 == 0) { sApp->processEventsFor(25); }
271+
if (processEvents && c % 125 == 0) { CApplication::processEventsFor(25); }
272272
}
273273
}
274274
CLogMessage(static_cast<CDatabaseUtils *>(nullptr)).info(u"Consolidated %1 models in %2ms")
@@ -374,7 +374,7 @@ namespace swift::core::db
374374
const int percentage = c * 100 / maxModelsCount;
375375
progressIndicator->updateProgressIndicatorAndProcessEvents(percentage);
376376
}
377-
else { sApp->processEventsFor(10); }
377+
else { CApplication::processEventsFor(10); }
378378
}
379379

380380
// values to be skipped

src/gui/components/audionotificationcomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ namespace swift::gui::components
199199
ui->cb_SetupAudioNotificationLogoff->isChecked());
200200

201201
const CStatusMessage msg = m_audioSettings.set(as);
202-
CLogMessage(this).preformatted(msg);
202+
CLogMessage::preformatted(msg);
203203

204204
const auto *sender = qobject_cast<const QCheckBox *>(QObject::sender());
205205
if (checked && sGui && sGui->getCContextAudioBase() && sender)

src/gui/components/copymodelsfromotherswiftversionscomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ namespace swift::gui::components
175175
if (ui->cb_Silent->isChecked())
176176
{
177177
// allow UI updates
178-
sApp->processEventsFor(50);
178+
CApplication::processEventsFor(50);
179179
return true;
180180
}
181181
const QMessageBox::StandardButton reply = QMessageBox::question(

src/gui/components/dbloadoverviewcomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace swift::gui::components
3131
//! \fixme KB 201709 It is hard to judge if it is a good idea to trigger cache admit in a UI component
3232
// althought admit happens in background, this component might trigger cache reads not needed (though it is not
3333
// very likely)
34-
this->admitCaches();
34+
admitCaches();
3535

3636
ui->lbl_DatabaseUrl->setTextFormat(Qt::RichText);
3737
ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);

src/gui/components/firstmodelsetcomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ namespace swift::gui::components
298298

299299
QWidget *CFirstModelSetComponent::mainWindow()
300300
{
301-
QWidget *pw = sGui->mainApplicationWidget();
301+
QWidget *pw = CGuiApplication::mainApplicationWidget();
302302
return pw ? pw : this;
303303
}
304304

src/gui/components/infobarstatuscomponent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ namespace swift::gui::components
250250

251251
void CInfoBarStatusComponent::updateSpacing()
252252
{
253-
if (!sGui || sGui->isShuttingDown() || !sGui->mainApplicationWidget()) { return; }
254-
const int w = sGui->mainApplicationWidget()->width();
253+
if (!sGui || sGui->isShuttingDown() || !CGuiApplication::mainApplicationWidget()) { return; }
254+
const int w = CGuiApplication::mainApplicationWidget()->width();
255255
const int s = (w >= 400) ? 6 : 2;
256256
this->setSpacing(s);
257257
}

src/gui/components/settingshotkeycomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace swift::gui::components
5656
void CSettingsHotkeyComponent::saveSettings()
5757
{
5858
const CStatusMessage msg = m_actionHotkeys.save();
59-
CLogMessage(this).preformatted(msg);
59+
CLogMessage::preformatted(msg);
6060
}
6161

6262
void CSettingsHotkeyComponent::registerDummyPttEntry()

0 commit comments

Comments
 (0)