diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index a1f4cf68..4f55c27c 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -30,6 +30,15 @@ # include #endif +// Rizin before 301e5af2170d9f3ed1edd658b0f9633f31fc4126 +// has RZ_GITTAP defined and uses it in rz_core_version(). +// After that, RZ_GITTAP is not defined anymore and RZ_VERSION is used. +#ifdef RZ_GITTAP +#define CUTTER_COMPILE_TIME_RZ_VERSION "" RZ_GITTAP +#else +#define CUTTER_COMPILE_TIME_RZ_VERSION "" RZ_VERSION +#endif + CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc, argv) { // Setup application information @@ -76,7 +85,8 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc // Check rizin version QString rzversion = rz_core_version(); - QString localVersion = "" RZ_GITTAP; + QString localVersion = CUTTER_COMPILE_TIME_RZ_VERSION; + qDebug() << rzversion << localVersion; if (rzversion != localVersion) { QMessageBox msg; msg.setIcon(QMessageBox::Critical); diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 1fb03120..326fb600 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -3890,6 +3890,12 @@ void CutterCore::loadScript(const QString &scriptname) triggerRefreshAll(); } +QString CutterCore::getRizinVersionReadable() +{ + return QString("%1 (%2)").arg(QString::fromUtf8(RZ_VERSION), + QString::fromUtf8(RZ_GITTIP).left(7)); +} + QString CutterCore::getVersionInformation() { int i; @@ -3924,7 +3930,7 @@ QString CutterCore::getVersionInformation() /* ... */ { NULL, NULL } }; - versionInfo.append(QString("%1 rz\n").arg(RZ_GITTAP)); + versionInfo.append(QString("%1 rz\n").arg(getRizinVersionReadable())); for (i = 0; vcs[i].name; i++) { struct vcs_t *v = &vcs[i]; const char *name = v->callback(); diff --git a/src/core/Cutter.h b/src/core/Cutter.h index a577ee9a..42e3666a 100644 --- a/src/core/Cutter.h +++ b/src/core/Cutter.h @@ -147,6 +147,7 @@ public: { return asyncCmdEsil(command.toUtf8().constData(), task); } + QString getRizinVersionReadable(); QString getVersionInformation(); QJsonDocument parseJson(const char *res, const char *cmd = nullptr); diff --git a/src/dialogs/AboutDialog.cpp b/src/dialogs/AboutDialog.cpp index 49a3ff5c..d332cb29 100644 --- a/src/dialogs/AboutDialog.cpp +++ b/src/dialogs/AboutDialog.cpp @@ -25,8 +25,9 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia ui->logoSvgWidget->load(Config()->getLogoFile()); QString aboutString( - tr("Version") + " " CUTTER_VERSION_FULL "
" + tr("Using rizin-") + RZ_GITTAP - + "
" + buildQtVersionString() + "

" + tr("Optional Features:") + "
" + tr("Version") + " " CUTTER_VERSION_FULL "
" + tr("Using rizin ") + + Core()->getRizinVersionReadable() + "
" + buildQtVersionString() + "

" + + tr("Optional Features:") + "
" + QString("Python: %1
") .arg( #ifdef CUTTER_ENABLE_PYTHON