diff --git a/src/frames/aboutdialog.cpp b/src/frames/aboutdialog.cpp index 998cbd1..9f08727 100644 --- a/src/frames/aboutdialog.cpp +++ b/src/frames/aboutdialog.cpp @@ -1,15 +1,18 @@ #include "aboutdialog.h" #include "ui_aboutdialog.h" +#ifdef unix +#include +#endif + AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) { ui->setupUi(this); ui->appName->setText(QString("%1 (%2)").arg(APP_NAME, APP_ARCH)); - QString os_version = APP_OS_VERSION; - os_version = os_version.replace("-D", ""); - ui->version->setText(QString("v%1 %2/%3 (qt %4)").arg(APP_VERSION, APP_OS, os_version, QT_VERSION_STR)); + QString compiler = getCompilerInfo(); + ui->version->setText(QString("v%1-%3 (qt %4)").arg(APP_VERSION, compiler, QT_VERSION_STR)); ui->textEdit_2->append(QString("Qt Open Source %1").arg(QT_VERSION_STR)); } @@ -17,3 +20,17 @@ AboutDialog::~AboutDialog() { delete ui; } + +QString AboutDialog::getCompilerInfo() +{ +#ifdef __GNUC__ + #ifdef __MINGW32__ + return QString("MinGW_%1.%2.%3").arg(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); + #else + return QString("GLIBC_%1").arg(gnu_get_libc_version()); + #endif +#else + return "unknown"; +#endif +} + diff --git a/src/frames/aboutdialog.h b/src/frames/aboutdialog.h index 4474ece..bf9639c 100644 --- a/src/frames/aboutdialog.h +++ b/src/frames/aboutdialog.h @@ -2,6 +2,7 @@ #define ABOUTDIALOG_H #include +#include namespace Ui { class AboutDialog; @@ -17,6 +18,7 @@ public: private: Ui::AboutDialog *ui; + QString getCompilerInfo(); }; #endif // ABOUTDIALOG_H diff --git a/src/frames/filterdialog.cpp b/src/frames/filterdialog.cpp index 20277e5..1f77e2d 100644 --- a/src/frames/filterdialog.cpp +++ b/src/frames/filterdialog.cpp @@ -137,7 +137,7 @@ const Filter FilterDialog::getFilter() void FilterDialog::validateAndAccept() { - if (ui->nameEdit->text().count() == 0) + if (ui->nameEdit->text().length() == 0) { QMessageBox::critical(this, "This filter needs a name", "You need to enter a name to save this filter"); return;