Browse Source

Also rename source/targetFirstByte ot offsets in function declarations.

master
Andrius Štikonas 3 months ago
parent
commit
551654de0d
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      src/util/externalcommandhelper.cpp
  2. +2
    -2
      src/util/externalcommandhelper.h

+ 3
- 3
src/util/externalcommandhelper.cpp View File

@ -87,7 +87,7 @@ bool ExternalCommandHelper::readData(const QString& sourceDevice, QByteArray& bu
if (size != buffer.size()) {
qCritical() << xi18n("Could not read from device <filename>%1</filename>.", sourceDevice);
return false;
return false;
}
return true;
@ -274,7 +274,7 @@ QVariantMap ExternalCommandHelper::CopyBlocks(const QString& sourceDevice, const
return reply;
}
bool ExternalCommandHelper::WriteData(const QByteArray& buffer, const QString& targetDevice, const qint64 targetFirstByte)
bool ExternalCommandHelper::WriteData(const QByteArray& buffer, const QString& targetDevice, const qint64 targetOffset)
{
if (!isCallerAuthorized()) {
return false;
@ -283,7 +283,7 @@ bool ExternalCommandHelper::WriteData(const QByteArray& buffer, const QString& t
if ( targetDevice.left(5) != QStringLiteral("/dev/") )
return false;
return writeData(targetDevice, buffer, targetFirstByte);
return writeData(targetDevice, buffer, targetOffset);
}
QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStringList& arguments, const QByteArray& input, const int processChannelMode)


+ 2
- 2
src/util/externalcommandhelper.h View File

@ -37,8 +37,8 @@ public:
public Q_SLOTS:
Q_SCRIPTABLE QVariantMap RunCommand(const QString& command, const QStringList& arguments, const QByteArray& input, const int processChannelMode);
Q_SCRIPTABLE QVariantMap CopyBlocks(const QString& sourceDevice, const qint64 sourceFirstByte, const qint64 sourceLength, const QString& targetDevice, const qint64 targetFirstByte, const qint64 blockSize);
Q_SCRIPTABLE bool WriteData(const QByteArray& buffer, const QString& targetDevice, const qint64 targetFirstByte);
Q_SCRIPTABLE QVariantMap CopyBlocks(const QString& sourceDevice, const qint64 sourceOffset, const qint64 sourceLength, const QString& targetDevice, const qint64 targetOffset, const qint64 blockSize);
Q_SCRIPTABLE bool WriteData(const QByteArray& buffer, const QString& targetDevice, const qint64 targetOffset);
Q_SCRIPTABLE bool CreateFile(const QString& filePath, const QByteArray& fileContents);
private:


Loading…
Cancel
Save