File indexing completed on 2024-10-06 12:15:12
0001 /* 0002 This file is part of KDE. 0003 0004 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org> 0005 SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us> 0006 0007 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0008 */ 0009 0010 #include "itemjob.h" 0011 0012 using namespace Attica; 0013 0014 template<class T> 0015 ItemJob<T>::ItemJob(PlatformDependent *internals, const QNetworkRequest &request) 0016 : GetJob(internals, request) 0017 { 0018 } 0019 0020 template<class T> 0021 void ItemJob<T>::parse(const QString &xml) 0022 { 0023 typename T::Parser p; 0024 m_item = p.parse(xml); 0025 setMetadata(p.metadata()); 0026 } 0027 0028 template<class T> 0029 T ItemJob<T>::result() const 0030 { 0031 return m_item; 0032 } 0033 0034 template<class T> 0035 ItemDeleteJob<T>::ItemDeleteJob(PlatformDependent *internals, const QNetworkRequest &request) 0036 : DeleteJob(internals, request) 0037 { 0038 } 0039 0040 template<class T> 0041 void ItemDeleteJob<T>::parse(const QString &xml) 0042 { 0043 typename T::Parser p; 0044 m_item = p.parse(xml); 0045 setMetadata(p.metadata()); 0046 } 0047 0048 template<class T> 0049 T ItemDeleteJob<T>::result() const 0050 { 0051 return m_item; 0052 } 0053 0054 template<class T> 0055 ItemPostJob<T>::ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data) 0056 : PostJob(internals, request, data) 0057 { 0058 } 0059 0060 template<class T> 0061 ItemPostJob<T>::ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters) 0062 : PostJob(internals, request, parameters) 0063 { 0064 } 0065 0066 template<class T> 0067 void ItemPostJob<T>::parse(const QString &xml) 0068 { 0069 typename T::Parser p; 0070 m_item = p.parse(xml); 0071 setMetadata(p.metadata()); 0072 } 0073 0074 template<class T> 0075 T ItemPostJob<T>::result() const 0076 { 0077 return m_item; 0078 } 0079 0080 template<class T> 0081 ItemPutJob<T>::ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data) 0082 : PutJob(internals, request, data) 0083 { 0084 } 0085 0086 template<class T> 0087 ItemPutJob<T>::ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters) 0088 : PutJob(internals, request, parameters) 0089 { 0090 } 0091 0092 template<class T> 0093 void ItemPutJob<T>::parse(const QString &xml) 0094 { 0095 typename T::Parser p; 0096 m_item = p.parse(xml); 0097 setMetadata(p.metadata()); 0098 } 0099 0100 template<class T> 0101 T ItemPutJob<T>::result() const 0102 { 0103 return m_item; 0104 }