1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Fix warnings when building with GCC 7

This commit is contained in:
David Rosca 2017-06-06 17:51:06 +02:00
parent f0b8ac2daa
commit 567881f130
4 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2014 David Rosca <nowrep@gmail.com> * Copyright (C) 2014-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -120,6 +120,7 @@ QVariant BookmarksModel::data(const QModelIndex &index, int role) const
if (index.column() == 0 && itm->isUrl()) { if (index.column() == 0 && itm->isUrl()) {
return QString("%1\n%2").arg(itm->title(), QString::fromUtf8(itm->url().toEncoded())); return QString("%1\n%2").arg(itm->title(), QString::fromUtf8(itm->url().toEncoded()));
} }
// fallthrough
case Qt::DisplayRole: case Qt::DisplayRole:
switch (index.column()) { switch (index.column()) {
case 0: case 0:

View File

@ -72,6 +72,7 @@ void DownloadOptionsDialog::setLastDownloadOption(const DownloadManager::Downloa
ui->radioExternal->setChecked(true); ui->radioExternal->setChecked(true);
break; break;
} }
// fallthrough
case DownloadManager::OpenFile: case DownloadManager::OpenFile:
ui->radioOpen->setChecked(true); ui->radioOpen->setChecked(true);

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -115,6 +115,7 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const
if (index.column() == 0) { if (index.column() == 0) {
return QString("%1\n%2").arg(entry.title, entry.urlString); return QString("%1\n%2").arg(entry.title, entry.urlString);
} }
// fallthrough
case Qt::DisplayRole: case Qt::DisplayRole:
case Qt::EditRole: case Qt::EditRole:
switch (index.column()) { switch (index.column()) {

View File

@ -455,7 +455,7 @@ void ModelTest::data()
QVariant textAlignmentVariant = model->data(model->index(0, 0), Qt::TextAlignmentRole); QVariant textAlignmentVariant = model->data(model->index(0, 0), Qt::TextAlignmentRole);
if (textAlignmentVariant.isValid()) { if (textAlignmentVariant.isValid()) {
int alignment = textAlignmentVariant.toInt(); int alignment = textAlignmentVariant.toInt();
Q_ASSERT(alignment == (alignment & (Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask))); Q_ASSERT(alignment == int(alignment & (Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask)));
} }
// General Purpose roles that should return a QColor // General Purpose roles that should return a QColor