mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 04:36:34 +01:00
history: port foreach -> range-based for
Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
parent
d242ac51ab
commit
6c14547656
@ -148,7 +148,7 @@ void History::deleteHistoryEntry(const QList<int> &list)
|
||||
QSqlDatabase db = SqlDatabase::instance()->database();
|
||||
db.transaction();
|
||||
|
||||
foreach (int index, list) {
|
||||
for (int index : list) {
|
||||
QSqlQuery query(SqlDatabase::instance()->database());
|
||||
query.prepare("SELECT count, date, url, title FROM history WHERE id=?");
|
||||
query.addBindValue(index);
|
||||
|
@ -121,7 +121,7 @@ void HistoryMenu::aboutToShowMostVisited()
|
||||
|
||||
const QVector<HistoryEntry> mostVisited = mApp->history()->mostVisited(10);
|
||||
|
||||
foreach (const HistoryEntry &entry, mostVisited) {
|
||||
for (const HistoryEntry &entry : mostVisited) {
|
||||
Action* act = new Action(QzTools::truncatedText(entry.title, 40));
|
||||
act->setData(entry.url);
|
||||
act->setIcon(IconProvider::iconForUrl(entry.url));
|
||||
|
@ -236,7 +236,7 @@ HistoryItem* HistoryModel::itemFromIndex(const QModelIndex &index) const
|
||||
|
||||
void HistoryModel::removeTopLevelIndexes(const QList<QPersistentModelIndex> &indexes)
|
||||
{
|
||||
foreach (const QPersistentModelIndex &index, indexes) {
|
||||
for (const QPersistentModelIndex &index : indexes) {
|
||||
if (index.parent().isValid()) {
|
||||
continue;
|
||||
}
|
||||
@ -321,7 +321,7 @@ void HistoryModel::fetchMore(const QModelIndex &parent)
|
||||
|
||||
beginInsertRows(parent, 0, list.size() - 1);
|
||||
|
||||
foreach (const HistoryEntry &entry, list) {
|
||||
for (const HistoryEntry &entry : qAsConst(list)) {
|
||||
HistoryItem* newItem = new HistoryItem(parentItem);
|
||||
newItem->historyEntry = entry;
|
||||
}
|
||||
|
@ -105,7 +105,8 @@ void HistoryTreeView::removeSelectedItems()
|
||||
|
||||
QList<QPersistentModelIndex> topLevelIndexes;
|
||||
|
||||
foreach (const QModelIndex &index, selectedIndexes()) {
|
||||
const auto indexes = selectedIndexes();
|
||||
for (const QModelIndex &index : indexes) {
|
||||
if (index.column() > 0) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user