From a55b7eb7a765f09f0e83e9d3ce5696f540b6bd9b Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 24 Mar 2017 18:18:49 +0100 Subject: Change to new style connect syntax Quite some code churn, but I like the idea that wrong connections are compile time errors. Since I had to get rid of default arguments in Slots, this simplified things in doPopulateByFolder... --- beetplayer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'beetplayer.cpp') diff --git a/beetplayer.cpp b/beetplayer.cpp index ef3f84f..3ccf9d5 100644 --- a/beetplayer.cpp +++ b/beetplayer.cpp @@ -34,12 +34,12 @@ BeetPlayer::BeetPlayer(QWidget *parent, Qt::WindowFlags f) : QMainWindow(parent, splash.showMessage(tr("Constructing Player..."), Qt::AlignHCenter, Qt::yellow); qApp->processEvents(); mPlayerWidget = new PlayerWidget; - connect(mPlayerWidget, SIGNAL(viewModeChanged(QString)), this, SLOT(setViewMode(QString))); - connect(mPlayerWidget, SIGNAL(playModeChanged(QString)), this, SLOT(setPlayMode(QString))); - connect(mPlayerWidget, SIGNAL(numFilesChanged(int)), this, SLOT(setNumFiles(int))); - connect(mPlayerWidget, SIGNAL(playListLengthChanged(quint64)), this, SLOT(setPlayListLength(quint64))); - connect(mPlayerWidget, SIGNAL(message(QString)), this, SLOT(setMessage(QString))); - connect(mPlayerWidget, SIGNAL(setWinTitle(QString)), this, SLOT(setWindowTitle(QString))); + connect(mPlayerWidget, &PlayerWidget::viewModeChanged, this, &BeetPlayer::setViewMode); + connect(mPlayerWidget, &PlayerWidget::playModeChanged, this, &BeetPlayer::setPlayMode); + connect(mPlayerWidget, &PlayerWidget::numFilesChanged, this, &BeetPlayer::setNumFiles); + connect(mPlayerWidget, &PlayerWidget::playListLengthChanged, this, &BeetPlayer::setPlayListLength); + connect(mPlayerWidget, &PlayerWidget::message, this, &BeetPlayer::setMessage); + connect(mPlayerWidget, &PlayerWidget::setWinTitle, this, &BeetPlayer::setWindowTitle); createStatusbar(); setCentralWidget(mPlayerWidget); splash.showMessage(tr("Populating..."), Qt::AlignHCenter, Qt::yellow); @@ -93,11 +93,11 @@ void BeetPlayer::readSettings(){ void BeetPlayer::createGlobalActions(){ QAction *quitA = new QAction(tr("Quit"), this); quitA->setShortcut(tr("CTRL+Q")); - connect(quitA, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); + connect(quitA, &QAction::triggered, qApp, &QApplication::closeAllWindows); quitA->setData(Globals::QuitAction); Globals::instance()->addAction(quitA); QAction *configA = new QAction(QIcon(":/chastity_belt.png"), tr("Configure..."), this); - connect(configA, SIGNAL(triggered()), this, SLOT(configure())); + connect(configA, &QAction::triggered, this, &BeetPlayer::configure); configA->setData(Globals::ConfigAction); Globals::instance()->addAction(configA); } -- cgit v1.2.3-70-g09d2