Skip to content

Commit 1c4679d

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 68cba52 commit 1c4679d

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

@@ -434,8 +435,10 @@ class GeneralSettingsPage : public Core::IOptionsPage
434435
setId(Constants::QODE_ASSIST_GENERAL_SETTINGS_PAGE_ID);
435436
setDisplayName(TrConstants::GENERAL);
436437
setCategory(Constants::QODE_ASSIST_GENERAL_OPTIONS_CATEGORY);
438+
#if QODEASSIST_QT_CREATOR_VERSION < QT_VERSION_CHECK(15, 0, 83)
437439
setDisplayCategory(Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY);
438440
setCategoryIconPath(":/resources/images/qoderassist-icon.png");
441+
#endif
439442
setSettingsProvider([] { return &generalSettings(); });
440443
}
441444
};

0 commit comments

Comments
 (0)