Skip to content

Commit 2f5608d

Browse files
modified to use std::format().
1 parent d574ed3 commit 2f5608d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+245
-239
lines changed

src/corelib.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ unix {
466466
# Shared link
467467
LIBS += $$system("pkg-config --libs libmongoc-1.0 2>/dev/null")
468468
QMAKE_CXXFLAGS += $$system("pkg-config --cflags-only-I libmongoc-1.0 2>/dev/null")
469+
LIBS += $$system("pkg-config --libs openblas 2>/dev/null")
470+
QMAKE_CXXFLAGS += $$system("pkg-config --cflags-only-I openblas 2>/dev/null")
469471
}
470472
}
471473
}

src/tabstractcontroller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TAbstractController::TAbstractController() :
3030
void TAbstractController::exportVariant(const QString &name, const QVariant &value, bool overwrite)
3131
{
3232
if (!value.isValid()) {
33-
tSystemWarn("An invalid QVariant object for exportVariant(), name:{}", qUtf8Printable(name));
33+
tSystemWarn("An invalid QVariant object for exportVariant(), name:{}", name);
3434
return;
3535
}
3636

src/taccessvalidator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ bool TAccessValidator::validate(const TAbstractUser *user, const TActionControll
149149
Q_ASSERT(controller);
150150

151151
if (accessRules.isEmpty()) {
152-
Tf::warn("No rule for access validation: {}", qUtf8Printable(controller->className()));
152+
Tf::warn("No rule for access validation: {}", controller->className());
153153
return ret;
154154
}
155155

@@ -163,9 +163,9 @@ bool TAccessValidator::validate(const TAbstractUser *user, const TActionControll
163163
}
164164
}
165165
if (ret) {
166-
tSystemDebug("Access '{}' action by an unauthenticated user : Allow", qUtf8Printable(controller->activeAction()));
166+
tSystemDebug("Access '{}' action by an unauthenticated user : Allow", controller->activeAction());
167167
} else {
168-
tSystemWarn("Access '{}' action by an unauthenticated user : Deny", qUtf8Printable(controller->activeAction()));
168+
tSystemWarn("Access '{}' action by an unauthenticated user : Deny", controller->activeAction());
169169
}
170170

171171
} else {
@@ -178,9 +178,9 @@ bool TAccessValidator::validate(const TAbstractUser *user, const TActionControll
178178
}
179179
}
180180
if (ret) {
181-
tSystemDebug("Access '{}' action by '{}' user : Allow", qUtf8Printable(controller->activeAction()), qUtf8Printable(user->identityKey()));
181+
tSystemDebug("Access '{}' action by '{}' user : Allow", controller->activeAction(), user->identityKey());
182182
} else {
183-
tSystemWarn("Access '{}' action by '{}' user : Deny", qUtf8Printable(controller->activeAction()), qUtf8Printable(user->identityKey()));
183+
tSystemWarn("Access '{}' action by '{}' user : Deny", controller->activeAction(), user->identityKey());
184184
}
185185
}
186186

src/tactioncontext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void TActionContext::execute(THttpRequest &request)
197197
QString canonicalPath = QUrl(QStringLiteral(".")).resolved(QUrl(path)).toString().mid(1);
198198
QFile reqPath(Tf::app()->publicPath() + canonicalPath);
199199
QFileInfo fi(reqPath);
200-
tSystemDebug("canonicalPath : {}", qUtf8Printable(canonicalPath));
200+
tSystemDebug("canonicalPath : {}", canonicalPath);
201201

202202
if (fi.isFile() && fi.isReadable()) {
203203
// Check "If-Modified-Since" header for caching

src/tactioncontroller.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ bool TActionController::verifyRequest(const THttpRequest &request) const
282282
bool TActionController::render(const QString &action, const QString &layout)
283283
{
284284
if ((int)_rendered > 0) {
285-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '.' + activeAction()));
285+
Tf::warn("Has rendered already: {}", (className() + '.' + activeAction()));
286286
return false;
287287
}
288288
_rendered = RenderState::Rendered;
@@ -300,15 +300,15 @@ bool TActionController::render(const QString &action, const QString &layout)
300300
bool TActionController::renderTemplate(const QString &templateName, const QString &layout)
301301
{
302302
if ((int)_rendered > 0) {
303-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '#' + activeAction()));
303+
Tf::warn("Has rendered already: {}", (className() + '#' + activeAction()));
304304
return false;
305305
}
306306
_rendered = RenderState::Rendered;
307307

308308
// Creates view-object and displays it
309309
QStringList names = templateName.split("/");
310310
if (names.count() != 2) {
311-
Tf::error("Invalid patameter: {}", qUtf8Printable(templateName));
311+
Tf::error("Invalid patameter: {}", templateName);
312312
return false;
313313
}
314314
TDispatcher<TActionView> viewDispatcher(viewClassName(names[0], names[1]));
@@ -323,7 +323,7 @@ bool TActionController::renderTemplate(const QString &templateName, const QStrin
323323
bool TActionController::renderText(const QString &text, bool layoutEnable, const QString &layout)
324324
{
325325
if ((int)_rendered > 0) {
326-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '#' + activeAction()));
326+
Tf::warn("Has rendered already: {}", (className() + '#' + activeAction()));
327327
return false;
328328
}
329329
_rendered = RenderState::Rendered;
@@ -428,7 +428,7 @@ bool TActionController::renderXml(const QStringList &list)
428428
bool TActionController::renderAndCache(const QByteArray &key, int seconds, const QString &action, const QString &layout)
429429
{
430430
if ((int)_rendered > 0) {
431-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '.' + activeAction()));
431+
Tf::warn("Has rendered already: {}", (className() + '.' + activeAction()));
432432
return false;
433433
}
434434

@@ -449,7 +449,7 @@ bool TActionController::renderAndCache(const QByteArray &key, int seconds, const
449449
bool TActionController::renderOnCache(const QByteArray &key)
450450
{
451451
if ((int)_rendered > 0) {
452-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '.' + activeAction()));
452+
Tf::warn("Has rendered already: {}", (className() + '.' + activeAction()));
453453
return false;
454454
}
455455

@@ -481,7 +481,7 @@ QString TActionController::getRenderingData(const QString &templateName, const Q
481481
// Creates view-object
482482
QStringList names = templateName.split("/");
483483
if (names.count() != 2) {
484-
Tf::error("Invalid patameter: {}", qUtf8Printable(templateName));
484+
Tf::error("Invalid patameter: {}", templateName);
485485
return QString();
486486
}
487487

@@ -527,7 +527,7 @@ QByteArray TActionController::renderView(TActionView *view)
527527
TDispatcher<TActionView> defLayoutDispatcher(layoutClassName(QLatin1String("application")));
528528
if (!layoutView) {
529529
if (!layout().isNull()) {
530-
tSystemDebug("Not found layout: {}", qUtf8Printable(layout()));
530+
tSystemDebug("Not found layout: {}", layout());
531531
return QByteArray();
532532
} else {
533533
// Use default layout
@@ -555,7 +555,7 @@ bool TActionController::renderErrorResponse(int statusCode)
555555
bool ret = false;
556556

557557
if ((int)_rendered > 0) {
558-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '#' + activeAction()));
558+
Tf::warn("Has rendered already: {}", (className() + '#' + activeAction()));
559559
return ret;
560560
}
561561

@@ -592,7 +592,7 @@ QString TActionController::partialViewClassName(const QString &partial)
592592
void TActionController::redirect(const QUrl &url, int statusCode)
593593
{
594594
if ((int)_rendered > 0) {
595-
Tf::error("Unable to redirect. Has rendered already: {}", qUtf8Printable(className() + '#' + activeAction()));
595+
Tf::error("Unable to redirect. Has rendered already: {}", (className() + '#' + activeAction()));
596596
return;
597597
}
598598
_rendered = RenderState::Rendered;
@@ -614,7 +614,7 @@ void TActionController::redirect(const QUrl &url, int statusCode)
614614
bool TActionController::sendFile(const QString &filePath, const QByteArray &contentType, const QString &name, bool autoRemove)
615615
{
616616
if ((int)_rendered > 0) {
617-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '#' + activeAction()));
617+
Tf::warn("Has rendered already: {}", (className() + '#' + activeAction()));
618618
return false;
619619
}
620620
_rendered = RenderState::Rendered;
@@ -642,7 +642,7 @@ bool TActionController::sendFile(const QString &filePath, const QByteArray &cont
642642
bool TActionController::sendData(const QByteArray &data, const QByteArray &contentType, const QString &name)
643643
{
644644
if ((int)_rendered > 0) {
645-
Tf::warn("Has rendered already: {}", qUtf8Printable(className() + '#' + activeAction()));
645+
Tf::warn("Has rendered already: {}", (className() + '#' + activeAction()));
646646
return false;
647647
}
648648
_rendered = RenderState::Rendered;
@@ -800,7 +800,7 @@ void TActionController::setFlash(const QString &name, const QVariant &value)
800800
if (value.isValid()) {
801801
_flashVars.insert(name, value);
802802
} else {
803-
tSystemWarn("An invalid QVariant object for setFlash(), name:{}", qUtf8Printable(name));
803+
tSystemWarn("An invalid QVariant object for setFlash(), name:{}", name);
804804
}
805805
}
806806

src/tactioncontroller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include <QHostAddress>
33
#include <QtCore>
4+
#include <TGlobal>
45
#include <TAbstractController>
56
#include <TAccessValidator>
67
#include <TActionHelper>
@@ -9,7 +10,6 @@
910
#include <THttpResponse>
1011
#include <TActionContext>
1112
#include <TSession>
12-
#include <TGlobal>
1313

1414
class TActionView;
1515
class TAbstractUser;

src/tactionmailer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bool TActionMailer::deliver(const QString &templateName)
6363
view->setVariantMap(allVariants());
6464
QString msg = view->toString();
6565
if (msg.isEmpty()) {
66-
tSystemError("Mail Message Empty: template name:{}", qUtf8Printable(templateName));
66+
tSystemError("Mail Message Empty: template name:{}", templateName);
6767
return false;
6868
}
6969

@@ -82,7 +82,7 @@ bool TActionMailer::deliver(const QString &templateName)
8282
mailer->setAuthenticationEnabled(Tf::appSettings()->value(Tf::ActionMailerSmtpAuthentication).toBool());
8383
mailer->setUserName(Tf::appSettings()->value(Tf::ActionMailerSmtpUserName).toByteArray());
8484
mailer->setPassword(Tf::appSettings()->value(Tf::ActionMailerSmtpPassword).toByteArray());
85-
tSystemDebug("{}", (const char*)mail.toByteArray().data());
85+
tSystemDebug("{}", mail.toByteArray());
8686

8787
// POP before SMTP
8888
if (Tf::appSettings()->value(Tf::ActionMailerSmtpEnablePopBeforeSmtp).toBool()) {

src/tapplicationserverbase.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ bool TApplicationServerBase::loadLibraries()
5959
for (auto &libname : libs) {
6060
auto lib = new QLibrary(libPath + libname);
6161
if (lib->load()) {
62-
tSystemDebug("Library loaded: {}", qUtf8Printable(lib->fileName()));
62+
tSystemDebug("Library loaded: {}", lib->fileName());
6363
libsLoaded << lib;
6464
} else {
65-
tSystemWarn("{}", qUtf8Printable(lib->errorString()));
65+
tSystemWarn("{}", lib->errorString());
6666
ret = false;
6767
unloadLibraries();
6868
break;
6969
}
7070
}
7171

7272
QStringList controllers = TActionController::availableControllers();
73-
tSystemDebug("Available controllers: {}", qUtf8Printable(controllers.join(" ")));
73+
tSystemDebug("Available controllers: {}", controllers.join(" "));
7474

7575
if (ret) {
7676
loadedTimestamp = latestLibraryTimestamp();
@@ -86,7 +86,7 @@ void TApplicationServerBase::unloadLibraries()
8686
{
8787
for (auto lib : libsLoaded) {
8888
lib->unload();
89-
tSystemDebug("Library unloaded: {}", qUtf8Printable(lib->fileName()));
89+
tSystemDebug("Library unloaded: {}", lib->fileName());
9090
}
9191
libsLoaded.clear();
9292
}

src/tapplicationserverbase_unix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int TApplicationServerBase::nativeListen(const QHostAddress &address, uint16_t p
3838
QTcpServer server;
3939

4040
if (!server.listen(address, port)) {
41-
tSystemError("Listen failed address:{} port:{}", qUtf8Printable(address.toString()), port);
41+
tSystemError("Listen failed address:{} port:{}", address.toString(), port);
4242
return sd;
4343
}
4444

@@ -94,7 +94,7 @@ int TApplicationServerBase::nativeListen(const QString &fileDomain, OpenFlag fla
9494
QFile file(fileDomain);
9595
if (file.exists()) {
9696
file.remove();
97-
tSystemWarn("File for UNIX domain socket removed: {}", qUtf8Printable(fileDomain));
97+
tSystemWarn("File for UNIX domain socket removed: {}", fileDomain);
9898
}
9999

100100
// Bind

src/tbson.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ QVariantMap TBson::fromBson(const TBsonObject *obj)
167167
Tf::error("fromBson() unknown type: {}", (int)t);
168168
break;
169169
}
170-
//tSystemDebug("fromBson : t:{} key:{} = {}", t, qUtf8Printable(key), qUtf8Printable(ret[key].toString()));
170+
//tSystemDebug("fromBson : t:{} key:{} = {}", t, key, ret[key].toString());
171171
}
172172
return ret;
173173
}
@@ -252,7 +252,7 @@ static bool appendBsonValue(bson_t *bson, const QString &key, const QVariant &va
252252
break;
253253

254254
default:
255-
Tf::error("toBson() failed to convert name:{} type:{}", qUtf8Printable(key), type);
255+
Tf::error("toBson() failed to convert name:{} type:{}", key, type);
256256
ok = false;
257257
break;
258258
}

0 commit comments

Comments
 (0)