summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-05-29 00:13:34 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-05-29 00:13:34 +0200
commitd5fd357af9f14fb61011d5dbebd9a9fb7f11824a (patch)
treee8d090a1ae565ed617b0370f9f6ffd841cf1330b
parentFixed some warnings. (diff)
downloadrekonq-d5fd357af9f14fb61011d5dbebd9a9fb7f11824a.tar.xz
Let Opera sync handler being optional
-rw-r--r--CMakeLists.txt95
-rw-r--r--cmake/FindQtOAuth.cmake (renamed from FindQtOAuth.cmake)0
-rw-r--r--config-qca2.h.cmake1
-rw-r--r--config-qtoauth.h.cmake1
-rw-r--r--config-version.h.cmake (renamed from version.h.cmake)0
-rw-r--r--src/CMakeLists.txt38
-rw-r--r--src/bookmarks/bookmarkowner.cpp2
-rw-r--r--src/bookmarks/bookmarkowner.h2
-rw-r--r--src/bookmarks/bookmarkscontextmenu.cpp2
-rw-r--r--src/main.cpp2
-rw-r--r--src/sync/operasynchandler.cpp62
-rw-r--r--src/sync/synccheckwidget.cpp22
-rw-r--r--src/sync/syncdatawidget.cpp8
-rw-r--r--src/sync/synchosttypewidget.cpp14
-rw-r--r--src/sync/syncmanager.cpp9
-rw-r--r--src/sync/syncoperasettingswidget.cpp27
-rw-r--r--src/sync/syncoperasettingswidget.h4
-rw-r--r--src/urlbar/bookmarkwidget.cpp2
-rw-r--r--src/urlbar/bookmarkwidget.h2
-rw-r--r--src/urlbar/newresourcedialog.h24
-rw-r--r--src/urlbar/resourcelinkdialog.h48
21 files changed, 243 insertions, 122 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d24751b..ba9c3c8c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@ PROJECT( rekonq )
# rekonq info
SET(REKONQ_VERSION "0.9.60" )
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h )
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-version.h )
SET(REKONQ_SITE "http://rekonq.kde.org")
@@ -18,9 +18,11 @@ SET(REKONQ_SITE "http://rekonq.kde.org")
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.4)
+
+SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
+
# ==================================================================================
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH})
FIND_PACKAGE(Qt4 4.8.0 COMPONENTS QtCore QtGui QtNetwork QtWebKit REQUIRED)
@@ -40,19 +42,33 @@ INCLUDE(MacroOptionalFindPackage)
INCLUDE(FindPackageHandleStandardArgs)
INCLUDE(KDE4Defaults)
INCLUDE(MacroLibrary)
+
ADD_DEFINITIONS(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
+
# ==================================================================================
# optional nepomuk requirements
MACRO_OPTIONAL_FIND_PACKAGE(Nepomuk)
MACRO_BOOL_TO_01(Nepomuk_FOUND HAVE_NEPOMUK)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-nepomuk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-nepomuk.h )
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-nepomuk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-nepomuk.h )
+
+
+# ==================================================================================
+# optional QCA2 & QtOAuth requirements
+
+MACRO_OPTIONAL_FIND_PACKAGE(QCA2)
+MACRO_BOOL_TO_01(QCA2_FOUND HAVE_QCA2)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-qca2.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-qca2.h )
+
+
+MACRO_OPTIONAL_FIND_PACKAGE(QtOAuth)
+MACRO_BOOL_TO_01(QTOAUTH_FOUND HAVE_QTOAUTH)
-FIND_PACKAGE(QCA2 REQUIRED)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-qtoauth.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-qtoauth.h )
-FIND_PACKAGE(QtOAuth REQUIRED)
# ==================================================================================
# Log messages
@@ -98,23 +114,6 @@ ELSE(KDE4_FOUND)
MESSAGE(STATUS "")
ENDIF(KDE4_FOUND)
-
-# ----------------------- Optional Deps --------------------------------------
-MESSAGE(STATUS "")
-MESSAGE(STATUS "")
-MESSAGE(STATUS " rekonq ${REKONQ_VERSION} OPTIONAL dependencies")
-MESSAGE(STATUS "")
-
-# Nepomuk
-
-IF(HAVE_NEPOMUK)
- MESSAGE(STATUS " Nepomuk Libraries..................... YES")
- MESSAGE(STATUS " Rekonq will be compiled with support for bookmarks nepomuk tagging")
-ELSE(HAVE_NEPOMUK)
- MESSAGE(STATUS " Nepomuk Libraries..................... NO")
- MESSAGE(STATUS " Rekonq will be compiled WITHOUT support for bookmarks tagging")
-ENDIF(HAVE_NEPOMUK)
-
##### FINAL RESULTS #####
# create suspance..
@@ -129,9 +128,55 @@ ELSE(QT4_FOUND AND KDE4_FOUND)
SET(REKONQ_CAN_BE_COMPILED false)
ENDIF(QT4_FOUND AND KDE4_FOUND)
-MESSAGE(STATUS "")
-MESSAGE(STATUS "-----------------------------------------------------------------------")
-MESSAGE(STATUS "")
+# ----------------------- Optional Deps --------------------------------------
+
+IF(REKONQ_CAN_BE_COMPILED)
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS " ----- Optional Features")
+ MESSAGE(STATUS "")
+
+ # Nepomuk
+
+ IF(HAVE_NEPOMUK)
+ MESSAGE(STATUS " Nepomuk Libraries..................... YES")
+ MESSAGE(STATUS " Rekonq will be compiled with support for bookmarks nepomuk tagging")
+ ELSE(HAVE_NEPOMUK)
+ MESSAGE(STATUS " Nepomuk Libraries..................... NO")
+ MESSAGE(STATUS " Rekonq will be compiled WITHOUT support for bookmarks tagging")
+ ENDIF(HAVE_NEPOMUK)
+
+ MESSAGE(STATUS "")
+
+ # QCA2
+
+ IF(HAVE_QCA2)
+ MESSAGE(STATUS " QCA2 Libraries........................ YES")
+ ELSE(HAVE_QCA2)
+ MESSAGE(STATUS " QCA2 Libraries........................ NO")
+ ENDIF(HAVE_QCA2)
+
+ # QTOAUTH
+
+ IF(HAVE_QTOAUTH)
+ MESSAGE(STATUS " QtOAuth Libraries..................... YES")
+ ELSE(HAVE_QTOAUTH)
+ MESSAGE(STATUS " QtOAuth Libraries..................... NO")
+ ENDIF(HAVE_QTOAUTH)
+
+
+ IF(HAVE_QCA2 AND HAVE_QTOAUTH)
+ MESSAGE(STATUS " Rekonq will be compiled with support for opera sync handler")
+ ELSE(HAVE_QCA2 AND HAVE_QTOAUTH)
+ MESSAGE(STATUS " Rekonq will be compiled WITHOUT support for opera sync handler")
+ ENDIF(HAVE_QCA2 AND HAVE_QTOAUTH)
+
+
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "-----------------------------------------------------------------------")
+ MESSAGE(STATUS "")
+
+ENDIF(REKONQ_CAN_BE_COMPILED)
# ===============================================================================
diff --git a/FindQtOAuth.cmake b/cmake/FindQtOAuth.cmake
index a9578ea2..a9578ea2 100644
--- a/FindQtOAuth.cmake
+++ b/cmake/FindQtOAuth.cmake
diff --git a/config-qca2.h.cmake b/config-qca2.h.cmake
new file mode 100644
index 00000000..db503b24
--- /dev/null
+++ b/config-qca2.h.cmake
@@ -0,0 +1 @@
+#cmakedefine HAVE_QCA2
diff --git a/config-qtoauth.h.cmake b/config-qtoauth.h.cmake
new file mode 100644
index 00000000..05a5b2b9
--- /dev/null
+++ b/config-qtoauth.h.cmake
@@ -0,0 +1 @@
+#cmakedefine HAVE_QTOAUTH
diff --git a/version.h.cmake b/config-version.h.cmake
index cbc6492b..cbc6492b 100644
--- a/version.h.cmake
+++ b/config-version.h.cmake
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 763f02d7..c7945398 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -101,7 +101,6 @@ SET( rekonq_KDEINIT_SRCS
#----------------------------------------
sync/ftpsynchandler.cpp
sync/googlesynchandler.cpp
- sync/operasynchandler.cpp
sync/syncassistant.cpp
sync/synchandler.cpp
sync/syncmanager.cpp
@@ -114,6 +113,7 @@ SET( rekonq_KDEINIT_SRCS
sync/syncoperasettingswidget.cpp
)
+# Nepomuk OPTIONAL src files
IF(HAVE_NEPOMUK)
SET( rekonq_KDEINIT_SRCS
${rekonq_KDEINIT_SRCS}
@@ -122,6 +122,16 @@ IF(HAVE_NEPOMUK)
)
ENDIF(HAVE_NEPOMUK)
+
+# Opera sync optional src files
+IF(HAVE_QCA2 AND HAVE_QTOAUTH)
+ SET( rekonq_KDEINIT_SRCS
+ ${rekonq_KDEINIT_SRCS}
+ sync/operasynchandler.cpp
+ )
+ENDIF(HAVE_QCA2 AND HAVE_QTOAUTH)
+
+
KDE4_ADD_UI_FILES( rekonq_KDEINIT_SRCS
settings/settings_general.ui
settings/settings_tabs.ui
@@ -168,24 +178,33 @@ INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${KDE4_INCLUDES}
${QT4_INCLUDES}
- ${QCA2_INCLUDE_DIR}
- ${QTOAUTH_INCLUDE_DIR}
)
+# Nepomuk optional include directories
IF(HAVE_NEPOMUK)
INCLUDE_DIRECTORIES(${SOPRANO_INCLUDE_DIR}
${NEPOMUK_INCLUDE_DIR}
)
ENDIF(HAVE_NEPOMUK)
+# Opera sync optional include directories
+IF(HAVE_QCA2 AND HAVE_QTOAUTH)
+ INCLUDE_DIRECTORIES(${QCA2_INCLUDE_DIR}
+ ${QTOAUTH_INCLUDE_DIR}
+ )
+ENDIF(HAVE_QCA2 AND HAVE_QTOAUTH)
+
+
### -------------- ADDING DEFINITIONS...
ADD_DEFINITIONS ( ${KDE4_DEFINITIONS} )
+
### -------------- ADDING APPLICATION ICON...
KDE4_ADD_APP_ICON( rekonq_KDEINIT_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../icons/hi*-app-rekonq.png )
+
### --------------- ADDING EXECUTABLE...
KDE4_ADD_KDEINIT_EXECUTABLE( rekonq ${rekonq_KDEINIT_SRCS} main.cpp )
@@ -202,10 +221,10 @@ TARGET_LINK_LIBRARIES ( kdeinit_rekonq
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${KDE4_KPARTS_LIBS}
- ${QCA2_LIBRARY}
- ${QTOAUTH_LIBRARY}
)
+
+# Nepomuk optional target link libraries
IF(HAVE_NEPOMUK)
TARGET_LINK_LIBRARIES( kdeinit_rekonq
${NEPOMUK_LIBRARIES}
@@ -214,6 +233,15 @@ IF(HAVE_NEPOMUK)
)
ENDIF(HAVE_NEPOMUK)
+# Opera sync optional link libraries
+IF(HAVE_QCA2 AND HAVE_QTOAUTH)
+ TARGET_LINK_LIBRARIES( kdeinit_rekonq
+ ${QCA2_LIBRARY}
+ ${QTOAUTH_LIBRARY}
+ )
+ENDIF(HAVE_QCA2 AND HAVE_QTOAUTH)
+
+
### ------------ INSTALL FILES...
INSTALL( TARGETS rekonq ${INSTALL_TARGETS_DEFAULT_ARGS} )
diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp
index 3aa3b8d3..430ec5c3 100644
--- a/src/bookmarks/bookmarkowner.cpp
+++ b/src/bookmarks/bookmarkowner.cpp
@@ -47,7 +47,7 @@
#include <QClipboard>
// Nepomuk config include
-#include "../config-nepomuk.h"
+#include "config-nepomuk.h"
#ifdef HAVE_NEPOMUK
// Local Nepomuk Includes
diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h
index 01a5c480..f0b238b9 100644
--- a/src/bookmarks/bookmarkowner.h
+++ b/src/bookmarks/bookmarkowner.h
@@ -35,7 +35,7 @@
#include "rekonq_defines.h"
// Nepomuk config include
-#include "../config-nepomuk.h"
+#include "config-nepomuk.h"
// KDE Includes
#include <KAction>
diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp
index cd2ab5c7..65f7994f 100644
--- a/src/bookmarks/bookmarkscontextmenu.cpp
+++ b/src/bookmarks/bookmarkscontextmenu.cpp
@@ -29,7 +29,7 @@
#include "bookmarkscontextmenu.h"
// Nepomuk config include
-#include "../config-nepomuk.h"
+#include "config-nepomuk.h"
// Local Includes
#include "bookmarkowner.h"
diff --git a/src/main.cpp b/src/main.cpp
index b73dbc92..7a23172c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -25,7 +25,7 @@
// version include
-#include "../version.h"
+#include "config-version.h"
// Local Includes
#include "application.h"
diff --git a/src/sync/operasynchandler.cpp b/src/sync/operasynchandler.cpp
index 25656b10..50d671f8 100644
--- a/src/sync/operasynchandler.cpp
+++ b/src/sync/operasynchandler.cpp
@@ -183,7 +183,7 @@ void OperaSyncHandler::startLogin()
kDebug() << QUrl("https://auth.opera.com/service/oauth/authorize?oauth_token=" + QString(_requestToken) + "&oauth_callback=oob");
- _webPage.mainFrame()->load(QUrl("https://auth.opera.com/service/oauth/authorize?oauth_token=" + QString(_requestToken) + "&oauth_callback=oob" ));
+ _webPage.mainFrame()->load(QUrl("https://auth.opera.com/service/oauth/authorize?oauth_token=" + QString(_requestToken) + "&oauth_callback=oob"));
}
else
{
@@ -199,7 +199,7 @@ void OperaSyncHandler::loadFinished(bool ok)
if (!ok)
{
kDebug() << "Error loading: " << _webPage.mainFrame()->url();
- emit syncStatus(Rekonq::Bookmarks, false, i18n( "Error loading: " + _webPage.mainFrame()->url().toEncoded()));
+ emit syncStatus(Rekonq::Bookmarks, false, i18n("Error loading: " + _webPage.mainFrame()->url().toEncoded()));
_isSyncing = false;
return;
@@ -350,7 +350,7 @@ void OperaSyncHandler::fetchBookmarksResultSlot(KJob* job)
QDomElement item = responseList.at(0).toElement();
KBookmark current = root.first();
- while(!current.isNull())
+ while (!current.isNull())
{
if (current.isGroup())
{
@@ -377,7 +377,8 @@ void OperaSyncHandler::fetchBookmarksResultSlot(KJob* job)
kDebug() << "Grand child is null";
handleLocalGroup(current.toGroup(), grandChild, id);
}
- else{
+ else
+ {
handleLocalGroup(current.toGroup(), grandChild, id);
}
}
@@ -395,11 +396,11 @@ void OperaSyncHandler::fetchBookmarksResultSlot(KJob* job)
kDebug() << "Add bookmark :" << url;
addBookmarkOnServer(current.fullText(), current.url().url());
}
-/* else
- {
- kDebug() << "Bookmark exists :" << url;
- }
-*/
+ /* else
+ {
+ kDebug() << "Bookmark exists :" << url;
+ }
+ */
}
current = root.next(current);
@@ -591,7 +592,8 @@ void OperaSyncHandler::handleResponse(const QDomNodeList &responseList, KBookmar
{
handleResource(item, root);
item = item.nextSibling();
- }while (!item.isNull());
+ }
+ while (!item.isNull());
}
}
@@ -600,7 +602,7 @@ void OperaSyncHandler::handleLocalGroup(const KBookmarkGroup &root, const QDomEl
{
KBookmark current = root.first();
- while(!current.isNull())
+ while (!current.isNull())
{
if (current.isGroup())
{
@@ -641,11 +643,11 @@ void OperaSyncHandler::handleLocalGroup(const KBookmarkGroup &root, const QDomEl
addBookmarkOnServer(current.fullText(), current.url().url(), parentId);
}
-/* else
- {
- kDebug() << "Bookmark exists :" << url;
- }
-*/
+ /* else
+ {
+ kDebug() << "Bookmark exists :" << url;
+ }
+ */
}
current = root.next(current);
@@ -657,8 +659,8 @@ void OperaSyncHandler::addBookmarkOnServer(QString title, QString url, QString p
{
QOAuth::ParamMap requestMap;
requestMap.insert("api_output", "xml");
- requestMap.insert("api_method","create");
- requestMap.insert("item_type","bookmark");
+ requestMap.insert("api_method", "create");
+ requestMap.insert("item_type", "bookmark");
requestMap.insert("title", QUrl::toPercentEncoding(title.toUtf8()));
requestMap.insert("uri", QUrl::toPercentEncoding(url.toUtf8()));
@@ -671,8 +673,8 @@ void OperaSyncHandler::addBookmarkOnServer(QString title, QString url, QString p
QByteArray postData = _qoauth.createParametersString(requestUrl, QOAuth::POST, _authToken, _authTokenSecret, QOAuth::HMAC_SHA1, requestMap, QOAuth::ParseForRequestContent);
- KIO::TransferJob *job = KIO::http_post( KUrl(requestUrl), postData, KIO::HideProgressInfo );
- job->addMetaData("Content-Type", "application/x-www-form-urlencoded" );
+ KIO::TransferJob *job = KIO::http_post(KUrl(requestUrl), postData, KIO::HideProgressInfo);
+ job->addMetaData("Content-Type", "application/x-www-form-urlencoded");
connect(job, SIGNAL(result(KJob*)), this, SLOT(createBookmarkResultSlot(KJob*)));
connect(job, SIGNAL(data(KIO::Job*, QByteArray)), this, SLOT(createBookmarkDataSlot(KIO::Job*, QByteArray)));
@@ -685,8 +687,8 @@ KJob *OperaSyncHandler::addBookmarkFolderOnServer(QString title, QString parent)
{
QOAuth::ParamMap requestMap;
requestMap.insert("api_output", "xml");
- requestMap.insert("api_method","create");
- requestMap.insert("item_type","bookmark_folder");
+ requestMap.insert("api_method", "create");
+ requestMap.insert("item_type", "bookmark_folder");
requestMap.insert("title", QUrl::toPercentEncoding(title.toUtf8()));
QByteArray requestUrl = "https://link.api.opera.com/rest/bookmark/";
@@ -697,8 +699,8 @@ KJob *OperaSyncHandler::addBookmarkFolderOnServer(QString title, QString parent)
QByteArray postData = _qoauth.createParametersString(requestUrl, QOAuth::POST, _authToken, _authTokenSecret, QOAuth::HMAC_SHA1, requestMap, QOAuth::ParseForRequestContent);
- KIO::TransferJob *job = KIO::http_post( KUrl(requestUrl), postData, KIO::HideProgressInfo );
- job->addMetaData("Content-Type", "application/x-www-form-urlencoded" );
+ KIO::TransferJob *job = KIO::http_post(KUrl(requestUrl), postData, KIO::HideProgressInfo);
+ job->addMetaData("Content-Type", "application/x-www-form-urlencoded");
_jobToResponseMap.insert(job, "");
connect(job, SIGNAL(result(KJob*)), this, SLOT(createBookmarkFolderResultSlot(KJob*)));
@@ -712,7 +714,7 @@ KJob *OperaSyncHandler::addBookmarkFolderOnServer(QString title, QString parent)
void OperaSyncHandler::deleteResourceOnServer(QString id)
{
QOAuth::ParamMap requestMap;
- requestMap.insert("api_method","delete");
+ requestMap.insert("api_method", "delete");
QByteArray requestUrl = "https://link.api.opera.com/rest/bookmark/";
@@ -727,8 +729,8 @@ void OperaSyncHandler::deleteResourceOnServer(QString id)
kDebug() << "Deleting Resource : " << id;
- KIO::TransferJob *job = KIO::http_post( KUrl(requestUrl), postData, KIO::HideProgressInfo );
- job->addMetaData("Content-Type", "application/x-www-form-urlencoded" );
+ KIO::TransferJob *job = KIO::http_post(KUrl(requestUrl), postData, KIO::HideProgressInfo);
+ job->addMetaData("Content-Type", "application/x-www-form-urlencoded");
connect(job, SIGNAL(result(KJob*)), this, SLOT(deleteResourceResultSlot(KJob*)));
connect(job, SIGNAL(data(KIO::Job*, QByteArray)), this, SLOT(deleteResourceDataSlot(KIO::Job*, QByteArray)));
@@ -791,7 +793,7 @@ QString OperaSyncHandler::getChildString(const QDomNode &node, const QString &na
{
QDomNodeList nodes = node.childNodes();
- for (int j=0; j<nodes.size(); ++j)
+ for (int j = 0; j < nodes.size(); ++j)
{
QDomElement element = nodes.at(j).toElement();
@@ -808,7 +810,7 @@ QDomElement OperaSyncHandler::getChildElement(const QDomNode &node, const QStrin
{
QDomNodeList nodes = node.childNodes();
- for (int j=0; j<nodes.size(); ++j)
+ for (int j = 0; j < nodes.size(); ++j)
{
QDomElement element = nodes.at(j).toElement();
@@ -874,7 +876,7 @@ QDomElement OperaSyncHandler::findOperaBookmark(const QDomElement &root, const K
{
QDomElement current = root.firstChild().toElement();
- while (!current.isNull() )
+ while (!current.isNull())
{
if ((getChildString(current, "item_type") == "bookmark") && KUrl(getUrlFromResourceProperties(current)) == url)
break;
diff --git a/src/sync/synccheckwidget.cpp b/src/sync/synccheckwidget.cpp
index 7d44c580..4874377f 100644
--- a/src/sync/synccheckwidget.cpp
+++ b/src/sync/synccheckwidget.cpp
@@ -92,6 +92,22 @@ void SyncCheckWidget::initializePage()
QString loadingGitPath = KStandardDirs::locate("appdata" , "pics/loading.mng");
+ // Now, load syncManager settings...
+ rApp->syncManager()->loadSettings();
+
+ SyncHandler *h = rApp->syncManager()->handler();
+
+ if (!h)
+ {
+ bkLabel->setPixmap(notSyncedIcon.pixmap(16));
+ hsLabel->setPixmap(notSyncedIcon.pixmap(16));
+ psLabel->setPixmap(notSyncedIcon.pixmap(16));
+ return;
+ }
+
+ connect(h, SIGNAL(syncStatus(Rekonq::SyncData, bool, QString)), this, SLOT(updateWidget(Rekonq::SyncData, bool, QString)));
+
+
// bookmarks
if (ReKonfig::syncBookmarks())
{
@@ -130,12 +146,6 @@ void SyncCheckWidget::initializePage()
{
psLabel->setPixmap(notSyncedIcon.pixmap(16));
}
-
- // Now, load syncManager settings...
- rApp->syncManager()->loadSettings();
-
- SyncHandler *h = rApp->syncManager()->handler();
- connect(h, SIGNAL(syncStatus(Rekonq::SyncData, bool, QString)), this, SLOT(updateWidget(Rekonq::SyncData, bool, QString)));
}
diff --git a/src/sync/syncdatawidget.cpp b/src/sync/syncdatawidget.cpp
index 9b415ad2..635c6239 100644
--- a/src/sync/syncdatawidget.cpp
+++ b/src/sync/syncdatawidget.cpp
@@ -49,17 +49,17 @@ void SyncDataWidget::initializePage()
kcfg_syncHistory->setDisabled(true);
kcfg_syncPasswords->setDisabled(true);
- switch(ReKonfig::syncType())
+ switch (ReKonfig::syncType())
{
- //Ftp Sync Handler
+ //Ftp Sync Handler
case 0:
kcfg_syncBookmarks->setEnabled(true);
kcfg_syncHistory->setEnabled(true);
kcfg_syncPasswords->setEnabled(true);
break;
- //Google Sync Handler
+ //Google Sync Handler
case 1:
- //Opera Sync Handler
+ //Opera Sync Handler
case 2:
kcfg_syncBookmarks->setEnabled(true);
break;
diff --git a/src/sync/synchosttypewidget.cpp b/src/sync/synchosttypewidget.cpp
index cece6e2c..289f5e5e 100644
--- a/src/sync/synchosttypewidget.cpp
+++ b/src/sync/synchosttypewidget.cpp
@@ -45,9 +45,9 @@ SyncHostTypeWidget::SyncHostTypeWidget(QWidget *parent)
kcfg_syncEnabled->setChecked(ReKonfig::syncEnabled());
if (ReKonfig::syncType() == 0)
ftpRadioButton->setChecked(true);
- else if(ReKonfig::syncType() == 1)
+ else if (ReKonfig::syncType() == 1)
googleRadioButton->setChecked(true);
- else if(ReKonfig::syncType() == 2)
+ else if (ReKonfig::syncType() == 2)
operaRadioButton->setChecked(true);
else
nullRadioButton->setChecked(true);
@@ -83,11 +83,11 @@ int SyncHostTypeWidget::nextId() const
ReKonfig::setSyncType(0);
return SyncAssistant::Page_FTP_Settings;
}
- else if (googleRadioButton->isChecked())
- {
- ReKonfig::setSyncType(1);
- return SyncAssistant::Page_Google_Settings;
- }
+ else if (googleRadioButton->isChecked())
+ {
+ ReKonfig::setSyncType(1);
+ return SyncAssistant::Page_Google_Settings;
+ }
else if (operaRadioButton->isChecked())
{
ReKonfig::setSyncType(2);
diff --git a/src/sync/syncmanager.cpp b/src/sync/syncmanager.cpp
index 67b23054..78cc4b4e 100644
--- a/src/sync/syncmanager.cpp
+++ b/src/sync/syncmanager.cpp
@@ -31,6 +31,10 @@
// Auto Includes
#include "rekonq.h"
+// Config Includes
+#include "config-qca2.h"
+#include "config-qtoauth.h"
+
// Local Includes
#include "application.h"
#include "bookmarkmanager.h"
@@ -39,7 +43,10 @@
#include "syncassistant.h"
#include "ftpsynchandler.h"
#include "googlesynchandler.h"
+
+#if (defined HAVE_QCA2 && defined HAVE_QTOAUTH)
#include "operasynchandler.h"
+#endif
// KDE Includes
#include <klocalizedstring.h>
@@ -84,9 +91,11 @@ void SyncManager::loadSettings()
case 1:
_syncImplementation = new GoogleSyncHandler(this);
break;
+#if (defined HAVE_QCA2 && defined HAVE_QTOAUTH)
case 2:
_syncImplementation = new OperaSyncHandler(this);
break;
+#endif
default:
kDebug() << "/dev/null";
return;
diff --git a/src/sync/syncoperasettingswidget.cpp b/src/sync/syncoperasettingswidget.cpp
index 7cef9e24..a45ae70c 100644
--- a/src/sync/syncoperasettingswidget.cpp
+++ b/src/sync/syncoperasettingswidget.cpp
@@ -1,8 +1,9 @@
/* ============================================================
*
* This file is a part of the rekonq project
+*
* Copyright (C) 2012 by Siteshwar Vashisht <siteshwar at gmail dot com>
-* Copyright (C) 2011 by Andrea Diamantini <adjam7 at gmail dot com>
+* Copyright (C) 2011-2012 by Andrea Diamantini <adjam7 at gmail dot com>
*
*
* This program is free software; you can redistribute it and/or
@@ -31,6 +32,10 @@
// Auto Includes
#include "rekonq.h"
+// Config Includes
+#include "config-qca2.h"
+#include "config-qtoauth.h"
+
// Local Includes
#include "syncassistant.h"
@@ -39,15 +44,29 @@ SyncOperaSettingsWidget::SyncOperaSettingsWidget(QWidget *parent)
: QWizardPage(parent)
{
setupUi(this);
+
+#if (defined HAVE_QCA2 && defined HAVE_QTOAUTH)
+
kcfg_syncUser->setText(ReKonfig::syncUser());
kcfg_syncPass->setText(ReKonfig::syncPass());
kcfg_syncPass->setPasswordMode(true);
+
+#else
+
+ kcfg_syncUser->setEnabled(false);
+ kcfg_syncPass->setEnabled(false);
+
+ infoLabel->setText(i18n("Rekonq has been compiled without support for Opera Sync"));
+
+#endif
}
int SyncOperaSettingsWidget::nextId() const
{
+#if (defined HAVE_QCA2 && defined HAVE_QTOAUTH)
+
// save
ReKonfig::setSyncHost("http://link.opera.com/");
ReKonfig::setSyncUser(kcfg_syncUser->text());
@@ -57,4 +76,10 @@ int SyncOperaSettingsWidget::nextId() const
ReKonfig::setSyncPasswords(false);
return SyncAssistant::Page_Data;
+
+#else
+
+ return SyncAssistant::Page_Check;
+
+#endif
}
diff --git a/src/sync/syncoperasettingswidget.h b/src/sync/syncoperasettingswidget.h
index 5eb608d3..53e95699 100644
--- a/src/sync/syncoperasettingswidget.h
+++ b/src/sync/syncoperasettingswidget.h
@@ -2,8 +2,8 @@
*
* This file is a part of the rekonq project
*
-* Copyright (C) 2011 by Siteshwar Vashisht <siteshwar AT gmail.com>
-* Copyright (C) 2011 by Andrea Diamantini <adjam7 at gmail dot com>
+* Copyright (C) 2011-2012 by Siteshwar Vashisht <siteshwar AT gmail.com>
+* Copyright (C) 2011-2012 by Andrea Diamantini <adjam7 at gmail dot com>
*
*
* This program is free software; you can redistribute it and/or
diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp
index 2b76073e..b3658dd9 100644
--- a/src/urlbar/bookmarkwidget.cpp
+++ b/src/urlbar/bookmarkwidget.cpp
@@ -53,7 +53,7 @@
#include <QDBusConnectionInterface>
// Nepomuk config include
-#include "../config-nepomuk.h"
+#include "config-nepomuk.h"
#ifdef HAVE_NEPOMUK
// Local Nepomuk Includes
diff --git a/src/urlbar/bookmarkwidget.h b/src/urlbar/bookmarkwidget.h
index 6dc1b761..e5f25d37 100644
--- a/src/urlbar/bookmarkwidget.h
+++ b/src/urlbar/bookmarkwidget.h
@@ -35,7 +35,7 @@
#include <QPlainTextEdit>
// Nepomuk config include
-#include "../config-nepomuk.h"
+#include "config-nepomuk.h"
#ifdef HAVE_NEPOMUK
diff --git a/src/urlbar/newresourcedialog.h b/src/urlbar/newresourcedialog.h
index f8aa5f48..651c631c 100644
--- a/src/urlbar/newresourcedialog.h
+++ b/src/urlbar/newresourcedialog.h
@@ -37,21 +37,21 @@
namespace Nepomuk
{
- class NewResourceDialog : public KDialog
- {
- Q_OBJECT
+class NewResourceDialog : public KDialog
+{
+ Q_OBJECT
- public:
- explicit NewResourceDialog(int index, Nepomuk::Resource& nfoResource, QWidget* parent = 0);
- virtual ~NewResourceDialog();
+public:
+ explicit NewResourceDialog(int index, Nepomuk::Resource& nfoResource, QWidget* parent = 0);
+ virtual ~NewResourceDialog();
- private Q_SLOTS:
- void newResourceSlot();
+private Q_SLOTS:
+ void newResourceSlot();
- private:
- class Private;
- Private* const d;
- };
+private:
+ class Private;
+ Private* const d;
+};
}
#endif // NEWRESOURCEDIALOG_H
diff --git a/src/urlbar/resourcelinkdialog.h b/src/urlbar/resourcelinkdialog.h
index 8846d0a0..e628aa10 100644
--- a/src/urlbar/resourcelinkdialog.h
+++ b/src/urlbar/resourcelinkdialog.h
@@ -1,7 +1,7 @@
/* ============================================================
*
* This is a part of the GSoC project 2011 - Fancy Bookmarking
-*
+*
* Copyright (c) 2011-2012 by Phaneendra Hegde <pnh.pes@gmail.com>
*
*
@@ -38,36 +38,36 @@
namespace Nepomuk
{
- class Resource;
+class Resource;
- namespace Query
- {
- class Query;
- }
+namespace Query
+{
+class Query;
+}
- class ResourceLinkDialog : public KDialog
- {
- Q_OBJECT
+class ResourceLinkDialog : public KDialog
+{
+ Q_OBJECT
- public:
- explicit ResourceLinkDialog(Nepomuk::Resource& nfoResource, QWidget* parent = 0);
- virtual ~ResourceLinkDialog();
- void setRelatedResources();
+public:
+ explicit ResourceLinkDialog(Nepomuk::Resource& nfoResource, QWidget* parent = 0);
+ virtual ~ResourceLinkDialog();
+ void setRelatedResources();
- private Q_SLOTS:
- void dynamicSearchingSlot();
- void resourceSelectedSlot(int);
- void linkResourceSlot();
- void unlinkResourceSlot();
- void createNewResourceSlot();
- void showContextMenu(const QPoint&);
+private Q_SLOTS:
+ void dynamicSearchingSlot();
+ void resourceSelectedSlot(int);
+ void linkResourceSlot();
+ void unlinkResourceSlot();
+ void createNewResourceSlot();
+ void showContextMenu(const QPoint&);
- private:
- class Private;
- Private* const d;
+private:
+ class Private;
+ Private* const d;
- };
+};
}
#endif // RESOURCELINKDIALOG_H