diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-07-03 13:52:02 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-03 15:55:04 +0200 |
commit | 1b233eff36dd185d32a1e72a2ba0ef825b1f6ef7 (patch) | |
tree | 4317b7622529cdc02e3e002ad2562338cd43fd43 /examples/webkitwidgets | |
parent | a4db690e3d09d2341b101557fa2875423db192d2 (diff) | |
download | qtwebkit-examples-1b233eff36dd185d32a1e72a2ba0ef825b1f6ef7.tar.gz |
Silence compiler warnings in browser example.
settings.cpp(138) : warning C4189: 'jar' : local variable is initialized but not referenced
settings.cpp(240) : warning C4189: 'jar' : local variable is initialized but not referenced
searchlineedit.cpp: In member function 'virtual void ClearButton::paintEvent(QPaintEvent*)':
searchlineedit.cpp:68:12: warning: variable 'color' set but not used [-Wunused-but-set-variable]
networkaccessmanager.cpp: In member function 'void NetworkAccessManager::requestFinished(QNetworkReply*)':
networkaccessmanager.cpp:115:12: warning: unused variable 'pctCached' [-Wunused-variable]
networkaccessmanager.cpp:116:12: warning: unused variable 'pctPipelined' [-Wunused-variable]
networkaccessmanager.cpp:117:12: warning: unused variable 'pctSecure' [-Wunused-variable]
networkaccessmanager.cpp:118:12: warning: unused variable 'pctDownloadBuffer' [-Wunused-variable]
history.cpp: In member function 'virtual int HistoryMenuModel::rowCount(const QModelIndex&) const':
history.cpp:516:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
history.cpp: In member function 'virtual QModelIndex HistoryMenuModel::mapToSource(const QModelIndex&) const':
history.cpp:541:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Change-Id: I76ba8ff28509f39c653e9b5ba707e380393dff0d
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'examples/webkitwidgets')
-rw-r--r-- | examples/webkitwidgets/browser/history.cpp | 6 | ||||
-rw-r--r-- | examples/webkitwidgets/browser/networkaccessmanager.cpp | 2 | ||||
-rw-r--r-- | examples/webkitwidgets/browser/searchlineedit.cpp | 1 | ||||
-rw-r--r-- | examples/webkitwidgets/browser/settings.cpp | 10 |
4 files changed, 8 insertions, 11 deletions
diff --git a/examples/webkitwidgets/browser/history.cpp b/examples/webkitwidgets/browser/history.cpp index d241994..761d3f5 100644 --- a/examples/webkitwidgets/browser/history.cpp +++ b/examples/webkitwidgets/browser/history.cpp @@ -513,7 +513,7 @@ int HistoryMenuModel::rowCount(const QModelIndex &parent) const return bumpedItems + folders; } - if (parent.internalId() == -1) { + if (parent.internalId() == quintptr(-1)) { if (parent.row() < bumpedRows()) return 0; } @@ -538,7 +538,7 @@ QModelIndex HistoryMenuModel::mapToSource(const QModelIndex &proxyIndex) const if (!proxyIndex.isValid()) return QModelIndex(); - if (proxyIndex.internalId() == -1) { + if (proxyIndex.internalId() == quintptr(-1)) { int bumpedItems = bumpedRows(); if (proxyIndex.row() < bumpedItems) return m_treeModel->index(proxyIndex.row(), proxyIndex.column(), m_treeModel->index(0, 0)); @@ -559,7 +559,7 @@ QModelIndex HistoryMenuModel::index(int row, int column, const QModelIndex &pare || parent.column() > 0) return QModelIndex(); if (!parent.isValid()) - return createIndex(row, column, -1); + return createIndex(row, column, quintptr(-1)); QModelIndex treeIndexParent = mapToSource(parent); diff --git a/examples/webkitwidgets/browser/networkaccessmanager.cpp b/examples/webkitwidgets/browser/networkaccessmanager.cpp index f6c858a..4028883 100644 --- a/examples/webkitwidgets/browser/networkaccessmanager.cpp +++ b/examples/webkitwidgets/browser/networkaccessmanager.cpp @@ -112,12 +112,12 @@ void NetworkAccessManager::requestFinished(QNetworkReply *reply) if (requestFinishedCount % 10) return; +#ifdef QT_DEBUG double pctCached = (double(requestFinishedFromCacheCount) * 100.0/ double(requestFinishedCount)); double pctPipelined = (double(requestFinishedPipelinedCount) * 100.0/ double(requestFinishedCount)); double pctSecure = (double(requestFinishedSecureCount) * 100.0/ double(requestFinishedCount)); double pctDownloadBuffer = (double(requestFinishedDownloadBufferCount) * 100.0/ double(requestFinishedCount)); -#ifdef QT_DEBUG qDebug("STATS [%lli requests total] [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS] [%3.2f%% Zerocopy]", requestFinishedCount, pctCached, pctPipelined, pctSecure, pctDownloadBuffer); #endif } diff --git a/examples/webkitwidgets/browser/searchlineedit.cpp b/examples/webkitwidgets/browser/searchlineedit.cpp index d22e6b2..94b2cdc 100644 --- a/examples/webkitwidgets/browser/searchlineedit.cpp +++ b/examples/webkitwidgets/browser/searchlineedit.cpp @@ -65,7 +65,6 @@ void ClearButton::paintEvent(QPaintEvent *event) int height = this->height(); painter.setRenderHint(QPainter::Antialiasing, true); - QColor color = palette().color(QPalette::Mid); painter.setBrush(isDown() ? palette().color(QPalette::Dark) : palette().color(QPalette::Mid)); diff --git a/examples/webkitwidgets/browser/settings.cpp b/examples/webkitwidgets/browser/settings.cpp index a45e42f..9303510 100644 --- a/examples/webkitwidgets/browser/settings.cpp +++ b/examples/webkitwidgets/browser/settings.cpp @@ -135,9 +135,8 @@ void SettingsDialog::loadFromSettings() // Privacy settings.beginGroup(QLatin1String("cookies")); - CookieJar *jar = BrowserApplication::cookieJar(); QByteArray value = settings.value(QLatin1String("acceptCookies"), QLatin1String("AcceptOnlyFromSitesNavigatedTo")).toByteArray(); - QMetaEnum acceptPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("AcceptPolicy")); + QMetaEnum acceptPolicyEnum = CookieJar::staticMetaObject.enumerator(CookieJar::staticMetaObject.indexOfEnumerator("AcceptPolicy")); CookieJar::AcceptPolicy acceptCookies = acceptPolicyEnum.keyToValue(value) == -1 ? CookieJar::AcceptOnlyFromSitesNavigatedTo : static_cast<CookieJar::AcceptPolicy>(acceptPolicyEnum.keyToValue(value)); @@ -154,7 +153,7 @@ void SettingsDialog::loadFromSettings() } value = settings.value(QLatin1String("keepCookiesUntil"), QLatin1String("Expire")).toByteArray(); - QMetaEnum keepPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("KeepPolicy")); + QMetaEnum keepPolicyEnum = CookieJar::staticMetaObject.enumerator(CookieJar::staticMetaObject.indexOfEnumerator("KeepPolicy")); CookieJar::KeepPolicy keepCookies = keepPolicyEnum.keyToValue(value) == -1 ? CookieJar::KeepUntilExpire : static_cast<CookieJar::KeepPolicy>(keepPolicyEnum.keyToValue(value)); @@ -237,8 +236,7 @@ void SettingsDialog::saveToSettings() keepCookies = CookieJar::KeepUntilTimeLimit; break; } - CookieJar *jar = BrowserApplication::cookieJar(); - QMetaEnum acceptPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("AcceptPolicy")); + QMetaEnum acceptPolicyEnum = CookieJar::staticMetaObject.enumerator(CookieJar::staticMetaObject.indexOfEnumerator("AcceptPolicy")); settings.setValue(QLatin1String("acceptCookies"), QLatin1String(acceptPolicyEnum.valueToKey(keepCookies))); CookieJar::KeepPolicy keepPolicy; @@ -255,7 +253,7 @@ void SettingsDialog::saveToSettings() break; } - QMetaEnum keepPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("KeepPolicy")); + QMetaEnum keepPolicyEnum = CookieJar::staticMetaObject.enumerator(CookieJar::staticMetaObject.indexOfEnumerator("KeepPolicy")); settings.setValue(QLatin1String("keepCookiesUntil"), QLatin1String(keepPolicyEnum.valueToKey(keepPolicy))); settings.endGroup(); |