clazy: Convert many old-style connects into function pointer based
[quassel.git] / src / qtui / settingspages / keysequencewidget.cpp
index 6e4fea6..f480e7c 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2012 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This class has been inspired by KDE's KKeySequenceWidget and uses     *
 #include <QToolButton>
 
 // This defines the unicode symbols for special keys (kCommandUnicode and friends)
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #  include <Carbon/Carbon.h>
 #endif
 
 #include "action.h"
 #include "actioncollection.h"
-#include "iconloader.h"
+#include "icon.h"
 #include "keysequencewidget.h"
 
 KeySequenceButton::KeySequenceButton(KeySequenceWidget *d_, QWidget *parent)
@@ -162,17 +162,14 @@ void KeySequenceButton::keyReleaseEvent(QKeyEvent *e)
 /******************************************************************************/
 
 KeySequenceWidget::KeySequenceWidget(QWidget *parent)
-    : QWidget(parent),
-    _shortcutsModel(0),
-    _isRecording(false),
-    _modifierKeys(0)
+    : QWidget(parent)
 {
-    QHBoxLayout *layout = new QHBoxLayout(this);
+    auto *layout = new QHBoxLayout(this);
     layout->setMargin(0);
 
     _keyButton = new KeySequenceButton(this, this);
     _keyButton->setFocusPolicy(Qt::StrongFocus);
-    _keyButton->setIcon(SmallIcon("configure"));
+    _keyButton->setIcon(icon::get("configure"));
     _keyButton->setToolTip(tr("Click on the button, then enter the shortcut like you would in the program.\nExample for Ctrl+a: hold the Ctrl key and press a."));
     layout->addWidget(_keyButton);
 
@@ -180,16 +177,16 @@ KeySequenceWidget::KeySequenceWidget(QWidget *parent)
     layout->addWidget(_clearButton);
 
     if (qApp->isLeftToRight())
-        _clearButton->setIcon(SmallIcon("edit-clear-locationbar-rtl"));
+        _clearButton->setIcon(icon::get("edit-clear-locationbar-rtl"));
     else
-        _clearButton->setIcon(SmallIcon("edit-clear-locationbar-ltr"));
+        _clearButton->setIcon(icon::get("edit-clear-locationbar-ltr"));
 
     setLayout(layout);
 
-    connect(_keyButton, SIGNAL(clicked()), SLOT(startRecording()));
-    connect(_keyButton, SIGNAL(clicked()), SIGNAL(clicked()));
-    connect(_clearButton, SIGNAL(clicked()), SLOT(clear()));
-    connect(_clearButton, SIGNAL(clicked()), SIGNAL(clicked()));
+    connect(_keyButton, &QAbstractButton::clicked, this, &KeySequenceWidget::startRecording);
+    connect(_keyButton, &QAbstractButton::clicked, this, &KeySequenceWidget::clicked);
+    connect(_clearButton, &QAbstractButton::clicked, this, &KeySequenceWidget::clear);
+    connect(_clearButton, &QAbstractButton::clicked, this, &KeySequenceWidget::clicked);
 }
 
 
@@ -265,7 +262,7 @@ void KeySequenceWidget::updateShortcutDisplay()
 
     if (_isRecording) {
         if (_modifierKeys) {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
             if (_modifierKeys & Qt::META) s += QChar(kControlUnicode);
             if (_modifierKeys & Qt::ALT) s += QChar(kOptionUnicode);
             if (_modifierKeys & Qt::SHIFT) s += QChar(kShiftUnicode);