Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make plugin registration be compatible with Qt Creator 16 #80

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions qodeassist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@

#include "ConfigurationManager.hpp"
#include "QodeAssistClient.hpp"
#include "Version.hpp"
#include "chat/ChatOutputPane.h"
#include "chat/NavigationPanel.hpp"
#include "settings/GeneralSettings.hpp"
#include "settings/ProjectSettingsPanel.hpp"
#include "settings/SettingsConstants.hpp"

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

void initialize() final
{
#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(15, 0, 83)
Core::IOptionsPage::registerCategory(
Constants::QODE_ASSIST_GENERAL_OPTIONS_CATEGORY,
Constants::QODE_ASSIST_GENERAL_OPTIONS_DISPLAY_CATEGORY,
":/resources/images/qoderassist-icon.png");
#endif

Providers::registerProviders();
Templates::registerTemplates();

Expand Down
3 changes: 3 additions & 0 deletions settings/GeneralSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "SettingsTr.hpp"
#include "SettingsUtils.hpp"
#include "UpdateDialog.hpp"
#include "../Version.hpp"

namespace QodeAssist::Settings {

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