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

Expand url

parent 26f830c6
......@@ -16,6 +16,7 @@
*/
#include "viewerpluginexpandurlinterface.h"
#include <MessageViewer/ScamExpandUrlJob>
#include <QHBoxLayout>
#include <QIcon>
......@@ -45,7 +46,10 @@ QAction *ViewerPluginExpandurlInterface::action() const
void ViewerPluginExpandurlInterface::showWidget()
{
//TODO expand url
if (mCurrentUrl.isValid()) {
MessageViewer::ScamExpandUrlJob *job = new MessageViewer::ScamExpandUrlJob(this);
job->expandedUrl(mCurrentUrl);
}
}
ViewerPluginInterface::SpecificFeatureTypes ViewerPluginExpandurlInterface::featureTypes() const
......@@ -62,3 +66,8 @@ void ViewerPluginExpandurlInterface::createAction(KActionCollection *ac)
connect(mAction, &QAction::triggered, this, &ViewerPluginExpandurlInterface::slotActivatePlugin);
}
}
void ViewerPluginExpandurlInterface::setUrl(const QUrl &url)
{
mCurrentUrl = url;
}
......@@ -19,6 +19,7 @@
#define VIEWERPLUGINEXPANDURLINTERFACE_H
#include <messageviewer/viewerplugininterface.h>
#include <QUrl>
class KActionCollection;
namespace MessageViewer
{
......@@ -33,8 +34,10 @@ public:
void showWidget() Q_DECL_OVERRIDE;
ViewerPluginInterface::SpecificFeatureTypes featureTypes() const Q_DECL_OVERRIDE;
void setUrl(const QUrl &url) Q_DECL_OVERRIDE;
private:
void createAction(KActionCollection *ac);
QUrl mCurrentUrl;
QAction *mAction;
};
}
......
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