| 1 | /* |
| 2 | This file is part of KDE. |
| 3 | |
| 4 | SPDX-FileCopyrightText: 2009 Eckhart Wörner <ewoerner@kde.org> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #include "listjob.h" |
| 10 | |
| 11 | #include <QXmlStreamReader> |
| 12 | #include <attica_debug.h> |
| 13 | |
| 14 | using namespace Attica; |
| 15 | |
| 16 | template<class T> |
| 17 | ListJob<T>::ListJob(PlatformDependent *internals, const QNetworkRequest &request) |
| 18 | : GetJob(internals, request) |
| 19 | { |
| 20 | qCDebug(ATTICA) << "creating list job:" << request.url(); |
| 21 | } |
| 22 | |
| 23 | template<class T> |
| 24 | typename T::List ListJob<T>::itemList() const |
| 25 | { |
| 26 | return m_itemList; |
| 27 | } |
| 28 | |
| 29 | template<class T> |
| 30 | void ListJob<T>::parse(const QString &xml) |
| 31 | { |
| 32 | typename T::Parser parser; |
| 33 | m_itemList = parser.parseList(xml); |
| 34 | setMetadata(parser.metadata()); |
| 35 | qCDebug(ATTICA) << "received categories:" << m_itemList.size(); |
| 36 | } |
| 37 | |