[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/pim/akonadi_kdeforum/src
From: Rudy Commenge <rudywi () gmail ! com>
Date: 2010-01-08 18:26:44
Message-ID: 1262975204.795968.22475.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1071782 by rcommenge:
source code cleaned
M +10 -46 kdeforum_resource.cpp
M +1 -1 kdeforum_resource.h
--- trunk/playground/pim/akonadi_kdeforum/src/kdeforum_resource.cpp #1071781:1071782
@@ -31,8 +31,6 @@
#include <kabc/errorhandler.h>
#include <QDebug>
#include <QUrl>
-// FindLibAttica.cmake causing compilation problems,
-// hence Attica related lines commented until clean CMakeLists.txt solution is found
#include <attica/person.h>
#include <attica/provider.h>
@@ -46,9 +44,6 @@
QDBusConnection::sessionBus().registerObject( QLatin1String( "/Settings" ),
Settings::self(), QDBusConnection::ExportAdaptors );
- // FindLibAttica.cmake causing compilation problems,
- // hence Attica related lines commented until clean CMakeLists.txt solution is \
found
-
//Initializing the Provider Manager
m_pm = new ProviderManager();
QString configPath = "/.akonadi/kde-forum/providers.xml";
@@ -92,31 +87,9 @@
// data for each item, remote ID and MIME type are enough at this stage.
// Depending on how your resource accesses the data, there are several
// different ways to tell Akonadi when you are done.
+
+ getContacts(0);
- /*
- Numero ICQ -> X-messaging/icq-All
- AOL Instant Messenger -> X-messaging/aim-All
- MSN Messenger -> X-messaging/msn-All
- Yahoo Messenger -> X-messaging/yahoo-All
- Adresse Jabber -> X-messaging/xmpp-All
- Site Internet -> url
- Localisation -> Address : ;;;;;localisation;
- Emploi -> role
- Anniversaire -> birthday
- Avatar -> photo
- Nom d'utilisateur -> nickname
- Email -> emails[0]
- real name -> Address : ;real name;;;;;
- gender -> prevoir un nouveau champ
- kde version -> prevoir un nouveau champ
- kde user since -> prevoir un nouveau champ
- os -> prevoir un nouveau champ
- country -> Address : ;;;;;;country
- biography -> note
- timezone -> timezone
- */
- getContacts();
-
}
bool KDEForum_Resource::retrieveItem( const Akonadi::Item &item, const \
QSet<QByteArray> &parts ) @@ -184,26 +157,17 @@
// of this template code to keep it simple
}
-// FindLibAttica.cmake causing compilation problems,
-// hence Attica related lines commented until clean CMakeLists.txt solution is found
-void KDEForum_Resource::getContacts()
+void KDEForum_Resource::getContacts(int page)
{
QList<Provider> proList = m_pm->providers();
- Q_FOREACH(Provider pro, proList) {
-
- // Solution 1: Use the requestPersonSearchByName() method from the Attica \
library
- // [url form not yet supported by rudy.commenge.free.fr]
- //ListJob<Person> *job = pro.requestPersonSearchByName(QString(""));
- ListJob<Person> *job = pro.requestPersonSearchByLocation(0.0, 0.0, 0.0, 0, \
1000);
-
- connect(job, SIGNAL(finished(Attica::BaseJob*)), \
SLOT(contactsReceived(Attica::BaseJob*)));
- job->start();
- }
+ // [url form not yet supported by rudy.commenge.free.fr]
+ ListJob<Person> *job = proList.last().requestPersonSearchByLocation(0.0, 0.0, 0.0, \
page, 1000); +
+ connect(job, SIGNAL(finished(Attica::BaseJob*)), \
SLOT(contactsReceived(Attica::BaseJob*))); + job->start();
}
-// FindLibAttica.cmake causing compilation problems,
-// hence Attica related lines commented until clean CMakeLists.txt solution is \
found*void KDEForum_Resource::contactsReceived(Attica::BaseJob* baseJob) void \
KDEForum_Resource::contactsReceived(Attica::BaseJob* baseJob) { ListJob<Person>* \
listJob = static_cast<ListJob<Person>*>(baseJob); Person::List persons = \
listJob->itemList(); @@ -221,9 +185,9 @@
// email
addressee.insertEmail(person.extendedAttribute(QString("email")), true);
// group
- addressee.insertCustom(QString("usergroup"),QString("group"),person.extendedAttribute(QString("group")));
+ addressee.insertCustom(QString("PHPBBForum"),QString("group"),person.extendedAttribute(QString("group")));
//language
- addressee.insertCustom(QString("language"),QString("language"),person.extendedAttribute(QString("language")));
+ addressee.insertCustom(QString("PHPBBForum"),QString("language"),person.extendedAttribute(QString("language")));
item.setRemoteId(person.extendedAttribute(QString("userid")));
--- trunk/playground/pim/akonadi_kdeforum/src/kdeforum_resource.h #1071781:1071782
@@ -35,7 +35,7 @@
~KDEForum_Resource();
// FindLibAttica.cmake causing compilation problems,
// hence Attica related lines commented until clean CMakeLists.txt solution is \
found
- void getContacts();
+ void getContacts( int page);
public Q_SLOTS:
virtual void configure( WId windowId );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic