Program central hub of information. More...
#include <application.h>
Public Member Functions | |
bool | isGameFileIntegrityCheckEnabled () const |
Do we verify the locally stored game files? | |
bool | isRunning () const |
Plugins and other threads can use this to figure out if program is closing. | |
MainWindow * | mainWindow () const |
MainWindow of the program. | |
QWidget * | mainWindowAsQWidget () const |
Returns MainWindow as a QWidget. | |
const QStringList & | originalArgs () const |
The unmodified list of arguments Doomseeker was launched with. | |
void | setMainWindow (MainWindow *mainWindow) |
void | stopRunning () |
Makes isRunning() return false. | |
Static Public Member Functions | |
static void | deinit () |
Deinitializes the program; executed when program is shutting down. | |
static QIcon | icon () |
static void | init (int &argc, char **argv) |
static Application * | instance () |
static bool | isInit () |
Static Public Attributes | |
static const QString | NAME = "doomseeker" |
Program name - doomseeker. | |
Program central hub of information.
Accessors provide plugins with certain objects and data that is not encapsulated in any singleton. Calling any non-const method from plugin perspective may result in undefined behavior of the program or even other plugins.
Definition at line 45 of file application.h.
|
static |
Deinitializes the program; executed when program is shutting down.
Doesn't delete the actual instance() but calls destroy() method.
That way certain data fields can still be accessed after the program is deinitialized. Actual instance is never deleted explicitly, and OS will clear the memory anyway.
Definition at line 63 of file application.cpp.
bool Application::isGameFileIntegrityCheckEnabled | ( | ) | const |
Do we verify the locally stored game files?
Tell if the checksum verification of locally stored game files is enabled. If it's disabled, plugins may optimize to not ask for the checksums of remote files.
This method was introduced in Doomseeker 1.5.
Definition at line 106 of file application.cpp.
bool Application::isRunning | ( | ) | const |
Plugins and other threads can use this to figure out if program is closing.
Threads should exit their loops and let the program close gracefully.
Definition at line 111 of file application.cpp.
MainWindow * Application::mainWindow | ( | ) | const |
MainWindow of the program.
Might be nullptr if the current run doesn't create a MainWindow or the MainWindow was closed.
Definition at line 116 of file application.cpp.
QWidget * Application::mainWindowAsQWidget | ( | ) | const |
Returns MainWindow as a QWidget.
Useful for plugins that need to specify a parent widget for dialog boxes or such, as the MainWindow class itself is not exported.
Might be nullptr if current run doesn't create a MainWindow or the MainWindow was closed.
Definition at line 121 of file application.cpp.
const QStringList & Application::originalArgs | ( | ) | const |
The unmodified list of arguments Doomseeker was launched with.
This list includes the arguments that can be "consumed" by Qt.
This method was introduced in Doomseeker 1.4.
Definition at line 131 of file application.cpp.
void Application::stopRunning | ( | ) |
Makes isRunning() return false.
Called when program is shutting down.
Definition at line 136 of file application.cpp.
|
static |
Program name - doomseeker.
Definition at line 51 of file application.h.