summaryrefslogtreecommitdiff
path: root/src/sync/operasynchandler.h
diff options
context:
space:
mode:
authorSiteshwar Vashisht <siteshwar@gmail.com>2012-05-06 00:19:13 +0530
committerAndrea Diamantini <adjam7@gmail.com>2012-05-28 00:10:30 +0200
commit701ed3ea2a7587d72601d6a6ebf6062d81b12140 (patch)
treead62806f620740941c7a4f55160a130428ab59f8 /src/sync/operasynchandler.h
parentFirst working implementation for syncing with Opera Link, code needs lots of ... (diff)
downloadrekonq-701ed3ea2a7587d72601d6a6ebf6062d81b12140.tar.xz
Refactored code and tried to stablize support for syncing with Opera Bookmarks.
Diffstat (limited to 'src/sync/operasynchandler.h')
-rw-r--r--src/sync/operasynchandler.h55
1 files changed, 23 insertions, 32 deletions
diff --git a/src/sync/operasynchandler.h b/src/sync/operasynchandler.h
index 5131425f..59aff9fb 100644
--- a/src/sync/operasynchandler.h
+++ b/src/sync/operasynchandler.h
@@ -61,17 +61,18 @@ public:
private Q_SLOTS:
void loadFinished(bool);
-/* void fetchingBookmarksFinished();
- void updateBookmarkFinished();
-*/
- void dataSlot(KIO::Job*, QByteArray);
- void resultSlot(KJob*);
- void bookmarkDataSlot(KIO::Job*, QByteArray);
- void bookmarkResultSlot(KJob*);
+ void fetchBookmarksDataSlot(KIO::Job*, QByteArray);
+ void fetchBookmarksResultSlot(KJob*);
- void bookmarkFolderDataSlot(KIO::Job*, QByteArray);
- void bookmarkFolderResultSlot(KJob*);
+ void createBookmarkDataSlot(KIO::Job*, QByteArray);
+ void createBookmarkResultSlot(KJob*);
+
+ void createBookmarkFolderDataSlot(KIO::Job*, QByteArray);
+ void createBookmarkFolderResultSlot(KJob*);
+
+ void deleteResourceDataSlot(KIO::Job*, QByteArray);
+ void deleteResourceResultSlot(KJob*);
Q_SIGNALS:
void syncBookmarksFinished(bool);
@@ -80,16 +81,16 @@ Q_SIGNALS:
private:
enum {SEND_CHANGES, RECEIVE_CHANGES} _mode;
- enum BookmarkType {BOOKMARK, BOOKMARK_FOLDER};
bool syncRelativeEnabled(bool);
void startLogin();
void getBookmarks();
+
void handleBookmark(const QDomElement &item, KBookmarkGroup root);
void handleBookmarkFolder(const QDomElement &item, KBookmarkGroup &root);
void handleResource(const QDomNode &item, KBookmarkGroup &root);
+ void handleResponse(const QDomNodeList &responseList, KBookmarkGroup &root);
-// void handleLocalBookmark(const KBookmarkGroup &root, const QDomElement &item);
void handleLocalGroup(const KBookmarkGroup &root, const QDomElement &item, QString parentId);
void addBookmarkOnServer(QString, QString, QString parent = QString());
@@ -108,35 +109,25 @@ private:
static QDomElement findOperaFolder(const QDomElement &root, const QString &name);
static QDomElement findOperaBookmark(const QDomElement &root, const KUrl &url);
-/* void checkToAddGB(const KBookmarkGroup &root, const QDomNodeList &);
- void checkToDeleteGB(BookmarkManager *, const QDomNodeList &);
- QString getChildElement(const QDomNode &node, QString name);
- void checkRequestCount();*/
+ void decreaseRequestCount();
- // QUrl _remoteBookmarksUrl;
bool _doLogin;
QWebPage _webPage;
-/* QNetworkReply *_reply;
- QSet<KUrl> _bookmarksToAdd;
- QSet<QString> _bookmarksToDelete;
- unsigned int _requestCount;*/
+
+ int _requestCount;
bool _isSyncing;
- QOAuth::Interface *qoauth;
- QOAuth::ParamMap requestParam, resultParam, authParams;
- QByteArray requestToken, requestTokenSecret;
- QByteArray authToken, authTokenSecret;
-
- QUrl url;
-// QSslSocket *socket;
- QByteArray urlParams;
- QWebView *webView;
- QByteArray xmlData;
- QMap<KJob*, QByteArray> jobToResponseMap;
- QMap<KJob*, KBookmarkGroup> jobToGroupMap;
+ QOAuth::Interface _qoauth;
+
+ QByteArray _requestToken, _requestTokenSecret;
+ QByteArray _authToken, _authTokenSecret;
+
+ QByteArray _xmlData;
+ QMap<KJob*, QByteArray> _jobToResponseMap;
+ QMap<KJob*, KBookmarkGroup> _jobToGroupMap;
};
#endif // OPERA_SYNC_HANDLER_H