From 1ef30d36327d31f2e4ab7434483bcbbffb2c9025 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Mon, 21 May 2012 21:56:03 +0530 Subject: Send changes to server after receiving changes from server. --- src/sync/operasynchandler.cpp | 98 +++++++++++++++++++++---------------------- 1 file 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 = ""; } -- cgit v1.2.1