Init Python before RCore

This commit is contained in:
Florian Märkl 2019-02-20 18:52:11 +01:00
parent a93c5e225f
commit d1f5da9946
5 changed files with 19 additions and 19 deletions

View File

@ -12,7 +12,7 @@
#include "Cutter.h"
#include "sdb.h"
Q_GLOBAL_STATIC(ccClass, uniqueInstance)
Q_GLOBAL_STATIC(CutterCore, uniqueInstance)
#define R_JSON_KEY(name) static const QString name = QStringLiteral(#name)
@ -139,6 +139,16 @@ static void cutterREventCallback(REvent *, int type, void *user, void *data)
CutterCore::CutterCore(QObject *parent) :
QObject(parent)
{
}
CutterCore *CutterCore::instance()
{
return uniqueInstance;
}
void CutterCore::initialize()
{
r_cons_new(); // initialize console
core_ = r_core_new();
@ -174,12 +184,6 @@ CutterCore::CutterCore(QObject *parent) :
asyncTaskManager = new AsyncTaskManager(this);
}
CutterCore *CutterCore::instance()
{
return uniqueInstance;
}
QList<QString> CutterCore::sdbList(QString path)
{
CORE_LOCK();

View File

@ -412,13 +412,14 @@ Q_DECLARE_METATYPE(VariableDescription)
class CutterCore: public QObject
{
Q_OBJECT
friend class ccClass;
public:
explicit CutterCore(QObject *parent = nullptr);
~CutterCore();
static CutterCore *instance();
void initialize();
AsyncTaskManager *getAsyncTaskManager() { return asyncTaskManager; }
RVA getOffset() const { return core_->offset; }
@ -779,7 +780,7 @@ private:
MemoryWidgetType memoryWidgetPriority;
QString notes;
RCore *core_;
RCore *core_ = nullptr;
AsyncTaskManager *asyncTaskManager;
RVA offsetPriorDebugging = RVA_INVALID;
QErrorMessage msgBox;
@ -789,8 +790,4 @@ private:
};
class ccClass : public CutterCore
{
};
#endif // CUTTER_H

View File

@ -104,13 +104,13 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
Python()->initialize();
#endif
Core()->initialize();
Core()->setSettings();
Config()->loadInitial();
bool analLevelSpecified = false;
int analLevel = 0;
// Initialize CutterCore and set default settings
Core()->setSettings();
if (cmd_parser.isSet(analOption)) {
analLevel = cmd_parser.value(analOption).toInt(&analLevelSpecified);

View File

@ -64,7 +64,6 @@ Configuration::Configuration() : QObject()
.arg(s.fileName())
);
}
loadInitial();
}
Configuration *Configuration::instance()

View File

@ -27,8 +27,6 @@ private:
QSettings s;
static Configuration *mPtr;
void loadInitial();
// Colors
void loadBaseThemeNative();
void loadBaseThemeDark();
@ -44,6 +42,8 @@ public:
Configuration();
static Configuration *instance();
void loadInitial();
void resetAll();
// Languages