Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4bf6308f authored by Laurent Montel's avatar Laurent Montel 😁

Reload engine when we change config

parent 09dc8e69
......@@ -38,6 +38,7 @@ InsertShorturlPluginEditor::~InsertShorturlPluginEditor()
MessageComposer::PluginEditorInterface *InsertShorturlPluginEditor::createInterface(KActionCollection *ac, QObject *parent)
{
InsertShorturlPluginEditorInterface *interface = new InsertShorturlPluginEditorInterface(parent);
connect(this, &InsertShorturlPluginEditor::configChanged, interface, &InsertShorturlPluginEditorInterface::loadEngine);
interface->createAction(ac);
return interface;
}
......@@ -55,7 +56,9 @@ bool InsertShorturlPluginEditor::hasConfigureDialog() const
void InsertShorturlPluginEditor::showConfigureDialog(QWidget *parent)
{
QPointer<InsertShorturlConfigureDialog> dlg = new InsertShorturlConfigureDialog(parent);
dlg->exec();
if (dlg->exec()) {
Q_EMIT configChanged();
}
delete dlg;
}
......
......@@ -37,6 +37,8 @@ public:
bool hasPopupMenuSupport() const override;
bool hasConfigureDialog() const override;
void showConfigureDialog(QWidget *parent = nullptr) override;
Q_SIGNALS:
void configChanged();
};
#endif
......@@ -36,6 +36,7 @@ InsertShorturlPluginEditorInterface::InsertShorturlPluginEditorInterface(QObject
{
setNeedSelectedText(true);
initializePlugins();
loadEngine();
}
InsertShorturlPluginEditorInterface::~InsertShorturlPluginEditorInterface()
......
......@@ -34,10 +34,10 @@ public:
void createAction(KActionCollection *ac) override;
void exec() override;
void loadEngine();
private:
void initializePlugins();
void slotActivated();
void loadEngine();
void slotShortUrlDone(const QString &url);
void slotShortUrlFailed(const QString &errMsg);
QHash<QString, ShortUrlEngineInterface *> mLstInterface;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment