MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / populateApplicationList

Method populateApplicationList

gui/settingsdialog.cpp:295–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295void SettingsDialog::populateApplicationList()
296{
297 const int defapp = mTempApplications->getDefaultApplication();
298 for (int i = 0; i < mTempApplications->getApplicationCount(); i++) {
299 const Application& app = mTempApplications->getApplication(i);
300 QString name = app.getName();
301 if (i == defapp) {
302 name += " ";
303 name += tr("[Default]");
304 }
305 mUI->mListWidget->addItem(name);
306 }
307
308 // Select default application, or if there is no default app then the
309 // first item.
310 if (defapp == -1)
311 mUI->mListWidget->setCurrentRow(0);
312 else {
313 if (mTempApplications->getApplicationCount() > defapp)
314 mUI->mListWidget->setCurrentRow(defapp);
315 else
316 mUI->mListWidget->setCurrentRow(0);
317 }
318}
319
320void SettingsDialog::ok()
321{

Callers

nothing calls this directly

Calls 3

getDefaultApplicationMethod · 0.80
addItemMethod · 0.80
getApplicationCountMethod · 0.45

Tested by

no test coverage detected