Skip to content

Commit 0424847

Browse files
refactor: drop asprintf conditional compile
since Qt 5.7 needed
1 parent 1cfca7c commit 0424847

File tree

3 files changed

+1
-25
lines changed

3 files changed

+1
-25
lines changed

makespec/BUILDVERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
96
1+
97

src/component/exportutil/exportutil.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ auto ExportUtil::getContestantHtmlCode(Contest *contest, Contestant *contestant,
183183
"border-color: #ccc;\">";
184184

185185
if (timeUsed[j][k] != -1) {
186-
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
187186
htmlCode += QString("").asprintf("%.3lf s", double(timeUsed[j][k]) / 1000);
188-
#else
189-
htmlCode += QString("").sprintf("%.3lf s", double(timeUsed[j][k]) / 1000);
190-
#endif
191187
} else {
192188
htmlCode += tr("Invalid");
193189
}
@@ -197,11 +193,7 @@ auto ExportUtil::getContestantHtmlCode(Contest *contest, Contestant *contestant,
197193
"border-color: #ccc;\">";
198194

199195
if (memoryUsed[j][k] != -1) {
200-
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
201196
htmlCode += QString("").asprintf("%.3lf MB", double(memoryUsed[j][k]) / 1024 / 1024);
202-
#else
203-
htmlCode += QString("").sprintf("%.3lf MB", double(memoryUsed[j][k]) / 1024 / 1024);
204-
#endif
205197
} else {
206198
htmlCode += tr("Invalid");
207199
}
@@ -540,11 +532,7 @@ auto ExportUtil::getSmallerContestantHtmlCode(Contest *contest, Contestant *cont
540532
htmlCode += "<td>";
541533

542534
if (timeUsed[j][k] != -1) {
543-
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
544535
htmlCode += QString("").asprintf("%.3lf s", double(timeUsed[j][k]) / 1000);
545-
#else
546-
htmlCode += QString("").sprintf("%.3lf s", double(timeUsed[j][k]) / 1000);
547-
#endif
548536
} else {
549537
htmlCode += tr("Invalid");
550538
}
@@ -553,11 +541,7 @@ auto ExportUtil::getSmallerContestantHtmlCode(Contest *contest, Contestant *cont
553541
htmlCode += "<td>";
554542

555543
if (memoryUsed[j][k] != -1) {
556-
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
557544
htmlCode += QString("").asprintf("%.3lf MB", double(memoryUsed[j][k]) / 1024 / 1024);
558-
#else
559-
htmlCode += QString("").sprintf("%.3lf MB", double(memoryUsed[j][k]) / 1024 / 1024);
560-
#endif
561545
} else {
562546
htmlCode += tr("Invalid");
563547
}

src/detaildialog.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,7 @@ void DetailDialog::refreshViewer(Contest *_contest, Contestant *_contestant) {
182182
htmlCode += R"(<td nowrap="nowrap" align="center" valign="middle">)";
183183

184184
if (timeUsed[j][k] != -1) {
185-
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
186185
htmlCode += QString("").asprintf("%.3lf s", double(timeUsed[j][k]) / 1000);
187-
#else
188-
htmlCode += QString("").sprintf("%.3lf s", double(timeUsed[j][k]) / 1000);
189-
#endif
190186
} else {
191187
htmlCode += tr("Invalid");
192188
}
@@ -195,11 +191,7 @@ void DetailDialog::refreshViewer(Contest *_contest, Contestant *_contestant) {
195191
htmlCode += R"(<td nowrap="nowrap" align="center" valign="middle">)";
196192

197193
if (memoryUsed[j][k] != -1) {
198-
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
199194
htmlCode += QString("").asprintf("%.3lf MB", double(memoryUsed[j][k]) / 1024 / 1024);
200-
#else
201-
htmlCode += QString("").sprintf("%.3lf MB", double(memoryUsed[j][k]) / 1024 / 1024);
202-
#endif
203195
} else {
204196
htmlCode += tr("Invalid");
205197
}

0 commit comments

Comments
 (0)