merged master

This commit is contained in:
Luis Ángel San Martín
2016-03-25 17:15:14 +01:00
30 changed files with 641 additions and 125 deletions

View File

@ -11,7 +11,7 @@ ComicDB::ComicDB()
}
bool ComicDB::isDir()
bool ComicDB::isDir() const
{
return false;
}

View File

@ -124,7 +124,7 @@ class ComicDB : public LibraryItem
public:
ComicDB();
bool isDir();
bool isDir() const;
bool _hasCover;

View File

@ -0,0 +1,27 @@
#include "folder.h"
Folder::Folder()
:knownParent(false),
knownId(false),
numChildren(-1)
{}
Folder::Folder(qulonglong folderId, qulonglong parentId, const QString &folderName, const QString &folderPath)
:knownParent(true),
knownId(true),
numChildren(-1)
{
this->id = folderId;
this->parentId = parentId;
this->name = folderName;
this->path = folderPath;
}
Folder::Folder(const QString & folderName, const QString & folderPath)
:knownParent(false),
knownId(false),
numChildren(-1)
{
this->name = folderName;
this->path = folderPath;
}

View File

@ -11,20 +11,85 @@ public:
bool knownParent;
bool knownId;
Folder():knownParent(false), knownId(false){};
Folder(qulonglong sid, qulonglong pid,QString fn, QString fp):knownParent(true), knownId(true){id = sid; parentId = pid;name = fn; path = fp;};
Folder(QString fn, QString fp):knownParent(false), knownId(false){name = fn; path = fp;};
void setId(qulonglong sid){id = sid;knownId = true;};
void setFather(qulonglong pid){parentId = pid;knownParent = true;};
bool isDir() {return true;};
bool isFinished() const {return finished;};
bool isCompleted() const {return completed;};
void setFinished(bool b) {finished = b;};
void setCompleted(bool b) {completed = b;};
Folder();
Folder(qulonglong folderId, qulonglong parentId,const QString & folderName, const QString & folderPath);
Folder(const QString & folderName, const QString & folderPath);
inline void setId(qulonglong sid)
{
id = sid;
knownId = true;
}
inline void setFather(qulonglong pid)
{
parentId = pid;
knownParent = true;
}
inline bool isDir() const
{
return true;
}
inline bool isFinished() const
{
return finished;
}
inline bool isCompleted() const
{
return completed;
}
inline void setFinished(bool b)
{
finished = b;
}
inline void setCompleted(bool b)
{
completed = b;
}
inline qint32 getNumChildren() const
{
return numChildren;
}
inline void setNumChildren(const qint32 v)
{
numChildren = v;
}
inline QString getFirstChildHash() const
{
return firstChildHash;
}
inline void setFirstChildHash(const QString & v)
{
firstChildHash = v;
}
inline QString getCustomImage() const
{
return customImage;
}
inline void setCustomImage(const QString & s)
{
customImage = s;
}
private:
bool finished;
bool completed;
qint32 numChildren; //-1 for unknown number of children
QString firstChildHash; //empty for unknown first child
QString customImage; //empty for none custom image
};
#endif

View File

@ -6,11 +6,11 @@
class LibraryItem
{
public:
virtual bool isDir() = 0;
virtual bool isDir() const = 0;
QString name;
QString path;
qulonglong parentId;
qulonglong id;
};
#endif
#endif