summaryrefslogtreecommitdiff
path: root/src/backends/evolution/EvolutionCalendarSource.cpp
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2011-01-18 15:07:46 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2011-01-18 15:15:09 +0100
commita61b8590f39666f441c035ebd2f87f452fd7115d (patch)
treedb4af01d7612d2e1b383aca7e57143ab8dcfc560 /src/backends/evolution/EvolutionCalendarSource.cpp
parent623c1a3634ebad35a7d15dd58dd211cdb76b16f1 (diff)
backend API cleanup: removal of "const char *" return types
SyncConfig inherited "const char *" from the Funambol C++ API and some other methods used the same approach for efficient access to plain strings. However, this has the disadvantage that dynamically generated strings cannot be returned. SyncConfig had to use an awkward workaround with a local string cache. This patch converts most of that code to a normal std::string return value and removes the string cache. Out-of-tree backends must be adapted, otherwise they won't compile.
Diffstat (limited to 'src/backends/evolution/EvolutionCalendarSource.cpp')
-rw-r--r--src/backends/evolution/EvolutionCalendarSource.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backends/evolution/EvolutionCalendarSource.cpp b/src/backends/evolution/EvolutionCalendarSource.cpp
index 4cc3f4db..2fc67133 100644
--- a/src/backends/evolution/EvolutionCalendarSource.cpp
+++ b/src/backends/evolution/EvolutionCalendarSource.cpp
@@ -157,12 +157,12 @@ SyncSource::Databases EvolutionCalendarSource::getDatabases()
char *EvolutionCalendarSource::authenticate(const char *prompt,
const char *key)
{
- const char *passwd = getPassword();
+ std::string passwd = getPassword();
SE_LOG_DEBUG(this, NULL, "authentication requested, prompt \"%s\", key \"%s\" => %s",
prompt, key,
- passwd && passwd[0] ? "returning configured password" : "no password configured");
- return passwd && passwd[0] ? strdup(passwd) : NULL;
+ !passwd.empty() ? "returning configured password" : "no password configured");
+ return !passwd.empty() ? strdup(passwd.c_str()) : NULL;
}
void EvolutionCalendarSource::open()