mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 10:04:46 -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
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue