Skip to content

Commit 4d0a5dc

Browse files
updated
1 parent a07bc38 commit 4d0a5dc

File tree

13 files changed

+5
-237
lines changed

13 files changed

+5
-237
lines changed

.github/workflows/actions.yml

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -342,54 +342,3 @@ jobs:
342342
run: |
343343
cd tools\test\releasetest
344344
.\releasetest.bat
345-
346-
build-windows-qt62-msvc2019:
347-
runs-on: windows-latest
348-
steps:
349-
- uses: actions/checkout@main
350-
- name: Install Qt
351-
uses: jurplel/install-qt-action@v4
352-
with:
353-
version: '6.2.2'
354-
host: 'windows'
355-
target: 'desktop'
356-
- name: Install VisualStudio tools
357-
run: |
358-
choco install visualstudio2019community -y
359-
choco install visualstudio2019-workload-nativedesktop -y
360-
choco install sqlite -y
361-
- name: Build for debug mode
362-
shell: cmd
363-
run: |
364-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
365-
set CL=/MP
366-
qmake -version
367-
call configure.bat --enable-debug
368-
cd src
369-
nmake
370-
nmake install
371-
cd ..\tools
372-
nmake
373-
nmake install
374-
- name: Test modules
375-
shell: cmd
376-
run: |
377-
cd src/test
378-
call testall.bat
379-
- name: Build for release mode
380-
shell: cmd
381-
run: |
382-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
383-
set CL=/MP
384-
call configure.bat
385-
cd src
386-
nmake
387-
nmake install
388-
cd ..\tools
389-
nmake
390-
nmake install
391-
- name: Test release
392-
shell: cmd
393-
run: |
394-
cd tools\test\releasetest
395-
.\releasetest.bat

src/test/rand/main.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#include <QTest>
22
#include <QtCore>
33
#include <QHostInfo>
4-
#if QT_VERSION >= 0x050a00
54
#include <QRandomGenerator>
6-
#endif
75
#include <tglobal.h>
86
#include <stdio.h>
97
#include <random>
@@ -53,10 +51,8 @@ private slots:
5351
void minstd_rand();
5452
void ranlux24_base();
5553
void ranlux48_base();
56-
#if QT_VERSION >= 0x050a00
5754
void rand_QRandomGenerator_global();
5855
void rand_QRandomGenerator_system();
59-
#endif
6056
void randomstring1();
6157
void randomstring2();
6258

@@ -161,7 +157,7 @@ void TestRand::ranlux48_base()
161157
}
162158
}
163159

164-
#if QT_VERSION >= 0x050a00
160+
165161
void TestRand::rand_QRandomGenerator_global()
166162
{
167163
QBENCHMARK {
@@ -180,7 +176,7 @@ void TestRand::rand_QRandomGenerator_system()
180176
mutex.unlock();
181177
}
182178
}
183-
#endif
179+
184180

185181
void TestRand::randomstring1()
186182
{

tools/tfmanager/main.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
#include <TWebApplication>
1717
#include <tfcore.h>
1818
#include <tprocessinfo.h>
19-
#if QT_VERSION < 0x060000
20-
# include <QTextCodec>
21-
#endif
2219
#include <cinttypes>
2320

2421
#ifdef Q_OS_UNIX
@@ -63,36 +60,6 @@ enum CommandOption {
6360
ShowSettings,
6461
};
6562

66-
67-
#if QT_VERSION < 0x050400
68-
#ifdef Q_OS_WIN
69-
const QMap<int, QString> winVersion = {
70-
{QSysInfo::WV_XP, "Windows XP"},
71-
{QSysInfo::WV_2003, "Windows Server 2003"},
72-
{QSysInfo::WV_VISTA, "Windows Vista or Windows Server 2008"},
73-
{QSysInfo::WV_WINDOWS7, "Windows 7 or Windows Server 2008 R2"},
74-
{QSysInfo::WV_WINDOWS8, "Windows 8 or Windows Server 2012"},
75-
#if QT_VERSION >= 0x050200
76-
{QSysInfo::WV_WINDOWS8_1, "Windows 8.1 or Windows Server 2012 R2"},
77-
#endif
78-
};
79-
#endif
80-
81-
#ifdef Q_OS_DARWIN
82-
const QMap<int, QString> macxVersion = {
83-
{QSysInfo::MV_10_3, "Mac OS X 10.3 Panther"},
84-
{QSysInfo::MV_10_4, "Mac OS X 10.4 Tiger"},
85-
{QSysInfo::MV_10_5, "Mac OS X 10.5 Leopard"},
86-
{QSysInfo::MV_10_6, "Mac OS X 10.6 Snow Leopard"},
87-
{QSysInfo::MV_10_7, "Mac OS X 10.7 Lion"},
88-
{QSysInfo::MV_10_8, "Mac OS X 10.8 Mountain Lion"},
89-
#if QT_VERSION >= 0x050100
90-
{QSysInfo::MV_10_9, "Mac OS X 10.9 Mavericks"},
91-
#endif
92-
};
93-
#endif
94-
#endif
95-
9663
const QMap<QString, int> options = {
9764
{"-e", EnvironmentSpecified},
9865
{"-s", SocketSpecified},
@@ -189,20 +156,7 @@ void writeStartupLog()
189156
tSystemInfo("TreeFrog Framework version {}", TF_VERSION_STR);
190157

191158
QString qtversion = QLatin1String("Execution environment: Qt ") + qVersion();
192-
#if QT_VERSION >= 0x050400
193159
qtversion += QLatin1String(" / ") + QSysInfo::prettyProductName();
194-
#else
195-
#if defined(Q_OS_WIN)
196-
qtversion += QLatin1String(" / ") + winVersion.value(QSysInfo::WindowsVersion, "Windows");
197-
#elif defined(Q_OS_DARWIN)
198-
qtversion += QLatin1String(" / ") + macxVersion()->value(QSysInfo::MacintoshVersion, "Mac OS X");
199-
#elif defined(Q_OS_UNIX)
200-
struct utsname uts;
201-
if (uname(&uts) == 0) {
202-
qtversion += QString(" / %1 %2").arg(uts.sysname).arg(uts.release);
203-
}
204-
#endif
205-
#endif
206160
tSystemInfo("{}", (const char *)qtversion.toLatin1().data());
207161
}
208162

@@ -467,12 +421,6 @@ int managerMain(int argc, char *argv[])
467421
{
468422
TWebApplication app(argc, argv);
469423

470-
#if QT_VERSION < 0x060000
471-
// Sets codec
472-
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
473-
QTextCodec::setCodecForLocale(codec);
474-
#endif
475-
476424
if (!checkArguments()) {
477425
return 1;
478426
}

tools/tfserver/main.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
#include <cstdlib>
2222
#include <cstdio>
2323
#include <glog/logging.h>
24-
#if QT_VERSION < 0x060000
25-
# include <QTextCodec>
26-
#endif
24+
2725

2826
constexpr auto DEBUG_MODE_OPTION = "--debug";
2927
constexpr auto SOCKET_OPTION = "-s";
@@ -229,12 +227,6 @@ int main(int argc, char *argv[])
229227
tSystemInfo("Application's default locale: {}", qUtf8Printable(locale.name()));
230228
}
231229

232-
#if QT_VERSION < 0x060000
233-
// Sets codec
234-
QTextCodec *codec = webapp.codecForInternal();
235-
QTextCodec::setCodecForLocale(codec);
236-
#endif
237-
238230
if (!webapp.webRootExists()) {
239231
tSystemError("No such directory");
240232
std::fprintf(stderr, "No such directory\n");

tools/tmake/main.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@
1111
#include <QMap>
1212
#include <QSettings>
1313
#include <QString>
14-
#if QT_VERSION < 0x060000
15-
# include <QTextCodec>
16-
#endif
1714

1815
constexpr auto DEFAULT_OUTPUT_DIR = "viewcodes";
19-
2016
extern QString devIni;
2117
extern int defaultTrimMode;
2218

@@ -69,19 +65,6 @@ int main(int argc, char *argv[])
6965
QSettings appSetting(appIni, QSettings::IniFormat);
7066
QSettings devSetting(devIni, QSettings::IniFormat);
7167

72-
// Default codec
73-
#if QT_VERSION < 0x060000
74-
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
75-
QString codecName = appSetting.value("InternalEncoding").toString();
76-
if (!codecName.isEmpty()) {
77-
QTextCodec *c = QTextCodec::codecForName(codecName.toLatin1().constData());
78-
if (c) {
79-
codec = c;
80-
}
81-
}
82-
QTextCodec::setCodecForLocale(codec);
83-
#endif
84-
8568
defaultTrimMode = devSetting.value("Erb.DefaultTrimMode", "1").toInt();
8669
std::printf("Erb.DefaultTrimMode: %d\n", defaultTrimMode);
8770

tools/tmake/test/tmaketest.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ void TestTfpconverter::parse()
6060
QFile file(fileName);
6161
QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
6262
QTextStream ts(&file);
63-
#if QT_VERSION < 0x060000
64-
ts.setCodec("UTF-8");
65-
#endif
6663
QString html = ts.readAll();
6764

6865
THtmlParser parser;
@@ -72,9 +69,6 @@ void TestTfpconverter::parse()
7269
QFile res("result.phtm");
7370
res.open(QIODevice::WriteOnly | QIODevice::Truncate);
7471
QTextStream rests(&res);
75-
#if QT_VERSION < 0x060000
76-
rests.setCodec("UTF-8");
77-
#endif
7872
rests << result;
7973
res.close();
8074

@@ -131,23 +125,14 @@ void TestTfpconverter::otamaconvert()
131125
QFile htmlFile(htmlFileName);
132126
QVERIFY(htmlFile.open(QIODevice::ReadOnly | QIODevice::Text));
133127
QTextStream tshtml(&htmlFile);
134-
#if QT_VERSION < 0x060000
135-
tshtml.setCodec("UTF-8");
136-
#endif
137128

138129
QFile olgFile(olgFileName);
139130
QVERIFY(olgFile.open(QIODevice::ReadOnly | QIODevice::Text));
140131
QTextStream tsolg(&olgFile);
141-
#if QT_VERSION < 0x060000
142-
tsolg.setCodec("UTF-8");
143-
#endif
144132

145133
QFile resultFile(resultFileName);
146134
QVERIFY(resultFile.open(QIODevice::ReadOnly | QIODevice::Text));
147135
QTextStream tsres(&resultFile);
148-
#if QT_VERSION < 0x060000
149-
tsres.setCodec("UTF-8");
150-
#endif
151136

152137
QString result = OtamaConverter::convertToErb(tshtml.readAll(), tsolg.readAll(), 1);
153138
QString expect = tsres.readAll();
@@ -186,23 +171,14 @@ void TestTfpconverter::otamaconvertStrong()
186171
QFile htmlFile(htmlFileName);
187172
QVERIFY(htmlFile.open(QIODevice::ReadOnly | QIODevice::Text));
188173
QTextStream tshtml(&htmlFile);
189-
#if QT_VERSION < 0x060000
190-
tshtml.setCodec("UTF-8");
191-
#endif
192174

193175
QFile olgFile(olgFileName);
194176
QVERIFY(olgFile.open(QIODevice::ReadOnly | QIODevice::Text));
195177
QTextStream tsolg(&olgFile);
196-
#if QT_VERSION < 0x060000
197-
tsolg.setCodec("UTF-8");
198-
#endif
199178

200179
QFile resultFile(resultFileName);
201180
QVERIFY(resultFile.open(QIODevice::ReadOnly | QIODevice::Text));
202181
QTextStream tsres(&resultFile);
203-
#if QT_VERSION < 0x060000
204-
tsres.setCodec("UTF-8");
205-
#endif
206182

207183
QString result = OtamaConverter::convertToErb(tshtml.readAll(), tsolg.readAll(), 2);
208184
QString expect = tsres.readAll();

tools/tspawn/controllergenerator.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,7 @@ bool ControllerGenerator::generate(const QString &dstDir) const
225225
{"var1", convMethod.value(pair.second).arg(fieldNameToVariableName(pair.first))},
226226
{"code1", sessInsertStr},
227227
{"code2", sessGetStr},
228-
#if QT_VERSION < 0x060000
229-
{"type", QString::fromLatin1(QMetaType::typeName(pair.second))},
230-
#else
231228
{"type", QString::fromLatin1(QMetaType(pair.second).name())},
232-
#endif
233229
{"rev", revStr},
234230
{"id", fieldNameToVariableName(pair.first)},
235231
{"condition", conditionString.value(pair.second).arg(fieldNameToVariableName(pair.first))},

tools/tspawn/main.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
#include "apicontrollergenerator.h"
2727
#include "apiservicegenerator.h"
2828
#include <QtCore>
29-
#if QT_VERSION < 0x060000
30-
# include <QTextCodec>
31-
#endif
3229
#include <random>
3330
#ifndef Q_CC_MSVC
3431
#include <unistd.h>
@@ -557,11 +554,7 @@ int main(int argc, char *argv[])
557554
break;
558555

559556
case ShowDriverPath: {
560-
#if QT_VERSION < 0x060000
561-
QString path = QLibraryInfo::location(QLibraryInfo::PluginsPath) + "/sqldrivers";
562-
#else
563557
QString path = QLibraryInfo::path(QLibraryInfo::PluginsPath) + "/sqldrivers";
564-
#endif
565558
QFileInfo fi(path);
566559
if (!fi.exists() || !fi.isDir()) {
567560
qCritical("Error: database driver's directory not found");
@@ -621,13 +614,6 @@ int main(int argc, char *argv[])
621614
return 2;
622615
}
623616

624-
#if QT_VERSION < 0x060000
625-
// Sets codec
626-
QTextCodec *codec = QTextCodec::codecForName(appSettings.value("InternalEncoding").toByteArray().trimmed());
627-
codec = (codec) ? codec : QTextCodec::codecForLocale();
628-
QTextCodec::setCodecForLocale(codec);
629-
#endif
630-
631617
// ERB or Otama
632618
templateSystem = devSettings.value("TemplateSystem").toString().toLower();
633619
if (templateSystem.isEmpty()) {

0 commit comments

Comments
 (0)