diff --git a/src/3rdparty/qtwin.cpp b/src/3rdparty/qtwin.cpp index 2344dbca4..ac8bb4fe3 100644 --- a/src/3rdparty/qtwin.cpp +++ b/src/3rdparty/qtwin.cpp @@ -115,8 +115,9 @@ bool QtWin::isRunningWindows7() { #ifdef Q_WS_WIN return QSysInfo::windowsVersion() == QSysInfo::WV_WINDOWS7; -#endif +#else return false; +#endif } /*! diff --git a/src/adblock/adblocknetwork.cpp b/src/adblock/adblocknetwork.cpp index add272c94..c1f6ba8af 100644 --- a/src/adblock/adblocknetwork.cpp +++ b/src/adblock/adblocknetwork.cpp @@ -81,7 +81,7 @@ QNetworkReply* AdBlockNetwork::block(const QNetworkRequest &request) if (blockedRule) { QVariant v = request.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100)); - WebPage* webPage = (WebPage*)(v.value()); + WebPage* webPage = static_cast (v.value()); if (webPage) { webPage->addAdBlockRule(blockedRule->filter(), request.url()); } diff --git a/src/app/qupzilla.cpp b/src/app/qupzilla.cpp index ef231c1d4..7593db8bb 100644 --- a/src/app/qupzilla.cpp +++ b/src/app/qupzilla.cpp @@ -1039,7 +1039,7 @@ void QupZilla::showPreferences() prefs->show(); } -void QupZilla::showSource(QWebFrame *frame, const QString &selectedHtml) +void QupZilla::showSource(QWebFrame* frame, const QString &selectedHtml) { if (!frame) { frame = weView()->page()->mainFrame(); @@ -1285,7 +1285,7 @@ void QupZilla::sendLink() QDesktopServices::openUrl(url); } -void QupZilla::printPage(QWebFrame *frame) +void QupZilla::printPage(QWebFrame* frame) { QPrintPreviewDialog* dialog = new QPrintPreviewDialog(this); @@ -1340,7 +1340,7 @@ void QupZilla::startPrivate(bool state) mApp->togglePrivateBrowsingMode(state); } -void QupZilla::resizeEvent(QResizeEvent *event) +void QupZilla::resizeEvent(QResizeEvent* event) { m_bookmarksToolbar->setMaximumWidth(width()); diff --git a/src/app/qupzilla.h b/src/app/qupzilla.h index ae03b14a4..491115ade 100644 --- a/src/app/qupzilla.h +++ b/src/app/qupzilla.h @@ -201,7 +201,7 @@ private slots: bool quitApp(); private: - void resizeEvent(QResizeEvent *event); + void resizeEvent(QResizeEvent* event); void keyPressEvent(QKeyEvent* event); void mousePressEvent(QMouseEvent* event); void closeEvent(QCloseEvent* event); diff --git a/src/autofill/autofillmodel.cpp b/src/autofill/autofillmodel.cpp index c4326e2c1..084aae77a 100644 --- a/src/autofill/autofillmodel.cpp +++ b/src/autofill/autofillmodel.cpp @@ -182,9 +182,9 @@ void AutoFillModel::post(const QNetworkRequest &request, const QByteArray &outgo m_lastOutgoingData = outgoingData; QVariant v = request.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100)); - QWebPage* webPage = (QWebPage*)(v.value()); + QWebPage* webPage = static_cast (v.value()); v = request.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 102)); - WebView* webView = (WebView*)(v.value()); + WebView* webView = static_cast (v.value()); if (!webPage || !webView) { return; } diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp index c92628cca..f4ac22ae8 100644 --- a/src/bookmarks/bookmarkstoolbar.cpp +++ b/src/bookmarks/bookmarkstoolbar.cpp @@ -102,7 +102,7 @@ void BookmarksToolbar::moveRight() return; } - ToolButton* button = (ToolButton*) act->data().value(); + ToolButton* button = static_cast (act->data().value()); int index = m_layout->indexOf(button); if (index == m_layout->count() - 1) { @@ -139,7 +139,7 @@ void BookmarksToolbar::moveLeft() return; } - ToolButton* button = (ToolButton*) act->data().value(); + ToolButton* button = static_cast (act->data().value()); int index = m_layout->indexOf(button); if (index == 0) { @@ -176,7 +176,7 @@ void BookmarksToolbar::removeButton() return; } - ToolButton* button = (ToolButton*) act->data().value(); + ToolButton* button = static_cast (act->data().value()); if (!button) { return; } diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index 53a39fd9c..cf7203907 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -283,32 +283,31 @@ void HistoryManager::refreshTable() void HistoryManager::search(const QString &searchText) { ui->historyTree->filterString(searchText); - return; - if (searchText.isEmpty()) { - refreshTable(); - return; - } +// if (searchText.isEmpty()) { +// refreshTable(); +// return; +// } - refreshTable(); - ui->historyTree->setUpdatesEnabled(false); +// refreshTable(); +// ui->historyTree->setUpdatesEnabled(false); - QList items = ui->historyTree->findItems("*" + searchText + "*", Qt::MatchRecursive | Qt::MatchWildcard); +// QList items = ui->historyTree->findItems("*" + searchText + "*", Qt::MatchRecursive | Qt::MatchWildcard); - QList foundItems; - foreach(QTreeWidgetItem * fitem, items) { - if (fitem->text(1).isEmpty()) { - continue; - } - QTreeWidgetItem* item = new QTreeWidgetItem(); - item->setText(0, fitem->text(0)); - item->setText(1, fitem->text(1)); - item->setWhatsThis(1, fitem->whatsThis(1)); - item->setIcon(0, _iconForUrl(fitem->text(1))); - foundItems.append(item); - } - ui->historyTree->clear(); - ui->historyTree->addTopLevelItems(foundItems); - ui->historyTree->setUpdatesEnabled(true); +// QList foundItems; +// foreach(QTreeWidgetItem * fitem, items) { +// if (fitem->text(1).isEmpty()) { +// continue; +// } +// QTreeWidgetItem* item = new QTreeWidgetItem(); +// item->setText(0, fitem->text(0)); +// item->setText(1, fitem->text(1)); +// item->setWhatsThis(1, fitem->whatsThis(1)); +// item->setIcon(0, _iconForUrl(fitem->text(1))); +// foundItems.append(item); +// } +// ui->historyTree->clear(); +// ui->historyTree->addTopLevelItems(foundItems); +// ui->historyTree->setUpdatesEnabled(true); } void HistoryManager::optimizeDb() diff --git a/src/network/networkmanager.cpp b/src/network/networkmanager.cpp index 15d2d76cd..59aa7124d 100644 --- a/src/network/networkmanager.cpp +++ b/src/network/networkmanager.cpp @@ -94,9 +94,9 @@ void NetworkManager::setSSLConfiguration(QNetworkReply* reply) QNetworkRequest request = reply->request(); QVariant v = request.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100)); - WebPage* webPage = (WebPage*)(v.value()); + WebPage* webPage = static_cast (v.value()); v = request.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 102)); - WebView* webView = (WebView*)(v.value()); + WebView* webView = static_cast (v.value()); if (!webPage || !webView) { return; } @@ -131,7 +131,7 @@ void NetworkManager::sslError(QNetworkReply* reply, QList errors) QNetworkRequest request = reply->request(); QVariant v = request.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100)); - WebPage* webPage = (WebPage*)(v.value()); + WebPage* webPage = static_cast (v.value()); if (!webPage) { return; } diff --git a/src/tools/pagethumbnailer.cpp b/src/tools/pagethumbnailer.cpp index f784bc1a1..3513fa0b6 100644 --- a/src/tools/pagethumbnailer.cpp +++ b/src/tools/pagethumbnailer.cpp @@ -43,6 +43,7 @@ PageThumbnailer::PageThumbnailer(QObject* parent) : QObject(parent) , m_page(new QWebPage(this)) , m_size(QSize(231, 130)) + , m_loadTitle(false) { NetworkManagerProxy* networkProxy = new NetworkManagerProxy(this); networkProxy->setPrimaryNetworkAccessManager(mApp->networkManager()); diff --git a/src/webview/tabbar.cpp b/src/webview/tabbar.cpp index d4227c27a..ad7fb2373 100644 --- a/src/webview/tabbar.cpp +++ b/src/webview/tabbar.cpp @@ -313,7 +313,7 @@ int TabBar::normalTabsCount() return count() - m_pinnedTabsCount; } -void TabBar::mousePressEvent(QMouseEvent *event) +void TabBar::mousePressEvent(QMouseEvent* event) { if (event->buttons() & Qt::LeftButton && tabAt(event->pos()) != -1) { m_dragStartPosition = mapFromGlobal(event->globalPos()); @@ -325,7 +325,7 @@ void TabBar::mousePressEvent(QMouseEvent *event) QTabBar::mousePressEvent(event); } -void TabBar::mouseMoveEvent(QMouseEvent *event) +void TabBar::mouseMoveEvent(QMouseEvent* event) { if (!m_dragStartPosition.isNull() && m_tabWidget->buttonAddTab()->isVisible()) { int manhattanLength = (event->pos() - m_dragStartPosition).manhattanLength(); diff --git a/src/webview/tabbar.h b/src/webview/tabbar.h index 28e6cb1b4..200a47dac 100644 --- a/src/webview/tabbar.h +++ b/src/webview/tabbar.h @@ -80,8 +80,8 @@ private slots: void closeCurrentTab(); private: - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent* event); + void mouseMoveEvent(QMouseEvent* event); void mouseDoubleClickEvent(QMouseEvent* event); void mouseReleaseEvent(QMouseEvent* event); QSize tabSizeHint(int index) const; diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index c0d92b8f5..55cf0bb5a 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -810,7 +810,6 @@ void WebView::load(const QUrl &url) QUrl WebView::url() const { - return QWebView::url(); QUrl ur = QWebView::url(); if (ur.isEmpty() && !m_aboutToLoadUrl.isEmpty()) { return m_aboutToLoadUrl;