Skip to content

Commit d83ef05

Browse files
deleted codes for qt5
1 parent ffd450c commit d83ef05

21 files changed

+42
-350
lines changed

defaults/controllers_qt5/CMakeLists.txt

Lines changed: 0 additions & 45 deletions
This file was deleted.

defaults/helpers_qt5/CMakeLists.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

defaults/models_qt5/CMakeLists.txt

Lines changed: 0 additions & 54 deletions
This file was deleted.

defaults/views_qt5/CMakeLists.txt

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/corelib.pro

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ TEMPLATE = lib
33
CONFIG += shared console
44
CONFIG -= lib_bundle
55
QT += sql network xml qml
6-
lessThan(QT_MAJOR_VERSION, 6) {
7-
CONFIG += c++14
8-
windows:QMAKE_CXXFLAGS += /std:c++14
6+
lessThan(QT_MINOR_VERSION, 3) {
7+
# Qt6.2
8+
CONFIG += c++17
9+
windows:QMAKE_CXXFLAGS += /std:c++17
910
} else {
1011
CONFIG += c++20
1112
windows:QMAKE_CXXFLAGS += /Zc:__cplusplus /std:c++20 /permissive-
@@ -42,12 +43,7 @@ windows {
4243
LIBS += ../3rdparty/lz4/build/cmake/build/Release/lz4_static.lib
4344
header.files = $$HEADER_FILES $$HEADER_CLASSES
4445
header.files += $$MONGODB_FILES $$MONGODB_CLASSES
45-
46-
lessThan(QT_MAJOR_VERSION, 6) {
47-
QMAKE_CXXFLAGS += /source-charset:utf-8 /wd 4819 /wd 4661
48-
} else {
49-
QMAKE_CXXFLAGS += /wd 4819 /wd 4661
50-
}
46+
QMAKE_CXXFLAGS += /wd 4819 /wd 4661
5147

5248
isEmpty(header.path) {
5349
header.path = C:/TreeFrog/$${VERSION}/include

src/tabstractmodel.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ void TAbstractModel::setProperties(const QJsonDocument &properties)
175175
}
176176

177177

178-
#if QT_VERSION >= 0x050c00 // 5.12.0
179-
180178
/*!
181179
Converts all the properies to CBOR using QCborValue::fromVariant() and
182180
returns the map composed of those elements.
@@ -185,7 +183,7 @@ QCborMap TAbstractModel::toCborMap(const QStringList &properties) const
185183
{
186184
return QCborMap::fromVariantMap(toVariantMap(properties));
187185
}
188-
#endif
186+
189187

190188

191189
/*!

src/tabstractmodel.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ class T_CORE_EXPORT TAbstractModel {
2121
virtual void setProperties(const QJsonObject &properties);
2222
virtual QJsonObject toJsonObject(const QStringList &properties = QStringList()) const;
2323
virtual void setProperties(const QJsonDocument &properties);
24-
#if QT_VERSION >= 0x050c00 // 5.12.0
2524
virtual QCborMap toCborMap(const QStringList &properties = QStringList()) const;
26-
#endif
2725

2826
QString variableNameToFieldName(const QString &name) const;
2927
static QString fieldNameToVariableName(const QString &name);

src/tactioncontext.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,7 @@ void TActionContext::flushResponse(TActionController *controller, bool immediate
385385
QByteArray ctype = controller->_response.header().contentType().toLower();
386386
if (ctype.startsWith("text") && !ctype.contains("charset")) {
387387
ctype += "; charset=";
388-
#if QT_VERSION < 0x060000
389-
ctype += Tf::app()->codecForHttpOutput()->name();
390-
#else
391388
ctype += QStringConverter::nameForEncoding(Tf::app()->encodingForHttpOutput());
392-
#endif
393389
controller->_response.header().setContentType(ctype);
394390
}
395391

src/tactioncontroller.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
#include <QJsonDocument>
3030
#include <QJsonObject>
3131
#include <TWebApplication>
32-
#if QT_VERSION >= 0x060000
33-
# include <QStringEncoder>
34-
#endif
32+
#include <QStringEncoder>
3533

3634
const QString FLASH_VARS_SESSION_KEY("_flashVariants");
3735
const QString LOGIN_USER_NAME_KEY("_loginUserName");
@@ -356,11 +354,7 @@ bool TActionController::renderXml(const QDomDocument &document)
356354
QByteArray xml;
357355
QTextStream ts(&xml);
358356

359-
#if QT_VERSION < 0x060000
360-
ts.setCodec("UTF-8");
361-
#else
362357
ts.setEncoding(QStringConverter::Utf8);
363-
#endif
364358
document.save(ts, 1, QDomNode::EncodingFromTextStream);
365359
return sendData(xml, "text/xml");
366360
}
@@ -512,11 +506,7 @@ QByteArray TActionController::renderView(TActionView *view)
512506
if (!layoutEnabled()) {
513507
// Renders without layout
514508
tSystemDebug("Renders without layout");
515-
#if QT_VERSION < 0x060000
516-
return Tf::app()->codecForHttpOutput()->fromUnicode(view->toString());
517-
#else
518509
return QStringEncoder(Tf::app()->encodingForHttpOutput()).encode(view->toString());
519-
#endif
520510
}
521511

522512
// Displays with layout
@@ -534,11 +524,7 @@ QByteArray TActionController::renderView(TActionView *view)
534524
layoutView = defLayoutDispatcher.object();
535525
if (!layoutView) {
536526
tSystemDebug("Not found default layout. Renders without layout.");
537-
#if QT_VERSION < 0x060000
538-
return Tf::app()->codecForHttpOutput()->fromUnicode(view->toString());
539-
#else
540527
return QStringEncoder(Tf::app()->encodingForHttpOutput()).encode(view->toString());
541-
#endif
542528
}
543529
}
544530
}
@@ -547,11 +533,7 @@ QByteArray TActionController::renderView(TActionView *view)
547533
layoutView->setVariantMap(allVariants());
548534
layoutView->setController(this);
549535
layoutView->setSubActionView(view);
550-
#if QT_VERSION < 0x060000
551-
return Tf::app()->codecForHttpOutput()->fromUnicode(layoutView->toString());
552-
#else
553536
return QStringEncoder(Tf::app()->encodingForHttpOutput()).encode(layoutView->toString());
554-
#endif
555537
}
556538

557539
/*!
@@ -916,8 +898,6 @@ bool TActionController::renderJson(const QStringList &list)
916898
return renderJson(QJsonArray::fromStringList(list));
917899
}
918900

919-
#if QT_VERSION >= 0x050c00 // 5.12.0
920-
921901
/*!
922902
Renders a CBOR object \a variant as HTTP response.
923903
*/
@@ -967,8 +947,6 @@ bool TActionController::renderCbor(const QCborArray &array, QCborValue::Encoding
967947
return renderCbor(array.toCborValue(), opt);
968948
}
969949

970-
#endif
971-
972950
/*!
973951
\fn const TSession &TActionController::session() const;
974952

src/tactioncontroller.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,12 @@ class T_CORE_EXPORT TActionController : public TAbstractController, public TActi
8383
bool renderAndCache(const QByteArray &key, int seconds, const QString &action = QString(), const QString &layout = QString());
8484
bool renderOnCache(const QByteArray &key);
8585
void removeCache(const QByteArray &key);
86-
#if QT_VERSION >= 0x050c00 // 5.12.0
8786
bool renderCbor(const QVariant &variant, QCborValue::EncodingOptions opt = QCborValue::NoTransformation);
8887
bool renderCbor(const QVariantMap &map, QCborValue::EncodingOptions opt = QCborValue::NoTransformation);
8988
bool renderCbor(const QVariantHash &hash, QCborValue::EncodingOptions opt = QCborValue::NoTransformation);
9089
bool renderCbor(const QCborValue &value, QCborValue::EncodingOptions opt = QCborValue::NoTransformation);
9190
bool renderCbor(const QCborMap &map, QCborValue::EncodingOptions opt = QCborValue::NoTransformation);
9291
bool renderCbor(const QCborArray &array, QCborValue::EncodingOptions opt = QCborValue::NoTransformation);
93-
#endif
9492
bool renderErrorResponse(int statusCode);
9593
void redirect(const QUrl &url, int statusCode = Tf::Found);
9694
bool sendFile(const QString &filePath, const QByteArray &contentType, const QString &name = QString(), bool autoRemove = false);

0 commit comments

Comments
 (0)