Made ContentManagerModel::createNode() non-static

This commit is contained in:
Veloman Yunkan 2023-12-13 15:44:11 +04:00
parent a7f0309e7d
commit d38ec6bfa3
2 changed files with 3 additions and 3 deletions

View File

@ -124,7 +124,7 @@ QString convertToUnits(QString size)
return preciseBytes + " " + units[unitIndex]; return preciseBytes + " " + units[unitIndex];
} }
std::shared_ptr<RowNode> ContentManagerModel::createNode(QMap<QString, QVariant> bookItem, QMap<QString, QByteArray> iconMap, std::shared_ptr<RowNode> rootNode) std::shared_ptr<RowNode> ContentManagerModel::createNode(QMap<QString, QVariant> bookItem, QMap<QString, QByteArray> iconMap) const
{ {
auto faviconUrl = "https://" + bookItem["faviconUrl"].toString(); auto faviconUrl = "https://" + bookItem["faviconUrl"].toString();
QString id = bookItem["id"].toString(); QString id = bookItem["id"].toString();
@ -158,7 +158,7 @@ void ContentManagerModel::setupNodes()
{ {
beginResetModel(); beginResetModel();
for (auto bookItem : m_data) { for (auto bookItem : m_data) {
rootNode->appendChild(createNode(bookItem, iconMap, rootNode)); rootNode->appendChild(createNode(bookItem, iconMap));
} }
endResetModel(); endResetModel();
} }

View File

@ -35,7 +35,7 @@ public:
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
void refreshIcons(); void refreshIcons();
static std::shared_ptr<RowNode> createNode(QMap<QString, QVariant> bookItem, QMap<QString, QByteArray> iconMap, std::shared_ptr<RowNode> rootNode); std::shared_ptr<RowNode> createNode(QMap<QString, QVariant> bookItem, QMap<QString, QByteArray> iconMap) const;
public slots: public slots:
void updateImage(QModelIndex index, QString url, QByteArray imageData); void updateImage(QModelIndex index, QString url, QByteArray imageData);