Skip to content

Commit 9cdd8ff

Browse files
refactor: drop qAsConst conditional compile
since we need Qt 5.7 at least
1 parent dbbe360 commit 9cdd8ff

File tree

7 files changed

+3
-33
lines changed

7 files changed

+3
-33
lines changed

makespec/BUILDVERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
92
1+
93

src/addtestcaseswizard.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
#include <QMessageBox>
1616
#include <algorithm>
1717

18-
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
19-
#define qAsConst
20-
#endif
21-
2218
AddTestCasesWizard::AddTestCasesWizard(QWidget *parent) : QWizard(parent), ui(new Ui::AddTestCasesWizard) {
2319
ui->setupUi(this);
2420
ui->fullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore(), this));

src/base/LemonTranslator.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ namespace Lemon::common {
3838
void LemonTranslator::refreshTranslations() {
3939
searchPaths = getLanguageSearchPaths();
4040
languages.clear();
41-
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
42-
for (const auto &path : searchPaths)
43-
#else
44-
for (const auto &path : qAsConst(searchPaths))
45-
#endif
46-
{
41+
for (const auto &path : qAsConst(searchPaths)) {
4742
languages << QDir(path).entryList({"*.qm"}, QDir::Hidden | QDir::Files);
4843
}
4944
std::transform(languages.begin(), languages.end(), languages.begin(),
@@ -53,12 +48,7 @@ namespace Lemon::common {
5348
}
5449

5550
auto LemonTranslator::InstallTranslation(const QString &code) -> bool {
56-
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
57-
for (const auto &path : searchPaths)
58-
#else
59-
for (const auto &path : qAsConst(searchPaths))
60-
#endif
61-
{
51+
for (const auto &path : qAsConst(searchPaths)) {
6252
if (FileExistsIn(QDir(path), code + ".qm")) {
6353
DEBUG("Found " + code + " in folder: " + path);
6454
QTranslator *translatorNew = new QTranslator();

src/core/testcase.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
//
1111
#include "base/settings.h"
1212

13-
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
14-
#define qAsConst
15-
#endif
16-
1713
TestCase::TestCase(QObject *parent) : QObject(parent) {}
1814

1915
void TestCase::copyTo(TestCase *to) {

src/exttestcasemodifier.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
#include "core/testcase.h"
1313
#include "exttestcaseupdaterdialog.h"
1414

15-
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
16-
#define qAsConst
17-
#endif
18-
1915
ExtTestCaseModifier::ExtTestCaseModifier(QWidget *parent) : QWidget(parent), ui(new Ui::ExtTestCaseModifier) {
2016
ui->setupUi(this);
2117

src/exttestcasetable.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
//
1313
#include <QHeaderView>
1414

15-
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
16-
#define qAsConst
17-
#endif
18-
1915
ExtTestCaseTable::ExtTestCaseTable(QWidget * /*parent*/) {
2016
clear();
2117

src/exttestcaseupdaterdialog.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
#include <QMessageBox>
1616
#include <QValidator>
1717

18-
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
19-
#define qAsConst
20-
#endif
21-
2218
ExtTestCaseUpdaterDialog::ExtTestCaseUpdaterDialog(QWidget *parent, Task *nowTask,
2319
const Settings *nowSettings, int nowCaseNumber,
2420
int editScore, int editData, int editTime, int editMemory,

0 commit comments

Comments
 (0)