diff options
author | Timothy Pearson <[email protected]> | 2013-01-26 13:17:50 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2013-01-26 13:17:50 -0600 |
commit | b363d2579af0a11b77e698aed2e1021c2233b644 (patch) | |
tree | f4a47b87354b7a6a3b266c8121bd8ddaeb7accaa /tderesources/carddav/reader.cpp | |
parent | 61bddfe3a7226b18c68a76124b727c736f431688 (diff) | |
download | tdepim-b363d2579af0a11b77e698aed2e1021c2233b644.tar.gz tdepim-b363d2579af0a11b77e698aed2e1021c2233b644.zip |
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'tderesources/carddav/reader.cpp')
-rw-r--r-- | tderesources/carddav/reader.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/tderesources/carddav/reader.cpp b/tderesources/carddav/reader.cpp new file mode 100644 index 000000000..62645535b --- /dev/null +++ b/tderesources/carddav/reader.cpp @@ -0,0 +1,63 @@ +/*========================================================================= +| KABCDAV +|-------------------------------------------------------------------------- +| (c) 2010 Timothy Pearson +| +| This project is released under the GNU General Public License. +| Please see the file COPYING for more details. +|-------------------------------------------------------------------------- +| Remote address book loading. + ========================================================================*/ + +/*========================================================================= +| INCLUDES + ========================================================================*/ + +#include "reader.h" +#include <kdebug.h> +#include <string> + +/*========================================================================= +| NAMESPACE + ========================================================================*/ + +using namespace KABC; + +/*========================================================================= +| METHODS + ========================================================================*/ + +void CardDavReader::cleanJob() { + CardDavJob::cleanJob(); + mData = ""; +} + +int CardDavReader::runJob(runtime_info* RT) { + kdDebug() << "reader::run, url: " << url() << '\n'; + + response* result = carddav_get_response(); + CARDDAV_RESPONSE res = OK; + + kdDebug() << "getting all objects" << '\n'; + if (getUseURI() == false) + res = carddav_getall_object(result, std::string(url().ascii()).c_str(), RT); + else + res = carddav_getall_object_by_uri(result, std::string(url().ascii()).c_str(), RT); + + if (OK == res) { + kdDebug() << "success" << '\n'; + if (result->msg) { + mData = result->msg; + } else { + kdDebug() << "empty collection" << '\n'; + // empty collection + mData = ""; + } + } + + carddav_free_response(&result); + + return res; +} + +// EOF ======================================================================== |