Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fakemonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ FakeMonitor::FakeMonitor(HostInfoManager *manager, QObject *parent)
{
m_updateTimer->setInterval(200);
m_updateTimer->start();
connect(m_updateTimer, SIGNAL(timeout()), SLOT(update()));
connect(m_updateTimer, &QTimer::timeout, this, &FakeMonitor::update);

setSchedulerState(Online);

Expand Down
6 changes: 3 additions & 3 deletions src/icecreammonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void IcecreamMonitor::checkScheduler(bool deleteit)
} else if (m_scheduler) {
return;
}
QTimer::singleShot(1000 + (QRandomGenerator::global()->generate() & 1023), this, SLOT(slotCheckScheduler())); // TODO: check if correct
QTimer::singleShot(1000 + (QRandomGenerator::global()->generate() & 1023), this, &IcecreamMonitor::slotCheckScheduler); // TODO: check if correct
}

void IcecreamMonitor::registerNotify(int fd, QSocketNotifier::Type type, const char *slot)
Expand Down Expand Up @@ -140,7 +140,7 @@ void IcecreamMonitor::slotCheckScheduler()

if (!m_scheduler->send_msg(MonLoginMsg())) {
checkScheduler(true);
QTimer::singleShot(0, this, SLOT(slotCheckScheduler()));
QTimer::singleShot(0, this, &IcecreamMonitor::slotCheckScheduler);
} else {
setSchedulerState(Online);
}
Expand All @@ -158,7 +158,7 @@ void IcecreamMonitor::slotCheckScheduler()
QSocketNotifier::Read, SLOT(slotCheckScheduler()));
}
if (m_fd_type == QSocketNotifier::Read) {
QTimer::singleShot(1000 + (QRandomGenerator::global()->generate() & 1023), this, SLOT(slotCheckScheduler()));
QTimer::singleShot(1000 + (QRandomGenerator::global()->generate() & 1023), this, &IcecreamMonitor::slotCheckScheduler);
}
}

Expand Down
28 changes: 14 additions & 14 deletions src/mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ MainWindow::MainWindow(QWidget *parent)
m_jobStatsWidget = new QLabel;
m_jobStatsWidget->setVisible(false);
statusBar()->addPermanentWidget(m_jobStatsWidget);

QAction *action = nullptr;

if (QSystemTrayIcon::isSystemTrayAvailable())
Expand All @@ -108,7 +108,7 @@ MainWindow::MainWindow(QWidget *parent)
fileMenu->addSeparator();
}

action = fileMenu->addAction(tr("&Quit"), this, SLOT(quit()), tr("Ctrl+Q"));
action = fileMenu->addAction(tr("&Quit"), this, &QWidget::close, tr("Ctrl+Q"));
action->setIcon(QIcon::fromTheme(QStringLiteral("application-exit")));
action->setMenuRole(QAction::QuitRole);

Expand All @@ -131,22 +131,22 @@ MainWindow::MainWindow(QWidget *parent)
action = m_viewMode->addAction(tr("&Detailed Host View"));
action->setCheckable(true);
action->setData(QStringLiteral("detailedhost"));
connect(m_viewMode, SIGNAL(triggered(QAction *)), this, SLOT(handleViewModeActionTriggered(QAction *)));
connect(m_viewMode, &QActionGroup::triggered, this, &MainWindow::handleViewModeActionTriggered);
viewMenu->addActions(m_viewMode->actions());

viewMenu->addSeparator();

action = viewMenu->addAction(tr("Pause"));
action->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-pause")));
action->setCheckable(true);
connect(action, SIGNAL(triggered()), this, SLOT(pauseView()));
connect(action, &QAction::triggered, this, &MainWindow::pauseView);
m_pauseViewAction = action;

viewMenu->addSeparator();

action = viewMenu->addAction(tr("Configure View..."));
action->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
connect(action, SIGNAL(triggered()), this, SLOT(configureView()));
connect(action, &QAction::triggered, this, &MainWindow::configureView);
m_configureViewAction = action;

action = helpMenu->addAction(tr("About Qt..."));
Expand All @@ -155,7 +155,7 @@ MainWindow::MainWindow(QWidget *parent)

action = helpMenu->addAction(tr("About..."));
action->setIcon(appIcon);
connect(action, SIGNAL(triggered()), this, SLOT(about()));
connect(action, &QAction::triggered, this, &MainWindow::about);
action->setMenuRole(QAction::AboutRole);

m_hostInfoManager = new HostInfoManager;
Expand Down Expand Up @@ -233,19 +233,19 @@ void MainWindow::setMonitor(Monitor *monitor)
}

if (m_monitor) {
disconnect(m_monitor, SIGNAL(schedulerStateChanged(Monitor::SchedulerState)),
this, SLOT(updateSchedulerState(Monitor::SchedulerState)));
disconnect(m_monitor, SIGNAL(jobUpdated(const Job &)), this, SLOT(updateJob(Job)));
disconnect(m_monitor->hostInfoManager(), SIGNAL(hostMapChanged()), this, SLOT(updateJobStats()));
disconnect(m_monitor.data(), &Monitor::schedulerStateChanged,
this, &MainWindow::updateSchedulerState);
disconnect(m_monitor.data(), &Monitor::jobUpdated, this, &MainWindow::updateJob);
disconnect(m_monitor->hostInfoManager(), &HostInfoManager::hostMapChanged, this, &MainWindow::updateJobStats);
}

m_monitor = monitor;

if (m_monitor) {
connect(m_monitor, SIGNAL(schedulerStateChanged(Monitor::SchedulerState)),
this, SLOT(updateSchedulerState(Monitor::SchedulerState)));
connect(m_monitor, SIGNAL(jobUpdated(const Job &)), this, SLOT(updateJob(Job)));
connect(m_monitor->hostInfoManager(), SIGNAL(hostMapChanged()), this, SLOT(updateJobStats()));
connect(m_monitor.data(), &Monitor::schedulerStateChanged,
this, &MainWindow::updateSchedulerState);
connect(m_monitor.data(), &Monitor::jobUpdated, this, &MainWindow::updateJob);
connect(m_monitor->hostInfoManager(), &HostInfoManager::hostMapChanged, this, &MainWindow::updateJobStats);
}

if (m_view) {
Expand Down
20 changes: 10 additions & 10 deletions src/statusview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ void StatusView::setMonitor(Monitor *monitor)
}

if (m_monitor) {
disconnect(m_monitor.data(), SIGNAL(jobUpdated(Job)), this, SLOT(update(Job)));
disconnect(m_monitor.data(), SIGNAL(nodeRemoved(HostId)), this, SLOT(removeNode(HostId)));
disconnect(m_monitor.data(), SIGNAL(nodeUpdated(HostId)), this, SLOT(checkNode(HostId)));
disconnect(m_monitor.data(), SIGNAL(schedulerStateChanged(Monitor::SchedulerState)),
this, SLOT(updateSchedulerState(Monitor::SchedulerState)));
disconnect(m_monitor.data(), &Monitor::jobUpdated, this, &StatusView::update);
disconnect(m_monitor.data(), &Monitor::nodeRemoved, this, &StatusView::removeNode);
disconnect(m_monitor.data(), &Monitor::nodeUpdated, this, &StatusView::checkNode);
disconnect(m_monitor.data(), &Monitor::schedulerStateChanged,
this, &StatusView::updateSchedulerState);
}

m_monitor = monitor;

if (m_monitor) {
connect(m_monitor.data(), SIGNAL(jobUpdated(Job)), this, SLOT(update(Job)));
connect(m_monitor.data(), SIGNAL(nodeRemoved(HostId)), this, SLOT(removeNode(HostId)));
connect(m_monitor.data(), SIGNAL(nodeUpdated(HostId)), this, SLOT(checkNode(HostId)));
connect(m_monitor.data(), SIGNAL(schedulerStateChanged(Monitor::SchedulerState)),
this, SLOT(updateSchedulerState(Monitor::SchedulerState)));
connect(m_monitor.data(), &Monitor::jobUpdated, this, &StatusView::update);
connect(m_monitor.data(), &Monitor::nodeRemoved, this, &StatusView::removeNode);
connect(m_monitor.data(), &Monitor::nodeUpdated, this, &StatusView::checkNode);
connect(m_monitor.data(), &Monitor::schedulerStateChanged,
this, &StatusView::updateSchedulerState);

if (options().testFlag(RememberJobsOption)) {
foreach(const Job &job, m_monitor->jobHistory()) {
Expand Down