mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
preferences: port foreach -> range-based for
Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
parent
6c14547656
commit
ea75f18c5b
@ -87,10 +87,10 @@ AcceptLanguage::AcceptLanguage(QWidget* parent)
|
||||
|
||||
Settings settings;
|
||||
settings.beginGroup("Language");
|
||||
QStringList langs = settings.value("acceptLanguage", defaultLanguage()).toStringList();
|
||||
const QStringList langs = settings.value("acceptLanguage", defaultLanguage()).toStringList();
|
||||
settings.endGroup();
|
||||
|
||||
foreach (const QString &code, langs) {
|
||||
for (const QString &code : langs) {
|
||||
QString code_ = code;
|
||||
QLocale loc = QLocale(code_.replace(QLatin1Char('-'), QLatin1Char('_')));
|
||||
QString label;
|
||||
|
@ -82,10 +82,10 @@ void AutoFillManager::loadPasswords()
|
||||
ui->showPasswords->setText(tr("Show Passwords"));
|
||||
m_passwordsShown = false;
|
||||
|
||||
QVector<PasswordEntry> allEntries = mApp->autoFill()->getAllFormData();
|
||||
const QVector<PasswordEntry> allEntries = mApp->autoFill()->getAllFormData();
|
||||
|
||||
ui->treePass->clear();
|
||||
foreach (const PasswordEntry &entry, allEntries) {
|
||||
for (const PasswordEntry &entry : allEntries) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(ui->treePass);
|
||||
item->setText(0, entry.host);
|
||||
item->setText(1, entry.username);
|
||||
|
@ -101,7 +101,7 @@ void PluginsManager::refresh()
|
||||
|
||||
const QList<Plugins::Plugin> &allPlugins = mApp->plugins()->availablePlugins();
|
||||
|
||||
foreach (const Plugins::Plugin &plugin, allPlugins) {
|
||||
for (const Plugins::Plugin &plugin : allPlugins) {
|
||||
PluginSpec spec = plugin.pluginSpec;
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem(ui->list);
|
||||
|
@ -209,7 +209,8 @@ Preferences::Preferences(BrowserWindow* window)
|
||||
ui->activeProfile->setText("<b>" + ProfileManager::currentProfile() + "</b>");
|
||||
ui->startProfile->addItem(startingProfile);
|
||||
|
||||
foreach (const QString &name, ProfileManager::availableProfiles()) {
|
||||
const auto names = ProfileManager::availableProfiles();
|
||||
for (const QString &name : names) {
|
||||
if (startingProfile != name) {
|
||||
ui->startProfile->addItem(name);
|
||||
}
|
||||
@ -295,7 +296,8 @@ Preferences::Preferences(BrowserWindow* window)
|
||||
ui->webRTCPublicIpOnly->setChecked(settings.value("WebRTCPublicIpOnly", true).toBool());
|
||||
ui->dnsPrefetch->setChecked(settings.value("DNSPrefetch", true).toBool());
|
||||
|
||||
foreach (int level, WebView::zoomLevels()) {
|
||||
const auto levels = WebView::zoomLevels();
|
||||
for (int level : levels) {
|
||||
ui->defaultZoomLevel->addItem(QString("%1%").arg(level));
|
||||
}
|
||||
ui->defaultZoomLevel->setCurrentIndex(settings.value("DefaultZoomLevel", WebView::zoomLevels().indexOf(100)).toInt());
|
||||
|
@ -45,10 +45,10 @@ ThemeManager::ThemeManager(QWidget* parent, Preferences* preferences)
|
||||
|
||||
const QStringList themePaths = DataPaths::allPaths(DataPaths::Themes);
|
||||
|
||||
foreach (const QString &path, themePaths) {
|
||||
for (const QString &path : themePaths) {
|
||||
QDir dir(path);
|
||||
QStringList list = dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
|
||||
foreach (const QString &name, list) {
|
||||
const QStringList list = dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
|
||||
for (const QString &name : list) {
|
||||
Theme themeInfo = parseTheme(dir.absoluteFilePath(name) + QLatin1Char('/'), name);
|
||||
if (!themeInfo.isValid) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user