Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 281289df authored by Shubham  .'s avatar Shubham . Committed by Caio Jordão Carvalho

Constantify nonce and some cleanup

Reviewers: stikonas, #kde_partition_manager, cjlcarvalho

Reviewed By: stikonas, #kde_partition_manager, cjlcarvalho

Subscribers: varunp, tctara, teo, abhijeet2096, caiovosilva, cjlcarvalho, #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D20108
parent 4986b514
......@@ -90,7 +90,7 @@ ActionReply ExternalCommandHelper::init(const QVariantMap& args)
*/
quint64 ExternalCommandHelper::getNonce()
{
quint64 nonce = m_Generator.generate();
const quint64 nonce = m_Generator.generate();
m_Nonces.insert(nonce);
return nonce;
}
......@@ -135,6 +135,7 @@ bool ExternalCommandHelper::readData(const QString& sourceDevice, QByteArray& bu
bool ExternalCommandHelper::writeData(const QString &targetDevice, const QByteArray& buffer, const qint64 offset)
{
QFile device(targetDevice);
if (!device.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Unbuffered)) {
qCritical() << xi18n("Could not open device <filename>%1</filename> for writing.", targetDevice);
return false;
......@@ -149,6 +150,7 @@ bool ExternalCommandHelper::writeData(const QString &targetDevice, const QByteAr
qCritical() << xi18n("Could not write to device <filename>%1</filename>.", targetDevice);
return false;
}
return true;
}
......
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