[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/pim/krss/resources/libkrssresource
From:       Dmitry Ivanov <vonami () gmail ! com>
Date:       2009-03-15 20:27:46
Message-ID: 1237148866.299417.19053.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 939838 by divanov:

Process the additional properties too


 M  +13 -2     util.cpp  


--- trunk/playground/pim/krss/resources/libkrssresource/util.cpp #939837:939838
@@ -29,6 +29,11 @@
 #include <QtCore/QString>
 #include <QtCore/QByteArray>
 
+#include <KDE/KDebug>
+#include <QtCore/QMultiMap>
+#include <QtCore/QMapIterator>
+#include <QtXml/QDomElement>
+
 namespace
 {
 // from akregator/src/utils.cpp
@@ -112,8 +117,14 @@
     }
     rssItem.setCategories( categories );
 
-    // TODO: attributes
-    //kDebug() << "Debug info:" << syndItem->debugInfo();
+    // Additional properties
+    // it's a multi map but we store only the most recently inserted value
+    const QMultiMap<QString, QDomElement> syndProperties = syndItem->additionalProperties();
+    QMapIterator<QString, QDomElement> it( syndProperties );
+    while ( it.hasNext() ) {
+        it.next();
+        rssItem.setCustomProperty( it.key(), it.value().text() );
+    }
 
     rssItem.setHash( calcHash( syndItem->title() + syndItem->description() +
                                syndItem->content() + syndItem->link() ) );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic