From ce66fe98b0e54d940e1dc1815df62f4d3a9092c3 Mon Sep 17 00:00:00 2001 From: a1ext Date: Tue, 30 Oct 2018 17:02:01 +0300 Subject: [PATCH] Windows&Unicode - build scripts. Fixes #589 (#890) * Fixes #589 Build scripts were updated Fixed utf8 file path displaying in Dashboard widget * Fixed meson build --- meson.py | 1 + prepare_r2.bat | 2 +- src/widgets/Dashboard.cpp | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meson.py b/meson.py index 9e3bfd3c..1aa846b5 100644 --- a/meson.py +++ b/meson.py @@ -54,6 +54,7 @@ def build(args): defines.append('-Dradare2:r2_incdir=radare2/include') defines.append('-Dradare2:r2_libdir=radare2/lib') defines.append('-Dradare2:r2_datdir=radare2/share') + defines.append('-Dc_args=-D_UNICODE -DUNICODE') r2_meson_mod.meson(os.path.join(ROOT, 'src'), cutter_builddir, prefix=cutter_builddir, backend=args.backend, release=args.release, shared=False, options=defines) diff --git a/prepare_r2.bat b/prepare_r2.bat index d59e7702..28f60e38 100644 --- a/prepare_r2.bat +++ b/prepare_r2.bat @@ -16,6 +16,6 @@ ECHO Building radare2 (%PLATFORM%) CD radare2 git clean -xfd RMDIR /S /Q ..\%R2DIST% -python sys\meson.py --release --shared --install=..\%R2DIST% --options r2_datdir=radare2/share +python sys\meson.py --release --shared --install=..\%R2DIST% --options "r2_datdir=radare2/share" "c_args=-D_UNICODE -DUNICODE" IF !ERRORLEVEL! NEQ 0 EXIT /B 1 COPY /Y build\shlr\libr2sdb.a ..\%R2DIST%\lib\r_sdb.lib diff --git a/src/widgets/Dashboard.cpp b/src/widgets/Dashboard.cpp index 111229fa..7033609a 100644 --- a/src/widgets/Dashboard.cpp +++ b/src/widgets/Dashboard.cpp @@ -39,7 +39,13 @@ void Dashboard::updateContents() QJsonObject item = docu.object()["core"].toObject(); QJsonObject item2 = docu.object()["bin"].toObject(); - this->ui->fileEdit->setText(item["file"].toString()); +#ifdef Q_OS_WIN + QString fname = item["file"].toString(); + fname = QString::fromUtf8(fname.toLatin1()); +#else // Q_OS_WIN + QString fname = item["file"].toString(); +#endif // Q_OS_WIN + this->ui->fileEdit->setText(fname); this->ui->formatEdit->setText(item["format"].toString()); this->ui->modeEdit->setText(item["mode"].toString()); this->ui->typeEdit->setText(item["type"].toString());