Refactoring
This commit is contained in:
@@ -91,8 +91,8 @@ int GlobalShortcut::nativeKeycode(const Qt::Key qt_keycode) {
|
||||
|
||||
}
|
||||
|
||||
int GlobalShortcut::nativeKeycode2(const Qt::Key key) {
|
||||
Q_UNUSED(key)
|
||||
int GlobalShortcut::nativeKeycode2(const Qt::Key qt_keycode) {
|
||||
Q_UNUSED(qt_keycode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <QAction>
|
||||
#include <QKeySequence>
|
||||
|
||||
#include "core/scoped_ptr.h"
|
||||
#include "includes/scoped_ptr.h"
|
||||
|
||||
class GlobalShortcutsBackendMacOSPrivate;
|
||||
|
||||
|
||||
@@ -36,12 +36,11 @@
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "config.h"
|
||||
#include "globalshortcutsmanager.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/mac_startup.h"
|
||||
|
||||
#import "core/SBSystemPreferences.h"
|
||||
#import "includes/SBSystemPreferences.h"
|
||||
|
||||
class GlobalShortcutsBackendMacOSPrivate {
|
||||
public:
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <QShortcut>
|
||||
#include <QKeySequence>
|
||||
|
||||
#include "core/logging.h"
|
||||
|
||||
#include "globalshortcutsmanager.h"
|
||||
#include "globalshortcutsbackend.h"
|
||||
|
||||
@@ -58,13 +60,13 @@
|
||||
# include "globalshortcutsbackend-macos.h"
|
||||
#endif
|
||||
|
||||
#include "settings/globalshortcutssettingspage.h"
|
||||
#include "constants/globalshortcutssettings.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
GlobalShortcutsManager::GlobalShortcutsManager(QWidget *parent) : QWidget(parent) {
|
||||
|
||||
settings_.beginGroup(GlobalShortcutsSettingsPage::kSettingsGroup);
|
||||
settings_.beginGroup(GlobalShortcutsSettings::kSettingsGroup);
|
||||
|
||||
// Create actions
|
||||
AddShortcut(u"play"_s, tr("Play"), std::bind(&GlobalShortcutsManager::Play, this));
|
||||
@@ -131,25 +133,25 @@ void GlobalShortcutsManager::ReloadSettings() {
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_KDE_GLOBALSHORTCUTS
|
||||
if (settings_.value("use_kde", true).toBool()) {
|
||||
if (settings_.value(GlobalShortcutsSettings::kUseKDE, true).toBool()) {
|
||||
backends_enabled_ << GlobalShortcutsBackend::Type::KDE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GNOME_GLOBALSHORTCUTS
|
||||
if (settings_.value("use_gnome", true).toBool()) {
|
||||
if (settings_.value(GlobalShortcutsSettings::kUseGnome, true).toBool()) {
|
||||
backends_enabled_ << GlobalShortcutsBackend::Type::Gnome;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MATE_GLOBALSHORTCUTS
|
||||
if (settings_.value("use_mate", true).toBool()) {
|
||||
if (settings_.value(GlobalShortcutsSettings::kUseMate, true).toBool()) {
|
||||
backends_enabled_ << GlobalShortcutsBackend::Type::Mate;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X11_GLOBALSHORTCUTS
|
||||
if (settings_.value("use_x11", false).toBool()) {
|
||||
if (settings_.value(GlobalShortcutsSettings::kUseX11, false).toBool()) {
|
||||
backends_enabled_ << GlobalShortcutsBackend::Type::X11;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user