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

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

SVN commit 939753 by divanov:

SVN_SILENT: indent = 4 spaces && style


 M  +25 -30    rssitemsync.cpp  
 M  +5 -9      rssitemsync.h  


--- trunk/playground/pim/krss/resources/libkrssresource/rssitemsync.cpp \
#939752:939753 @@ -16,48 +16,43 @@
 */
 
 #include "rssitemsync.h"
-
 #include "libkrss/rssitem.h"
 
 #include <KDebug>
 
 RssItemSync::RssItemSync( const Akonadi::Collection &collection, QObject *parent )
-        : ItemSync( collection, parent )
+    : ItemSync( collection, parent )
 {
 }
 
-RssItemSync::~RssItemSync()
-{
-}
-
 bool RssItemSync::updateItem( const Akonadi::Item &storedItem, Akonadi::Item \
&newItem )  {
-        if ( storedItem.mimeType() != QString::fromLatin1( "application/rss+xml" ) \
                ||
-             newItem.mimeType() != QString::fromLatin1( "application/rss+xml" ) ) {
-                kWarning() << "Either storedItem or newItem doesn't have mimetype \
                \'application/rss+xml\'";
-                kWarning() << "Remote id:" << storedItem.remoteId();
-                return false;
-        }
+    if ( storedItem.mimeType() != QString::fromLatin1( "application/rss+xml" ) ||
+        newItem.mimeType() != QString::fromLatin1( "application/rss+xml" ) ) {
+        kWarning() << "Either storedItem or newItem doesn't have mimetype \
\'application/rss+xml\'"; +        kWarning() << "Remote id:" << \
storedItem.remoteId(); +        return false;
+    }
 
-        if ( !storedItem.hasPayload() || !newItem.hasPayload() ) {
-                kWarning() << "Either storedItem or newItem doesn't have payload";
-                kWarning() << "Remote id:" << storedItem.remoteId();
-                return false;
-        }
+    if ( !storedItem.hasPayload() || !newItem.hasPayload() ) {
+        kWarning() << "Either storedItem or newItem doesn't have payload";
+        kWarning() << "Remote id:" << storedItem.remoteId();
+        return false;
+    }
 
-        const KRss::RssItem newRssItem = newItem.payload<KRss::RssItem>();
-        const int newHash = newRssItem.hash();
-        const int storedHash = storedItem.payload<KRss::RssItem>().hash();
+    const KRss::RssItem newRssItem = newItem.payload<KRss::RssItem>();
+    const int newHash = newRssItem.hash();
+    const int storedHash = storedItem.payload<KRss::RssItem>().hash();
 
-        if ( !newRssItem.guidIsHash() && storedHash != newHash ) {
-                kDebug() << "The article has been updated:" << newItem.remoteId();
-                // dont overwrite the existing flags
-                // and clear \Seen + set \Recent
-                newItem.setFlags( storedItem.flags() );
-                newItem.clearFlag( "\\Seen" );
-                newItem.setFlag( "\\Recent" );
-                return true;
-        }
+    if ( !newRssItem.guidIsHash() && storedHash != newHash ) {
+        kDebug() << "The article has been updated:" << newItem.remoteId();
+        // dont overwrite the existing flags
+        // and clear \Seen + set \Recent
+        newItem.setFlags( storedItem.flags() );
+        newItem.clearFlag( "\\Seen" );
+        newItem.setFlag( "\\Recent" );
+        return true;
+    }
 
-        return false;
+    return false;
 }
--- trunk/playground/pim/krss/resources/libkrssresource/rssitemsync.h #939752:939753
@@ -15,22 +15,18 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef RSSRESOURCE_RSSITEMSYNC
-#define RSSRESOURCE_RSSITEMSYNC
+#ifndef KRSSRESOURCE_RSSITEMSYNC
+#define KRSSRESOURCE_RSSITEMSYNC
 
 #include <akonadi/itemsync.h>
 
 class RssItemSync : public Akonadi::ItemSync
 {
-
 public:
+    explicit RssItemSync( const Akonadi::Collection& collection, QObject *parent = 0 \
);  
-        explicit RssItemSync( const Akonadi::Collection &collection, QObject *parent \
                = 0 );
-        ~RssItemSync();
-
 protected:
-
-        bool updateItem( const Akonadi::Item &storedItem, Akonadi::Item &newItem );
+    bool updateItem( const Akonadi::Item& storedItem, Akonadi::Item& newItem );
 };
 
-#endif /* RSSRESOURCE_RSSITEMSYNC */
+#endif // KRSSRESOURCE_RSSITEMSYNC


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

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