From 7022fc27142350414afd4bba2f0e6688bc263ffd Mon Sep 17 00:00:00 2001 From: CrSjimo Date: Tue, 28 Oct 2025 23:45:50 +0800 Subject: [PATCH 001/319] Fix svscraft QtShaderTools linking --- .github/actions/initialize-build-environment/action.yml | 2 +- src/libs/3rdparty/svscraft | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/initialize-build-environment/action.yml b/.github/actions/initialize-build-environment/action.yml index 2d35b2f5..f92910ef 100644 --- a/.github/actions/initialize-build-environment/action.yml +++ b/.github/actions/initialize-build-environment/action.yml @@ -45,5 +45,5 @@ runs: uses: jurplel/install-qt-action@v4 with: version: ${{ inputs.qt_version }} - modules: qt5compat + modules: qt5compat qtshadertools cache: true diff --git a/src/libs/3rdparty/svscraft b/src/libs/3rdparty/svscraft index db265541..eb10eb99 160000 --- a/src/libs/3rdparty/svscraft +++ b/src/libs/3rdparty/svscraft @@ -1 +1 @@ -Subproject commit db26554132eebdc78f7f2ecfa684e8920f1e2bfb +Subproject commit eb10eb9933528dc072af7074f801b889fd0d6144 From 678d831e0e44c5d047f0f1605f03bb96454b7d30 Mon Sep 17 00:00:00 2001 From: CrSjimo Date: Wed, 29 Oct 2025 00:19:42 +0800 Subject: [PATCH 002/319] Update choruskit --- src/libs/3rdparty/choruskit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/3rdparty/choruskit b/src/libs/3rdparty/choruskit index 00cbb74c..20df2897 160000 --- a/src/libs/3rdparty/choruskit +++ b/src/libs/3rdparty/choruskit @@ -1 +1 @@ -Subproject commit 00cbb74c1c39b54bbd7178fbd4bc9e5f6cbdb1d9 +Subproject commit 20df2897ebacae703a6e4ff4d73e26d43d59daa7 From 7bcc340f5d56a2a4e3ee4f3b702c58c746cba031 Mon Sep 17 00:00:00 2001 From: CrSjimo Date: Sun, 2 Nov 2025 21:23:27 +0800 Subject: [PATCH 003/319] Update clang format --- .clang-format | 370 ++++++++++++------ .../uishell/src/AchievementProxyModel.cpp | 20 +- .../uishell/src/AchievementProxyModel_p.h | 3 +- .../uishell/src/ActionLayoutsEditorHelper.cpp | 7 +- .../uishell/src/ActionLayoutsEditorHelper_p.h | 3 +- .../uishell/src/DigitalClockLabel_p.h | 3 +- .../uishell/src/InvisibleCentralWidget_p.h | 3 +- .../uishell/src/LyricsSubtreeProxyModel.cpp | 1 + .../uishell/src/LyricsSubtreeProxyModel_p.h | 1 + .../uishell/src/PluginManagerHelper.cpp | 10 +- .../uishell/src/PluginManagerHelper_p.h | 5 +- .../uishell/src/RecentFilesProxyModel.cpp | 2 +- .../uishell/src/RecentFilesProxyModel_p.h | 3 +- .../uishell/src/SettingCatalogModel.cpp | 14 +- .../uishell/src/SettingCatalogModel_p.h | 3 +- .../SettingCatalogSortFilterProxyModel.cpp | 28 +- .../SettingCatalogSortFilterProxyModel_p.h | 5 +- .../uishell/src/SettingPageWidgetDialog.cpp | 1 - .../uishell/src/SettingPageWidgetDialog_p.h | 4 +- .../uishell/src/SubtreeProxyModel.cpp | 24 +- .../application/uishell/src/UIShellGlobal.h | 4 +- src/libs/application/uishell/src/USDef_p.h | 5 +- .../uishell/src/WindowAgentForeign_p.h | 3 +- .../internal/achievementplugin.cpp | 14 +- .../achievement/internal/achievementplugin.h | 1 - .../internal/addons/achievementaddon.cpp | 4 +- .../internal/addons/achievementaddon.h | 5 +- src/plugins/audio/internal/audioplugin.cpp | 17 +- src/plugins/audio/internal/audioplugin.h | 5 +- .../dialogs/audiotroubleshootingdialog.cpp | 31 +- .../dialogs/audiotroubleshootingdialog.h | 3 +- .../internal/settings/audioandmidipage.cpp | 2 +- .../internal/settings/audioandmidipage.h | 3 +- .../internal/settings/audiooutputpage.cpp | 4 +- .../audio/internal/settings/audiooutputpage.h | 3 +- .../internal/subsystems/outputsystem.cpp | 7 +- .../audio/internal/subsystems/outputsystem.h | 1 - .../utils/audiooutputsettingshelper.cpp | 157 ++++---- .../utils/audiooutputsettingshelper.h | 10 +- src/plugins/coreplugin/core/coreinterface.cpp | 81 ++-- src/plugins/coreplugin/core/coreinterface.h | 3 +- .../coreplugin/core/notificationmessage.h | 4 +- src/plugins/coreplugin/core/quickinput.cpp | 46 ++- src/plugins/coreplugin/core/quickinput.h | 3 +- src/plugins/coreplugin/core/quickinput_p.h | 6 +- src/plugins/coreplugin/core/quickpick.cpp | 41 +- src/plugins/coreplugin/core/quickpick.h | 3 +- src/plugins/coreplugin/core/quickpick_p.h | 6 +- src/plugins/coreplugin/coreglobal.h | 4 +- .../internal/actions/actionhelper.cpp | 6 +- .../internal/actions/findactionsmodel.cpp | 15 +- .../internal/addon/editactionsaddon.cpp | 6 +- .../internal/addon/findactionsaddon.cpp | 10 +- .../internal/addon/metadataaddon.cpp | 13 +- .../coreplugin/internal/addon/metadataaddon.h | 2 +- .../internal/addon/notificationaddon.cpp | 13 +- .../addon/projectstartuptimeraddon.cpp | 18 +- .../addon/projectwindownavigatoraddon.cpp | 12 +- .../addon/projectwindownavigatoraddon.h | 2 +- .../internal/addon/recentfileaddon.cpp | 14 +- .../internal/addon/recentfileaddon.h | 2 +- .../internal/addon/timelineaddon.cpp | 39 +- .../internal/addon/viewvisibilityaddon.cpp | 9 +- .../internal/addon/workspaceaddon.cpp | 52 ++- .../internal/behaviorpreference.cpp | 8 +- .../coreplugin/internal/behaviorpreference.h | 3 +- .../colorscheme/colorschemecollection.cpp | 251 ++++++------ .../colorschemewelcomewizardpagehelper.h | 3 +- .../coreplugin/internal/coreplugin.cpp | 115 +++--- src/plugins/coreplugin/internal/coreplugin.h | 4 +- .../internal/extras/coreachievementsmodel.h | 4 +- .../notification/notificationmanager.cpp | 23 +- .../notification/notificationmanager.h | 2 +- .../internal/settings/appearancepage.cpp | 2 +- .../internal/settings/colorschemepage.cpp | 21 +- .../internal/settings/colorschemepage.h | 4 +- .../internal/settings/filebackuppage.cpp | 4 +- .../internal/settings/filebackuppage.h | 2 +- .../internal/settings/generalpage.cpp | 19 +- .../internal/settings/generalpage.h | 1 - .../internal/settings/keymappage.cpp | 11 +- .../coreplugin/internal/settings/logpage.cpp | 6 +- .../coreplugin/internal/settings/logpage.h | 2 +- .../coreplugin/internal/settings/menupage.cpp | 19 +- .../coreplugin/internal/settings/menupage.h | 1 - .../internal/settings/timeindicatorpage.cpp | 2 +- .../projectwindowworkspacelayout.cpp | 6 +- .../workspace/projectwindowworkspacelayout.h | 5 +- .../projectwindowworkspacemanager.cpp | 119 +++--- .../workspace/projectwindowworkspacemanager.h | 1 - .../coreplugin/project/editactionshandler.h | 3 +- .../project/editactionshandlerregistry.cpp | 64 ++- .../project/editactionshandlerregistry.h | 2 +- .../project/projectdocumentcontext.cpp | 26 +- .../project/projectdocumentcontext.h | 1 - .../project/projectdocumentcontext_p.h | 1 - .../coreplugin/project/projecttimeline.cpp | 2 +- .../coreplugin/project/projecttimeline.h | 9 +- .../windows/actionwindowinterfacebase.cpp | 10 +- .../windows/actionwindowinterfacebase.h | 4 +- .../windows/homewindowinterface.cpp | 4 +- .../coreplugin/windows/homewindowinterface.h | 5 +- .../windows/projectwindowinterface.cpp | 92 +++-- .../windows/projectwindowinterface.h | 5 +- .../internal/addons/maintenanceaddon.cpp | 19 +- .../internal/addons/maintenanceaddon.h | 5 +- .../internal/applicationupdatechecker.cpp | 36 +- .../internal/applicationupdatechecker.h | 10 +- .../internal/applicationupdatechecker_p.h | 10 +- .../internal/maintenanceplugin.cpp | 5 +- .../maintenance/internal/maintenanceplugin.h | 1 - .../internal/settings/updatepage.cpp | 16 +- .../internal/settings/updatepage.h | 4 +- .../internal/addons/welcomewizardaddon.cpp | 7 +- .../internal/addons/welcomewizardaddon.h | 5 +- .../internal/welcomewizardplugin.h | 1 - 116 files changed, 1128 insertions(+), 1056 deletions(-) diff --git a/.clang-format b/.clang-format index f3affdec..e59adbd6 100644 --- a/.clang-format +++ b/.clang-format @@ -1,130 +1,252 @@ -# References: -# https://clang.llvm.org/docs/ClangFormatStyleOptions.html -# https://code.qt.io/cgit/qt/qt5.git/tree/_clang-format - +Language: Cpp BasedOnStyle: LLVM - -Standard: c++20 - -# 指针和引用的对齐方式。 -# 可能的值有: -# PAS_Left (在配置中: Left) 指针左对齐。 -# PAS_Right (在配置中: Right) 指针右对齐。 -# PAS_Middle (在配置中: Middle) 指针中间对齐。 -PointerAlignment: Right - -# public/protected/private 等访问修饰符偏移量 AccessModifierOffset: -4 - -# 缩进长度 -IndentWidth: 4 - -# 连续空行的最大数 -MaxEmptyLinesToKeep: 999 - -# 在OC中的@property后面添加一个空格。例如:使用“@property (readonly)”而不是“@property(readonly)” -ObjCSpaceAfterProperty: true - -# OC块中所拍的字符数 -ObjCBlockIndentWidth: 4 - -# 取决于值, 语句“int f() { return 0; }”可以被放到一个单行。 -# 可能的值有: -# SFS_None (在配置中: None) 从不合并方法或函数到单独的一行。 -# SFS_Empty (在配置中: Empty) 仅合并空的函数。 -# SFS_Inline (在配置中: Inline) 仅合并类中定义的方法或函数. 意味着 “empty”. -# SFS_All (在配置中: All) 合并所有的方法适应单行. -AllowShortFunctionsOnASingleLine: None - -# 如果为真(true), 语句“if (a) return;” 能被放到单行。 -AllowShortIfStatementsOnASingleLine: false - -# 如果为真(true), 对齐注释。 -AlignTrailingComments: true - -# 如果为真,对齐连续的宏定义 -AlignConsecutiveMacros: true - -# 如果为真(true),将会在“[”之后和“]”之前插入空格。 -SpacesInSquareBrackets: false - -# 如果为真(true), 将会在“(”之后和“)”之前插入空格。 -SpacesInParentheses : false - -# 如果为真(true), 校准连续的声明。 -# 这将会校准连续多行的声明的名字。这将会导致像下面这样的格式: -# int aaaa = 12; -# float b = 23; -# std::string ccc = 23; -AlignConsecutiveDeclarations: false - -# 如果为真(true),连续调整多行 -# 这将会调整连续行中的分配操作符。这将会导致像下面这样的格式: -# int aaaa = 12; -# int b = 23; -# int ccc = 23; -AlignConsecutiveAssignments: false - -# 如果为假(false),移除分配操作符(=)前空格。 -SpaceBeforeAssignmentOperators: true - -# 如果为真(true), 将会在字面量容器中插入空格(例如 OC和Javascript的数组和字典字面量)。 -SpacesInContainerLiterals: false - -# 缩进case标签 +AlignAfterOpenBracket: BlockIndent +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false +AlignConsecutiveDeclarations: + Enabled: false +AlignConsecutiveMacros: + Enabled: false +AlignConsecutiveShortCaseStatements: + Enabled: false +AlignEscapedNewlines: Left +AlignOperands: Align +AlignTrailingComments: + Kind: Never +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowBreakBeforeNoexceptSpecifier: Never +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: true +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +AttributeMacros: + - __capability +BinPackArguments: true +BinPackParameters: true +BitFieldColonSpacing: Both +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterExternBlock: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakAfterAttributes: Leave +BreakAfterJavaFieldAnnotations: false +BreakArrays: true +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: Attach +BreakBeforeInlineASMColon: OnlyMultiline +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +BreakStringLiterals: true +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE] +IfMacros: + - KJ_IF_MAYBE +IncludeBlocks: Regroup +IncludeCategories: + # Local headers + - Regex: '^".*\.h"$' + Priority: -999 + # Qt public + - Regex: '^<(Q[a-zA-Z0-9_]+|qt_[a-zA-Z0-9_]+\.h|qqml_[a-zA-Z0-9_]+\.h)>$' + Priority: 201 + # Qt qpa + - Regex: '^$' + Priority: 202 + # Qt private + - Regex: '^$' + Priority: 203 + # Windows platform-specific + - Regex: '^<[a-zA-Z0-9_]+\.h>$' + Priority: 1 + # C++ standard library + - Regex: '^<[a-z0-9_]+>$' + Priority: 2 + # Boost + - Regex: '^ AchievementProxyModel::roleNames() const { static const QHash roles{ - {USDef::AR_IdRole, "id" }, - {USDef::AR_NameRole, "name" }, + {USDef::AR_IdRole, "id"}, + {USDef::AR_NameRole, "name"}, {USDef::AR_DescriptionRole, "description"}, - {USDef::AR_IconRole, "icon" }, - {USDef::AR_IconColorRole, "iconColor" }, - {USDef::AR_HiddenRole, "hidden" }, - {CompletedRole, "completed" }, + {USDef::AR_IconRole, "icon"}, + {USDef::AR_IconColorRole, "iconColor"}, + {USDef::AR_HiddenRole, "hidden"}, + {CompletedRole, "completed"}, }; return roles; } @@ -33,7 +33,7 @@ namespace UIShell { const QString id = QIdentityProxyModel::data(index, USDef::AR_IdRole).toString(); return m_completedAchievements.contains(id); } - + // For all other roles, delegate to the parent implementation return QIdentityProxyModel::data(index, role); } @@ -68,7 +68,7 @@ namespace UIShell { bool AchievementProxyModel::handleAchievementCompleted(const QString &id, bool completed) { bool changed = false; - + if (completed) { // Add to completed achievements if not already present if (!m_completedAchievements.contains(id)) { @@ -82,7 +82,7 @@ namespace UIShell { changed = true; } } - + if (changed) { // Use cached mapping to find the model index directly const QModelIndex idx = indexForId(id); diff --git a/src/libs/application/uishell/src/AchievementProxyModel_p.h b/src/libs/application/uishell/src/AchievementProxyModel_p.h index 0951aac0..89e63893 100644 --- a/src/libs/application/uishell/src/AchievementProxyModel_p.h +++ b/src/libs/application/uishell/src/AchievementProxyModel_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_ACHIEVEMENTPROXYMODEL_P_H #define UISHELL_ACHIEVEMENTPROXYMODEL_P_H -#include #include +#include + namespace UIShell { class AchievementProxyModel : public QIdentityProxyModel { diff --git a/src/libs/application/uishell/src/ActionLayoutsEditorHelper.cpp b/src/libs/application/uishell/src/ActionLayoutsEditorHelper.cpp index 22fc422a..863d7d13 100644 --- a/src/libs/application/uishell/src/ActionLayoutsEditorHelper.cpp +++ b/src/libs/application/uishell/src/ActionLayoutsEditorHelper.cpp @@ -54,10 +54,7 @@ namespace UIShell { --len; if (len == 0) break; - } else if (s.at(pos) == QLatin1Char('(') && len >= 4 && - s.at(pos + 1) == QLatin1Char('&') && - s.at(pos + 2) != QLatin1Char('&') && - s.at(pos + 3) == QLatin1Char(')')) { + } else if (s.at(pos) == QLatin1Char('(') && len >= 4 && s.at(pos + 1) == QLatin1Char('&') && s.at(pos + 2) != QLatin1Char('&') && s.at(pos + 3) == QLatin1Char(')')) { // a mnemonic with format "\s*(&X)" int n = 0; while (idx > n && text.at(idx - n - 1).isSpace()) @@ -66,7 +63,7 @@ namespace UIShell { pos += 4; len -= 4; continue; - } + } text[idx] = s.at(pos); ++pos; ++idx; diff --git a/src/libs/application/uishell/src/ActionLayoutsEditorHelper_p.h b/src/libs/application/uishell/src/ActionLayoutsEditorHelper_p.h index bab17ed9..e93f500f 100644 --- a/src/libs/application/uishell/src/ActionLayoutsEditorHelper_p.h +++ b/src/libs/application/uishell/src/ActionLayoutsEditorHelper_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_ACTIONLAYOUTSEDITORHELPER_P_H #define UISHELL_ACTIONLAYOUTSEDITORHELPER_P_H -#include #include +#include + class QJSValue; namespace QAK { diff --git a/src/libs/application/uishell/src/DigitalClockLabel_p.h b/src/libs/application/uishell/src/DigitalClockLabel_p.h index 786df684..d8f6a409 100644 --- a/src/libs/application/uishell/src/DigitalClockLabel_p.h +++ b/src/libs/application/uishell/src/DigitalClockLabel_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_DIGITALCLOCKLABEL_P_H #define UISHELL_DIGITALCLOCKLABEL_P_H -#include #include +#include + #include namespace UIShell { diff --git a/src/libs/application/uishell/src/InvisibleCentralWidget_p.h b/src/libs/application/uishell/src/InvisibleCentralWidget_p.h index c358e4cb..d0681076 100644 --- a/src/libs/application/uishell/src/InvisibleCentralWidget_p.h +++ b/src/libs/application/uishell/src/InvisibleCentralWidget_p.h @@ -1,9 +1,10 @@ #ifndef DIFFSCOPE_UISHELL_INVISIBLECENTRALWIDGET_P_H #define DIFFSCOPE_UISHELL_INVISIBLECENTRALWIDGET_P_H +#include + #include #include -#include namespace UIShell { diff --git a/src/libs/application/uishell/src/LyricsSubtreeProxyModel.cpp b/src/libs/application/uishell/src/LyricsSubtreeProxyModel.cpp index 343138a6..5183e73c 100644 --- a/src/libs/application/uishell/src/LyricsSubtreeProxyModel.cpp +++ b/src/libs/application/uishell/src/LyricsSubtreeProxyModel.cpp @@ -1,4 +1,5 @@ #include "LyricsSubtreeProxyModel_p.h" + #include namespace UIShell { diff --git a/src/libs/application/uishell/src/LyricsSubtreeProxyModel_p.h b/src/libs/application/uishell/src/LyricsSubtreeProxyModel_p.h index be8f3107..7f722d31 100644 --- a/src/libs/application/uishell/src/LyricsSubtreeProxyModel_p.h +++ b/src/libs/application/uishell/src/LyricsSubtreeProxyModel_p.h @@ -2,6 +2,7 @@ #define UISHELL_LYRICSSUBTREEPROXYMODEL_P_H #include "SubtreeProxyModel_p.h" + #include namespace UIShell { diff --git a/src/libs/application/uishell/src/PluginManagerHelper.cpp b/src/libs/application/uishell/src/PluginManagerHelper.cpp index 466d0604..8dc7df72 100644 --- a/src/libs/application/uishell/src/PluginManagerHelper.cpp +++ b/src/libs/application/uishell/src/PluginManagerHelper.cpp @@ -5,8 +5,8 @@ #include -#include #include +#include #include #include @@ -106,8 +106,6 @@ namespace UIShell { return result; } - - PluginCollectionHelper::PluginCollectionHelper(ExtensionSystem::PluginCollection *pluginCollection, PluginManagerHelper *parent) : QObject(parent), m_pluginCollection(pluginCollection) { } @@ -129,8 +127,6 @@ namespace UIShell { return result; } - - PluginManagerHelper::PluginManagerHelper(QObject *parent) : QObject(parent) { } @@ -138,9 +134,7 @@ namespace UIShell { QList PluginManagerHelper::pluginCollections() { QList result; - std::ranges::transform(ExtensionSystem::PluginManager::pluginCollections(), - std::back_inserter(result), - [=, this](auto *p) { return getHelper(p); }); + std::ranges::transform(ExtensionSystem::PluginManager::pluginCollections(), std::back_inserter(result), [=, this](auto *p) { return getHelper(p); }); return result; } PluginSpecHelper *PluginManagerHelper::findPlugin(const QString &name) { diff --git a/src/libs/application/uishell/src/PluginManagerHelper_p.h b/src/libs/application/uishell/src/PluginManagerHelper_p.h index b707cdc9..2a37e74f 100644 --- a/src/libs/application/uishell/src/PluginManagerHelper_p.h +++ b/src/libs/application/uishell/src/PluginManagerHelper_p.h @@ -1,10 +1,11 @@ #ifndef UISHELL_PLUGINMANAGERHELPER_H #define UISHELL_PLUGINMANAGERHELPER_H -#include -#include #include +#include +#include + namespace ExtensionSystem { class PluginSpec; class PluginCollection; diff --git a/src/libs/application/uishell/src/RecentFilesProxyModel.cpp b/src/libs/application/uishell/src/RecentFilesProxyModel.cpp index 1a0c93cc..88991d09 100644 --- a/src/libs/application/uishell/src/RecentFilesProxyModel.cpp +++ b/src/libs/application/uishell/src/RecentFilesProxyModel.cpp @@ -11,7 +11,7 @@ namespace UIShell { } RecentFilesProxyModel::~RecentFilesProxyModel() = default; QHash RecentFilesProxyModel::roleNames() const { - static const QHash m { + static const QHash m{ {USDef::RF_NameRole, "name"}, {USDef::RF_PathRole, "path"}, {USDef::RF_LastModifiedTextRole, "lastModifiedText"}, diff --git a/src/libs/application/uishell/src/RecentFilesProxyModel_p.h b/src/libs/application/uishell/src/RecentFilesProxyModel_p.h index d71ef1f6..da95dd3b 100644 --- a/src/libs/application/uishell/src/RecentFilesProxyModel_p.h +++ b/src/libs/application/uishell/src/RecentFilesProxyModel_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_RECENTFILESPROXYMODEL_P_H #define UISHELL_RECENTFILESPROXYMODEL_P_H -#include #include +#include + namespace UIShell { class RecentFilesProxyModel : public QSortFilterProxyModel { diff --git a/src/libs/application/uishell/src/SettingCatalogModel.cpp b/src/libs/application/uishell/src/SettingCatalogModel.cpp index deea5d34..f987b310 100644 --- a/src/libs/application/uishell/src/SettingCatalogModel.cpp +++ b/src/libs/application/uishell/src/SettingCatalogModel.cpp @@ -1,7 +1,7 @@ #include "SettingCatalogModel_p.h" -#include #include +#include namespace UIShell { @@ -108,10 +108,10 @@ namespace UIShell { } switch (role) { - case Qt::DisplayRole: - return QVariant::fromValue(page); - default: - return QVariant(); + case Qt::DisplayRole: + return QVariant::fromValue(page); + default: + return QVariant(); } } @@ -149,7 +149,7 @@ namespace UIShell { // Find the parent of the added page Core::ISettingPage *parentPage = page->parentPage(); - + if (!parentPage) { // Top-level page added auto pages = m_catalog->pages(); @@ -235,7 +235,7 @@ namespace UIShell { return parentPage->pages().indexOf(page); } - static Core::ISettingPage *findPageById(const QList &pages, const QString &id) { + static Core::ISettingPage *findPageById(const QList &pages, const QString &id) { for (Core::ISettingPage *page : pages) { if (page && page->id() == id) { return page; diff --git a/src/libs/application/uishell/src/SettingCatalogModel_p.h b/src/libs/application/uishell/src/SettingCatalogModel_p.h index ba1f2f82..7a277151 100644 --- a/src/libs/application/uishell/src/SettingCatalogModel_p.h +++ b/src/libs/application/uishell/src/SettingCatalogModel_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_SETTINGCATALOGMODEL_P_H #define UISHELL_SETTINGCATALOGMODEL_P_H -#include #include +#include + namespace Core { class SettingCatalog; class ISettingPage; diff --git a/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel.cpp b/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel.cpp index 21d5f230..e8ab4a81 100644 --- a/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel.cpp +++ b/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel.cpp @@ -21,10 +21,10 @@ namespace UIShell { if (m_filterKeyword == keyword) { return; } - + m_filterKeyword = keyword; emit filterKeywordChanged(); - + // Trigger filter update invalidateFilter(); } @@ -38,17 +38,17 @@ namespace UIShell { if (m_filterKeyword.isEmpty()) { return true; } - + QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); if (!index.isValid()) { return false; } - + Core::ISettingPage *page = pageForIndex(index); if (!page) { return false; } - + // Use ISettingPage::matches() to check if the page matches the filter keyword return page->matches(m_filterKeyword); } @@ -57,22 +57,22 @@ namespace UIShell { if (!index.isValid()) { return nullptr; } - + // Get the page from the model data QVariant data = sourceModel()->data(index, Qt::DisplayRole); if (!data.isValid()) { return nullptr; } - + // The SettingCatalogModel returns ISettingPage* as QVariant - return data.value(); + return data.value(); } QModelIndex SettingCatalogSortFilterProxyModel::findFirstMatch() const { if (!sourceModel()) { return {}; } - + // Start depth-first search from the root return findFirstMatchRecursive(QModelIndex()); } @@ -81,29 +81,29 @@ namespace UIShell { if (!sourceModel()) { return {}; } - + int rowCount = sourceModel()->rowCount(parent); - + for (int row = 0; row < rowCount; ++row) { QModelIndex sourceIndex = sourceModel()->index(row, 0, parent); if (!sourceIndex.isValid()) { continue; } - + // Check if current item matches Core::ISettingPage *page = pageForIndex(sourceIndex); if (filterKeyword().isEmpty() || (page && page->matches(m_filterKeyword))) { // Map from source model index to proxy model index return mapFromSource(sourceIndex); } - + // Recursively search children (depth-first) QModelIndex childMatch = findFirstMatchRecursive(sourceIndex); if (childMatch.isValid()) { return childMatch; } } - + return {}; } diff --git a/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel_p.h b/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel_p.h index 89044ed2..5dc69f6d 100644 --- a/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel_p.h +++ b/src/libs/application/uishell/src/SettingCatalogSortFilterProxyModel_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_SETTINGCATALOGSORTFILTERPROXYMODEL_P_H #define UISHELL_SETTINGCATALOGSORTFILTERPROXYMODEL_P_H -#include #include +#include + namespace Core { class ISettingPage; } @@ -36,7 +37,7 @@ namespace UIShell { private: Core::ISettingPage *pageForIndex(const QModelIndex &index) const; QModelIndex findFirstMatchRecursive(const QModelIndex &parent) const; - + QString m_filterKeyword; }; diff --git a/src/libs/application/uishell/src/SettingPageWidgetDialog.cpp b/src/libs/application/uishell/src/SettingPageWidgetDialog.cpp index 73fe89dd..0f370614 100644 --- a/src/libs/application/uishell/src/SettingPageWidgetDialog.cpp +++ b/src/libs/application/uishell/src/SettingPageWidgetDialog.cpp @@ -30,5 +30,4 @@ namespace UIShell { emit widgetChanged(); } - } diff --git a/src/libs/application/uishell/src/SettingPageWidgetDialog_p.h b/src/libs/application/uishell/src/SettingPageWidgetDialog_p.h index 39be74be..5dbc51f3 100644 --- a/src/libs/application/uishell/src/SettingPageWidgetDialog_p.h +++ b/src/libs/application/uishell/src/SettingPageWidgetDialog_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_SETTINGPAGEWIDGETDIALOG_P_H #define UISHELL_SETTINGPAGEWIDGETDIALOG_P_H +#include + #include #include -#include namespace UIShell { @@ -28,7 +29,6 @@ namespace UIShell { private: QWidget *m_widget{}; - }; } diff --git a/src/libs/application/uishell/src/SubtreeProxyModel.cpp b/src/libs/application/uishell/src/SubtreeProxyModel.cpp index fb620c28..5de7782e 100644 --- a/src/libs/application/uishell/src/SubtreeProxyModel.cpp +++ b/src/libs/application/uishell/src/SubtreeProxyModel.cpp @@ -46,7 +46,7 @@ namespace UIShell { QList pathFromRoot; QModelIndex sourceParent = m_rootIndex; if (parent.isValid()) { - SubtreeProxyItemData *parentData = static_cast(parent.internalPointer()); + SubtreeProxyItemData *parentData = static_cast(parent.internalPointer()); if (parentData) { pathFromRoot = parentData->pathFromRoot; pathFromRoot.append(parent.row()); @@ -73,7 +73,7 @@ namespace UIShell { if (!sourceModel() || !child.isValid() || !m_rootIndex.isValid()) { return QModelIndex(); } - SubtreeProxyItemData *itemData = static_cast(child.internalPointer()); + SubtreeProxyItemData *itemData = static_cast(child.internalPointer()); if (!itemData || itemData->pathFromRoot.isEmpty()) { return QModelIndex(); } @@ -163,18 +163,12 @@ namespace UIShell { } QAbstractProxyModel::setSourceModel(sourceModel); if (sourceModel) { - connect(sourceModel, &QAbstractItemModel::dataChanged, - this, &SubtreeProxyModel::sourceDataChanged); - connect(sourceModel, &QAbstractItemModel::rowsAboutToBeInserted, - this, &SubtreeProxyModel::sourceRowsAboutToBeInserted); - connect(sourceModel, &QAbstractItemModel::rowsInserted, - this, &SubtreeProxyModel::sourceRowsInserted); - connect(sourceModel, &QAbstractItemModel::rowsAboutToBeRemoved, - this, &SubtreeProxyModel::sourceRowsAboutToBeRemoved); - connect(sourceModel, &QAbstractItemModel::rowsRemoved, - this, &SubtreeProxyModel::sourceRowsRemoved); - connect(sourceModel, &QAbstractItemModel::modelReset, - this, &SubtreeProxyModel::sourceModelReset); + connect(sourceModel, &QAbstractItemModel::dataChanged, this, &SubtreeProxyModel::sourceDataChanged); + connect(sourceModel, &QAbstractItemModel::rowsAboutToBeInserted, this, &SubtreeProxyModel::sourceRowsAboutToBeInserted); + connect(sourceModel, &QAbstractItemModel::rowsInserted, this, &SubtreeProxyModel::sourceRowsInserted); + connect(sourceModel, &QAbstractItemModel::rowsAboutToBeRemoved, this, &SubtreeProxyModel::sourceRowsAboutToBeRemoved); + connect(sourceModel, &QAbstractItemModel::rowsRemoved, this, &SubtreeProxyModel::sourceRowsRemoved); + connect(sourceModel, &QAbstractItemModel::modelReset, this, &SubtreeProxyModel::sourceModelReset); } beginResetModel(); endResetModel(); @@ -281,7 +275,7 @@ namespace UIShell { if (!proxyIndex.isValid() || !m_rootIndex.isValid()) { return QModelIndex(); } - SubtreeProxyItemData *itemData = static_cast(proxyIndex.internalPointer()); + SubtreeProxyItemData *itemData = static_cast(proxyIndex.internalPointer()); if (!itemData) { return QModelIndex(); } diff --git a/src/libs/application/uishell/src/UIShellGlobal.h b/src/libs/application/uishell/src/UIShellGlobal.h index bc6ad25c..f3c5ce6a 100644 --- a/src/libs/application/uishell/src/UIShellGlobal.h +++ b/src/libs/application/uishell/src/UIShellGlobal.h @@ -4,9 +4,9 @@ #include #if defined(UISHELL_LIBRARY) -# define UISHELL_EXPORT Q_DECL_EXPORT +# define UISHELL_EXPORT Q_DECL_EXPORT #else -# define UISHELL_EXPORT Q_DECL_IMPORT +# define UISHELL_EXPORT Q_DECL_IMPORT #endif #endif //DIFFSCOPE_UISHELL_UISHELLGLOBAL_H diff --git a/src/libs/application/uishell/src/USDef_p.h b/src/libs/application/uishell/src/USDef_p.h index b45829ad..2f8104c1 100644 --- a/src/libs/application/uishell/src/USDef_p.h +++ b/src/libs/application/uishell/src/USDef_p.h @@ -1,10 +1,11 @@ #ifndef UISHELL_USDEF_P_H #define UISHELL_USDEF_P_H -#include +#include #include -#include + +#include namespace UIShell { diff --git a/src/libs/application/uishell/src/WindowAgentForeign_p.h b/src/libs/application/uishell/src/WindowAgentForeign_p.h index 8cbf26e5..74d236da 100644 --- a/src/libs/application/uishell/src/WindowAgentForeign_p.h +++ b/src/libs/application/uishell/src/WindowAgentForeign_p.h @@ -1,9 +1,10 @@ #ifndef UISHELL_WINDOWAGENTFOREIGN_P_H #define UISHELL_WINDOWAGENTFOREIGN_P_H -#include #include +#include + #include namespace UIShell { diff --git a/src/plugins/achievement/internal/achievementplugin.cpp b/src/plugins/achievement/internal/achievementplugin.cpp index 3e225239..f5f54089 100644 --- a/src/plugins/achievement/internal/achievementplugin.cpp +++ b/src/plugins/achievement/internal/achievementplugin.cpp @@ -2,13 +2,13 @@ #include -#include - #include #include #include +#include + #include #include #include @@ -43,11 +43,11 @@ namespace Achievement { if (component.isError()) { qFatal() << component.errorString(); } - auto o = component.createWithInitialProperties({ - {"models", QVariant::fromValue(Core::RuntimeInterface::instance()->getObjects("org.diffscope.achievements"))}, - {"settings", QVariant::fromValue(Core::RuntimeInterface::settings())}, - {"settingCategory", "org.diffscope.achievements"} - }); + auto o = component.createWithInitialProperties( + {{"models", QVariant::fromValue(Core::RuntimeInterface::instance()->getObjects("org.diffscope.achievements"))}, + {"settings", QVariant::fromValue(Core::RuntimeInterface::settings())}, + {"settingCategory", "org.diffscope.achievements"}} + ); o->setParent(this); AchievementAddOn::setWindow(qobject_cast(o)); } diff --git a/src/plugins/achievement/internal/achievementplugin.h b/src/plugins/achievement/internal/achievementplugin.h index 547d9c83..3000574e 100644 --- a/src/plugins/achievement/internal/achievementplugin.h +++ b/src/plugins/achievement/internal/achievementplugin.h @@ -15,7 +15,6 @@ namespace Achievement { bool initialize(const QStringList &arguments, QString *errorMessage) override; void extensionsInitialized() override; bool delayedInitialize() override; - }; } diff --git a/src/plugins/achievement/internal/addons/achievementaddon.cpp b/src/plugins/achievement/internal/addons/achievementaddon.cpp index 43f98303..ab9028a7 100644 --- a/src/plugins/achievement/internal/addons/achievementaddon.cpp +++ b/src/plugins/achievement/internal/addons/achievementaddon.cpp @@ -27,9 +27,7 @@ namespace Achievement { if (component.isError()) { qFatal() << component.errorString(); } - auto o = component.createWithInitialProperties({ - {"addOn", QVariant::fromValue(this)} - }); + auto o = component.createWithInitialProperties({{"addOn", QVariant::fromValue(this)}}); o->setParent(this); QMetaObject::invokeMethod(o, "registerToContext", windowInterface->actionContext()); } diff --git a/src/plugins/achievement/internal/addons/achievementaddon.h b/src/plugins/achievement/internal/addons/achievementaddon.h index e3321507..67384762 100644 --- a/src/plugins/achievement/internal/addons/achievementaddon.h +++ b/src/plugins/achievement/internal/addons/achievementaddon.h @@ -1,11 +1,12 @@ #ifndef DIFFSCOPE_ACHIEVEMENT_ACHIEVEMENTADDON_H #define DIFFSCOPE_ACHIEVEMENT_ACHIEVEMENTADDON_H -#include #include #include +#include + namespace Achievement { class AchievementAddOn : public Core::WindowInterfaceAddOn { @@ -13,7 +14,7 @@ namespace Achievement { QML_ELEMENT QML_UNCREATABLE("") Q_PROPERTY(QQuickWindow *window READ window CONSTANT) - public: + public: explicit AchievementAddOn(QObject *parent = nullptr); ~AchievementAddOn() override; diff --git a/src/plugins/audio/internal/audioplugin.cpp b/src/plugins/audio/internal/audioplugin.cpp index 006030fd..ba18a118 100644 --- a/src/plugins/audio/internal/audioplugin.cpp +++ b/src/plugins/audio/internal/audioplugin.cpp @@ -1,10 +1,8 @@ #include "audioplugin.h" #include -#include #include - -#include +#include #include #include @@ -12,12 +10,14 @@ #include +#include + #include -#include