Skip to content
Merged
2 changes: 1 addition & 1 deletion include/courtroom.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <QMessageBox>
#include <QParallelAnimationGroup>
#include <QPropertyAnimation>
#if QT_VERSION > QT_VERSION_CHECK(5, 10, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
#include <QRandomGenerator> //added in Qt 5.10
#endif
#include <QRegExp>
Expand Down
12 changes: 11 additions & 1 deletion src/courtroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
~Qt::WindowMaximizeButtonHint);

ao_app->initBASS();

#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) // Needed for pre-5.10 RNG stuff
qsrand(static_cast<uint>(QDateTime::currentMSecsSinceEpoch() / 1000));
#endif

keepalive_timer = new QTimer(this);
keepalive_timer->start(45000);
Expand Down Expand Up @@ -4142,6 +4143,11 @@ void Courtroom::mod_called(QString p_ip)
void Courtroom::case_called(QString msg, bool def, bool pro, bool jud, bool jur,
bool steno)
{
Q_UNUSED(def);
Q_UNUSED(pro);
Q_UNUSED(jud);
Q_UNUSED(jur);
Q_UNUSED(steno);
if (ui_casing->isChecked()) {
ui_server_chatlog->append(msg);
modcall_player->play(ao_app->get_court_sfx("case_call"));
Expand Down Expand Up @@ -4961,7 +4967,11 @@ void Courtroom::music_random()
}
if (clist.length() == 0)
return;
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
on_music_list_double_clicked(clist.at(qrand() % clist.length()), 1);
#else
on_music_list_double_clicked(clist.at(QRandomGenerator::global()->bounded(0, clist.length())), 1);
#endif
}

void Courtroom::music_list_expand_all() { ui_music_list->expandAll(); }
Expand Down
4 changes: 4 additions & 0 deletions src/demoserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ void DemoServer::recv_data()
}

QStringList packet_list =
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
in_data.split("%", QString::SplitBehavior(QString::SkipEmptyParts));
#else
in_data.split("%", Qt::SkipEmptyParts);
#endif

for (const QString &packet : packet_list) {
AOPacket ao_packet(packet);
Expand Down
3 changes: 3 additions & 0 deletions src/discord_rich_presence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ void Discord::state_lobby() {}

void Discord::state_server(std::string name, std::string server_id)
{
Q_UNUSED(name);
Q_UNUSED(server_id);
qDebug() << "Discord RPC: Setting server state";
}

void Discord::state_character(std::string name)
{
Q_UNUSED(name);
qDebug() << "Discord RPC: Setting character state";
}

Expand Down
5 changes: 4 additions & 1 deletion src/networkmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,11 @@ void NetworkManager::handle_server_packet(const QString& p_data)
partial_packet = false;
}
}

#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const QStringList packet_list = in_data.split("%", QString::SkipEmptyParts);
#else
const QStringList packet_list = in_data.split("%", Qt::SkipEmptyParts);
#endif

for (const QString &packet : packet_list) {
AOPacket *f_packet = new AOPacket(packet);
Expand Down