Commit fd44ee34 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

options: volume size is an unsigned long

GIT_SILENT
parent f52e0a3f
......@@ -40,7 +40,7 @@ CliProperties::CliProperties(QObject *parent, const KPluginMetaData &metaData, c
{
}
QStringList CliProperties::addArgs(const QString &archive, const QStringList &files, const QString &password, bool headerEncryption, int compressionLevel, const QString &compressionMethod, const QString &encryptionMethod, uint volumeSize)
QStringList CliProperties::addArgs(const QString &archive, const QStringList &files, const QString &password, bool headerEncryption, int compressionLevel, const QString &compressionMethod, const QString &encryptionMethod, ulong volumeSize)
{
if (!encryptionMethod.isEmpty()) {
Q_ASSERT(!password.isEmpty());
......@@ -270,7 +270,7 @@ QString CliProperties::substituteEncryptionMethodSwitch(const QString &method) c
return encMethodSwitch;
}
QString CliProperties::substituteMultiVolumeSwitch(uint volumeSize) const
QString CliProperties::substituteMultiVolumeSwitch(ulong volumeSize) const
{
// The maximum value we allow in the QDoubleSpinBox is 1000MB. Converted to
// KB this is 1024000.
......
......@@ -85,7 +85,7 @@ public:
int compressionLevel,
const QString &compressionMethod,
const QString &encryptionMethod,
uint volumeSize);
ulong volumeSize);
QStringList commentArgs(const QString &archive, const QString &commentfile);
QStringList deleteArgs(const QString &archive, const QVector<Archive::Entry*> &files, const QString &password);
QStringList extractArgs(const QString &archive, const QStringList &files, bool preservePaths, const QString &password);
......@@ -107,7 +107,7 @@ private:
QString substituteCompressionLevelSwitch(int level) const;
QString substituteCompressionMethodSwitch(const QString &method) const;
QString substituteEncryptionMethodSwitch(const QString &method) const;
QString substituteMultiVolumeSwitch(uint volumeSize) const;
QString substituteMultiVolumeSwitch(ulong volumeSize) const;
QString m_addProgram;
QString m_deleteProgram;
......
......@@ -94,7 +94,7 @@ ulong CompressionOptionsWidget::volumeSize() const
{
if (collapsibleMultiVolume->isEnabled() && multiVolumeCheckbox->isChecked()) {
// Convert to kilobytes.
return volumeSizeSpinbox->value() * 1024;
return static_cast<ulong>(volumeSizeSpinbox->value()) * 1024;
} else {
return 0;
}
......
......@@ -90,12 +90,12 @@ void CompressionOptions::setCompressionLevel(int level)
m_compressionLevel = level;
}
int CompressionOptions::volumeSize() const
ulong CompressionOptions::volumeSize() const
{
return m_volumeSize;
}
void CompressionOptions::setVolumeSize(int size)
void CompressionOptions::setVolumeSize(ulong size)
{
m_volumeSize = size;
}
......
......@@ -67,8 +67,8 @@ public:
int compressionLevel() const;
void setCompressionLevel(int level);
int volumeSize() const;
void setVolumeSize(int size);
ulong volumeSize() const;
void setVolumeSize(ulong size);
QString compressionMethod() const;
void setCompressionMethod(const QString &method);
QString encryptionMethod() const;
......@@ -78,7 +78,7 @@ public:
private:
int m_compressionLevel = -1;
int m_volumeSize = 0;
ulong m_volumeSize = 0;
QString m_compressionMethod;
QString m_encryptionMethod;
QString m_globalWorkDir;
......
......@@ -1368,7 +1368,7 @@ void Part::slotAddFiles()
m_compressionOptions.setEncryptionMethod(arguments().metaData()[QStringLiteral("encryptionMethod")]);
}
if (!m_compressionOptions.isVolumeSizeSet() && arguments().metaData().contains(QStringLiteral("volumeSize"))) {
m_compressionOptions.setVolumeSize(arguments().metaData()[QStringLiteral("volumeSize")].toInt());
m_compressionOptions.setVolumeSize(arguments().metaData()[QStringLiteral("volumeSize")].toULong());
}
const auto compressionMethods = m_model->archive()->property("compressionMethods").toStringList();
......
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