1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 04:36:34 +01:00

Fix all build warnings

This commit is contained in:
David Rosca 2015-08-30 17:42:58 +02:00
parent 1683d5aaaf
commit 758fd6c687
16 changed files with 37 additions and 120 deletions

View File

@ -21,6 +21,6 @@ script:
- QMAKE="qmake"
- if [[ "$QT" == "qt55" ]]; then QMAKE="/opt/qt55/bin/qmake"; fi
- $QMAKE
# - $QMAKE QMAKE_CXXFLAGS+="-Wextra -Werror"
- $QMAKE QMAKE_CXXFLAGS+="-Wextra -Werror"
- make || exit 1
# - cd scripts && ./run_tests.sh $QMAKE

View File

@ -337,6 +337,7 @@ bool AdBlockRule::matchObject(const QNetworkRequest &request) const
bool AdBlockRule::matchSubdocument(const QNetworkRequest &request) const
{
Q_UNUSED(request)
#if QTWEBENGINE_DISABLED
QWebEngineFrame* originatingFrame = static_cast<QWebEngineFrame*>(request.originatingObject());
if (!originatingFrame) {

View File

@ -1190,6 +1190,7 @@ bool BrowserWindow::event(QEvent* event)
void BrowserWindow::printPage(QWebEngineFrame* frame)
{
Q_UNUSED(frame)
#if QTWEBENGINE_DISABLED
QPrintPreviewDialog* dialog = new QPrintPreviewDialog(this);
dialog->setAttribute(Qt::WA_DeleteOnClose);

View File

@ -142,10 +142,8 @@ QString ProfileManager::startingProfile() const
void ProfileManager::setStartingProfile(const QString &profileName)
{
#if QTWEBENGINE_DISABLED
QSettings settings(DataPaths::path(DataPaths::Profiles) + QLatin1String("/profiles.ini"), QSettings::IniFormat);
settings.setValue(QLatin1String("Profiles/startProfile"), profileName);
#endif
}
QStringList ProfileManager::availableProfiles() const

View File

@ -176,12 +176,14 @@ QVector<PasswordEntry> AutoFill::completeFrame(QWebEngineFrame* frame)
return list;
}
#if QTWEBENGINE_DISABLED
const QUrl frameUrl = QzTools::frameUrl(frame);
if (!isStored(frameUrl)) {
return list;
}
list = getFormData(frameUrl);
#endif
if (!list.isEmpty()) {
const PasswordEntry entry = list.first();
@ -199,6 +201,8 @@ QVector<PasswordEntry> AutoFill::completeFrame(QWebEngineFrame* frame)
void AutoFill::post(const QNetworkRequest &request, const QByteArray &outgoingData)
{
Q_UNUSED(request)
Q_UNUSED(outgoingData)
#if QTWEBENGINE_DISABLED
// Don't save in private browsing
if (mApp->isPrivate()) {

View File

@ -212,6 +212,7 @@ QByteArray PageFormCompleter::convertWebKitFormBoundaryIfNecessary(const QByteAr
PageFormCompleter::QueryItem PageFormCompleter::findUsername(const QWebElement &form) const
{
Q_UNUSED(form)
#if QTWEBENGINE_DISABLED
// Try to find username (or email) field in the form.
QStringList selectors;

View File

@ -43,7 +43,7 @@ BookmarksTreeView::BookmarksTreeView(QWidget* parent)
connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(indexExpanded(QModelIndex)));
connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(indexCollapsed(QModelIndex)));
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged()));
connect(this, SIGNAL(slotSelectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSelectionChanged()));
}
BookmarksTreeView::ViewType BookmarksTreeView::viewType() const
@ -151,7 +151,7 @@ void BookmarksTreeView::indexCollapsed(const QModelIndex &parent)
}
}
void BookmarksTreeView::selectionChanged()
void BookmarksTreeView::slotSelectionChanged()
{
emit bookmarksSelected(selectedBookmarks());
}

View File

@ -70,7 +70,7 @@ private slots:
void indexExpanded(const QModelIndex &parent);
void indexCollapsed(const QModelIndex &parent);
void selectionChanged();
void slotSelectionChanged();
private:
void restoreExpandedState(const QModelIndex &parent);

View File

@ -105,7 +105,7 @@ SOURCES += \
bookmarks/bookmarkswidget.cpp \
cookies/cookiejar.cpp \
cookies/cookiemanager.cpp \
downloads/downloadfilehelper.cpp \
#downloads/downloadfilehelper.cpp \
downloads/downloaditem.cpp \
downloads/downloadmanager.cpp \
downloads/downloadoptionsdialog.cpp \
@ -129,15 +129,15 @@ SOURCES += \
navigation/reloadstopbutton.cpp \
navigation/siteicon.cpp \
navigation/websearchbar.cpp \
network/cabundleupdater.cpp \
network/networkmanager.cpp \
#network/cabundleupdater.cpp \
#network/networkmanager.cpp \
network/networkmanagerproxy.cpp \
network/networkproxyfactory.cpp \
network/pac/pacmanager.cpp \
network/pac/proxyautoconfig.cpp \
network/schemehandlers/adblockschemehandler.cpp \
network/schemehandlers/fileschemehandler.cpp \
network/schemehandlers/ftpschemehandler.cpp \
#network/schemehandlers/ftpschemehandler.cpp \
network/schemehandlers/qupzillaschemehandler.cpp \
network/sslerrordialog.cpp \
notifications/desktopnotification.cpp \
@ -154,16 +154,16 @@ SOURCES += \
other/checkboxdialog.cpp \
other/iconchooser.cpp \
other/licenseviewer.cpp \
other/pagescreen.cpp \
#other/pagescreen.cpp \
other/qzsettings.cpp \
other/siteinfo.cpp \
#other/siteinfo.cpp \
other/siteinfowidget.cpp \
other/sourceviewer.cpp \
other/sourceviewersearch.cpp \
#other/sourceviewer.cpp \
#other/sourceviewersearch.cpp \
other/statusbarmessage.cpp \
other/updater.cpp \
other/useragentmanager.cpp \
plugins/clicktoflash.cpp \
#plugins/clicktoflash.cpp \
plugins/pluginproxy.cpp \
plugins/plugins.cpp \
plugins/speeddial.cpp \
@ -301,7 +301,7 @@ HEADERS += \
bookmarks/bookmarkswidget.h \
cookies/cookiejar.h \
cookies/cookiemanager.h \
downloads/downloadfilehelper.h \
#downloads/downloadfilehelper.h \
downloads/downloaditem.h \
downloads/downloadmanager.h \
downloads/downloadoptionsdialog.h \
@ -325,7 +325,7 @@ HEADERS += \
navigation/reloadstopbutton.h \
navigation/siteicon.h \
navigation/websearchbar.h \
network/cabundleupdater.h \
#network/cabundleupdater.h \
network/networkmanager.h \
network/networkmanagerproxy.h \
network/networkproxyfactory.h \
@ -334,7 +334,7 @@ HEADERS += \
network/pac/proxyautoconfig.h \
network/schemehandlers/adblockschemehandler.h \
network/schemehandlers/fileschemehandler.h \
network/schemehandlers/ftpschemehandler.h \
#network/schemehandlers/ftpschemehandler.h \
network/schemehandlers/qupzillaschemehandler.h \
network/schemehandlers/schemehandler.h \
network/sslerrordialog.h \
@ -352,16 +352,16 @@ HEADERS += \
other/checkboxdialog.h \
other/iconchooser.h \
other/licenseviewer.h \
other/pagescreen.h \
#other/pagescreen.h \
other/qzsettings.h \
other/siteinfo.h \
#other/siteinfo.h \
other/siteinfowidget.h \
other/sourceviewer.h \
other/sourceviewersearch.h \
#other/sourceviewer.h \
#other/sourceviewersearch.h \
other/statusbarmessage.h \
other/updater.h \
other/useragentmanager.h \
plugins/clicktoflash.h \
#plugins/clicktoflash.h \
plugins/plugininterface.h \
plugins/pluginproxy.h \
plugins/plugins.h \

View File

@ -256,6 +256,8 @@ void SearchEnginesManager::addEngine(const Engine &engine)
void SearchEnginesManager::addEngineFromForm(const QWebElement &element, WebView* view)
{
Q_UNUSED(element)
Q_UNUSED(view)
#if QTWEBENGINE_DISABLED
QWebElement formElement = element.parent();

View File

@ -46,25 +46,12 @@ void PopupStatusBarMessage::showMessage(const QString &message)
QWebEngineFrame* mainFrame = view->page()->mainFrame();
#endif
int horizontalScrollSize = 0;
int verticalScrollSize = 0;
const int scrollbarSize = m_popupWindow->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
#if QTWEBENGINE_DISABLED
if (mainFrame->scrollBarMaximum(Qt::Horizontal)) {
horizontalScrollSize = scrollbarSize;
}
if (mainFrame->scrollBarMaximum(Qt::Vertical)) {
verticalScrollSize = scrollbarSize;
}
#endif
m_statusBarText->setText(message);
m_statusBarText->setMaximumWidth(view->width() - verticalScrollSize);
m_statusBarText->setMaximumWidth(view->width());
m_statusBarText->resize(m_statusBarText->sizeHint());
QPoint position;
position.setY(view->height() - horizontalScrollSize - m_statusBarText->height());
position.setY(view->height() - m_statusBarText->height());
QRect statusRect = QRect(view->mapToGlobal(QPoint(0, position.y())), m_statusBarText->size());

View File

@ -202,6 +202,7 @@ void SSLManager::deleteCertificate()
void SSLManager::ignoreAll(bool state)
{
Q_UNUSED(state)
#if QTWEBENGINE_DISABLED
mApp->networkManager()->setIgnoreAllWarnings(state);
#endif
@ -209,6 +210,7 @@ void SSLManager::ignoreAll(bool state)
void SSLManager::disableWeakCiphers(bool state)
{
Q_UNUSED(state)
#if QTWEBENGINE_DISABLED
mApp->networkManager()->setDisableWeakCiphers(state);
#endif

View File

@ -213,15 +213,6 @@ QString QzTools::escapeSqlString(QString urlString)
return urlString;
}
QUrl QzTools::frameUrl(QWebEngineFrame* frame)
{
#if QTWEBENGINE_DISABLED
return frame->url().isEmpty() ? frame->baseUrl() : frame->url();
#else
return QUrl();
#endif
}
QString QzTools::ensureUniqueFilename(const QString &name, const QString &appendFormat)
{
if (!QFile::exists(name)) {

View File

@ -24,7 +24,6 @@
class QSslCertificate;
class QFontMetrics;
class QWebEngineFrame;
class QPixmap;
class QIcon;
class QWidget;
@ -49,7 +48,6 @@ public:
static QString urlEncodeQueryString(const QUrl &url);
static QString fromPunycode(const QString &str);
static QString escapeSqlString(QString urlString);
static QUrl frameUrl(QWebEngineFrame *frame);
static QString ensureUniqueFilename(const QString &name, const QString &appendFormat = QString("(%1)"));
static QString getFileNameFromUrl(const QUrl &url);

View File

@ -83,13 +83,13 @@ WebPage::WebPage(QObject* parent)
, m_secureStatus(false)
, m_adjustingScheduled(false)
{
setupWebChannel();
connect(this, &QWebEnginePage::loadProgress, this, &WebPage::progress);
connect(this, &QWebEnginePage::loadFinished, this, &WebPage::finished);
connect(this, &QWebEnginePage::urlChanged, this, &WebPage::urlChanged);
connect(this, &QWebEnginePage::featurePermissionRequested, this, &WebPage::featurePermissionRequested);
connect(this, &QWebEnginePage::windowCloseRequested, this, &WebPage::windowCloseRequested);
setupWebChannel();
}
WebPage::~WebPage()
@ -159,12 +159,7 @@ bool WebPage::isLoading() const
void WebPage::urlChanged(const QUrl &url)
{
#if QTWEBENGINE_DISABLED
// Make sure JavaScript is enabled for qupzilla pages regardless of user settings
if (url.scheme() == QLatin1String("qupzilla")) {
settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
}
#endif
Q_UNUSED(url)
if (isLoading()) {
m_adBlockedEntries.clear();
@ -225,65 +220,6 @@ void WebPage::watchedFileChanged(const QString &file)
}
}
void WebPage::handleUnsupportedContent(QNetworkReply* reply)
{
if (!reply) {
return;
}
const QUrl url = reply->url();
switch (reply->error()) {
case QNetworkReply::NoError:
if (reply->header(QNetworkRequest::ContentTypeHeader).isValid()) {
QString requestUrl = reply->request().url().toString(QUrl::RemoveFragment | QUrl::RemoveQuery);
#if QTWEBENGINE_DISABLED
if (requestUrl.endsWith(QLatin1String(".swf"))) {
const QWebElement docElement = mainFrame()->documentElement();
const QWebElement object = docElement.findFirst(QString("object[src=\"%1\"]").arg(requestUrl));
const QWebElement embed = docElement.findFirst(QString("embed[src=\"%1\"]").arg(requestUrl));
if (!object.isNull() || !embed.isNull()) {
qDebug() << "WebPage::UnsupportedContent" << url << "Attempt to download flash object on site!";
reply->deleteLater();
return;
}
}
DownloadManager* dManager = mApp->downloadManager();
dManager->handleUnsupportedContent(reply, this);
#endif
return;
}
// Falling unsupported content with invalid ContentTypeHeader to be handled as UnknownProtocol
case QNetworkReply::ProtocolUnknownError: {
if (url.scheme() == QLatin1String("file")) {
FileSchemeHandler::handleUrl(url);
return;
}
if (url.scheme() == QLatin1String("ftp")) {
DownloadManager* dManager = mApp->downloadManager();
#if QTWEBENGINE_DISABLED
dManager->handleUnsupportedContent(reply, this);
#endif
return;
}
qDebug() << "WebPage::UnsupportedContent" << url << "ProtocolUnknowError";
desktopServicesOpen(url);
reply->deleteLater();
return;
}
default:
break;
}
qDebug() << "WebPage::UnsupportedContent error" << url << reply->errorString();
reply->deleteLater();
}
void WebPage::handleUnknownProtocol(const QUrl &url)
{
const QString protocol = url.scheme();
@ -1040,7 +976,6 @@ void WebPage::javaScriptAlert(const QUrl &securityOrigin, const QString &msg)
void WebPage::setJavaScriptEnabled(bool enabled)
{
settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, enabled);
m_javaScriptEnabled = enabled;
}
QWebEnginePage* WebPage::createWindow(QWebEnginePage::WebWindowType type)

View File

@ -81,8 +81,6 @@ signals:
void privacyChanged(bool status);
protected slots:
void handleUnsupportedContent(QNetworkReply* url);
void progress(int prog);
void finished();
@ -131,7 +129,6 @@ private:
int m_loadProgress;
bool m_blockAlerts;
bool m_secureStatus;
bool m_javaScriptEnabled;
bool m_adjustingScheduled;
};