From fa226c66caf80f9f5041f9616d057309e8f958c0 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 11 Aug 2013 03:42:04 +0200 Subject: Implement Favorites Re-Implement mark as Favorites in new ArchiveView. Also, don't block when the Collector is running again and we're trying to update the view. --- archiveview.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'archiveview.cpp') diff --git a/archiveview.cpp b/archiveview.cpp index 27aacc9..295ddae 100644 --- a/archiveview.cpp +++ b/archiveview.cpp @@ -371,6 +371,17 @@ void ArchiveTree::editSeriesPart(){ } } +void ArchiveTree::markAsFavorite(){ + QModelIndex idx = firstSelected(); + if(!idx.isValid()){ + return; + } + int pId = idx.data(ArchiveModel::SeriesPartIdRole).toInt(); + bool fav = idx.data(ArchiveModel::FavoriteRole).toBool(); + ArchiveController *c = SmGlobals::instance()->archiveController(); + c->archiveTreeModel()->setFavorite(pId, !fav); +} + void ArchiveTree::impossible(const QString msg){ QMessageBox::critical(this, tr("Error"), msg); } -- cgit v1.2.3-70-g09d2