mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Bump minimum Qt version from 5.8 to 5.15 (#6442)
* Bump minimum Qt version from 5.8 to 5.15 * remove version check * remove version checks
This commit is contained in:
parent
521046fb09
commit
70f9982c29
31 changed files with 5 additions and 156 deletions
|
|
@ -59,7 +59,7 @@ if(Qt6_FOUND)
|
|||
endif()
|
||||
else()
|
||||
find_package(
|
||||
Qt5 5.8.0
|
||||
Qt5 5.15.2
|
||||
COMPONENTS ${REQUIRED_QT_COMPONENTS}
|
||||
QUIET HINTS ${Qt5_DIR}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -150,12 +150,7 @@ void ShortcutTreeView::currentChanged(const QModelIndex ¤t, const QModelIn
|
|||
*/
|
||||
void ShortcutTreeView::updateSearchString(const QString &searchString)
|
||||
{
|
||||
#if QT_VERSION > QT_VERSION_CHECK(5, 14, 0)
|
||||
const auto skipEmptyParts = Qt::SkipEmptyParts;
|
||||
#else
|
||||
const auto skipEmptyParts = QString::SkipEmptyParts;
|
||||
#endif
|
||||
QStringList searchWords = searchString.split(" ", skipEmptyParts);
|
||||
QStringList searchWords = searchString.split(" ", Qt::SkipEmptyParts);
|
||||
|
||||
auto escapeRegex = [](const QString &s) { return QRegularExpression::escape(s); };
|
||||
std::transform(searchWords.begin(), searchWords.end(), searchWords.begin(), escapeRegex);
|
||||
|
|
|
|||
|
|
@ -117,11 +117,7 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
|
|||
chooseTokenFromDeckRadioButton->setDisabled(true); // No tokens in deck = no need for option
|
||||
} else {
|
||||
chooseTokenFromDeckRadioButton->setChecked(true);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
cardDatabaseDisplayModel->setCardNameSet(QSet<QString>(predefinedTokens.begin(), predefinedTokens.end()));
|
||||
#else
|
||||
cardDatabaseDisplayModel->setCardNameSet(QSet<QString>::fromList(predefinedTokens));
|
||||
#endif
|
||||
}
|
||||
|
||||
auto *tokenChooseLayout = new QVBoxLayout;
|
||||
|
|
@ -223,11 +219,7 @@ void DlgCreateToken::actChooseTokenFromAll(bool checked)
|
|||
void DlgCreateToken::actChooseTokenFromDeck(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
cardDatabaseDisplayModel->setCardNameSet(QSet<QString>(predefinedTokens.begin(), predefinedTokens.end()));
|
||||
#else
|
||||
cardDatabaseDisplayModel->setCardNameSet(QSet<QString>::fromList(predefinedTokens));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,14 +78,7 @@ void PlayerEventHandler::eventShuffle(const Event_Shuffle &event)
|
|||
void PlayerEventHandler::eventRollDie(const Event_RollDie &event)
|
||||
{
|
||||
if (!event.values().empty()) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QList<uint> rolls(event.values().begin(), event.values().end());
|
||||
#else
|
||||
QList<uint> rolls;
|
||||
for (const auto &value : event.values()) {
|
||||
rolls.append(value);
|
||||
}
|
||||
#endif
|
||||
std::sort(rolls.begin(), rolls.end());
|
||||
emit logRollDie(player, static_cast<int>(event.sides()), rolls);
|
||||
} else if (event.value()) {
|
||||
|
|
|
|||
|
|
@ -17,12 +17,7 @@ void AbstractGraphicsItem::paintNumberEllipse(int number,
|
|||
font.setWeight(QFont::Bold);
|
||||
|
||||
QFontMetrics fm(font);
|
||||
double w = 1.3 *
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
fm.horizontalAdvance(numStr);
|
||||
#else
|
||||
fm.width(numStr);
|
||||
#endif
|
||||
double w = 1.3 * fm.horizontalAdvance(numStr);
|
||||
double h = fm.height() * 1.3;
|
||||
if (w < h)
|
||||
w = h;
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@ CardPictureLoaderWorker::CardPictureLoaderWorker()
|
|||
// We need a timeout to ensure requests don't hang indefinitely in case of
|
||||
// cache corruption, see related Qt bug: https://bugreports.qt.io/browse/QTBUG-111397
|
||||
// Use Qt's default timeout (30s, as of 2023-02-22)
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
networkManager->setTransferTimeout();
|
||||
#endif
|
||||
cache = new QNetworkDiskCache(this);
|
||||
cache->setCacheDirectory(SettingsCache::instance().getNetworkCachePath());
|
||||
cache->setMaximumCacheSize(1024L * 1024L *
|
||||
|
|
|
|||
|
|
@ -57,17 +57,10 @@ void Logger::openLogfileSession()
|
|||
return;
|
||||
}
|
||||
fileStream.setDevice(&fileHandle);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
fileStream << "Log session started at " << QDateTime::currentDateTime().toString() << Qt::endl;
|
||||
fileStream << getClientVersion() << Qt::endl;
|
||||
fileStream << getSystemArchitecture() << Qt::endl;
|
||||
fileStream << getClientInstallInfo() << Qt::endl;
|
||||
#else
|
||||
fileStream << "Log session started at " << QDateTime::currentDateTime().toString() << endl;
|
||||
fileStream << getClientVersion() << endl;
|
||||
fileStream << getSystemArchitecture() << endl;
|
||||
fileStream << getClientInstallInfo() << endl;
|
||||
#endif
|
||||
logToFileEnabled = true;
|
||||
}
|
||||
|
||||
|
|
@ -77,11 +70,7 @@ void Logger::closeLogfileSession()
|
|||
return;
|
||||
|
||||
logToFileEnabled = false;
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
fileStream << "Log session closed at " << QDateTime::currentDateTime().toString() << Qt::endl;
|
||||
#else
|
||||
fileStream << "Log session closed at " << QDateTime::currentDateTime().toString() << endl;
|
||||
#endif
|
||||
fileHandle.close();
|
||||
}
|
||||
|
||||
|
|
@ -103,11 +92,7 @@ void Logger::internalLog(const QString &message)
|
|||
std::cerr << message.toStdString() << std::endl; // Print to stdout
|
||||
|
||||
if (logToFileEnabled) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
fileStream << message << Qt::endl; // Print to fileStream
|
||||
#else
|
||||
fileStream << message << endl; // Print to fileStream
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -236,11 +236,7 @@ void ChatView::appendMessage(QString message,
|
|||
cursor.setCharFormat(defaultFormat);
|
||||
|
||||
bool mentionEnabled = SettingsCache::instance().getChatMention();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
highlightedWords = SettingsCache::instance().getHighlightWords().split(' ', Qt::SkipEmptyParts);
|
||||
#else
|
||||
highlightedWords = SettingsCache::instance().getHighlightWords().split(' ', QString::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
// parse the message
|
||||
while (message.size()) {
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@ class UserListProxy;
|
|||
class UserMessagePosition
|
||||
{
|
||||
public:
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
|
||||
UserMessagePosition() = default; // older qt versions require a default constructor to use in containers
|
||||
#endif
|
||||
UserMessagePosition(QTextCursor &cursor);
|
||||
int relativePosition;
|
||||
QTextBlock block;
|
||||
|
|
|
|||
|
|
@ -421,10 +421,8 @@ bool GamesProxyModel::filterAcceptsRow(int sourceRow) const
|
|||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||
static const QDate epochDate = QDateTime::fromSecsSinceEpoch(0, QTimeZone::UTC).date();
|
||||
#elif (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
||||
static const QDate epochDate = QDateTime::fromSecsSinceEpoch(0, Qt::UTC).date();
|
||||
#else
|
||||
static const QDate epochDate = QDateTime::fromTime_t(0, Qt::UTC).date();
|
||||
static const QDate epochDate = QDateTime::fromSecsSinceEpoch(0, Qt::UTC).date();
|
||||
#endif
|
||||
auto *model = qobject_cast<GamesModel *>(sourceModel());
|
||||
if (!model)
|
||||
|
|
|
|||
|
|
@ -16,10 +16,7 @@ ArchidektApiResponseDeckListingsDisplayWidget::ArchidektApiResponseDeckListingsD
|
|||
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAsNeeded);
|
||||
|
||||
imageNetworkManager = new QNetworkAccessManager(this);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
imageNetworkManager->setTransferTimeout(); // Use Qt's default timeout
|
||||
#endif
|
||||
|
||||
imageNetworkManager->setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy);
|
||||
|
||||
// Add widgets for deck listings
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@
|
|||
TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
||||
{
|
||||
networkManager = new QNetworkAccessManager(this);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
networkManager->setTransferTimeout(); // Use Qt's default timeout
|
||||
#endif
|
||||
|
||||
networkManager->setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy);
|
||||
connect(networkManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(processApiJson(QNetworkReply *)));
|
||||
|
||||
|
|
|
|||
|
|
@ -53,11 +53,7 @@ void EdhrecCommanderApiResponseBracketNavigationWidget::applyOptionsFromUrl(cons
|
|||
}
|
||||
|
||||
// Expecting something like: "commanders/the-ur-dragon/core/expensive"
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList parts = cleanedUrl.split('/', Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList parts = cleanedUrl.split('/', QString::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
if (parts.size() < 2) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -53,11 +53,7 @@ void EdhrecCommanderApiResponseBudgetNavigationWidget::applyOptionsFromUrl(const
|
|||
}
|
||||
|
||||
// Expecting something like: "commanders/the-ur-dragon/core/expensive"
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList parts = cleanedUrl.split('/', Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList parts = cleanedUrl.split('/', QString::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
if (parts.size() < 2) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@
|
|||
TabEdhRec::TabEdhRec(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
||||
{
|
||||
networkManager = new QNetworkAccessManager(this);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
networkManager->setTransferTimeout(); // Use Qt's default timeout
|
||||
#endif
|
||||
|
||||
networkManager->setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy);
|
||||
connect(networkManager, &QNetworkAccessManager::finished, this, &TabEdhRec::processApiJson);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,10 +37,7 @@ static bool canBeCommander(const CardInfoPtr &cardInfo)
|
|||
TabEdhRecMain::TabEdhRecMain(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
||||
{
|
||||
networkManager = new QNetworkAccessManager(this);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
networkManager->setTransferTimeout(); // Use Qt's default timeout
|
||||
#endif
|
||||
|
||||
networkManager->setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy);
|
||||
connect(networkManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(processApiJson(QNetworkReply *)));
|
||||
|
||||
|
|
|
|||
|
|
@ -499,11 +499,7 @@ QString MainWindow::extractInvalidUsernameMessage(QString &in)
|
|||
if (words.startsWith("\n")) {
|
||||
out += tr("no unacceptable language as specified by these server rules:",
|
||||
"note that the following lines will not be translated");
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
for (QString &line : words.split("\n", Qt::SkipEmptyParts)) {
|
||||
#else
|
||||
for (QString &line : words.split("\n", QString::SkipEmptyParts)) {
|
||||
#endif
|
||||
out += "<li>" + line + "</li>";
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -260,10 +260,8 @@ int main(int argc, char *argv[])
|
|||
qCInfo(MainLog) << "MainWindow constructor finished";
|
||||
|
||||
ui.setWindowIcon(QPixmap("theme:cockatrice"));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
// set name of the app desktop file; used by wayland to load the window icon
|
||||
QGuiApplication::setDesktopFileName("cockatrice");
|
||||
#endif
|
||||
|
||||
SettingsCache::instance().setClientID(generateClientID());
|
||||
|
||||
|
|
|
|||
|
|
@ -328,11 +328,7 @@ QMap<QString, int> CardDatabaseQuerier::getAllSubCardTypesWithCount() const
|
|||
QStringList parts = type.split(" — ");
|
||||
|
||||
if (parts.size() > 1) { // Ensure there are subtypes
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList subtypes = parts[1].split(" ", Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList subtypes = parts[1].split(" ", QString::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
for (const QString &subtype : subtypes) {
|
||||
typeCounts[subtype]++;
|
||||
|
|
|
|||
|
|
@ -283,11 +283,7 @@ bool SetsDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex &source
|
|||
auto nameIndex = sourceModel()->index(sourceRow, SetsModel::LongNameCol, sourceParent);
|
||||
auto shortNameIndex = sourceModel()->index(sourceRow, SetsModel::ShortNameCol, sourceParent);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
||||
const auto filter = filterRegularExpression();
|
||||
#else
|
||||
const auto filter = filterRegExp();
|
||||
#endif
|
||||
|
||||
return (sourceModel()->data(typeIndex).toString().contains(filter) ||
|
||||
sourceModel()->data(nameIndex).toString().contains(filter) ||
|
||||
|
|
|
|||
|
|
@ -42,11 +42,7 @@ RemoteClient::RemoteClient(QObject *parent, INetworkSettingsProvider *_networkSe
|
|||
connect(socket, &QTcpSocket::connected, this, &RemoteClient::slotConnected);
|
||||
connect(socket, &QTcpSocket::readyRead, this, &RemoteClient::readData);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
connect(socket, &QTcpSocket::errorOccurred, this, &RemoteClient::slotSocketError);
|
||||
#else
|
||||
connect(socket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &RemoteClient::slotSocketError);
|
||||
#endif
|
||||
|
||||
websocket = new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this);
|
||||
connect(websocket, &QWebSocket::binaryMessageReceived, this, &RemoteClient::websocketMessageReceived);
|
||||
|
|
|
|||
|
|
@ -63,11 +63,7 @@ void Server_CardZone::shuffle(int start, int end)
|
|||
|
||||
for (int i = end; i > start; i--) {
|
||||
int j = rng->rand(start, i);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
||||
cards.swapItemsAt(j, i);
|
||||
#else
|
||||
cards.swap(j, i);
|
||||
#endif
|
||||
}
|
||||
playersWithWritePermission.clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,11 +73,7 @@ Server_Game::Server_Game(const ServerInfo_User &_creatorInfo,
|
|||
spectatorsSeeEverything(_spectatorsSeeEverything), startingLifeTotal(_startingLifeTotal),
|
||||
shareDecklistsOnLoad(_shareDecklistsOnLoad), inactivityCounter(0), startTimeOfThisGame(0), secondsElapsed(0),
|
||||
firstGameStarted(false), turnOrderReversed(false), startTime(QDateTime::currentDateTime()), pingClock(nullptr),
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
gameMutex()
|
||||
#else
|
||||
gameMutex(QMutex::Recursive)
|
||||
#endif
|
||||
{
|
||||
currentReplay = new GameReplay;
|
||||
currentReplay->set_replay_id(room->getServer()->getDatabaseInterface()->getNextReplayId());
|
||||
|
|
|
|||
|
|
@ -90,11 +90,7 @@ private slots:
|
|||
void doStartGameIfReady(bool forceStartGame = false);
|
||||
|
||||
public:
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
mutable QRecursiveMutex gameMutex;
|
||||
#else
|
||||
mutable QMutex gameMutex;
|
||||
#endif
|
||||
Server_Game(const ServerInfo_User &_creatorInfo,
|
||||
int _gameId,
|
||||
const QString &_description,
|
||||
|
|
|
|||
|
|
@ -112,11 +112,7 @@ void IslInterface::initServer()
|
|||
|
||||
socket->startServerEncryption();
|
||||
if (!socket->waitForEncrypted(5000)) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
QList<QSslError> sslErrors(socket->sslHandshakeErrors());
|
||||
#else
|
||||
QList<QSslError> sslErrors(socket->sslErrors());
|
||||
#endif
|
||||
if (sslErrors.isEmpty())
|
||||
qDebug() << "[ISL] SSL handshake timeout, terminating connection";
|
||||
else
|
||||
|
|
@ -193,11 +189,7 @@ void IslInterface::initClient()
|
|||
return;
|
||||
}
|
||||
if (!socket->waitForEncrypted(5000)) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
QList<QSslError> sslErrors(socket->sslHandshakeErrors());
|
||||
#else
|
||||
QList<QSslError> sslErrors(socket->sslErrors());
|
||||
#endif
|
||||
if (sslErrors.isEmpty())
|
||||
qDebug() << "[ISL] SSL handshake timeout, terminating connection";
|
||||
else
|
||||
|
|
|
|||
|
|
@ -254,13 +254,8 @@ bool Servatrice::initServer()
|
|||
qDebug() << "Accept registered users only:" << getRegOnlyServerEnabled();
|
||||
qDebug() << "Registration enabled:" << getRegistrationEnabled();
|
||||
if (getRegistrationEnabled()) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList emailBlackListFilters = getEmailBlackList().split(",", Qt::SkipEmptyParts);
|
||||
QStringList emailWhiteListFilters = getEmailWhiteList().split(",", Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList emailBlackListFilters = getEmailBlackList().split(",", QString::SkipEmptyParts);
|
||||
QStringList emailWhiteListFilters = getEmailWhiteList().split(",", QString::SkipEmptyParts);
|
||||
#endif
|
||||
qDebug() << "Email blacklist:" << emailBlackListFilters;
|
||||
qDebug() << "Email whitelist:" << emailWhiteListFilters;
|
||||
qDebug() << "Require email address to register:" << getRequireEmailForRegistrationEnabled();
|
||||
|
|
@ -564,11 +559,7 @@ void Servatrice::setRequiredFeatures(const QString &featureList)
|
|||
FeatureSet features;
|
||||
serverRequiredFeatureList.clear();
|
||||
features.initalizeFeatureList(serverRequiredFeatureList);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList listReqFeatures = featureList.split(",", Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList listReqFeatures = featureList.split(",", QString::SkipEmptyParts);
|
||||
#endif
|
||||
if (!listReqFeatures.isEmpty())
|
||||
for (const QString &reqFeature : listReqFeatures) {
|
||||
features.enableRequiredFeature(serverRequiredFeatureList, reqFeature);
|
||||
|
|
|
|||
|
|
@ -163,11 +163,7 @@ bool Servatrice_DatabaseInterface::usernameIsValid(const QString &user, QString
|
|||
bool allowPunctuationPrefix = settingsCache->value("users/allowpunctuationprefix", false).toBool();
|
||||
QString allowedPunctuation = settingsCache->value("users/allowedpunctuation", "_").toString();
|
||||
QString disallowedWordsStr = settingsCache->value("users/disallowedwords", "").toString();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList disallowedWords = disallowedWordsStr.split(",", Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList disallowedWords = disallowedWordsStr.split(",", QString::SkipEmptyParts);
|
||||
#endif
|
||||
disallowedWords.removeDuplicates();
|
||||
QVariant displayDisallowedWords = settingsCache->value("users/displaydisallowedwords");
|
||||
QString disallowedRegExpStr;
|
||||
|
|
|
|||
|
|
@ -57,11 +57,7 @@ void ServerLogger::logMessage(const QString &message, void *caller)
|
|||
// filter out all log entries based on values in configuration file
|
||||
bool shouldWeWriteLog = settingsCache->value("server/writelog", 1).toBool();
|
||||
QString logFilters = settingsCache->value("server/logfilters").toString();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList listlogFilters = logFilters.split(",", Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList listlogFilters = logFilters.split(",", QString::SkipEmptyParts);
|
||||
#endif
|
||||
bool shouldWeSkipLine = false;
|
||||
|
||||
if (!shouldWeWriteLog)
|
||||
|
|
|
|||
|
|
@ -972,11 +972,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdGetWarnList(const Comma
|
|||
Response_WarnList *re = new Response_WarnList;
|
||||
|
||||
QString officialWarnings = settingsCache->value("server/officialwarnings").toString();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList warningsList = officialWarnings.split(",", Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList warningsList = officialWarnings.split(",", QString::SkipEmptyParts);
|
||||
#endif
|
||||
for (const QString &warning : warningsList) {
|
||||
re->add_warning(warning.toStdString());
|
||||
}
|
||||
|
|
@ -1172,13 +1168,8 @@ Response::ResponseCode AbstractServerSocketInterface::cmdRegisterAccount(const C
|
|||
const auto parsedEmailParts = EmailParser::parseEmailAddress(nameFromStdString(cmd.email()));
|
||||
const auto emailUser = parsedEmailParts.first;
|
||||
const auto emailDomain = parsedEmailParts.second;
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
const QStringList emailBlackListFilters = emailBlackList.split(",", Qt::SkipEmptyParts);
|
||||
const QStringList emailWhiteListFilters = emailWhiteList.split(",", Qt::SkipEmptyParts);
|
||||
#else
|
||||
const QStringList emailBlackListFilters = emailBlackList.split(",", QString::SkipEmptyParts);
|
||||
const QStringList emailWhiteListFilters = emailWhiteList.split(",", QString::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
bool requireEmailForRegistration = settingsCache->value("registration/requireemail", true).toBool();
|
||||
if (requireEmailForRegistration && emailUser.isEmpty()) {
|
||||
|
|
@ -1930,13 +1921,8 @@ TcpServerSocketInterface::TcpServerSocketInterface(Servatrice *_server,
|
|||
socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
|
||||
connect(socket, SIGNAL(readyRead()), this, SLOT(readClient()));
|
||||
connect(socket, SIGNAL(disconnected()), this, SLOT(catchSocketDisconnected()));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this,
|
||||
SLOT(catchSocketError(QAbstractSocket::SocketError)));
|
||||
#else
|
||||
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this,
|
||||
SLOT(catchSocketError(QAbstractSocket::SocketError)));
|
||||
#endif
|
||||
}
|
||||
|
||||
TcpServerSocketInterface::~TcpServerSocketInterface()
|
||||
|
|
@ -2109,10 +2095,8 @@ void WebsocketServerSocketInterface::initConnection(void *_socket)
|
|||
}
|
||||
socket = (QWebSocket *)_socket;
|
||||
socket->setParent(this);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
// https://bugreports.qt.io/browse/QTBUG-70693
|
||||
socket->setMaxAllowedIncomingMessageSize(1500000); // 1.5MB
|
||||
#endif
|
||||
|
||||
address = socket->peerAddress();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,7 @@ SettingsCache::SettingsCache(const QString &fileName, QSettings::Format format,
|
|||
// first, figure out if we are running in portable mode
|
||||
isPortableBuild = QFile::exists(qApp->applicationDirPath() + "/portable.dat");
|
||||
|
||||
QStringList disallowedRegExpStr =
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
value("users/disallowedregexp", "").toString().split(",", Qt::SkipEmptyParts);
|
||||
#else
|
||||
value("users/disallowedregexp", "").toString().split(",", QString::SkipEmptyParts);
|
||||
#endif
|
||||
QStringList disallowedRegExpStr = value("users/disallowedregexp", "").toString().split(",", Qt::SkipEmptyParts);
|
||||
disallowedRegExpStr.removeDuplicates();
|
||||
for (const QString ®ExpStr : disallowedRegExpStr) {
|
||||
disallowedRegExp.append(QRegularExpression(QString("\\A%1\\z").arg(regExpStr)));
|
||||
|
|
|
|||
|
|
@ -334,11 +334,7 @@ void QxtSmtpPrivate::authenticate()
|
|||
state = Authenticated;
|
||||
emit qxt_p().authenticated();
|
||||
} else {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList auth = extensions["AUTH"].toUpper().split(' ', Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList auth = extensions["AUTH"].toUpper().split(' ', QString::SkipEmptyParts);
|
||||
#endif
|
||||
if (auth.contains("CRAM-MD5")) {
|
||||
authCramMD5();
|
||||
} else if (auth.contains("PLAIN")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue