diff options
author | Arno <am@disconnect.de> | 2013-07-27 11:31:08 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-07-27 11:31:08 +0200 |
commit | 5cfaa2c755c52c2ccbdd88ea3239dafb120a179b (patch) | |
tree | ba0386df4e1ed60bb0d5be3090bba1a6622437cc /filestreemodel.h | |
parent | fa4f4952b11b94ffa899e40c4f22070280a4a399 (diff) | |
download | SheMov-5cfaa2c755c52c2ccbdd88ea3239dafb120a179b.tar.gz SheMov-5cfaa2c755c52c2ccbdd88ea3239dafb120a179b.tar.bz2 SheMov-5cfaa2c755c52c2ccbdd88ea3239dafb120a179b.zip |
Get rid of old archive
Yeah, finally it's gone! Lot's of useless, unneeded code vanished :)
Diffstat (limited to 'filestreemodel.h')
-rw-r--r-- | filestreemodel.h | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/filestreemodel.h b/filestreemodel.h deleted file mode 100644 index 3b7924b..0000000 --- a/filestreemodel.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. -*/ - -#ifndef FILESTREEMODEL_H -#define FILESTREEMODEL_H - -#include <QSqlDatabase> -#include <QList> -#include <QHash> -#include <QMap> -#include <QColor> -#include <QIcon> - -#include "smtreemodel.h" - -class QSqlQuery; -class SeriesTreeModel; - -class FilesTreeModel : public SmTreeModel { - Q_OBJECT - public: - enum CustomRoles { FileNameRole = Qt::UserRole + 1, FullPathRole = Qt::UserRole + 2, SizeRole = Qt::UserRole + 3, DvdNoRole = Qt::UserRole + 4, SizeDisplayRole = Qt::UserRole + 5, FileTypeRole = Qt::UserRole + 6, Md5SumRole = Qt::UserRole + 7, PartNoRole = Qt::UserRole + 8, SeriesPartIdRole = Qt::UserRole + 9, QualityRole = Qt::UserRole + 10, FilesIdRole = Qt::UserRole + 11, SeriesPartRole = Qt::UserRole + 12, DisplayNameRole = Qt::UserRole + 13, SizeDurationRole = Qt::UserRole + 14, SeriesNameRole = Qt::UserRole + 15, FavoriteRole = Qt::UserRole + 16 }; - enum FileTypes { Movie = 1, FrontCover = 2, BackCover = 3, GeneralCover = 4 }; - enum Fields { FileName = 0, PartNo = 1, SizeDisplay = 2, Quality = 3, DvdNo = 4, FullPath = 5, Size = 6, FileType = 7, Md5Sum = 8, SeriesPartId = 9, FilesId = 10, SeriesPart = 11, DisplayName = 12, SizeDuration = 13, SeriesName = 14, Favorite = 15 }; - enum Mode { Ids, Burn }; - explicit FilesTreeModel(QStringList &headers, QObject *parent = 0); - const QHash<int, QString> fileTypes() const { return mFileTypes; } - const QHash<int, QString> coverTypes() const { return mCoverTypes; } - const QHash<QString, int> editableColumns() const { return mEditableColumns; } - int mode() const { return mMode; } - void setMode(int mode) { mMode = mode; } - int displayMode() const { return mDisplayMode; } - void setDisplayMode(int mode) { mDisplayMode = mode; } - - //data + flags - void setIds(const QList<int> &seriesPartIds); - void setForBurn(); - QVariant data(const QModelIndex &index, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); - Qt::ItemFlags flags(const QModelIndex &index) const; - QHash<QString, QString> filesBySeriesPartId(int seriesPartId) const; - QList<QMap<QString, QString> > streamInfo(const QModelIndex &idx) const; - QList<QMap<QString, QString> > streamInfo(const QString &path) const; - QMap<QString, QString> pictureInfo(const QString &path) const; - QMap<QString, QString> pictureInfo(const QModelIndex &idx) const; - QMap<QString, QString> pictureMetaInfo(const QModelIndex &idx); - int fileType(const QString &md5sum) const; - QModelIndex fileSizeLessThan(quint64 size) const; - - //file manipulation - bool addFile(const QString &fullPath, int type, int quality, int filePart, int seriesPartId, int dvd = -1); - bool deleteFile(const QModelIndex &file); - bool deleteFiles(const QList<QPersistentModelIndex> &files); - bool updateSeries(int newSeries, QList<QPersistentModelIndex> files); - - //misc - void readCache(); - void writeCache(); - - public slots: - void readSettings(); - void refresh(); - - private: - //functions - void populate(QSqlQuery &filesQuery); - - //database - QSqlDatabase mDb; - QSqlQuery *mUpdateDvdQuery; - QSqlQuery *mUpdateQualityQuery; - QSqlQuery *mUpdatePartNoQuery; - QSqlQuery *mUpdateFileTypeQuery; - QSqlQuery *mInsertFileQuery; - QSqlQuery *mFilesQuery; - QSqlQuery *mDeleteFileQuery; - QSqlQuery *mFileTypeQuery; - QSqlQuery *mUpdateSeriesPartQuery; - - //misc - QHash<int, QString> mFileTypes; - QHash<int, QString> mCoverTypes; - QHash<QString, QString> mPicsDurationCache; - QHash<QString, int> mEditableColumns; - SeriesTreeModel *mSeriesModel; - int mMode; - const int mMagic; - QColor mLocalColor; - QColor mArchivedColor; - QColor mFavoriteColor; - qint64 mDvdSize; - QList<int> mCurrentIds; - int mDisplayMode; -}; - -#endif // FILESTREEMODEL_H |