|
Cppcheck
|
List of applications user has specified to open errors with. More...
#include <applicationlist.h>
Public Member Functions | |
| ApplicationList (QObject *parent=nullptr) | |
| ~ApplicationList () override | |
| bool | loadSettings () |
| Load all applications. More... | |
| void | saveSettings () const |
| Save all applications. More... | |
| int | getApplicationCount () const |
| Get the amount of applications in the list. More... | |
| const Application & | getApplication (const int index) const |
| Get specific application's name. More... | |
| Application & | getApplication (const int index) |
| int | getDefaultApplication () const |
| Return the default application. More... | |
| void | addApplication (const Application &app) |
| Add a new application. More... | |
| void | removeApplication (const int index) |
| Remove an application from the list. More... | |
| void | setDefault (const int index) |
| Set application as default application. More... | |
| void | copy (const ApplicationList *list) |
| Remove all applications from this list and copy all applications from list given as a parameter. More... | |
Protected Member Functions | |
| void | clear () |
| Clear the list. More... | |
Private Member Functions | |
| bool | checkAndAddApplication (const QString &appPath, const QString &name, const QString ¶meters) |
Private Attributes | |
| QList< Application > | mApplications |
| List of applications. More... | |
| int | mDefaultApplicationIndex = -1 |
| Index of the default application. More... | |
List of applications user has specified to open errors with.
Definition at line 35 of file applicationlist.h.
|
explicit |
Definition at line 29 of file applicationlist.cpp.
|
override |
Definition at line 35 of file applicationlist.cpp.
References clear().
| void ApplicationList::addApplication | ( | const Application & | app | ) |
Add a new application.
| app | Application to add. |
Definition at line 146 of file applicationlist.cpp.
References Application::getName(), Application::getPath(), and mApplications.
Referenced by SettingsDialog::addApplication(), checkAndAddApplication(), copy(), and loadSettings().
|
private |
Definition at line 186 of file applicationlist.cpp.
References addApplication(), Application::setName(), Application::setParameters(), and Application::setPath().
Referenced by loadSettings().
|
protected |
Clear the list.
Definition at line 180 of file applicationlist.cpp.
References mApplications, and mDefaultApplicationIndex.
Referenced by copy(), and ~ApplicationList().
| void ApplicationList::copy | ( | const ApplicationList * | list | ) |
Remove all applications from this list and copy all applications from list given as a parameter.
| list | Copying source |
Definition at line 166 of file applicationlist.cpp.
References addApplication(), clear(), getApplication(), getApplicationCount(), getDefaultApplication(), and mDefaultApplicationIndex.
Referenced by SettingsDialog::ok(), and SettingsDialog::SettingsDialog().
| Application & ApplicationList::getApplication | ( | const int | index | ) |
Definition at line 126 of file applicationlist.cpp.
References mApplications.
| const Application & ApplicationList::getApplication | ( | const int | index | ) | const |
Get specific application's name.
| index | Index of the application whose name to get |
Definition at line 136 of file applicationlist.cpp.
References mApplications.
Referenced by ResultsTree::contextMenuEvent(), copy(), SettingsDialog::editApplication(), SettingsDialog::populateApplicationList(), saveSettings(), and ResultsTree::startApplication().
| int ApplicationList::getApplicationCount | ( | ) | const |
Get the amount of applications in the list.
Definition at line 121 of file applicationlist.cpp.
References mApplications.
Referenced by ResultsTree::contextMenuEvent(), copy(), SettingsDialog::populateApplicationList(), saveSettings(), and ResultsTree::startApplication().
|
inline |
Return the default application.
Definition at line 75 of file applicationlist.h.
References mDefaultApplicationIndex.
Referenced by ResultsTree::contextMenuEvent(), copy(), SettingsDialog::editApplication(), SettingsDialog::populateApplicationList(), SettingsDialog::removeApplication(), and ResultsTree::startApplication().
| bool ApplicationList::loadSettings | ( | ) |
Load all applications.
Definition at line 40 of file applicationlist.cpp.
References addApplication(), checkAndAddApplication(), mDefaultApplicationIndex, Application::setName(), Application::setParameters(), Application::setPath(), SETTINGS_APPLICATION_DEFAULT, SETTINGS_APPLICATION_NAMES, SETTINGS_APPLICATION_PARAMS, and SETTINGS_APPLICATION_PATHS.
Referenced by MainWindow::loadSettings().
| void ApplicationList::removeApplication | ( | const int | index | ) |
Remove an application from the list.
| index | Index of the application to remove. |
Definition at line 154 of file applicationlist.cpp.
References mApplications.
Referenced by SettingsDialog::removeApplication().
| void ApplicationList::saveSettings | ( | ) | const |
Save all applications.
Definition at line 101 of file applicationlist.cpp.
References getApplication(), getApplicationCount(), Application::getName(), Application::getParameters(), Application::getPath(), mDefaultApplicationIndex, SETTINGS_APPLICATION_DEFAULT, SETTINGS_APPLICATION_NAMES, SETTINGS_APPLICATION_PARAMS, and SETTINGS_APPLICATION_PATHS.
Referenced by MainWindow::saveSettings().
| void ApplicationList::setDefault | ( | const int | index | ) |
Set application as default application.
| index | Index of the application to make the default one |
Definition at line 159 of file applicationlist.cpp.
References mApplications, and mDefaultApplicationIndex.
Referenced by SettingsDialog::defaultApplication(), and SettingsDialog::removeApplication().
|
private |
List of applications.
Definition at line 130 of file applicationlist.h.
Referenced by addApplication(), clear(), getApplication(), getApplicationCount(), removeApplication(), and setDefault().
|
private |
Index of the default application.
Definition at line 136 of file applicationlist.h.
Referenced by clear(), copy(), getDefaultApplication(), loadSettings(), saveSettings(), and setDefault().