You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.9 KiB
64 lines
1.9 KiB
15 years ago
|
/*=========================================================================
|
||
|
| 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) {
|
||
13 years ago
|
kdDebug() << "reader::run, url: " << url() << '\n';
|
||
15 years ago
|
|
||
|
response* result = carddav_get_response();
|
||
|
CARDDAV_RESPONSE res = OK;
|
||
|
|
||
13 years ago
|
kdDebug() << "getting all objects" << '\n';
|
||
15 years ago
|
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);
|
||
15 years ago
|
|
||
|
if (OK == res) {
|
||
13 years ago
|
kdDebug() << "success" << '\n';
|
||
15 years ago
|
if (result->msg) {
|
||
|
mData = result->msg;
|
||
|
} else {
|
||
13 years ago
|
kdDebug() << "empty collection" << '\n';
|
||
15 years ago
|
// empty collection
|
||
|
mData = "";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
carddav_free_response(&result);
|
||
|
|
||
|
return res;
|
||
|
}
|
||
|
|
||
|
// EOF ========================================================================
|