-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlibfusion.cpp
More file actions
43 lines (32 loc) · 793 Bytes
/
libfusion.cpp
File metadata and controls
43 lines (32 loc) · 793 Bytes
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
#include "libfusion.h"
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QStandardPaths>
#else
#include <QDesktopServices>
#endif
LibFusion::LibFusion()
{
}
QDir LibFusion::getWorkingDir()
{
QString p = QDir::currentPath();
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
p = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#else
p = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
#endif
int idx = p.lastIndexOf("/");
if( idx == -1)
idx = p.lastIndexOf("\\");
p = p.left(idx+1);
p += "Fusion";
return QDir(p);
}
bool LibFusion::makeSureWorkingDirExists()
{
if (!getWorkingDir().exists())
{
return getWorkingDir().mkpath(".");
}
return true;
}