From 78d26758184cd23b0ea27ab714a9e1d1c3aeba9b Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 31 Oct 2010 13:41:52 +0100 Subject: First try on ConsistencyChecker Well, it works, so let's shit it :) Unfortunately the database is inconsistent, so add a checker for that. Still needs some work, though. Eg. display errors seperately and make it possible to delete stray files. Also the Filesystem check must be implemented. --- shemov.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index ac11916..da3986f 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -42,6 +42,7 @@ #include "newmoviewizard.h" #include "filestreewidget.h" #include "filestreemodel.h" +#include "consistencycheck.h" SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) { //application icon @@ -286,6 +287,8 @@ void SheMov::createActions(){ connect(cleanup2, SIGNAL(triggered()), mCleanupMapper, SLOT(map())); mCleanupMapper->setMapping(cleanup2, "genres"); mCleanupGroup->addAction(cleanup2); + mConsistencyA = new QAction(tr("Check consisteny..."), this); + connect(mConsistencyA, SIGNAL(triggered()), this, SLOT(checkConsistency())); mQuitA = new QAction(tr("Quit"), this); mQuitA->setShortcut(tr("CTRL+q")); @@ -422,6 +425,7 @@ void SheMov::createMenus(){ QMenu *cleanupMenu = new QMenu(tr("Clean database"), this); cleanupMenu->addActions(mCleanupGroup->actions()); fileMenu->addMenu(cleanupMenu); + fileMenu->addAction(mConsistencyA); fileMenu->addSeparator(); fileMenu->addAction(mQuitA); menuBar()->addMenu(fileMenu); @@ -627,3 +631,8 @@ void SheMov::readSettings(){ ; } } + +void SheMov::checkConsistency(){ + ConsistencyCheck c; + c.exec(); +} -- cgit v1.2.3-70-g09d2