Commit 9340c244 authored by Arnav Rawat's avatar Arnav Rawat

The comic applet previously attempted to use the url associated with the

icon. However, the dataengine does not return a url. Changed the method
headers and method calls to use QIcon instead.
parent d204d692
......@@ -28,14 +28,14 @@ QHash<int, QByteArray> ActiveComicModel::roleNames() const
return roleNames;
}
void ActiveComicModel::addComic(const QString &key, const QString &title, const QString &iconPath, bool highlight)
void ActiveComicModel::addComic(const QString& key, const QString& title, const QIcon& icon, bool highlight)
{
QList<QStandardItem *> newRow;
QStandardItem *item = new QStandardItem(title);
item->setData(key, ComicKeyRole);
item->setData(title, ComicTitleRole);
item->setData(iconPath, ComicIconRole);
item->setData(icon, ComicIconRole);
item->setData(highlight, ComicHighlightRole);
newRow << item;
......
......@@ -26,7 +26,7 @@ public:
QHash<int, QByteArray> roleNames() const override;
void addComic(const QString &key, const QString &title, const QString &iconPath, bool highlight = true);
void addComic(const QString &key, const QString &title, const QIcon &icon, bool highlight = true);
int count() { return rowCount(QModelIndex()); }
......
......@@ -277,13 +277,13 @@ void ComicApplet::updateUsedComics()
const QString name = data.data().toString();
const QString identifier = data.data( Qt::UserRole ).toString();
const QString iconPath = data.data( Qt::DecorationRole ).value<QIcon>().name();
const QIcon icon = data.data( Qt::DecorationRole ).value<QIcon>();
//found a newer strip last time, which was not visited
if (mCheckNewComicStripsInterval && !cg.readEntry(QLatin1String("lastStripVisited_") + identifier, true)) {
mActiveComicModel->addComic(identifier, name, iconPath, true);
mActiveComicModel->addComic(identifier, name, icon, true);
} else {
mActiveComicModel->addComic(identifier, name, iconPath);
mActiveComicModel->addComic(identifier, name, icon);
}
++tab;
......
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