Skip to content

Commit 0104036

Browse files
committed
GUI: Initialize Settings in main.
Setting organization and program name in main() allows us to cleanup Settings class usage. As we don't need to keep using the one instance of Settings but can create new Settings class whenever we need to access settings. According to the Qt documentation creating Settings class is fast.
1 parent 31e85f4 commit 0104036

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

gui/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919

2020
#include <QApplication>
21+
#include <QCoreApplication>
2122
#include <QTextCodec>
2223
#include <QTranslator>
2324
#include <QMetaType>
@@ -36,6 +37,9 @@ int main(int argc, char *argv[])
3637
if (!CheckArgs(app.arguments()))
3738
return 0;
3839

40+
QCoreApplication::setOrganizationName("Cppcheck");
41+
QCoreApplication::setApplicationName("Cppcheck-GUI");
42+
3943
app.setWindowIcon(QIcon(":icon.png"));
4044

4145
// Register this metatype that is used to transfer error info

0 commit comments

Comments
 (0)