Remove some debug output.

This commit is contained in:
Andrius Štikonas 2018-01-24 15:35:11 +00:00
parent e42a5c9289
commit 61fed73a5d
3 changed files with 5 additions and 17 deletions

View File

@ -22,7 +22,7 @@
#include "jobs/job.h"
#include <QString>
#include <QDebug>
class Partition;
class Device;
class Report;

View File

@ -25,7 +25,6 @@
#include "util/externalcommand.h"
#include "util/report.h"
#include <QDebug>
#include <QEventLoop>
#include <QtGlobal>
#include <QStandardPaths>
@ -85,8 +84,6 @@ bool ExternalCommand::copyBlocks()
if (cmd.isEmpty())
cmd = QStandardPaths::findExecutable(QStringLiteral("dd"), { QStringLiteral("/sbin/"), QStringLiteral("/usr/sbin/"), QStringLiteral("/usr/local/sbin/") });
qDebug() << "ExternalCommand::copyBlocks\n";
KAuth::Action action(QStringLiteral("org.kde.kpmcore.externalcommand.copyblockshelper"));
action.setHelperId(QStringLiteral("org.kde.kpmcore.externalcommand"));
@ -118,7 +115,6 @@ bool ExternalCommand::copyBlocks()
m_Output = job->data()[QStringLiteral("output")].toByteArray();
setExitCode(job->data()[QStringLiteral("exitCode")].toInt());
qDebug() << "ExternalCommand::copyBlocks finished";
emit finished();
return true;
}

View File

@ -59,17 +59,14 @@ bool ExternalCommandHelper::writeData(QByteArray& buffer, qint64 offset)
return true;
}
qDebug() << "cmd exitCode "<<cmd.exitCode() << "\n";
qDebug() << "cmd exitCode " << cmd.exitCode() << "\n";
return false;
}
ActionReply ExternalCommandHelper::copyblockshelper(const QVariantMap& args)
{
qDebug() << "ExternalCommandHelper::copyBlocksHelper\n";
command = args[QStringLiteral("command")].toString();
qint64 blockSize = args[QStringLiteral("blockSize")].toInt();
qint64 blocksToCopy = args[QStringLiteral("blocksToCopy")].toInt();
qint64 readOffset = args[QStringLiteral("readOffset")].toInt();
@ -83,19 +80,15 @@ ActionReply ExternalCommandHelper::copyblockshelper(const QVariantMap& args)
QStringList environment = args[QStringLiteral("environment")].toStringList();
//qDebug() << command<< " " << sourceDevice <<" " << targetDevice << " blocksToCopy: " << blocksToCopy << " blockSize" << blockSize << " " << readOffset<<" "<<writeOffset<<" "<<environment<<"\n";
ActionReply reply;
//connect(&cmd, &QProcess::readyReadStandardOutput, this, &ExternalCommandHelper::onReadOutput);
QByteArray buffer;
cmd.setEnvironment(environment);
qint64 blocksCopied = 0;
//QByteArray buffer;
QByteArray buffer;
int percent = 0;
//QTime t;
bool rval = true;
@ -111,6 +104,7 @@ ActionReply ExternalCommandHelper::copyblockshelper(const QVariantMap& args)
if (++blocksCopied * 100 / blocksToCopy != percent) {
percent = blocksCopied * 100 / blocksToCopy;
// FIXME
//if (percent % 5 == 0 && t.elapsed() > 1000) {
// const qint64 mibsPerSec = (blocksCopied * blockSize / 1024 / 1024) / (t.elapsed() / 1000);
// const qint64 estSecsLeft = (100 - percent) * t.elapsed() / percent / 1000;
@ -135,10 +129,8 @@ ActionReply ExternalCommandHelper::copyblockshelper(const QVariantMap& args)
if (rval)
rval = writeData(buffer, lastBlockWriteOffset);
if (rval){
qDebug() << "Percent 100"<<"\n";
if (rval)
emit progress(100);
}
}