1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
5 SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8*/
9
10#include "itemjob.h"
11
12using namespace Attica;
13
14template<class T>
15ItemJob<T>::ItemJob(PlatformDependent *internals, const QNetworkRequest &request)
16 : GetJob(internals, request)
17{
18}
19
20template<class T>
21void ItemJob<T>::parse(const QString &xml)
22{
23 typename T::Parser p;
24 m_item = p.parse(xml);
25 setMetadata(p.metadata());
26}
27
28template<class T>
29T ItemJob<T>::result() const
30{
31 return m_item;
32}
33
34template<class T>
35ItemDeleteJob<T>::ItemDeleteJob(PlatformDependent *internals, const QNetworkRequest &request)
36 : DeleteJob(internals, request)
37{
38}
39
40template<class T>
41void ItemDeleteJob<T>::parse(const QString &xml)
42{
43 typename T::Parser p;
44 m_item = p.parse(xml);
45 setMetadata(p.metadata());
46}
47
48template<class T>
49T ItemDeleteJob<T>::result() const
50{
51 return m_item;
52}
53
54template<class T>
55ItemPostJob<T>::ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data)
56 : PostJob(internals, request, data)
57{
58}
59
60template<class T>
61ItemPostJob<T>::ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap &parameters)
62 : PostJob(internals, request, parameters)
63{
64}
65
66template<class T>
67void ItemPostJob<T>::parse(const QString &xml)
68{
69 typename T::Parser p;
70 m_item = p.parse(xml);
71 setMetadata(p.metadata());
72}
73
74template<class T>
75T ItemPostJob<T>::result() const
76{
77 return m_item;
78}
79
80template<class T>
81ItemPutJob<T>::ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data)
82 : PutJob(internals, request, data)
83{
84}
85
86template<class T>
87ItemPutJob<T>::ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap &parameters)
88 : PutJob(internals, request, parameters)
89{
90}
91
92template<class T>
93void ItemPutJob<T>::parse(const QString &xml)
94{
95 typename T::Parser p;
96 m_item = p.parse(xml);
97 setMetadata(p.metadata());
98}
99
100template<class T>
101T ItemPutJob<T>::result() const
102{
103 return m_item;
104}
105

source code of attica/src/itemjob.cpp