diff --git a/src/mumble/BanEditor.cpp b/src/mumble/BanEditor.cpp index fd5adc4ec9c..079e586401e 100644 --- a/src/mumble/BanEditor.cpp +++ b/src/mumble/BanEditor.cpp @@ -13,6 +13,8 @@ #include +#include + BanEditor::BanEditor(const MumbleProto::BanList &msg, QWidget *p) : QDialog(p), maskDefaultValue(32) { setupUi(this); @@ -28,7 +30,11 @@ BanEditor::BanEditor(const MumbleProto::BanList &msg, QWidget *p) : QDialog(p), b.qsHash = u8(be.hash()); b.qsReason = u8(be.reason()); b.qdtStart = QDateTime::fromString(u8(be.start()), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + b.qdtStart.setTimeZone(QTimeZone::UTC); +#else b.qdtStart.setTimeSpec(Qt::UTC); +#endif if (!b.qdtStart.isValid()) b.qdtStart = QDateTime::currentDateTime(); b.iDuration = be.duration(); diff --git a/src/mumble/PluginUpdater.cpp b/src/mumble/PluginUpdater.cpp index fd529eff30e..2a0d7bd99d4 100644 --- a/src/mumble/PluginUpdater.cpp +++ b/src/mumble/PluginUpdater.cpp @@ -70,7 +70,13 @@ void PluginUpdater::promptAndUpdate() { setWindowIcon(QIcon(QLatin1String("skin:mumble.svg"))); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + // checkStateChanged was introduced in Qt 6.7 + QObject::connect(qcbSelectAll, &QCheckBox::checkStateChanged, this, &PluginUpdater::on_selectAll); +#else QObject::connect(qcbSelectAll, &QCheckBox::stateChanged, this, &PluginUpdater::on_selectAll); +#endif + QObject::connect(this, &QDialog::finished, this, &PluginUpdater::on_finished); if (exec() == QDialog::Accepted) { @@ -117,7 +123,12 @@ void PluginUpdater::populateUI() { UpdateWidgetPair pair = { checkBox, urlLabel }; m_pluginUpdateWidgets << pair; +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + // checkStateChanged was introduced in Qt 6.7 + QObject::connect(checkBox, &QCheckBox::checkStateChanged, this, &PluginUpdater::on_singleSelectionChanged); +#else QObject::connect(checkBox, &QCheckBox::stateChanged, this, &PluginUpdater::on_singleSelectionChanged); +#endif } // sort the plugins alphabetically @@ -147,7 +158,11 @@ void PluginUpdater::clearUI() { } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void PluginUpdater::on_selectAll(Qt::CheckState checkState) { +#else void PluginUpdater::on_selectAll(int checkState) { +#endif // failsafe for partially selected state (shouldn't happen though) if (checkState == Qt::PartiallyChecked) { checkState = Qt::Unchecked; @@ -161,7 +176,11 @@ void PluginUpdater::on_selectAll(int checkState) { } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void PluginUpdater::on_singleSelectionChanged(Qt::CheckState checkState) { +#else void PluginUpdater::on_singleSelectionChanged(int checkState) { +#endif bool isChecked = checkState == Qt::Checked; // Block signals for the selectAll checkBox in order to not trigger its diff --git a/src/mumble/PluginUpdater.h b/src/mumble/PluginUpdater.h index 32185f5bd8b..bf996c6b55b 100644 --- a/src/mumble/PluginUpdater.h +++ b/src/mumble/PluginUpdater.h @@ -84,10 +84,17 @@ class PluginUpdater : public QDialog, public Ui::PluginUpdater { public slots: /// Clears the UI from the widgets created for the individual plugins. void clearUI(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + /// Slot triggered if the user changes the state of the selectAll CheckBox. + void on_selectAll(Qt::CheckState checkState); + /// Slot triggered if the user toggles the CheckBox for any individual plugin. + void on_singleSelectionChanged(Qt::CheckState checkState); +#else /// Slot triggered if the user changes the state of the selectAll CheckBox. void on_selectAll(int checkState); /// Slot triggered if the user toggles the CheckBox for any individual plugin. void on_singleSelectionChanged(int checkState); +#endif /// Slot triggered when the dialog is being closed. void on_finished(int result); /// Slot that can be triggered to ask for the update process to be interrupted. diff --git a/src/mumble/SocketRPC.cpp b/src/mumble/SocketRPC.cpp index dfea98c57d1..410c70c0c12 100644 --- a/src/mumble/SocketRPC.cpp +++ b/src/mumble/SocketRPC.cpp @@ -73,7 +73,11 @@ void SocketRPCClient::readyRead() { void SocketRPCClient::processXml() { QDomDocument qdd; +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + qdd.setContent(qbaOutput, QDomDocument::ParseOption::Default); +#else qdd.setContent(qbaOutput, false); +#endif QDomElement request = qdd.firstChildElement(); diff --git a/src/mumble/UserListModel.cpp b/src/mumble/UserListModel.cpp index eb4d95e363b..b3f04d0443c 100644 --- a/src/mumble/UserListModel.cpp +++ b/src/mumble/UserListModel.cpp @@ -17,6 +17,8 @@ #include +#include + UserListModel::UserListModel(const MumbleProto::UserList &userList, QObject *parent_) : QAbstractTableModel(parent_), m_legacyMode(false) { m_userList.reserve(userList.users_size()); @@ -296,6 +298,10 @@ QString UserListModel::pathForChannelId(const unsigned int channelId) const { QDateTime UserListModel::isoUTCToDateTime(const std::string &isoTime) const { QDateTime dt = QDateTime::fromString(u8(isoTime), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + dt.setTimeZone(QTimeZone::UTC); +#else dt.setTimeSpec(Qt::UTC); +#endif return dt; } diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp index c92e366b070..73b05994c8d 100644 --- a/src/murmur/Messages.cpp +++ b/src/murmur/Messages.cpp @@ -20,12 +20,13 @@ #include "Version.h" #include "crypto/CryptState.h" -#include -#include - #include #include +#include +#include +#include + #include #define RATELIMIT(user) \ @@ -687,7 +688,11 @@ void Server::msgBanList(ServerUser *uSource, MumbleProto::BanList &msg) { b.qsReason = u8(be.reason()); if (be.has_start()) { b.qdtStart = QDateTime::fromString(u8(be.start()), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + b.qdtStart.setTimeZone(QTimeZone::UTC); +#else b.qdtStart.setTimeSpec(Qt::UTC); +#endif } else { b.qdtStart = QDateTime::currentDateTime().toUTC(); } diff --git a/src/murmur/ServerDB.cpp b/src/murmur/ServerDB.cpp index ffb655c2d64..4536641ea6c 100644 --- a/src/murmur/ServerDB.cpp +++ b/src/murmur/ServerDB.cpp @@ -3,14 +3,12 @@ // that can be found in the LICENSE file at the root of the // Mumble source tree or at . -#include +#include "ServerDB.h" #ifdef Q_OS_WIN # include "win.h" #endif -#include "ServerDB.h" - #include "ACL.h" #include "Channel.h" #include "Connection.h" @@ -22,12 +20,14 @@ #include "ServerUser.h" #include "User.h" +#include + #include +#include +#include #include #include -#include - #ifdef Q_OS_WIN # include #else @@ -1210,7 +1210,11 @@ QList< UserInfo > Server::getRegisteredUsersEx() { userinfo.name = query.value(1).toString(); userinfo.last_channel = query.value(2).toInt(); userinfo.last_active = QDateTime::fromString(query.value(3).toString(), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + userinfo.last_active.setTimeZone(QTimeZone::UTC); +#else userinfo.last_active.setTimeSpec(Qt::UTC); +#endif users << userinfo; } @@ -2220,14 +2224,22 @@ int Server::readLastChannel(int id) { } QDateTime last_active = QDateTime::fromString(query.value(1).toString(), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + last_active.setTimeZone(QTimeZone::UTC); +#else last_active.setTimeSpec(Qt::UTC); +#endif QDateTime last_disconnect; // NULL column for last_disconnect will yield an empty invalid QDateTime object. // Using that object with QDateTime::secsTo() will return 0 as per Qt specification. if (!query.value(2).isNull()) { last_disconnect = QDateTime::fromString(query.value(2).toString(), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + last_disconnect.setTimeZone(QTimeZone::UTC); +#else last_disconnect.setTimeSpec(Qt::UTC); +#endif } if (last_active.secsTo(last_disconnect) <= 0) { @@ -2312,7 +2324,11 @@ void Server::getBans() { ban.qsHash = query.value(3).toString(); ban.qsReason = query.value(4).toString(); ban.qdtStart = query.value(5).toDateTime(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + ban.qdtStart.setTimeZone(QTimeZone::UTC); +#else ban.qdtStart.setTimeSpec(Qt::UTC); +#endif ban.iDuration = query.value(6).toUInt(); if (ban.isValid())