Syndication Library
feed.cpp
00001 /* 00002 * This file is part of the syndication library 00003 * 00004 * Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00023 #include "feed.h" 00024 #include "category.h" 00025 #include "image.h" 00026 #include "item.h" 00027 #include "person.h" 00028 00029 #include <QtCore/QList> 00030 #include <QtCore/QString> 00031 00032 namespace Syndication { 00033 00034 Feed::~Feed() 00035 { 00036 } 00037 00038 QString Feed::debugInfo() const 00039 { 00040 QString info; 00041 00042 info += QLatin1String("# Feed begin ######################\n"); 00043 00044 QString dtitle = title(); 00045 if (!dtitle.isNull()) 00046 info += QLatin1String("title: #") + dtitle + QLatin1String("#\n"); 00047 00048 QString dlink = link(); 00049 if (!dlink.isNull()) 00050 info += QLatin1String("link: #") + dlink + QLatin1String("#\n"); 00051 00052 QString ddescription = description(); 00053 if (!ddescription.isNull()) 00054 info += QLatin1String("description: #") + ddescription + QLatin1String("#\n"); 00055 00056 QString dcopyright = copyright(); 00057 if (!dcopyright.isNull()) 00058 info += QLatin1String("copyright: #") + dcopyright + QLatin1String("#\n"); 00059 00060 QString dlanguage = language(); 00061 if (!dlanguage.isNull()) 00062 info += QLatin1String("language: #") + dlanguage + QLatin1String("#\n"); 00063 00064 QList<PersonPtr> dauthors = authors(); 00065 QList<PersonPtr>::ConstIterator itp = dauthors.constBegin(); 00066 QList<PersonPtr>::ConstIterator endp = dauthors.constEnd(); 00067 00068 for ( ; itp != endp; ++itp) 00069 info += (*itp)->debugInfo(); 00070 00071 QList<CategoryPtr> dcategories = categories(); 00072 QList<CategoryPtr>::ConstIterator itc = dcategories.constBegin(); 00073 QList<CategoryPtr>::ConstIterator endc = dcategories.constEnd(); 00074 00075 for ( ; itc != endc; ++itc) 00076 info += (*itc)->debugInfo(); 00077 00078 ImagePtr dimage = image(); 00079 00080 if (!dimage->isNull()) 00081 info += dimage->debugInfo(); 00082 00083 QList<ItemPtr> ditems = items(); 00084 QList<ItemPtr>::ConstIterator it = ditems.constBegin(); 00085 QList<ItemPtr>::ConstIterator end = ditems.constEnd(); 00086 00087 for ( ; it != end; ++it) 00088 info += (*it)->debugInfo(); 00089 00090 info += QLatin1String("# Feed end ########################\n"); 00091 00092 return info; 00093 } 00094 00095 } // namespace Syndication
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:08:47 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:08:47 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.