From b0d671fede5adfadad2b465fb4c8ae50b40516f3 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 10 Apr 2014 16:14:32 +0200 Subject: Implement Drag and Drop in Movie Archive Well, this was actually a bit of a drag. You have read the docs very carefully to get it right. For one, don't construct the drag object in mousePressEvent if you also want a double click, otherwise you end up with very weird behavior. Same goes for the receiving end. Differentiate between dragEnterEvent and dragMoveEvent, otherwise you'll only be able to drop items if you hit the right row on entering. There are some artefacts during the drag, but I guess that's a Qt bug. Didn't bother to look into it. --- archivecontroller.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'archivecontroller.cpp') diff --git a/archivecontroller.cpp b/archivecontroller.cpp index a7d0501..5638119 100644 --- a/archivecontroller.cpp +++ b/archivecontroller.cpp @@ -232,6 +232,13 @@ void ArchiveController::readConfig(){ mGenreIcon = SmGlobals::instance()->iconFor("genre"); } +void ArchiveController::moveFilesToSeriespart(const QStringList &md5Sums, int newSeriesPart){ + foreach(QString md5, md5Sums){ + mArchiveFilesModel->updateSeriesPartForFile(md5, newSeriesPart); + } + mArchiveFilesModel->refresh(); +} + void ArchiveController::treeSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected){ Q_UNUSED(selected); Q_UNUSED(deselected); -- cgit v1.2.3-70-g09d2