zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #04146
[Branch ~zeitgeist/zeitgeist/bluebird] Rev 276: - Remove Extension.get_name method, use get_type().name() instead.
------------------------------------------------------------
revno: 276
committer: Siegfried-Angel Gevatter Pujals <siegfried@xxxxxxxxxxxx>
branch nick: bluebird
timestamp: Sun 2011-09-25 17:58:52 +0200
message:
- Remove Extension.get_name method, use get_type().name() instead.
- Document the store_config and retrieve_config functions.
modified:
extensions/blacklist.vala
extensions/ds-registry.vala
extensions/histogram.vala
src/extension.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 'extensions/blacklist.vala'
--- extensions/blacklist.vala 2011-09-25 13:45:59 +0000
+++ extensions/blacklist.vala 2011-09-25 15:58:52 +0000
@@ -116,10 +116,6 @@
}
}
- public override string get_name () {
- return "blacklist";
- }
-
public override void unload ()
{
try
=== modified file 'extensions/ds-registry.vala'
--- extensions/ds-registry.vala 2011-09-25 13:45:59 +0000
+++ extensions/ds-registry.vala 2011-09-25 15:58:52 +0000
@@ -200,11 +200,6 @@
}
- public override string get_name ()
- {
- return "data-source-registry";
- }
-
public override void unload ()
{
try
=== modified file 'extensions/histogram.vala'
--- extensions/histogram.vala 2011-09-25 13:45:59 +0000
+++ extensions/histogram.vala 2011-09-25 15:58:52 +0000
@@ -49,11 +49,6 @@
}
}
- public override string get_name ()
- {
- return "histogram";
- }
-
public override void unload ()
{
try
=== modified file 'src/extension.vala'
--- src/extension.vala 2011-09-25 13:45:59 +0000
+++ src/extension.vala 2011-09-25 15:58:52 +0000
@@ -38,8 +38,6 @@
{
public unowned Engine engine { get; construct set; }
- public abstract string get_name();
-
/**
* This method gets called before Zeitgeist stops.
*
@@ -127,15 +125,27 @@
{
}
+ /**
+ * Store `data' under the given (extension unique) key, overwriting any
+ * previous value.
+ */
protected void store_config (string key, Variant data)
{
- engine.extension_store.store (get_name (), key, data);
+ engine.extension_store.store (get_type ().name (), key, data);
}
+ /**
+ * Retrieve data this extension previously stored under the given key,
+ * or null if there is no such data.
+ *
+ * @param key: key under which the data is stored
+ * @param format: type string for the resulting Variant
+ */
protected Variant? retrieve_config (string key, string format)
{
VariantType type = new VariantType(format);
- return engine.extension_store.retrieve (get_name (), key, type);
+ return engine.extension_store.retrieve (
+ get_type ().name (), key, type);
}
}