File indexing completed on 2024-03-24 15:23:50

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2009 Eckhart Wörner <ewoerner@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "listjob.h"
0010 
0011 #include <QXmlStreamReader>
0012 #include <attica_debug.h>
0013 
0014 using namespace Attica;
0015 
0016 template<class T>
0017 ListJob<T>::ListJob(PlatformDependent *internals, const QNetworkRequest &request)
0018     : GetJob(internals, request)
0019 {
0020     qCDebug(ATTICA) << "creating list job:" << request.url();
0021 }
0022 
0023 template<class T>
0024 typename T::List ListJob<T>::itemList() const
0025 {
0026     return m_itemList;
0027 }
0028 
0029 template<class T>
0030 void ListJob<T>::parse(const QString &xml)
0031 {
0032     typename T::Parser parser;
0033     m_itemList = parser.parseList(xml);
0034     setMetadata(parser.metadata());
0035     qCDebug(ATTICA) << "received categories:" << m_itemList.size();
0036 }