diff --git a/YACReaderLibrary/db/folder_item.cpp b/YACReaderLibrary/db/folder_item.cpp index 9444d3fd..3628e2f8 100644 --- a/YACReaderLibrary/db/folder_item.cpp +++ b/YACReaderLibrary/db/folder_item.cpp @@ -65,6 +65,17 @@ void FolderItem::setData(int column, const QVariant &value) itemData[column] = value; } +void FolderItem::addChild(FolderItem *child, int childIndex) +{ + child->parentItem = this; + childItems.insert(childIndex, child); +} + +void FolderItem::removeChild(FolderItem *child) +{ + childItems.removeOne(child); +} + void FolderItem::removeChild(int childIndex) { childItems.removeAt(childIndex); @@ -86,6 +97,11 @@ FolderItem *FolderItem::parent() return parentItem; } +void FolderItem::setData(const QList &data) +{ + itemData = data; +} + int FolderItem::row() const { if (parentItem) diff --git a/YACReaderLibrary/db/folder_item.h b/YACReaderLibrary/db/folder_item.h index 2cc4bd45..ef77c4d9 100644 --- a/YACReaderLibrary/db/folder_item.h +++ b/YACReaderLibrary/db/folder_item.h @@ -64,7 +64,10 @@ public: unsigned long long int id; QList comicNames; FolderItem *originalItem; + void setData(const QList &data); void setData(int column, const QVariant &value); + void addChild(FolderItem *child, int childIndex); + void removeChild(FolderItem *child); void removeChild(int childIndex); void clearChildren(); QList children();