From 807e20570cbfef6e258313565598905564f1bb86 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 27 May 2012 22:58:44 +0200 Subject: Kitchen sink clean up - astyle - copyrights - (some) includes --- src/adblock/adblockmanager.cpp | 10 +- src/adblock/blockedelementswidget.cpp | 2 +- src/adblock/blockedelementswidget.h | 12 +- src/analyzer/analyzerpanel.cpp | 8 +- src/analyzer/networkanalyzer.cpp | 2 +- src/application.cpp | 10 +- src/application.h | 2 +- src/bookmarks/bookmarkmanager.cpp | 6 +- src/bookmarks/bookmarkowner.cpp | 30 +-- src/bookmarks/bookmarkscontextmenu.cpp | 3 +- src/bookmarks/bookmarkstoolbar.cpp | 10 +- src/bookmarks/bookmarkstreemodel.cpp | 2 +- src/downloaditem.cpp | 10 +- src/downloaditem.h | 12 +- src/downloadmanager.cpp | 10 +- src/downloadmanager.h | 6 +- src/history/historymanager.cpp | 4 +- src/history/historymodels.cpp | 48 ++-- src/mainview.cpp | 8 +- src/mainwindow.cpp | 38 ++-- src/mainwindow.h | 6 +- src/newtabpage.cpp | 86 ++++---- src/newtabpage.h | 4 +- src/opensearch/opensearchmanager.cpp | 6 +- src/opensearch/searchengine.h | 16 +- src/paneltreeview.cpp | 2 +- src/protocolhandler.cpp | 4 +- src/rekonqmenu.cpp | 2 +- src/searchenginebar.cpp | 2 +- src/searchenginebar.h | 2 +- src/settings/passexceptionswidget.cpp | 8 +- src/settings/privacywidget.cpp | 4 +- src/settings/privacywidget.h | 4 +- src/settings/settingsdialog.cpp | 6 +- src/sync/googlesynchandler.cpp | 30 +-- src/sync/syncassistant.cpp | 3 +- src/sync/syncassistant.h | 4 +- src/sync/synccheckwidget.cpp | 4 +- src/sync/synccheckwidget.h | 2 +- src/sync/syncdatawidget.cpp | 2 +- src/sync/syncdatawidget.h | 2 +- src/sync/syncgooglesettingswidget.cpp | 3 +- src/sync/syncgooglesettingswidget.h | 4 +- src/sync/synchosttypewidget.cpp | 16 +- src/sync/synchosttypewidget.h | 2 +- src/sync/syncmanager.cpp | 6 +- src/sync/syncmanager.h | 2 +- src/tabbar.cpp | 2 +- src/thumbupdater.cpp | 4 +- src/thumbupdater.h | 4 +- src/urlbar/bookmarkwidget.cpp | 181 +++++++-------- src/urlbar/bookmarkwidget.h | 23 +- src/urlbar/completionwidget.cpp | 8 +- src/urlbar/listitem.cpp | 4 +- src/urlbar/newresourcedialog.cpp | 133 ++++++----- src/urlbar/newresourcedialog.h | 53 +++-- src/urlbar/resourcelinkdialog.cpp | 388 ++++++++++++++++++--------------- src/urlbar/resourcelinkdialog.h | 51 +++-- src/urlbar/urlbar.cpp | 2 +- src/urlbar/urlbar.h | 2 +- src/urlbar/urlresolver.cpp | 22 +- src/webpage.cpp | 20 +- src/webtab.cpp | 10 +- src/webtab.h | 6 +- src/webview.cpp | 12 +- 65 files changed, 734 insertions(+), 656 deletions(-) diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp index fca4ea03..967f103c 100644 --- a/src/adblock/adblockmanager.cpp +++ b/src/adblock/adblockmanager.cpp @@ -220,7 +220,7 @@ void AdBlockManager::loadRuleString(const QString &stringRule) _blackList << rule; } - + QNetworkReply *AdBlockManager::block(const QNetworkRequest &request, WebPage *page) { if (!_isAdblockEnabled) @@ -404,7 +404,7 @@ void AdBlockManager::addCustomRule(const QString &stringRule, bool reloadPage) out << stringRule << '\n'; ruleFile.close(); - + // load it loadRuleString(stringRule); @@ -427,14 +427,14 @@ void AdBlockManager::showBlockedItemDialog() dialog->setMainWidget(&widget); dialog->exec(); - Q_FOREACH(const QString &r, widget.rulesToAdd()) + Q_FOREACH(const QString & r, widget.rulesToAdd()) { addCustomRule(r); } - + if (widget.pageNeedsReload()) emit reloadCurrentPage(); - + dialog->deleteLater(); } diff --git a/src/adblock/blockedelementswidget.cpp b/src/adblock/blockedelementswidget.cpp index b0e18c39..141dd203 100644 --- a/src/adblock/blockedelementswidget.cpp +++ b/src/adblock/blockedelementswidget.cpp @@ -111,6 +111,6 @@ void BlockedElementsWidget::unblockElement() _rulesToAdd << urlString; } - + _reloadPage = true; } diff --git a/src/adblock/blockedelementswidget.h b/src/adblock/blockedelementswidget.h index c796be87..d26ee849 100644 --- a/src/adblock/blockedelementswidget.h +++ b/src/adblock/blockedelementswidget.h @@ -48,10 +48,16 @@ public: void setBlockedElements(const QStringList &); void setHidedElements(int); - bool pageNeedsReload() { return _reloadPage; }; + bool pageNeedsReload() + { + return _reloadPage; + }; + + QStringList rulesToAdd() + { + return _rulesToAdd; + }; - QStringList rulesToAdd() { return _rulesToAdd; }; - private Q_SLOTS: void unblockElement(); diff --git a/src/analyzer/analyzerpanel.cpp b/src/analyzer/analyzerpanel.cpp index 3bd17e9c..5f9fc00d 100644 --- a/src/analyzer/analyzerpanel.cpp +++ b/src/analyzer/analyzerpanel.cpp @@ -74,14 +74,14 @@ void NetworkAnalyzerPanel::toggle(bool enable) if (enable) { connect(page, SIGNAL(loadStarted()), _viewer, SLOT(clear())); - connect(manager, SIGNAL(networkData(QNetworkAccessManager::Operation,QNetworkRequest,QNetworkReply*)), - _viewer, SLOT(addRequest(QNetworkAccessManager::Operation,QNetworkRequest,QNetworkReply*))); + connect(manager, SIGNAL(networkData(QNetworkAccessManager::Operation, QNetworkRequest, QNetworkReply*)), + _viewer, SLOT(addRequest(QNetworkAccessManager::Operation, QNetworkRequest, QNetworkReply*))); } else { disconnect(page, SIGNAL(loadStarted()), _viewer, SLOT(clear())); - disconnect(manager, SIGNAL(networkData(QNetworkAccessManager::Operation,QNetworkRequest,QNetworkReply*)), - _viewer, SLOT(addRequest(QNetworkAccessManager::Operation,QNetworkRequest,QNetworkReply*))); + disconnect(manager, SIGNAL(networkData(QNetworkAccessManager::Operation, QNetworkRequest, QNetworkReply*)), + _viewer, SLOT(addRequest(QNetworkAccessManager::Operation, QNetworkRequest, QNetworkReply*))); } setVisible(enable); diff --git a/src/analyzer/networkanalyzer.cpp b/src/analyzer/networkanalyzer.cpp index 882318d4..61ab69a5 100644 --- a/src/analyzer/networkanalyzer.cpp +++ b/src/analyzer/networkanalyzer.cpp @@ -71,7 +71,7 @@ NetworkAnalyzer::NetworkAnalyzer(QWidget *parent) _requestList->setContextMenuPolicy(Qt::CustomContextMenu); connect(_mapper, SIGNAL(mapped(QObject*)), this, SLOT(requestFinished(QObject*))); - connect(_requestList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(showItemDetails(QTreeWidgetItem*))); + connect(_requestList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(showItemDetails(QTreeWidgetItem*))); connect(_requestList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(popupContextMenu(QPoint))); } diff --git a/src/application.cpp b/src/application.cpp index 9f99abb8..c36aeeb8 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -333,8 +333,8 @@ int Application::newInstance() historyManager(); // bookmarks loading - connect(bookmarkManager(), SIGNAL(openUrl(KUrl,Rekonq::OpenType)), - instance(), SLOT(loadUrl(KUrl,Rekonq::OpenType))); + connect(bookmarkManager(), SIGNAL(openUrl(KUrl, Rekonq::OpenType)), + instance(), SLOT(loadUrl(KUrl, Rekonq::OpenType))); ReKonfig::setRecoverOnCrash(ReKonfig::recoverOnCrash() + 1); saveConfiguration(); @@ -478,7 +478,7 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) MainWindow *w = 0; if (newType == Rekonq::NewWindow - || (newType == Rekonq::NewTab && ReKonfig::openLinksInNewWindow())) + || (newType == Rekonq::NewTab && ReKonfig::openLinksInNewWindow())) { w = newMainWindow(); newType = Rekonq::CurrentTab; @@ -806,7 +806,7 @@ void Application::createWebAppShortcut() dialog->setCaption(i18nc("@title:window", "Create Application Shortcut")); dialog->setButtons(KDialog::Ok | KDialog::Cancel); dialog->button(KDialog::Ok)->setText(i18n("Create")); - dialog->setMinimumSize(400,50); + dialog->setMinimumSize(400, 50); Ui::webAppCreation wAppWidget; QWidget widget; @@ -853,7 +853,7 @@ void Application::createWebAppShortcut() out.setCodec("UTF-8"); out << shortcutString; - wAppFile.setPermissions(QFile::ReadUser|QFile::WriteUser|QFile::ExeUser|QFile::ReadGroup|QFile::ReadOther); + wAppFile.setPermissions(QFile::ReadUser | QFile::WriteUser | QFile::ExeUser | QFile::ReadGroup | QFile::ReadOther); wAppFile.close(); } diff --git a/src/application.h b/src/application.h index 36114ae0..168a9dcd 100644 --- a/src/application.h +++ b/src/application.h @@ -100,7 +100,7 @@ public: { return _privateBrowsingAction; }; - + public Q_SLOTS: /** * Save application's configuration diff --git a/src/bookmarks/bookmarkmanager.cpp b/src/bookmarks/bookmarkmanager.cpp index 165966d2..43f4dd3a 100644 --- a/src/bookmarks/bookmarkmanager.cpp +++ b/src/bookmarks/bookmarkmanager.cpp @@ -69,12 +69,12 @@ BookmarkManager::BookmarkManager(QObject *parent) delete tempManager; } - connect(m_manager, SIGNAL(changed(QString,QString)), this, SLOT(slotBookmarksChanged())); + connect(m_manager, SIGNAL(changed(QString, QString)), this, SLOT(slotBookmarksChanged())); // setup menu m_owner = new BookmarkOwner(m_manager, this); - connect(m_owner, SIGNAL(openUrl(KUrl,Rekonq::OpenType)), - this, SIGNAL(openUrl(KUrl,Rekonq::OpenType))); + connect(m_owner, SIGNAL(openUrl(KUrl, Rekonq::OpenType)), + this, SIGNAL(openUrl(KUrl, Rekonq::OpenType))); KAction *a = KStandardAction::addBookmark(m_owner, SLOT(bookmarkCurrentPage()), this); m_actionCollection->addAction(QL1S("rekonq_add_bookmark"), a); diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp index 6cea5e9c..3aa3b8d3 100644 --- a/src/bookmarks/bookmarkowner.cpp +++ b/src/bookmarks/bookmarkowner.cpp @@ -50,13 +50,13 @@ #include "../config-nepomuk.h" #ifdef HAVE_NEPOMUK - // Local Nepomuk Includes - #include "resourcelinkdialog.h" +// Local Nepomuk Includes +#include "resourcelinkdialog.h" - // Nepomuk Includes - #include - #include -#endif +// Nepomuk Includes +#include +#include +#endif BookmarkOwner::BookmarkOwner(KBookmarkManager *manager, QObject *parent) @@ -225,8 +225,8 @@ KBookmark BookmarkOwner::bookmarkCurrentPage(const KBookmark &bookmark) #ifdef HAVE_NEPOMUK Nepomuk::Resource nfoResource; nfoResource = ((QUrl)currentUrl()); - nfoResource.addType( Nepomuk::Vocabulary::NFO::Website() ); - nfoResource.setLabel( currentTitle() ); + nfoResource.addType(Nepomuk::Vocabulary::NFO::Website()); + nfoResource.setLabel(currentTitle()); #endif } @@ -234,7 +234,7 @@ KBookmark BookmarkOwner::bookmarkCurrentPage(const KBookmark &bookmark) if (!bookmark.isNull()) parent.moveBookmark(newBk, bookmark); - m_manager->emitChanged(parent); + m_manager->emitChanged(parent); return newBk; } @@ -322,13 +322,13 @@ void BookmarkOwner::editBookmark(KBookmark bookmark) #ifdef HAVE_NEPOMUK - void BookmarkOwner::fancyBookmark(KBookmark bookmark) - { - Nepomuk::Resource nfoResource = (KUrl)bookmark.url(); - Nepomuk::ResourceLinkDialog r( nfoResource ); - r.exec(); +void BookmarkOwner::fancyBookmark(KBookmark bookmark) +{ + Nepomuk::Resource nfoResource = (KUrl)bookmark.url(); + Nepomuk::ResourceLinkDialog r(nfoResource); + r.exec(); - } +} #endif bool BookmarkOwner::deleteBookmark(const KBookmark &bookmark) diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp index b49f6883..cd2ab5c7 100644 --- a/src/bookmarks/bookmarkscontextmenu.cpp +++ b/src/bookmarks/bookmarkscontextmenu.cpp @@ -3,6 +3,7 @@ * This file is a part of the rekonq project * * Copyright (C) 2010 by Yoann Laissus +* Copyright (c) 2011-2012 by Phaneendra Hegde * * * This program is free software; you can redistribute it and/or @@ -71,7 +72,7 @@ void BookmarksContextMenu::addBookmarkActions() addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::EDIT)); #ifdef HAVE_NEPOMUK - addAction(m_bmOwner->createAction(bookmark(),BookmarkOwner::FANCYBOOKMARK)); + addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::FANCYBOOKMARK)); #endif addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::DELETE)); } diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp index 482e829f..ad8af326 100644 --- a/src/bookmarks/bookmarkstoolbar.cpp +++ b/src/bookmarks/bookmarkstoolbar.cpp @@ -164,7 +164,7 @@ BookmarkToolBar::BookmarkToolBar(KToolBar *toolBar, QObject *parent) { toolBar->setContextMenuPolicy(Qt::CustomContextMenu); connect(toolBar, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint))); - connect(rApp->bookmarkManager()->manager(), SIGNAL(changed(QString,QString)), this, SLOT(hideMenu())); + connect(rApp->bookmarkManager()->manager(), SIGNAL(changed(QString, QString)), this, SLOT(hideMenu())); toolBar->setAcceptDrops(true); toolBar->installEventFilter(this); toolBar->setShortcutEnabled(false); @@ -290,8 +290,8 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) { QDragEnterEvent *dragEvent = static_cast(event); if (dragEvent->mimeData()->hasFormat(BookmarkManager::bookmark_mime_type()) - || dragEvent->mimeData()->hasFormat("text/uri-list") - || dragEvent->mimeData()->hasFormat("text/plain")) + || dragEvent->mimeData()->hasFormat("text/uri-list") + || dragEvent->mimeData()->hasFormat("text/plain")) { QFrame* dropIndicatorWidget = new QFrame(toolBar()); dropIndicatorWidget->setFrameShape(QFrame::VLine); @@ -322,8 +322,8 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) { QDragMoveEvent *dragEvent = static_cast(event); if (dragEvent->mimeData()->hasFormat(BookmarkManager::bookmark_mime_type()) - || dragEvent->mimeData()->hasFormat("text/uri-list") - || dragEvent->mimeData()->hasFormat("text/plain")) + || dragEvent->mimeData()->hasFormat("text/uri-list") + || dragEvent->mimeData()->hasFormat("text/plain")) { QAction *overAction = toolBar()->actionAt(dragEvent->pos()); KBookmarkActionInterface *overActionBK = dynamic_cast(overAction); diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp index 4df7b981..9e54f010 100644 --- a/src/bookmarks/bookmarkstreemodel.cpp +++ b/src/bookmarks/bookmarkstreemodel.cpp @@ -167,7 +167,7 @@ BookmarksTreeModel::BookmarksTreeModel(QObject *parent) , m_root(0) { resetModel(); - connect(rApp->bookmarkManager()->manager(), SIGNAL(changed(QString,QString)), + connect(rApp->bookmarkManager()->manager(), SIGNAL(changed(QString, QString)), this, SLOT(bookmarksChanged(QString))); } diff --git a/src/downloaditem.cpp b/src/downloaditem.cpp index f1f0b9d9..38edbf1e 100644 --- a/src/downloaditem.cpp +++ b/src/downloaditem.cpp @@ -59,7 +59,7 @@ DownloadItem::DownloadItem(KIO::CopyJob *job, const QDateTime &d, QObject *paren , m_job(job) , m_state(0) { - QObject::connect(job, SIGNAL(percent(KJob*,ulong)), this, SLOT(updateProgress(KJob*,ulong))); + QObject::connect(job, SIGNAL(percent(KJob*, ulong)), this, SLOT(updateProgress(KJob*, ulong))); QObject::connect(job, SIGNAL(finished(KJob*)), this, SLOT(onFinished(KJob*))); QObject::connect(job, SIGNAL(suspended(KJob*)), this, SLOT(onSuspended(KJob*))); } @@ -114,10 +114,10 @@ void DownloadItem::setIsKGetDownload() void DownloadItem::updateProgress(KJob *job, unsigned long value) { Q_UNUSED(job); - + if (value > 0 && value < 100) m_state = Downloading; - + emit downloadProgress(value); } @@ -143,10 +143,10 @@ void DownloadItem::onFinished(KJob *job) void DownloadItem::onSuspended(KJob *job) { Q_UNUSED(job); - + m_state = Suspended; - // TODO: + // TODO: // connect to job->resume() to let rekonq resume it } diff --git a/src/downloaditem.h b/src/downloaditem.h index f7b12782..0b244c34 100644 --- a/src/downloaditem.h +++ b/src/downloaditem.h @@ -63,29 +63,29 @@ public: // This is used to add a DownloadItem managed with KIO explicit DownloadItem(KIO::CopyJob *job, const QDateTime &d, QObject *parent = 0); - + inline QDateTime dateTime() const { return m_dateTime; } KUrl destUrl() const; - + QString originUrl() const; QString destinationUrlString() const; QString fileName() const; QString fileDirectory() const; QString icon() const; QString errorString() const; - + inline int state() const { return m_state; } void setIsKGetDownload(); - - + + Q_SIGNALS: void downloadProgress(int percent); void downloadFinished(bool success); @@ -100,7 +100,7 @@ private: KUrl m_destUrl; QDateTime m_dateTime; - + KIO::CopyJob *m_job; int m_state; diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index f313a68d..7c31f435 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -86,11 +86,11 @@ DownloadManager::~DownloadManager() out << item->destinationUrlString(); out << item->dateTime(); } - + downloadFile.close(); } - + void DownloadManager::init() { QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); @@ -123,7 +123,7 @@ DownloadItem* DownloadManager::addDownload(KIO::CopyJob *job) return 0; KIO::CopyJob *cJob = qobject_cast(job); - + QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); QFile downloadFile(downloadFilePath); if (!downloadFile.open(QFile::WriteOnly | QFile::Append)) @@ -139,7 +139,7 @@ DownloadItem* DownloadManager::addDownload(KIO::CopyJob *job) DownloadItem *item = new DownloadItem(job, QDateTime::currentDateTime(), this); m_downloadList.append(item); emit newDownloadAdded(item); - return item; + return item; } @@ -148,7 +148,7 @@ DownloadItem* DownloadManager::addKGetDownload(const QString &srcUrl, const QStr QWebSettings *globalSettings = QWebSettings::globalSettings(); if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) return 0; - + QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); QFile downloadFile(downloadFilePath); if (!downloadFile.open(QFile::WriteOnly | QFile::Append)) diff --git a/src/downloadmanager.h b/src/downloadmanager.h index bc20ff13..4cbd5fd6 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -55,7 +55,7 @@ class REKONQ_TESTS_EXPORT DownloadManager : public QObject public: DownloadManager(QObject *parent = 0); ~DownloadManager(); - + DownloadList downloads() const { return m_downloadList; @@ -69,13 +69,13 @@ public: void downloadLinksWithKGet(const QVariant &contentList); void removeDownloadItem(int index); - + private: void init(); DownloadItem* addDownload(KIO::CopyJob *job); DownloadItem* addKGetDownload(const QString &srcUrl, const QString &destUrl); - + Q_SIGNALS: void newDownloadAdded(QObject *item); void notifyDownload(const QString&, Rekonq::Notify = Rekonq::Download); diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index e55e8a98..5acb180e 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -104,7 +104,7 @@ void HistoryManager::addHistoryEntry(const KUrl &url, const QString &title) { if (ReKonfig::expireHistory() == 5) // DON'T STORE HISTORY! return; - + QWebSettings *globalSettings = QWebSettings::globalSettings(); if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) return; @@ -169,7 +169,7 @@ void HistoryManager::setHistory(const QList &history, bool loadedAn m_lastSavedUrl.clear(); m_saveTimer->changeOccurred(); } - + emit historyReset(); } diff --git a/src/history/historymodels.cpp b/src/history/historymodels.cpp index 90886cac..93a7b941 100644 --- a/src/history/historymodels.cpp +++ b/src/history/historymodels.cpp @@ -224,12 +224,12 @@ void HistoryFilterModel::setSourceModel(QAbstractItemModel *newSourceModel) if (sourceModel()) { disconnect(sourceModel(), SIGNAL(modelReset()), this, SLOT(sourceReset())); - disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), - this, SLOT(dataChanged(QModelIndex,QModelIndex))); - disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(sourceRowsInserted(QModelIndex,int,int))); - disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(sourceRowsRemoved(QModelIndex,int,int))); + disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), + this, SLOT(dataChanged(QModelIndex, QModelIndex))); + disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(sourceRowsInserted(QModelIndex, int, int))); + disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(sourceRowsRemoved(QModelIndex, int, int))); } QAbstractProxyModel::setSourceModel(newSourceModel); @@ -238,12 +238,12 @@ void HistoryFilterModel::setSourceModel(QAbstractItemModel *newSourceModel) { m_loaded = false; connect(sourceModel(), SIGNAL(modelReset()), this, SLOT(sourceReset())); - connect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), - this, SLOT(sourceDataChanged(QModelIndex,QModelIndex))); - connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(sourceRowsInserted(QModelIndex,int,int))); - connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(sourceRowsRemoved(QModelIndex,int,int))); + connect(sourceModel(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), + this, SLOT(sourceDataChanged(QModelIndex, QModelIndex))); + connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(sourceRowsInserted(QModelIndex, int, int))); + connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(sourceRowsRemoved(QModelIndex, int, int))); } } @@ -405,16 +405,16 @@ bool HistoryFilterModel::removeRows(int row, int count, const QModelIndex &paren if (row < 0 || count <= 0 || row + count > rowCount(parent) || parent.isValid()) return false; int lastRow = row + count - 1; - disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(sourceRowsRemoved(QModelIndex,int,int))); + disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(sourceRowsRemoved(QModelIndex, int, int))); beginRemoveRows(parent, row, lastRow); int oldCount = rowCount(); int start = sourceModel()->rowCount() - m_sourceRow.value(row); int end = sourceModel()->rowCount() - m_sourceRow.value(lastRow); sourceModel()->removeRows(start, end - start + 1); endRemoveRows(); - connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(sourceRowsRemoved(QModelIndex,int,int))); + connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(sourceRowsRemoved(QModelIndex, int, int))); m_loaded = false; if (oldCount - count != rowCount()) reset(); @@ -625,10 +625,10 @@ void HistoryTreeModel::setSourceModel(QAbstractItemModel *newSourceModel) { disconnect(sourceModel(), SIGNAL(modelReset()), this, SLOT(sourceReset())); disconnect(sourceModel(), SIGNAL(layoutChanged()), this, SLOT(sourceReset())); - disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(sourceRowsInserted(QModelIndex,int,int))); - disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(sourceRowsRemoved(QModelIndex,int,int))); + disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(sourceRowsInserted(QModelIndex, int, int))); + disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(sourceRowsRemoved(QModelIndex, int, int))); } QAbstractProxyModel::setSourceModel(newSourceModel); @@ -637,10 +637,10 @@ void HistoryTreeModel::setSourceModel(QAbstractItemModel *newSourceModel) { connect(sourceModel(), SIGNAL(modelReset()), this, SLOT(sourceReset())); connect(sourceModel(), SIGNAL(layoutChanged()), this, SLOT(sourceReset())); - connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(sourceRowsInserted(QModelIndex,int,int))); - connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(sourceRowsRemoved(QModelIndex,int,int))); + connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(sourceRowsInserted(QModelIndex, int, int))); + connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(sourceRowsRemoved(QModelIndex, int, int))); } reset(); diff --git a/src/mainview.cpp b/src/mainview.cpp index a7a34b84..a9bc5407 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -88,7 +88,7 @@ MainView::MainView(QWidget *parent) connect(tabBar, SIGNAL(detachTab(int)), this, SLOT(detachTab(int))); connect(tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); - connect(tabBar, SIGNAL(tabMoved(int,int)), m_widgetBar, SLOT(moveBar(int,int))); + connect(tabBar, SIGNAL(tabMoved(int, int)), m_widgetBar, SLOT(moveBar(int, int))); // current page index changing connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); @@ -255,13 +255,13 @@ void MainView::currentChanged(int index) // disconnecting webpage from mainview disconnect(oldTab->page(), SIGNAL(statusBarMessage(QString)), this, SIGNAL(showStatusBarMessage(QString))); - disconnect(oldTab->page(), SIGNAL(linkHovered(QString,QString,QString)), + disconnect(oldTab->page(), SIGNAL(linkHovered(QString, QString, QString)), this, SIGNAL(linkHovered(QString))); } connect(tab->page(), SIGNAL(statusBarMessage(QString)), this, SIGNAL(showStatusBarMessage(QString))); - connect(tab->page(), SIGNAL(linkHovered(QString,QString,QString)), + connect(tab->page(), SIGNAL(linkHovered(QString, QString, QString)), this, SIGNAL(linkHovered(QString))); emit currentTitle(tab->view()->title()); @@ -636,7 +636,7 @@ void MainView::webViewUrlChanged(const QUrl &url) int index = indexOf(view->parentWidget()); if (ReKonfig::hoveringTabOption() == 2) tabBar()->setTabToolTip(index, url.toString()); - + rApp->mainWindow()->updateHistoryActions(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 68772bea..7553a424 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -173,7 +173,7 @@ MainWindow::MainWindow() setStatusBar(0); // setting popup notification - connect(rApp, SIGNAL(focusChanged(QWidget*,QWidget*)), m_popup, SLOT(hide())); + connect(rApp, SIGNAL(focusChanged(QWidget*, QWidget*)), m_popup, SLOT(hide())); m_popup->setAutoFillBackground(true); m_popup->setMargin(4); m_popup->raise(); @@ -181,10 +181,10 @@ MainWindow::MainWindow() connect(m_hidePopupTimer, SIGNAL(timeout()), m_popup, SLOT(hide())); // notification system - connect(m_view, SIGNAL(showStatusBarMessage(QString,Rekonq::Notify)), this, SLOT(notifyMessage(QString,Rekonq::Notify))); + connect(m_view, SIGNAL(showStatusBarMessage(QString, Rekonq::Notify)), this, SLOT(notifyMessage(QString, Rekonq::Notify))); connect(m_view, SIGNAL(linkHovered(QString)), this, SLOT(notifyMessage(QString))); - connect(rApp->downloadManager(), SIGNAL(notifyDownload(QString,Rekonq::Notify)), - this, SLOT(notifyMessage(QString,Rekonq::Notify))); + connect(rApp->downloadManager(), SIGNAL(notifyDownload(QString, Rekonq::Notify)), + this, SLOT(notifyMessage(QString, Rekonq::Notify))); // connect signals and slots connect(m_view, SIGNAL(currentTitle(QString)), this, SLOT(updateWindowTitle(QString))); @@ -253,11 +253,11 @@ void MainWindow::setupToolbars() void MainWindow::postLaunch() { setupBookmarksAndToolsShortcuts(); - + // this just to fix reopening rekonq after fullscreen close KToolBar *mainBar = toolBar("mainToolBar"); - mainBar->show(); - + mainBar->show(); + // Bookmarks Bar KToolBar *XMLGUIBkBar = toolBar("bookmarkToolBar"); if (!XMLGUIBkBar) @@ -358,7 +358,7 @@ void MainWindow::setupActions() a->setShortcut(fullScreenShortcut); a = actionCollection()->addAction(KStandardAction::Home); - connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(homePage())); + connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(homePage())); KStandardAction::preferences(this, SLOT(preferences()), actionCollection()); a = KStandardAction::redisplay(m_view, SLOT(webReload()), actionCollection()); @@ -423,8 +423,8 @@ void MainWindow::setupActions() // ========================= History related actions ============================== a = actionCollection()->addAction(KStandardAction::Back); - connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), - this, SLOT(openPrevious(Qt::MouseButtons,Qt::KeyboardModifiers))); + connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), + this, SLOT(openPrevious(Qt::MouseButtons, Qt::KeyboardModifiers))); m_historyBackMenu = new KMenu(this); a->setMenu(m_historyBackMenu); @@ -432,8 +432,8 @@ void MainWindow::setupActions() connect(m_historyBackMenu, SIGNAL(triggered(QAction*)), this, SLOT(openActionUrl(QAction*))); a = actionCollection()->addAction(KStandardAction::Forward); - connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), - this, SLOT(openNext(Qt::MouseButtons,Qt::KeyboardModifiers))); + connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), + this, SLOT(openNext(Qt::MouseButtons, Qt::KeyboardModifiers))); m_historyForwardMenu = new KMenu(this); a->setMenu(m_historyForwardMenu); @@ -578,8 +578,8 @@ void MainWindow::setupPanels() // Setup history panel const QString historyTitle = i18n("History Panel"); m_historyPanel = new HistoryPanel(historyTitle, this); - connect(m_historyPanel, SIGNAL(openUrl(KUrl,Rekonq::OpenType)), - rApp, SLOT(loadUrl(KUrl,Rekonq::OpenType))); + connect(m_historyPanel, SIGNAL(openUrl(KUrl, Rekonq::OpenType)), + rApp, SLOT(loadUrl(KUrl, Rekonq::OpenType))); connect(m_historyPanel, SIGNAL(itemHovered(QString)), this, SLOT(notifyMessage(QString))); connect(m_historyPanel, SIGNAL(destroyed()), rApp, SLOT(saveConfiguration())); @@ -597,8 +597,8 @@ void MainWindow::setupPanels() // Setup bookmarks panel const QString bookmarksTitle = i18n("Bookmarks Panel"); m_bookmarksPanel = new BookmarksPanel(bookmarksTitle, this); - connect(m_bookmarksPanel, SIGNAL(openUrl(KUrl,Rekonq::OpenType)), - rApp, SLOT(loadUrl(KUrl,Rekonq::OpenType))); + connect(m_bookmarksPanel, SIGNAL(openUrl(KUrl, Rekonq::OpenType)), + rApp, SLOT(loadUrl(KUrl, Rekonq::OpenType))); connect(m_bookmarksPanel, SIGNAL(itemHovered(QString)), this, SLOT(notifyMessage(QString))); connect(m_bookmarksPanel, SIGNAL(destroyed()), rApp, SLOT(saveConfiguration())); @@ -743,7 +743,7 @@ void MainWindow::preferences() // keep us informed when the user changes settings connect(s, SIGNAL(settingsChanged(QString)), rApp, SLOT(updateConfiguration())); connect(s, SIGNAL(finished(int)), s, SLOT(deleteLater())); - + s->show(); } @@ -1545,7 +1545,7 @@ void MainWindow::setupBookmarksAndToolsShortcuts() m_rekonqMenu->setButtonWidget(toolsButton); return; } - + kWarning() << "oh oh, something went wrong with rekonq tools button..."; } @@ -1620,7 +1620,7 @@ void MainWindow::loadCheckedUrl(const KUrl& url, const Rekonq::OpenType& type, Q { // NOTE: At this point, url should just be resolved via urlresolver. // No need to check it twice - + WebTab *tab = 0; switch (type) { diff --git a/src/mainwindow.h b/src/mainwindow.h index e647cc88..e7e03053 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -84,9 +84,9 @@ public: QString selectedText() const; void loadCheckedUrl(const KUrl& url, - const Rekonq::OpenType& type = Rekonq::CurrentTab, - QWebHistory *webHistory = 0 - ); + const Rekonq::OpenType& type = Rekonq::CurrentTab, + QWebHistory *webHistory = 0 + ); private: void setupBookmarksAndToolsShortcuts(); void setupActions(); diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 17f43735..c3d75c5e 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -71,7 +71,7 @@ NewTabPage::NewTabPage(QWebFrame *frame) QString htmlFilePath = KStandardDirs::locate("data", "rekonq/htmls/home.html"); QString dataPath = QL1S("file://") + htmlFilePath; dataPath.remove(QL1S("/htmls/home.html")); - + QFile file(htmlFilePath); bool isOpened = file.open(QIODevice::ReadOnly); if (!isOpened) @@ -229,7 +229,7 @@ void NewTabPage::generate(const KUrl &url) if (url.fileName() == QL1S("search")) { - QString value = url.queryItemValue( QL1S("q") ); + QString value = url.queryItemValue(QL1S("q")); loadPageForUrl(KUrl("about:history"), value); return; } @@ -248,14 +248,14 @@ void NewTabPage::generate(const KUrl &url) if (url.fileName() == QL1S("search")) { - QString value = url.queryItemValue( QL1S("q") ); + QString value = url.queryItemValue(QL1S("q")); loadPageForUrl(KUrl("about:downloads"), value); return; } if (url.fileName() == QL1S("opendir")) { - QString value = url.queryItemValue( QL1S("q") ); + QString value = url.queryItemValue(QL1S("q")); KUrl dirUrl = KUrl(value); (void)new KRun(dirUrl, rApp->mainWindow(), 0, dirUrl.isLocalFile()); return; @@ -263,13 +263,13 @@ void NewTabPage::generate(const KUrl &url) if (url.fileName() == QL1S("removeItem")) { - int value = url.queryItemValue( QL1S("item") ).toInt(); + int value = url.queryItemValue(QL1S("item")).toInt(); rApp->downloadManager()->removeDownloadItem(value); loadPageForUrl(KUrl("about:downloads")); return; } } - + if (url == KUrl("about:bookmarks/edit")) { rApp->bookmarkManager()->slotEditBookmarks(); @@ -283,7 +283,7 @@ void NewTabPage::generate(const KUrl &url) return; } - + loadPageForUrl(url); } @@ -411,14 +411,14 @@ void NewTabPage::browsingMenu(const KUrl ¤tUrl) void NewTabPage::favoritesPage() { m_root.addClass(QL1S("favorites")); - + QWebElement add = createLinkItem(i18n("Add Favorite"), - QL1S("about:preview/add"), - QL1S("list-add"), - KIconLoader::Toolbar); + QL1S("about:preview/add"), + QL1S("list-add"), + KIconLoader::Toolbar); add.setAttribute(QL1S("class"), QL1S("right")); m_root.document().findFirst("#actions").appendInside(add); - + QStringList names = ReKonfig::previewNames(); QStringList urls = ReKonfig::previewUrls(); @@ -448,13 +448,13 @@ void NewTabPage::historyPage(const QString & filter) QWebElement searchForm = createFormItem(i18n("Search History"), QL1S("about:history/search")); searchForm.setAttribute(QL1S("class"), QL1S("left")); - + m_root.document().findFirst(QL1S("#actions")).appendInside(searchForm); - + QWebElement clearHistory = createLinkItem(i18n("Clear History"), - QL1S("about:history/clear"), - QL1S("edit-clear"), - KIconLoader::Toolbar); + QL1S("about:history/clear"), + QL1S("edit-clear"), + KIconLoader::Toolbar); clearHistory.setAttribute(QL1S("class"), QL1S("right")); m_root.document().findFirst(QL1S("#actions")).appendInside(clearHistory); @@ -463,7 +463,7 @@ void NewTabPage::historyPage(const QString & filter) proxy->setSourceModel(model); bool filterIsEmpty = filter.isEmpty(); - + if (!filterIsEmpty) proxy->setFilterFixedString(filter); @@ -542,9 +542,9 @@ void NewTabPage::bookmarksPage() m_root.addClass(QL1S("bookmarks")); QWebElement editBookmarks = createLinkItem(i18n("Edit Bookmarks"), - QL1S("about:bookmarks/edit"), - QL1S("bookmarks-organize"), - KIconLoader::Toolbar); + QL1S("about:bookmarks/edit"), + QL1S("bookmarks-organize"), + KIconLoader::Toolbar); editBookmarks.setAttribute(QL1S("class"), QL1S("right")); m_root.document().findFirst(QL1S("#actions")).appendInside(editBookmarks); @@ -562,7 +562,7 @@ void NewTabPage::bookmarksPage() QWebElement rootFolder = m_root.lastChild(); rootFolder.appendInside(markup(QL1S("h4"))); rootFolder.lastChild().setPlainText(i18n("Unsorted")); - + while (!bookmark.isNull()) { createBookmarkItem(bookmark, rootFolder); @@ -614,16 +614,16 @@ void NewTabPage::downloadsPage(const QString & filter) m_root.document().findFirst(QL1S("#actions")).appendInside(searchForm); QWebElement clearDownloads = createLinkItem(i18n("Clear Downloads"), - QL1S("about:downloads/clear"), - QL1S("edit-clear"), - KIconLoader::Toolbar); + QL1S("about:downloads/clear"), + QL1S("edit-clear"), + KIconLoader::Toolbar); clearDownloads.setAttribute(QL1S("class"), QL1S("right")); m_root.document().findFirst(QL1S("#actions")).appendInside(clearDownloads); DownloadList list = rApp->downloadManager()->downloads(); bool filterIsEmpty = filter.isEmpty(); - + if (list.isEmpty()) { m_root.addClass(QL1S("empty")); @@ -632,20 +632,20 @@ void NewTabPage::downloadsPage(const QString & filter) } int i = 0; - + Q_FOREACH(DownloadItem * item, list) { KUrl u = item->destUrl(); QString fName = u.fileName(); QString srcUrl = item->originUrl(); - + if (!filterIsEmpty) { if (!fName.contains(filter, Qt::CaseInsensitive) && !srcUrl.contains(filter, Qt::CaseInsensitive)) continue; } - + m_root.prependInside(markup(QL1S("div"))); QWebElement div = m_root.firstChild(); @@ -687,7 +687,7 @@ void NewTabPage::downloadsPage(const QString & filter) div.appendInside(QL1S("") + i18nc("%1 = Error description", "Error: %1", item->errorString()) + QL1S("")); break; - case DownloadItem::Done: + case DownloadItem::Done: default: if (QFile::exists(file)) { @@ -714,14 +714,14 @@ void NewTabPage::downloadsPage(const QString & filter) div.lastChild().setAttribute(QL1S("class"), QL1S("greylink")); div.lastChild().setAttribute(QL1S("href"), QL1S("about:downloads/removeItem?item=") + QString::number(i)); div.lastChild().setPlainText(i18n("Remove from list")); - + break; } i++; } - if (i==0) + if (i == 0) { m_root.addClass(QL1S("empty")); m_root.setPlainText(i18n("No matches for string %1 in downloads", filter)); @@ -795,7 +795,7 @@ void NewTabPage::reloadPreview(int index) QString nameString = ReKonfig::previewNames().at(index); QString title = checkTitle(QString::number(index + 1) + QL1S(" - ") + nameString); - + ThumbUpdater *t = new ThumbUpdater(thumb, urlString, title); t->updateThumb(); } @@ -833,7 +833,7 @@ QWebElement NewTabPage::tabPreview(int winIndex, int tabIndex, const KUrl &url, prev.findFirst(QL1S("span a")).setPlainText(checkTitle(title)); setupTabPreview(prev, winIndex, tabIndex); - + prev.findFirst(QL1S(".right")).setStyleProperty(QL1S("visibility"), QL1S("visible")); prev.findFirst(QL1S(".left")).setStyleProperty(QL1S("visibility"), QL1S("hidden")); @@ -865,12 +865,12 @@ QWebElement NewTabPage::closedTabPreview(int index, const KUrl &url, const QStri void NewTabPage::setupPreview(QWebElement e, int index, bool showControls) { e.findFirst(QL1S(".right img")).setAttribute(QL1S("src"), - QL1S("file:///") + KIconLoader::global()->iconPath("edit-delete", KIconLoader::DefaultState)); + QL1S("file:///") + KIconLoader::global()->iconPath("edit-delete", KIconLoader::DefaultState)); e.findFirst(QL1S(".right")).setAttribute(QL1S("title"), i18n("Remove favorite")); e.findFirst(QL1S(".left img")).setAttribute(QL1S("src"), - QL1S("file:///") + KIconLoader::global()->iconPath("view-refresh", KIconLoader::DefaultState)); + QL1S("file:///") + KIconLoader::global()->iconPath("view-refresh", KIconLoader::DefaultState)); e.findFirst(QL1S(".left")).setAttribute(QL1S("title"), i18n("Set new favorite")); @@ -890,7 +890,7 @@ void NewTabPage::setupPreview(QWebElement e, int index, bool showControls) void NewTabPage::setupTabPreview(QWebElement e, int winIndex, int tabIndex) { e.findFirst(QL1S(".right img")).setAttribute(QL1S("src"), - QL1S("file:///") + KIconLoader::global()->iconPath("edit-delete", KIconLoader::DefaultState)); + QL1S("file:///") + KIconLoader::global()->iconPath("edit-delete", KIconLoader::DefaultState)); e.findFirst(QL1S(".right")).setAttribute(QL1S("title"), QL1S("Close Tab")); QString href = QL1S("about:tabs/remove?win=") + QString::number(winIndex) + QL1S("&tab=") + QString::number(tabIndex); @@ -963,7 +963,7 @@ void NewTabPage::createBookmarkItem(const KBookmark &bookmark, QWebElement paren parent.appendInside(QL1S(" ")); parent.appendInside(markup(QL1S("a"))); parent.lastChild().setAttribute(QL1S("href") , bookmark.url().prettyUrl()); - parent.lastChild().setPlainText( checkTitle(bookmark.fullText(), 40) ); + parent.lastChild().setPlainText(checkTitle(bookmark.fullText(), 40)); parent.appendInside(QL1S("
")); } } @@ -1003,11 +1003,11 @@ QWebElement NewTabPage::createFormItem(const QString &title, const QString &urlS form.appendInside(markup(QL1S("input"))); form.lastChild().setAttribute(QL1S("type"), QL1S("text")); form.lastChild().setAttribute(QL1S("name"), QL1S("q")); - + form.appendInside(markup(QL1S("input"))); form.lastChild().setAttribute(QL1S("type"), QL1S("submit")); form.lastChild().setAttribute(QL1S("value"), title); - + return form; } @@ -1023,7 +1023,7 @@ void NewTabPage::initJS() { QWebFrame *parentFrame = qobject_cast(parent()); QString oldHTML = parentFrame->toHtml(); - + QString includes; includes += QL1S(""); includes += QL1S(""); @@ -1065,11 +1065,11 @@ void NewTabPage::saveFavorites() QStringList newNames = names; QStringList newUrls = urls; - QWebElementCollection coll = m_root.document().findAll( QL1S(".thumbnail") ); + QWebElementCollection coll = m_root.document().findAll(QL1S(".thumbnail")); QList list = coll.toList(); int i = 0; - + Q_FOREACH(QWebElement e, list) { if (!e.hasAttribute(QL1S("id"))) diff --git a/src/newtabpage.h b/src/newtabpage.h index 939b498b..5b4e811b 100644 --- a/src/newtabpage.h +++ b/src/newtabpage.h @@ -94,7 +94,7 @@ private: QWebElement createLinkItem(const QString &title, const QString &urlString, const QString &iconPath, int groupOrSize) const; QWebElement createFormItem(const QString &title, const QString &urlString) const; - + /** * This function helps to get faster a new markup of one type, * it isn't easy to create one with QWebElement. @@ -114,7 +114,7 @@ private: void initJS(); void saveFavorites(); - + private: QString m_html; QWebElement m_root; diff --git a/src/opensearch/opensearchmanager.cpp b/src/opensearch/opensearchmanager.cpp index c315f9c8..5fad35ac 100644 --- a/src/opensearch/opensearchmanager.cpp +++ b/src/opensearch/opensearchmanager.cpp @@ -126,7 +126,7 @@ void OpenSearchManager::addOpenSearchEngine(const KUrl &url, const QString &titl m_currentJob = KIO::get(url, KIO::NoReload, KIO::HideProgressInfo); m_jobUrl = url; m_state = REQ_DESCRIPTION; - connect(m_currentJob, SIGNAL(data(KIO::Job*,QByteArray)), this, SLOT(dataReceived(KIO::Job*,QByteArray))); + connect(m_currentJob, SIGNAL(data(KIO::Job*, QByteArray)), this, SLOT(dataReceived(KIO::Job*, QByteArray))); connect(m_currentJob, SIGNAL(result(KJob*)), this, SLOT(jobFinished(KJob*))); } @@ -155,7 +155,7 @@ void OpenSearchManager::requestSuggestion(const QString &searchText) _typedText = searchText; m_currentJob = KIO::get(url, KIO::NoReload, KIO::HideProgressInfo); m_state = REQ_SUGGESTION; - connect(m_currentJob, SIGNAL(data(KIO::Job*,QByteArray)), this, SLOT(dataReceived(KIO::Job*,QByteArray))); + connect(m_currentJob, SIGNAL(data(KIO::Job*, QByteArray)), this, SLOT(dataReceived(KIO::Job*, QByteArray))); connect(m_currentJob, SIGNAL(result(KJob*)), this, SLOT(jobFinished(KJob*))); } } @@ -222,7 +222,7 @@ void OpenSearchManager::jobFinished(KJob *job) idleJob(); return; } - + // Do NOT parse if job had same errors or the typed string is empty if (job->error() || _typedText.isEmpty()) { diff --git a/src/opensearch/searchengine.h b/src/opensearch/searchengine.h index 7cd37a67..21678e9d 100644 --- a/src/opensearch/searchengine.h +++ b/src/opensearch/searchengine.h @@ -41,19 +41,19 @@ namespace SearchEngine { - void reload(); - - QString delimiter(); +void reload(); - KService::Ptr defaultEngine(); +QString delimiter(); - KService::List favorites(); +KService::Ptr defaultEngine(); - KService::Ptr fromString(const QString &text); +KService::List favorites(); - QString buildQuery(KService::Ptr engine, const QString &text); +KService::Ptr fromString(const QString &text); - QString extractQuery(const QString &text); +QString buildQuery(KService::Ptr engine, const QString &text); + +QString extractQuery(const QString &text); } #endif diff --git a/src/paneltreeview.cpp b/src/paneltreeview.cpp index ebad68aa..21fc01c8 100644 --- a/src/paneltreeview.cpp +++ b/src/paneltreeview.cpp @@ -44,7 +44,7 @@ PanelTreeView::PanelTreeView(QWidget *parent) : QTreeView(parent) { connect(this, SIGNAL(itemHovered(QString)), parent, SIGNAL(itemHovered(QString))); - connect(this, SIGNAL(openUrl(KUrl,Rekonq::OpenType)), parent, SIGNAL(openUrl(KUrl,Rekonq::OpenType))); + connect(this, SIGNAL(openUrl(KUrl, Rekonq::OpenType)), parent, SIGNAL(openUrl(KUrl, Rekonq::OpenType))); setMouseTracking(true); setExpandsOnDoubleClick(false); } diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index 691ab002..7b6c9318 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -186,7 +186,7 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra (void)new KRun(_url, rApp->mainWindow(), 0, _url.isLocalFile()); return true; } - + // let webkit try to load a known (or missing) protocol... if (KProtocolInfo::isKnownProtocol(_url)) return false; @@ -297,7 +297,7 @@ QString ProtocolHandler::dirHandling(const KFileItemList &list) // 1. default data path QString dataPath = QL1S("file://") + infoFilePath; dataPath.remove(QL1S("/htmls/rekonqinfo.html")); - + // 2. title QString title = _url.prettyUrl(); diff --git a/src/rekonqmenu.cpp b/src/rekonqmenu.cpp index a5d6b1a0..a5cea784 100644 --- a/src/rekonqmenu.cpp +++ b/src/rekonqmenu.cpp @@ -53,7 +53,7 @@ void RekonqMenu::showEvent(QShowEvent* event) if (!m_button) return; - + // Adjust the position of the menu to be shown within the // rekonq window to reduce the cases that sub-menus might overlap // the right screen border. diff --git a/src/searchenginebar.cpp b/src/searchenginebar.cpp index 3bb600de..441facf7 100644 --- a/src/searchenginebar.cpp +++ b/src/searchenginebar.cpp @@ -46,7 +46,7 @@ SearchEngineBar::SearchEngineBar(QWidget *parent) { connect(this, SIGNAL(accepted()), this, SLOT(hideAndDelete())); connect(this, SIGNAL(accepted()), this, SLOT(slotAccepted())); - + connect(this, SIGNAL(rejected()), this, SLOT(hideAndDelete())); connect(this, SIGNAL(rejected()), this, SLOT(slotRejected())); diff --git a/src/searchenginebar.h b/src/searchenginebar.h index 9e5b8efc..7ee1f90c 100644 --- a/src/searchenginebar.h +++ b/src/searchenginebar.h @@ -45,7 +45,7 @@ private Q_SLOTS: void hideAndDelete(); void slotAccepted(); void slotRejected(); - + Q_SIGNALS: void accepted(); void rejected(); diff --git a/src/settings/passexceptionswidget.cpp b/src/settings/passexceptionswidget.cpp index 8813c178..feee4d88 100644 --- a/src/settings/passexceptionswidget.cpp +++ b/src/settings/passexceptionswidget.cpp @@ -38,12 +38,12 @@ PassExWidget::PassExWidget(QWidget *parent) setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); - + connect(removeOneButton, SIGNAL(clicked()), this, SLOT(removeOne())); connect(removeAllButton, SIGNAL(clicked()), this, SLOT(removeAll())); QStringList exList = ReKonfig::walletBlackList(); - Q_FOREACH(const QString &str, exList) + Q_FOREACH(const QString & str, exList) { QListWidgetItem *item = new QListWidgetItem(str, listWidget); listWidget->addItem(item); @@ -54,7 +54,7 @@ PassExWidget::PassExWidget(QWidget *parent) void PassExWidget::removeOne() { QString item = listWidget->takeItem(listWidget->currentRow())->text(); - + QStringList exList = ReKonfig::walletBlackList(); exList.removeOne(item); ReKonfig::setWalletBlackList(exList); @@ -64,7 +64,7 @@ void PassExWidget::removeOne() void PassExWidget::removeAll() { listWidget->clear(); - + QStringList clearList; ReKonfig::setWalletBlackList(clearList); } diff --git a/src/settings/privacywidget.cpp b/src/settings/privacywidget.cpp index bb6aee7b..46774a63 100644 --- a/src/settings/privacywidget.cpp +++ b/src/settings/privacywidget.cpp @@ -49,7 +49,7 @@ PrivacyWidget::PrivacyWidget(QWidget *parent) setupUi(this); reload(); - + // DO NOT TRACK KConfigGroup cg = KConfigGroup(KSharedConfig::openConfig("kioslaverc", KConfig::NoGlobals), QString()); doNotTrackCheckBox->setChecked(cg.readEntry("DoNotTrack", false)); @@ -77,7 +77,7 @@ void PrivacyWidget::save() void PrivacyWidget::reload() { bool b = ReKonfig::javascriptEnabled(); - + kcfg_javascriptCanAccessClipboard->setEnabled(b); kcfg_javascriptCanOpenWindows->setEnabled(b); diff --git a/src/settings/privacywidget.h b/src/settings/privacywidget.h index 8d90260e..229cb7df 100644 --- a/src/settings/privacywidget.h +++ b/src/settings/privacywidget.h @@ -52,10 +52,10 @@ public: Q_SIGNALS: void changed(bool); - + private Q_SLOTS: void hasChanged(); - + void launchCacheSettings(); void launchCookieSettings(); void showPassExceptions(); diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp index 0d5c2542..a45ee7de 100644 --- a/src/settings/settingsdialog.cpp +++ b/src/settings/settingsdialog.cpp @@ -71,7 +71,7 @@ private: WebKitWidget *webkitWidg; PrivacyWidget *privacyWidg; AdvancedWidget *advancedWidg; - + KCModuleProxy *ebrowsingModule; KShortcutsEditor *shortcutsEditor; @@ -163,7 +163,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) connect(d->ebrowsingModule, SIGNAL(changed(bool)), this, SLOT(updateButtons())); connect(d->advancedWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); connect(d->privacyWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); - + connect(d->shortcutsEditor, SIGNAL(keyChange()), this, SLOT(updateButtons())); // save settings @@ -194,7 +194,7 @@ void SettingsDialog::saveSettings() d->ebrowsingModule->save(); d->privacyWidg->reload(); - + SearchEngine::reload(); rApp->opensearchManager()->removeDeletedEngines(); diff --git a/src/sync/googlesynchandler.cpp b/src/sync/googlesynchandler.cpp index 801b7b62..fab3c635 100644 --- a/src/sync/googlesynchandler.cpp +++ b/src/sync/googlesynchandler.cpp @@ -162,7 +162,7 @@ void GoogleSyncHandler::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; @@ -184,8 +184,8 @@ void GoogleSyncHandler::loadFinished(bool ok) - email.setAttribute("value",ReKonfig::syncUser()); - passwd.setAttribute("value",ReKonfig::syncPass()); + email.setAttribute("value", ReKonfig::syncUser()); + passwd.setAttribute("value", ReKonfig::syncPass()); form.evaluateJavaScript("this.submit();"); emit syncStatus(Rekonq::Bookmarks, true, i18n("Signing in...")); @@ -219,7 +219,7 @@ void GoogleSyncHandler::loadFinished(bool ok) if (!_bookmarksToDelete.isEmpty()) { - for (QSet::const_iterator iter=_bookmarksToDelete.constBegin(); iter != _bookmarksToDelete.end(); ++iter) + for (QSet::const_iterator iter = _bookmarksToDelete.constBegin(); iter != _bookmarksToDelete.end(); ++iter) { QNetworkRequest request; request.setUrl(QUrl("https://www.google.com/bookmarks/mark?dlq=" + *iter + "&sig=" + sigKey)); @@ -234,7 +234,7 @@ void GoogleSyncHandler::loadFinished(bool ok) if (!_bookmarksToAdd.isEmpty()) { emit syncStatus(Rekonq::Bookmarks, true, i18n("Adding bookmarks on server...")); - for (QSet::const_iterator iter=_bookmarksToAdd.constBegin(); iter != _bookmarksToAdd.end(); ++iter) + for (QSet::const_iterator iter = _bookmarksToAdd.constBegin(); iter != _bookmarksToAdd.end(); ++iter) { KBookmark bookmark = rApp->bookmarkManager()->bookmarkForUrl(*iter); QByteArray postData; @@ -246,7 +246,7 @@ void GoogleSyncHandler::loadFinished(bool ok) postData.append("&sig=" + sigKey.toUtf8()); QNetworkRequest request; - request.setUrl(QUrl("https://www.google.com/bookmarks/mark?sig=" + sigKey +"&btnA")); + request.setUrl(QUrl("https://www.google.com/bookmarks/mark?sig=" + sigKey + "&btnA")); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); kDebug() << "Url: " << request.url(); kDebug() << "Post data is :" << postData; @@ -293,11 +293,11 @@ void GoogleSyncHandler::fetchingBookmarksFinished() if (_mode == RECEIVE_CHANGES) { - for (int i=0; ibookmarkForUrl(KUrl(url)); if (bookmark.isNull()) @@ -350,7 +350,7 @@ QString GoogleSyncHandler::getChildElement(const QDomNode &node, QString name) { QDomNodeList nodes = node.childNodes(); - for (int j=0; jbookmarkForUrl(KUrl(url)); if (result.isNull()) { kDebug() << "Deleting from Google Bookmarks: " << url; - _bookmarksToDelete.insert(getChildElement(bookmarksOnServer.at(i),"id")); + _bookmarksToDelete.insert(getChildElement(bookmarksOnServer.at(i), "id")); } } diff --git a/src/sync/syncassistant.cpp b/src/sync/syncassistant.cpp index 0e51e7b7..651cad75 100644 --- a/src/sync/syncassistant.cpp +++ b/src/sync/syncassistant.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or @@ -36,6 +36,7 @@ #include "syncftpsettingswidget.h" #include "syncgooglesettingswidget.h" + SyncAssistant::SyncAssistant(QWidget *parent) : QWizard(parent) { diff --git a/src/sync/syncassistant.h b/src/sync/syncassistant.h index 9853cb2d..e09db71a 100644 --- a/src/sync/syncassistant.h +++ b/src/sync/syncassistant.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or @@ -42,7 +42,7 @@ public: Page_Data, Page_Type, Page_FTP_Settings, - Page_Google_Settings, + Page_Google_Settings, Page_Check }; diff --git a/src/sync/synccheckwidget.cpp b/src/sync/synccheckwidget.cpp index 27f19721..5fdf5cd7 100644 --- a/src/sync/synccheckwidget.cpp +++ b/src/sync/synccheckwidget.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or @@ -130,7 +130,7 @@ void SyncCheckWidget::initializePage() rApp->syncManager()->loadSettings(); SyncHandler *h = rApp->syncManager()->handler(); - connect(h, SIGNAL(syncStatus(Rekonq::SyncData,bool,QString)), this, SLOT(updateWidget(Rekonq::SyncData,bool,QString))); + connect(h, SIGNAL(syncStatus(Rekonq::SyncData, bool, QString)), this, SLOT(updateWidget(Rekonq::SyncData, bool, QString))); } diff --git a/src/sync/synccheckwidget.h b/src/sync/synccheckwidget.h index 5cec1591..312fe9b4 100644 --- a/src/sync/synccheckwidget.h +++ b/src/sync/synccheckwidget.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/sync/syncdatawidget.cpp b/src/sync/syncdatawidget.cpp index 8b6ca8e3..fe3637b1 100644 --- a/src/sync/syncdatawidget.cpp +++ b/src/sync/syncdatawidget.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/sync/syncdatawidget.h b/src/sync/syncdatawidget.h index 30d1ae34..b1676384 100644 --- a/src/sync/syncdatawidget.h +++ b/src/sync/syncdatawidget.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/sync/syncgooglesettingswidget.cpp b/src/sync/syncgooglesettingswidget.cpp index c927a741..0a357d4f 100644 --- a/src/sync/syncgooglesettingswidget.cpp +++ b/src/sync/syncgooglesettingswidget.cpp @@ -1,8 +1,9 @@ /* ============================================================ * * This file is a part of the rekonq project +* * Copyright (C) 2012 by Siteshwar Vashisht -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/sync/syncgooglesettingswidget.h b/src/sync/syncgooglesettingswidget.h index 25c55dba..a51b1d2c 100644 --- a/src/sync/syncgooglesettingswidget.h +++ b/src/sync/syncgooglesettingswidget.h @@ -2,8 +2,8 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Siteshwar Vashisht -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Siteshwar Vashisht +* Copyright (C) 2011-20112 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/sync/synchosttypewidget.cpp b/src/sync/synchosttypewidget.cpp index 32fd1f9f..d52baf34 100644 --- a/src/sync/synchosttypewidget.cpp +++ b/src/sync/synchosttypewidget.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or @@ -42,8 +42,8 @@ SyncHostTypeWidget::SyncHostTypeWidget(QWidget *parent) if (ReKonfig::syncType() == 0) ftpRadioButton->setChecked(true); - else if(ReKonfig::syncType() == 1) - googleRadioButton->setChecked(true); + else if (ReKonfig::syncType() == 1) + googleRadioButton->setChecked(true); else nullRadioButton->setChecked(true); } @@ -57,11 +57,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 { ReKonfig::setSyncType(2); diff --git a/src/sync/synchosttypewidget.h b/src/sync/synchosttypewidget.h index 66408825..bc16f00b 100644 --- a/src/sync/synchosttypewidget.h +++ b/src/sync/synchosttypewidget.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/sync/syncmanager.cpp b/src/sync/syncmanager.cpp index 29e76414..aeb543d0 100644 --- a/src/sync/syncmanager.cpp +++ b/src/sync/syncmanager.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or @@ -74,8 +74,8 @@ void SyncManager::loadSettings() delete _syncImplementation.data(); _syncImplementation.clear(); } - - switch(ReKonfig::syncType()) + + switch (ReKonfig::syncType()) { case 0: _syncImplementation = new FTPSyncHandler(this); diff --git a/src/sync/syncmanager.h b/src/sync/syncmanager.h index cd7dbefa..586f3c4d 100644 --- a/src/sync/syncmanager.h +++ b/src/sync/syncmanager.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2011 by Andrea Diamantini +* Copyright (C) 2011-2012 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/tabbar.cpp b/src/tabbar.cpp index e3bcf3eb..2ce0cb39 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -88,7 +88,7 @@ TabBar::TabBar(QWidget *parent) setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(contextMenu(int,QPoint)), this, SLOT(contextMenu(int,QPoint))); + connect(this, SIGNAL(contextMenu(int, QPoint)), this, SLOT(contextMenu(int, QPoint))); connect(this, SIGNAL(emptyAreaContextMenu(QPoint)), this, SLOT(emptyAreaContextMenu(QPoint))); connect(m_animationMapper, SIGNAL(mapped(int)), this, SLOT(removeAnimation(int))); diff --git a/src/thumbupdater.cpp b/src/thumbupdater.cpp index e230b87f..01323c44 100644 --- a/src/thumbupdater.cpp +++ b/src/thumbupdater.cpp @@ -70,8 +70,8 @@ void ThumbUpdater::updateImage(bool ok) KUrl u(_url); QString previewPath = ok - ? QL1S("file://") + WebSnap::imagePathFromUrl(u) - : rApp->iconManager()->iconPathForUrl(u) + ? QL1S("file://") + WebSnap::imagePathFromUrl(u) + : rApp->iconManager()->iconPathForUrl(u) ; _thumb.findFirst(QL1S(".preview img")).setAttribute(QL1S("src"), previewPath); diff --git a/src/thumbupdater.h b/src/thumbupdater.h index 5bd858cf..2544969f 100644 --- a/src/thumbupdater.h +++ b/src/thumbupdater.h @@ -45,10 +45,10 @@ public: ~ThumbUpdater(); void updateThumb(); - + private Q_SLOTS: void updateImage(bool); - + private: QWebElement _thumb; QString _url; diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp index d3bcd41b..2b76073e 100644 --- a/src/urlbar/bookmarkwidget.cpp +++ b/src/urlbar/bookmarkwidget.cpp @@ -4,6 +4,7 @@ * * Copyright (C) 2010-2011 by Yoann Laissus * Copyright (C) 2012 by Andrea Diamantini +* Copyright (c) 2011-2012 by Phaneendra Hegde * * * This program is free software; you can redistribute it and/or @@ -55,11 +56,11 @@ #include "../config-nepomuk.h" #ifdef HAVE_NEPOMUK - // Local Nepomuk Includes - #include "resourcelinkdialog.h" +// Local Nepomuk Includes +#include "resourcelinkdialog.h" - //Nepomuk Includes - #include +//Nepomuk Includes +#include #endif @@ -76,7 +77,7 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) m_isNepomukEnabled = QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.NepomukServer"); kDebug() << "IS NEPOMUK ACTUALLY RUNNING? " << m_isNepomukEnabled; #endif - + QFormLayout *layout = new QFormLayout(this); layout->setHorizontalSpacing(20); @@ -89,14 +90,14 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) bookmarkInfo->setFont(f); // Remove button - QLabel *removeLabel = new QLabel( this ); - removeLabel->setText( i18n( "Remove" ) ); - removeLabel->setAlignment( Qt::AlignRight ); + QLabel *removeLabel = new QLabel(this); + removeLabel->setText(i18n("Remove")); + removeLabel->setAlignment(Qt::AlignRight); hLayout->addWidget(bookmarkInfo); hLayout->addWidget(removeLabel); layout->addRow(hLayout); - connect(removeLabel, SIGNAL( linkActivated(QString) ), this, SLOT( removeBookmark() )); + connect(removeLabel, SIGNAL(linkActivated(QString)), this, SLOT(removeBookmark())); //Bookmark Folder QLabel *folderLabel = new QLabel(this); @@ -126,51 +127,51 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) if (m_isNepomukEnabled) { QLabel* rateLabel = new QLabel(this); - rateLabel->setText( i18n( "Rate:" ) ); - KRatingWidget *ratingWidget = new KRatingWidget( this ); - if ( m_nfoResource.rating() != NULL ) + rateLabel->setText(i18n("Rate:")); + KRatingWidget *ratingWidget = new KRatingWidget(this); + if (m_nfoResource.rating() != 0) { - ratingWidget->setRating( m_nfoResource.rating() ); + ratingWidget->setRating(m_nfoResource.rating()); } - connect( ratingWidget, SIGNAL( ratingChanged( int ) ), this, SLOT( setRatingSlot( int ) ) ); - ratingWidget->setToolTip( i18n( "Rate this page" ) ); - layout->addRow( rateLabel,ratingWidget ); + connect(ratingWidget, SIGNAL(ratingChanged(int)), this, SLOT(setRatingSlot(int))); + ratingWidget->setToolTip(i18n("Rate this page")); + layout->addRow(rateLabel, ratingWidget); //Add comments - QLabel *commentLabel = new QLabel( this ); - commentLabel->setText( i18n( "Describe:" ) ); - commentLabel->setAlignment( Qt::AlignCenter ); - m_commentEdit = new QPlainTextEdit( this ); - if ( !m_nfoResource.description().isEmpty() ) + QLabel *commentLabel = new QLabel(this); + commentLabel->setText(i18n("Describe:")); + commentLabel->setAlignment(Qt::AlignCenter); + m_commentEdit = new QPlainTextEdit(this); + if (!m_nfoResource.description().isEmpty()) { - m_commentEdit->setPlainText( m_nfoResource.description() ); + m_commentEdit->setPlainText(m_nfoResource.description()); } - connect( m_commentEdit, SIGNAL(textChanged()), this, SLOT(addCommentSlot()) ); - layout->addRow( commentLabel, m_commentEdit ); + connect(m_commentEdit, SIGNAL(textChanged()), this, SLOT(addCommentSlot())); + layout->addRow(commentLabel, m_commentEdit); // Create tags - QLabel *tagLabel = new QLabel( this ); - tagLabel->setText( i18n( "Tags:" ) ); - tagLabel->setAlignment( Qt::AlignLeft ); - m_tagLine = new KLineEdit( this ); - m_tagLine->setPlaceholderText( i18n( "add tags(comma separated)" ) ); + QLabel *tagLabel = new QLabel(this); + tagLabel->setText(i18n("Tags:")); + tagLabel->setAlignment(Qt::AlignLeft); + m_tagLine = new KLineEdit(this); + m_tagLine->setPlaceholderText(i18n("add tags(comma separated)")); QList tagList = Nepomuk::Tag::allTags(); - Q_FOREACH(Nepomuk::Tag t,tagList) + Q_FOREACH(Nepomuk::Tag t, tagList) { m_tList.append(t.label()); } - QCompleter *completeTag = new QCompleter( m_tList ); + QCompleter *completeTag = new QCompleter(m_tList); completeTag->setCompletionMode(QCompleter::PopupCompletion); m_tagLine->setCompleter(completeTag); loadTags(); - layout->addRow(tagLabel,m_tagLine); + layout->addRow(tagLabel, m_tagLine); - QPushButton *linkToResource = new QPushButton( this ); - linkToResource->setText( i18n( "Link Resources" ) ); - connect(linkToResource, SIGNAL(clicked()), this, SLOT( linkToResourceSlot() ) ); + QPushButton *linkToResource = new QPushButton(this); + linkToResource->setText(i18n("Link Resources")); + connect(linkToResource, SIGNAL(clicked()), this, SLOT(linkToResourceSlot())); layout->addWidget(linkToResource); } else @@ -183,7 +184,7 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) layout->addWidget(nepomukLabel); } #endif - + // Ok & Cancel buttons QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); @@ -229,7 +230,7 @@ void BookmarkWidget::accept() parseTags(); } #endif - + close(); } @@ -287,77 +288,77 @@ void BookmarkWidget::removeBookmark() #ifdef HAVE_NEPOMUK - void BookmarkWidget::addTags(QList tagList) +void BookmarkWidget::addTags(QList tagList) +{ + Q_FOREACH(const Nepomuk::Tag & tag, tagList) { - foreach ( const Nepomuk::Tag &tag,tagList) + if (!m_nfoResource.tags().contains(tag)) { - if (!m_nfoResource.tags().contains(tag)) - { - m_nfoResource.addTag(tag); - } - } - foreach ( Nepomuk::Tag tag,m_nfoResource.tags()) - { - if (!tagList.contains(tag)) - { - tag.remove(); - } + m_nfoResource.addTag(tag); } } - - void BookmarkWidget::parseTags() + Q_FOREACH(Nepomuk::Tag tag, m_nfoResource.tags()) { - QList tagList; - if(m_tagLine->text().contains(',')) - { - QString text = m_tagLine->text(); - QStringList tagStringList = text.split( QChar::fromAscii(',') ); - - foreach( const QString &tag, tagStringList ) - { - QString trimmedTag = tag.trimmed(); - if (!trimmedTag.isEmpty()) - tagList << trimmedTag; - } - } - else + if (!tagList.contains(tag)) { - tagList << m_tagLine->text().trimmed(); + tag.remove(); } - addTags(tagList); } +} - - void BookmarkWidget::loadTags() +void BookmarkWidget::parseTags() +{ + QList tagList; + if (m_tagLine->text().contains(',')) { - QString list; - if(!m_nfoResource.tags().isEmpty()) + QString text = m_tagLine->text(); + QStringList tagStringList = text.split(QChar::fromAscii(',')); + + Q_FOREACH(const QString & tag, tagStringList) { - foreach( const Nepomuk::Tag &tag, m_nfoResource.tags() ) - { - list.append(tag.genericLabel()); - list.append(","); - } - m_tagLine->setText(list); + QString trimmedTag = tag.trimmed(); + if (!trimmedTag.isEmpty()) + tagList << trimmedTag; } } - - - void BookmarkWidget::setRatingSlot( int rate ) + else { - m_nfoResource.setRating(rate); + tagList << m_tagLine->text().trimmed(); } + addTags(tagList); +} + - - void BookmarkWidget::addCommentSlot() +void BookmarkWidget::loadTags() +{ + QString list; + if (!m_nfoResource.tags().isEmpty()) { - m_nfoResource.setDescription(m_commentEdit->toPlainText()); + Q_FOREACH(const Nepomuk::Tag & tag, m_nfoResource.tags()) + { + list.append(tag.genericLabel()); + list.append(","); + } + m_tagLine->setText(list); } +} - void BookmarkWidget::linkToResourceSlot() - { - Nepomuk::ResourceLinkDialog r( m_nfoResource ); - r.exec(); - } +void BookmarkWidget::setRatingSlot(int rate) +{ + m_nfoResource.setRating(rate); +} + + +void BookmarkWidget::addCommentSlot() +{ + m_nfoResource.setDescription(m_commentEdit->toPlainText()); +} + + +void BookmarkWidget::linkToResourceSlot() +{ + Nepomuk::ResourceLinkDialog r(m_nfoResource); + r.exec(); +} #endif diff --git a/src/urlbar/bookmarkwidget.h b/src/urlbar/bookmarkwidget.h index 41dd344e..6dc1b761 100644 --- a/src/urlbar/bookmarkwidget.h +++ b/src/urlbar/bookmarkwidget.h @@ -4,6 +4,7 @@ * * Copyright (C) 2010-2011 by Yoann Laissus * Copyright (C) 2012 by Andrea Diamantini +* Copyright (c) 2011-2012 by Phaneendra Hegde * * * This program is free software; you can redistribute it and/or @@ -37,10 +38,12 @@ #include "../config-nepomuk.h" #ifdef HAVE_NEPOMUK - // Nepomuk Includes - #include - #include - #include + +// Nepomuk Includes +#include +#include +#include + #endif // Forward Declarations @@ -59,28 +62,28 @@ public: void showAt(const QPoint &pos); -#ifdef HAVE_NEPOMUK +#ifdef HAVE_NEPOMUK void addTags(QList); void parseTags(); void loadTags(); #endif - + Q_SIGNALS: void updateIcon(); private: void setupFolderComboBox(); - + private Q_SLOTS: void accept(); void removeBookmark(); #ifdef HAVE_NEPOMUK - void setRatingSlot( int rate ); + void setRatingSlot(int rate); void addCommentSlot(); void linkToResourceSlot(); #endif - + private: KBookmark *m_bookmark; KLineEdit *m_name; @@ -89,7 +92,7 @@ private: QPlainTextEdit *m_commentEdit; QStringList m_tList; -#ifdef HAVE_NEPOMUK +#ifdef HAVE_NEPOMUK Nepomuk::Resource m_nfoResource; bool m_isNepomukEnabled; #endif diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp index 92ef4fb9..fa38d7f0 100644 --- a/src/urlbar/completionwidget.cpp +++ b/src/urlbar/completionwidget.cpp @@ -73,9 +73,9 @@ void CompletionWidget::insertItems(const UrlSearchList &list, const QString& tex ListItem *suggestion = ListItemFactory::create(item, text, this); suggestion->setBackgroundRole(offset % 2 ? QPalette::AlternateBase : QPalette::Base); connect(suggestion, - SIGNAL(itemClicked(ListItem*,Qt::MouseButton,Qt::KeyboardModifiers)), + SIGNAL(itemClicked(ListItem*, Qt::MouseButton, Qt::KeyboardModifiers)), this, - SLOT(itemChosen(ListItem*,Qt::MouseButton,Qt::KeyboardModifiers))); + SLOT(itemChosen(ListItem*, Qt::MouseButton, Qt::KeyboardModifiers))); connect(suggestion, SIGNAL(updateList()), this, SLOT(updateList())); connect(this, SIGNAL(nextItemSubChoice()), suggestion, SLOT(nextItemSubChoice())); @@ -384,8 +384,8 @@ void CompletionWidget::suggestUrls(const QString &text) } UrlResolver *res = new UrlResolver(text); - connect(res, SIGNAL(suggestionsReady(UrlSearchList,QString)), - this, SLOT(updateSearchList(UrlSearchList,QString))); + connect(res, SIGNAL(suggestionsReady(UrlSearchList, QString)), + this, SLOT(updateSearchList(UrlSearchList, QString))); _resList = res->orderedSearchItems(); // NOTE: It's important to call this AFTER orderedSearchItems() to let everything work diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index 92552e7e..8b753569 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -391,8 +391,8 @@ ImageLabel::ImageLabel(const QString &url, int width, int height, QWidget *paren else { KIO::TransferJob *job = KIO::get(KUrl(url), KIO::NoReload, KIO::HideProgressInfo); - connect(job, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(slotData(KJob*,QByteArray))); + connect(job, SIGNAL(data(KIO::Job*, QByteArray)), + this, SLOT(slotData(KJob*, QByteArray))); connect(job, SIGNAL(result(KJob*)), this, SLOT(slotResult(KJob*))); } diff --git a/src/urlbar/newresourcedialog.cpp b/src/urlbar/newresourcedialog.cpp index 9e0ed223..39cffc36 100644 --- a/src/urlbar/newresourcedialog.cpp +++ b/src/urlbar/newresourcedialog.cpp @@ -1,37 +1,45 @@ -/* - This is a part of the GSoC project - Fancy Bookmarking - Copyright 2011 Phaneendra Hegde +/* ============================================================ +* +* This is a part of the GSoC project 2011 - Fancy Bookmarking +* +* Copyright (c) 2011-2012 by Phaneendra Hegde +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -//Local Includes +// Self Includes #include "newresourcedialog.h" +#include "newresourcedialog.moc" -//Nepomuk Includes +// Nepomuk Includes #include #include #include #include -//Qt Includes +// Qt Includes #include #include #include + class Nepomuk::NewResourceDialog::Private { public: @@ -45,30 +53,30 @@ public: }; -Nepomuk::NewResourceDialog::NewResourceDialog( int index, Nepomuk::Resource& nfoResource, QWidget* parent ): - KDialog( parent ), - d( new Private() ) +Nepomuk::NewResourceDialog::NewResourceDialog(int index, Nepomuk::Resource& nfoResource, QWidget* parent): + KDialog(parent), + d(new Private()) { d->q = this; d->m_index = index; - d->m_nofResource =nfoResource; - setWindowTitle( i18n( "Link to new Resource" ) ); - setButtonText( Ok, i18n( "Link" ) ); - setMinimumSize( 200, 150 ); + d->m_nofResource = nfoResource; + setWindowTitle(i18n("Link to new Resource")); + setButtonText(Ok, i18n("Link")); + setMinimumSize(200, 150); - QVBoxLayout *layout = new QVBoxLayout( mainWidget() ); - d->m_resourceName = new KLineEdit( mainWidget() ); - d->m_titleResource = new QLabel( mainWidget() ); - d->m_titleResource->setText( i18n( "* Resource Name:" ) ); - layout->addWidget( d->m_titleResource ); - layout->addWidget( d->m_resourceName ); - d->m_description = new QPlainTextEdit( mainWidget() ); - d->m_desResource = new QLabel( mainWidget() ); - d->m_desResource->setText( i18n( "Description (Optional)" )); - layout->addWidget( d->m_desResource); - layout->addWidget( d->m_description ); + QVBoxLayout *layout = new QVBoxLayout(mainWidget()); + d->m_resourceName = new KLineEdit(mainWidget()); + d->m_titleResource = new QLabel(mainWidget()); + d->m_titleResource->setText(i18n("* Resource Name:")); + layout->addWidget(d->m_titleResource); + layout->addWidget(d->m_resourceName); + d->m_description = new QPlainTextEdit(mainWidget()); + d->m_desResource = new QLabel(mainWidget()); + d->m_desResource->setText(i18n("Description (Optional)")); + layout->addWidget(d->m_desResource); + layout->addWidget(d->m_description); - connect( this, SIGNAL( okClicked() ), this, SLOT( newResourceSlot() ) ); + connect(this, SIGNAL(okClicked()), this, SLOT(newResourceSlot())); } @@ -80,29 +88,34 @@ Nepomuk::NewResourceDialog::~NewResourceDialog() void Nepomuk::NewResourceDialog::newResourceSlot() { - if( d->m_index == 1 ) { - Nepomuk::Resource newResource( d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Person() ); - newResource.addSymbol( "user-identity" ); - d->m_nofResource.addIsRelated( newResource ); + if (d->m_index == 1) + { + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Person()); + newResource.addSymbol("user-identity"); + d->m_nofResource.addIsRelated(newResource); } - else if( d->m_index == 2 ) { - Nepomuk::Resource newResource( d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Project() ); - newResource.addSymbol( "project-development" ); - d->m_nofResource.addIsRelated( newResource ); + else if (d->m_index == 2) + { + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Project()); + newResource.addSymbol("project-development"); + d->m_nofResource.addIsRelated(newResource); } - else if( d->m_index == 3 ) { - Nepomuk::Resource newResource( d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Task() ); - newResource.addSymbol( "view-pim-tasks" ); - d->m_nofResource.addIsRelated( newResource ); + else if (d->m_index == 3) + { + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Task()); + newResource.addSymbol("view-pim-tasks"); + d->m_nofResource.addIsRelated(newResource); } - else if( d->m_index == 4 ) { - Nepomuk::Resource newResource( d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Location() ); - newResource.addSymbol( "user-location" ); - d->m_nofResource.addIsRelated( newResource ); + else if (d->m_index == 4) + { + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Location()); + newResource.addSymbol("user-location"); + d->m_nofResource.addIsRelated(newResource); } - else if( d->m_index == 5 ) { - Nepomuk::Resource newResource( d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Note() ); - newResource.addSymbol( "knotes" ); - d->m_nofResource.addIsRelated( newResource ); + else if (d->m_index == 5) + { + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Note()); + newResource.addSymbol("knotes"); + d->m_nofResource.addIsRelated(newResource); } } diff --git a/src/urlbar/newresourcedialog.h b/src/urlbar/newresourcedialog.h index 0bfcd0ba..f8aa5f48 100644 --- a/src/urlbar/newresourcedialog.h +++ b/src/urlbar/newresourcedialog.h @@ -1,32 +1,40 @@ -/* - This is a part of the GSoC project - Fancy Bookmarking - Copyright 2011 Phaneendra Hegde - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ +/* ============================================================ +* +* This is a part of the GSoC project 2011 - Fancy Bookmarking +* +* Copyright (c) 2011-2012 by Phaneendra Hegde +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ + #ifndef NEWRESOURCEDIALOG_H #define NEWRESOURCEDIALOG_H -//kde includes + +// KDE Includes #include #include #include + namespace Nepomuk { class NewResourceDialog : public KDialog @@ -34,17 +42,16 @@ namespace Nepomuk Q_OBJECT public: - explicit NewResourceDialog( int index,Nepomuk::Resource& nfoResource, QWidget* parent = 0 ); + explicit NewResourceDialog(int index, Nepomuk::Resource& nfoResource, QWidget* parent = 0); virtual ~NewResourceDialog(); private Q_SLOTS: - void newResourceSlot(); + void newResourceSlot(); private: class Private; Private* const d; }; - } #endif // NEWRESOURCEDIALOG_H diff --git a/src/urlbar/resourcelinkdialog.cpp b/src/urlbar/resourcelinkdialog.cpp index 9c2ab203..8a4b5685 100644 --- a/src/urlbar/resourcelinkdialog.cpp +++ b/src/urlbar/resourcelinkdialog.cpp @@ -1,32 +1,41 @@ -/* - This is a part of the GSoC project - Fancy Bookmarking - Copyright 2011 Phaneendra Hegde - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -//Local Includes +/* ============================================================ +* +* This is a part of the GSoC project 2011 - Fancy Bookmarking +* +* Copyright (c) 2011-2012 by Phaneendra Hegde +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ + + +// Self Includes #include "resourcelinkdialog.h" +#include "resourcelinkdialog.moc" + +// Local Includes #include "newresourcedialog.h" -//Qt Includes -#include -#include -#include -#include +// Qt Includes +#include +#include +#include +#include #include #include #include @@ -38,13 +47,13 @@ #include #include -//KDE Includes +// KDE Includes #include #include #include #include -//Nepomuk Includes +// Nepomuk Includes #include #include #include @@ -79,101 +88,106 @@ public: }; + void Nepomuk::ResourceLinkDialog::Private::_k_selectionChanged() { - q->enableButton( KDialog::User1, !m_resourceView->selectionModel()->selectedRows().isEmpty() ); + q->enableButton(KDialog::User1, !m_resourceView->selectionModel()->selectedRows().isEmpty()); } -Nepomuk::ResourceLinkDialog::ResourceLinkDialog( Nepomuk::Resource &nfoResource, QWidget* parent ): - KDialog( parent ), - d( new Private() ) +Nepomuk::ResourceLinkDialog::ResourceLinkDialog(Nepomuk::Resource &nfoResource, QWidget* parent): + KDialog(parent), + d(new Private()) { d->m_nfoResource = nfoResource; - setWindowTitle( i18n( "Resource Linker" ) ); - setButtons( Ok | User1 | User2 | Cancel ); - enableButtonCancel( true ); - enableButtonOk( true ); - enableButton( User1, false ); - setButtonText( Ok, i18n( "Done" ) ); - setButtonText( User1, i18n( "Link" ) ); - setButtonText( User2, "Unlink" ); - setMinimumSize(400,350); + setWindowTitle(i18n("Resource Linker")); + setButtons(Ok | User1 | User2 | Cancel); + enableButtonCancel(true); + enableButtonOk(true); + enableButton(User1, false); + setButtonText(Ok, i18n("Done")); + setButtonText(User1, i18n("Link")); + setButtonText(User2, "Unlink"); + setMinimumSize(400, 350); // d->m_resourceView->setSelectionMode(QAbstractItemView::ExtendedSelection); - QGridLayout *mainLayout = new QGridLayout ( mainWidget() ); + QGridLayout *mainLayout = new QGridLayout(mainWidget()); d->q = this; - d->m_linkedResources = new QListView ( mainWidget() ); - d->m_linkedResourceModel = new Utils::SimpleResourceModel( this ); - d->m_linkedResources->setModel( d->m_linkedResourceModel ); + d->m_linkedResources = new QListView(mainWidget()); + d->m_linkedResourceModel = new Utils::SimpleResourceModel(this); + d->m_linkedResources->setModel(d->m_linkedResourceModel); setRelatedResources(); - d->m_searchBox = new KLineEdit ( mainWidget() ); - d->m_searchBox->setPlaceholderText( i18n( "Search resources" ) ); - connect( d->m_searchBox, SIGNAL( textChanged( QString ) ), this, SLOT( dynamicSearchingSlot() ) ); + d->m_searchBox = new KLineEdit(mainWidget()); + d->m_searchBox->setPlaceholderText(i18n("Search resources")); + connect(d->m_searchBox, SIGNAL(textChanged(QString)), this, SLOT(dynamicSearchingSlot())); - d->m_resourceView = new QListView ( mainWidget() ); - d->m_resourceView->setToolTip( i18n( " Double click to link resource ") ); - d->m_resourceModel = new Utils::SimpleResourceModel( this ); - d->m_resourceView->setModel( d->m_resourceModel ); + d->m_resourceView = new QListView(mainWidget()); + d->m_resourceView->setToolTip(i18n(" Double click to link resource ")); + d->m_resourceModel = new Utils::SimpleResourceModel(this); + d->m_resourceView->setModel(d->m_resourceModel); - d->m_resourceSelect = new QComboBox( mainWidget() ); + d->m_resourceSelect = new QComboBox(mainWidget()); QStringList rlist; - rlist << i18n( "Any resource" ) << i18n( "Persons" ) << i18n( "Projects" ) << i18n( "Tasks" ) << i18n( "Places" ) << i18n( "Notes" ); - d->m_resourceSelect->addItems( rlist ); - d->m_resourceSelect->setItemIcon(1,KIcon("user-identity")); - d->m_resourceSelect->setItemIcon(2,KIcon("project-development")); - d->m_resourceSelect->setItemIcon(3,KIcon("view-pim-tasks")); - d->m_resourceSelect->setItemIcon(4,KIcon("user-location")); - d->m_resourceSelect->setItemIcon(5,KIcon("knotes")); - connect( d->m_resourceSelect, SIGNAL( currentIndexChanged( int ) ), this, SLOT( resourceSelectedSlot( int ) ) ); - - d->m_resourceLabel = new QLabel( i18n( "Matching resources:" ), mainWidget() ); - d->m_linkedResourceLabel = new QLabel( i18n( "Linked Resources:" ), mainWidget() ); - - - d->m_newResourceButton = new QPushButton( mainWidget() ); - d->m_newResourceButton->setText( i18n( "Create New Resource" ) ); - if( d->m_resourceSelect->currentIndex() == 0 ) { - d->m_newResourceButton->setEnabled( false ); + rlist << i18n("Any resource") << i18n("Persons") << i18n("Projects") << i18n("Tasks") << i18n("Places") << i18n("Notes"); + d->m_resourceSelect->addItems(rlist); + d->m_resourceSelect->setItemIcon(1, KIcon("user-identity")); + d->m_resourceSelect->setItemIcon(2, KIcon("project-development")); + d->m_resourceSelect->setItemIcon(3, KIcon("view-pim-tasks")); + d->m_resourceSelect->setItemIcon(4, KIcon("user-location")); + d->m_resourceSelect->setItemIcon(5, KIcon("knotes")); + connect(d->m_resourceSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(resourceSelectedSlot(int))); + + d->m_resourceLabel = new QLabel(i18n("Matching resources:"), mainWidget()); + d->m_linkedResourceLabel = new QLabel(i18n("Linked Resources:"), mainWidget()); + + + d->m_newResourceButton = new QPushButton(mainWidget()); + d->m_newResourceButton->setText(i18n("Create New Resource")); + if (d->m_resourceSelect->currentIndex() == 0) + { + d->m_newResourceButton->setEnabled(false); } - connect(d->m_newResourceButton, SIGNAL( clicked() ), this, SLOT( createNewResourceSlot() ) ); + connect(d->m_newResourceButton, SIGNAL(clicked()), this, SLOT(createNewResourceSlot())); QVBoxLayout *vlayoutR = new QVBoxLayout; QVBoxLayout *vlayoutL = new QVBoxLayout; - vlayoutL->addWidget( d->m_searchBox ); - vlayoutL->addWidget( d->m_resourceLabel ); - vlayoutL->addWidget( d->m_resourceView ); - vlayoutR->addWidget( d->m_resourceSelect ); - vlayoutR->addWidget( d->m_linkedResourceLabel ); - vlayoutR->addWidget( d->m_linkedResources ); - vlayoutR->addWidget( d->m_newResourceButton ); - mainLayout->addLayout( vlayoutL, 1 ,1 ); + vlayoutL->addWidget(d->m_searchBox); + vlayoutL->addWidget(d->m_resourceLabel); + vlayoutL->addWidget(d->m_resourceView); + vlayoutR->addWidget(d->m_resourceSelect); + vlayoutR->addWidget(d->m_linkedResourceLabel); + vlayoutR->addWidget(d->m_linkedResources); + vlayoutR->addWidget(d->m_newResourceButton); + mainLayout->addLayout(vlayoutL, 1 , 1); mainLayout->addLayout(vlayoutR, 1, 2); - mainLayout->setColumnMinimumWidth(1,100); + mainLayout->setColumnMinimumWidth(1, 100); -// d->m_linkedResources->setContextMenuPolicy(Qt::CustomContextMenu); d->m_linkedResources->setContextMenuPolicy(Qt::CustomContextMenu); - connect( d->m_resourceView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), - this, SLOT(_k_selectionChanged()) ); - connect ( d->m_linkedResources->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), - this, SLOT( _k_selectionChanged() ) ); - connect ( this, SIGNAL( user1Clicked() ), this, SLOT( linkResourceSlot() ) ); - connect ( this, SIGNAL( user2Clicked() ), this, SLOT( unlinkResourceSlot() ) ); - connect ( d->m_resourceView, SIGNAL( doubleClicked(QModelIndex) ), this, SLOT( linkResourceSlot() ) ); - connect (d->m_linkedResources, SIGNAL( customContextMenuRequested(QPoint) ), this, SLOT( showContextMenu(QPoint) ) ); - if( !d->m_linkedResources->selectionModel()->selectedRows().isEmpty() ) { - enableButton( User2, true ); + connect(d->m_resourceView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), + this, SLOT(_k_selectionChanged())); + connect(d->m_linkedResources->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), + this, SLOT(_k_selectionChanged())); + connect(this, SIGNAL(user1Clicked()), this, SLOT(linkResourceSlot())); + connect(this, SIGNAL(user2Clicked()), this, SLOT(unlinkResourceSlot())); + connect(d->m_resourceView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(linkResourceSlot())); + connect(d->m_linkedResources, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); + + if (!d->m_linkedResources->selectionModel()->selectedRows().isEmpty()) + { + enableButton(User2, true); } } + Nepomuk::ResourceLinkDialog::~ResourceLinkDialog() { delete d; } + void Nepomuk::ResourceLinkDialog::setRelatedResources() { QList relatedResourceList = d->m_nfoResource.isRelateds(); @@ -181,167 +195,191 @@ void Nepomuk::ResourceLinkDialog::setRelatedResources() } + void Nepomuk::ResourceLinkDialog::linkResourceSlot() { QModelIndexList selectedResourceList; selectedResourceList << d->m_resourceView->selectionModel()->selectedIndexes(); - Q_FOREACH(const QModelIndex& i, selectedResourceList) { - d->m_resourceView->selectionModel()->setCurrentIndex( i, QItemSelectionModel::NoUpdate ); - d->m_nfoResource.addIsRelated( d->m_resourceModel->resourceForIndex(d->m_resourceView->selectionModel()->currentIndex() ) ); + Q_FOREACH(const QModelIndex & i, selectedResourceList) + { + d->m_resourceView->selectionModel()->setCurrentIndex(i, QItemSelectionModel::NoUpdate); + d->m_nfoResource.addIsRelated(d->m_resourceModel->resourceForIndex(d->m_resourceView->selectionModel()->currentIndex())); } setRelatedResources(); } + void Nepomuk::ResourceLinkDialog::unlinkResourceSlot() { - d->m_nfoResource.removeProperty( Nepomuk::Resource::isRelatedUri(), + d->m_nfoResource.removeProperty(Nepomuk::Resource::isRelatedUri(), d->m_linkedResourceModel->resourceForIndex( - d->m_linkedResources->selectionModel()->currentIndex() ) ); + d->m_linkedResources->selectionModel()->currentIndex())); setRelatedResources(); } + void Nepomuk::ResourceLinkDialog::showContextMenu(const QPoint &pos) { d->m_removeResourceAction = new KAction(this); d->m_removeResourceAction->setText(i18n("&Unlink ")); d->m_removeResourceAction->setIcon(KIcon("edit-delete")); - connect (d->m_removeResourceAction, SIGNAL( triggered(bool) ), this, SLOT( unlinkResourceSlot() ) ); + connect(d->m_removeResourceAction, SIGNAL(triggered(bool)), this, SLOT(unlinkResourceSlot())); QMenu myMenu; QPoint globalPos = d->m_linkedResources->mapToGlobal(pos); myMenu.addAction(d->m_removeResourceAction); myMenu.exec(globalPos); } + + void Nepomuk::ResourceLinkDialog::createNewResourceSlot() { - Nepomuk::NewResourceDialog newResource( d->m_resourceSelect->currentIndex(), d->m_nfoResource ); + Nepomuk::NewResourceDialog newResource(d->m_resourceSelect->currentIndex(), d->m_nfoResource); //close(); newResource.exec(); setRelatedResources(); } + + void Nepomuk::ResourceLinkDialog::dynamicSearchingSlot() { Nepomuk::Query::Query query; Nepomuk::Query::QueryServiceClient *test; - switch( d->m_resourceSelect->currentIndex() ) { + switch (d->m_resourceSelect->currentIndex()) + { case 1: - query = Nepomuk::Query::QueryParser::parseQuery( d->m_searchBox->text() ); - query = query && Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Person() ); - test = new Nepomuk::Query::QueryServiceClient( this ); - test->query( query ); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Person()); + test = new Nepomuk::Query::QueryServiceClient(this); + test->query(query); d->m_resourceModel->clear(); - connect(test,SIGNAL( newEntries( QList ) ), - d->m_resourceModel,SLOT( addResults(QList)) ); + connect(test, SIGNAL(newEntries(QList)), + d->m_resourceModel, SLOT(addResults(QList))); break; + case 2: - query = Nepomuk::Query::QueryParser::parseQuery( d->m_searchBox->text() ); - query = query && Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Project() ); - test = new Nepomuk::Query::QueryServiceClient( this ); - test->query( query ); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Project()); + test = new Nepomuk::Query::QueryServiceClient(this); + test->query(query); d->m_resourceModel->clear(); - connect(test,SIGNAL( newEntries( QList ) ), - d->m_resourceModel,SLOT( addResults(QList)) ); + connect(test, SIGNAL(newEntries(QList)), + d->m_resourceModel, SLOT(addResults(QList))); break; + case 3: - query = Nepomuk::Query::QueryParser::parseQuery( d->m_searchBox->text() ); - query = query && Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Task() ); - test = new Nepomuk::Query::QueryServiceClient( this ); - test->query( query ); - d->m_resourceModel->clear(); - connect(test,SIGNAL( newEntries( QList ) ), - d->m_resourceModel,SLOT( addResults(QList)) ); - break; + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Task()); + test = new Nepomuk::Query::QueryServiceClient(this); + test->query(query); + d->m_resourceModel->clear(); + connect(test, SIGNAL(newEntries(QList)), + d->m_resourceModel, SLOT(addResults(QList))); + break; + case 4: - query = Nepomuk::Query::QueryParser::parseQuery( d->m_searchBox->text() ); - query = query && Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Location() ); - test = new Nepomuk::Query::QueryServiceClient( this ); - test->query( query ); - d->m_resourceModel->clear(); - connect(test,SIGNAL( newEntries( QList ) ), - d->m_resourceModel,SLOT( addResults(QList)) ); - break; + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Location()); + test = new Nepomuk::Query::QueryServiceClient(this); + test->query(query); + d->m_resourceModel->clear(); + connect(test, SIGNAL(newEntries(QList)), + d->m_resourceModel, SLOT(addResults(QList))); + break; + case 5: - query = Nepomuk::Query::QueryParser::parseQuery( d->m_searchBox->text() ); - query = query && Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Note() ); - test = new Nepomuk::Query::QueryServiceClient( this ); - test->query( query ); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Note()); + test = new Nepomuk::Query::QueryServiceClient(this); + test->query(query); d->m_resourceModel->clear(); - connect(test,SIGNAL( newEntries( QList ) ), - d->m_resourceModel,SLOT( addResults(QList)) ); + connect(test, SIGNAL(newEntries(QList)), + d->m_resourceModel, SLOT(addResults(QList))); break; + default: break; } } -void Nepomuk::ResourceLinkDialog::resourceSelectedSlot( int index ) +void Nepomuk::ResourceLinkDialog::resourceSelectedSlot(int index) { - enableButton( User1, true ); - d->m_newResourceButton->setEnabled( true ); - if( index == 0 ) { + enableButton(User1, true); + d->m_newResourceButton->setEnabled(true); + if (index == 0) + { d->m_resourceModel->clear(); - d->m_newResourceButton->setEnabled( false ); + d->m_newResourceButton->setEnabled(false); } //List Personal Contacts - if( index == 1 ) { - Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Person() ); - Nepomuk::Query::Query query( term ); - query.setLimit( 20 ); - QListresults = Nepomuk::Query::QueryServiceClient::syncQuery( query ); + if (index == 1) + { + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Person()); + Nepomuk::Query::Query query(term); + query.setLimit(20); + QListresults = Nepomuk::Query::QueryServiceClient::syncQuery(query); QList resource; - Q_FOREACH( const Nepomuk::Query::Result& result, results ) { - resource.append( result.resource() ); + Q_FOREACH(const Nepomuk::Query::Result & result, results) + { + resource.append(result.resource()); } - d->m_resourceModel->setResources( resource ); + d->m_resourceModel->setResources(resource); } //List Projects - else if( index == 2 ) { - Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Project() ); - Nepomuk::Query::Query query( term ); + else if (index == 2) + { + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Project()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QListresults = Nepomuk::Query::QueryServiceClient::syncQuery( query ); + QListresults = Nepomuk::Query::QueryServiceClient::syncQuery(query); QList resource; - Q_FOREACH( const Nepomuk::Query::Result& result, results ) { - resource.append( result.resource() ); + Q_FOREACH(const Nepomuk::Query::Result & result, results) + { + resource.append(result.resource()); } - d->m_resourceModel->setResources( resource ); + d->m_resourceModel->setResources(resource); } //List Tasks - else if( index == 3 ) { - Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Task() ); - Nepomuk::Query::Query query( term ); + else if (index == 3) + { + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Task()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QListresults = Nepomuk::Query::QueryServiceClient::syncQuery( query ); + QListresults = Nepomuk::Query::QueryServiceClient::syncQuery(query); QList resource; - Q_FOREACH( const Nepomuk::Query::Result& result, results ) { - resource.append( result.resource() ); + Q_FOREACH(const Nepomuk::Query::Result & result, results) + { + resource.append(result.resource()); } - d->m_resourceModel->setResources( resource ); + d->m_resourceModel->setResources(resource); } //List Places - else if( index == 4 ) { - Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Location() ); - Nepomuk::Query::Query query( term ); + else if (index == 4) + { + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Location()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QListresults = Nepomuk::Query::QueryServiceClient::syncQuery( query ); + QListresults = Nepomuk::Query::QueryServiceClient::syncQuery(query); QList resource; - Q_FOREACH( const Nepomuk::Query::Result& result, results ) { - resource.append( result.resource() ); + Q_FOREACH(const Nepomuk::Query::Result & result, results) + { + resource.append(result.resource()); } - d->m_resourceModel->setResources( resource ); + d->m_resourceModel->setResources(resource); } //List Notes - else if( index == 5 ) { - Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm( Nepomuk::Vocabulary::PIMO::Note() ); - Nepomuk::Query::Query query( term ); + else if (index == 5) + { + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Note()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QListresults = Nepomuk::Query::QueryServiceClient::syncQuery( query ); + QListresults = Nepomuk::Query::QueryServiceClient::syncQuery(query); QList resource; - Q_FOREACH( const Nepomuk::Query::Result& result, results ) { - resource.append( result.resource() ); + Q_FOREACH(const Nepomuk::Query::Result & result, results) + { + resource.append(result.resource()); } - d->m_resourceModel->setResources( resource ); + d->m_resourceModel->setResources(resource); } } - diff --git a/src/urlbar/resourcelinkdialog.h b/src/urlbar/resourcelinkdialog.h index 7e623778..8846d0a0 100644 --- a/src/urlbar/resourcelinkdialog.h +++ b/src/urlbar/resourcelinkdialog.h @@ -1,22 +1,27 @@ -/* - This is a part of the GSoC project - Fancy Bookmarking - Copyright 2011 Phaneendra Hegde - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ +/* ============================================================ +* +* This is a part of the GSoC project 2011 - Fancy Bookmarking +* +* Copyright (c) 2011-2012 by Phaneendra Hegde +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* ============================================================ */ #ifndef RESOURCELINKDIALOG_H @@ -30,10 +35,13 @@ #include #include + namespace Nepomuk { class Resource; - namespace Query { + + namespace Query + { class Query; } @@ -42,7 +50,7 @@ namespace Nepomuk Q_OBJECT public: - explicit ResourceLinkDialog( Nepomuk::Resource& nfoResource, QWidget* parent = 0 ); + explicit ResourceLinkDialog(Nepomuk::Resource& nfoResource, QWidget* parent = 0); virtual ~ResourceLinkDialog(); void setRelatedResources(); @@ -60,7 +68,6 @@ namespace Nepomuk Private* const d; }; - } #endif // RESOURCELINKDIALOG_H diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 1a8410a3..b5f05024 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -432,7 +432,7 @@ void UrlBar::activateSuggestions(bool b) { _box = new CompletionWidget(this); installEventFilter(_box.data()); - connect(_box.data(), SIGNAL(chosenUrl(KUrl,Rekonq::OpenType)), this, SLOT(loadRequestedUrl(KUrl,Rekonq::OpenType))); + connect(_box.data(), SIGNAL(chosenUrl(KUrl, Rekonq::OpenType)), this, SLOT(loadRequestedUrl(KUrl, Rekonq::OpenType))); // activate suggestions on edit text connect(this, SIGNAL(textChanged(QString)), this, SLOT(detectTypedString(QString))); diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h index 6460dae3..4f2586bc 100644 --- a/src/urlbar/urlbar.h +++ b/src/urlbar/urlbar.h @@ -108,7 +108,7 @@ private Q_SLOTS: void manageBookmarks(QPoint); void manageFavorites(QPoint); - + void refreshFavicon(); void pasteAndGo(); diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index f7fb27f1..e2ca32cb 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -122,19 +122,19 @@ UrlSearchList UrlResolver::orderedSearchItems() { QStringList aboutUrlList; aboutUrlList - << QL1S("about:home") - << QL1S("about:favorites") - << QL1S("about:closedTabs") - << QL1S("about:bookmarks") - << QL1S("about:history") - << QL1S("about:downloads") - << QL1S("about:tabs") - << QL1S("about:info"); + << QL1S("about:home") + << QL1S("about:favorites") + << QL1S("about:closedTabs") + << QL1S("about:bookmarks") + << QL1S("about:history") + << QL1S("about:downloads") + << QL1S("about:tabs") + << QL1S("about:info"); QStringList aboutUrlResults = aboutUrlList.filter(_typedString, Qt::CaseInsensitive); UrlSearchList list; - + if (aboutUrlResults.isEmpty()) { UrlSearchItem info(UrlSearchItem::Browse, QL1S("about:info"), QL1S("info")); @@ -146,7 +146,7 @@ UrlSearchList UrlResolver::orderedSearchItems() Q_FOREACH(const QString & urlResult, aboutUrlResults) { QString name = urlResult; - name.remove(0,6); + name.remove(0, 6); UrlSearchItem item(UrlSearchItem::Browse, urlResult, name); list << item; } @@ -273,7 +273,7 @@ void UrlResolver::computeQurlFromUserInput() QString hst = urlFromUserInput.host(); urlFromUserInput.setHost(hst.toLower()); } - + QString urlString = urlFromUserInput.toString(); QString gTitle = i18nc("Browse a website", "Browse"); UrlSearchItem gItem(UrlSearchItem::Browse, urlString, gTitle); diff --git a/src/webpage.cpp b/src/webpage.cpp index bc4d0aa9..f9fb1191 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -213,7 +213,7 @@ QString WebPage::suggestedFileName() return _suggestedFileName; }; - + bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) { if (_isOnRekonqPage) @@ -261,9 +261,9 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r break; case QWebPage::NavigationTypeReload: - setRequestMetaData( QL1S("cache"), QL1S("reload") ); + setRequestMetaData(QL1S("cache"), QL1S("reload")); break; - + case QWebPage::NavigationTypeBackOrForward: case QWebPage::NavigationTypeOther: break; @@ -489,7 +489,7 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) QWebFrame* frame = qobject_cast(reply->request().originatingObject()); if (!frame) return; - + const bool isMainFrameRequest = (frame == mainFrame()); // Only deal with non-redirect responses... @@ -499,11 +499,11 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) _sslInfo.restoreFrom(reply->attribute(static_cast(KIO::AccessManager::MetaData)), reply->url()); return; } - + // We are just managing loading URLs errors if (reply->request().url() != _loadingUrl) return; - + // NOTE: These are not all networkreply errors, // but just that supported directly by KIO switch (reply->error()) @@ -522,7 +522,7 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) // ignore this.. return; - // WARNING: This is also typical adblocked element error: IGNORE THIS! + // WARNING: This is also typical adblocked element error: IGNORE THIS! case QNetworkReply::ContentAccessDenied: // access to remote content denied break; @@ -530,7 +530,7 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) // last chance for the strange things (eg: FTP, custom schemes, etc...) if (_protHandler.postHandling(reply->request(), mainFrame())) return; - + case QNetworkReply::ConnectionRefusedError: // remote server refused connection case QNetworkReply::HostNotFoundError: // invalid hostname case QNetworkReply::TimeoutError: // connection time out @@ -590,9 +590,9 @@ QString WebPage::errorPage(QNetworkReply *reply) msg += i18n("

Oops! Rekonq cannot load %1

", urlString); - + msg += i18n("

Wrong digited?

"); - + msg += QL1S(""); msg += QL1S("
"); diff --git a/src/webtab.cpp b/src/webtab.cpp index e2ffe0d5..de7e134c 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -84,8 +84,8 @@ WebTab::WebTab(QWidget *parent) if (wallet) { - connect(wallet, SIGNAL(saveFormDataRequested(QString,QUrl)), - this, SLOT(createWalletBar(QString,QUrl))); + connect(wallet, SIGNAL(saveFormDataRequested(QString, QUrl)), + this, SLOT(createWalletBar(QString, QUrl))); } connect(view(), SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); @@ -328,8 +328,8 @@ void WebTab::showSearchEngine(const QPoint &pos) WebShortcutWidget *widget = new WebShortcutWidget(window()); widget->setWindowFlags(Qt::Popup); - connect(widget, SIGNAL(webShortcutSet(KUrl,QString,QString)), - rApp->opensearchManager(), SLOT(addOpenSearchEngine(KUrl,QString,QString))); + connect(widget, SIGNAL(webShortcutSet(KUrl, QString, QString)), + rApp->opensearchManager(), SLOT(addOpenSearchEngine(KUrl, QString, QString))); connect(rApp->opensearchManager(), SIGNAL(openSearchEngineAdded(QString)), this, SLOT(openSearchEngineAdded())); @@ -343,7 +343,7 @@ void WebTab::openSearchEngineAdded() // If the providers changed, tell sycoca to rebuild its database... KBuildSycocaProgressDialog::rebuildKSycoca(this); - disconnect(rApp->opensearchManager(), SIGNAL(openSearchEngineAdded(QString,QString,QString)), + disconnect(rApp->opensearchManager(), SIGNAL(openSearchEngineAdded(QString, QString, QString)), this, SLOT(openSearchEngineAdded())); } diff --git a/src/webtab.h b/src/webtab.h index 6d5a79b4..39c23fb9 100644 --- a/src/webtab.h +++ b/src/webtab.h @@ -60,7 +60,7 @@ public: WebView *view(); WebPage *page(); - + inline UrlBar *urlBar() const { return m_urlBar; @@ -102,10 +102,10 @@ private Q_SLOTS: void showRSSInfo(const QPoint &pos); void showSearchEngine(const QPoint &pos); void openSearchEngineAdded(); - + void showMessageBar(); void loadFinished(); - + void showSearchEngineBar(); private: diff --git a/src/webview.cpp b/src/webview.cpp index 579e6a78..65295294 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -88,8 +88,8 @@ WebView::WebView(QWidget* parent) connect(this, SIGNAL(linkMiddleOrCtrlClicked(KUrl)), this, SLOT(loadUrlInNewTab(KUrl))); // loadUrl signal - connect(this, SIGNAL(loadUrl(KUrl,Rekonq::OpenType)), - rApp, SLOT(loadUrl(KUrl,Rekonq::OpenType))); + connect(this, SIGNAL(loadUrl(KUrl, Rekonq::OpenType)), + rApp, SLOT(loadUrl(KUrl, Rekonq::OpenType))); // Auto scroll timer connect(m_autoScrollTimer, SIGNAL(timeout()), this, SLOT(scrollFrameChanged())); @@ -278,15 +278,15 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) a = new KAction(KIcon("view-preview"), i18n("&View Image"), this); a->setData(result.imageUrl()); - connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), - this, SLOT(viewImage(Qt::MouseButtons,Qt::KeyboardModifiers))); + connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), + this, SLOT(viewImage(Qt::MouseButtons, Qt::KeyboardModifiers))); menu.addAction(a); menu.addAction(pageAction(KWebPage::DownloadImageToDisk)); a = new KAction(KIcon("view-media-visualization"), i18n("&Copy Image Location"), this); a->setData(result.imageUrl()); - connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(slotCopyImageLocation())); + connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(slotCopyImageLocation())); menu.addAction(a); if (rApp->adblockManager()->isEnabled()) @@ -910,7 +910,7 @@ void WebView::loadUrlInNewTab(const KUrl &u) { QNetworkRequest req(u); req.setRawHeader(QByteArray("Referer"), url().toEncoded()); - + WebTab *w = 0; if (ReKonfig::openLinksInNewWindow()) { -- cgit v1.2.1