Skip to content

Commit

Permalink
Chore - Remove feature flag for addon and the addon state abstraction (
Browse files Browse the repository at this point in the history
…#9315)

* Remove addon feature flag

* Remove addon state abstraction -- its never been used

* Remove the last reference to the addon feature
  • Loading branch information
brizental authored Apr 3, 2024
1 parent 8360943 commit e15800a
Show file tree
Hide file tree
Showing 17 changed files with 2 additions and 882 deletions.
3 changes: 0 additions & 3 deletions src/addons/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "qmlengineholder.h"
#include "settings/settingsmanager.h"
#include "settingsholder.h"
#include "state/addonsessionstate.h"
#include "versionutils.h"

namespace {
Expand Down Expand Up @@ -400,8 +399,6 @@ Addon* Addon::create(QObject* parent, const QString& manifestFileName) {
return nullptr;
}

addon->m_state = new AddonState(addon, obj["state"].toObject());

QJsonObject javascript = obj["javascript"].toObject();
if (!addon->evaluateJavascript(javascript)) {
addon->deleteLater();
Expand Down
10 changes: 1 addition & 9 deletions src/addons/addon.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
#define ADDON_H

#include <QJSValue>
#include <QMap>
#include <QObject>
#include <QTranslator>

#include "state/addonstate.h"

class AddonConditionWatcher;
class QJsonObject;

Expand All @@ -28,7 +27,6 @@ class Addon : public QObject {
Q_PROPERTY(QString id READ id CONSTANT)
Q_PROPERTY(QString name MEMBER m_name CONSTANT)
Q_PROPERTY(QString type READ type CONSTANT)
Q_PROPERTY(AddonState* state READ state CONSTANT)

public:
enum Status {
Expand Down Expand Up @@ -59,10 +57,6 @@ class Addon : public QObject {
const QString& id() const { return m_id; }
const QString& type() const { return m_type; }
const QString& manifestFileName() const { return m_manifestFileName; }
AddonState* state() const {
Q_ASSERT(m_state);
return m_state;
}

virtual void retranslate();

Expand Down Expand Up @@ -105,8 +99,6 @@ class Addon : public QObject {
QList<QTranslator*> m_translators;
QMap<QString, double> m_translationCompleteness;

AddonState* m_state = nullptr;

AddonApi* m_api = nullptr;
AddonConditionWatcher* m_conditionWatcher = nullptr;

Expand Down
10 changes: 0 additions & 10 deletions src/addons/manager/addonmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ AddonManager::AddonManager(QObject* parent)
AddonManager::~AddonManager() { MZ_COUNT_DTOR(AddonManager); }

void AddonManager::initialize() {
if (!Feature::get(Feature::Feature_addon)->isSupported()) {
logger.warning() << "Addons disabled by feature flag";
return;
}

// Load on disk addons, doing this will initialize the addons directory
QList<AddonData> addons;
if (m_addonIndex.getOnDiskAddonsList(&addons)) {
Expand Down Expand Up @@ -197,11 +192,6 @@ bool AddonManager::loadManifest(const QString& manifestFileName) {
}

void AddonManager::unload(const QString& addonId) {
if (!Feature::get(Feature::Feature_addon)->isSupported()) {
logger.warning() << "Addons disabled by feature flag";
return;
}

if (!m_addons.contains(addonId)) {
logger.warning() << "No addon with id" << addonId;
return;
Expand Down
31 changes: 0 additions & 31 deletions src/addons/state/addonsessionstate.cpp

This file was deleted.

48 changes: 0 additions & 48 deletions src/addons/state/addonsessionstate.h

This file was deleted.

50 changes: 0 additions & 50 deletions src/addons/state/addonstate.h

This file was deleted.

121 changes: 0 additions & 121 deletions src/addons/state/addonstatebase.cpp

This file was deleted.

Loading

0 comments on commit e15800a

Please sign in to comment.