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 "jobs/job.h"
#include <QString> #include <QString>
#include <QDebug>
class Partition; class Partition;
class Device; class Device;
class Report; class Report;

View File

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

View File

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