← Back to team overview

zeitgeist team mailing list archive

[Branch ~zeitgeist/zeitgeist/bluebird] Rev 209: Fix builtin extensions

 

------------------------------------------------------------
revno: 209
committer: Michal Hruby <michal.mhr@xxxxxxxxx>
branch nick: bluebird
timestamp: Wed 2011-08-31 14:23:34 +0200
message:
  Fix builtin extensions
modified:
  src/Makefile.am
  src/extension-collection.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/Makefile.am'
--- src/Makefile.am	2011-08-31 11:02:37 +0000
+++ src/Makefile.am	2011-08-31 12:23:34 +0000
@@ -5,6 +5,7 @@
 AM_CPPFLAGS = \
 	$(BLUEBIRD_CFLAGS) \
 	-include $(CONFIG_HEADER) \
+	-w \
 	$(NULL)
 
 VALAFLAGS = \
@@ -16,7 +17,7 @@
 	--pkg gmodule-2.0 \
 	$(NULL)
 
-
+# Make sure every extension has only one vala file!
 extensions_VALASOURCES = \
 	ext-data-source-registry.vala \
 	ext-blacklist.vala \
@@ -59,7 +60,8 @@
 	touch "$@"
 
 extensions_vala.stamp: zeitgeist-engine.vapi $(extensions_VALASOURCES)
-	$(VALAC) $(VALAFLAGS) $(EXT_FLAGS) -C $(filter %.vala %.vapi,$^)
+	$(foreach ext_src,$(filter %.vala,$^),\
+		$(VALAC) $(VALAFLAGS) $(EXT_FLAGS) -C zeitgeist-engine.vapi $(ext_src) || exit 1;)
 	touch "$@"
 
 # FIXME: can we make this depend on $(ontology_trig_DATA)?

=== modified file 'src/extension-collection.vala'
--- src/extension-collection.vala	2011-08-25 21:06:38 +0000
+++ src/extension-collection.vala	2011-08-31 12:23:34 +0000
@@ -55,11 +55,20 @@
 
             // load the builtin extensions first
 #if BUILTIN_EXTENSIONS
-            var bel = new BuiltinExtension (data_source_registry_init);
-            extension = bel.create_instance ();
-            if (extension != null) extensions.add (extension);
+            RegisterExtensionFunc[] builtins =
+            {
+                data_source_registry_init,
+                blacklist_init
+            };
+
+            foreach (var func in builtins)
+            {
+                ExtensionLoader builtin = new BuiltinExtension (func);
+                extension = builtin.create_instance ();
+                if (extension != null) extensions.add (extension);
+            }
 #endif
-            
+
             // TODO: load extensions from system & user directories, and make
             // sure the order is correct
             unowned string ext_dir1 = Utils.get_local_extensions_path ();
@@ -105,6 +114,7 @@
 
 #if BUILTIN_EXTENSIONS
     private extern static Type data_source_registry_init (TypeModule mod);
+    private extern static Type blacklist_init (TypeModule mod);
 #endif
 
 }