1 #include <QApplication>
4 #include <QStandardPaths>
10 static QDir path(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +
"/.config/autostart");
11 static const QString file =
"ckb.desktop";
12 static const QString internalFile(
":/txt/ckb.desktop");
13 #elif defined(Q_OS_MACX)
14 static QDir path(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +
"/Library/LaunchAgents");
15 static const QString file =
"com.ckb.ckb.plist";
16 static const QString internalFile(
":/txt/com.ckb.ckb.plist");
23 return QDir::root().absoluteFilePath(QStandardPaths::findExecutable(
"ckb")) == qApp->applicationFilePath();
24 #elif defined(Q_OS_MACX)
25 return qApp->applicationFilePath().startsWith(
"/Applications/ckb.app", Qt::CaseInsensitive);
35 if(!path.exists() || !path.exists(file))
47 QDir::home().mkpath(path.absolutePath());
48 QFile::copy(internalFile, path.absoluteFilePath(file));
57 QFile::remove(path.absoluteFilePath(file));
static void set(const QString &key, const QVariant &value)
static QVariant get(const QString &key, const QVariant &defaultValue=QVariant())
static const QString settingPath