DolphinQt: Make use of the C++11 signal/slot connection syntax.

Also use lambdas over one-line functions in some cases.
This commit is contained in:
waddlesplash
2015-09-10 23:31:40 -04:00
parent 3014feedc8
commit 8fbf70ec55
6 changed files with 44 additions and 75 deletions

View File

@ -22,7 +22,7 @@ DGameGrid::DGameGrid(QWidget* parent_widget) :
m_ui->setupUi(this);
SetViewStyle(STYLE_GRID);
connect(this, SIGNAL(itemActivated(QListWidgetItem*)), this, SIGNAL(StartGame()));
connect(this, &QListWidget::itemActivated, this, &DGameGrid::StartGame);
}
DGameGrid::~DGameGrid()

View File

@ -27,15 +27,15 @@ DGameTracker::DGameTracker(QWidget* parent_widget)
: QStackedWidget(parent_widget),
m_watcher(new QFileSystemWatcher(this))
{
connect(m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(ScanForGames()));
connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &DGameTracker::ScanForGames);
m_tree_widget = new DGameTree(this);
addWidget(m_tree_widget);
connect(m_tree_widget, SIGNAL(StartGame()), this, SIGNAL(StartGame()));
connect(m_tree_widget, &DGameTree::StartGame, this, &DGameTracker::StartGame);
m_grid_widget = new DGameGrid(this);
addWidget(m_grid_widget);
connect(m_grid_widget, SIGNAL(StartGame()), this, SIGNAL(StartGame()));
connect(m_grid_widget, &DGameGrid::StartGame, this, &DGameTracker::StartGame);
SetViewStyle(STYLE_LIST);
}

View File

@ -24,7 +24,7 @@ DGameTree::DGameTree(QWidget* parent_widget) :
setIconSize(QSize(BANNER_WIDTH, BANNER_HEIGHT));
sortByColumn(COL_TITLE, Qt::AscendingOrder);
connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(ItemActivated(QTreeWidgetItem*)));
connect(this, &QTreeWidget::itemActivated, this, &DGameTree::ItemActivated);
}
DGameTree::~DGameTree()