← Back to team overview

zeitgeist team mailing list archive

[Branch ~zeitgeist/zeitgeist/bluebird] Rev 217: Move the ExtensionCollection instance to engine.vala.

 

------------------------------------------------------------
revno: 217
committer: Siegfried-Angel Gevatter Pujals <siegfried@xxxxxxxxxxxx>
branch nick: bluebird
timestamp: Fri 2011-09-02 18:38:41 +0200
message:
  Move the ExtensionCollection instance to engine.vala.
modified:
  src/engine.vala
  src/zeitgeist-daemon.vala


--
lp:~zeitgeist/zeitgeist/bluebird
https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird

Your team Zeitgeist Framework Team is subscribed to branch lp:~zeitgeist/zeitgeist/bluebird.
To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== modified file 'src/engine.vala'
--- src/engine.vala	2011-09-02 16:11:42 +0000
+++ src/engine.vala	2011-09-02 16:38:41 +0000
@@ -34,15 +34,16 @@
 public class Engine : Object
 {
 
-    Zeitgeist.SQLite.ZeitgeistDatabase database;
-    unowned Sqlite.Database db;
-
-    TableLookup interpretations_table;
-    TableLookup manifestations_table;
-    TableLookup mimetypes_table;
-    TableLookup actors_table;
-
-    uint32 last_id;
+    private Zeitgeist.SQLite.ZeitgeistDatabase database;
+    private ExtensionCollection extension_collection;
+    private unowned Sqlite.Database db;
+
+    private TableLookup interpretations_table;
+    private TableLookup manifestations_table;
+    private TableLookup mimetypes_table;
+    private TableLookup actors_table;
+
+    private uint32 last_id;
 
     public Engine () throws EngineError
     {
@@ -54,6 +55,13 @@
         manifestations_table = new TableLookup(database, "manifestation");
         mimetypes_table = new TableLookup(database, "mimetype");
         actors_table = new TableLookup(database, "actor");
+
+        extension_collection = new ExtensionCollection ();
+    }
+
+    public string[] get_extension_names ()
+    {
+        return extension_collection.get_extension_names ();
     }
 
     public GenericArray<Event?> get_events(uint32[] event_ids,
@@ -562,25 +570,25 @@
             {
                 unowned Subject subject = event.subjects[i];
                 uris.add (subject.uri);
-                
+
                 if (subject.current_uri == "" || subject.current_uri == null)
                     subject.current_uri = subject.uri;
-                
-                if (event.interpretation == ZG.MOVE_EVENT 
+
+                if (event.interpretation == ZG.MOVE_EVENT
                     && subject.uri == subject.current_uri)
                 {
                     //FIXME: throw Error here
                     return 0;
                 }
-                else if (event.interpretation != ZG.MOVE_EVENT 
+                else if (event.interpretation != ZG.MOVE_EVENT
                     && subject.uri != subject.current_uri)
                 {
                     //FIXME: throw Error here
                     return 0;
                 }
-                
+
                 uris.add (subject.current_uri);
-                
+
                 if (subject.origin != "")
                     uris.add (subject.origin);
                 if (subject.text != "")
@@ -678,7 +686,7 @@
         stdout.printf ("============ Inserted event: ============\n");
         event.debug_print ();
         stdout.printf ("\n");
-        
+
         if (event.interpretation == ZG.MOVE_EVENT)
         {
             handle_move_event (event);
@@ -1028,7 +1036,7 @@
         }
         return subwhere;
     }
-    
+
     private void handle_move_event(Event event)
     {
         for (int i = 0; i < event.subjects.length; i++)

=== modified file 'src/zeitgeist-daemon.vala'
--- src/zeitgeist-daemon.vala	2011-08-30 14:11:09 +0000
+++ src/zeitgeist-daemon.vala	2011-09-02 16:38:41 +0000
@@ -75,7 +75,6 @@
 
         private Engine engine;
         private MonitorManager notifications;
-        private ExtensionCollection extension_collection;
 
         private uint log_register_id;
         private unowned DBusConnection connection;
@@ -84,7 +83,7 @@
         {
             owned get
             {
-                string[] ext = extension_collection.get_extension_names ();
+                string[] ext = engine.get_extension_names ();
                 return ext;
             }
         }
@@ -116,7 +115,6 @@
             }
 
             notifications = new MonitorManager ();
-            extension_collection = new ExtensionCollection ();
         }
 
         ~Daemon ()