#include <QBoxLayout>
#include <KLocale>
-#include <kio/jobclasses.h>
+#include <KIO/JobClasses>
#include <views/viewproperties.h>
// allows to give a progress indication for the user when applying the view
// properties later.
m_dirSizeJob = KIO::directorySize(dir);
- connect(m_dirSizeJob, SIGNAL(result(KJob*)),
- this, SLOT(applyViewProperties()));
+ connect(m_dirSizeJob, &KIO::DirectorySizeJob::result,
+ this, &ViewPropsProgressInfo::applyViewProperties);
// The directory size job cannot emit any progress signal, as it is not aware
// about the total number of directories. Therefor a timer is triggered, which
// periodically updates the current directory count.
m_timer = new QTimer(this);
- connect(m_timer, SIGNAL(timeout()),
- this, SLOT(updateProgress()));
+ connect(m_timer, &QTimer::timeout,
+ this, &ViewPropsProgressInfo::updateProgress);
m_timer->start(300);
- connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelApplying()));
+ connect(this, &ViewPropsProgressInfo::cancelClicked, this, &ViewPropsProgressInfo::cancelApplying);
}
ViewPropsProgressInfo::~ViewPropsProgressInfo()
void ViewPropsProgressInfo::updateProgress()
{
- if (m_dirSizeJob != 0) {
+ if (m_dirSizeJob) {
const int subdirs = m_dirSizeJob->totalSubdirs();
m_label->setText(i18nc("@info:progress", "Counting folders: %1", subdirs));
}
- if (m_applyViewPropsJob != 0) {
+ if (m_applyViewPropsJob) {
const int progress = m_applyViewPropsJob->progress();
m_progressBar->setValue(progress);
}
m_dirSizeJob = 0;
m_applyViewPropsJob = new ApplyViewPropsJob(m_dir, *m_viewProps);
- connect(m_applyViewPropsJob, SIGNAL(result(KJob*)),
- this, SLOT(close()));
+ connect(m_applyViewPropsJob, &ApplyViewPropsJob::result,
+ this, &ViewPropsProgressInfo::close);
}
void ViewPropsProgressInfo::cancelApplying()
{
- if (m_dirSizeJob != 0) {
+ if (m_dirSizeJob) {
m_dirSizeJob->kill();
m_dirSizeJob = 0;
}
- if (m_applyViewPropsJob != 0) {
+ if (m_applyViewPropsJob) {
m_applyViewPropsJob->kill();
m_applyViewPropsJob = 0;
}