Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

getting rid of config.vala changes

  • Loading branch information...
commit 7f6153637eeae2791d8135d09a1b21e361035ead 1 parent 9563503
@guillaumev authored
Showing with 15 additions and 53 deletions.
  1. +0 −39 piwigo.patch
  2. +15 −14 src/PiwigoConnector.vala
View
39 piwigo.patch
@@ -1,42 +1,3 @@
-Index: src/Config.vala
-===================================================================
---- src/Config.vala (revisión: 2331)
-+++ src/Config.vala (copia de trabajo)
-@@ -273,6 +273,34 @@
- return get_int("/apps/shotwell/sharing/picasa/default_size", 3) - 1;
- }
-
-+ public string? get_picasa_auth_token() {
-+ return get_string("/apps/shotwell/sharing/picasa/auth_token");
-+ }
-+
-+ public string? get_piwigo_url() {
-+ return get_string("/apps/shotwell/sharing/piwigo/url");
-+ }
-+
-+ public bool set_piwigo_url(string url) {
-+ return set_string("/apps/shotwell/sharing/piwigo/url", url);
-+ }
-+
-+ public string? get_piwigo_user_name() {
-+ return get_string("/apps/shotwell/sharing/piwigo/user_name");
-+ }
-+
-+ public bool set_piwigo_user_name(string user_name) {
-+ return set_string("/apps/shotwell/sharing/piwigo/user_name", user_name);
-+ }
-+
-+ public string? get_piwigo_id() {
-+ return get_string("/apps/shotwell/sharing/piwigo/id");
-+ }
-+
-+ public bool set_piwigo_id(string id) {
-+ return set_string("/apps/shotwell/sharing/piwigo/id", id);
-+ }
-+
- public string? get_publishing_string(string id, string key) {
- return get_string(_("/apps/shotwell/sharing/%s/%s").printf(id, key));
- }
Index: src/WebConnectors.vala
===================================================================
--- src/WebConnectors.vala (revisión: 2331)
View
29 src/PiwigoConnector.vala
@@ -11,6 +11,7 @@ namespace PiwigoConnector {
private const string SERVICE_WELCOME_MESSAGE =
_("You are not currently logged into your Piwigo Web Album.\n\nPlease enter the URL of your Piwigo installation and your username and password");
private const string DEFAULT_CATEGORY_NAME = _("Shotwell Connect");
+ private const string CONFIG_NAME = "piwigo";
private struct Category {
int id;
@@ -74,7 +75,7 @@ namespace PiwigoConnector {
}
public override ServiceCapabilities.MediaType get_supported_media() {
- return MediaType.PHOTO | MediaType.VIDEO;
+ return MediaType.PHOTO;
}
public override ServiceInteractor factory(PublishingDialog host) {
@@ -965,33 +966,33 @@ namespace PiwigoConnector {
private bool has_persistent_state() {
Config config = Config.get_instance();
- return ((config.get_piwigo_url() != null) &&
- (config.get_piwigo_user_name() != null) &&
- (config.get_piwigo_id() != null));
+ return ((config.get_publishing_string(CONFIG_NAME, "url") != null) &&
+ (config.get_publishing_string(CONFIG_NAME, "username") != null) &&
+ (config.get_publishing_string(CONFIG_NAME, "id") != null));
}
private void save_persistent_state() {
Config config = Config.get_instance();
-
- config.set_piwigo_url(pwg_url);
- config.set_piwigo_user_name(username);
- config.set_piwigo_id(pwg_id);
+
+ config.set_publishing_string(CONFIG_NAME, "url", pwg_url);
+ config.set_publishing_string(CONFIG_NAME, "username", username);
+ config.set_publishing_string(CONFIG_NAME, "id", pwg_id);
}
private void load_persistent_state() {
Config config = Config.get_instance();
- pwg_url = config.get_piwigo_url();
- username = config.get_piwigo_user_name();
- pwg_id = config.get_piwigo_id();
+ pwg_url = config.get_publishing_string(CONFIG_NAME, "url");
+ username = config.get_publishing_string(CONFIG_NAME, "username");
+ pwg_id = config.get_publishing_string(CONFIG_NAME, "id");
}
private void clear_persistent_state() {
Config config = Config.get_instance();
- config.set_piwigo_url("");
- config.set_piwigo_user_name("");
- config.set_piwigo_id("");
+ config.set_publishing_string(CONFIG_NAME, "url", "");
+ config.set_publishing_string(CONFIG_NAME, "username", "");
+ config.set_publishing_string(CONFIG_NAME, "id", "");
}
public bool is_authenticated() {
Please sign in to comment.
Something went wrong with that request. Please try again.