Skip to content

Commit cad224e

Browse files
committed
fix: Make plugin registration be compatible with Qt Creator 16
This introduces changes needed after the following commit in Qt Creator: qt-creator/qt-creator@ba5e4b7 Core: Provide settings categories centrally
1 parent d8a0150 commit cad224e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

qodeassist.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@
4343

4444
#include "ConfigurationManager.hpp"
4545
#include "QodeAssistClient.hpp"
46+
#include "Version.hpp"
4647
#include "chat/ChatOutputPane.h"
4748
#include "chat/NavigationPanel.hpp"
4849
#include "settings/GeneralSettings.hpp"
4950
#include "settings/ProjectSettingsPanel.hpp"
51+
#include "settings/SettingsConstants.hpp"
5052

5153
#include "UpdateStatusWidget.hpp"
5254
#include "providers/Providers.hpp"
@@ -77,6 +79,13 @@ class QodeAssistPlugin final : public ExtensionSystem::IPlugin
7779

7880
void initialize() final
7981
{
82+
#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(15, 0, 83)
83+
Core::IOptionsPage::registerCategory(
84+
Constants::QODE_ASSIST_GENERAL_OPTIONS_CATEGORY,
85+
Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY,
86+
":/resources/images/qoderassist-icon.png");
87+
#endif
88+
8089
Providers::registerProviders();
8190
Templates::registerTemplates();
8291

settings/GeneralSettings.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "SettingsTr.hpp"
4040
#include "SettingsUtils.hpp"
4141
#include "UpdateDialog.hpp"
42+
#include "../Version.hpp"
4243

4344
namespace QodeAssist::Settings {
4445

@@ -444,8 +445,10 @@ class GeneralSettingsPage : public Core::IOptionsPage
444445
setId(Constants::QODE_ASSIST_GENERAL_SETTINGS_PAGE_ID);
445446
setDisplayName(TrConstants::GENERAL);
446447
setCategory(Constants::QODE_ASSIST_GENERAL_OPTIONS_CATEGORY);
448+
#if QODEASSIST_QT_CREATOR_VERSION < QT_VERSION_CHECK(15, 0, 83)
447449
setDisplayCategory(Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY);
448450
setCategoryIconPath(":/resources/images/qoderassist-icon.png");
451+
#endif
449452
setSettingsProvider([] { return &generalSettings(); });
450453
}
451454
};

0 commit comments

Comments
 (0)