mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Init Python before RCore
This commit is contained in:
parent
a93c5e225f
commit
d1f5da9946
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -64,7 +64,6 @@ Configuration::Configuration() : QObject()
|
||||
.arg(s.fileName())
|
||||
);
|
||||
}
|
||||
loadInitial();
|
||||
}
|
||||
|
||||
Configuration *Configuration::instance()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user