From 2f65da6869eacde492e8091118ec145dca9adc28 Mon Sep 17 00:00:00 2001 From: APTX Date: Wed, 10 Apr 2013 02:42:31 +0200 Subject: [PATCH] Remove itemData field from MyListNode. Increase batch size --- localmylist/mylistnode.cpp | 25 +++++++++++++++++-------- localmylist/mylistnode.h | 3 +-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/localmylist/mylistnode.cpp b/localmylist/mylistnode.cpp index 7ba876f..d2d4322 100644 --- a/localmylist/mylistnode.cpp +++ b/localmylist/mylistnode.cpp @@ -19,11 +19,6 @@ MyListNode::MyListNode(MyListModel *model_, NodeType type, int totalRowCount, My query = new SqlAsyncQuery; query->setCallback([this](){ fetchComplete();}); - - if (m_type != RootNode) - return; - - itemData << "Title" << "Episode / Version" << "Rating / Quality" << "Vote" << "Watched / Renamed"; } MyListNode::~MyListNode() @@ -57,10 +52,24 @@ int MyListNode::columnCount() const QVariant MyListNode::data(int column, int role) const { - if (role == Qt::DisplayRole) - return itemData.value(column); - else + if (role != Qt::DisplayRole) return QVariant(); + + switch (column) + { + case 0: + return QObject::tr("Title"); + case 1: + return QObject::tr("Episode / Version"); + case 2: + return QObject::tr("Rating / Quality"); + case 3: + return QObject::tr("Vote"); + case 4: + return QObject::tr("Watched / Renamed"); + } + + return QVariant(); } MyListNode *MyListNode::parent() diff --git a/localmylist/mylistnode.h b/localmylist/mylistnode.h index 153805a..ecb12f1 100644 --- a/localmylist/mylistnode.h +++ b/localmylist/mylistnode.h @@ -79,14 +79,13 @@ protected: QList childItems; QList newItems; - QList itemData; MyListNode *parentItem; MyListModel *model; SqlAsyncQuery *query; bool m_working; - static const int LIMIT = 200; + static const int LIMIT = 500; }; class LOCALMYLISTSHARED_EXPORT MyListAnimeNode : public MyListNode -- 2.52.0