From 5f5cf7417d1c13ba8fb90c24d36f376da258bf27 Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 6 Mar 2013 09:05:41 +0100 Subject: [PATCH] [Code] Updated coding style with patched Astyle + normalized signals. Code was formatted with patched astyle that correctly formats foreach macro. Normalize tool is now used to normalize all signal/slots signatures to normalized format. It saves few reallocations on connections. --- scripts/coding_style.sh | 14 +++++--- src/lib/3rdparty/fancytabwidget.cpp | 4 +-- src/lib/3rdparty/qftp.cpp | 12 +++---- src/lib/3rdparty/qtlockedfile_win.cpp | 2 +- src/lib/3rdparty/qtsingleapplication.cpp | 6 ++-- src/lib/3rdparty/qtwin.cpp | 4 +-- src/lib/3rdparty/stylehelper.cpp | 5 +-- .../adblock/adblockaddsubscriptiondialog.cpp | 2 +- src/lib/adblock/adblockdialog.cpp | 4 +-- src/lib/adblock/adblockicon.cpp | 2 +- src/lib/adblock/adblockmanager.cpp | 20 +++++------ src/lib/adblock/adblockrule.cpp | 14 ++++---- src/lib/adblock/adblocksubscription.cpp | 4 +-- src/lib/adblock/adblocktreewidget.cpp | 4 +-- src/lib/app/mainapplication.cpp | 10 +++--- src/lib/app/qupzilla.cpp | 18 +++++----- src/lib/autofill/autofill.cpp | 2 +- src/lib/autofill/pageformcompleter.cpp | 8 ++--- src/lib/bookmarks/bookmarksmanager.cpp | 34 +++++++++---------- src/lib/bookmarks/bookmarksmodel.cpp | 2 +- src/lib/bookmarks/bookmarkstoolbar.cpp | 14 ++++---- src/lib/bookmarks/bookmarkswidget.cpp | 4 +-- .../bookmarksimport/bookmarksimportdialog.cpp | 6 ++-- .../bookmarksimporticonfetcher.cpp | 2 +- src/lib/bookmarksimport/chromeimporter.cpp | 2 +- src/lib/cookies/cookiejar.cpp | 4 +-- src/lib/cookies/cookiemanager.cpp | 4 +-- src/lib/downloads/downloaditem.cpp | 6 ++-- src/lib/downloads/downloadmanager.cpp | 14 ++++---- src/lib/history/history.cpp | 2 +- src/lib/history/historymanager.cpp | 4 +-- src/lib/history/historymodel.cpp | 10 +++--- src/lib/history/historyview.cpp | 4 +-- .../completer/locationcompleter.cpp | 4 +-- .../completer/locationcompleterdelegate.cpp | 2 +- .../completer/locationcompletermodel.cpp | 6 ++-- src/lib/navigation/locationbar.cpp | 4 +-- src/lib/navigation/websearchbar.cpp | 10 +++--- src/lib/network/networkmanager.cpp | 22 ++++++------ src/lib/network/networkmanagerproxy.cpp | 8 ++--- .../schemehandlers/fileschemehandler.cpp | 4 +-- .../schemehandlers/ftpschemehandler.cpp | 10 +++--- .../schemehandlers/qupzillaschemehandler.cpp | 6 ++-- src/lib/opensearch/searchenginesdialog.cpp | 4 +-- src/lib/opensearch/searchenginesmanager.cpp | 10 +++--- src/lib/other/browsinglibrary.cpp | 4 +-- src/lib/other/macmenureceiver.cpp | 8 ++--- src/lib/other/pagescreen.cpp | 6 ++-- src/lib/plugins/clicktoflash.cpp | 6 ++-- src/lib/plugins/pluginproxy.cpp | 20 +++++------ src/lib/plugins/plugins.cpp | 12 +++---- .../plugins/qtwebkit/spellcheck/speller.cpp | 2 +- src/lib/plugins/speeddial.cpp | 16 ++++----- src/lib/popupwindow/popupwindow.cpp | 4 +-- src/lib/preferences/acceptlanguage.cpp | 4 +-- src/lib/preferences/pluginsmanager.cpp | 6 ++-- src/lib/preferences/preferences.cpp | 6 ++-- src/lib/preferences/sslmanager.cpp | 8 ++--- src/lib/preferences/thememanager.cpp | 4 +-- src/lib/rss/rssmanager.cpp | 6 ++-- src/lib/rss/rssnotification.cpp | 2 +- src/lib/sidebar/bookmarkssidebar.cpp | 20 +++++------ src/lib/sidebar/historysidebar.cpp | 4 +-- src/lib/sidebar/sidebar.cpp | 8 ++--- src/lib/tools/buttonwithmenu.cpp | 4 +-- .../html5permissionsdialog.cpp | 8 ++--- src/lib/tools/htmlhighlighter.cpp | 4 +-- src/lib/tools/iconprovider.cpp | 10 +++--- src/lib/tools/plaineditwithlines.cpp | 4 +-- src/lib/tools/qztools.cpp | 2 +- src/lib/tools/treewidget.cpp | 23 +++++++------ src/lib/webview/siteinfo.cpp | 8 ++--- src/lib/webview/tabbar.cpp | 4 +-- src/lib/webview/tabbedwebview.cpp | 2 +- src/lib/webview/tabwidget.cpp | 14 ++++---- src/lib/webview/webhistorywrapper.cpp | 4 +-- src/lib/webview/webpage.cpp | 24 ++++++------- src/lib/webview/webview.cpp | 8 ++--- .../AccessKeysNavigation/akn_handler.cpp | 14 ++++---- src/plugins/GreaseMonkey/gm_manager.cpp | 12 +++---- src/plugins/GreaseMonkey/gm_script.cpp | 10 +++--- src/plugins/GreaseMonkey/gm_urlmatcher.cpp | 2 +- .../GreaseMonkey/settings/gm_settings.cpp | 2 +- src/plugins/PIM/PIM_handler.cpp | 8 ++--- 84 files changed, 329 insertions(+), 321 deletions(-) diff --git a/scripts/coding_style.sh b/scripts/coding_style.sh index 60f6e48d8..631bde4c5 100755 --- a/scripts/coding_style.sh +++ b/scripts/coding_style.sh @@ -1,7 +1,8 @@ #!/bin/bash # # Requirements: -# astyle >=2.02 +# astyle > =2.02 (patched with foreach support) +# normalize (Qt tool to normalize all signal/slots format) # function format_sources { @@ -9,7 +10,7 @@ function format_sources { --indent-labels --pad-oper --unpad-paren --pad-header \ --convert-tabs --indent-preprocessor --break-closing-brackets \ --align-pointer=type --align-reference=name \ - `find -type f -name '*.cpp'` + `find -type f -name '*.cpp'` | grep 'Formatted' find . -name "*.orig" -print0 | xargs -0 rm -rf } @@ -20,16 +21,19 @@ function format_headers { --keep-one-line-statements --keep-one-line-blocks \ --indent-preprocessor --convert-tabs \ --align-pointer=type --align-reference=name \ - `find -type f -name '*.h'` + `find -type f -name '*.h'` | grep 'Formatted' find . -name "*.orig" -print0 | xargs -0 rm -rf } cd ../src -echo "running astyle for *.cpp ..." +echo "Running astyle for *.cpp ..." format_sources -echo "running astyle for *.h ..." +echo "Running astyle for *.h ..." format_headers +echo "Running normalize ..." +normalize --modify . + exit 0 diff --git a/src/lib/3rdparty/fancytabwidget.cpp b/src/lib/3rdparty/fancytabwidget.cpp index 7b6829b3a..8a664a935 100644 --- a/src/lib/3rdparty/fancytabwidget.cpp +++ b/src/lib/3rdparty/fancytabwidget.cpp @@ -623,7 +623,7 @@ void FancyTabWidget::SetMode(Mode mode) side_layout_->insertWidget(0, bar); tab_bar_ = bar; - foreach(const Item & item, items_) { + foreach (const Item &item, items_) { if (item.type_ == Item::Type_Spacer) { bar->addSpacer(item.spacer_size_); } @@ -722,7 +722,7 @@ void FancyTabWidget::MakeTabBar(QTabBar::Shape shape, bool text, bool icons, side_layout_->insertWidget(0, bar); } - foreach(const Item & item, items_) { + foreach (const Item &item, items_) { if (item.type_ != Item::Type_Tab) { continue; } diff --git a/src/lib/3rdparty/qftp.cpp b/src/lib/3rdparty/qftp.cpp index 0c964b63a..2af643f0b 100644 --- a/src/lib/3rdparty/qftp.cpp +++ b/src/lib/3rdparty/qftp.cpp @@ -1493,15 +1493,15 @@ QFtp::QFtp(QObject* parent) SLOT(_q_piConnectState(int))); connect(&d->pi, SIGNAL(finished(QString)), SLOT(_q_piFinished(QString))); - connect(&d->pi, SIGNAL(error(int, QString)), - SLOT(_q_piError(int, QString))); - connect(&d->pi, SIGNAL(rawFtpReply(int, QString)), - SLOT(_q_piFtpReply(int, QString))); + connect(&d->pi, SIGNAL(error(int,QString)), + SLOT(_q_piError(int,QString))); + connect(&d->pi, SIGNAL(rawFtpReply(int,QString)), + SLOT(_q_piFtpReply(int,QString))); connect(&d->pi.dtp, SIGNAL(readyRead()), SIGNAL(readyRead())); - connect(&d->pi.dtp, SIGNAL(dataTransferProgress(qint64, qint64)), - SIGNAL(dataTransferProgress(qint64, qint64))); + connect(&d->pi.dtp, SIGNAL(dataTransferProgress(qint64,qint64)), + SIGNAL(dataTransferProgress(qint64,qint64))); connect(&d->pi.dtp, SIGNAL(listInfo(QUrlInfo)), SIGNAL(listInfo(QUrlInfo))); } diff --git a/src/lib/3rdparty/qtlockedfile_win.cpp b/src/lib/3rdparty/qtlockedfile_win.cpp index bd0f9979d..bb30f83b4 100644 --- a/src/lib/3rdparty/qtlockedfile_win.cpp +++ b/src/lib/3rdparty/qtlockedfile_win.cpp @@ -213,7 +213,7 @@ bool QtLockedFile::unlock() rmutex = 0; } else { - foreach(Qt::HANDLE mutex, rmutexes) { + foreach (Qt::HANDLE mutex, rmutexes) { ReleaseMutex(mutex); CloseHandle(mutex); } diff --git a/src/lib/3rdparty/qtsingleapplication.cpp b/src/lib/3rdparty/qtsingleapplication.cpp index 4e26c451f..4751de5b3 100644 --- a/src/lib/3rdparty/qtsingleapplication.cpp +++ b/src/lib/3rdparty/qtsingleapplication.cpp @@ -143,7 +143,7 @@ void QtSingleApplication::sysInit(const QString &appId) { actWin = 0; peer = new QtLocalPeer(this, appId); - connect(peer, SIGNAL(messageReceived(const QString &)), SIGNAL(messageReceived(const QString &))); + connect(peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString))); } @@ -258,10 +258,10 @@ void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessag } if (activateOnMessage) { - connect(peer, SIGNAL(messageReceived(const QString &)), this, SLOT(activateWindow())); + connect(peer, SIGNAL(messageReceived(QString)), this, SLOT(activateWindow())); } else { - disconnect(peer, SIGNAL(messageReceived(const QString &)), this, SLOT(activateWindow())); + disconnect(peer, SIGNAL(messageReceived(QString)), this, SLOT(activateWindow())); } } diff --git a/src/lib/3rdparty/qtwin.cpp b/src/lib/3rdparty/qtwin.cpp index 73981a94b..02154cc3d 100644 --- a/src/lib/3rdparty/qtwin.cpp +++ b/src/lib/3rdparty/qtwin.cpp @@ -284,7 +284,7 @@ bool WindowNotifier::nativeEvent(const QByteArray &eventType, void* _message, lo #endif if (message && message->message == WM_DWMCOMPOSITIONCHANGED) { bool compositionEnabled = QtWin::isCompositionEnabled(); - foreach(QWidget * widget, widgets) { + foreach (QWidget* widget, widgets) { if (widget) { widget->setAttribute(Qt::WA_NoSystemBackground, compositionEnabled); bool isBlur = widgetsBlurState.value(widget, false); @@ -364,7 +364,7 @@ void QtWin::populateFrequentSites(IObjectCollection* collection, const QString & History* history = mApp->history(); QVector mostList = history->mostVisited(6); - foreach(const HistoryEntry & entry, mostList) { + foreach (const HistoryEntry &entry, mostList) { collection->AddObject(CreateShellLink(entry.title, entry.url.toString(), appPath, QString(" " + entry.url.toEncoded()), appPath, 1)); } diff --git a/src/lib/3rdparty/stylehelper.cpp b/src/lib/3rdparty/stylehelper.cpp index 5aba52a4a..5cf7690a2 100644 --- a/src/lib/3rdparty/stylehelper.cpp +++ b/src/lib/3rdparty/stylehelper.cpp @@ -127,8 +127,9 @@ void StyleHelper::setBaseColor(const QColor &newcolor) if (color.isValid() && color != m_baseColor) { m_baseColor = color; - foreach(QWidget * w, QApplication::topLevelWidgets()) - w->update(); + foreach (QWidget* w, QApplication::topLevelWidgets()) { + w->update(); + } } } diff --git a/src/lib/adblock/adblockaddsubscriptiondialog.cpp b/src/lib/adblock/adblockaddsubscriptiondialog.cpp index e51362936..9e7048adc 100644 --- a/src/lib/adblock/adblockaddsubscriptiondialog.cpp +++ b/src/lib/adblock/adblockaddsubscriptiondialog.cpp @@ -42,7 +42,7 @@ AdBlockAddSubscriptionDialog::AdBlockAddSubscriptionDialog(QWidget* parent) << Subscription("RU Adlist (Russian)", "https://ruadlist.googlecode.com/hg/advblock.txt") << Subscription("Antisocial (English)", "http://adversity.googlecode.com/hg/Antisocial.txt"); - foreach(const Subscription & subscription, m_knownSubscriptions) { + foreach (const Subscription &subscription, m_knownSubscriptions) { ui->comboBox->addItem(subscription.title); } diff --git a/src/lib/adblock/adblockdialog.cpp b/src/lib/adblock/adblockdialog.cpp index 98cedb5d0..aedbbab3d 100644 --- a/src/lib/adblock/adblockdialog.cpp +++ b/src/lib/adblock/adblockdialog.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -169,7 +169,7 @@ void AdBlockDialog::load() return; } - foreach(AdBlockSubscription * subscription, m_manager->subscriptions()) { + foreach (AdBlockSubscription* subscription, m_manager->subscriptions()) { AdBlockTreeWidget* tree = new AdBlockTreeWidget(subscription, tabWidget); tabWidget->addTab(tree, subscription->title()); } diff --git a/src/lib/adblock/adblockicon.cpp b/src/lib/adblock/adblockicon.cpp index 04f73eaa5..ef4ece6d0 100644 --- a/src/lib/adblock/adblockicon.cpp +++ b/src/lib/adblock/adblockicon.cpp @@ -152,7 +152,7 @@ void AdBlockIcon::createMenu(QMenu* menu) } else { menu->addAction(tr("Blocked URL (AdBlock Rule) - click to edit rule"))->setEnabled(false); - foreach(const WebPage::AdBlockedEntry & entry, entries) { + foreach (const WebPage::AdBlockedEntry &entry, entries) { QString address = entry.url.toString().right(55); QString actionText = tr("%1 with (%2)").arg(address, entry.rule->filter()).replace(QLatin1Char('&'), QLatin1String("&&")); diff --git a/src/lib/adblock/adblockmanager.cpp b/src/lib/adblock/adblockmanager.cpp index c2aff1109..afe352f26 100644 --- a/src/lib/adblock/adblockmanager.cpp +++ b/src/lib/adblock/adblockmanager.cpp @@ -93,7 +93,7 @@ QNetworkReply* AdBlockManager::block(const QNetworkRequest &request) return 0; } - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { const AdBlockRule* blockedRule = subscription->match(request, urlDomain, urlString); if (blockedRule) { @@ -185,7 +185,7 @@ bool AdBlockManager::removeSubscription(AdBlockSubscription* subscription) AdBlockCustomList* AdBlockManager::customList() const { - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { AdBlockCustomList* list = qobject_cast(subscription); if (list) { @@ -224,7 +224,7 @@ void AdBlockManager::load() QDir(mApp->currentProfilePath()).mkdir("adblock"); } - foreach(const QString & fileName, adblockDir.entryList(QStringList("*.txt"), QDir::Files)) { + foreach (const QString &fileName, adblockDir.entryList(QStringList("*.txt"), QDir::Files)) { if (fileName == QLatin1String("easylist.txt") || fileName == QLatin1String("customlist.txt")) { continue; } @@ -264,7 +264,7 @@ void AdBlockManager::load() connect(customList, SIGNAL(subscriptionEdited()), mApp, SLOT(reloadUserStyleSheet())); // Load all subscriptions - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { subscription->loadSubscription(m_disabledRules); } @@ -281,7 +281,7 @@ void AdBlockManager::load() void AdBlockManager::updateAllSubscriptions() { - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { subscription->updateSubscription(); } @@ -297,7 +297,7 @@ void AdBlockManager::save() return; } - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { subscription->saveSubscription(); } @@ -322,7 +322,7 @@ bool AdBlockManager::canRunOnScheme(const QString &scheme) const bool AdBlockManager::canBeBlocked(const QUrl &url) const { - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { if (subscription->adBlockDisabledForUrl(url)) { return false; } @@ -339,7 +339,7 @@ QString AdBlockManager::elementHidingRules() const QString rules; - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { rules.append(subscription->elementHidingRules()); } @@ -355,7 +355,7 @@ QString AdBlockManager::elementHidingRulesForDomain(const QUrl &url) const { QString rules; - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { if (subscription->elemHideDisabledForUrl(url)) { return QString(); } @@ -373,7 +373,7 @@ QString AdBlockManager::elementHidingRulesForDomain(const QUrl &url) const AdBlockSubscription* AdBlockManager::subscriptionByName(const QString &name) const { - foreach(AdBlockSubscription * subscription, m_subscriptions) { + foreach (AdBlockSubscription* subscription, m_subscriptions) { if (subscription->title() == name) { return subscription; } diff --git a/src/lib/adblock/adblockrule.cpp b/src/lib/adblock/adblockrule.cpp index f33681681..7b05f3316 100644 --- a/src/lib/adblock/adblockrule.cpp +++ b/src/lib/adblock/adblockrule.cpp @@ -266,14 +266,14 @@ bool AdBlockRule::matchDomain(const QString &domain) const } if (m_blockedDomains.isEmpty()) { - foreach(const QString & d, m_allowedDomains) { + foreach (const QString &d, m_allowedDomains) { if (isMatchingDomain(domain, d)) { return true; } } } else if (m_allowedDomains.isEmpty()) { - foreach(const QString & d, m_blockedDomains) { + foreach (const QString &d, m_blockedDomains) { if (isMatchingDomain(domain, d)) { return false; } @@ -281,13 +281,13 @@ bool AdBlockRule::matchDomain(const QString &domain) const return true; } else { - foreach(const QString & d, m_blockedDomains) { + foreach (const QString &d, m_blockedDomains) { if (isMatchingDomain(domain, d)) { return false; } } - foreach(const QString & d, m_allowedDomains) { + foreach (const QString &d, m_allowedDomains) { if (isMatchingDomain(domain, d)) { return true; } @@ -395,7 +395,7 @@ void AdBlockRule::parseFilter() QStringList options = parsedLine.mid(optionsIndex + 1).split(QLatin1Char(','), QString::SkipEmptyParts); int handledOptions = 0; - foreach(const QString & option, options) { + foreach (const QString &option, options) { if (option.startsWith(QLatin1String("domain="))) { parseDomains(option.mid(7), QLatin1Char('|')); ++handledOptions; @@ -526,7 +526,7 @@ void AdBlockRule::parseDomains(const QString &domains, const QChar &separator) { QStringList domainsList = domains.split(separator, QString::SkipEmptyParts); - foreach(const QString domain, domainsList) { + foreach (const QString domain, domainsList) { if (domain.isEmpty()) { continue; } @@ -550,7 +550,7 @@ bool AdBlockRule::isMatchingDomain(const QString &domain, const QString &filter) bool AdBlockRule::isMatchingRegExpStrings(const QString &url) const { - foreach(const QString & string, m_regExpStrings) { + foreach (const QString &string, m_regExpStrings) { if (!url.contains(string)) { return false; } diff --git a/src/lib/adblock/adblocksubscription.cpp b/src/lib/adblock/adblocksubscription.cpp index 57ddba71f..f69baf194 100644 --- a/src/lib/adblock/adblocksubscription.cpp +++ b/src/lib/adblock/adblocksubscription.cpp @@ -436,7 +436,7 @@ void AdBlockCustomList::saveSubscription() textStream << "Url: " << url().toString() << endl; textStream << "[Adblock Plus 1.1.1]" << endl; - foreach(const AdBlockRule * rule, m_rules) { + foreach (const AdBlockRule* rule, m_rules) { textStream << rule->filter() << endl; } @@ -455,7 +455,7 @@ bool AdBlockCustomList::canBeRemoved() const bool AdBlockCustomList::containsFilter(const QString &filter) const { - foreach(const AdBlockRule * rule, m_rules) { + foreach (const AdBlockRule* rule, m_rules) { if (rule->filter() == filter) { return true; } diff --git a/src/lib/adblock/adblocktreewidget.cpp b/src/lib/adblock/adblocktreewidget.cpp index ff2967822..d2371744c 100644 --- a/src/lib/adblock/adblocktreewidget.cpp +++ b/src/lib/adblock/adblocktreewidget.cpp @@ -36,7 +36,7 @@ AdBlockTreeWidget::AdBlockTreeWidget(AdBlockSubscription* subscription, QWidget* setAlternatingRowColors(true); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); - connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(itemChanged(QTreeWidgetItem*))); + connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemChanged(QTreeWidgetItem*))); connect(m_subscription, SIGNAL(subscriptionUpdated()), this, SLOT(subscriptionUpdated())); } @@ -240,7 +240,7 @@ void AdBlockTreeWidget::refresh() const QVector &allRules = m_subscription->allRules(); int index = 0; - foreach(const AdBlockRule * rule, allRules) { + foreach (const AdBlockRule* rule, allRules) { QTreeWidgetItem* item = new QTreeWidgetItem(m_topItem); item->setText(0, rule->filter()); item->setData(0, Qt::UserRole + 10, index); diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 706fff51d..3c50b4280 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -153,7 +153,7 @@ MainApplication::MainApplication(int &argc, char** argv) if (argc > 1) { CommandLineOptions cmd(argc); - foreach(const CommandLineOptions::ActionPair & pair, cmd.getActions()) { + foreach (const CommandLineOptions::ActionPair &pair, cmd.getActions()) { switch (pair.action) { case Qz::CL_StartWithoutAddons: noAddons = true; @@ -220,7 +220,7 @@ MainApplication::MainApplication(int &argc, char** argv) } if (isRunning()) { - foreach(const QString & message, messages) { + foreach (const QString &message, messages) { sendMessage(message); } m_isClosing = true; @@ -266,7 +266,7 @@ MainApplication::MainApplication(int &argc, char** argv) QupZilla* qupzilla = new QupZilla(Qz::BW_FirstAppWindow, startUrl); m_mainWindows.append(qupzilla); - connect(qupzilla, SIGNAL(message(Qz::AppMessageType, bool)), this, SLOT(sendMessages(Qz::AppMessageType, bool))); + connect(qupzilla, SIGNAL(message(Qz::AppMessageType,bool)), this, SLOT(sendMessages(Qz::AppMessageType,bool))); connect(qupzilla, SIGNAL(startingCompleted()), this, SLOT(restoreCursor())); loadSettings(); @@ -913,7 +913,7 @@ Speller* MainApplication::speller() void MainApplication::startPrivateBrowsing() { QStringList args; - foreach(const QString & arg, arguments()) { + foreach (const QString &arg, arguments()) { if (arg.startsWith(QLatin1Char('-'))) { args.append(arg); } @@ -1101,7 +1101,7 @@ bool MainApplication::restoreStateSlot(QupZilla* window, RestoreData recoveryDat window->restoreWindowState(data); } - foreach(const RestoreManager::WindowData & data, recoveryData) { + foreach (const RestoreManager::WindowData &data, recoveryData) { QupZilla* window = makeNewWindow(Qz::BW_OtherRestoredWindow); window->restoreWindowState(data); } diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 041d6de6a..3a38d33db 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -144,7 +144,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl) m_hideNavigationTimer->setSingleShot(true); connect(m_hideNavigationTimer, SIGNAL(timeout()), this, SLOT(hideNavigationSlot())); - connect(mApp, SIGNAL(message(Qz::AppMessageType, bool)), this, SLOT(receiveMessage(Qz::AppMessageType, bool))); + connect(mApp, SIGNAL(message(Qz::AppMessageType,bool)), this, SLOT(receiveMessage(Qz::AppMessageType,bool))); QTimer::singleShot(0, this, SLOT(postLaunch())); } @@ -628,7 +628,7 @@ void QupZilla::setupOtherActions() // Make shortcuts available even in fullscreen (menu hidden) QList actions = menuBar()->actions(); - foreach(QAction * action, actions) { + foreach (QAction* action, actions) { if (action->menu()) { actions += action->menu()->actions(); } @@ -1042,7 +1042,7 @@ void QupZilla::aboutToShowClosedTabsMenu() { m_menuClosedTabs->clear(); int i = 0; - foreach(const ClosedTabsManager::Tab & tab, m_tabWidget->closedTabsManager()->allClosedTabs()) { + foreach (const ClosedTabsManager::Tab &tab, m_tabWidget->closedTabsManager()->allClosedTabs()) { QString title = tab.title; if (title.length() > 40) { title.truncate(40); @@ -1092,7 +1092,7 @@ void QupZilla::aboutToShowHistoryMostMenu() const QVector &mostList = mApp->history()->mostVisited(10); - foreach(const HistoryEntry & entry, mostList) { + foreach (const HistoryEntry &entry, mostList) { QString title = entry.title; if (title.length() > 40) { title.truncate(40); @@ -1155,7 +1155,7 @@ void QupZilla::aboutToShowEditMenu() void QupZilla::aboutToHideEditMenu() { #ifndef Q_OS_MAC - foreach(QAction * act, m_menuEdit->actions()) { + foreach (QAction* act, m_menuEdit->actions()) { act->setEnabled(false); } #endif @@ -1189,7 +1189,7 @@ void QupZilla::aboutToShowEncodingMenu() qSort(available); const QString &activeCodec = mApp->webSettings()->defaultTextEncoding(); - foreach(const QByteArray & name, available) { + foreach (const QByteArray &name, available) { QTextCodec* codec = QTextCodec::codecForName(name); if (codec && codec->aliases().contains(name)) { continue; @@ -1404,7 +1404,7 @@ void QupZilla::loadFolderBookmarks(Menu* menu) return; } - foreach(const Bookmark & b, mApp->bookmarksModel()->folderBookmarks(folder)) { + foreach (const Bookmark &b, mApp->bookmarksModel()->folderBookmarks(folder)) { tabWidget()->addView(b.url, b.title, Qz::NT_NotSelectedTab); } } @@ -2137,13 +2137,13 @@ void QupZilla::disconnectObjects() m_tabWidget->disconnectObjects(); m_tabWidget->getTabBar()->disconnectObjects(); - foreach(WebTab * tab, m_tabWidget->allTabs()) { + foreach (WebTab* tab, m_tabWidget->allTabs()) { tab->disconnectObjects(); tab->view()->disconnectObjects(); tab->view()->page()->disconnectObjects(); } - foreach(const QPointer &pointer, m_deleteOnCloseWidgets) { + foreach (const QPointer &pointer, m_deleteOnCloseWidgets) { if (pointer) { pointer.data()->deleteLater(); } diff --git a/src/lib/autofill/autofill.cpp b/src/lib/autofill/autofill.cpp index 40852b3a1..d2c1cb03a 100644 --- a/src/lib/autofill/autofill.cpp +++ b/src/lib/autofill/autofill.cpp @@ -320,7 +320,7 @@ void AutoFill::post(const QNetworkRequest &request, const QByteArray &outgoingDa if (isStored(siteUrl)) { const QVector &list = getFormData(siteUrl); - foreach(const AutoFillData & data, list) { + foreach (const AutoFillData &data, list) { if (data.username == formData.username) { updateLastUsed(data.id); diff --git a/src/lib/autofill/pageformcompleter.cpp b/src/lib/autofill/pageformcompleter.cpp index 34482d507..87f04eebf 100644 --- a/src/lib/autofill/pageformcompleter.cpp +++ b/src/lib/autofill/pageformcompleter.cpp @@ -52,11 +52,11 @@ PageFormData PageFormCompleter::extractFormData(const QByteArray &postData) cons const QWebElementCollection &allForms = getAllElementsFromPage(m_page, "form"); // Find form that contains password value sent in data - foreach(const QWebElement & formElement, allForms) { + foreach (const QWebElement &formElement, allForms) { bool found = false; const QWebElementCollection &inputs = formElement.findAll("input[type=\"password\"]"); - foreach(QWebElement inputElement, inputs) { + foreach (QWebElement inputElement, inputs) { const QString &passName = inputElement.attribute("name"); const QString &passValue = inputElement.evaluateJavaScript("this.value").toString(); @@ -197,9 +197,9 @@ PageFormCompleter::QueryItem PageFormCompleter::findUsername(const QWebElement & << "input[type=\"email\"]" << "input:not([type=\"hidden\"][type=\"password\"])"; - foreach(const QString & selector, selectors) { + foreach (const QString &selector, selectors) { const QWebElementCollection &inputs = form.findAll(selector); - foreach(QWebElement element, inputs) { + foreach (QWebElement element, inputs) { const QString &name = element.attribute("name"); const QString &value = element.evaluateJavaScript("this.value").toString(); diff --git a/src/lib/bookmarks/bookmarksmanager.cpp b/src/lib/bookmarks/bookmarksmanager.cpp index 983074877..36ff58013 100644 --- a/src/lib/bookmarks/bookmarksmanager.cpp +++ b/src/lib/bookmarks/bookmarksmanager.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -52,9 +52,9 @@ BookmarksManager::BookmarksManager(QupZilla* mainClass, QWidget* parent) ui->bookmarksTree->setDragDropReceiver(true, m_bookmarksModel); ui->bookmarksTree->setMimeType(QLatin1String("application/qupzilla.treewidgetitem.bookmarks")); - connect(ui->bookmarksTree, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(itemChanged(QTreeWidgetItem*))); + connect(ui->bookmarksTree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemChanged(QTreeWidgetItem*))); connect(ui->addFolder, SIGNAL(clicked()), this, SLOT(addFolder())); - connect(ui->bookmarksTree, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &))); + connect(ui->bookmarksTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); connect(ui->bookmarksTree, SIGNAL(itemControlClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*))); connect(ui->bookmarksTree, SIGNAL(itemMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*))); connect(ui->collapseAll, SIGNAL(clicked()), ui->bookmarksTree, SLOT(collapseAll())); @@ -62,13 +62,13 @@ BookmarksManager::BookmarksManager(QupZilla* mainClass, QWidget* parent) connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(removeBookmark(BookmarksModel::Bookmark))); - connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark)), this, SLOT(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark))); + connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark)), this, SLOT(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(subfolderAdded(QString)), this, SLOT(addSubfolder(QString))); connect(m_bookmarksModel, SIGNAL(folderAdded(QString)), this, SLOT(addFolder(QString))); connect(m_bookmarksModel, SIGNAL(folderDeleted(QString)), this, SLOT(removeFolder(QString))); - connect(m_bookmarksModel, SIGNAL(folderRenamed(QString, QString)), this, SLOT(renameFolder(QString, QString))); - connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString, bool)), this, SLOT(changeFolderParent(QString, bool))); - connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString, QByteArray, int, QUrl, QString, QString)), this, SLOT(changeBookmarkParent(QString, QByteArray, int, QUrl, QString, QString))); + connect(m_bookmarksModel, SIGNAL(folderRenamed(QString,QString)), this, SLOT(renameFolder(QString,QString))); + connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString,bool)), this, SLOT(changeFolderParent(QString,bool))); + connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString,QByteArray,int,QUrl,QString,QString)), this, SLOT(changeBookmarkParent(QString,QByteArray,int,QUrl,QString,QString))); connect(ui->optimizeDb, SIGNAL(clicked(QPoint)), this, SLOT(optimizeDb())); connect(ui->importBookmarks, SIGNAL(clicked(QPoint)), this, SLOT(importBookmarks())); @@ -382,7 +382,7 @@ void BookmarksManager::addBookmark(const BookmarksModel::Bookmark &bookmark) if (bookmark.inSubfolder) { QList list = ui->bookmarksTree->findItems(bookmark.folder, Qt::MatchExactly | Qt::MatchRecursive); if (list.count() != 0) { - foreach(QTreeWidgetItem * it, list) { + foreach (QTreeWidgetItem* it, list) { if (it->text(1).isEmpty()) { it->addChild(item); break; @@ -407,7 +407,7 @@ void BookmarksManager::removeBookmark(const BookmarksModel::Bookmark &bookmark) QList list = ui->bookmarksTree->findItems(bookmark.folder, Qt::MatchExactly | Qt::MatchRecursive); QTreeWidgetItem* subfolderItem = 0; if (list.count() != 0) { - foreach(QTreeWidgetItem * it, list) { + foreach (QTreeWidgetItem* it, list) { if (it->text(1).isEmpty()) { subfolderItem = it; break; @@ -482,7 +482,7 @@ void BookmarksManager::changeBookmarkParent(const QString &name, const QByteArra QList list = ui->bookmarksTree->findItems(name, Qt::MatchExactly | Qt::MatchRecursive); QTreeWidgetItem* item = 0; - foreach(item, list) { + foreach (item, list) { if (id == item->data(0, Qt::UserRole + 10).toInt()) { break; } @@ -584,7 +584,7 @@ void BookmarksManager::removeFolder(const QString &name) QTreeWidgetItem* folderItem = 0; if (list.count() != 0) { - foreach(QTreeWidgetItem * it, list) { + foreach (QTreeWidgetItem* it, list) { if (it->text(1).isEmpty()) { folderItem = it; break; @@ -607,7 +607,7 @@ void BookmarksManager::renameFolder(const QString &before, const QString &after) QTreeWidgetItem* folderItem = 0; if (list.count() != 0) { - foreach(QTreeWidgetItem * it, list) { + foreach (QTreeWidgetItem* it, list) { if (it->text(0) == before && it->text(1).isEmpty()) { folderItem = it; break; @@ -632,8 +632,8 @@ void BookmarksManager::insertBookmark(const QUrl &url, const QString &title, con QLineEdit* edit = new QLineEdit(dialog); QComboBox* combo = new QComboBox(dialog); BookmarksTree* bookmarksTree = new BookmarksTree(dialog); - connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*, QString*, bool, QString, WebView*)), - this, SLOT(addFolder(QWidget*, QString*, bool, QString, WebView*))); + connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*,QString*,bool,QString,WebView*)), + this, SLOT(addFolder(QWidget*,QString*,bool,QString,WebView*))); bookmarksTree->setViewType(BookmarksTree::ComboFolderView); bookmarksTree->header()->hide(); bookmarksTree->setColumnCount(1); @@ -698,8 +698,8 @@ void BookmarksManager::insertAllTabs() QLabel* label = new QLabel(dialog); QComboBox* combo = new QComboBox(dialog); BookmarksTree* bookmarksTree = new BookmarksTree(dialog); - connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*, QString*, bool, QString, WebView*)), - this, SLOT(addFolder(QWidget*, QString*, bool, QString, WebView*))); + connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*,QString*,bool,QString,WebView*)), + this, SLOT(addFolder(QWidget*,QString*,bool,QString,WebView*))); bookmarksTree->setViewType(BookmarksTree::ComboFolderView); bookmarksTree->header()->hide(); bookmarksTree->setColumnCount(1); @@ -742,7 +742,7 @@ void BookmarksManager::insertAllTabs() return; } - foreach(WebTab * tab, getQupZilla()->tabWidget()->allTabs(false)) { + foreach (WebTab* tab, getQupZilla()->tabWidget()->allTabs(false)) { if (tab->url().isEmpty()) { continue; } diff --git a/src/lib/bookmarks/bookmarksmodel.cpp b/src/lib/bookmarks/bookmarksmodel.cpp index 1a641839d..c7ef9c3cb 100644 --- a/src/lib/bookmarks/bookmarksmodel.cpp +++ b/src/lib/bookmarks/bookmarksmodel.cpp @@ -223,7 +223,7 @@ void BookmarksModel::removeBookmark(const QList list) QSqlDatabase db = QSqlDatabase::database(); db.transaction(); - foreach(int id, list) { + foreach (int id, list) { QSqlQuery query; query.prepare("SELECT url, title, folder FROM bookmarks WHERE id = ?"); query.bindValue(0, id); diff --git a/src/lib/bookmarks/bookmarkstoolbar.cpp b/src/lib/bookmarks/bookmarkstoolbar.cpp index 52d7edf43..40084caa2 100644 --- a/src/lib/bookmarks/bookmarkstoolbar.cpp +++ b/src/lib/bookmarks/bookmarkstoolbar.cpp @@ -56,12 +56,12 @@ BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(removeBookmark(BookmarksModel::Bookmark))); - connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark)), this, SLOT(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark))); + connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark)), this, SLOT(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(subfolderAdded(QString)), this, SLOT(subfolderAdded(QString))); connect(m_bookmarksModel, SIGNAL(folderDeleted(QString)), this, SLOT(folderDeleted(QString))); - connect(m_bookmarksModel, SIGNAL(folderRenamed(QString, QString)), this, SLOT(folderRenamed(QString, QString))); - connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString, bool)), this, SLOT(changeFolderParent(QString, bool))); - connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString, QByteArray, int, QUrl, QString, QString)), this, SLOT(changeBookmarkParent(QString, QByteArray, int, QUrl, QString, QString))); + connect(m_bookmarksModel, SIGNAL(folderRenamed(QString,QString)), this, SLOT(folderRenamed(QString,QString))); + connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString,bool)), this, SLOT(changeFolderParent(QString,bool))); + connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString,QByteArray,int,QUrl,QString,QString)), this, SLOT(changeBookmarkParent(QString,QByteArray,int,QUrl,QString,QString))); setMaximumWidth(p_QupZilla->width()); @@ -334,7 +334,7 @@ void BookmarksToolbar::loadFolderBookmarksInTabs() return; } - foreach(const Bookmark & b, m_bookmarksModel->folderBookmarks(folder)) { + foreach (const Bookmark &b, m_bookmarksModel->folderBookmarks(folder)) { p_QupZilla->tabWidget()->addView(b.url, b.title, Qz::NT_NotSelectedTab); } } @@ -621,7 +621,7 @@ void BookmarksToolbar::aboutToShowFolderMenu() menu->clear(); QString folder = menu->title(); - foreach(const Bookmark & b, m_bookmarksModel->folderBookmarks(folder)) { + foreach (const Bookmark &b, m_bookmarksModel->folderBookmarks(folder)) { QString title = b.title; if (title.length() > 40) { title.truncate(40); @@ -687,7 +687,7 @@ void BookmarksToolbar::refreshMostVisited() m_menuMostVisited->clear(); QVector mostList = m_historyModel->mostVisited(10); - foreach(const HistoryEntry & entry, mostList) { + foreach (const HistoryEntry &entry, mostList) { QString title = entry.title; if (title.length() > 40) { title.truncate(40); diff --git a/src/lib/bookmarks/bookmarkswidget.cpp b/src/lib/bookmarks/bookmarkswidget.cpp index 68d7b2d0b..7cb38e983 100644 --- a/src/lib/bookmarks/bookmarkswidget.cpp +++ b/src/lib/bookmarks/bookmarkswidget.cpp @@ -64,8 +64,8 @@ BookmarksWidget::BookmarksWidget(WebView* view, QWidget* parent) loadBookmark(); connect(ui->folder, SIGNAL(activated(int)), this, SLOT(comboItemActive(int))); - connect(m_bookmarksTree, SIGNAL(requestNewFolder(QWidget*, QString*, bool, QString, WebView*)), - mApp->browsingLibrary()->bookmarksManager(), SLOT(addFolder(QWidget*, QString*, bool, QString, WebView*))); + connect(m_bookmarksTree, SIGNAL(requestNewFolder(QWidget*,QString*,bool,QString,WebView*)), + mApp->browsingLibrary()->bookmarksManager(), SLOT(addFolder(QWidget*,QString*,bool,QString,WebView*))); } void BookmarksWidget::loadBookmark() diff --git a/src/lib/bookmarksimport/bookmarksimportdialog.cpp b/src/lib/bookmarksimport/bookmarksimportdialog.cpp index 5071f9595..eb7be16d3 100644 --- a/src/lib/bookmarksimport/bookmarksimportdialog.cpp +++ b/src/lib/bookmarksimport/bookmarksimportdialog.cpp @@ -107,7 +107,7 @@ void BookmarksImportDialog::startFetchingIcons() QIcon folderIcon = style()->standardIcon(QStyle::SP_DirIcon); QHash hash; - foreach(const Bookmark & b, m_exportedBookmarks) { + foreach (const Bookmark &b, m_exportedBookmarks) { QTreeWidgetItem* item; QTreeWidgetItem* findParent = hash[b.folder]; if (findParent) { @@ -141,7 +141,7 @@ void BookmarksImportDialog::startFetchingIcons() ui->treeWidget->expandAll(); - connect(m_fetcher, SIGNAL(iconFetched(QImage, QTreeWidgetItem*)), this, SLOT(iconFetched(QImage, QTreeWidgetItem*))); + connect(m_fetcher, SIGNAL(iconFetched(QImage,QTreeWidgetItem*)), this, SLOT(iconFetched(QImage,QTreeWidgetItem*))); connect(m_fetcher, SIGNAL(oneFinished()), this, SLOT(loadFinished())); m_fetcherThread->start(); @@ -267,7 +267,7 @@ void BookmarksImportDialog::addExportedBookmarks() QSqlDatabase db = QSqlDatabase::database(); db.transaction(); - foreach(const Bookmark & b, m_exportedBookmarks) { + foreach (const Bookmark &b, m_exportedBookmarks) { model->saveBookmark(b.url, b.title, qIconProvider->iconFromImage(b.image), b.folder); } diff --git a/src/lib/bookmarksimport/bookmarksimporticonfetcher.cpp b/src/lib/bookmarksimport/bookmarksimporticonfetcher.cpp index 67809c751..a8bf86eef 100644 --- a/src/lib/bookmarksimport/bookmarksimporticonfetcher.cpp +++ b/src/lib/bookmarksimport/bookmarksimporticonfetcher.cpp @@ -68,7 +68,7 @@ void BookmarksImportIconFetcher::slotStartFetching() { QNetworkAccessManager* manager = new QNetworkAccessManager(this); - foreach(const Pair & pair, m_pairs) { + foreach (const Pair &pair, m_pairs) { QVariant itemPointer = QVariant::fromValue((void*) pair.item); IconFetcher* fetcher = new IconFetcher(this); diff --git a/src/lib/bookmarksimport/chromeimporter.cpp b/src/lib/bookmarksimport/chromeimporter.cpp index c2c9413c3..9c386aeff 100644 --- a/src/lib/bookmarksimport/chromeimporter.cpp +++ b/src/lib/bookmarksimport/chromeimporter.cpp @@ -67,7 +67,7 @@ QVector ChromeImporter::exportBookmarks() } QScriptEngine* scriptEngine = new QScriptEngine(); - foreach(QString parsedString, parsedBookmarks) { + foreach (QString parsedString, parsedBookmarks) { parsedString = "(" + parsedString + ")"; if (scriptEngine->canEvaluate(parsedString)) { QScriptValue object = scriptEngine->evaluate(parsedString); diff --git a/src/lib/cookies/cookiejar.cpp b/src/lib/cookies/cookiejar.cpp index 122d8ae0a..60a6886f6 100644 --- a/src/lib/cookies/cookiejar.cpp +++ b/src/lib/cookies/cookiejar.cpp @@ -114,7 +114,7 @@ bool CookieJar::setCookiesFromUrl(const QList &cookieList, const { QList newList; - foreach(QNetworkCookie cookie, cookieList) { + foreach (QNetworkCookie cookie, cookieList) { // If cookie domain is empty, set it to url.host() if (cookie.domain().isEmpty()) { cookie.setDomain(url.host()); @@ -240,7 +240,7 @@ bool CookieJar::matchDomain(QString cookieDomain, QString siteDomain) bool CookieJar::listMatchesDomain(const QStringList &list, const QString &cookieDomain) { - foreach(const QString & d, list) { + foreach (const QString &d, list) { if (matchDomain(d, cookieDomain)) { return true; } diff --git a/src/lib/cookies/cookiemanager.cpp b/src/lib/cookies/cookiemanager.cpp index 5837309ff..171df771d 100644 --- a/src/lib/cookies/cookiemanager.cpp +++ b/src/lib/cookies/cookiemanager.cpp @@ -40,7 +40,7 @@ CookieManager::CookieManager(QWidget* parent) QzTools::centerWidgetOnScreen(this); // Stored Cookies - connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); + connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*))); connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie())); connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); @@ -102,7 +102,7 @@ void CookieManager::removeCookie() if (current->text(1).isEmpty()) { //Remove whole cookie group const QString &domain = current->data(0, Qt::UserRole + 10).toString(); - foreach(const QNetworkCookie & cookie, allCookies) { + foreach (const QNetworkCookie &cookie, allCookies) { if (cookie.domain() == domain || cookie.domain() == domain.mid(1)) { allCookies.removeOne(cookie); } diff --git a/src/lib/downloads/downloaditem.cpp b/src/lib/downloads/downloaditem.cpp index 505969912..afa373c28 100644 --- a/src/lib/downloads/downloaditem.cpp +++ b/src/lib/downloads/downloaditem.cpp @@ -116,7 +116,7 @@ void DownloadItem::startDownloading() m_reply->setParent(this); connect(m_reply, SIGNAL(finished()), this, SLOT(finished())); connect(m_reply, SIGNAL(readyRead()), this, SLOT(readyRead())); - connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); + connect(m_reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(downloadProgress(qint64,qint64))); connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error())); connect(m_reply, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged())); @@ -141,9 +141,9 @@ void DownloadItem::startDownloadingFromFtp(const QUrl &url) m_ftpDownloader = new FtpDownloader(this); connect(m_ftpDownloader, SIGNAL(finished()), this, SLOT(finished())); - connect(m_ftpDownloader, SIGNAL(dataTransferProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); + connect(m_ftpDownloader, SIGNAL(dataTransferProgress(qint64,qint64)), this, SLOT(downloadProgress(qint64,qint64))); connect(m_ftpDownloader, SIGNAL(errorOccured(QFtp::Error)), this, SLOT(error())); - connect(m_ftpDownloader, SIGNAL(ftpAuthenticationRequierd(const QUrl &, QAuthenticator*)), mApp->networkManager(), SLOT(ftpAuthentication(const QUrl &, QAuthenticator*))); + connect(m_ftpDownloader, SIGNAL(ftpAuthenticationRequierd(QUrl,QAuthenticator*)), mApp->networkManager(), SLOT(ftpAuthentication(QUrl,QAuthenticator*))); m_ftpDownloader->download(url, &m_outputFile); m_downloading = true; diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 4e8ca9e0e..b554661f8 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -152,20 +152,22 @@ void DownloadManager::timerEvent(QTimerEvent* e) } QTime remaining; - foreach(const QTime & time, remTimes) { + foreach (const QTime &time, remTimes) { if (time > remaining) { remaining = time; } } int progress = 0; - foreach(int prog, progresses) - progress += prog; + foreach (int prog, progresses) { + progress += prog; + } progress = progress / progresses.count(); double speed = 0.00; - foreach(double spee, speeds) - speed += spee; + foreach (double spee, speeds) { + speed += spee; + } ui->speedLabel->setText(tr("%1% of %2 files (%3) %4 remaining").arg(QString::number(progress), QString::number(progresses.count()), DownloadItem::currentSpeedToString(speed), @@ -228,7 +230,7 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, const Downl reply->setProperty("downReply", QVariant(true)); DownloadFileHelper* h = new DownloadFileHelper(m_lastDownloadPath, m_downloadPath, m_useNativeDialog); - connect(h, SIGNAL(itemCreated(QListWidgetItem*, DownloadItem*)), this, SLOT(itemCreated(QListWidgetItem*, DownloadItem*))); + connect(h, SIGNAL(itemCreated(QListWidgetItem*,DownloadItem*)), this, SLOT(itemCreated(QListWidgetItem*,DownloadItem*))); h->setLastDownloadOption(m_lastDownloadOption); h->setDownloadManager(this); diff --git a/src/lib/history/history.cpp b/src/lib/history/history.cpp index fe73050e6..d1929349b 100644 --- a/src/lib/history/history.cpp +++ b/src/lib/history/history.cpp @@ -142,7 +142,7 @@ void History::deleteHistoryEntry(const QList &list) QSqlDatabase db = QSqlDatabase::database(); db.transaction(); - foreach(int index, list) { + foreach (int index, list) { QSqlQuery query; query.prepare("SELECT count, date, url, title FROM history WHERE id=?"); query.addBindValue(index); diff --git a/src/lib/history/historymanager.cpp b/src/lib/history/historymanager.cpp index fd6b134d4..f50ed511f 100644 --- a/src/lib/history/historymanager.cpp +++ b/src/lib/history/historymanager.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -36,7 +36,7 @@ HistoryManager::HistoryManager(QupZilla* mainClass, QWidget* parent) { ui->setupUi(this); - connect(ui->historyTree, SIGNAL(openLink(QUrl, HistoryView::OpenBehavior)), this, SLOT(openLink(QUrl, HistoryView::OpenBehavior))); + connect(ui->historyTree, SIGNAL(openLink(QUrl,HistoryView::OpenBehavior)), this, SLOT(openLink(QUrl,HistoryView::OpenBehavior))); connect(ui->deleteB, SIGNAL(clicked()), ui->historyTree, SLOT(removeItems())); connect(ui->clearAll, SIGNAL(clicked()), this, SLOT(clearHistory())); diff --git a/src/lib/history/historymodel.cpp b/src/lib/history/historymodel.cpp index d93a8fc5b..0361053f7 100644 --- a/src/lib/history/historymodel.cpp +++ b/src/lib/history/historymodel.cpp @@ -43,9 +43,9 @@ HistoryModel::HistoryModel(History* history) init(); connect(m_history, SIGNAL(resetHistory()), this, SLOT(resetHistory())); - connect(m_history, SIGNAL(historyEntryAdded(const HistoryEntry &)), this, SLOT(historyEntryAdded(const HistoryEntry &))); - connect(m_history, SIGNAL(historyEntryDeleted(const HistoryEntry &)), this, SLOT(historyEntryDeleted(const HistoryEntry &))); - connect(m_history, SIGNAL(historyEntryEdited(const HistoryEntry &, const HistoryEntry &)), this, SLOT(historyEntryEdited(const HistoryEntry &, const HistoryEntry &))); + connect(m_history, SIGNAL(historyEntryAdded(HistoryEntry)), this, SLOT(historyEntryAdded(HistoryEntry))); + connect(m_history, SIGNAL(historyEntryDeleted(HistoryEntry)), this, SLOT(historyEntryDeleted(HistoryEntry))); + connect(m_history, SIGNAL(historyEntryEdited(HistoryEntry,HistoryEntry)), this, SLOT(historyEntryEdited(HistoryEntry,HistoryEntry))); } QVariant HistoryModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -237,7 +237,7 @@ HistoryItem* HistoryModel::itemFromIndex(const QModelIndex &index) const void HistoryModel::removeTopLevelIndexes(const QList &indexes) { - foreach(const QPersistentModelIndex & index, indexes) { + foreach (const QPersistentModelIndex &index, indexes) { if (index.parent().isValid()) { continue; } @@ -322,7 +322,7 @@ void HistoryModel::fetchMore(const QModelIndex &parent) beginInsertRows(parent, 0, list.size() - 1); - foreach(const HistoryEntry & entry, list) { + foreach (const HistoryEntry &entry, list) { HistoryItem* newItem = new HistoryItem(parentItem); newItem->historyEntry = entry; } diff --git a/src/lib/history/historyview.cpp b/src/lib/history/historyview.cpp index ae0acc754..0da108ed7 100644 --- a/src/lib/history/historyview.cpp +++ b/src/lib/history/historyview.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -68,7 +68,7 @@ void HistoryView::removeItems() QList topLevelIndexes; - foreach(const QModelIndex & index, selectedIndexes()) { + foreach (const QModelIndex &index, selectedIndexes()) { if (index.column() > 0) { continue; } diff --git a/src/lib/navigation/completer/locationcompleter.cpp b/src/lib/navigation/completer/locationcompleter.cpp index 0ad5e7e51..f73b745d8 100644 --- a/src/lib/navigation/completer/locationcompleter.cpp +++ b/src/lib/navigation/completer/locationcompleter.cpp @@ -90,7 +90,7 @@ void LocationCompleter::currentChanged(const QModelIndex &index) void LocationCompleter::slotPopupClosed() { - disconnect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex))); + disconnect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex))); disconnect(s_view, SIGNAL(clicked(QModelIndex)), this, SIGNAL(completionActivated())); disconnect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed())); disconnect(s_view, SIGNAL(aboutToActivateTab(TabPosition)), m_locationBar, SLOT(clear())); @@ -118,7 +118,7 @@ void LocationCompleter::showPopup() s_view->setFocusProxy(m_locationBar); s_view->setGeometry(popupRect); - connect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex))); + connect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex))); connect(s_view, SIGNAL(clicked(QModelIndex)), this, SIGNAL(completionActivated())); connect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed())); connect(s_view, SIGNAL(aboutToActivateTab(TabPosition)), m_locationBar, SLOT(clear())); diff --git a/src/lib/navigation/completer/locationcompleterdelegate.cpp b/src/lib/navigation/completer/locationcompleterdelegate.cpp index e22e5ad48..d7f7e96ca 100644 --- a/src/lib/navigation/completer/locationcompleterdelegate.cpp +++ b/src/lib/navigation/completer/locationcompleterdelegate.cpp @@ -151,7 +151,7 @@ void LocationCompleterDelegate::drawHighlightedTextLine(const QRect &rect, const // Look for longer parts first qSort(searchStrings.begin(), searchStrings.end(), sizeBiggerThan); - foreach(const QString & string, searchStrings) { + foreach (const QString &string, searchStrings) { int delimiter = text.indexOf(string, 0, Qt::CaseInsensitive); while (delimiter != -1) { diff --git a/src/lib/navigation/completer/locationcompletermodel.cpp b/src/lib/navigation/completer/locationcompletermodel.cpp index 544b50366..9b4d46be2 100644 --- a/src/lib/navigation/completer/locationcompletermodel.cpp +++ b/src/lib/navigation/completer/locationcompletermodel.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -184,13 +184,13 @@ QSqlQuery LocationCompleterModel::createQuery(const QString &searchString, const sqlQuery.addBindValue(QString("%%1%").arg(searchString)); } else { - foreach(const QString & str, searchList) { + foreach (const QString &str, searchList) { sqlQuery.addBindValue(QString("%%1%").arg(str)); sqlQuery.addBindValue(QString("%%1%").arg(str)); } } - foreach(const QUrl & url, alreadyFound) { + foreach (const QUrl &url, alreadyFound) { sqlQuery.addBindValue(url); } diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 2aa0cac02..961c89556 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -91,7 +91,7 @@ LocationBar::LocationBar(QupZilla* mainClass) connect(down, SIGNAL(clicked(QPoint)), &m_completer, SLOT(showMostVisited())); connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText())); connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText())); - connect(mApp, SIGNAL(message(Qz::AppMessageType, bool)), SLOT(onMessage(Qz::AppMessageType, bool))); + connect(mApp, SIGNAL(message(Qz::AppMessageType,bool)), SLOT(onMessage(Qz::AppMessageType,bool))); loadSettings(); @@ -319,7 +319,7 @@ void LocationBar::contextMenuEvent(QContextMenuEvent* event) QMenu menu(this); int i = 0; - foreach(QAction * act, tempMenu->actions()) { + foreach (QAction* act, tempMenu->actions()) { menu.addAction(act); switch (i) { diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index 54a97bf82..dafa1d53c 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -93,8 +93,8 @@ WebSearchBar::WebSearchBar(QupZilla* mainClass) m_openSearchEngine = new OpenSearchEngine(this); m_openSearchEngine->setNetworkAccessManager(mApp->networkManager()); - connect(m_openSearchEngine, SIGNAL(suggestions(const QStringList &)), this, SLOT(addSuggestions(const QStringList &))); - connect(this, SIGNAL(textEdited(const QString &)), m_openSearchEngine, SLOT(requestSuggestions(QString))); + connect(m_openSearchEngine, SIGNAL(suggestions(QStringList)), this, SLOT(addSuggestions(QStringList))); + connect(this, SIGNAL(textEdited(QString)), m_openSearchEngine, SLOT(requestSuggestions(QString))); QTimer::singleShot(0, this, SLOT(setupEngines())); } @@ -153,7 +153,7 @@ void WebSearchBar::setupEngines() m_boxSearchType->clearItems(); - foreach(const SearchEngine & en, m_searchManager->allEngines()) { + foreach (const SearchEngine &en, m_searchManager->allEngines()) { ButtonWithMenu::Item item; item.icon = en.icon; item.text = en.name; @@ -221,7 +221,7 @@ void WebSearchBar::completeMenuWithAvailableEngines(QMenu* menu) QWebFrame* frame = view->page()->mainFrame(); QWebElementCollection elements = frame->documentElement().findAll(QLatin1String("link[rel=search]")); - foreach(const QWebElement & element, elements) { + foreach (const QWebElement &element, elements) { if (element.attribute("type") != QLatin1String("application/opensearchdescription+xml")) { continue; } @@ -272,7 +272,7 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event) QMenu menu(this); int i = 0; - foreach(QAction * act, tempMenu->actions()) { + foreach (QAction* act, tempMenu->actions()) { menu.addAction(act); switch (i) { diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index bd7db43b7..3eef85cfc 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -69,9 +69,9 @@ NetworkManager::NetworkManager(QObject* parent) , m_adblockManager(0) , m_ignoreAllWarnings(false) { - connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), this, SLOT(authentication(QNetworkReply*, QAuthenticator*))); - connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator*)), this, SLOT(proxyAuthentication(QNetworkProxy, QAuthenticator*))); - connect(this, SIGNAL(sslErrors(QNetworkReply*, QList)), this, SLOT(sslError(QNetworkReply*, QList))); + connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authentication(QNetworkReply*,QAuthenticator*))); + connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthentication(QNetworkProxy,QAuthenticator*))); + connect(this, SIGNAL(sslErrors(QNetworkReply*,QList)), this, SLOT(sslError(QNetworkReply*,QList))); connect(this, SIGNAL(finished(QNetworkReply*)), this, SLOT(setSSLConfiguration(QNetworkReply*))); m_schemeHandlers["qupzilla"] = new QupZillaSchemeHandler(); @@ -175,7 +175,7 @@ void NetworkManager::sslError(QNetworkReply* reply, QList errors) } QHash errorHash; - foreach(const QSslError & error, errors) { + foreach (const QSslError &error, errors) { // Weird behavior on Windows if (error.error() == QSslError::NoError) { continue; @@ -220,7 +220,7 @@ void NetworkManager::sslError(QNetworkReply* reply, QList errors) certs += ""; certs += "
    "; - foreach(const QString & error, errors) { + foreach (const QString &error, errors) { certs += "
  • "; certs += tr("Error: ") + error; certs += "
  • "; @@ -241,7 +241,7 @@ void NetworkManager::sslError(QNetworkReply* reply, QList errors) return; } - foreach(const QSslCertificate & cert, errorHash.keys()) { + foreach (const QSslCertificate &cert, errorHash.keys()) { if (!m_localCerts.contains(cert)) { addLocalCertificate(cert); } @@ -480,11 +480,11 @@ QNetworkReply* NetworkManager::createRequest(QNetworkAccessManager::Operation op QVariant v = req.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100)); WebPage* webPage = static_cast(v.value()); if (webPage) { - connect(reply, SIGNAL(downloadRequest(const QNetworkRequest &)), - webPage, SLOT(downloadRequested(const QNetworkRequest &))); + connect(reply, SIGNAL(downloadRequest(QNetworkRequest)), + webPage, SLOT(downloadRequested(QNetworkRequest))); } - connect(reply, SIGNAL(ftpAuthenticationRequierd(const QUrl &, QAuthenticator*)), - this, SLOT(ftpAuthentication(const QUrl &, QAuthenticator*))); + connect(reply, SIGNAL(ftpAuthenticationRequierd(QUrl,QAuthenticator*)), + this, SLOT(ftpAuthentication(QUrl,QAuthenticator*))); } return reply; } @@ -625,7 +625,7 @@ void NetworkManager::loadCertificates() //CA Certificates m_caCerts = QSslSocket::defaultCaCertificates(); - foreach(const QString & path, m_certPaths) { + foreach (const QString &path, m_certPaths) { #ifdef Q_OS_WIN // Used from Qt 4.7.4 qsslcertificate.cpp and modified because QSslCertificate::fromPath // is kind of a bugged on Windows, it does work only with full path to cert file diff --git a/src/lib/network/networkmanagerproxy.cpp b/src/lib/network/networkmanagerproxy.cpp index 0c3a9c70d..87b30e16c 100644 --- a/src/lib/network/networkmanagerproxy.cpp +++ b/src/lib/network/networkmanagerproxy.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -36,10 +36,10 @@ void NetworkManagerProxy::setPrimaryNetworkAccessManager(NetworkManager* manager Q_ASSERT(manager); m_manager = manager; - connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), m_manager, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*))); - connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator*)), m_manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator*))); + connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), m_manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*))); + connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), m_manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); connect(this, SIGNAL(finished(QNetworkReply*)), m_manager, SIGNAL(finished(QNetworkReply*))); - connect(this, SIGNAL(sslErrors(QNetworkReply*, const QList &)), m_manager, SIGNAL(sslErrors(QNetworkReply*, const QList &))); + connect(this, SIGNAL(sslErrors(QNetworkReply*,QList)), m_manager, SIGNAL(sslErrors(QNetworkReply*,QList))); } QNetworkReply* NetworkManagerProxy::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData) diff --git a/src/lib/network/schemehandlers/fileschemehandler.cpp b/src/lib/network/schemehandlers/fileschemehandler.cpp index 32ffab750..bd30e3a05 100644 --- a/src/lib/network/schemehandlers/fileschemehandler.cpp +++ b/src/lib/network/schemehandlers/fileschemehandler.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -185,7 +185,7 @@ QString FileSchemeReply::loadDirectory() page.replace(QLatin1String("%UP-DIR-LINK%"), QUrl::fromLocalFile(upDir.absolutePath()).toEncoded()); } - foreach(const QFileInfo & info, list) { + foreach (const QFileInfo &info, list) { if (info.fileName() == QLatin1String(".") || info.fileName() == QLatin1String("..")) { continue; } diff --git a/src/lib/network/schemehandlers/ftpschemehandler.cpp b/src/lib/network/schemehandlers/ftpschemehandler.cpp index bfd2b803c..579ca9a7b 100644 --- a/src/lib/network/schemehandlers/ftpschemehandler.cpp +++ b/src/lib/network/schemehandlers/ftpschemehandler.cpp @@ -75,8 +75,8 @@ FtpSchemeReply::FtpSchemeReply(const QNetworkRequest &request, QObject* parent) m_ftp = new QFtp(this); connect(m_ftp, SIGNAL(listInfo(QUrlInfo)), this, SLOT(processListInfo(QUrlInfo))); connect(m_ftp, SIGNAL(readyRead()), this, SLOT(processData())); - connect(m_ftp, SIGNAL(commandFinished(int, bool)), this, SLOT(processCommand(int, bool))); - connect(m_ftp, SIGNAL(dataTransferProgress(qint64, qint64)), this, SIGNAL(downloadProgress(qint64, qint64))); + connect(m_ftp, SIGNAL(commandFinished(int,bool)), this, SLOT(processCommand(int,bool))); + connect(m_ftp, SIGNAL(dataTransferProgress(qint64,qint64)), this, SIGNAL(downloadProgress(qint64,qint64))); m_buffer.open(QIODevice::ReadWrite); @@ -120,7 +120,7 @@ void FtpSchemeReply::processCommand(int id, bool err) case QFtp::List: if (m_isGoingToDownload) { - foreach(const QUrlInfo & item, m_items) { + foreach (const QUrlInfo &item, m_items) { // don't check if it's a file or not, // seems it's a QFtp's bug: for link to a file isDir() returns true if (item.name() == m_probablyFileForDownload) { @@ -291,7 +291,7 @@ QString FtpSchemeReply::loadDirectory() } } - foreach(const QUrlInfo & item, m_items) { + foreach (const QUrlInfo &item, m_items) { if (item.name() == QLatin1String(".") || item.name() == QLatin1String("..")) { continue; @@ -422,7 +422,7 @@ FtpDownloader::FtpDownloader(QObject* parent) , m_dev(0) , m_lastError(QFtp::NoError) { - connect(this, SIGNAL(commandFinished(int, bool)), this, SLOT(processCommand(int, bool))); + connect(this, SIGNAL(commandFinished(int,bool)), this, SLOT(processCommand(int,bool))); connect(this, SIGNAL(done(bool)), this, SLOT(onDone(bool))); } diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index 38ad357fc..f8c8f82dd 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -431,7 +431,7 @@ QString QupZillaSchemeReply::configPage() QString pluginsString; const QList &availablePlugins = mApp->plugins()->getAvailablePlugins(); - foreach(const Plugins::Plugin & plugin, availablePlugins) { + foreach (const Plugins::Plugin &plugin, availablePlugins) { PluginSpec spec = plugin.pluginSpec; pluginsString.append(QString("%1%2%3%4").arg( spec.name, spec.version, QzTools::escape(spec.author), spec.description)); @@ -445,11 +445,11 @@ QString QupZillaSchemeReply::configPage() QString allGroupsString; QSettings* settings = Settings::globalSettings(); - foreach(const QString & group, settings->childGroups()) { + foreach (const QString &group, settings->childGroups()) { QString groupString = QString("[%1]").arg(group); settings->beginGroup(group); - foreach(const QString & key, settings->childKeys()) { + foreach (const QString &key, settings->childKeys()) { const QVariant &keyValue = settings->value(key); QString keyString; diff --git a/src/lib/opensearch/searchenginesdialog.cpp b/src/lib/opensearch/searchenginesdialog.cpp index c28bd8365..fc98059ae 100644 --- a/src/lib/opensearch/searchenginesdialog.cpp +++ b/src/lib/opensearch/searchenginesdialog.cpp @@ -37,7 +37,7 @@ SearchEnginesDialog::SearchEnginesDialog(QWidget* parent) connect(ui->moveUp, SIGNAL(clicked()), this, SLOT(moveUp())); connect(ui->moveDown, SIGNAL(clicked()), this, SLOT(moveDown())); - connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(editEngine())); + connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(editEngine())); ui->treeWidget->sortByColumn(-1); reloadEngines(); @@ -214,7 +214,7 @@ void SearchEnginesDialog::reloadEngines() ui->treeWidget->clear(); const QString defaultEngineName = mApp->searchEnginesManager()->defaultEngine().name; - foreach(const SearchEngine & en, m_manager->allEngines()) { + foreach (const SearchEngine &en, m_manager->allEngines()) { QTreeWidgetItem* item = new QTreeWidgetItem(); setEngine(item, en); changeItemToDefault(item, en.name == defaultEngineName); diff --git a/src/lib/opensearch/searchenginesmanager.cpp b/src/lib/opensearch/searchenginesmanager.cpp index 878f49e87..72ae7d4c2 100644 --- a/src/lib/opensearch/searchenginesmanager.cpp +++ b/src/lib/opensearch/searchenginesmanager.cpp @@ -99,7 +99,7 @@ SearchEngine SearchEnginesManager::engineForShortcut(const QString &shortcut) return returnEngine; } - foreach(const Engine & en, m_allEngines) { + foreach (const Engine &en, m_allEngines) { if (en.shortcut == shortcut) { returnEngine = en; break; @@ -171,7 +171,7 @@ void SearchEnginesManager::engineChangedImage() return; } - foreach(Engine e, m_allEngines) { + foreach (Engine e, m_allEngines) { if (e.name == engine->name() && e.url.contains(engine->searchUrl("%s").toString()) && !engine->image().isNull()) { @@ -233,7 +233,7 @@ void SearchEnginesManager::addEngineFromForm(const QWebElement &element, WebView query.addQueryItem(element.attribute("name"), "%s"); QWebElementCollection allInputs = formElement.findAll("input"); - foreach(QWebElement e, allInputs) { + foreach (QWebElement e, allInputs) { if (element == e || !e.hasAttribute("name")) { continue; } @@ -247,7 +247,7 @@ void SearchEnginesManager::addEngineFromForm(const QWebElement &element, WebView QList > queryItems; QWebElementCollection allInputs = formElement.findAll("input"); - foreach(QWebElement e, allInputs) { + foreach (QWebElement e, allInputs) { if (element == e || !e.hasAttribute("name")) { continue; } @@ -445,7 +445,7 @@ void SearchEnginesManager::saveSettings() QSqlQuery query; query.exec("DELETE FROM search_engines"); - foreach(const Engine & en, m_allEngines) { + foreach (const Engine &en, m_allEngines) { query.prepare("INSERT INTO search_engines (name, icon, url, shortcut, suggestionsUrl, suggestionsParameters) VALUES (?, ?, ?, ?, ?, ?)"); query.bindValue(0, en.name); query.bindValue(1, qIconProvider->iconToBase64(en.icon)); diff --git a/src/lib/other/browsinglibrary.cpp b/src/lib/other/browsinglibrary.cpp index 31672a554..135e41ffc 100644 --- a/src/lib/other/browsinglibrary.cpp +++ b/src/lib/other/browsinglibrary.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -57,7 +57,7 @@ BrowsingLibrary::BrowsingLibrary(QupZilla* mainClass, QWidget* parent) ui->tabs->setFocus(); connect(ui->tabs, SIGNAL(CurrentChanged(int)), this, SLOT(currentIndexChanged(int))); - connect(ui->searchLine, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(search())); + connect(ui->searchLine, SIGNAL(cursorPositionChanged(int,int)), this, SLOT(search())); } void BrowsingLibrary::currentIndexChanged(int index) diff --git a/src/lib/other/macmenureceiver.cpp b/src/lib/other/macmenureceiver.cpp index e9272c518..75b1749e7 100644 --- a/src/lib/other/macmenureceiver.cpp +++ b/src/lib/other/macmenureceiver.cpp @@ -42,13 +42,13 @@ void MacMenuReceiver::setEnabledSelectedMenuActions(QMenu* menu, const QListactions()) { + foreach (QAction* act, menu->actions()) { act->setEnabled(true); } return; } - foreach(int index, indexList) { + foreach (int index, indexList) { Q_ASSERT(index >= 0 && index < menu->actions().size()); menu->actions().at(index)->setEnabled(true); } @@ -62,13 +62,13 @@ void MacMenuReceiver::setDisabledSelectedMenuActions(QMenu* menu, const QListactions()) { + foreach (QAction* act, menu->actions()) { act->setDisabled(true); } return; } - foreach(int index, indexList) { + foreach (int index, indexList) { Q_ASSERT(index >= 0 && index < menu->actions().size()); menu->actions().at(index)->setDisabled(true); } diff --git a/src/lib/other/pagescreen.cpp b/src/lib/other/pagescreen.cpp index d79cf2ef4..cb6d80014 100644 --- a/src/lib/other/pagescreen.cpp +++ b/src/lib/other/pagescreen.cpp @@ -86,7 +86,7 @@ void PageScreen::saveScreen() } else { int part = 1; - foreach(const QImage & image, m_pageImages) { + foreach (const QImage &image, m_pageImages) { const QString &fileName = pathWithoutSuffix + ".part" + QString::number(part); image.save(fileName + ".png", "PNG"); part++; @@ -167,7 +167,7 @@ QImage PageScreen::scaleImage() QVector scaledImages; int sumHeight = 0; - foreach(const QImage & image, m_pageImages) { + foreach (const QImage &image, m_pageImages) { QImage scaled = image.scaledToWidth(450, Qt::SmoothTransformation); scaledImages.append(scaled); @@ -178,7 +178,7 @@ QImage PageScreen::scaleImage() QPainter painter(&finalImage); int offset = 0; - foreach(const QImage & image, scaledImages) { + foreach (const QImage &image, scaledImages) { painter.drawImage(0, offset, image); offset += image.height(); } diff --git a/src/lib/plugins/clicktoflash.cpp b/src/lib/plugins/clicktoflash.cpp index 853899fec..9c0f7a896 100644 --- a/src/lib/plugins/clicktoflash.cpp +++ b/src/lib/plugins/clicktoflash.cpp @@ -199,7 +199,7 @@ void ClickToFlash::findElement() elements.append(docElement.findAll(QLatin1String("embed"))); elements.append(docElement.findAll(QLatin1String("object"))); - foreach(const QWebElement & element, elements) { + foreach (const QWebElement &element, elements) { if (!checkElement(element) && !checkUrlOnElement(element)) { continue; } @@ -277,7 +277,7 @@ bool ClickToFlash::checkUrlOnElement(QWebElement el) bool ClickToFlash::checkElement(QWebElement el) { if (m_argumentNames == el.attributeNames()) { - foreach(const QString & name, m_argumentNames) { + foreach (const QString &name, m_argumentNames) { if (m_argumentValues.indexOf(el.attribute(name)) == -1) { return false; } @@ -297,7 +297,7 @@ void ClickToFlash::showInfo() lay->addRow(new QLabel(tr("Attribute Name")), new QLabel(tr("Value"))); int i = 0; - foreach(const QString & name, m_argumentNames) { + foreach (const QString &name, m_argumentNames) { QString value = m_argumentValues.at(i); SqueezeLabelV2* valueLabel = new SqueezeLabelV2(value); valueLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse); diff --git a/src/lib/plugins/pluginproxy.cpp b/src/lib/plugins/pluginproxy.cpp index 30513d55f..49629c9ba 100644 --- a/src/lib/plugins/pluginproxy.cpp +++ b/src/lib/plugins/pluginproxy.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -95,7 +95,7 @@ void PluginProxy::populateWebViewMenu(QMenu* menu, WebView* view, const QWebHitT return; } - foreach(PluginInterface * iPlugin, m_loadedPlugins) { + foreach (PluginInterface* iPlugin, m_loadedPlugins) { iPlugin->populateWebViewMenu(menu, view, r); } } @@ -104,7 +104,7 @@ bool PluginProxy::processMouseDoubleClick(const Qz::ObjectName &type, QObject* o { bool accepted = false; - foreach(PluginInterface * iPlugin, m_mouseDoubleClickHandlers) { + foreach (PluginInterface* iPlugin, m_mouseDoubleClickHandlers) { if (iPlugin->mouseDoubleClick(type, obj, event)) { accepted = true; } @@ -117,7 +117,7 @@ bool PluginProxy::processMousePress(const Qz::ObjectName &type, QObject* obj, QM { bool accepted = false; - foreach(PluginInterface * iPlugin, m_mousePressHandlers) { + foreach (PluginInterface* iPlugin, m_mousePressHandlers) { if (iPlugin->mousePress(type, obj, event)) { accepted = true; } @@ -130,7 +130,7 @@ bool PluginProxy::processMouseRelease(const Qz::ObjectName &type, QObject* obj, { bool accepted = false; - foreach(PluginInterface * iPlugin, m_mouseReleaseHandlers) { + foreach (PluginInterface* iPlugin, m_mouseReleaseHandlers) { if (iPlugin->mouseRelease(type, obj, event)) { accepted = true; } @@ -143,7 +143,7 @@ bool PluginProxy::processMouseMove(const Qz::ObjectName &type, QObject* obj, QMo { bool accepted = false; - foreach(PluginInterface * iPlugin, m_mouseMoveHandlers) { + foreach (PluginInterface* iPlugin, m_mouseMoveHandlers) { if (iPlugin->mouseMove(type, obj, event)) { accepted = true; } @@ -156,7 +156,7 @@ bool PluginProxy::processWheelEvent(const Qz::ObjectName &type, QObject* obj, QW { bool accepted = false; - foreach(PluginInterface * iPlugin, m_wheelEventHandlers) { + foreach (PluginInterface* iPlugin, m_wheelEventHandlers) { if (iPlugin->wheelEvent(type, obj, event)) { accepted = true; } @@ -169,7 +169,7 @@ bool PluginProxy::processKeyPress(const Qz::ObjectName &type, QObject* obj, QKey { bool accepted = false; - foreach(PluginInterface * iPlugin, m_keyPressHandlers) { + foreach (PluginInterface* iPlugin, m_keyPressHandlers) { if (iPlugin->keyPress(type, obj, event)) { accepted = true; } @@ -182,7 +182,7 @@ bool PluginProxy::processKeyRelease(const Qz::ObjectName &type, QObject* obj, QK { bool accepted = false; - foreach(PluginInterface * iPlugin, m_keyReleaseHandlers) { + foreach (PluginInterface* iPlugin, m_keyReleaseHandlers) { if (iPlugin->keyRelease(type, obj, event)) { accepted = true; } @@ -193,7 +193,7 @@ bool PluginProxy::processKeyRelease(const Qz::ObjectName &type, QObject* obj, QK QNetworkReply* PluginProxy::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData) { - foreach(PluginInterface * iPlugin, m_loadedPlugins) { + foreach (PluginInterface* iPlugin, m_loadedPlugins) { QNetworkReply* reply = iPlugin->createRequest(op, request, outgoingData); if (reply) { return reply; diff --git a/src/lib/plugins/plugins.cpp b/src/lib/plugins/plugins.cpp index 20f76f017..8c852f0a2 100644 --- a/src/lib/plugins/plugins.cpp +++ b/src/lib/plugins/plugins.cpp @@ -94,7 +94,7 @@ void Plugins::shutdown() c2f_saveSettings(); m_speedDial->saveSettings(); - foreach(PluginInterface * iPlugin, m_loadedPlugins) { + foreach (PluginInterface* iPlugin, m_loadedPlugins) { iPlugin->unload(); } } @@ -128,7 +128,7 @@ void Plugins::loadPlugins() settingsDir.mkdir(settingsDir.absolutePath()); } - foreach(const QString & fullPath, m_allowedPlugins) { + foreach (const QString &fullPath, m_allowedPlugins) { QPluginLoader* loader = new QPluginLoader(fullPath); PluginInterface* iPlugin = qobject_cast(loader->instance()); if (!iPlugin) { @@ -172,9 +172,9 @@ void Plugins::loadAvailablePlugins() #endif << mApp->PROFILEDIR + "plugins/"; - foreach(const QString & dir, dirs) { + foreach (const QString &dir, dirs) { QDir pluginsDir = QDir(dir); - foreach(const QString & fileName, pluginsDir.entryList(QDir::Files)) { + foreach (const QString &fileName, pluginsDir.entryList(QDir::Files)) { const QString absolutePath = pluginsDir.absoluteFilePath(fileName); if (m_allowedPlugins.contains(absolutePath)) { continue; @@ -227,7 +227,7 @@ void Plugins::refreshLoadedPlugins() { m_loadedPlugins.clear(); - foreach(const Plugin & plugin, m_availablePlugins) { + foreach (const Plugin &plugin, m_availablePlugins) { if (plugin.isLoaded()) { m_loadedPlugins.append(plugin.instance); } @@ -236,7 +236,7 @@ void Plugins::refreshLoadedPlugins() bool Plugins::alreadySpecInAvailable(const PluginSpec &spec) { - foreach(const Plugin & plugin, m_availablePlugins) { + foreach (const Plugin &plugin, m_availablePlugins) { if (plugin.pluginSpec == spec) { return true; } diff --git a/src/lib/plugins/qtwebkit/spellcheck/speller.cpp b/src/lib/plugins/qtwebkit/spellcheck/speller.cpp index c8f22ff38..ef6c33875 100644 --- a/src/lib/plugins/qtwebkit/spellcheck/speller.cpp +++ b/src/lib/plugins/qtwebkit/spellcheck/speller.cpp @@ -328,7 +328,7 @@ void Speller::populateLanguagesMenu() } const QVector langs = availableLanguages(); - foreach(const Language & lang, langs) { + foreach (const Language &lang, langs) { QAction* act = menu->addAction(lang.name, this, SLOT(changeLanguage())); act->setCheckable(true); act->setChecked(m_language == lang); diff --git a/src/lib/plugins/speeddial.cpp b/src/lib/plugins/speeddial.cpp index be22e5bcf..20399218b 100644 --- a/src/lib/plugins/speeddial.cpp +++ b/src/lib/plugins/speeddial.cpp @@ -95,7 +95,7 @@ SpeedDial::Page SpeedDial::pageForUrl(const QUrl &url) const QString &urlString = url.toString(); - foreach(const Page & page, m_webPages) { + foreach (const Page &page, m_webPages) { if (page.url == urlString) { return page; } @@ -137,7 +137,7 @@ void SpeedDial::addPage(const QUrl &url, const QString &title) m_webPages.append(page); m_regenerateScript = true; - foreach(QWebFrame * frame, cleanFrames()) { + foreach (QWebFrame* frame, cleanFrames()) { frame->page()->triggerAction(QWebPage::Reload); } @@ -156,7 +156,7 @@ void SpeedDial::removePage(const Page &page) m_webPages.removeAll(page); m_regenerateScript = true; - foreach(QWebFrame * frame, cleanFrames()) { + foreach (QWebFrame* frame, cleanFrames()) { frame->page()->triggerAction(QWebPage::Reload); } @@ -209,7 +209,7 @@ QString SpeedDial::initialScript() m_regenerateScript = false; m_initialScript.clear(); - foreach(const Page & page, m_webPages) { + foreach (const Page &page, m_webPages) { QString imgSource = m_thumbnailsDir + QCryptographicHash::hash(page.url.toUtf8(), QCryptographicHash::Md4).toHex() + ".png"; if (!QFile(imgSource).exists()) { @@ -239,7 +239,7 @@ void SpeedDial::changed(const QString &allPages) const QStringList &entries = allPages.split(QLatin1String("\";"), QString::SkipEmptyParts); m_webPages.clear(); - foreach(const QString & entry, entries) { + foreach (const QString &entry, entries) { if (entry.isEmpty()) { continue; } @@ -269,7 +269,7 @@ void SpeedDial::loadThumbnail(const QString &url, bool loadTitle) PageThumbnailer* thumbnailer = new PageThumbnailer(this); thumbnailer->setUrl(QUrl::fromEncoded(url.toUtf8())); thumbnailer->setLoadTitle(loadTitle); - connect(thumbnailer, SIGNAL(thumbnailCreated(const QPixmap &)), this, SLOT(thumbnailCreated(const QPixmap &))); + connect(thumbnailer, SIGNAL(thumbnailCreated(QPixmap)), this, SLOT(thumbnailCreated(QPixmap))); thumbnailer->start(); } @@ -353,7 +353,7 @@ void SpeedDial::thumbnailCreated(const QPixmap &pixmap) m_regenerateScript = true; cleanFrames(); - foreach(QWebFrame * frame, cleanFrames()) { + foreach (QWebFrame* frame, cleanFrames()) { frame->evaluateJavaScript(QString("setImageToUrl('%1', '%2');").arg(escapeUrl(url), escapeTitle(fileName))); if (loadTitle) { frame->evaluateJavaScript(QString("setTitleToUrl('%1', '%2');").arg(escapeUrl(url), escapeTitle(title))); @@ -398,7 +398,7 @@ QString SpeedDial::generateAllPages() { QString allPages; - foreach(const Page & page, m_webPages) { + foreach (const Page &page, m_webPages) { const QString &string = QString("url:\"%1\"|title:\"%2\";").arg(page.url, page.title); allPages.append(string); } diff --git a/src/lib/popupwindow/popupwindow.cpp b/src/lib/popupwindow/popupwindow.cpp index a7fe02fc4..77096687c 100644 --- a/src/lib/popupwindow/popupwindow.cpp +++ b/src/lib/popupwindow/popupwindow.cpp @@ -96,7 +96,7 @@ PopupWindow::PopupWindow(PopupWebView* view) // Make shortcuts available even with hidden menubar QList actions = m_menuBar->actions(); - foreach(QAction * action, actions) { + foreach (QAction* action, actions) { if (action->menu()) { actions += action->menu()->actions(); } @@ -120,7 +120,7 @@ PopupWindow::PopupWindow(PopupWebView* view) connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(loadProgress(int))); connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); - connect(m_page, SIGNAL(linkHovered(QString, QString, QString)), this, SLOT(showStatusBarMessage(QString))); + connect(m_page, SIGNAL(linkHovered(QString,QString,QString)), this, SLOT(showStatusBarMessage(QString))); connect(m_page, SIGNAL(geometryChangeRequested(QRect)), this, SLOT(setWindowGeometry(QRect))); connect(m_page, SIGNAL(statusBarVisibilityChangeRequested(bool)), this, SLOT(setStatusBarVisibility(bool))); connect(m_page, SIGNAL(menuBarVisibilityChangeRequested(bool)), this, SLOT(setMenuBarVisibility(bool))); diff --git a/src/lib/preferences/acceptlanguage.cpp b/src/lib/preferences/acceptlanguage.cpp index e81aefc2c..77e8eb369 100644 --- a/src/lib/preferences/acceptlanguage.cpp +++ b/src/lib/preferences/acceptlanguage.cpp @@ -18,7 +18,7 @@ */ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -79,7 +79,7 @@ AcceptLanguage::AcceptLanguage(QWidget* parent) QStringList langs = settings.value("acceptLanguage", defaultLanguage()).toStringList(); settings.endGroup(); - foreach(const QString & code, langs) { + foreach (const QString &code, langs) { QString code_ = code; QLocale loc = QLocale(code_.replace(QLatin1Char('-'), QLatin1Char('_'))); QString label; diff --git a/src/lib/preferences/pluginsmanager.cpp b/src/lib/preferences/pluginsmanager.cpp index bd0f8e9f0..558de1a31 100644 --- a/src/lib/preferences/pluginsmanager.cpp +++ b/src/lib/preferences/pluginsmanager.cpp @@ -45,7 +45,7 @@ PluginsManager::PluginsManager(QWidget* parent) ui->list->setEnabled(appPluginsEnabled); connect(ui->butSettings, SIGNAL(clicked()), this, SLOT(settingsClicked())); - connect(ui->list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(currentChanged(QListWidgetItem*))); + connect(ui->list, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentChanged(QListWidgetItem*))); connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); connect(ui->allowAppPlugins, SIGNAL(clicked(bool)), this, SLOT(allowAppPluginsChanged(bool))); @@ -62,7 +62,7 @@ PluginsManager::PluginsManager(QWidget* parent) QStringList whitelist = mApp->plugins()->c2f_getWhiteList(); ui->allowClick2Flash->setChecked(settings.value("Enable", true).toBool()); settings.endGroup(); - foreach(const QString & site, whitelist) { + foreach (const QString &site, whitelist) { QTreeWidgetItem* item = new QTreeWidgetItem(ui->whitelist); item->setText(0, site); } @@ -167,7 +167,7 @@ void PluginsManager::refresh() const QList &allPlugins = mApp->plugins()->getAvailablePlugins(); - foreach(const Plugins::Plugin & plugin, allPlugins) { + foreach (const Plugins::Plugin &plugin, allPlugins) { PluginSpec spec = plugin.pluginSpec; QListWidgetItem* item = new QListWidgetItem(ui->list); diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index 13ebb51b7..bfda13697 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -162,7 +162,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) ui->startProfile->addItem(actProfileName); QDir profilesDir(mApp->PROFILEDIR + "profiles/"); QStringList list_ = profilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); - foreach(const QString & name, list_) { + foreach (const QString &name, list_) { if (actProfileName == name) { continue; } @@ -385,7 +385,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) QDir lanDir(mApp->TRANSLATIONSDIR); QStringList list = lanDir.entryList(QStringList("*.qm")); - foreach(const QString & name, list) { + foreach (const QString &name, list) { if (name.startsWith(QLatin1String("qt_"))) { continue; } @@ -448,7 +448,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) connect(ui->uaManager, SIGNAL(clicked()), this, SLOT(openUserAgentManager())); connect(ui->jsOptionsButton, SIGNAL(clicked()), this, SLOT(openJsOptions())); - connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(showStackedPage(QListWidgetItem*))); + connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(showStackedPage(QListWidgetItem*))); ui->listWidget->setItemSelected(ui->listWidget->itemAt(5, 5), true); ui->version->setText(" QupZilla v" + QupZilla::VERSION); diff --git a/src/lib/preferences/sslmanager.cpp b/src/lib/preferences/sslmanager.cpp index 527a5c012..d4a3048e0 100644 --- a/src/lib/preferences/sslmanager.cpp +++ b/src/lib/preferences/sslmanager.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -74,7 +74,7 @@ void SSLManager::refreshCAList() ui->caList->clear(); m_caCerts = QSslSocket::defaultCaCertificates(); - foreach(const QSslCertificate & cert, m_caCerts) { + foreach (const QSslCertificate &cert, m_caCerts) { if (m_localCerts.contains(cert)) { continue; } @@ -95,7 +95,7 @@ void SSLManager::refreshLocalList() ui->localList->clear(); m_localCerts = mApp->networkManager()->getLocalCertificates(); - foreach(const QSslCertificate & cert, m_localCerts) { + foreach (const QSslCertificate &cert, m_localCerts) { QListWidgetItem* item = new QListWidgetItem(ui->localList); item->setText(CertificateInfoWidget::certificateItemText(cert)); item->setData(Qt::UserRole + 10, m_localCerts.indexOf(cert)); @@ -108,7 +108,7 @@ void SSLManager::refreshLocalList() void SSLManager::refreshPaths() { - foreach(const QString & path, mApp->networkManager()->certificatePaths()) { + foreach (const QString &path, mApp->networkManager()->certificatePaths()) { ui->pathList->addItem(path); } } diff --git a/src/lib/preferences/thememanager.cpp b/src/lib/preferences/thememanager.cpp index 5b4f564cc..beedfe5b0 100644 --- a/src/lib/preferences/thememanager.cpp +++ b/src/lib/preferences/thememanager.cpp @@ -43,7 +43,7 @@ ThemeManager::ThemeManager(QWidget* parent, Preferences* preferences) QDir themeDir(mApp->THEMESDIR); QStringList list = themeDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); - foreach(const QString & name, list) { + foreach (const QString &name, list) { Theme themeInfo = parseTheme(name); if (!themeInfo.isValid) { continue; @@ -61,7 +61,7 @@ ThemeManager::ThemeManager(QWidget* parent, Preferences* preferences) ui->listWidget->addItem(item); } - connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(currentChanged())); + connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentChanged())); connect(ui->license, SIGNAL(clicked(QPoint)), this, SLOT(showLicense())); currentChanged(); diff --git a/src/lib/rss/rssmanager.cpp b/src/lib/rss/rssmanager.cpp index 9e42b9a11..ec0cc7068 100644 --- a/src/lib/rss/rssmanager.cpp +++ b/src/lib/rss/rssmanager.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -92,11 +92,11 @@ void RSSManager::refreshTable() TreeWidget* tree = new TreeWidget(); tree->setHeaderLabel(tr("News")); tree->setContextMenuPolicy(Qt::CustomContextMenu); - connect(tree, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequested(const QPoint &))); + connect(tree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); ui->tabWidget->addTab(tree, title); ui->tabWidget->setTabToolTip(i, address.toString()); - connect(tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(loadFeed(QTreeWidgetItem*))); + connect(tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(loadFeed(QTreeWidgetItem*))); connect(tree, SIGNAL(itemMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(controlLoadFeed(QTreeWidgetItem*))); connect(tree, SIGNAL(itemControlClicked(QTreeWidgetItem*)), this, SLOT(controlLoadFeed(QTreeWidgetItem*))); QTreeWidgetItem* item = new QTreeWidgetItem(); diff --git a/src/lib/rss/rssnotification.cpp b/src/lib/rss/rssnotification.cpp index 2ac695667..cd0c8c377 100644 --- a/src/lib/rss/rssnotification.cpp +++ b/src/lib/rss/rssnotification.cpp @@ -103,7 +103,7 @@ RSSNotification::RSSNotification(const QString &title, const QUrl &url, WebView* } #endif - foreach(const RssApp & app, m_rssApps) { + foreach (const RssApp &app, m_rssApps) { ui->comboBox->addItem(app.icon, app.title, QVariant(app.type)); } diff --git a/src/lib/sidebar/bookmarkssidebar.cpp b/src/lib/sidebar/bookmarkssidebar.cpp index 327b21ff1..51b9a6bd5 100644 --- a/src/lib/sidebar/bookmarkssidebar.cpp +++ b/src/lib/sidebar/bookmarkssidebar.cpp @@ -47,22 +47,22 @@ BookmarksSideBar::BookmarksSideBar(QupZilla* mainClass, QWidget* parent) ui->bookmarksTree->setMimeType(QLatin1String("application/qupzilla.treewidgetitem.bookmarks")); ui->bookmarksTree->setDefaultItemShowMode(TreeWidget::ItemsExpanded); - connect(ui->bookmarksTree, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &))); + connect(ui->bookmarksTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); connect(ui->bookmarksTree, SIGNAL(itemControlClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*))); connect(ui->bookmarksTree, SIGNAL(itemMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*))); - connect(ui->bookmarksTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*))); + connect(ui->bookmarksTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*))); connect(ui->search, SIGNAL(textChanged(QString)), ui->bookmarksTree, SLOT(filterString(QString))); connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(removeBookmark(BookmarksModel::Bookmark))); - connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark)), - this, SLOT(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark))); + connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark)), + this, SLOT(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(folderAdded(QString)), this, SLOT(addFolder(QString))); connect(m_bookmarksModel, SIGNAL(folderDeleted(QString)), this, SLOT(removeFolder(QString))); - connect(m_bookmarksModel, SIGNAL(folderRenamed(QString, QString)), this, SLOT(renameFolder(QString, QString))); - connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString, bool)), this, SLOT(changeFolderParent(QString, bool))); - connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString, QByteArray, int, QUrl, QString, QString)), - this, SLOT(changeBookmarkParent(QString, QByteArray, int, QUrl, QString, QString))); + connect(m_bookmarksModel, SIGNAL(folderRenamed(QString,QString)), this, SLOT(renameFolder(QString,QString))); + connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString,bool)), this, SLOT(changeFolderParent(QString,bool))); + connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString,QByteArray,int,QUrl,QString,QString)), + this, SLOT(changeBookmarkParent(QString,QByteArray,int,QUrl,QString,QString))); QTimer::singleShot(0, this, SLOT(refreshTable())); } @@ -261,7 +261,7 @@ void BookmarksSideBar::changeBookmarkParent(const QString &name, const QByteArra QList list = ui->bookmarksTree->findItems(name, Qt::MatchExactly | Qt::MatchRecursive); QTreeWidgetItem* item = 0; - foreach(item, list) { + foreach (item, list) { if (id == item->data(0, Qt::UserRole + 10).toInt()) { break; } @@ -309,7 +309,7 @@ void BookmarksSideBar::changeFolderParent(const QString &name, bool isSubfolder) else { addFolder(name); QVector bookmarksList = m_bookmarksModel->folderBookmarks(name); - foreach(const Bookmark & b, bookmarksList) { + foreach (const Bookmark &b, bookmarksList) { addBookmark(b); } } diff --git a/src/lib/sidebar/historysidebar.cpp b/src/lib/sidebar/historysidebar.cpp index 62e867ac3..4388bd4a9 100644 --- a/src/lib/sidebar/historysidebar.cpp +++ b/src/lib/sidebar/historysidebar.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -36,7 +36,7 @@ HistorySideBar::HistorySideBar(QupZilla* mainClass, QWidget* parent) ui->historyTree->setColumnHidden(3, true); ui->historyTree->setSelectionMode(QAbstractItemView::SingleSelection); - connect(ui->historyTree, SIGNAL(openLink(QUrl, HistoryView::OpenBehavior)), this, SLOT(openLink(QUrl, HistoryView::OpenBehavior))); + connect(ui->historyTree, SIGNAL(openLink(QUrl,HistoryView::OpenBehavior)), this, SLOT(openLink(QUrl,HistoryView::OpenBehavior))); connect(ui->search, SIGNAL(textEdited(QString)), ui->historyTree->filterModel(), SLOT(setFilterFixedString(QString))); } diff --git a/src/lib/sidebar/sidebar.cpp b/src/lib/sidebar/sidebar.cpp index c5d0f1089..09bac57cf 100644 --- a/src/lib/sidebar/sidebar.cpp +++ b/src/lib/sidebar/sidebar.cpp @@ -103,7 +103,7 @@ void SideBarManager::addSidebar(const QString &id, SideBarInterface* interface) { s_sidebars[id] = interface; - foreach(QupZilla * window, mApp->mainWindows()) { + foreach (QupZilla* window, mApp->mainWindows()) { window->sideBarManager()->refreshMenu(); } } @@ -112,7 +112,7 @@ void SideBarManager::removeSidebar(const QString &id) { s_sidebars.remove(id); - foreach(QupZilla * window, mApp->mainWindows()) { + foreach (QupZilla* window, mApp->mainWindows()) { window->sideBarManager()->sideBarRemoved(id); } } @@ -134,7 +134,7 @@ void SideBarManager::refreshMenu() act->setShortcut(QKeySequence("Ctrl+H")); act->setData("History"); - foreach(const QPointer &sidebar, s_sidebars) { + foreach (const QPointer &sidebar, s_sidebars) { if (!sidebar) { continue; } @@ -162,7 +162,7 @@ void SideBarManager::updateActions() return; } - foreach(QAction * act, m_menu->actions()) { + foreach (QAction* act, m_menu->actions()) { act->setChecked(act->data().toString() == m_activeBar); } } diff --git a/src/lib/tools/buttonwithmenu.cpp b/src/lib/tools/buttonwithmenu.cpp index 78cedeebc..e9c3109be 100644 --- a/src/lib/tools/buttonwithmenu.cpp +++ b/src/lib/tools/buttonwithmenu.cpp @@ -58,7 +58,7 @@ void ButtonWithMenu::addItem(const Item &item) void ButtonWithMenu::addItems(const QVector &items) { - foreach(const Item & item, items) { + foreach (const Item &item, items) { addItem(item); } } @@ -134,7 +134,7 @@ void ButtonWithMenu::generateMenu() { m_menu->clear(); - foreach(const Item & item, m_items) { + foreach (const Item &item, m_items) { QVariant variant; variant.setValue(item); m_menu->addAction(item.icon, item.text, this, SLOT(setCurrentItem()))->setData(variant); diff --git a/src/lib/tools/html5permissions/html5permissionsdialog.cpp b/src/lib/tools/html5permissions/html5permissionsdialog.cpp index c20f4d941..24b772ff0 100644 --- a/src/lib/tools/html5permissions/html5permissionsdialog.cpp +++ b/src/lib/tools/html5permissions/html5permissionsdialog.cpp @@ -29,7 +29,7 @@ HTML5PermissionsDialog::HTML5PermissionsDialog(QWidget* parent) : loadSettings(); - foreach(const QString & site, m_notificationsGranted) { + foreach (const QString &site, m_notificationsGranted) { QTreeWidgetItem* item = new QTreeWidgetItem(ui->notifTree); item->setText(0, site); item->setText(1, tr("Allow")); @@ -38,7 +38,7 @@ HTML5PermissionsDialog::HTML5PermissionsDialog(QWidget* parent) : ui->notifTree->addTopLevelItem(item); } - foreach(const QString & site, m_notificationsDenied) { + foreach (const QString &site, m_notificationsDenied) { QTreeWidgetItem* item = new QTreeWidgetItem(ui->notifTree); item->setText(0, site); item->setText(1, tr("Deny")); @@ -47,7 +47,7 @@ HTML5PermissionsDialog::HTML5PermissionsDialog(QWidget* parent) : ui->notifTree->addTopLevelItem(item); } - foreach(const QString & site, m_geolocationGranted) { + foreach (const QString &site, m_geolocationGranted) { QTreeWidgetItem* item = new QTreeWidgetItem(ui->geoTree); item->setText(0, site); item->setText(1, tr("Allow")); @@ -56,7 +56,7 @@ HTML5PermissionsDialog::HTML5PermissionsDialog(QWidget* parent) : ui->geoTree->addTopLevelItem(item); } - foreach(const QString & site, m_geolocationDenied) { + foreach (const QString &site, m_geolocationDenied) { QTreeWidgetItem* item = new QTreeWidgetItem(ui->geoTree); item->setText(0, site); item->setText(1, tr("Deny")); diff --git a/src/lib/tools/htmlhighlighter.cpp b/src/lib/tools/htmlhighlighter.cpp index 8daabfde8..a8cab3393 100644 --- a/src/lib/tools/htmlhighlighter.cpp +++ b/src/lib/tools/htmlhighlighter.cpp @@ -66,7 +66,7 @@ HtmlHighlighter::HtmlHighlighter(QTextDocument* parent) tagFormat.setFontWeight(QFont::Bold); QStringList keywordPatterns; keywordPatterns << "| )?" << ">" << "(|= 0) { diff --git a/src/lib/tools/iconprovider.cpp b/src/lib/tools/iconprovider.cpp index 5553d3e90..d651c0000 100644 --- a/src/lib/tools/iconprovider.cpp +++ b/src/lib/tools/iconprovider.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -59,7 +59,7 @@ void IconProvider::saveIcon(WebView* view) return; } - foreach(const Icon & ic, m_iconBuffer) { + foreach (const Icon &ic, m_iconBuffer) { if (ic.url == item.url && ic.image == item.image) { return; } @@ -70,7 +70,7 @@ void IconProvider::saveIcon(WebView* view) QImage IconProvider::iconForUrl(const QUrl &url) { - foreach(const Icon & ic, m_iconBuffer) { + foreach (const Icon &ic, m_iconBuffer) { if (ic.url == url) { return ic.image; } @@ -89,7 +89,7 @@ QImage IconProvider::iconForUrl(const QUrl &url) QImage IconProvider::iconForDomain(const QUrl &url) { - foreach(const Icon & ic, m_iconBuffer) { + foreach (const Icon &ic, m_iconBuffer) { if (ic.url.host() == url.host()) { return ic.image; } @@ -109,7 +109,7 @@ QImage IconProvider::iconForDomain(const QUrl &url) void IconProvider::saveIconsToDatabase() { - foreach(const Icon & ic, m_iconBuffer) { + foreach (const Icon &ic, m_iconBuffer) { QSqlQuery query; query.prepare("SELECT id FROM icons WHERE url = ?"); query.bindValue(0, ic.url.toEncoded(QUrl::RemoveFragment)); diff --git a/src/lib/tools/plaineditwithlines.cpp b/src/lib/tools/plaineditwithlines.cpp index a109be9d5..7cd6d68b2 100644 --- a/src/lib/tools/plaineditwithlines.cpp +++ b/src/lib/tools/plaineditwithlines.cpp @@ -39,7 +39,7 @@ ****************************************************************************/ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -66,7 +66,7 @@ PlainEditWithLines::PlainEditWithLines(QWidget* parent) , m_countCache(-1, -1) { connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int))); - connect(this, SIGNAL(updateRequest(QRect, int)), this, SLOT(updateLineNumberArea(QRect, int))); + connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int))); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine())); updateLineNumberAreaWidth(0); diff --git a/src/lib/tools/qztools.cpp b/src/lib/tools/qztools.cpp index 996303fbc..90e319b52 100644 --- a/src/lib/tools/qztools.cpp +++ b/src/lib/tools/qztools.cpp @@ -382,7 +382,7 @@ QString QzTools::resolveFromPath(const QString &name) QStringList dirs = path.split(QLatin1Char(':'), QString::SkipEmptyParts); - foreach(const QString & dir, dirs) { + foreach (const QString &dir, dirs) { QDir d(dir); if (d.exists(name)) { return d.absoluteFilePath(name); diff --git a/src/lib/tools/treewidget.cpp b/src/lib/tools/treewidget.cpp index af79b4396..93505fcb2 100644 --- a/src/lib/tools/treewidget.cpp +++ b/src/lib/tools/treewidget.cpp @@ -34,7 +34,7 @@ TreeWidget::TreeWidget(QWidget* parent) { setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(sheduleRefresh())); + connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(sheduleRefresh())); } void TreeWidget::clear() @@ -123,7 +123,7 @@ QMimeData* TreeWidget::mimeData(const QList items) const QByteArray encodedData; QDataStream stream(&encodedData, QIODevice::WriteOnly); - foreach(const QTreeWidgetItem * item, items) { + foreach (const QTreeWidgetItem* item, items) { if (item) { QTreeWidgetItem* clonedItem = item->clone(); bool parentIsRoot = false; @@ -332,8 +332,9 @@ void TreeWidget::filterString(const QString &string) QList _allItems = allItems(); if (string.isEmpty()) { - foreach(QTreeWidgetItem * item, _allItems) - item->setHidden(false); + foreach (QTreeWidgetItem* item, _allItems) { + item->setHidden(false); + } for (int i = 0; i < topLevelItemCount(); i++) { topLevelItem(i)->setHidden(false); } @@ -342,7 +343,7 @@ void TreeWidget::filterString(const QString &string) } } else { - foreach(QTreeWidgetItem * item, _allItems) { + foreach (QTreeWidgetItem* item, _allItems) { item->setHidden(!item->text(0).contains(string, Qt::CaseInsensitive)); item->setExpanded(true); } @@ -460,13 +461,13 @@ void TreeWidget::setDragDropReceiver(bool enable, QObject* receiver) #if QT_VERSION < 0x050000 model()->setSupportedDragActions(Qt::CopyAction); #endif - connect(this, SIGNAL(folderParentChanged(QString, bool, bool*)), receiver, SLOT(changeFolderParent(QString, bool, bool*))); - connect(this, SIGNAL(bookmarkParentChanged(int, QString, QString, bool*)), receiver, SLOT(changeBookmarkParent(int, QString, QString, bool*))); - connect(this, SIGNAL(linkWasDroped(QUrl, QString, QVariant, QString, bool*)), receiver, SLOT(bookmarkDropedLink(QUrl, QString, QVariant, QString, bool*))); + connect(this, SIGNAL(folderParentChanged(QString,bool,bool*)), receiver, SLOT(changeFolderParent(QString,bool,bool*))); + connect(this, SIGNAL(bookmarkParentChanged(int,QString,QString,bool*)), receiver, SLOT(changeBookmarkParent(int,QString,QString,bool*))); + connect(this, SIGNAL(linkWasDroped(QUrl,QString,QVariant,QString,bool*)), receiver, SLOT(bookmarkDropedLink(QUrl,QString,QVariant,QString,bool*))); } else { - disconnect(this, SIGNAL(folderParentChanged(QString, bool, bool*)), receiver, SLOT(changeFolderParent(QString, bool, bool*))); - disconnect(this, SIGNAL(bookmarkParentChanged(int, QString, QString, bool*)), receiver, SLOT(changeBookmarkParent(int, QString, QString, bool*))); - disconnect(this, SIGNAL(linkWasDroped(QUrl, QString, QVariant, QString, bool*)), receiver, SLOT(bookmarkDropedLink(QUrl, QString, QVariant, QString, bool*))); + disconnect(this, SIGNAL(folderParentChanged(QString,bool,bool*)), receiver, SLOT(changeFolderParent(QString,bool,bool*))); + disconnect(this, SIGNAL(bookmarkParentChanged(int,QString,QString,bool*)), receiver, SLOT(changeBookmarkParent(int,QString,QString,bool*))); + disconnect(this, SIGNAL(linkWasDroped(QUrl,QString,QVariant,QString,bool*)), receiver, SLOT(bookmarkDropedLink(QUrl,QString,QVariant,QString,bool*))); } } diff --git a/src/lib/webview/siteinfo.cpp b/src/lib/webview/siteinfo.cpp index cc5302e08..1aea7f276 100644 --- a/src/lib/webview/siteinfo.cpp +++ b/src/lib/webview/siteinfo.cpp @@ -138,7 +138,7 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent) const QList &databases = frame->securityOrigin().databases(); int counter = 0; - foreach(const QWebDatabase & b, databases) { + foreach (const QWebDatabase &b, databases) { QListWidgetItem* item = new QListWidgetItem(ui->databaseList); item->setText(b.displayName()); item->setData(Qt::UserRole + 10, counter); @@ -168,9 +168,9 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent) connect(ui->secDetailsButton, SIGNAL(clicked()), this, SLOT(securityDetailsClicked())); connect(ui->saveButton, SIGNAL(clicked(QAbstractButton*)), this, SLOT(downloadImage())); - connect(ui->databaseList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(databaseItemChanged(QListWidgetItem*))); - connect(ui->treeImages, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(showImagePreview(QTreeWidgetItem*))); - connect(ui->treeImages, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(imagesCustomContextMenuRequested(const QPoint &))); + connect(ui->databaseList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(databaseItemChanged(QListWidgetItem*))); + connect(ui->treeImages, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(showImagePreview(QTreeWidgetItem*))); + connect(ui->treeImages, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(imagesCustomContextMenuRequested(QPoint))); ui->treeImages->setContextMenuPolicy(Qt::CustomContextMenu); ui->treeImages->sortByColumn(-1); diff --git a/src/lib/webview/tabbar.cpp b/src/lib/webview/tabbar.cpp index ba6e95fda..c69c91cbd 100644 --- a/src/lib/webview/tabbar.cpp +++ b/src/lib/webview/tabbar.cpp @@ -62,7 +62,7 @@ TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget) setAcceptDrops(true); connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); - connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &))); + connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); connect(m_tabWidget, SIGNAL(pinnedTabClosed()), this, SLOT(pinnedTabClosed())); connect(m_tabWidget, SIGNAL(pinnedTabAdded()), this, SLOT(pinnedTabAdded())); @@ -642,7 +642,7 @@ void TabBar::dropEvent(QDropEvent* event) int index = tabAt(event->pos()); if (index == -1) { - foreach(const QUrl & url, mime->urls()) { + foreach (const QUrl &url, mime->urls()) { m_tabWidget->addView(url, Qz::NT_SelectedTabAtTheEnd); } } diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index 655138d76..6277d4120 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -67,7 +67,7 @@ void TabbedWebView::setWebPage(WebPage* page) page->setParent(this); setPage(page); - connect(page, SIGNAL(linkHovered(QString, QString, QString)), this, SLOT(linkHovered(QString, QString, QString))); + connect(page, SIGNAL(linkHovered(QString,QString,QString)), this, SLOT(linkHovered(QString,QString,QString))); } void TabbedWebView::slotIconChanged() diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 6c5736499..b80be1d7f 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -93,7 +93,7 @@ void AddTabButton::dropEvent(QDropEvent* event) return; } - foreach(const QUrl & url, mime->urls()) { + foreach (const QUrl &url, mime->urls()) { m_tabWidget->addView(url, Qz::NT_SelectedNewEmptyTab); } } @@ -120,7 +120,7 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent) connect(m_tabBar, SIGNAL(closeTab(int)), this, SLOT(closeTab(int))); connect(m_tabBar, SIGNAL(closeAllButCurrent(int)), this, SLOT(closeAllButCurrent(int))); connect(m_tabBar, SIGNAL(duplicateTab(int)), this, SLOT(duplicateTab(int))); - connect(m_tabBar, SIGNAL(tabMoved(int, int)), this, SLOT(tabMoved(int, int))); + connect(m_tabBar, SIGNAL(tabMoved(int,int)), this, SLOT(tabMoved(int,int))); connect(m_tabBar, SIGNAL(moveAddTabButton(int)), this, SLOT(moveAddTabButton(int))); connect(m_tabBar, SIGNAL(showButtons()), this, SLOT(showButtons())); @@ -632,7 +632,7 @@ void TabWidget::closeAllButCurrent(int index) WebTab* akt = weTab(index); - foreach(WebTab * tab, allTabs(false)) { + foreach (WebTab* tab, allTabs(false)) { int tabIndex = tab->tabIndex(); if (akt == widget(tabIndex)) { continue; @@ -695,7 +695,7 @@ void TabWidget::restoreAllClosedTabs() const QVector &closedTabs = m_closedTabsManager->allClosedTabs(); - foreach(const ClosedTabsManager::Tab & tab, closedTabs) { + foreach (const ClosedTabsManager::Tab &tab, closedTabs) { int index = addView(QUrl(), tab.title, Qz::NT_CleanSelectedTab); WebTab* webTab = weTab(index); webTab->p_restoreTab(tab.url, tab.history); @@ -737,7 +737,7 @@ void TabWidget::aboutToShowClosedTabsMenu() else { m_menuTabs->clear(); int i = 0; - foreach(const ClosedTabsManager::Tab & tab, closedTabsManager()->allClosedTabs()) { + foreach (const ClosedTabsManager::Tab &tab, closedTabsManager()->allClosedTabs()) { QString title = tab.title; if (title.length() > 40) { title.truncate(40); @@ -880,7 +880,7 @@ QByteArray TabWidget::saveState() stream << tabList.count(); - foreach(const WebTab::SavedTab & tab, tabList) { + foreach (const WebTab::SavedTab &tab, tabList) { stream << tab; } @@ -919,7 +919,7 @@ bool TabWidget::restoreState(const QVector &tabs, int currentT void TabWidget::closeRecoveryTab() { - foreach(WebTab * tab, allTabs(false)) { + foreach (WebTab* tab, allTabs(false)) { if (tab->url().toString() == QLatin1String("qupzilla:restore")) { closeTab(tab->tabIndex(), true); } diff --git a/src/lib/webview/webhistorywrapper.cpp b/src/lib/webview/webhistorywrapper.cpp index 21e6daaf8..8567a5a64 100644 --- a/src/lib/webview/webhistorywrapper.cpp +++ b/src/lib/webview/webhistorywrapper.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * 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 @@ -27,7 +27,7 @@ QList WebHistoryWrapper::forwardItems(int maxItems, QWebHistory QUrl lastUrl = history->currentItem().url(); int count = 0; - foreach(const QWebHistoryItem & item, history->forwardItems(maxItems + 5)) { + foreach (const QWebHistoryItem &item, history->forwardItems(maxItems + 5)) { if (item.url() == lastUrl || count == maxItems) { continue; } diff --git a/src/lib/webview/webpage.cpp b/src/lib/webview/webpage.cpp index 56fbfe77c..06c37db78 100644 --- a/src/lib/webview/webpage.cpp +++ b/src/lib/webview/webpage.cpp @@ -93,22 +93,22 @@ WebPage::WebPage(QupZilla* mainClass) connect(this, SIGNAL(downloadRequested(QNetworkRequest)), this, SLOT(downloadRequested(QNetworkRequest))); connect(this, SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested())); - connect(this, SIGNAL(databaseQuotaExceeded(QWebFrame*, QString)), + connect(this, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString)), this, SLOT(dbQuotaExceeded(QWebFrame*))); connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject())); #if QTWEBKIT_FROM_2_2 - connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), - this, SLOT(featurePermissionRequested(QWebFrame*, QWebPage::Feature))); + connect(this, SIGNAL(featurePermissionRequested(QWebFrame*,QWebPage::Feature)), + this, SLOT(featurePermissionRequested(QWebFrame*,QWebPage::Feature))); #endif #if QTWEBKIT_FROM_2_3 - connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*, quint64, quint64)), - this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*, quint64))); + connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*,quint64,quint64)), + this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*,quint64))); #elif QTWEBKIT_FROM_2_2 - connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*, quint64)), - this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*, quint64))); + connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*,quint64)), + this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*,quint64))); #endif s_livingPages.append(this); @@ -162,7 +162,7 @@ bool WebPage::loadingError() const void WebPage::addRejectedCerts(const QList &certs) { - foreach(const QSslCertificate & cert, certs) { + foreach (const QSslCertificate &cert, certs) { if (!m_rejectedSslCerts.contains(cert)) { m_rejectedSslCerts.append(cert); } @@ -173,7 +173,7 @@ bool WebPage::containsRejectedCerts(const QList &certs) { int matches = 0; - foreach(const QSslCertificate & cert, certs) { + foreach (const QSslCertificate &cert, certs) { if (m_rejectedSslCerts.contains(cert)) { ++matches; } @@ -599,7 +599,7 @@ void WebPage::cleanBlockedObjects() const QWebElement &docElement = mainFrame()->documentElement(); - foreach(const AdBlockedEntry & entry, m_adBlockedEntries) { + foreach (const AdBlockedEntry &entry, m_adBlockedEntries) { const QString &urlString = entry.url.toString(); if (urlString.endsWith(QLatin1String(".js")) || urlString.endsWith(QLatin1String(".css"))) { continue; @@ -619,7 +619,7 @@ void WebPage::cleanBlockedObjects() QString selector("img[src$=\"%1\"], iframe[src$=\"%1\"],embed[src$=\"%1\"]"); QWebElementCollection elements = docElement.findAll(selector.arg(urlEnd)); - foreach(QWebElement element, elements) { + foreach (QWebElement element, elements) { QString src = element.attribute("src"); src.remove(QLatin1String("../")); @@ -755,7 +755,7 @@ bool WebPage::extension(Extension extension, const ExtensionOption* option, Exte QWebElementCollection elements; elements.append(docElement.findAll("iframe")); - foreach(QWebElement element, elements) { + foreach (QWebElement element, elements) { QString src = element.attribute("src"); if (exOption->url.toString().contains(src)) { element.setStyleProperty("visibility", "hidden"); diff --git a/src/lib/webview/webview.cpp b/src/lib/webview/webview.cpp index c7cdb2041..d919f638e 100644 --- a/src/lib/webview/webview.cpp +++ b/src/lib/webview/webview.cpp @@ -146,7 +146,7 @@ void WebView::setPage(QWebPage* page) m_page = qobject_cast(page); setZoom(qzSettings->defaultZoom); - connect(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*)), this, SLOT(frameStateChanged())); + connect(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*,QWebHistoryItem*)), this, SLOT(frameStateChanged())); connect(m_page, SIGNAL(privacyChanged(bool)), this, SIGNAL(privacyChanged(bool))); mApp->plugins()->emitWebPageCreated(m_page); @@ -444,7 +444,7 @@ void WebView::slotUrlChanged(const QUrl &url) const QString &host = url.host(); m_disableTouchMocking = false; - foreach(const QString & site, exceptions) { + foreach (const QString &site, exceptions) { if (host.contains(site)) { m_disableTouchMocking = true; } @@ -810,7 +810,7 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c // Apparently createStandardContextMenu() can return null pointer if (pageMenu) { int i = 0; - foreach(QAction * act, pageMenu->actions()) { + foreach (QAction* act, pageMenu->actions()) { if (act->isSeparator()) { menu->addSeparator(); continue; @@ -1025,7 +1025,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult // Search with ... Menu* swMenu = new Menu(tr("Search with..."), menu); SearchEnginesManager* searchManager = mApp->searchEnginesManager(); - foreach(const SearchEngine & en, searchManager->allEngines()) { + foreach (const SearchEngine &en, searchManager->allEngines()) { Action* act = new Action(en.icon, en.name); act->setData(QVariant::fromValue(en)); diff --git a/src/plugins/AccessKeysNavigation/akn_handler.cpp b/src/plugins/AccessKeysNavigation/akn_handler.cpp index 7e52066ae..2370331c2 100644 --- a/src/plugins/AccessKeysNavigation/akn_handler.cpp +++ b/src/plugins/AccessKeysNavigation/akn_handler.cpp @@ -1,6 +1,6 @@ /* ============================================================ * Access Keys Navigation plugin for QupZilla -* Copyright (C) 2012 David Rosca +* Copyright (C) 2012-2013 David Rosca * * 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 @@ -247,9 +247,9 @@ void AKN_Handler::showAccessKeys() QRect viewport = QRect(page->currentFrame()->scrollPosition(), page->viewportSize()); // Priority first goes to elements with accesskey attributes QList alreadyLabeled; - foreach(const QString & elementType, supportedElement) { + foreach (const QString &elementType, supportedElement) { QList result = page->currentFrame()->findAllElements(elementType).toList(); - foreach(const QWebElement & element, result) { + foreach (const QWebElement &element, result) { const QRect geometry = element.geometry(); if (geometry.size().isEmpty() || !viewport.contains(geometry.topLeft())) { @@ -278,9 +278,9 @@ void AKN_Handler::showAccessKeys() // Pick an access key first from the letters in the text and then from the // list of unused access keys - foreach(const QString & elementType, supportedElement) { + foreach (const QString &elementType, supportedElement) { QWebElementCollection result = page->currentFrame()->findAllElements(elementType); - foreach(const QWebElement & element, result) { + foreach (const QWebElement &element, result) { const QRect geometry = element.geometry(); if (unusedKeys.isEmpty() || alreadyLabeled.contains(element) @@ -310,7 +310,7 @@ void AKN_Handler::showAccessKeys() if (m_accessKeysVisible) { m_view.data()->installEventFilter(this); connect(m_view.data(), SIGNAL(loadStarted()), this, SLOT(hideAccessKeys())); - connect(m_view.data()->page(), SIGNAL(scrollRequested(int, int, QRect)), this, SLOT(hideAccessKeys())); + connect(m_view.data()->page(), SIGNAL(scrollRequested(int,int,QRect)), this, SLOT(hideAccessKeys())); #if QT_VERSION >= 0x040800 connect(m_view.data()->page(), SIGNAL(viewportChangeRequested()), this, SLOT(hideAccessKeys())); #endif @@ -332,7 +332,7 @@ void AKN_Handler::hideAccessKeys() // Uninstall event filter and disconnect loadStarted m_view.data()->removeEventFilter(this); disconnect(m_view.data(), SIGNAL(loadStarted()), this, SLOT(hideAccessKeys())); - disconnect(m_view.data()->page(), SIGNAL(scrollRequested(int, int, QRect)), this, SLOT(hideAccessKeys())); + disconnect(m_view.data()->page(), SIGNAL(scrollRequested(int,int,QRect)), this, SLOT(hideAccessKeys())); #if QT_VERSION >= 0x040800 disconnect(m_view.data()->page(), SIGNAL(viewportChangeRequested()), this, SLOT(hideAccessKeys())); #endif diff --git a/src/plugins/GreaseMonkey/gm_manager.cpp b/src/plugins/GreaseMonkey/gm_manager.cpp index 30e31d534..0d8b4ec44 100644 --- a/src/plugins/GreaseMonkey/gm_manager.cpp +++ b/src/plugins/GreaseMonkey/gm_manager.cpp @@ -75,7 +75,7 @@ QString GM_Manager::requireScripts(const QStringList &urlList) const QString script; - foreach(const QString & url, urlList) { + foreach (const QString &url, urlList) { if (settings.contains(url)) { const QString &fileName = settings.value(url).toString(); script.append(QzTools::readAllFileContents(fileName).trimmed() + '\n'); @@ -107,13 +107,13 @@ QList GM_Manager::allScripts() const bool GM_Manager::containsScript(const QString &fullName) const { - foreach(GM_Script * script, m_startScripts) { + foreach (GM_Script* script, m_startScripts) { if (fullName == script->fullName()) { return true; } } - foreach(GM_Script * script, m_endScripts) { + foreach (GM_Script* script, m_endScripts) { if (fullName == script->fullName()) { return true; } @@ -197,13 +197,13 @@ void GM_Manager::pageLoadStart() return; } - foreach(GM_Script * script, m_startScripts) { + foreach (GM_Script* script, m_startScripts) { if (script->match(urlString)) { frame->evaluateJavaScript(m_bootstrap + script->script()); } } - foreach(GM_Script * script, m_endScripts) { + foreach (GM_Script* script, m_endScripts) { if (script->match(urlString)) { const QString &jscript = QString("window.addEventListener(\"DOMContentLoaded\"," "function(e) { %1 }, false);").arg(m_bootstrap + script->script()); @@ -227,7 +227,7 @@ void GM_Manager::load() settings.beginGroup("GreaseMonkey"); m_disabledScripts = settings.value("disabledScripts", QStringList()).toStringList(); - foreach(const QString & fileName, gmDir.entryList(QStringList("*.js"), QDir::Files)) { + foreach (const QString &fileName, gmDir.entryList(QStringList("*.js"), QDir::Files)) { const QString &absolutePath = gmDir.absoluteFilePath(fileName); GM_Script* script = new GM_Script(this, absolutePath); diff --git a/src/plugins/GreaseMonkey/gm_script.cpp b/src/plugins/GreaseMonkey/gm_script.cpp index f0a81f1e3..8a5552998 100644 --- a/src/plugins/GreaseMonkey/gm_script.cpp +++ b/src/plugins/GreaseMonkey/gm_script.cpp @@ -92,7 +92,7 @@ QStringList GM_Script::include() const { QStringList list; - foreach(const GM_UrlMatcher & matcher, m_include) { + foreach (const GM_UrlMatcher &matcher, m_include) { list.append(matcher.pattern()); } @@ -103,7 +103,7 @@ QStringList GM_Script::exclude() const { QStringList list; - foreach(const GM_UrlMatcher & matcher, m_exclude) { + foreach (const GM_UrlMatcher &matcher, m_exclude) { list.append(matcher.pattern()); } @@ -126,13 +126,13 @@ bool GM_Script::match(const QString &urlString) return false; } - foreach(const GM_UrlMatcher & matcher, m_exclude) { + foreach (const GM_UrlMatcher &matcher, m_exclude) { if (matcher.match(urlString)) { return false; } } - foreach(const GM_UrlMatcher & matcher, m_include) { + foreach (const GM_UrlMatcher &matcher, m_include) { if (matcher.match(urlString)) { return true; } @@ -188,7 +188,7 @@ void GM_Script::parseScript() QStringList requireList; const QStringList &lines = metadataBlock.split(QLatin1Char('\n'), QString::SkipEmptyParts); - foreach(QString line, lines) { + foreach (QString line, lines) { if (!line.startsWith(QLatin1String("// @"))) { continue; } diff --git a/src/plugins/GreaseMonkey/gm_urlmatcher.cpp b/src/plugins/GreaseMonkey/gm_urlmatcher.cpp index 01d8f80b0..08b829d68 100644 --- a/src/plugins/GreaseMonkey/gm_urlmatcher.cpp +++ b/src/plugins/GreaseMonkey/gm_urlmatcher.cpp @@ -38,7 +38,7 @@ static bool wildcardMatch(const QString &string, const QString &pattern) } } - foreach(const QString & part, parts) { + foreach (const QString &part, parts) { pos = string.indexOf(part, pos); if (pos == -1) { return false; diff --git a/src/plugins/GreaseMonkey/settings/gm_settings.cpp b/src/plugins/GreaseMonkey/settings/gm_settings.cpp index 47e00a77b..c30f3c71b 100644 --- a/src/plugins/GreaseMonkey/settings/gm_settings.cpp +++ b/src/plugins/GreaseMonkey/settings/gm_settings.cpp @@ -108,7 +108,7 @@ void GM_Settings::loadScripts() ui->listWidget->clear(); - foreach(GM_Script * script, m_manager->allScripts()) { + foreach (GM_Script* script, m_manager->allScripts()) { QListWidgetItem* item = new QListWidgetItem(ui->listWidget); QIcon icon = QIcon(":/gm/data/script.png"); item->setIcon(icon); diff --git a/src/plugins/PIM/PIM_handler.cpp b/src/plugins/PIM/PIM_handler.cpp index e0407cc2e..941555793 100644 --- a/src/plugins/PIM/PIM_handler.cpp +++ b/src/plugins/PIM/PIM_handler.cpp @@ -1,6 +1,6 @@ /* ============================================================ * Personal Information Manager plugin for QupZilla -* Copyright (C) 2012 David Rosca +* Copyright (C) 2012-2013 David Rosca * Copyright (C) 2012 Mladen Pejaković * * This program is free software: you can redistribute it and/or modify @@ -155,7 +155,7 @@ bool PIM_Handler::keyPress(WebView* view, QKeyEvent* event) const QWebElement &document = view->page()->mainFrame()->documentElement(); const QWebElementCollection elements = document.findAll("input[type=\"text\"]"); - foreach(QWebElement element, elements) { + foreach (QWebElement element, elements) { const QString &name = element.attribute("name"); if (name.isEmpty()) { continue; @@ -206,7 +206,7 @@ void PIM_Handler::pageLoadFinished() const QWebElement &document = page->mainFrame()->documentElement(); const QWebElementCollection elements = document.findAll("input[type=\"text\"]"); - foreach(QWebElement element, elements) { + foreach (QWebElement element, elements) { const QString &name = element.attribute("name"); if (name.isEmpty()) { continue; @@ -224,7 +224,7 @@ PIM_Handler::PI_Type PIM_Handler::nameMatch(const QString &name) { for (int i = 0; i < PI_Max; ++i) { if (!m_allInfo[PI_Type(i)].isEmpty()) { - foreach(const QString & n, m_infoMatches[PI_Type(i)]) { + foreach (const QString &n, m_infoMatches[PI_Type(i)]) { if (name == n) { return PI_Type(i); }