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

List:       kde-commits
Subject:    branches/work/akregator/onlinesync/akregator/src
From:       Didier Hoarau <did.hoarau () gmail ! com>
Date:       2008-02-29 22:50:35
Message-ID: 1204325435.155510.19021.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 780769 by dhoarau:

More integration for the config tool


 M  +1 -1      CMakeLists.txt  
 M  +46 -2     actionmanagerimpl.cpp  
 M  +3 -0      actionmanagerimpl.h  
 M  +2 -2      feedsync/aggregator.h  
 A             feedsync/feedsync.cpp   feedsync/syncrss.cpp#780716 [License: UNKNOWN]
 A             feedsync/feedsync.h   feedsync/syncrss.h#780716 [License: UNKNOWN]
 M  +3 -3      feedsync/googlereader.h  
 M  +3 -3      feedsync/opml.h  
 D             feedsync/syncrss.cpp  
 D             feedsync/syncrss.h  
 M  +4 -0      mainwidget.cpp  


--- branches/work/akregator/onlinesync/akregator/src/CMakeLists.txt #780768:780769
@@ -101,7 +101,7 @@
 
 
 # Feed synchronization
-set(feedsync_SRCS  feedsync/syncrss.cpp
+set(feedsync_SRCS  feedsync/feedsync.cpp
                    feedsync/subscriptionlist.cpp 
                    feedsync/akregator.cpp 
                    feedsync/googlereader.cpp 
--- branches/work/akregator/onlinesync/akregator/src/actionmanagerimpl.cpp \
#780768:780769 @@ -22,6 +22,10 @@
     without including the source code for Qt in the source distribution.
 */
 
+// TODO Move all the code that is related to FeedSync
+#include "feedsync/feedsync.h"
+
+
 #include "actionmanagerimpl.h"
 #include "akregatorconfig.h"
 #include "akregator_part.h"
@@ -396,13 +400,53 @@
     action->setText(i18n("Send &File..."));
     connect(action, SIGNAL(triggered(bool)), mainWidget, SLOT(slotSendFile()));
 
-    // Feed synchronization
+    // TODO Move all the code that is related to FeedSync
+    loadFeedSyncMenu();
+}
+
+// TODO Move all the code that is related to FeedSync
+// #include "feedsync/feedsync.h"
+void ActionManagerImpl::loadFeedSyncMenu()
+{
+    // The object that will do the Sync
+    FeedSync * syncTool = new FeedSync();
+
+    // Fill the menubar
+    KActionCollection* coll = actionCollection();
     KActionMenu* feedSyncMenu = coll->add<KActionMenu>("feedsync_menu");
     feedSyncMenu->setText(i18n("&Feed synchronization"));
+    QAction* action;
+
+    // Read configuration
+    KConfig config("akregator_feedsyncrc");
+    foreach ( const QString& groupname, config.groupList() ) {
+        if (groupname.left(15)=="FeedSyncSource_") {
+            kDebug() << groupname;
+            KConfigGroup generalGroup( &config, groupname );
+
+            action = coll->addAction(groupname);
+            action->setProperty("Account",groupname);
+            action->setProperty("SyncType",syncTool->Get);
+            action->setIcon(KIcon("mail-receive"));
+            action->setText(i18n(QString ("Get from "+generalGroup.readEntry( \
"Account", QString() )).toUtf8())); +            feedSyncMenu->addAction(action);
+            connect( action, SIGNAL(triggered(bool)), syncTool, SLOT(sync()) );
+
+            action = coll->addAction(groupname);
+            action->setProperty("Account",groupname);
+            action->setProperty("SyncType",syncTool->Get);
+            action->setIcon(KIcon("mail-send"));
+            action->setText(i18n(QString ("Send to "+generalGroup.readEntry( \
"Account", QString() )).toUtf8())); +            feedSyncMenu->addAction(action);
+            connect( action, SIGNAL(triggered(bool)), syncTool, SLOT(sync()) );
+        }
+    }
+
     action = coll->addAction("feedsync_manage");
+    action->setIcon(KIcon("application-rss+xml"));
     action->setText(i18n("Manage..."));
+    connect(action, SIGNAL(triggered(bool)), d->mainWidget, \
SLOT(slotFeedSyncManage()));  feedSyncMenu->addAction(action);
-    connect(action, SIGNAL(triggered(bool)), mainWidget, \
SLOT(slotFeedSyncManage()));  }
 
 void ActionManagerImpl::initArticleViewer(ArticleViewer* articleViewer)
--- branches/work/akregator/onlinesync/akregator/src/actionmanagerimpl.h \
#780768:780769 @@ -83,6 +83,9 @@
         
         class ActionManagerImplPrivate;
         ActionManagerImplPrivate* d;
+
+        // TODO Move all the code that is related to FeedSync
+        void loadFeedSyncMenu();
 };
 
 } // namespace Akregator
--- branches/work/akregator/onlinesync/akregator/src/feedsync/aggregator.h \
#780768:780769 @@ -1,8 +1,8 @@
-#include "subscriptionlist.h"
-
 #ifndef AGGREGATOR_H
 #define AGGREGATOR_H
 
+#include "subscriptionlist.h"
+
 class Aggregator: public QObject
 {
  public:
--- branches/work/akregator/onlinesync/akregator/src/feedsync/googlereader.h \
#780768:780769 @@ -1,3 +1,6 @@
+#ifndef GOOGLEREADER_H
+#define GOOGLEREADER_H
+
 #include <KApplication>
 #include <QHttp>
 #include <QMutex>
@@ -5,9 +8,6 @@
 #include "aggregator.h"
 #include "subscriptionlist.h"
 
-#ifndef GOOGLEREADER_H
-#define GOOGLEREADER_H
-
 class GoogleReader: public Aggregator
 {
     Q_OBJECT
--- branches/work/akregator/onlinesync/akregator/src/feedsync/opml.h #780768:780769
@@ -1,9 +1,9 @@
+#ifndef OPML_H
+#define OPML_H
+
 #include "subscriptionlist.h"
 #include "aggregator.h"
 
-#ifndef OPML_H
-#define OPML_H
-
 class QFile;
 class QApplication;
 class QDomDocument;
--- branches/work/akregator/onlinesync/akregator/src/mainwidget.cpp #780768:780769
@@ -1228,6 +1228,8 @@
     m_mainFrame->slotSetStatusText( kifi.isNull() ? QString() : \
kifi.url().prettyUrl() );  }
 
+
+// TODO Move all the code that is related to FeedSync
 void Akregator::MainWidget::slotFeedSyncManage()
 {
     using namespace feedsync;
@@ -1236,6 +1238,8 @@
     dlg->show();
 }
 
+
+
 void Akregator::MainWidget::readProperties(const KConfigGroup &config)
 {
     // read filter settings


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

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