[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/pim/akonadi/exchange/connector
From: Shaheed Haque <srhaque () theiet ! org>
Date: 2012-02-25 16:58:01
Message-ID: 20120225165801.B28A4AC896 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1282211 by shaheed:
Optimise the passing of parentId into fetchCollections.
M +14 -4 mapiconnector2.cpp
M +3 -3 mapiconnector2.h
M +3 -4 mapiresource.cpp
M +1 -1 mapiresource.h
--- trunk/playground/pim/akonadi/exchange/connector/mapiconnector2.cpp \
#1282210:1282211 @@ -272,6 +272,16 @@
}
id->first = 0;
id->m_provider = MapiId::NSPI;
+#if 0
+ if (MAPI_E_SUCCESS != SetMAPIDebugLevel(m_context, 9)) {
+ error() << "cannot set debug level" << mapiError();
+ return false;
+ }
+ if (MAPI_E_SUCCESS != SetMAPIDumpData(m_context, true)) {
+ error() << "cannot set dump data" << mapiError();
+ return false;
+ }
+#endif
return true;
}
@@ -394,7 +404,7 @@
return true;
}
-MapiFolder::MapiFolder(MapiConnector2 *connection, const char *tallocName, MapiId \
&id) : +MapiFolder::MapiFolder(MapiConnector2 *connection, const char *tallocName, \
const MapiId &id) : MapiObject(connection, tallocName, id)
{
mapi_object_init(&m_contents);
@@ -494,7 +504,7 @@
bool MapiFolder::childrenPull(QList<MapiItem *> &children)
{
// Retrieve folder's content table
- if (MAPI_E_SUCCESS != GetContentsTable(&m_object, &m_contents, 0, NULL)) {
+ if (MAPI_E_SUCCESS != GetContentsTable(&m_object, &m_contents, \
TableFlags_UseUnicode, NULL)) { error() << "cannot get content table" << \
mapiError(); return false;
}
@@ -635,7 +645,7 @@
return m_modified;
}
-MapiMessage::MapiMessage(MapiConnector2 *connection, const char *tallocName, MapiId \
&id) : +MapiMessage::MapiMessage(MapiConnector2 *connection, const char *tallocName, \
const MapiId &id) : MapiObject(connection, tallocName, id)
{
}
@@ -1202,7 +1212,7 @@
return m_recipients;
}
-MapiObject::MapiObject(MapiConnector2 *connection, const char *tallocName, MapiId \
&id) : +MapiObject::MapiObject(MapiConnector2 *connection, const char *tallocName, \
const MapiId &id) : TallocContext(tallocName),
m_connection(connection),
m_id(id),
--- trunk/playground/pim/akonadi/exchange/connector/mapiconnector2.h #1282210:1282211
@@ -496,7 +496,7 @@
class MapiObject : protected TallocContext
{
public:
- MapiObject(MapiConnector2 *connection, const char *tallocName, MapiId &id);
+ MapiObject(MapiConnector2 *connection, const char *tallocName, const MapiId &id);
virtual ~MapiObject();
@@ -636,7 +636,7 @@
class MapiFolder : public MapiObject
{
public:
- MapiFolder(MapiConnector2 *connection, const char *tallocName, MapiId &id);
+ MapiFolder(MapiConnector2 *connection, const char *tallocName, const MapiId &id);
virtual ~MapiFolder();
@@ -679,7 +679,7 @@
class MapiMessage : public MapiObject
{
public:
- MapiMessage(MapiConnector2 *connection, const char *tallocName, MapiId &id);
+ MapiMessage(MapiConnector2 *connection, const char *tallocName, const MapiId &id);
virtual bool open();
--- trunk/playground/pim/akonadi/exchange/connector/mapiresource.cpp #1282210:1282211
@@ -126,15 +126,14 @@
root.setContentMimeTypes(contentTypes);
root.setRights(Akonadi::Collection::ReadOnly);
collections.append(root);
- fetchCollections(root.name(), root, collections);
+ fetchCollections(root.name(), rootId, root, collections);
emit status(Running, i18n("fetched collections: %1").arg(collections.size()));
}
-void MapiResource::fetchCollections(const QString &path, const Collection &parent, \
Akonadi::Collection::List &collections) +void MapiResource::fetchCollections(const \
QString &path, const MapiId &parentId, const Collection &parent, \
Akonadi::Collection::List &collections) {
kDebug() << "fetch collections in:" << path;
- MapiId parentId(parent.remoteId());
kError() << "parent folder:" << parentId.toString();
MapiFolder parentFolder(m_connection, "MapiResource::retrieveCollection", \
parentId); if (!parentFolder.open()) {
@@ -165,7 +164,7 @@
// Recurse down...
QString currentPath = path + separator + child.name();
- fetchCollections(currentPath, child, collections);
+ fetchCollections(currentPath, data->id(), child, collections);
delete data;
}
}
--- trunk/playground/pim/akonadi/exchange/connector/mapiresource.h #1282210:1282211
@@ -93,7 +93,7 @@
* Recurse through a hierarchy of Exchange folders which match the
* given filter.
*/
- void fetchCollections(const QString &path, const Akonadi::Collection &parent, \
Akonadi::Collection::List &collections); + void fetchCollections(const QString &path, \
const MapiId &parentId, const Akonadi::Collection &parent, Akonadi::Collection::List \
&collections);
/**
* Consistent error handling for task-based routines.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic