Fix minor EBN issues

This commit is contained in:
Yuri Chornoivan 2019-12-09 18:09:53 +02:00 committed by Andrius Štikonas
parent 59269f63df
commit 62aaa90a29
Signed by: andrius
GPG Key ID: E2E5CD054CB9CD3E
26 changed files with 28 additions and 28 deletions

View File

@ -39,7 +39,7 @@ class Report;
class CoreBackendDevice
{
public:
CoreBackendDevice(const QString& deviceNode);
explicit CoreBackendDevice(const QString& deviceNode);
virtual ~CoreBackendDevice() {}
public:

View File

@ -36,7 +36,7 @@ class CopyTarget;
class CopySourceFile : public CopySource
{
public:
CopySourceFile(const QString& filename);
explicit CopySourceFile(const QString& filename);
public:
bool open() override;

View File

@ -34,7 +34,7 @@
class CopyTargetByteArray : public CopyTarget
{
public:
CopyTargetByteArray(QByteArray& array);
explicit CopyTargetByteArray(QByteArray& array);
public:
bool open() override {

View File

@ -36,7 +36,7 @@ class QString;
class CopyTargetFile : public CopyTarget
{
public:
CopyTargetFile(const QString& filename);
explicit CopyTargetFile(const QString& filename);
public:
bool open() override;

View File

@ -171,7 +171,7 @@ Partition* LvmDevice::scanPartition(const QString& lvPath, PartitionTable* pTabl
mountPoint = FileSystem::detectMountPoint(fs, lvPath);
mounted = FileSystem::detectMountStatus(fs, lvPath);
if (mountPoint != QString() && fs->type() != FileSystem::Type::LinuxSwap) {
if (!mountPoint.isEmpty() && fs->type() != FileSystem::Type::LinuxSwap) {
const QStorageInfo storage = QStorageInfo(mountPoint);
if (logicalSize() > 0 && fs->type() != FileSystem::Type::Luks && mounted && storage.isValid())
fs->setSectorsUsed( (storage.bytesTotal() - storage.bytesFree()) / logicalSize() );

View File

@ -48,7 +48,7 @@ class LIBKPMCORE_EXPORT LvmDevice : public VolumeManagerDevice
friend class VolumeManagerDevice;
public:
LvmDevice(const QString& name, const QString& iconName = QString());
explicit LvmDevice(const QString& name, const QString& iconName = QString());
~LvmDevice();
public:

View File

@ -51,7 +51,7 @@ public:
typedef QList<Operation*> Operations;
public:
OperationStack(QObject* parent = nullptr);
explicit OperationStack(QObject* parent = nullptr);
~OperationStack();
Q_SIGNALS:

View File

@ -36,7 +36,7 @@ public:
Recovery,
};
SoftwareRAID(const QString& name,
explicit SoftwareRAID(const QString& name,
SoftwareRAID::Status status = SoftwareRAID::Status::Active,
const QString& iconName = QString());

View File

@ -46,7 +46,7 @@ public:
};
public:
SmartAttribute(const SmartAttributeParsedData& a);
explicit SmartAttribute(const SmartAttributeParsedData& a);
public:
qint32 id() const {

View File

@ -32,7 +32,7 @@ class SmartDiskInformation;
class SmartParser
{
public:
SmartParser(const QString &device_path);
explicit SmartParser(const QString &device_path);
~SmartParser();
public:

View File

@ -57,7 +57,7 @@ public:
typedef QList<SmartAttribute> Attributes;
public:
SmartStatus(const QString &device_path);
explicit SmartStatus(const QString &device_path);
public:
void update();

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
*************************************************************************/
#include "core/device_p.h"
#include "core/volumemanagerdevice.h"
#include "core/volumemanagerdevice_p.h"
#include "core/device_p.h"
#include "core/lvmdevice.h"
#include "core/raid/softwareraid.h"

View File

@ -17,9 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
*************************************************************************/
#include "fs/filesystem.h"
#include "core/fstab.h"
#include "fs/filesystem.h"
#include "fs/lvm2_pv.h"
#include "backend/corebackend.h"
@ -174,7 +174,7 @@ bool FileSystem::detectMountStatus(FileSystem* fs, const QString& partitionPath)
bool mounted = false;
if (fs->type() == FileSystem::Type::Lvm2_PV) {
mounted = FS::lvm2_pv::getVGName(partitionPath) != QString();
mounted = !FS::lvm2_pv::getVGName(partitionPath).isEmpty();
} else {
mounted = isMounted(partitionPath);
}

View File

@ -45,7 +45,7 @@ class LIBKPMCORE_EXPORT PartResizerWidget : public QWidget
Q_DISABLE_COPY(PartResizerWidget)
public:
PartResizerWidget(QWidget* parent);
explicit PartResizerWidget(QWidget* parent);
public:
void init(Device& d, Partition& p, qint64 minFirst, qint64 maxLast, bool read_only = false, bool move_allowed = true);

View File

@ -32,7 +32,7 @@ class QString;
class CheckFileSystemJob : public Job
{
public:
CheckFileSystemJob(Partition& p);
explicit CheckFileSystemJob(Partition& p);
public:
bool run(Report& parent) override;

View File

@ -59,7 +59,7 @@ bool CreatePartitionJob::run(Report& parent)
if (backendPartitionTable) {
QString partitionPath = backendPartitionTable->createPartition(*report, partition());
if (partitionPath != QString()) {
if (!partitionPath.isEmpty()) {
rval = true;
partition().setPartitionPath(partitionPath);
partition().setState(Partition::State::None);

View File

@ -32,7 +32,7 @@ class QString;
class CreatePartitionTableJob : public Job
{
public:
CreatePartitionTableJob(Device& d);
explicit CreatePartitionTableJob(Device& d);
public:
bool run(Report& parent) override;

View File

@ -30,7 +30,7 @@ class QString;
class DeactivateLogicalVolumeJob : public Job
{
public:
DeactivateLogicalVolumeJob(const VolumeManagerDevice& dev, const QStringList lvPaths = {});
explicit DeactivateLogicalVolumeJob(const VolumeManagerDevice& dev, const QStringList lvPaths = {});
public:
bool run(Report& parent) override;

View File

@ -30,7 +30,7 @@ class QString;
class DeactivateVolumeGroupJob : public Job
{
public:
DeactivateVolumeGroupJob(VolumeManagerDevice& dev);
explicit DeactivateVolumeGroupJob(VolumeManagerDevice& dev);
public:
bool run(Report& parent) override;

View File

@ -39,7 +39,7 @@ class LIBKPMCORE_EXPORT DeactivateVolumeGroupOperation : public Operation
friend class OperationStack;
public:
DeactivateVolumeGroupOperation(VolumeManagerDevice& d);
explicit DeactivateVolumeGroupOperation(VolumeManagerDevice& d);
public:
QString iconName() const override {

View File

@ -37,7 +37,7 @@ class LIBKPMCORE_EXPORT RemoveVolumeGroupOperation : public Operation
friend class OperationStack;
public:
RemoveVolumeGroupOperation(VolumeManagerDevice& d);
explicit RemoveVolumeGroupOperation(VolumeManagerDevice& d);
public:
QString iconName() const override {

View File

@ -33,7 +33,7 @@ class DummyDevice : public CoreBackendDevice
Q_DISABLE_COPY(DummyDevice)
public:
DummyDevice(const QString& deviceNode);
explicit DummyDevice(const QString& deviceNode);
~DummyDevice();
public:

View File

@ -34,7 +34,7 @@ class SfdiskDevice : public CoreBackendDevice
Q_DISABLE_COPY(SfdiskDevice);
public:
SfdiskDevice(const Device& d);
explicit SfdiskDevice(const Device& d);
~SfdiskDevice();
public:

View File

@ -32,7 +32,7 @@ class Partition;
class SfdiskPartitionTable : public CoreBackendPartitionTable
{
public:
SfdiskPartitionTable(const Device *d);
explicit SfdiskPartitionTable(const Device *d);
~SfdiskPartitionTable();
public:

View File

@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
*************************************************************************/
#include "util/externalcommand.h"
#include "backend/corebackendmanager.h"
#include "core/device.h"
#include "core/copysource.h"
@ -24,7 +25,6 @@
#include "core/copysourcedevice.h"
#include "core/copytargetdevice.h"
#include "util/globallog.h"
#include "util/externalcommand.h"
#include "util/report.h"
#include "externalcommandhelper_interface.h"

View File

@ -17,8 +17,8 @@
// SPDX-License-Identifier: GPL-3.0+
#include "helpers.h"
#include "testdevice.h"
#include "helpers.h"
#include "backend/corebackend.h"
#include "backend/corebackendmanager.h"
@ -81,7 +81,7 @@ void TestDevice::testDeviceName()
exit(EXIT_FAILURE);
} else {
for (const auto &device : devices) {
if (device->name() == QString())
if (device->name().isEmpty())
exit(EXIT_FAILURE);
}
}