[tracker/api-cleanup: 11/16] rss: Implement TrackerMinerOnline



commit fbffe5a23eb2db5663dc87fce822f236424a51d9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jan 29 00:04:03 2014 +0100

    rss: Implement TrackerMinerOnline
    
    This is more suitable than implementing TrackerMiner directly

 .../libtracker-miner/libtracker-miner.types        |    1 +
 src/libtracker-miner/tracker-miner-online.h        |    3 +++
 src/miners/rss/tracker-miner-rss.c                 |   12 +++++++++++-
 3 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/libtracker-miner/libtracker-miner.types 
b/docs/reference/libtracker-miner/libtracker-miner.types
index 0ddac01..9b77039 100644
--- a/docs/reference/libtracker-miner/libtracker-miner.types
+++ b/docs/reference/libtracker-miner/libtracker-miner.types
@@ -2,3 +2,4 @@ tracker_decorator_fs_get_type
 tracker_indexing_tree_get_type
 tracker_miner_get_type
 tracker_miner_fs_get_type
+tracker_miner_online_get_type
diff --git a/src/libtracker-miner/tracker-miner-online.h b/src/libtracker-miner/tracker-miner-online.h
index 91c5b32..1c4a95d 100644
--- a/src/libtracker-miner/tracker-miner-online.h
+++ b/src/libtracker-miner/tracker-miner-online.h
@@ -59,6 +59,9 @@ struct _TrackerMinerOnlineClass {
        gboolean (* connected)    (TrackerMinerOnline *miner,
                                   TrackerNetworkType  network);
        void     (* disconnected) (TrackerMinerOnline *miner);
+
+       /* <Private> */
+       gpointer padding[10];
 };
 
 GType               tracker_miner_online_get_type         (void) G_GNUC_CONST;
diff --git a/src/miners/rss/tracker-miner-rss.c b/src/miners/rss/tracker-miner-rss.c
index e36084a..44dfa19 100644
--- a/src/miners/rss/tracker-miner-rss.c
+++ b/src/miners/rss/tracker-miner-rss.c
@@ -85,7 +85,7 @@ static void         feed_ready_cb                   (GrssFeedsPool             *
                                                      gpointer               user_data);
 static const gchar *get_message_url                 (GrssFeedItem              *item);
 
-G_DEFINE_TYPE (TrackerMinerRSS, tracker_miner_rss, TRACKER_TYPE_MINER)
+G_DEFINE_TYPE (TrackerMinerRSS, tracker_miner_rss, TRACKER_TYPE_MINER_ONLINE)
 
 static void
 tracker_miner_rss_finalize (GObject *object)
@@ -109,11 +109,19 @@ tracker_miner_rss_finalize (GObject *object)
        G_OBJECT_CLASS (tracker_miner_rss_parent_class)->finalize (object);
 }
 
+static gboolean
+miner_connected (TrackerMinerOnline *miner,
+                TrackerNetworkType  network)
+{
+       return (network == NETWORK_TYPE_LAN);
+}
+
 static void
 tracker_miner_rss_class_init (TrackerMinerRSSClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
        TrackerMinerClass *miner_class = TRACKER_MINER_CLASS (klass);
+       TrackerMinerOnlineClass *miner_online_class = TRACKER_MINER_ONLINE_CLASS (klass);
 
        object_class->finalize = tracker_miner_rss_finalize;
 
@@ -122,6 +130,8 @@ tracker_miner_rss_class_init (TrackerMinerRSSClass *klass)
        miner_class->paused  = miner_paused;
        miner_class->resumed = miner_resumed;
 
+       miner_online_class->connected = miner_connected;
+
        g_type_class_add_private (object_class, sizeof (TrackerMinerRSSPrivate));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]