From 763d88a96d43403def55a7aa29a8dc3ad8eaf956 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 16 May 2024 03:34:03 +0300 Subject: [PATCH] ark: remove redundant kDebug() calls log nothing Signed-off-by: Ivailo Monev --- ark/app/batchextract.cpp | 2 - ark/kerfuffle/addtoarchive.cpp | 8 +-- ark/kerfuffle/archiveinterface.cpp | 9 ++-- ark/kerfuffle/jobs.cpp | 1 - ark/kerfuffle/queries.cpp | 12 ++--- ark/part/archivemodel.cpp | 1 - ark/part/archiveview.cpp | 1 - ark/part/part.cpp | 54 ++++++++----------- .../libsinglefileplugin/singlefileplugin.cpp | 2 - 9 files changed, 33 insertions(+), 57 deletions(-) diff --git a/ark/app/batchextract.cpp b/ark/app/batchextract.cpp index e8a21db4..a5054c9d 100644 --- a/ark/app/batchextract.cpp +++ b/ark/app/batchextract.cpp @@ -154,8 +154,6 @@ void BatchExtract::showFailedFiles() void BatchExtract::slotResult(KJob *job) { - kDebug(); - // TODO: The user must be informed about which file caused the error, and that the other files // in the queue will not be extracted. if (job->error()) { diff --git a/ark/kerfuffle/addtoarchive.cpp b/ark/kerfuffle/addtoarchive.cpp index eb27d8b8..b47e0897 100644 --- a/ark/kerfuffle/addtoarchive.cpp +++ b/ark/kerfuffle/addtoarchive.cpp @@ -118,10 +118,8 @@ void AddToArchive::start() QTimer::singleShot(0, this, SLOT(slotStartJob())); } -void AddToArchive::slotStartJob(void) +void AddToArchive::slotStartJob() { - kDebug(); - Kerfuffle::CompressionOptions options; if (!m_inputs.size()) { @@ -205,9 +203,7 @@ void AddToArchive::slotStartJob(void) void AddToArchive::slotFinished(KJob *job) { - kDebug(); - - if (job->error()) { + if (job->error() != KJob::NoError) { KMessageBox::error(NULL, job->errorText()); } diff --git a/ark/kerfuffle/archiveinterface.cpp b/ark/kerfuffle/archiveinterface.cpp index ad1291bd..7cd8dbca 100644 --- a/ark/kerfuffle/archiveinterface.cpp +++ b/ark/kerfuffle/archiveinterface.cpp @@ -34,10 +34,9 @@ namespace Kerfuffle { -ReadOnlyArchiveInterface::ReadOnlyArchiveInterface(QObject *parent, const QVariantList & args) - : QObject(parent), m_waitForFinishedSignal(false) +ReadOnlyArchiveInterface::ReadOnlyArchiveInterface(QObject *parent, const QVariantList &args) + : QObject(parent), m_waitForFinishedSignal(false) { - kDebug(); m_filename = args.first().toString(); } @@ -145,8 +144,8 @@ QString ReadOnlyArchiveInterface::permissionsString(mode_t perm) return QString::fromLatin1(buffer); } -ReadWriteArchiveInterface::ReadWriteArchiveInterface(QObject *parent, const QVariantList & args) - : ReadOnlyArchiveInterface(parent, args) +ReadWriteArchiveInterface::ReadWriteArchiveInterface(QObject *parent, const QVariantList &args) + : ReadOnlyArchiveInterface(parent, args) { } diff --git a/ark/kerfuffle/jobs.cpp b/ark/kerfuffle/jobs.cpp index 9f72513f..9d51b7a3 100644 --- a/ark/kerfuffle/jobs.cpp +++ b/ark/kerfuffle/jobs.cpp @@ -167,7 +167,6 @@ void Job::onUserQuery(Query *query) bool Job::doKill() { - kDebug(); bool ret = archiveInterface()->doKill(); if (!ret) { kDebug() << "Killing does not seem to be supported here."; diff --git a/ark/kerfuffle/queries.cpp b/ark/kerfuffle/queries.cpp index 5ce15ccc..d32a48bc 100644 --- a/ark/kerfuffle/queries.cpp +++ b/ark/kerfuffle/queries.cpp @@ -49,9 +49,7 @@ QVariant Query::response() void Query::waitForResponse() { - kDebug(); - - //if there is no response set yet, wait + // if there is no response set yet, wait if (!m_data.contains(QLatin1String("response"))) { m_responseCondition.wait(&m_responseMutex); } @@ -60,15 +58,13 @@ void Query::waitForResponse() void Query::setResponse(QVariant response) { - kDebug(); - m_data[QLatin1String( "response" )] = response; m_responseCondition.wakeAll(); } -OverwriteQuery::OverwriteQuery(const QString &filename) : - m_noRenameMode(false), - m_multiMode(true) +OverwriteQuery::OverwriteQuery(const QString &filename) + : m_noRenameMode(false), + m_multiMode(true) { m_data[QLatin1String( "filename" )] = filename; } diff --git a/ark/part/archivemodel.cpp b/ark/part/archivemodel.cpp index 17534300..c3e66f08 100644 --- a/ark/part/archivemodel.cpp +++ b/ark/part/archivemodel.cpp @@ -947,7 +947,6 @@ DeleteJob* ArchiveModel::deleteFiles(const QList & files) void ArchiveModel::slotCleanupEmptyDirs() { - kDebug(); QList queue; QList nodesToDelete; diff --git a/ark/part/archiveview.cpp b/ark/part/archiveview.cpp index c4673407..2de6aed3 100644 --- a/ark/part/archiveview.cpp +++ b/ark/part/archiveview.cpp @@ -73,7 +73,6 @@ void ArchiveView::slotDoubleClicked(const QModelIndex& index) void ArchiveView::setModel(QAbstractItemModel *model) { - kDebug(); QTreeView::setModel(model); setSelectionMode(QAbstractItemView::ExtendedSelection); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); diff --git a/ark/part/part.cpp b/ark/part/part.cpp index 86bd62d8..7e04b9b6 100644 --- a/ark/part/part.cpp +++ b/ark/part/part.cpp @@ -497,9 +497,7 @@ void Part::slotLoadingStarted() void Part::slotLoadingFinished(KJob *job) { - kDebug(); - - if (job->error()) { + if (job->error() != KJob::NoError) { if (arguments().metaData()[QLatin1String( "createNewArchive" )] != QLatin1String( "true" )) { KMessageBox::sorry(NULL, i18nc("@info", "Loading the archive %1 failed with the following error: %2", localFilePath(), job->errorText()), i18nc("@title:window", "Error Opening Archive")); @@ -524,7 +522,6 @@ void Part::slotLoadingFinished(KJob *job) void Part::setReadyGui() { - kDebug(); QApplication::restoreOverrideCursor(); m_busy = false; m_view->setEnabled(true); @@ -533,7 +530,6 @@ void Part::setReadyGui() void Part::setBusyGui() { - kDebug(); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); m_busy = true; m_view->setEnabled(false); @@ -741,8 +737,7 @@ QList Part::selectedFiles() void Part::slotExtractionDone(KJob* job) { - kDebug(); - if (job->error()) { + if (job->error() != KJob::NoError) { KMessageBox::error(widget(), job->errorString()); } else { ExtractJob *extractJob = qobject_cast(job); @@ -766,8 +761,6 @@ void Part::slotExtractionDone(KJob* job) void Part::adjustColumns() { - kDebug(); - m_view->header()->setResizeMode(0, QHeaderView::ResizeToContents); } @@ -814,8 +807,6 @@ void Part::slotAddFiles(const QStringList& filesToAdd, const QString& path) void Part::slotAddFiles() { - kDebug(); - // #264819: passing widget() as the parent will not work as expected. // KFileDialog will create a KFileWidget, which runs an internal // event loop to stat the given directory. This, in turn, leads to @@ -825,18 +816,22 @@ void Part::slotAddFiles() // non-modal state). // When KFileDialog::exec() is called, the widget is already shown // and nothing happens. - const QStringList filesToAdd = - KFileDialog::getOpenFileNames(KUrl("kfiledialog:///ArkAddFiles"), - QString(), widget()->parentWidget(), - i18nc("@title:window", "Add Files")); + const QStringList filesToAdd = KFileDialog::getOpenFileNames( + KUrl("kfiledialog:///ArkAddFiles"), + QString(), widget()->parentWidget(), + i18nc("@title:window", "Add Files") + ); slotAddFiles(filesToAdd); } void Part::slotAddDir() { - kDebug(); - const QString dirToAdd = KFileDialog::getExistingDirectory(KUrl("kfiledialog:///ArkAddFiles"), widget(), i18nc("@title:window", "Add Folder")); + const QString dirToAdd = KFileDialog::getExistingDirectory( + KUrl("kfiledialog:///ArkAddFiles"), + widget(), + i18nc("@title:window", "Add Folder") + ); if (!dirToAdd.isEmpty()) { slotAddFiles(QStringList() << dirToAdd); @@ -845,32 +840,29 @@ void Part::slotAddDir() void Part::slotAddFilesDone(KJob* job) { - kDebug(); - if (job->error()) { + if (job->error() != KJob::NoError) { KMessageBox::error(widget(), job->errorString()); } } void Part::slotDeleteFilesDone(KJob* job) { - kDebug(); - if (job->error()) { + if (job->error() != KJob::NoError) { KMessageBox::error(widget(), job->errorString()); } } void Part::slotDeleteFiles() { - kDebug(); - - const int reallyDelete = - KMessageBox::questionYesNo(NULL, - i18n("Deleting these files is not undoable. Are you sure you want to do this?"), - i18nc("@title:window", "Delete files"), - KStandardGuiItem::del(), - KStandardGuiItem::cancel(), - QString(), - KMessageBox::Dangerous | KMessageBox::Notify); + const int reallyDelete = KMessageBox::questionYesNo( + NULL, + i18n("Deleting these files is not undoable. Are you sure you want to do this?"), + i18nc("@title:window", "Delete files"), + KStandardGuiItem::del(), + KStandardGuiItem::cancel(), + QString(), + KMessageBox::Dangerous | KMessageBox::Notify + ); if (reallyDelete == KMessageBox::No) { return; diff --git a/ark/plugins/libsinglefileplugin/singlefileplugin.cpp b/ark/plugins/libsinglefileplugin/singlefileplugin.cpp index 0bd40fa3..00c73c17 100644 --- a/ark/plugins/libsinglefileplugin/singlefileplugin.cpp +++ b/ark/plugins/libsinglefileplugin/singlefileplugin.cpp @@ -108,8 +108,6 @@ bool LibSingleFileInterface::copyFiles(const QList &files, const QStri bool LibSingleFileInterface::list() { - kDebug(); - const QString filename = uncompressedFileName(); Kerfuffle::ArchiveEntry e;