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

List:       kde-commits
Subject:    playground/pim/krss
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2009-07-05 18:35:36
Message-ID: 1246818936.715745.26652.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 991834 by osterfeld:

handle different serializer impls (there will be only one in the end anyway) at \
compile time by separate .cpp files, instead of having the interface which also \
requires ifdefs in using code

 M  +2 -21     libkrss/rssitemserializer.h  
 M  +2 -2      libkrss/rssitemserializer_protobuf.cpp  
 M  +2 -2      libkrss/rssitemserializer_xml.cpp  
 M  +1 -1      plugin/akonadi_serializer_rss.h  


--- trunk/playground/pim/krss/libkrss/rssitemserializer.h #991833:991834
@@ -42,29 +42,10 @@
         Full
     };
 
-    virtual ~RssItemSerializer() {}
-    virtual void serialize( const KRss::RssItem& item, QByteArray& array, ItemPart \
                part = Full ) const = 0;
-    virtual bool deserialize( KRss::RssItem& item, const QByteArray& array, ItemPart \
part = Full ) const = 0; +    void serialize( const KRss::RssItem& item, QByteArray& \
array, ItemPart part = Full ) const; +    bool deserialize( KRss::RssItem& item, \
const QByteArray& array, ItemPart part = Full ) const;  };
 
-class KRSS_EXPORT XmlRssItemSerializerImpl : public RssItemSerializer
-{
-public:
-    /* reimp */ void serialize( const KRss::RssItem& item, QByteArray& array, \
                ItemPart part = Full ) const;
-    /* reimp */ bool deserialize( KRss::RssItem& item, const QByteArray& array, \
                ItemPart part = Full ) const;
-};
-
-#ifdef KRSS_ENABLE_PROTOBUF_SERIALIZER
-
-class KRSS_EXPORT ProtobufRssItemSerializerImpl : public RssItemSerializer
-{
-public:
-    /* reimp */ void serialize( const KRss::RssItem& item, QByteArray& array, \
                ItemPart part = Full ) const;
-    /* reimp */ bool deserialize( KRss::RssItem& item, const QByteArray& array, \
                ItemPart part = Full ) const;
-};
-
-#endif
-
 }
 
 #endif // KRSS_RSSITEMSERIALIZER_H
--- trunk/playground/pim/krss/libkrss/rssitemserializer_protobuf.cpp #991833:991834
@@ -67,7 +67,7 @@
     return r;
 }
 
-void ProtobufRssItemSerializerImpl::serialize( const KRss::RssItem& item, \
QByteArray& array, ItemPart part ) const +void RssItemSerializer::serialize( const \
KRss::RssItem& item, QByteArray& array, ItemPart part ) const  {
     const bool writeHeaders = part == Full || part == Headers;
     const bool writeContent = part == Full || part == Content;
@@ -138,7 +138,7 @@
     return p;
 }
 
-bool KRss::ProtobufRssItemSerializerImpl::deserialize( KRss::RssItem& item, const \
QByteArray& array, ItemPart part ) const +bool KRss::RssItemSerializer::deserialize( \
KRss::RssItem& item, const QByteArray& array, ItemPart part ) const  {
     const bool readHeaders = part == Full || part == Headers;
     const bool readContent = part == Full || part == Content;
--- trunk/playground/pim/krss/libkrss/rssitemserializer_xml.cpp #991833:991834
@@ -387,7 +387,7 @@
 
 } // namespace
 
-void KRss::XmlRssItemSerializerImpl::serialize( const KRss::RssItem& item, \
QByteArray& array, ItemPart part ) const +void KRss::RssItemSerializer::serialize( \
const KRss::RssItem& item, QByteArray& array, ItemPart part ) const  {
     QXmlStreamWriter writer( &array );
     writer.writeStartDocument();
@@ -395,7 +395,7 @@
     writer.writeEndDocument();
 }
 
-bool KRss::XmlRssItemSerializerImpl::deserialize( KRss::RssItem& item, const \
QByteArray& array, ItemPart part ) const +bool KRss::RssItemSerializer::deserialize( \
KRss::RssItem& item, const QByteArray& array, ItemPart part ) const  {
     QXmlStreamReader reader( array );
     reader.setNamespaceProcessing( true );
--- trunk/playground/pim/krss/plugin/akonadi_serializer_rss.h #991833:991834
@@ -38,7 +38,7 @@
 #ifdef KRSS_ENABLE_PROTOBUF_SERIALIZER
     KRss::ProtobufRssItemSerializerImpl m_serializer;
 #else
-    KRss::XmlRssItemSerializerImpl m_serializer;
+    KRss::RssItemSerializer m_serializer;
 #endif
 };
 


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

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