mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-04-29 14:14:34 +02:00
chore: add back deprecation warnings and disable all API deprecated before 6.0
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
5fee4e3f8b
commit
2271a05b19
@ -88,6 +88,9 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_WARN_DEPRECATED_UP_TO=0x060200")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_DISABLE_DEPRECATED_UP_TO=0x060000")
|
||||
|
||||
# Fix aarch64 build for toml++
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTOML_ENABLE_FLOAT16=0")
|
||||
|
||||
|
@ -53,7 +53,7 @@ static inline QChar getNextChar(const QString& s, int location)
|
||||
int StringUtils::naturalCompare(const QString& s1, const QString& s2, Qt::CaseSensitivity cs)
|
||||
{
|
||||
int l1 = 0, l2 = 0;
|
||||
while (l1 <= s1.count() && l2 <= s2.count()) {
|
||||
while (l1 <= s1.size() && l2 <= s2.size()) {
|
||||
// skip spaces, tabs and 0's
|
||||
QChar c1 = getNextChar(s1, l1);
|
||||
while (c1.isSpace())
|
||||
|
@ -79,7 +79,7 @@ void PackFetchTask::fetchPrivate(const QStringList& toFetch)
|
||||
QObject::connect(job, &NetJob::succeeded, this, [this, job, data, packCode] {
|
||||
ModpackList packs;
|
||||
parseAndAddPacks(*data, PackType::Private, packs);
|
||||
foreach (Modpack currentPack, packs) {
|
||||
for (auto& currentPack : packs) {
|
||||
currentPack.packCode = packCode;
|
||||
emit privateFileDownloadFinished(currentPack);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ void PackInstallTask::install()
|
||||
// we only care about the libs
|
||||
QJsonArray libs = doc.object().value("libraries").toArray();
|
||||
|
||||
foreach (const QJsonValue& value, libs) {
|
||||
for (const auto& value : libs) {
|
||||
QString nameValue = value.toObject().value("name").toString();
|
||||
if (!nameValue.startsWith("net.minecraftforge")) {
|
||||
continue;
|
||||
|
@ -480,7 +480,7 @@ bool TranslationsModel::selectLanguage(QString key)
|
||||
bool successful = false;
|
||||
// FIXME: this is likely never present. FIX IT.
|
||||
d->m_qt_translator.reset(new QTranslator());
|
||||
if (d->m_qt_translator->load("qt_" + langCode, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
|
||||
if (d->m_qt_translator->load("qt_" + langCode, QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
||||
qDebug() << "Loading Qt Language File for" << langCode.toLocal8Bit().constData() << "...";
|
||||
if (!QCoreApplication::installTranslator(d->m_qt_translator.get())) {
|
||||
qCritical() << "Loading Qt Language File failed.";
|
||||
|
@ -724,7 +724,7 @@ void MainWindow::changeActiveAccount()
|
||||
QAction* sAction = (QAction*)sender();
|
||||
|
||||
// Profile's associated Mojang username
|
||||
if (sAction->data().type() != QVariant::Type::Int)
|
||||
if (sAction->data().typeId() != QMetaType::Int)
|
||||
return;
|
||||
|
||||
QVariant action_data = sAction->data();
|
||||
|
@ -76,8 +76,8 @@ void SkinOpenGLWindow::mousePressEvent(QMouseEvent* e)
|
||||
void SkinOpenGLWindow::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
if (m_isMousePressed) {
|
||||
int dx = event->x() - m_mousePosition.x();
|
||||
int dy = event->y() - m_mousePosition.y();
|
||||
int dx = event->position().x() - m_mousePosition.x();
|
||||
int dy = event->position().y() - m_mousePosition.y();
|
||||
|
||||
m_yaw += dx * 0.5f;
|
||||
m_pitch += dy * 0.5f;
|
||||
|
@ -418,7 +418,7 @@ void InstanceView::mouseDoubleClickEvent(QMouseEvent* event)
|
||||
|
||||
QModelIndex index = indexAt(event->pos());
|
||||
if (!index.isValid() || !(index.flags() & Qt::ItemIsEnabled) || (m_pressedIndex != index)) {
|
||||
QMouseEvent me(QEvent::MouseButtonPress, event->localPos(), event->windowPos(), event->screenPos(), event->button(),
|
||||
QMouseEvent me(QEvent::MouseButtonPress, event->position(), event->scenePosition(), event->globalPosition(), event->button(),
|
||||
event->buttons(), event->modifiers());
|
||||
mousePressEvent(&me);
|
||||
return;
|
||||
@ -598,7 +598,7 @@ void InstanceView::dragEnterEvent(QDragEnterEvent* event)
|
||||
if (!isDragEventAccepted(event)) {
|
||||
return;
|
||||
}
|
||||
m_lastDragPosition = event->pos() + offset();
|
||||
m_lastDragPosition = event->position().toPoint() + offset();
|
||||
viewport()->update();
|
||||
event->accept();
|
||||
}
|
||||
@ -610,7 +610,7 @@ void InstanceView::dragMoveEvent(QDragMoveEvent* event)
|
||||
if (!isDragEventAccepted(event)) {
|
||||
return;
|
||||
}
|
||||
m_lastDragPosition = event->pos() + offset();
|
||||
m_lastDragPosition = event->position().toPoint() + offset();
|
||||
viewport()->update();
|
||||
event->accept();
|
||||
}
|
||||
@ -636,7 +636,7 @@ void InstanceView::dropEvent(QDropEvent* event)
|
||||
|
||||
if (event->source() == this) {
|
||||
if (event->possibleActions() & Qt::MoveAction) {
|
||||
std::pair<VisualGroup*, VisualGroup::HitResults> dropPos = rowDropPos(event->pos());
|
||||
std::pair<VisualGroup*, VisualGroup::HitResults> dropPos = rowDropPos(event->position().toPoint());
|
||||
const VisualGroup* group = dropPos.first;
|
||||
auto hitResult = dropPos.second;
|
||||
|
||||
|
@ -75,7 +75,7 @@ ApplicationId ApplicationId::fromTraditionalApp()
|
||||
prefix.remove(QRegularExpression("[^a-zA-Z]"));
|
||||
prefix.truncate(6);
|
||||
QByteArray idc = protoId.toUtf8();
|
||||
quint16 idNum = qChecksum(idc.constData(), idc.size());
|
||||
quint16 idNum = qChecksum(idc);
|
||||
auto socketName = QLatin1String("pl") + prefix + QLatin1Char('-') + QString::number(idNum, 16).left(12);
|
||||
#if defined(Q_OS_WIN)
|
||||
if (!pProcessIdToSessionId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user