[tracker/miner-web: 28/31] libtracker-miner: Renames in TrackerPasswordProvider API
- From: Adrien Bustany <abustany src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/miner-web: 28/31] libtracker-miner: Renames in TrackerPasswordProvider API
- Date: Thu, 12 Nov 2009 20:40:23 +0000 (UTC)
commit d1289e71b4bd5148e329a0b7b491c301204225ca
Author: Adrien Bustany <madcat mymadcat com>
Date: Thu Nov 12 15:59:34 2009 -0300
libtracker-miner: Renames in TrackerPasswordProvider API
This commit renames tracker_password_provider_get to
tracker_password_provider_get_password and tracker_password_provider_store to
tracker_password_provider_store_password.
It also ports the two backend (keyfile and gnome-keyring) to the new API.
src/libtracker-miner/Makefile.am | 10 +++++++---
src/libtracker-miner/gnome-password-provider.vala | 4 ++--
.../keyfile-password-provider.vala | 4 ++--
src/libtracker-miner/password-provider.vala | 4 ++--
4 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-miner/Makefile.am b/src/libtracker-miner/Makefile.am
index f9b210c..22ee618 100644
--- a/src/libtracker-miner/Makefile.am
+++ b/src/libtracker-miner/Makefile.am
@@ -133,11 +133,15 @@ libtracker-miner-web.vala.stamp: $(libtracker_miner_la_VALASOURCES)
$(VALAC) -C $(VALAPKGS) $(VALAFLAGS) -H tracker-password-provider.h --library tracker-password-provider-$(TRACKER_API_VERSION) $^
touch $@
-# Custom rule to avoid API duplication. Custom shell script to workaround
-# a dbus-binding-tool bug where it generates bad code when passed two files
+# Custom rule to avoid API duplication. There is also a workaround for bug
+# in dbus-binding-tool where it generates bad code when two files are passed
# on the command line (though the man page says it supports it)
+# This bug is reported at https://bugs.freedesktop.org/show_bug.cgi?id=25056
tracker-miner-web-glue.h: $(top_srcdir)/data/dbus/tracker-miner-web.xml $(top_srcdir)/data/dbus/tracker-miner.xml
- $(top_srcdir)/src/libtracker-miner/merge_interfaces.sh $^ > $(top_srcdir)/src/libtracker-miner/tracker-miner-web-full.xml
+ echo '<?xml version="1.0" encoding="UTF-8"?>' > $(top_srcdir)/src/libtracker-miner/tracker-miner-web-full.xml
+ echo '<node name="/">' >> $(top_srcdir)/src/libtracker-miner/tracker-miner-web-full.xml
+ cat $^ | grep -v -e '<node' -e '<?xml' -e '</node>' >> $(top_srcdir)/src/libtracker-miner/tracker-miner-web-full.xml
+ echo '</node>' >> $(top_srcdir)/src/libtracker-miner/tracker-miner-web-full.xml
$(AM_V_GEN)$(DBUSBINDINGTOOL) --mode=glib-server --output=$@ --prefix=tracker_miner_web $(top_srcdir)/src/libtracker-miner/tracker-miner-web-full.xml
%-glue.h: $(top_srcdir)/data/dbus/%.xml
diff --git a/src/libtracker-miner/gnome-password-provider.vala b/src/libtracker-miner/gnome-password-provider.vala
index b53dcdb..6a3d204 100644
--- a/src/libtracker-miner/gnome-password-provider.vala
+++ b/src/libtracker-miner/gnome-password-provider.vala
@@ -12,7 +12,7 @@ namespace Tracker {
public string name { get { return BACKEND_NAME; }}
- public void store (string service, string description, string username, string password) throws PasswordProviderError
+ public void store_password (string service, string description, string username, string password) throws PasswordProviderError
{
GnomeKeyring.Result r = GnomeKeyring.store_password_sync (password_schema, null /* default keyring */, description, password, "username", username, "service", service, null);
@@ -21,7 +21,7 @@ namespace Tracker {
}
}
- public new string get (string service, out string? username) throws PasswordProviderError
+ public string get_password (string service, out string? username) throws PasswordProviderError
{
GnomeKeyring.AttributeList attributes = new GnomeKeyring.AttributeList ();
attributes.append_string ("service", service);
diff --git a/src/libtracker-miner/keyfile-password-provider.vala b/src/libtracker-miner/keyfile-password-provider.vala
index 3540cd6..5221d93 100644
--- a/src/libtracker-miner/keyfile-password-provider.vala
+++ b/src/libtracker-miner/keyfile-password-provider.vala
@@ -6,7 +6,7 @@ namespace Tracker {
public string name { get { return BACKEND_NAME; }}
- public void store (string service, string description, string username, string password) throws PasswordProviderError
+ public void store_password (string service, string description, string username, string password) throws PasswordProviderError
{
GLib.KeyFile password_file = new GLib.KeyFile ();
@@ -29,7 +29,7 @@ namespace Tracker {
}
}
- public new string get (string service, out string? username) throws PasswordProviderError
+ public string get_password (string service, out string? username) throws PasswordProviderError
{
GLib.KeyFile password_file = new GLib.KeyFile ();
diff --git a/src/libtracker-miner/password-provider.vala b/src/libtracker-miner/password-provider.vala
index b01a554..75d53ce 100644
--- a/src/libtracker-miner/password-provider.vala
+++ b/src/libtracker-miner/password-provider.vala
@@ -10,8 +10,8 @@ namespace Tracker {
[CCode (cheader_filename = "libtracker-miner/tracker-miner-web.h")]
public interface PasswordProvider : GLib.Object {
public abstract string name { get; }
- public abstract void store (string service, string description, string username, string password) throws PasswordProviderError;
- public abstract string @get (string service, out string? username) throws PasswordProviderError;
+ public abstract void store_password (string service, string description, string username, string password) throws PasswordProviderError;
+ public abstract string @get_password (string service, out string? username) throws PasswordProviderError;
public abstract void forget (string service, string username) throws PasswordProviderError;
public static PasswordProvider password_provider {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]