summaryrefslogtreecommitdiffstats
path: root/mappingtablemodel.h
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-07-31 11:05:59 +0200
committerArno <am@disconnect.de>2010-07-31 11:05:59 +0200
commit6d3b28f9b12964b161b5a7ac0038435cfdd6e27b (patch)
tree59d49ee1ab59b53bb762135d70759350f4b44159 /mappingtablemodel.h
parent066cc53c2506fb7f7cb7b3b0d888243df611cacd (diff)
downloadSheMov-6d3b28f9b12964b161b5a7ac0038435cfdd6e27b.tar.gz
SheMov-6d3b28f9b12964b161b5a7ac0038435cfdd6e27b.tar.bz2
SheMov-6d3b28f9b12964b161b5a7ac0038435cfdd6e27b.zip
Added database maintenance code
Implemented a function in MappingTableModel to remove all actors/genres with no references in the according mapping table. Available through the "File" menu.
Diffstat (limited to 'mappingtablemodel.h')
-rw-r--r--mappingtablemodel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/mappingtablemodel.h b/mappingtablemodel.h
index ae64600..9d00f72 100644
--- a/mappingtablemodel.h
+++ b/mappingtablemodel.h
@@ -41,6 +41,10 @@ class MappingTableModel : public SmTreeModel{
bool removeMapping(int seriesId, int itemId);
QList<QVariant> mappings(int seriesId);
+ //database maintenance
+ QHash<QString, int> zeroUsers();
+ void deleteItems(const QList<int> &ids);
+
signals:
void needResort();
@@ -61,6 +65,8 @@ class MappingTableModel : public SmTreeModel{
QSqlQuery *mAddMappingQuery;
QSqlQuery *mRemoveMappingQuery;
QSqlQuery *mMappingQuery;
+ QSqlQuery *mAllItemsQuery;
+ QSqlQuery *mItemCountQuery;
};
#endif // MAPPINGTABLEMODEL_H