Commit 9a670a6b authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from last API deprecated since Qt5.0

parent 93a65424
......@@ -20,13 +20,6 @@
ActiveComicModel::ActiveComicModel(QObject *parent)
: QStandardItemModel(0, 1, parent)
{
QHash<int, QByteArray> newRoleNames = roleNames();
newRoleNames[ComicKeyRole] = "key";
newRoleNames[ComicTitleRole] = "title";
newRoleNames[ComicIconRole] = "icon";
newRoleNames[ComicHighlightRole] = "highlight";
setRoleNames(newRoleNames);
connect(this, &ActiveComicModel::modelReset,
this, &ActiveComicModel::countChanged);
connect(this, &ActiveComicModel::rowsInserted,
......@@ -35,6 +28,17 @@ ActiveComicModel::ActiveComicModel(QObject *parent)
this, &ActiveComicModel::countChanged);
}
QHash<int, QByteArray> ActiveComicModel::roleNames() const
{
auto roleNames = QStandardItemModel::roleNames();
roleNames.insert(ComicKeyRole, "key");
roleNames.insert(ComicTitleRole, "title");
roleNames.insert(ComicIconRole, "icon");
roleNames.insert(ComicHighlightRole, "highlight");
return roleNames;
}
void ActiveComicModel::addComic(const QString &key, const QString &title, const QString &iconPath, bool highlight)
{
QList<QStandardItem *> newRow;
......
......@@ -36,6 +36,8 @@ public:
ActiveComicModel(QObject *parent = 0);
QHash<int, QByteArray> roleNames() const override;
void addComic(const QString &key, const QString &title, const QString &iconPath, bool highlight = true);
int count() { return rowCount(QModelIndex()); }
......
......@@ -161,6 +161,7 @@ ComicApplet::~ComicApplet()
}
}
delete mSavingDir;
delete m_newStuffDialog;
}
void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::Data &data )
......
......@@ -211,7 +211,7 @@ Q_SIGNALS:
QSizeF mLastSize;
QSizeF mIdealSize;
Plasma::DataEngine *mEngine;
QWeakPointer<KNS3::DownloadDialog> m_newStuffDialog;
QPointer<KNS3::DownloadDialog> m_newStuffDialog;
//Tabs
bool mTabAdded;
......
......@@ -24,6 +24,7 @@
#include <QtCore/QRegExp>
#include <QtGui/QImage>
#include <QXmlStreamReader>
#include <QUrlQuery>
#include <QDebug>
#include <kio/job.h>
......@@ -41,11 +42,13 @@ class FlickrProvider::Private
QUrl buildUrl(const QDate &date) {
QUrl url(QLatin1String( "https://api.flickr.com/services/rest/"));
url.addQueryItem("api_key", FLICKR_API_KEY);
url.addQueryItem("method", "flickr.interestingness.getList");
url.addQueryItem("date", date.toString( Qt::ISODate ) );
QUrlQuery urlQuery(url);
urlQuery.addQueryItem("api_key", FLICKR_API_KEY);
urlQuery.addQueryItem("method", "flickr.interestingness.getList");
urlQuery.addQueryItem("date", date.toString( Qt::ISODate ) );
// url_o might be either too small or too large.
url.addQueryItem("extras", "url_k,url_h,url_o");
urlQuery.addQueryItem("extras", "url_k,url_h,url_o");
url.setQuery(urlQuery);
return url;
}
......
Supports Markdown
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