diff options
author | Arno <am@disconnect.de> | 2013-06-02 11:24:06 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-06-02 11:24:06 +0200 |
commit | 721fd40222440c6e8a81f4379f894d8908772a8a (patch) | |
tree | a7b54efd2ec9168efb4c7ae8e49851430b84a1b6 /archivemodel.h | |
parent | 459f58c57bfa1021783134b11853e8e4140055f3 (diff) | |
download | SheMov-721fd40222440c6e8a81f4379f894d8908772a8a.tar.gz SheMov-721fd40222440c6e8a81f4379f894d8908772a8a.tar.bz2 SheMov-721fd40222440c6e8a81f4379f894d8908772a8a.zip |
Implement Rename
Rename items: spits out an error message if the new item already exists.
Diffstat (limited to 'archivemodel.h')
-rw-r--r-- | archivemodel.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/archivemodel.h b/archivemodel.h index 0f2eea7..946bb3c 100644 --- a/archivemodel.h +++ b/archivemodel.h @@ -19,7 +19,7 @@ class ArchiveCollector; class ArchiveModel : 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, CountRole = Qt::UserRole + 8 }; + enum CustomRoles { NameRole = Qt::UserRole + 1, GenericIdRole = Qt::UserRole + 2, SeriesPartIdRole = Qt::UserRole + 3, SeriesPartRole = Qt::UserRole + 4, TypeRole = Qt::UserRole + 5, FavoriteRole = Qt::UserRole + 6, SubtitleRole = Qt::UserRole + 7, CountRole = Qt::UserRole + 8 }; enum Fields { Name = 0, GenericId = 1, SeriesPartId = 2, SeriesPart = 3, Type = 4, Favorite = 5, Subtitle = 6, Count = 7 }; enum Order { SeriesName, Actor, Genre, NoOrder }; enum { NumFields = 8 }; @@ -29,12 +29,18 @@ class ArchiveModel : public SmTreeModel { const QHash<QString, int> availableOrdersHash() const { return mAvailableOrders; } ArchiveCollector *collector() { return mCollector; } virtual QVariant data(const QModelIndex &index, int role) const; + virtual bool setData(const QModelIndex &idx, const QVariant &value, int role); QStringList indexToPath(const QModelIndex &idx) const; QModelIndexList pathToIndex(const QStringList &path) const; + signals: + void needRefresh(); + void databaseError(const QString &error); + public slots: void setOrder(int order); void setOrder(const QString &order); + void refresh(); private slots: void collectorFinished(); |