Skip to content

Commit

Permalink
remove: QObjectTree is uneeded (lefover from a qml css attempt)
Browse files Browse the repository at this point in the history
Signed-off-by: Rachel Powers <[email protected]>
  • Loading branch information
Ryex committed Nov 1, 2024
1 parent 01c9f8c commit e84324a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 493 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
qt_ver: 6
qt_host: linux
qt_arch: ""
qt_version: "6.2.4"
qt_modules: "qt5compat qtimageformats qtnetworkauth"
qt_version: "6.7.3"
qt_modules: "qt5compat qtimageformats qtnetworkauth qtshadertools"

- os: windows-2022
name: "Windows-MinGW-w64"
Expand All @@ -83,7 +83,7 @@ jobs:
qt_host: windows
qt_arch: ""
qt_version: "6.7.3"
qt_modules: "qt5compat qtimageformats qtnetworkauth"
qt_modules: "qt5compat qtimageformats qtnetworkauth qtshadertools"
nscurl_tag: "v24.9.26.122"
nscurl_sha256: "AEE6C4BE3CB6455858E9C1EE4B3AFE0DB9960FA03FE99CCDEDC28390D57CCBB0"

Expand All @@ -96,7 +96,7 @@ jobs:
qt_host: windows
qt_arch: "win64_msvc2019_arm64"
qt_version: "6.7.3"
qt_modules: "qt5compat qtimageformats qtnetworkauth"
qt_modules: "qt5compat qtimageformats qtnetworkauth qtshadertools"
nscurl_tag: "v24.9.26.122"
nscurl_sha256: "AEE6C4BE3CB6455858E9C1EE4B3AFE0DB9960FA03FE99CCDEDC28390D57CCBB0"

Expand All @@ -107,7 +107,7 @@ jobs:
qt_host: mac
qt_arch: ""
qt_version: "6.7.3"
qt_modules: "qt5compat qtimageformats qtnetworkauth"
qt_modules: "qt5compat qtimageformats qtnetworkauth qtshadertools"

- os: macos-14
name: macOS-Legacy
Expand Down Expand Up @@ -152,12 +152,14 @@ jobs:
extra-cmake-modules:p
ninja:p
qt6-base:p
qt6-declarative:p
qt6-svg:p
qt6-imageformats:p
quazip-qt6:p
ccache:p
qt6-5compat:p
qt6-networkauth:p
qt6-shadertools:p
cmark:p
- name: Force newer ccache
Expand Down Expand Up @@ -216,7 +218,7 @@ jobs:
- name: Install host Qt (Windows MSVC arm64)
if: runner.os == 'Windows' && matrix.architecture == 'arm64'
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
aqtversion: "==3.1.*"
py7zrversion: ">=0.20.2"
Expand All @@ -232,7 +234,7 @@ jobs:

- name: Install Qt (macOS, Linux & Windows MSVC)
if: matrix.msystem == ''
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
aqtversion: "==3.1.*"
py7zrversion: ">=0.20.2"
Expand All @@ -242,6 +244,7 @@ jobs:
modules: ${{ matrix.qt_modules }}
tools: ${{ matrix.qt_tools }}
cache: ${{ inputs.is_qt_cached }}
archives: "qtbase qtsvg qtdeclarative qtgamepad qtgraphicaleffects qtimageformats"

- name: Install MSVC (Windows MSVC)
if: runner.os == 'Windows' # We want this for MinGW builds as well, as we need SignTool
Expand Down
23 changes: 4 additions & 19 deletions launcher/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include "pathmatcher/MultiMatcher.h"
#include "pathmatcher/SimplePrefixMatcher.h"
#include "tasks/Task.h"
#include "qobject_tree/QObjectTree.h"
#include "tools/GenericProfiler.h"
#include "ui/InstanceWindow.h"
#include "ui/MainWindow.h"
Expand Down Expand Up @@ -505,15 +504,15 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
foundLoggingRules = QFile::exists(logRulesPath);

// search the dataPath()
// seach app data standard path
// search app data standard path
if (!foundLoggingRules && !isPortable() && dirParam.isEmpty() && dataDirEnv.isEmpty()) {
logRulesPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, FS::PathCombine("..", logRulesFile));
if (!logRulesPath.isEmpty()) {
qDebug() << "Found" << logRulesPath << "...";
foundLoggingRules = true;
}
}
// seach root path
// search root path
if (!foundLoggingRules) {
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
logRulesPath = FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME, logRulesFile);
Expand Down Expand Up @@ -1296,7 +1295,7 @@ void Application::performMainStartupAction()
qDebug() << "<> Updater started.";
}

{ // delete instances tmp dirctory
{ // delete instances tmp directory
auto instDir = m_settings->get("InstanceDir").toString();
const QString tempRoot = FS::PathCombine(instDir, ".tmp");
FS::deletePath(tempRoot);
Expand Down Expand Up @@ -1625,20 +1624,6 @@ MainWindow* Application::showMainWindow(bool minimized)
return m_mainWindow;
}

void printNode(QObjectTreeItem* node, int level)
{
if (!node) {
return;
}
qDebug() << level << node->data(0) << node->data(1) << node->data(2);
for (int i = 0; i < node->childCount(); ++i) {
auto child = node->child(i);
if (child) {
printNode(child, level + 1);
}
}
}

void Application::showWidgetGallery()
{
auto widgetGallery = new WidgetGalleryWindow();
Expand Down Expand Up @@ -1805,7 +1790,7 @@ QString Application::getJarPath(QString jarFile)
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
#endif
FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars"),
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debugging
};
for (QString p : potentialPaths) {
QString jarPath = FS::PathCombine(p, jarFile);
Expand Down
1 change: 0 additions & 1 deletion launcher/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

#include "AppQmlEngine.h"
#include "minecraft/launch/MinecraftTarget.h"
#include "qobject_tree/QObjectTree.h"

class LaunchController;
class LocalPeer;
Expand Down
7 changes: 1 addition & 6 deletions launcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,6 @@ set(MODELS_SOURCES
models/QtResourcesModel.h
)

set(QOBJECTTREE_SOURCES
qobject_tree/QObjectTree.cpp
qobject_tree/QObjectTree.h
)

set(QMLHELPER_SOURCES
LambdaHelper.h
)
Expand Down Expand Up @@ -792,7 +787,6 @@ set(LOGIC_SOURCES
${TECHNIC_SOURCES}
${ATLAUNCHER_SOURCES}
${MODELS_SOURCES}
${QOBJECTTREE_SOURCES}
${QMLHELPER_SOURCES}
${QML_ENGINE_SOURCES}
${WIDGET_GALLERY_SOURCES}
Expand Down Expand Up @@ -1339,6 +1333,7 @@ target_link_libraries(Launcher_logic

if (UNIX AND NOT CYGWIN AND NOT APPLE)
target_link_libraries(Launcher_logic
PUBLIC
gamemode
)
endif()
Expand Down
17 changes: 8 additions & 9 deletions launcher/models/QtResourcesModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,15 @@ QVariant QtResourceModel::data(const QModelIndex& index, int role) const
if (!index.isValid() || index.model() != this)
return QVariant();

auto column = index.column();
switch (role) {
case Qt::DisplayRole:
switch (index.column()) {
case NameColumn:
return this->name(index);
case SizeColumn:
// TODO: actually report size
return this->size(index);
default:
break;
if (column == NameColumn) {
return this->name(index);
} else if (column == SizeColumn) {
return this->size(index);
}
break;
case FilePathRole:
return filePath(index);
case FileNameRole:
Expand Down Expand Up @@ -248,7 +246,8 @@ QString QtResourceModel::name(const QModelIndex& index) const
return indexNode->fileName;
}

qint64 QtResourceModel::size(const QModelIndex& index) const {
qint64 QtResourceModel::size(const QModelIndex& index) const
{
if (!index.isValid()) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion launcher/qml/org/prismlauncher/pqcstyle/TabFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#include <QApplication>
#include <QStyle>
#include <QStyleOptionTabwidgetFrame>
#include <QtWidgets/QStyleOptionTabwidgetFrame>

PStyleTabFrame::PStyleTabFrame(QQuickItem* parent) : PQuickStyleItem(parent)
{
Expand Down
Loading

0 comments on commit e84324a

Please sign in to comment.