summaryrefslogtreecommitdiff
path: root/src/sync/operasynchandler.cpp
diff options
context:
space:
mode:
authorSiteshwar Vashisht <siteshwar@gmail.com>2012-05-21 21:56:03 +0530
committerAndrea Diamantini <adjam7@gmail.com>2012-05-28 00:10:31 +0200
commit1ef30d36327d31f2e4ab7434483bcbbffb2c9025 (patch)
treee03137b45d270ee5d782a5f4ecb8bf49ee047949 /src/sync/operasynchandler.cpp
parentRefactored code and tried to stablize support for syncing with Opera Bookmarks. (diff)
downloadrekonq-1ef30d36327d31f2e4ab7434483bcbbffb2c9025.tar.xz
Send changes to server after receiving changes from server.
Diffstat (limited to 'src/sync/operasynchandler.cpp')
-rw-r--r--src/sync/operasynchandler.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/sync/operasynchandler.cpp b/src/sync/operasynchandler.cpp
index ed25e34b..f9bf34bf 100644
--- a/src/sync/operasynchandler.cpp
+++ b/src/sync/operasynchandler.cpp
@@ -313,74 +313,74 @@ void OperaSyncHandler::fetchBookmarksResultSlot(KJob* job)
{
handleResponse(responseList, root);
emit syncStatus(Rekonq::Bookmarks, true, i18n("Done!"));
- _isSyncing = false;
+// _isSyncing = false;
+ _mode = SEND_CHANGES;
}
- else
- {
- handleResponse(responseList, root);
- QDomElement item = responseList.at(0).toElement();
- KBookmark current = root.first();
+ handleResponse(responseList, root);
- while(!current.isNull())
+ QDomElement item = responseList.at(0).toElement();
+ KBookmark current = root.first();
+
+ while(!current.isNull())
+ {
+ if (current.isGroup())
{
- if (current.isGroup())
- {
- QString groupName = current.fullText();
- QDomElement child = findOperaFolder(item, groupName);
+ QString groupName = current.fullText();
+ QDomElement child = findOperaFolder(item, groupName);
- if (child.isNull())
- {
- //Add Opera group here
- kDebug() << "Add group " << groupName;
- KJob *job = addBookmarkFolderOnServer(current.fullText());
- _jobToGroupMap.insert(job, current.toGroup());
- }
- else
- {
- kDebug() << "Handling group " << groupName;
- QDomElement grandChild = getChildElement(child, "children");
-
- QString id = getChildString(child, "id");
-
- kDebug() << grandChild.tagName() << id;
-
- if (grandChild.isNull())
- {
- kDebug() << "Grand child is null";
- handleLocalGroup(current.toGroup(), grandChild, id);
- }
- else{
- //kDebug() << "Grand child " << getTitleFromResourceProperties(grandChild);
- handleLocalGroup(current.toGroup(), grandChild, id);
- }
- }
+ if (child.isNull())
+ {
+ //Add Opera group here
+ kDebug() << "Add group " << groupName;
+ KJob *job = addBookmarkFolderOnServer(current.fullText());
+ _jobToGroupMap.insert(job, current.toGroup());
}
-
else
{
- KUrl url = current.url();
+ kDebug() << "Handling group " << groupName;
+ QDomElement grandChild = getChildElement(child, "children");
+
+ QString id = getChildString(child, "id");
- QDomElement child = findOperaBookmark(item, url);
+ kDebug() << grandChild.tagName() << id;
- if (child.isNull())
+ if (grandChild.isNull())
{
- //Add bookmark on server
- kDebug() << "Add bookmark :" << url;
- addBookmarkOnServer(current.fullText(), current.url().url());
+ kDebug() << "Grand child is null";
+ handleLocalGroup(current.toGroup(), grandChild, id);
}
- else
- {
- kDebug() << "Bookmark exists :" << url;
+ else{
+ //kDebug() << "Grand child " << getTitleFromResourceProperties(grandChild);
+ handleLocalGroup(current.toGroup(), grandChild, id);
}
}
+ }
- current = root.next(current);
+ else
+ {
+ KUrl url = current.url();
+
+ QDomElement child = findOperaBookmark(item, url);
+
+ if (child.isNull())
+ {
+ //Add bookmark on server
+ kDebug() << "Add bookmark :" << url;
+ addBookmarkOnServer(current.fullText(), current.url().url());
+ }
+ else
+ {
+ kDebug() << "Bookmark exists :" << url;
+ }
}
- decreaseRequestCount();
+ current = root.next(current);
}
+ decreaseRequestCount();
+
+
_xmlData = "";
}