File indexing completed on 2024-07-14 14:25:37

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2010 Intel Corporation
0005     SPDX-FileContributor: Mateu Batle Sastre <mbatle@collabora.co.uk>
0006 
0007     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0008 */
0009 
0010 #include "homepagetypeparser.h"
0011 
0012 using namespace Attica;
0013 
0014 QStringList HomePageType::Parser::xmlElement() const
0015 {
0016     return QStringList(QStringLiteral("homepagetype"));
0017 }
0018 
0019 HomePageType HomePageType::Parser::parseXml(QXmlStreamReader &xml)
0020 {
0021     HomePageType item;
0022 
0023     while (!xml.atEnd()) {
0024         xml.readNext();
0025         if (xml.isStartElement()) {
0026             if (xml.name() == QLatin1String("id")) {
0027                 item.setId(xml.readElementText().toInt());
0028             } else if (xml.name() == QLatin1String("name")) {
0029                 item.setName(xml.readElementText());
0030             }
0031         }
0032         if (xml.isEndElement() && xml.name() == QLatin1String("homepagetype")) {
0033             break;
0034         }
0035     }
0036     return item;
0037 }