[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-16 19:07:27
Message-ID: 1237230447.770524.17867.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 940174 by divanov:

Simplify


 M  +9 -19     rssresourcebase.cpp  


--- trunk/playground/pim/krss/resources/libkrssresource/rssresourcebase.cpp \
#940173:940174 @@ -37,26 +37,16 @@
 using namespace KRssResource;
 using namespace KRss;
 
-namespace {
-struct Modifier
+static void addSubscriptionLabel( KRss::FeedCollection& collection, const QString& \
label )  {
-    void addSubscriptionLabel( KRss::FeedCollection& collection, const QString& \
                label )
-    {
-        collection.addSubscriptionLabel( label );
-    }
+    collection.addSubscriptionLabel( label );
+}
 
-    void removeSubscriptionLabel( KRss::FeedCollection& collection, const QString& \
                label )
-    {
-        collection.removeSubscriptionLabel( label );
-    }
+static void removeSubscriptionLabel( KRss::FeedCollection& collection, const \
QString& label ) +{
+    collection.removeSubscriptionLabel( label );
+}
 
-    static Modifier instance;
-};
-
-Modifier Modifier::instance;
-
-} // namespace
-
 // member functions
 RssResourceBase::RssResourceBase( const QString &id )
         :ResourceBase( id )
@@ -149,7 +139,7 @@
 bool RssResourceBase::subscribe( const KRss::Feed::Id& id, const QString \
&subscriptionLabel )  {
     FeedCollectionModifyJob * const job = new FeedCollectionModifyJob( id, this );
-    job->setModifier( boost::bind( &Modifier::addSubscriptionLabel, \
Modifier::instance, _1, subscriptionLabel ) ); +    job->setModifier( boost::bind( \
                &addSubscriptionLabel, _1, subscriptionLabel ) );
     connect( job, SIGNAL( result( KJob* ) ), this, SLOT( slotFeedModified( KJob* ) ) \
);  job->start();
 
@@ -162,7 +152,7 @@
 bool RssResourceBase::unsubscribe( const KRss::Feed::Id& id, const QString \
&subscriptionLabel )  {
     FeedCollectionModifyJob * const job = new FeedCollectionModifyJob( id, this );
-    job->setModifier( boost::bind( &Modifier::removeSubscriptionLabel, \
Modifier::instance, _1, subscriptionLabel ) ); +    job->setModifier( boost::bind( \
                &removeSubscriptionLabel, _1, subscriptionLabel ) );
     connect( job, SIGNAL( result( KJob* ) ), this, SLOT( slotFeedModified( KJob* ) ) \
);  job->start();
 


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

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