diff options
author | Arno <am@disconnect.de> | 2011-05-14 10:32:19 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2011-05-14 10:32:19 +0200 |
commit | a6a1c319ee5a77cc8341eaeccc72da35cbcf17c5 (patch) | |
tree | 83c6cf2403b0eda9c60959d273eaf31599e7099f /seriestreemodel.h | |
parent | 189dbc38b5a4495553303a705e54eb1c95bc8e52 (diff) | |
download | SheMov-a6a1c319ee5a77cc8341eaeccc72da35cbcf17c5.tar.gz SheMov-a6a1c319ee5a77cc8341eaeccc72da35cbcf17c5.tar.bz2 SheMov-a6a1c319ee5a77cc8341eaeccc72da35cbcf17c5.zip |
Add field isLocal to SeriesTreeModel
Indicate if SeriesPart has local files in SeriesTreeModel. The
cost for this is an additional Query when populating the model,
but fortunately the performance impact isn't noticeable.
Also introduced a new enum NumFields to SeriesTreeModel. It
represents the number of fields for a SmTreeItem so extending
the model isn't that cumbersome any more.
Diffstat (limited to 'seriestreemodel.h')
-rw-r--r-- | seriestreemodel.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/seriestreemodel.h b/seriestreemodel.h index 8488cd7..348ff2c 100644 --- a/seriestreemodel.h +++ b/seriestreemodel.h @@ -20,10 +20,11 @@ class QSqlQuery; class SeriesTreeModel : public SmTreeModel { Q_OBJECT public: - enum CustomRoles { NameRole = Qt::UserRole + 1, SeriesIdRole = Qt::UserRole + 2, SeriesPartIdRole = Qt::UserRole + 3, SeriesPartRole = Qt::UserRole + 4, TypeRole = Qt::UserRole + 5, FavoriteRole = Qt::UserRole + 6, SubtitleRole = Qt::UserRole + 7 }; - enum Fields { Name = 0, SeriesId = 1, SeriesPartId = 2, SeriesPart = 3, Type = 4, Favorite = 5, Subtitle = 6 }; + enum CustomRoles { NameRole = Qt::UserRole + 1, SeriesIdRole = Qt::UserRole + 2, SeriesPartIdRole = Qt::UserRole + 3, SeriesPartRole = Qt::UserRole + 4, TypeRole = Qt::UserRole + 5, FavoriteRole = Qt::UserRole + 6, SubtitleRole = Qt::UserRole + 7, IsLocalRole = Qt::UserRole + 8 }; + enum Fields { Name = 0, SeriesId = 1, SeriesPartId = 2, SeriesPart = 3, Type = 4, Favorite = 5, Subtitle = 6, IsLocal = 7 }; enum Types { Series, Part, NewSeries }; enum QueryType { NumericQuery, TextQuery }; + enum { NumFields = 8 }; explicit SeriesTreeModel(QStringList &headers, QObject *parent = 0); ~SeriesTreeModel(); @@ -38,6 +39,7 @@ class SeriesTreeModel : public SmTreeModel { QFileInfoList findFiles(const QModelIndex &where) const; QFileInfoList findMovies(const QModelIndexList &from) const; QFileInfoList findSortedMovies(const QModelIndex &from) const; + bool hasLocals(int sPartId) const; int seriesIdByPartId(int partId); int findNextDvdNo() const; @@ -86,6 +88,7 @@ class SeriesTreeModel : public SmTreeModel { QSqlQuery *mGenreFilterQuery; QSqlQuery *mFavoriteSeriesIdQuery; QSqlQuery *mFavoriteSeriesPartsQuery; + QSqlQuery *mIsLocalQuery; QHash<int, int> mSeriesPartSeriesMap; QHash<int, QString> mUpdateGenericMap; QColor mFavoriteColor; |