Commit ab59de54 authored by Laurent Montel's avatar Laurent Montel 😁

remove some clazy warning

parent 5ad09405
......@@ -73,8 +73,8 @@ Archiver::Archiver(QWidget *parent)
if ( !interactive )
{
connect(this, SIGNAL(logging(const QString &)), this, SLOT(loggingSlot(const QString &)));
connect(this, SIGNAL(warning(const QString &)), this, SLOT(warningSlot(const QString &)));
connect(this, &Archiver::logging, this, &Archiver::loggingSlot);
connect(this, &Archiver::warning, this, &Archiver::warningSlot);
}
}
......@@ -499,7 +499,7 @@ bool Archiver::createArchive(const QStringList &includes, const QStringList &exc
QTimer runTimer;
if ( interactive ) // else we do not need to be interrupted during the backup
{
connect(&runTimer, SIGNAL(timeout()), this, SLOT(updateElapsed()));
connect(&runTimer, &QTimer::timeout, this, &Archiver::updateElapsed);
runTimer.start(1000);
}
elapsed.start();
......@@ -542,8 +542,8 @@ bool Archiver::createArchive(const QStringList &includes, const QStringList &exc
QPointer<KIO::ListJob> listJob;
listJob = KIO::listDir(targetURL, KIO::DefaultFlags, false);
connect(listJob, SIGNAL(entries(KIO::Job *, const KIO::UDSEntryList &)),
this, SLOT(slotListResult(KIO::Job *, const KIO::UDSEntryList &)));
connect(listJob.data(), &KIO::ListJob::entries,
this, &Archiver::slotListResult);
while ( listJob )
qApp->processEvents(QEventLoop::WaitForMoreEvents);
......@@ -568,7 +568,7 @@ bool Archiver::createArchive(const QStringList &includes, const QStringList &exc
if ( jobResult == 0 )
{
std::sort(targetDirList.begin(), targetDirList.end(), Archiver::UDSlessThan);
QString prefix = filePrefix.isEmpty() ? QString::fromLatin1("backup_") : (filePrefix + QLatin1String("_"));
QString prefix = filePrefix.isEmpty() ? QStringLiteral("backup_") : (filePrefix + QLatin1String("_"));
QString sliceName;
int num = 0;
......@@ -604,7 +604,7 @@ bool Archiver::createArchive(const QStringList &includes, const QStringList &exc
QPointer<KIO::SimpleJob> delJob;
delJob = KIO::file_delete(url, KIO::DefaultFlags);
connect(delJob, SIGNAL(result(KJob *)), this, SLOT(slotResult(KJob *)));
connect(delJob.data(), &KJob::result, this, &Archiver::slotResult);
while ( delJob )
qApp->processEvents(QEventLoop::WaitForMoreEvents);
......@@ -665,7 +665,7 @@ bool Archiver::createArchive(const QStringList &includes, const QStringList &exc
sliceList,
QString(),
KStandardGuiItem::cont(), KStandardGuiItem::quit(),
QLatin1String("showDoneInfo"));
QStringLiteral("showDoneInfo"));
if ( ret == KMessageBox::No ) // quit
qApp->quit();
......@@ -746,7 +746,7 @@ void Archiver::finishSlice()
// copy to have the archive for the script later down
job = KIO::copy(source, target, KIO::DefaultFlags);
connect(job, SIGNAL(result(KJob *)), this, SLOT(slotResult(KJob *)));
connect(job.data(), &KJob::result, this, &Archiver::slotResult);
emit logging(i18n("...uploading archive %1 to %2", source.fileName(), target.toString()));
......@@ -912,7 +912,7 @@ bool Archiver::getNextSlice()
if ( baseName.isEmpty() )
{
QString prefix = filePrefix.isEmpty() ? QString::fromLatin1("backup") : filePrefix;
QString prefix = filePrefix.isEmpty() ? QStringLiteral("backup") : filePrefix;
if ( targetURL.isLocalFile() )
baseName = targetURL.path() + QStringLiteral("/") + prefix + QDateTime::currentDateTime().toString(QStringLiteral("_yyyy.MM.dd-hh.mm.ss"));
......
......@@ -29,28 +29,28 @@ MainWidget::MainWidget(QWidget *parent)
ui.cancelButton->setIcon(SmallIcon(QStringLiteral("kbackup_cancel"), 22));
ui.folder->setIcon(SmallIcon(QStringLiteral("folder")));
connect(ui.startButton, SIGNAL(clicked()), this, SLOT(startBackup()));
connect(ui.cancelButton, SIGNAL(clicked()), Archiver::instance, SLOT(cancel()));
connect(ui.startButton, &QAbstractButton::clicked, this, &MainWidget::startBackup);
connect(ui.cancelButton, &QAbstractButton::clicked, Archiver::instance, &Archiver::cancel);
connect(ui.forceFullBackup, SIGNAL(clicked(bool)), Archiver::instance, SLOT(setForceFullBackup(bool)));
connect(ui.forceFullBackup, &QAbstractButton::clicked, Archiver::instance, &Archiver::setForceFullBackup);
connect(Archiver::instance, SIGNAL(logging(const QString &)), ui.log, SLOT(append(const QString &)));
connect(Archiver::instance, SIGNAL(warning(const QString &)), ui.warnings, SLOT(append(const QString &)));
connect(Archiver::instance, &Archiver::logging, ui.log, &QTextEdit::append);
connect(Archiver::instance, &Archiver::warning, ui.warnings, &QTextEdit::append);
connect(Archiver::instance, SIGNAL(targetCapacity(KIO::filesize_t)), this, SLOT(setCapacity(KIO::filesize_t)));
connect(Archiver::instance, &Archiver::targetCapacity, this, &MainWidget::setCapacity);
connect(Archiver::instance, SIGNAL(totalFilesChanged(int)), ui.totalFiles, SLOT(setNum(int)));
connect(Archiver::instance, SIGNAL(totalBytesChanged(KIO::filesize_t)), this, SLOT(updateTotalBytes()));
connect(Archiver::instance, &Archiver::totalBytesChanged, this, &MainWidget::updateTotalBytes);
connect(Archiver::instance, SIGNAL(sliceProgress(int)), ui.progressSlice, SLOT(setValue(int)));
connect(Archiver::instance, &Archiver::sliceProgress, ui.progressSlice, &QProgressBar::setValue);
connect(Archiver::instance, SIGNAL(newSlice(int)), ui.sliceNum, SLOT(setNum(int)));
connect(Archiver::instance, SIGNAL(fileProgress(int)), this, SLOT(setFileProgress(int)));
connect(Archiver::instance, SIGNAL(elapsedChanged(const QTime &)), this, SLOT(updateElapsed(const QTime &)));
connect(Archiver::instance, &Archiver::fileProgress, this, &MainWidget::setFileProgress);
connect(Archiver::instance, &Archiver::elapsedChanged, this, &MainWidget::updateElapsed);
connect(Archiver::instance, SIGNAL(backupTypeChanged(bool)), this, SLOT(setIsIncrementalBackup(bool)));
connect(Archiver::instance, &Archiver::backupTypeChanged, this, &MainWidget::setIsIncrementalBackup);
connect(ui.folder, SIGNAL(clicked()), this, SLOT(getMediaSize()));
connect(ui.folder, &QAbstractButton::clicked, this, &MainWidget::getMediaSize);
connect(ui.targetDir, SIGNAL(returnPressed(const QString &)), this, SLOT(setTargetURL(const QString &)));
KUrlCompletion *kc = new KUrlCompletion(KUrlCompletion::DirCompletion);
......
......@@ -106,9 +106,9 @@ MainWindow::MainWindow()
// save/restore window settings and size
setAutoSaveSettings();
connect(Archiver::instance, SIGNAL(totalFilesChanged(int)), this, SLOT(changeSystrayTip()));
connect(Archiver::instance, SIGNAL(logging(const QString &)), this, SLOT(loggingSlot(const QString &)));
connect(Archiver::instance, SIGNAL(inProgress(bool)), this, SLOT(inProgress(bool)));
connect(Archiver::instance, &Archiver::totalFilesChanged, this, &MainWindow::changeSystrayTip);
connect(Archiver::instance, &Archiver::logging, this, &MainWindow::loggingSlot);
connect(Archiver::instance, &Archiver::inProgress, this, &MainWindow::inProgress);
startBackupAction = actionCollection()->addAction(QStringLiteral("startBackup"), mainWidget, SLOT(startBackup()));
startBackupAction->setIcon(QIcon::fromTheme(QStringLiteral("kbackup_start")));
......@@ -132,7 +132,7 @@ MainWindow::MainWindow()
void MainWindow::runBackup()
{
autorun = true;
QTimer::singleShot(0, mainWidget, SLOT(startBackup()));
QTimer::singleShot(0, mainWidget, &MainWidget::startBackup);
}
//--------------------------------------------------------------------------------
......@@ -355,7 +355,7 @@ void MainWindow::changeSystrayTip()
QString::number(Archiver::instance->getTotalBytes() / 1024.0 / 1024.0, 'f', 2),
KStringHandler::csqueeze(lastLog, 60));
sysTray->setToolTip(QLatin1String("kbackup"), QLatin1String("kbackup"), text);
sysTray->setToolTip(QStringLiteral("kbackup"), QStringLiteral("kbackup"), text);
}
//--------------------------------------------------------------------------------
......
......@@ -31,7 +31,7 @@ void sigHandler(int sig)
{
Q_UNUSED(sig)
QTimer::singleShot(0, Archiver::instance, SLOT(cancel()));
QTimer::singleShot(0, Archiver::instance, &Archiver::cancel);
QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment