Update for RZ_GITTAP Removal (#2608)

This commit is contained in:
Florian Märkl 2021-02-24 18:52:35 +01:00 committed by GitHub
parent f95751c4cd
commit 6da02c6a02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 4 deletions

View File

@ -30,6 +30,15 @@
# include <RzGhidraDecompiler.h>
#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);

View File

@ -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();

View File

@ -147,6 +147,7 @@ public:
{
return asyncCmdEsil(command.toUtf8().constData(), task);
}
QString getRizinVersionReadable();
QString getVersionInformation();
QJsonDocument parseJson(const char *res, const char *cmd = nullptr);

View File

@ -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 "<br/>" + tr("Using rizin-") + RZ_GITTAP
+ "<br/>" + buildQtVersionString() + "<p><b>" + tr("Optional Features:") + "</b><br/>"
tr("Version") + " " CUTTER_VERSION_FULL "<br/>" + tr("Using rizin ")
+ Core()->getRizinVersionReadable() + "<br/>" + buildQtVersionString() + "<p><b>"
+ tr("Optional Features:") + "</b><br/>"
+ QString("Python: %1<br/>")
.arg(
#ifdef CUTTER_ENABLE_PYTHON