From ee2b5e6cdf9052a961f4254b39c04a1916c341ec Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Tue, 23 Aug 2011 16:22:27 -0400
Subject: [PATCH] * #6718: confmanager: removed more unused methods

---
 .../dbus/configurationmanager-introspec.xml   | 20 ---------
 daemon/src/dbus/configurationmanager.cpp      | 10 -----
 daemon/src/dbus/configurationmanager.h        |  2 -
 daemon/src/managerimpl.cpp                    | 45 -------------------
 daemon/src/managerimpl.h                      | 12 -----
 .../dbus/configurationmanager-introspec.xml   | 20 ---------
 gnome/src/dbus/dbus.c                         | 27 -----------
 gnome/src/dbus/dbus.h                         | 12 -----
 8 files changed, 148 deletions(-)

diff --git a/daemon/src/dbus/configurationmanager-introspec.xml b/daemon/src/dbus/configurationmanager-introspec.xml
index 7168fbf0de..7ff88b660f 100755
--- a/daemon/src/dbus/configurationmanager-introspec.xml
+++ b/daemon/src/dbus/configurationmanager-introspec.xml
@@ -272,26 +272,6 @@
 		   </arg>
 	   </method>
 
-	   <method name="getRingtoneChoice" tp:name-for-bindings="getRingtoneChoice">
-		   <tp:docstring>
-		   </tp:docstring>
-		   <arg type="s" name="accountID" direction="in"/>
-		   <arg type="s" name="tone" direction="out">
-			   <tp:docstring>
-			   </tp:docstring>
-		   </arg>
-	   </method>
-
-	   <method name="setRingtoneChoice" tp:name-for-bindings="setRingtoneChoice">
-		   <tp:docstring>
-		   </tp:docstring>
-		   <arg type="s" name="accountID" direction="in"/>
-		   <arg type="s" name="tone" direction="in">
-			   <tp:docstring>
-			   </tp:docstring>
-		   </arg>
-	   </method>
-
 	   <method name="getAudioManager" tp:name-for-bindings="getAudioManager">
 		   <tp:docstring>
 		   </tp:docstring>
diff --git a/daemon/src/dbus/configurationmanager.cpp b/daemon/src/dbus/configurationmanager.cpp
index 632f7280e1..f248ed2720 100644
--- a/daemon/src/dbus/configurationmanager.cpp
+++ b/daemon/src/dbus/configurationmanager.cpp
@@ -462,16 +462,6 @@ int32_t ConfigurationManager::isIax2Enabled (void)
     return Manager::instance().isIax2Enabled();
 }
 
-std::string ConfigurationManager::getRingtoneChoice (const std::string& accountID)
-{
-    return Manager::instance().getRingtoneChoice (accountID);
-}
-
-void ConfigurationManager::setRingtoneChoice (const std::string& accountID, const std::string& tone)
-{
-    Manager::instance().setRingtoneChoice (accountID, tone);
-}
-
 std::string ConfigurationManager::getRecordPath (void)
 {
     return Manager::instance().getRecordPath();
diff --git a/daemon/src/dbus/configurationmanager.h b/daemon/src/dbus/configurationmanager.h
index 3360423eb3..bd0cfce84b 100644
--- a/daemon/src/dbus/configurationmanager.h
+++ b/daemon/src/dbus/configurationmanager.h
@@ -105,8 +105,6 @@ class ConfigurationManager
         bool isMd5CredentialHashing (void);
         void setMd5CredentialHashing (const bool& enabled);
         int32_t isIax2Enabled (void);
-        std::string getRingtoneChoice (const std::string& accountID);
-        void setRingtoneChoice (const std::string& accountID, const std::string& tone);
         std::string getRecordPath (void);
         void setRecordPath (const std::string& recPath);
         bool getIsAlwaysRecording(void);
diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp
index 5810bb2f32..f302ac225c 100644
--- a/daemon/src/managerimpl.cpp
+++ b/daemon/src/managerimpl.cpp
@@ -2508,51 +2508,6 @@ void ManagerImpl::ringtoneEnabled (const std::string& id)
 
 }
 
-std::string ManagerImpl::getRingtoneChoice (const std::string& id) const
-{
-
-    // retreive specified account id
-    Account *account = getAccount (id);
-
-    if (!account) {
-        _warn ("Manager: Warning: Not a valid account ID for ringone choice");
-        return "";
-    }
-
-    // we need the absolute path
-    std::string tone_name = account->getRingtonePath();
-    std::string tone_path;
-
-    if (tone_name.find (DIR_SEPARATOR_CH) == std::string::npos) {
-        // check in ringtone directory ($(PREFIX)/share/sflphone/ringtones)
-        tone_path = std::string (PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR
-                    + DIR_SEPARATOR_STR + tone_name;
-    } else {
-        // the absolute has been saved; do nothing
-        tone_path = tone_name;
-    }
-
-    _debug ("Manager: get ringtone path %s", tone_path.c_str());
-
-    return tone_path;
-}
-
-void ManagerImpl::setRingtoneChoice (const std::string& tone, const std::string& id)
-{
-    _debug ("Manager: Set ringtone path %s to account", tone.c_str());
-
-    // retreive specified account id
-    Account *account = getAccount (id);
-
-    if (!account) {
-        _warn ("Manager: Warning: Not a valid account ID for ringtone choice");
-        return;
-    }
-
-    // we save the absolute path
-    account->setRingtonePath (tone);
-}
-
 std::string ManagerImpl::getRecordPath (void) const
 {
     return audioPreference.getRecordpath();
diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h
index 14cb8984a6..5f9b5dd51c 100644
--- a/daemon/src/managerimpl.h
+++ b/daemon/src/managerimpl.h
@@ -657,18 +657,6 @@ class ManagerImpl
          */
         void ringtoneEnabled (const std::string& id);
 
-        /**
-         * Get the ringtone
-         * @return gchar* The file name selected as a ringtone
-         */
-        std::string getRingtoneChoice (const std::string& id) const;
-
-        /**
-         * Set a ringtone
-         * @param tone The file name of the ringtone
-         */
-        void setRingtoneChoice (const std::string&, const std::string& id);
-
         /**
          * Get the recording path from configuration tree
          * @return the string correspoding to the path
diff --git a/gnome/src/dbus/configurationmanager-introspec.xml b/gnome/src/dbus/configurationmanager-introspec.xml
index 7168fbf0de..7ff88b660f 100755
--- a/gnome/src/dbus/configurationmanager-introspec.xml
+++ b/gnome/src/dbus/configurationmanager-introspec.xml
@@ -272,26 +272,6 @@
 		   </arg>
 	   </method>
 
-	   <method name="getRingtoneChoice" tp:name-for-bindings="getRingtoneChoice">
-		   <tp:docstring>
-		   </tp:docstring>
-		   <arg type="s" name="accountID" direction="in"/>
-		   <arg type="s" name="tone" direction="out">
-			   <tp:docstring>
-			   </tp:docstring>
-		   </arg>
-	   </method>
-
-	   <method name="setRingtoneChoice" tp:name-for-bindings="setRingtoneChoice">
-		   <tp:docstring>
-		   </tp:docstring>
-		   <arg type="s" name="accountID" direction="in"/>
-		   <arg type="s" name="tone" direction="in">
-			   <tp:docstring>
-			   </tp:docstring>
-		   </arg>
-	   </method>
-
 	   <method name="getAudioManager" tp:name-for-bindings="getAudioManager">
 		   <tp:docstring>
 		   </tp:docstring>
diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c
index 08eb4eaa31..766d752410 100644
--- a/gnome/src/dbus/dbus.c
+++ b/gnome/src/dbus/dbus.c
@@ -1763,33 +1763,6 @@ dbus_set_echo_cancel_delay(int delay)
     }
 }
 
-gchar*
-dbus_get_ringtone_choice (const gchar *accountID)
-{
-    gchar* tone;
-    GError* error = NULL;
-    org_sflphone_SFLphone_ConfigurationManager_get_ringtone_choice (
-        configurationManagerProxy, accountID, &tone, &error);
-
-    if (error) {
-        g_error_free (error);
-    }
-
-    return tone;
-}
-
-void
-dbus_set_ringtone_choice (const gchar *accountID, const gchar* tone)
-{
-    GError* error = NULL;
-    org_sflphone_SFLphone_ConfigurationManager_set_ringtone_choice (
-        configurationManagerProxy, accountID, tone, &error);
-
-    if (error) {
-        g_error_free (error);
-    }
-}
-
 
 int
 dbus_is_iax2_enabled()
diff --git a/gnome/src/dbus/dbus.h b/gnome/src/dbus/dbus.h
index 91159ecf43..18627f1cf7 100644
--- a/gnome/src/dbus/dbus.h
+++ b/gnome/src/dbus/dbus.h
@@ -325,18 +325,6 @@ void dbus_set_echo_cancel_delay(int delay);
  */
 int dbus_is_iax2_enabled (void);
 
-/**
- * ConfigurationManager - Get the ringtone
- * @return gchar* The file name selected as a ringtone
- */
-gchar* dbus_get_ringtone_choice (const gchar *accountID);
-
-/**
- * ConfigurationManager - Set a ringtone
- * @param tone The file name of the ringtone
- */
-void dbus_set_ringtone_choice (const gchar *accountID, const gchar* tone);
-
 /**
  * ConfigurationManager - Gives the maximum number of days the user wants to have in the history
  * @return double The maximum number of days
-- 
GitLab