mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
add a binary version check to prevent warn about possible binary incompatibility issues
This commit is contained in:
parent
fcba8aca38
commit
cad2828d1f
16
src/main.cpp
16
src/main.cpp
@ -2,6 +2,7 @@
|
|||||||
#include "newfiledialog.h"
|
#include "newfiledialog.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -15,6 +16,21 @@ int main(int argc, char *argv[])
|
|||||||
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Check r2 version
|
||||||
|
QString r2version = r_core_version();
|
||||||
|
QString localVersion = "" R2_GITTAP;
|
||||||
|
if(r2version != localVersion)
|
||||||
|
{
|
||||||
|
QMessageBox msg;
|
||||||
|
msg.setIcon(QMessageBox::Critical);
|
||||||
|
msg.setWindowIcon(QIcon(":/new/prefix1/img/logo-small.png"));
|
||||||
|
msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||||
|
msg.setWindowTitle("Version mismatch!");
|
||||||
|
msg.setText(QString("The version used to compile iaito (%1) does not match the binary version of radare2 (%2). This could result in unexpected behaviour. Are you sure you want to continue?").arg(localVersion, r2version));
|
||||||
|
if(msg.exec() == QMessageBox::No)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
NewFileDialog n;
|
NewFileDialog n;
|
||||||
n.show();
|
n.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
Loading…
Reference in New Issue
Block a user