diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-08-12 21:03:34 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-08-12 21:03:34 +0000 |
| commit | 7ef8d11baeaf1847ba7f1df5d858f8cffea9300d (patch) | |
| tree | a741fb49db8834efd4b46d760b89082547eb2a9d /src/plugins/General/hotkey/settingsdialog.cpp | |
| parent | 6f301f5880f7efce76ed46e7b502830642b87370 (diff) | |
| download | qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.tar.gz qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.tar.bz2 qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.zip | |
coding style fixes
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9470 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/hotkey/settingsdialog.cpp')
| -rw-r--r-- | src/plugins/General/hotkey/settingsdialog.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/plugins/General/hotkey/settingsdialog.cpp b/src/plugins/General/hotkey/settingsdialog.cpp index 1255790e2..89ec737e8 100644 --- a/src/plugins/General/hotkey/settingsdialog.cpp +++ b/src/plugins/General/hotkey/settingsdialog.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2015 by Ilya Kotov * + * Copyright (C) 2009-2020 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -22,6 +22,7 @@ #include <QHeaderView> #include <QMessageBox> #include <qmmp/qmmp.h> +#include <algorithm> #include "hotkeydialog.h" #include "settingsdialog.h" @@ -63,7 +64,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) settings.endGroup(); } - SettingsDialog::~SettingsDialog() { while (!m_hotkeys.isEmpty()) @@ -86,18 +86,11 @@ void SettingsDialog::accept() void SettingsDialog::on_tableWidget_itemDoubleClicked (QTableWidgetItem *item) { - Hotkey *key = nullptr; - for(Hotkey *k : m_hotkeys) - { - if (k->action == item->type()) - { - key = k; - break; - } - } - if (!key) + auto it = std::find_if(m_hotkeys.cbegin(), m_hotkeys.cend(), [item](Hotkey *k) { return k->action == item->type(); }); + if(it == m_hotkeys.cend()) return; + Hotkey *key = *it; HotkeyDialog *dialog = new HotkeyDialog(key->key, key->mod, this); if (item->type() >= QTableWidgetItem::UserType && dialog->exec() == QDialog::Accepted) |
