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 436236f7 authored by Laurent Montel's avatar Laurent Montel 😁

USe new api

parent 07dde4fb
......@@ -76,7 +76,7 @@ find_package(KF5Prison ${KF5_VERSION} CONFIG REQUIRED)
set(MAILCOMMON_LIB_VERSION "5.7.40")
set(GRAVATAR_LIB_VERSION "5.7.40")
set(PIMCOMMON_LIB_VERSION "5.7.42")
set(PIMCOMMON_LIB_VERSION "5.7.43")
set(GRANTLEETHEME_LIB_VERSION "5.7.40")
set(CALENDARSUPPORT_LIB_VERSION "5.7.40")
set(EVENTVIEW_LIB_VERSION "5.7.40")
......
......@@ -19,12 +19,14 @@
#include "insertshorturlplugineditorinterface.h"
#include <KPIMTextEdit/RichTextEditor>
#include <PimCommon/NetworkManager>
#include <KLocalizedString>
#include <KActionCollection>
#include <QAction>
#include <KSharedConfig>
#include <KSharedConfig>
#include <KConfigGroup>
#include <QAction>
#include <QNetworkConfigurationManager>
#include "shorturlengineplugin/shorturlengineinterface.h"
#include "shorturlengineplugin/shorturlengineplugin.h"
#include "shorturlengineplugin/shorturlenginepluginmanager.h"
......@@ -91,20 +93,15 @@ void InsertShorturlPluginEditorInterface::exec()
QTextCursor textCursor = richTextEditor()->textCursor();
QString urlStr = textCursor.selectedText();
if (urlStr.startsWith(QLatin1String("http:")) || urlStr.startsWith(QLatin1String("https:"))) {
/*
if (!mCurrentEngine) {
return;
}
if (!PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline()) {
KMessageBox::information(this, i18n("No network connection detected, we cannot shorten URL."), i18n("No network"));
Q_EMIT message(i18n("No network connection detected, we cannot shorten URL."));
return;
}
if (mOriginalUrl->text().isEmpty()) {
return;
}
mIndicatorLabel->start();
mCurrentEngine->setShortUrl(mOriginalUrl->text());
mShortUrl->clear();
/*
mCurrentEngine->setShortUrl(urlStr);
mCurrentEngine->generateShortUrl();
*/
//textCursor.insertText(newText);
......@@ -113,12 +110,12 @@ void InsertShorturlPluginEditorInterface::exec()
}
void InsertShorturlPluginEditorInterface::slotShortUrlDone(const QString &url)
{
//Insert new url
//mIndicatorLabel->stop();
}
void InsertShorturlPluginEditorInterface::slotShortUrlFailed(const QString &errMsg)
{
//KMessageBox::error(this, i18n("An error occurred: \"%1\"", errMsg));
//mIndicatorLabel->stop();
Q_EMIT message(i18n("An error occurred: \"%1\"", errMsg));
}
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