From 2b50c604691831ad990bd1f0155848b7ef44344f Mon Sep 17 00:00:00 2001 From: Volker Lanz Date: Mon, 7 Jun 2010 13:10:55 +0000 Subject: [PATCH] rename Device::sectorSize() to Device::logicalSectorSize() svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1135506 --- src/core/copysourcedevice.cpp | 2 +- src/core/copytargetdevice.cpp | 2 +- src/core/device.h | 6 +++--- src/core/partition.cpp | 2 +- src/gui/devicepropsdialog.cpp | 2 +- src/gui/infopane.cpp | 2 +- src/jobs/backupfilesystemjob.cpp | 2 +- src/ops/resizeoperation.cpp | 6 +++--- src/ops/restoreoperation.cpp | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core/copysourcedevice.cpp b/src/core/copysourcedevice.cpp index b0fae2e..6873458 100644 --- a/src/core/copysourcedevice.cpp +++ b/src/core/copysourcedevice.cpp @@ -63,7 +63,7 @@ bool CopySourceDevice::open() */ qint32 CopySourceDevice::sectorSize() const { - return device().sectorSize(); + return device().logicalSectorSize(); } /** Returns the length of this CopySource diff --git a/src/core/copytargetdevice.cpp b/src/core/copytargetdevice.cpp index e14955d..c973854 100644 --- a/src/core/copytargetdevice.cpp +++ b/src/core/copytargetdevice.cpp @@ -58,7 +58,7 @@ bool CopyTargetDevice::open() /** @return the Device's sector size */ qint32 CopyTargetDevice::sectorSize() const { - return device().sectorSize(); + return device().logicalSectorSize(); } /** Writes the given number of sectors to the Device. diff --git a/src/core/device.h b/src/core/device.h index 13ede68..29042d3 100644 --- a/src/core/device.h +++ b/src/core/device.h @@ -56,7 +56,7 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT Device : public QObject public: bool operator==(const Device& other) const; bool operator!=(const Device& other) const; - + const QString& name() const { return m_Name; } /**< @return the Device's name, usually some manufacturer string */ const QString& deviceNode() const { return m_DeviceNode; } /**< @return the Device's node, for example "/dev/sda" */ PartitionTable* partitionTable() { return m_PartitionTable; } /**< @return the Device's PartitionTable */ @@ -64,9 +64,9 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT Device : public QObject qint32 heads() const { return m_Heads; } /**< @return the number of heads on the Device in CHS notation */ qint32 cylinders() const { return m_Cylinders; } /**< @return the number of cylinders on the Device in CHS notation */ qint32 sectorsPerTrack() const { return m_SectorsPerTrack; } /**< @return the number of sectors on the Device in CHS notation */ - qint32 sectorSize() const { return m_SectorSize; } /**< @return the sector size the Device claims to use */ + qint32 logicalSectorSize() const { return m_SectorSize; } /**< @return the logical sector size the Device uses */ qint64 totalSectors() const { return static_cast(heads()) * cylinders() * sectorsPerTrack(); } /**< @return the total number of sectors on the device */ - qint64 capacity() const { return totalSectors() * sectorSize(); } /**< @return the Device's capacity in bytes */ + qint64 capacity() const { return totalSectors() * logicalSectorSize(); } /**< @return the Device's capacity in bytes */ qint64 cylinderSize() const { return static_cast(heads()) * sectorsPerTrack(); } /**< @return the size of a cylinder on this Device in sectors */ void setIconName(const QString& name) { m_IconName = name; } diff --git a/src/core/partition.cpp b/src/core/partition.cpp index 2fecafd..69c42d4 100644 --- a/src/core/partition.cpp +++ b/src/core/partition.cpp @@ -62,7 +62,7 @@ Partition::Partition(PartitionNode* parent, const Device& device, const Partitio m_AvailableFlags(availableFlags), m_ActiveFlags(activeFlags), m_IsMounted(mounted), - m_SectorSize(device.sectorSize()), + m_SectorSize(device.logicalSectorSize()), m_State(state) { Q_ASSERT(m_Parent); diff --git a/src/gui/devicepropsdialog.cpp b/src/gui/devicepropsdialog.cpp index 29c56e6..53728db 100644 --- a/src/gui/devicepropsdialog.cpp +++ b/src/gui/devicepropsdialog.cpp @@ -105,7 +105,7 @@ void DevicePropsDialog::setupDialog() dialogWidget().cylinderSize().setText(i18ncp("@label", "1 Sector", "%1 Sectors", device().cylinderSize())); dialogWidget().primariesMax().setText(maxPrimaries); - dialogWidget().sectorSize().setText(Capacity(device().sectorSize()).toString(Capacity::Byte, Capacity::AppendUnit)); + dialogWidget().sectorSize().setText(Capacity(device().logicalSectorSize()).toString(Capacity::Byte, Capacity::AppendUnit)); dialogWidget().totalSectors().setText(KGlobal::locale()->formatNumber(device().totalSectors(), 0)); dialogWidget().type().setText(type); diff --git a/src/gui/infopane.cpp b/src/gui/infopane.cpp index cf5c250..c013302 100644 --- a/src/gui/infopane.cpp +++ b/src/gui/infopane.cpp @@ -151,7 +151,7 @@ void InfoPane::showDevice(Qt::DockWidgetArea area, const Device& d) createLabels(i18nc("@label device", "Heads:"), QString::number(d.heads()), cols(area), x, y); createLabels(i18nc("@label device", "Cylinders:"), KGlobal::locale()->formatNumber(d.cylinders(), 0), cols(area), x, y); createLabels(i18nc("@label device", "Sectors:"), KGlobal::locale()->formatNumber(d.sectorsPerTrack(), 0), cols(area), x, y); - createLabels(i18nc("@label device", "Logical sector size:"), Capacity(d.sectorSize()).toString(Capacity::Byte, Capacity::AppendUnit), cols(area), x, y); + createLabels(i18nc("@label device", "Logical sector size:"), Capacity(d.logicalSectorSize()).toString(Capacity::Byte, Capacity::AppendUnit), cols(area), x, y); createLabels(i18nc("@label device", "Cylinder size:"), i18ncp("@label", "1 Sector", "%1 Sectors", d.cylinderSize()), cols(area), x, y); createLabels(i18nc("@label device", "Primaries/Max:"), maxPrimaries, cols(area), x, y); } diff --git a/src/jobs/backupfilesystemjob.cpp b/src/jobs/backupfilesystemjob.cpp index ce97bc6..4af6db2 100644 --- a/src/jobs/backupfilesystemjob.cpp +++ b/src/jobs/backupfilesystemjob.cpp @@ -59,7 +59,7 @@ bool BackupFileSystemJob::run(Report& parent) else if (sourcePartition().fileSystem().supportBackup() == FileSystem::cmdSupportCore) { CopySourceDevice copySource(sourceDevice(), sourcePartition().fileSystem().firstSector(), sourcePartition().fileSystem().lastSector()); - CopyTargetFile copyTarget(fileName(), sourceDevice().sectorSize()); + CopyTargetFile copyTarget(fileName(), sourceDevice().logicalSectorSize()); if (!copySource.open()) report->line() << i18nc("@info/plain", "Could not open file system on source partition %1 for backup.", sourcePartition().deviceNode()); diff --git a/src/ops/resizeoperation.cpp b/src/ops/resizeoperation.cpp index 303c259..34cbf86 100644 --- a/src/ops/resizeoperation.cpp +++ b/src/ops/resizeoperation.cpp @@ -200,10 +200,10 @@ QString ResizeOperation::description() const // Each of these needs a different description. And for reasons of i18n, we cannot // just concatenate strings together... - const QString moveDelta = Capacity(qAbs(newFirstSector() - origFirstSector()) * targetDevice().sectorSize()).toString(); + const QString moveDelta = Capacity(qAbs(newFirstSector() - origFirstSector()) * targetDevice().logicalSectorSize()).toString(); - const QString origCapacity = Capacity(origLength() * targetDevice().sectorSize()).toString(); - const QString newCapacity = Capacity(newLength() * targetDevice().sectorSize()).toString(); + const QString origCapacity = Capacity(origLength() * targetDevice().logicalSectorSize()).toString(); + const QString newCapacity = Capacity(newLength() * targetDevice().logicalSectorSize()).toString(); switch(resizeAction()) { diff --git a/src/ops/restoreoperation.cpp b/src/ops/restoreoperation.cpp index ddeaa94..cf4ef81 100644 --- a/src/ops/restoreoperation.cpp +++ b/src/ops/restoreoperation.cpp @@ -228,7 +228,7 @@ Partition* RestoreOperation::createRestorePartition(const Device& device, Partit if (!fileInfo.exists()) return NULL; - const qint64 end = start + fileInfo.size() / device.sectorSize() - 1; + const qint64 end = start + fileInfo.size() / device.logicalSectorSize() - 1; Partition* p = new Partition(&parent, device, PartitionRole(r), FileSystemFactory::create(FileSystem::Unknown, start, end), start, end, -1); p->setState(Partition::StateRestore);