-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.cpp
More file actions
71 lines (56 loc) · 1.11 KB
/
app.cpp
File metadata and controls
71 lines (56 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "app.h"
#include <QApplication>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(app, "app")
App::App(QObject *parent)
: QObject { parent }
{
initialize();
}
Editor *App::editor() const
{
return m_editor;
}
LevelHandler *App::levelHandler() const
{
return m_levelHandler;
}
bool App::debugMode() const
{
return m_debugMode;
}
void App::setDebugMode(bool flag)
{
if (m_debugMode == flag) {
return;
}
m_debugMode = flag;
emit debugModeChanged();
}
void App::initialize()
{
qCInfo(app) << "initializing";
m_levelHandler = new LevelHandler(this);
m_editor = new Editor(this);
connect(m_editor, &Editor::levelSavedSuccessfully, m_levelHandler, &LevelHandler::updateUserLevelsModel);
}
bool App::debugBox2d() const
{
return m_debugBox2d;
}
void App::setDebugBox2d(bool flag)
{
if (m_debugBox2d == flag) {
return;
}
m_debugBox2d = flag;
emit debugBox2dChanged();
}
QString App::musicPath() const
{
#if defined(Q_OS_IOS)
return QString("file://%1/").arg(qApp->applicationDirPath());
#else
return QString("file:///%1/%2/").arg(qApp->applicationDirPath()).arg("music");
#endif
}