Add Loading ~/.cutterrc (#1644)

This commit is contained in:
Florian Märkl 2019-07-11 12:32:56 +02:00 committed by GitHub
parent 78ff1459c9
commit c7d582f00a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -116,6 +116,7 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
Core()->initialize();
Core()->setSettings();
Config()->loadInitial();
Core()->loadCutterRC();
bool analLevelSpecified = false;
int analLevel = 0;

View File

@ -185,6 +185,22 @@ void CutterCore::initialize()
asyncTaskManager = new AsyncTaskManager(this);
}
void CutterCore::loadCutterRC()
{
auto home = QDir::home();
if (!home.exists()) {
return;
}
auto cutterRCFileInfo = QFileInfo(home, ".cutterrc");
if (!cutterRCFileInfo.isFile()) {
return;
}
auto path = cutterRCFileInfo.absoluteFilePath();
qInfo() << "Loading" << path;
r_core_cmd_file(core_, path.toUtf8().constData());
}
QList<QString> CutterCore::sdbList(QString path)
{
CORE_LOCK();

View File

@ -44,6 +44,7 @@ public:
static CutterCore *instance();
void initialize();
void loadCutterRC();
AsyncTaskManager *getAsyncTaskManager() { return asyncTaskManager; }