Commit e3385d3c authored by Laurent Montel's avatar Laurent Montel 😁

Fix api

parent 1d03b9b0
...@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) ...@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory) include(ECMQtDeclareLoggingCategory)
include(ECMAddTests) include(ECMAddTests)
set(MESSAGELIB_LIB_VERSION "5.1.80") set(MESSAGELIB_LIB_VERSION "5.1.81")
set(KF5_VERSION "5.19.0") set(KF5_VERSION "5.19.0")
set(KDEPIMLIBS_LIB_VERSION "5.1.42") set(KDEPIMLIBS_LIB_VERSION "5.1.42")
......
...@@ -2391,7 +2391,7 @@ void ViewerPrivate::slotActivatePlugin(ViewerPluginInterface *interface) ...@@ -2391,7 +2391,7 @@ void ViewerPrivate::slotActivatePlugin(ViewerPluginInterface *interface)
if (!text.isEmpty()) { if (!text.isEmpty()) {
interface->setText(text); interface->setText(text);
} }
interface->showWidget(); interface->execute();
} }
void ViewerPrivate::slotAttachmentSaveAs() void ViewerPrivate::slotAttachmentSaveAs()
......
...@@ -88,7 +88,7 @@ ViewerPluginTest::~ViewerPluginTest() ...@@ -88,7 +88,7 @@ ViewerPluginTest::~ViewerPluginTest()
void ViewerPluginTest::slotActivatePlugin(MessageViewer::ViewerPluginInterface *interface) void ViewerPluginTest::slotActivatePlugin(MessageViewer::ViewerPluginInterface *interface)
{ {
interface->showWidget(); interface->execute();
} }
int main(int argc, char **argv) int main(int argc, char **argv)
......
...@@ -40,6 +40,11 @@ ViewerPluginInterface::~ViewerPluginInterface() ...@@ -40,6 +40,11 @@ ViewerPluginInterface::~ViewerPluginInterface()
delete d; delete d;
} }
void ViewerPluginInterface::execute()
{
showWidget();
}
void ViewerPluginInterface::setText(const QString &text) void ViewerPluginInterface::setText(const QString &text)
{ {
Q_UNUSED(text); Q_UNUSED(text);
...@@ -75,6 +80,11 @@ void ViewerPluginInterface::closePlugin() ...@@ -75,6 +80,11 @@ void ViewerPluginInterface::closePlugin()
// Reimplement in subclass // Reimplement in subclass
} }
void ViewerPluginInterface::showWidget()
{
// Reimplement in subclass
}
void ViewerPluginInterface::updateAction(const Akonadi::Item &item) void ViewerPluginInterface::updateAction(const Akonadi::Item &item)
{ {
Q_UNUSED(item); Q_UNUSED(item);
......
...@@ -43,17 +43,19 @@ public: ...@@ -43,17 +43,19 @@ public:
Q_FLAGS(SpecificFeatureTypes) Q_FLAGS(SpecificFeatureTypes)
Q_DECLARE_FLAGS(SpecificFeatureTypes, SpecificFeatureType) Q_DECLARE_FLAGS(SpecificFeatureTypes, SpecificFeatureType)
virtual void execute();
virtual void setText(const QString &text); virtual void setText(const QString &text);
virtual QAction *action() const; virtual QAction *action() const;
virtual void setUrl(const QUrl &url); virtual void setUrl(const QUrl &url);
virtual void setMessage(const KMime::Message::Ptr &value); virtual void setMessage(const KMime::Message::Ptr &value);
virtual void setMessageItem(const Akonadi::Item &item); virtual void setMessageItem(const Akonadi::Item &item);
virtual void closePlugin(); virtual void closePlugin();
virtual void showWidget() = 0;
virtual ViewerPluginInterface::SpecificFeatureTypes featureTypes() const = 0; virtual ViewerPluginInterface::SpecificFeatureTypes featureTypes() const = 0;
virtual void updateAction(const Akonadi::Item &item); virtual void updateAction(const Akonadi::Item &item);
protected: protected:
virtual void showWidget();
void addHelpTextAction(QAction *act, const QString &text); void addHelpTextAction(QAction *act, const QString &text);
protected Q_SLOTS: protected Q_SLOTS:
......
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