Commit 64f3219f authored by Laurent Montel's avatar Laurent Montel 😁

Add message in statusbar when it's not a shorten url

parent 344751bf
......@@ -6,7 +6,7 @@ set(messageviewer_expandurlplugin_SRCS
add_library(messageviewer_expandurlplugin MODULE ${messageviewer_expandurlplugin_SRCS})
target_link_libraries(messageviewer_expandurlplugin
KF5::MessageViewer KF5::XmlGui
KF5::MessageViewer KF5::XmlGui KF5::Libkdepim
)
install(TARGETS messageviewer_expandurlplugin DESTINATION ${PLUGIN_INSTALL_DIR}/messageviewer)
......
......@@ -24,6 +24,7 @@
#include <QIcon>
#include <QAction>
#include <BroadcastStatus>
#include <KActionCollection>
#include <KLocalizedString>
......@@ -46,14 +47,14 @@ QAction *ViewerPluginExpandurlInterface::action() const
return mAction;
}
void ViewerPluginExpandurlInterface::showWidget()
void ViewerPluginExpandurlInterface::execute()
{
if (mCurrentUrl.isValid()) {
if (MessageViewer::ScamCheckShortUrlManager::self()->scamCheckShortUrl()->isShortUrl(mCurrentUrl)) {
MessageViewer::ScamExpandUrlJob *job = new MessageViewer::ScamExpandUrlJob(this);
job->expandedUrl(mCurrentUrl);
} else {
//TODO message in statusbar.
KPIM::BroadcastStatus ::instance()->setStatusMsg(i18n("Current Url is not a shorten url."));
}
}
}
......
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