mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
refs #912, formatting, typos, const
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ea50533755
commit
422e6626c8
@@ -7,13 +7,13 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackcore/context/contextapplication.h"
|
||||
#include "blackgui/components/hotkeydialog.h"
|
||||
#include "blackgui/components/configurationwizard.h"
|
||||
#include "blackgui/components/settingshotkeycomponent.h"
|
||||
#include "blackgui/components/hotkeydialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
#include "blackmisc/input/hotkeycombination.h"
|
||||
#include "blackcore/context/contextapplication.h"
|
||||
#include "blackcore/context/contextaudio.h"
|
||||
#include "blackcore/inputmanager.h"
|
||||
#include "ui_settingshotkeycomponent.h"
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
@@ -53,8 +53,7 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
CSettingsHotkeyComponent::~CSettingsHotkeyComponent()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
void CSettingsHotkeyComponent::ps_addEntry()
|
||||
{
|
||||
@@ -80,13 +79,15 @@ namespace BlackGui
|
||||
|
||||
const auto model = ui->tv_Hotkeys->model();
|
||||
const QModelIndex indexHotkey = model->index(index.row(), 0, QModelIndex());
|
||||
Q_ASSERT(indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).canConvert<CActionHotkey>());
|
||||
Q_ASSERT_X(indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).canConvert<CActionHotkey>(), Q_FUNC_INFO, "No action hotkey");
|
||||
CActionHotkey actionHotkey = indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).value<CActionHotkey>();
|
||||
BlackMisc::CIdentifierList registeredApps;
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||
if (sGui->getIContextApplication()) registeredApps = sGui->getIContextApplication()->getRegisteredApplications();
|
||||
|
||||
// add local application
|
||||
registeredApps.push_back(CIdentifier());
|
||||
auto selectedActionHotkey = CHotkeyDialog::getActionHotkey(actionHotkey, registeredApps, this);
|
||||
const auto selectedActionHotkey = CHotkeyDialog::getActionHotkey(actionHotkey, registeredApps, this);
|
||||
if (selectedActionHotkey.isValid() && checkAndConfirmConflicts(selectedActionHotkey, { actionHotkey }))
|
||||
{
|
||||
updateHotkeyInSettings(actionHotkey, selectedActionHotkey);
|
||||
@@ -156,7 +157,7 @@ namespace BlackGui
|
||||
m_model.clear();
|
||||
for (const auto &hotkey : hotkeys)
|
||||
{
|
||||
int position = m_model.rowCount();
|
||||
const int position = m_model.rowCount();
|
||||
m_model.insertRows(position, 1, QModelIndex());
|
||||
QModelIndex index = m_model.index(position, 0, QModelIndex());
|
||||
m_model.setData(index, QVariant::fromValue(hotkey), CActionHotkeyListModel::ActionHotkeyRole);
|
||||
|
||||
Reference in New Issue
Block a user