summaryrefslogtreecommitdiffstats
path: root/archiveview.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-08-11 03:42:04 +0200
committerArno <am@disconnect.de>2013-08-11 03:42:04 +0200
commitfa226c66caf80f9f5041f9616d057309e8f958c0 (patch)
treedf6c66d76c69358f95c60bd1079896b07b658183 /archiveview.cpp
parent43fe74b668dd3927f01f2aad8c8c995d498007e1 (diff)
downloadSheMov-fa226c66caf80f9f5041f9616d057309e8f958c0.tar.gz
SheMov-fa226c66caf80f9f5041f9616d057309e8f958c0.tar.bz2
SheMov-fa226c66caf80f9f5041f9616d057309e8f958c0.zip
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.
Diffstat (limited to 'archiveview.cpp')
-rw-r--r--archiveview.cpp11
1 files changed, 11 insertions, 0 deletions
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);
}