Skip to content

Commit 7a5414f

Browse files
committed
feat(upstream): merge PrismLauncher 10.0.1
Signed-off-by: so5iso4ka <so5iso4ka@icloud.com>
2 parents db9f335 + c64d871 commit 7a5414f

16 files changed

Lines changed: 112 additions & 32 deletions

launcher/Application.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "tools/GenericProfiler.h"
5353
#include "ui/InstanceWindow.h"
5454
#include "ui/MainWindow.h"
55+
#include "ui/ToolTipFilter.h"
5556
#include "ui/ViewLogWindow.h"
5657

5758
#include "ui/dialogs/ProgressDialog.h"
@@ -1222,6 +1223,10 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
12221223
}
12231224
}
12241225

1226+
if (qgetenv("XDG_CURRENT_DESKTOP") == "gamescope") {
1227+
installEventFilter(new ToolTipFilter);
1228+
}
1229+
12251230
if (createSetupWizard()) {
12261231
return;
12271232
}

launcher/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,8 @@ SET(LAUNCHER_SOURCES
888888
ui/InstanceWindow.cpp
889889
ui/ViewLogWindow.h
890890
ui/ViewLogWindow.cpp
891+
ui/ToolTipFilter.h
892+
ui/ToolTipFilter.cpp
891893

892894
# FIXME: maybe find a better home for this.
893895
FileIgnoreProxy.cpp

launcher/InstanceImportTask.cpp

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,17 @@ void InstanceImportTask::processZipPack()
150150
extractDir.cd("minecraft");
151151
m_modpackType = ModpackType::Technic;
152152
stop = true;
153-
} else {
154-
QFileInfo fileInfo(fileName);
155-
if (fileInfo.fileName() == "instance.cfg") {
156-
qDebug() << "MultiMC:" << true;
157-
m_modpackType = ModpackType::MultiMC;
158-
root = cleanPath(fileInfo.path());
159-
stop = true;
160-
return true;
161-
}
162-
if (fileInfo.fileName() == "manifest.json") {
163-
qDebug() << "Flame:" << true;
164-
m_modpackType = ModpackType::Flame;
165-
root = cleanPath(fileInfo.path());
166-
stop = true;
167-
return true;
168-
}
153+
} else if (fileName == "manifest.json") {
154+
qDebug() << "Flame:" << true;
155+
m_modpackType = ModpackType::Flame;
156+
stop = true;
157+
return true;
158+
} else if (QFileInfo fileInfo(fileName); fileInfo.fileName() == "instance.cfg") {
159+
qDebug() << "MultiMC:" << true;
160+
m_modpackType = ModpackType::MultiMC;
161+
root = cleanPath(fileInfo.path());
162+
stop = true;
163+
return true;
169164
}
170165
QCoreApplication::processEvents();
171166
return true;

launcher/icons/IconList.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <QFileSystemWatcher>
4141
#include <QMap>
4242
#include <QMimeData>
43+
#include <QPixmap>
4344
#include <QSet>
4445
#include <QUrl>
4546
#include "icons/IconUtils.h"
@@ -217,7 +218,13 @@ void IconList::fileChanged(const QString& path)
217218
int idx = getIconIndex(key);
218219
if (idx == -1)
219220
return;
220-
QIcon icon(path);
221+
QIcon icon;
222+
// special handling for jpg and jpeg to go through pixmap to keep the size constant
223+
if (path.endsWith(".jpg") || path.endsWith(".jpeg")) {
224+
icon.addPixmap(QPixmap(path));
225+
} else {
226+
icon.addFile(path);
227+
}
221228
if (icon.availableSizes().empty())
222229
return;
223230

@@ -395,7 +402,14 @@ bool IconList::addThemeIcon(const QString& key)
395402
bool IconList::addIcon(const QString& key, const QString& name, const QString& path, const IconType type)
396403
{
397404
// replace the icon even? is the input valid?
398-
QIcon icon(path);
405+
QIcon icon;
406+
// special handling for jpg and jpeg to go through pixmap to keep the size constant
407+
if (path.endsWith(".jpg") || path.endsWith(".jpeg")) {
408+
icon.addPixmap(QPixmap(path));
409+
} else {
410+
icon.addFile(path);
411+
}
412+
399413
if (icon.isNull())
400414
return false;
401415
auto iter = m_nameIndex.find(key);

launcher/minecraft/mod/ResourceFolderModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ bool ResourceFolderModel::update()
335335
},
336336
Qt::ConnectionType::QueuedConnection);
337337

338-
Task::Ptr preUpdate{createPreUpdateTask()};
338+
Task::Ptr preUpdate{ createPreUpdateTask() };
339339

340340
if (preUpdate != nullptr) {
341341
auto task = new SequentialTask("ResourceFolderModel::update");

launcher/minecraft/mod/ShaderPackFolderModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "FileSystem.h"
21
#include "ShaderPackFolderModel.h"
2+
#include "FileSystem.h"
33

44
namespace {
55
class ShaderPackIndexMigrateTask : public Task {

launcher/minecraft/mod/tasks/LocalResourceUpdateTask.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ LocalResourceUpdateTask::LocalResourceUpdateTask(QDir index_dir, ModPlatform::In
3535
}
3636

3737
#ifdef Q_OS_WIN32
38-
SetFileAttributesW(index_dir.path().toStdWString().c_str(), FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
38+
std::wstring wpath = index_dir.path().toStdWString();
39+
if (index_dir.dirName().startsWith('.')) {
40+
SetFileAttributesW(wpath.c_str(), FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
41+
} else {
42+
// fix shaderpacks folder being hidden by Prism Launcher 10.0.1
43+
SetFileAttributesW(wpath.c_str(), FILE_ATTRIBUTE_NORMAL);
44+
}
3945
#endif
4046
}
4147

launcher/net/NetRequest.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ void NetRequest::downloadError(QNetworkReply::NetworkError error)
169169
}
170170
}
171171
// error happened during download.
172-
qCCritical(logCat) << getUid().toString() << "Failed" << m_url.toString() << "with reason" << error;
172+
qCCritical(logCat) << getUid().toString() << "Failed" << m_url.toString() << "with error" << error;
173173
if (m_reply)
174-
qCCritical(logCat) << getUid().toString() << "HTTP Status" << replyStatusCode() << ";error" << errorString();
174+
qCCritical(logCat) << getUid().toString() << "HTTP status:" << replyStatusCode() << errorString();
175+
if (m_errorResponse.size() > 0)
176+
qCCritical(logCat) << getUid().toString() << "Response from server:" << m_errorResponse;
175177
m_state = State::Failed;
176178
}
177179
}
@@ -308,6 +310,9 @@ void NetRequest::downloadReadyRead()
308310
if (m_state == State::Running) {
309311
auto data = m_reply->readAll();
310312
m_state = m_sink->write(data);
313+
if (replyStatusCode() >= 400) {
314+
m_errorResponse.append(data);
315+
}
311316
if (m_state == State::Failed) {
312317
qCCritical(logCat) << getUid().toString() << "Failed to process response chunk:" << m_sink->failReason();
313318
}

launcher/net/NetRequest.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class NetRequest : public Task {
106106

107107
/// the network reply
108108
unique_qobject_ptr<QNetworkReply> m_reply;
109+
QByteArray m_errorResponse;
109110

110111
/// source URL
111112
QUrl m_url;

launcher/ui/ToolTipFilter.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-License-Identifier: GPL-3.0-only
2+
/*
3+
* Prism Launcher - Minecraft Launcher
4+
* Copyright (C) 2026 Mark Deneen <mdeneen@gmail.com>
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, version 3.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
*/
19+
20+
#include "ToolTipFilter.h"
21+
22+
bool ToolTipFilter::eventFilter(QObject* obj, QEvent* ev)
23+
{
24+
if (ev->type() == QEvent::ToolTip) {
25+
return true;
26+
} else {
27+
return QObject::eventFilter(obj, ev);
28+
}
29+
}

0 commit comments

Comments
 (0)