summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-10-07 06:46:36 +0200
committerMontel Laurent <[email protected]>2015-10-07 06:46:36 +0200
commit7f2d24222029fbcdc9837809106b01c0b30cecd6 (patch)
treea58832c7b1a300628e6834dde85984701fe62d47
parenta80e4868555f5b417e39877c0ad08d1acbf91082 (diff)
Remove unused files
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.cpp58
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.h52
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.cpp80
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.h40
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.cpp55
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.h39
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.cpp55
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.h40
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.cpp55
-rw-r--r--pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.h41
10 files changed, 0 insertions, 515 deletions
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.cpp b/pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.cpp
deleted file mode 100644
index 730d33e..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#include "shorturl/abstractshorturl.h"
-
-#include <KLocalizedString>
-using namespace PimCommon;
-AbstractShortUrl::AbstractShortUrl(QObject *parent)
- : QObject(parent),
- mErrorFound(false),
- mNetworkAccessManager(new QNetworkAccessManager(this))
-{
- connect(mNetworkAccessManager, &QNetworkAccessManager::finished, this, &AbstractShortUrl::slotShortUrlFinished);
-}
-
-AbstractShortUrl::~AbstractShortUrl()
-{
-
-}
-
-void AbstractShortUrl::shortUrl(const QString &url)
-{
- mErrorFound = false;
- if (!url.trimmed().startsWith(QStringLiteral("http://")) &&
- !url.trimmed().startsWith(QStringLiteral("https://")) &&
- !url.trimmed().startsWith(QStringLiteral("ftp://")) &&
- !url.trimmed().startsWith(QStringLiteral("ftps://"))) {
- mOriginalUrl = QLatin1String("http://") + url;
- } else {
- mOriginalUrl = url;
- }
-}
-
-void AbstractShortUrl::slotErrorFound(QNetworkReply::NetworkError error)
-{
- mErrorFound = true;
- QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
- Q_EMIT shortUrlFailed(i18n("Error reported by server:\n\'%1\'", (reply ? reply->errorString() : QString::number(error))));
-}
-
-void AbstractShortUrl::slotShortUrlFinished(QNetworkReply */*reply*/)
-{
-}
-
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.h b/pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.h
deleted file mode 100644
index bc1150b..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/abstractshorturl.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef ABSTRACTSHORTURL_H
-#define ABSTRACTSHORTURL_H
-
-#include <QObject>
-#include <QNetworkReply>
-
-namespace PimCommon
-{
-class AbstractShortUrl : public QObject
-{
- Q_OBJECT
-public:
- explicit AbstractShortUrl(QObject *parent = Q_NULLPTR);
- ~AbstractShortUrl();
-
- virtual QString shortUrlName() const = 0;
- virtual void shortUrl(const QString &url);
- virtual void start() = 0;
-
-Q_SIGNALS:
- void shortUrlDone(const QString &url);
- void shortUrlFailed(const QString &error);
-
-protected Q_SLOTS:
- void slotErrorFound(QNetworkReply::NetworkError error);
- virtual void slotShortUrlFinished(QNetworkReply *reply);
-
-protected:
- QString mOriginalUrl;
- bool mErrorFound;
- QNetworkAccessManager *mNetworkAccessManager;
-};
-}
-
-#endif // ABSTRACTSHORTURL_H
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.cpp b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.cpp
deleted file mode 100644
index 1b6eeb3..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (c) 2014-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#include "isgdshorturl.h"
-
-#include <QJsonDocument>
-#include <QNetworkRequest>
-#include <QUrl>
-#include <qregexp.h>
-
-using namespace PimCommon;
-IsGdShortUrl::IsGdShortUrl(QObject *parent)
- : PimCommon::AbstractShortUrl(parent)
-{
- connect(mNetworkAccessManager, &QNetworkAccessManager::sslErrors, this, &IsGdShortUrl::slotSslErrors);
-}
-
-IsGdShortUrl::~IsGdShortUrl()
-{
-
-}
-
-void IsGdShortUrl::start()
-{
- const QString requestUrl = QStringLiteral("http://is.gd/create.php?%1&url=%2").arg(QStringLiteral("format=json")).arg(mOriginalUrl);
- QNetworkRequest request = QNetworkRequest(QUrl(requestUrl));
-
- request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/json"));
- QNetworkReply *reply = mNetworkAccessManager->get(request);
- connect(reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), this, &IsGdShortUrl::slotErrorFound);
-}
-
-QString IsGdShortUrl::shortUrlName() const
-{
- return QStringLiteral("Is.gd");
-}
-
-void IsGdShortUrl::slotSslErrors(QNetworkReply *reply, const QList<QSslError> &error)
-{
- reply->ignoreSslErrors(error);
-}
-
-void IsGdShortUrl::slotShortUrlFinished(QNetworkReply *reply)
-{
- if (mErrorFound) {
- return;
- }
-
- const QByteArray data = reply->readAll();
- QJsonParseError error;
- const QJsonDocument json = QJsonDocument::fromJson(data, &error);
- //qCDebug(PIMCOMMON_LOG) << "void IsGdShortUrl::slotShortUrlFinished(QNetworkReply *reply) " << data;
-
- reply->deleteLater();
-
- if (error.error != QJsonParseError::NoError || json.isNull()) {
- //qCDebug(PIMCOMMON_LOG) << " Error during parsing" << error.errorString();
- Q_EMIT shortUrlFailed(error.errorString());
- return;
- }
- const QMap<QString, QVariant> map = json.toVariant().toMap();
-
- if (map.contains(QStringLiteral("shorturl"))) {
- Q_EMIT shortUrlDone(map.value(QStringLiteral("shorturl")).toString());
- }
-}
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.h b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.h
deleted file mode 100644
index e7d2844..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/isgdshorturl.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright (c) 2014-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef IsGdShortUrl_H
-#define IsGdShortUrl_H
-#include "shorturl/abstractshorturl.h"
-
-namespace PimCommon
-{
-class IsGdShortUrl : public PimCommon::AbstractShortUrl
-{
- Q_OBJECT
-public:
- explicit IsGdShortUrl(QObject *parent = Q_NULLPTR);
- ~IsGdShortUrl();
-
- void start() Q_DECL_OVERRIDE;
- QString shortUrlName() const Q_DECL_OVERRIDE;
-
-private Q_SLOTS:
- void slotShortUrlFinished(QNetworkReply *reply) Q_DECL_OVERRIDE;
- void slotSslErrors(QNetworkReply *, const QList<QSslError> &error);
-};
-}
-
-#endif // IsGdShortUrl_H
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.cpp b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.cpp
deleted file mode 100644
index 7bbe838..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#include "migremeshorturl.h"
-
-#include <QNetworkRequest>
-
-using namespace PimCommon;
-
-MigremeShortUrl::MigremeShortUrl(QObject *parent)
- : PimCommon::AbstractShortUrl(parent)
-{
-}
-
-MigremeShortUrl::~MigremeShortUrl()
-{
-}
-
-QString MigremeShortUrl::shortUrlName() const
-{
- return QStringLiteral("migre.me");
-}
-
-void MigremeShortUrl::start()
-{
- const QString requestUrl = QStringLiteral("http://migre.me/api.txt?url=%1").arg(mOriginalUrl);
- QNetworkReply *reply = mNetworkAccessManager->get(QNetworkRequest(QUrl(requestUrl)));
- connect(reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), this, &MigremeShortUrl::slotErrorFound);
-}
-
-void MigremeShortUrl::slotShortUrlFinished(QNetworkReply *reply)
-{
- if (!mErrorFound) {
- const QString data = QString::fromUtf8(reply->readAll());
- if (!data.isEmpty()) {
- Q_EMIT shortUrlDone(data);
- }
- }
- reply->deleteLater();
-}
-
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.h b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.h
deleted file mode 100644
index 2e7aded..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/migremeshorturl.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef MIGREMESHORTURL_H
-#define MIGREMESHORTURL_H
-#include "shorturl/abstractshorturl.h"
-
-namespace PimCommon
-{
-class MigremeShortUrl : public PimCommon::AbstractShortUrl
-{
- Q_OBJECT
-public:
- explicit MigremeShortUrl(QObject *parent = Q_NULLPTR);
- ~MigremeShortUrl();
-
- void start() Q_DECL_OVERRIDE;
-
- QString shortUrlName() const Q_DECL_OVERRIDE;
-private Q_SLOTS:
- void slotShortUrlFinished(QNetworkReply *reply) Q_DECL_OVERRIDE;
-};
-}
-
-#endif // MIGREMESHORTURL_H
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.cpp b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.cpp
deleted file mode 100644
index 7f0f789..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#include "tinyurlshorturl.h"
-
-#include <QNetworkRequest>
-
-using namespace PimCommon;
-
-TinyurlShortUrl::TinyurlShortUrl(QObject *parent)
- : PimCommon::AbstractShortUrl(parent)
-{
-}
-
-TinyurlShortUrl::~TinyurlShortUrl()
-{
-}
-
-QString TinyurlShortUrl::shortUrlName() const
-{
- return QStringLiteral("TinyURL.com");
-}
-
-void TinyurlShortUrl::start()
-{
- const QString requestUrl = QStringLiteral("http://tinyurl.com/api-create.php?url=%1").arg(mOriginalUrl);
- QNetworkReply *reply = mNetworkAccessManager->get(QNetworkRequest(QUrl(requestUrl)));
- connect(reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), this, &TinyurlShortUrl::slotErrorFound);
-}
-
-void TinyurlShortUrl::slotShortUrlFinished(QNetworkReply *reply)
-{
- if (!mErrorFound) {
- const QString data = QString::fromUtf8(reply->readAll());
- if (!data.isEmpty()) {
- Q_EMIT shortUrlDone(data);
- }
- }
- reply->deleteLater();
-}
-
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.h b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.h
deleted file mode 100644
index b1ab6b0..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/tinyurlshorturl.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef TINYURLSHORTURL_H
-#define TINYURLSHORTURL_H
-#include "shorturl/abstractshorturl.h"
-
-namespace PimCommon
-{
-class TinyurlShortUrl : public PimCommon::AbstractShortUrl
-{
- Q_OBJECT
-public:
- explicit TinyurlShortUrl(QObject *parent = Q_NULLPTR);
- ~TinyurlShortUrl();
-
- void start() Q_DECL_OVERRIDE;
-
- QString shortUrlName() const Q_DECL_OVERRIDE;
-
-private Q_SLOTS:
- void slotShortUrlFinished(QNetworkReply *reply) Q_DECL_OVERRIDE;
-};
-}
-
-#endif // TINYURLSHORTURL_H
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.cpp b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.cpp
deleted file mode 100644
index a795ac7..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#include "triopabshorturl.h"
-
-#include <QNetworkRequest>
-
-using namespace PimCommon;
-
-TriopabShortUrl::TriopabShortUrl(QObject *parent)
- : PimCommon::AbstractShortUrl(parent)
-{
-}
-
-TriopabShortUrl::~TriopabShortUrl()
-{
-}
-
-void TriopabShortUrl::start()
-{
- const QString requestUrl = QStringLiteral("http://to.ly/api.php?longurl=%1").arg(mOriginalUrl);
- QNetworkReply *reply = mNetworkAccessManager->get(QNetworkRequest(QUrl(requestUrl)));
- connect(reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), this, &TriopabShortUrl::slotErrorFound);
-}
-
-QString TriopabShortUrl::shortUrlName() const
-{
- return QStringLiteral("to.ly");
-}
-
-void TriopabShortUrl::slotShortUrlFinished(QNetworkReply *reply)
-{
- if (!mErrorFound) {
- const QString data = QString::fromUtf8(reply->readAll());
- if (!data.isEmpty()) {
- Q_EMIT shortUrlDone(data);
- }
- }
- reply->deleteLater();
-}
-
diff --git a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.h b/pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.h
deleted file mode 100644
index 6dfa82b..0000000
--- a/pimcommon/src/customtools/shorturlplugin/shorturl/engine/triopabshorturl.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Copyright (c) 2013-2015 Montel Laurent <[email protected]>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License, version 2, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef TRIOPABSHORTURL_H
-#define TRIOPABSHORTURL_H
-
-#include "shorturl/abstractshorturl.h"
-
-namespace PimCommon
-{
-class TriopabShortUrl : public PimCommon::AbstractShortUrl
-{
- Q_OBJECT
-public:
- explicit TriopabShortUrl(QObject *parent = Q_NULLPTR);
- ~TriopabShortUrl();
-
- void start() Q_DECL_OVERRIDE;
-
- QString shortUrlName() const Q_DECL_OVERRIDE;
-private Q_SLOTS:
- void slotShortUrlFinished(QNetworkReply *reply) Q_DECL_OVERRIDE;
-
-};
-}
-
-#endif // TRIOPABSHORTURL_H