krazy2 fixes

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1160573
This commit is contained in:
Volker Lanz 2010-08-08 12:36:05 +00:00
parent 6e582dd236
commit c4d159e6c5
14 changed files with 18 additions and 15 deletions

View File

@ -93,7 +93,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="kcfg_preferredUnit">
<widget class="KComboBox" name="kcfg_preferredUnit">
<item>
<property name="text">
<string>Byte</string>

View File

@ -64,7 +64,7 @@ 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 physicalSectorSize() const { return m_PhysicalSectorSize; } /**< @return the phyiscal sector size the Device uses or -1 if unknown */
qint32 physicalSectorSize() const { return m_PhysicalSectorSize; } /**< @return the physical sector size the Device uses or -1 if unknown */
qint32 logicalSectorSize() const { return m_LogicalSectorSize; } /**< @return the logical sector size the Device uses */
qint64 totalSectors() const { return static_cast<qint64>(heads()) * cylinders() * sectorsPerTrack(); } /**< @return the total number of sectors on the device */
qint64 capacity() const { return totalSectors() * logicalSectorSize(); } /**< @return the Device's capacity in bytes */

View File

@ -17,6 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#if !defined(MOUNTENTRY__H)
#define MOUNTENTRY__H
#include <QString>
#include <QStringList>
#include <qglobal.h>
@ -42,3 +46,4 @@ class MountEntry
IdentifyType identifyType;
};
#endif

View File

@ -46,7 +46,7 @@ class FileSystem
class SupportTool
{
public:
SupportTool(const QString& n = QString(), const KUrl& u = KUrl()) : name(n), url(u) {}
explicit SupportTool(const QString& n = QString(), const KUrl& u = KUrl()) : name(n), url(u) {}
const QString name;
const KUrl url;

View File

@ -48,7 +48,6 @@
#include <kio/netaccess.h>
#include <kio/jobuidelegate.h>
#include <kio/copyjob.h>
#include <ktemporaryfile.h>
const QString ApplyProgressDialog::m_TimeFormat = "hh:mm:ss";

View File

@ -66,4 +66,5 @@ void CreatePartitionTableDialog::onMSDOSToggled(bool on)
widget().radioGPT().setChecked(true);
}
}
}
}

View File

@ -200,7 +200,7 @@ bool EditMountPointDialogWidget::readMountpoints(const QString& filename)
type = MountEntry::label;
device = findBlkIdDevice("LABEL", QString(device).remove("LABEL="));
}
else if (device.startsWith("/"))
else if (device.startsWith('/'))
device = QFile::symLinkTarget(device);
if (!device.isEmpty())

View File

@ -759,7 +759,7 @@ void MainWindow::onImportPartitionTable()
QString fileName;
if (!KIO::NetAccess::download(url, fileName, this))
{
KMessageBox::error(this, i18nc("@info", "Could not open input file <filename>%1</filename> for import: %s", url.fileName(), KIO::NetAccess::lastErrorString()), i18nc("@title:window", "Error Importing Partition Table"));
KMessageBox::error(this, i18nc("@info", "Could not open input file <filename>%1</filename> for import: %2", url.fileName(), KIO::NetAccess::lastErrorString()), i18nc("@title:window", "Error Importing Partition Table"));
return;
}
@ -844,8 +844,8 @@ void MainWindow::onImportPartitionTable()
qint64 lastSector = rxPartition.cap(3).toLongLong();
QString fsName = rxPartition.cap(4);
QString roleNames = rxPartition.cap(5);
QString volumeLabel = rxPartition.cap(6).replace('"', "");
QStringList flags = rxPartition.cap(7).replace('"', "").split(',');
QString volumeLabel = rxPartition.cap(6).replace('"', QString());
QStringList flags = rxPartition.cap(7).replace('"', QString()).split(',');
if (firstSector < ptable->firstUsable() || lastSector > ptable->lastUsable())
{

View File

@ -87,7 +87,7 @@ void PartResizerWidget::init(Device& d, Partition& p, qint64 minFirst, qint64 ma
setMinimumLength(qMax(partition().sectorsUsed(), partition().minimumSectors()));
setMaximumLength(qMin(totalSectors(), partition().maximumSectors()));
// set margins to accomodate for top/bottom button asymmetric layouts
// set margins to accommodate to top/bottom button asymmetric layouts
QStyleOptionButton bOpt;
bOpt.initFrom(this);

View File

@ -41,7 +41,7 @@ class PartWidget : public PartWidgetBase
Q_OBJECT
public:
PartWidget(QWidget* parent, const Partition* p = NULL);
explicit PartWidget(QWidget* parent, const Partition* p = NULL);
public:
void init(const Partition* p);

View File

@ -21,7 +21,6 @@
#include "gui/sizedetailswidget.h"
#include "gui/partresizerwidget.h"
#include "gui/sizedialogwidget.h"
#include "gui/sizedetailswidget.h"
#include "core/partitiontable.h"
#include "core/device.h"

View File

@ -40,7 +40,6 @@
#include <kicon.h>
#include <kglobalsettings.h>
#include <kglobal.h>
#include <klocale.h>
#include <QTreeWidgetItem>
#include <QTextStream>

View File

@ -519,7 +519,7 @@ FileSystem::Type LibPartedBackend::detectFileSystem(PedPartition* pedPartition)
else if (s == "ufs") rval = FileSystem::Ufs;
else if (s == "vfat" && pedPartition->fs_type != NULL)
{
// libblkid does not distinguish betweeen fat16 and fat32, so we're still using libparted
// libblkid does not distinguish between fat16 and fat32, so we're still using libparted
// for those
if (strcmp(pedPartition->fs_type->name, "fat16") == 0)
rval = FileSystem::Fat16;

View File

@ -233,7 +233,7 @@ QList<Solid::Device> getSolidDeviceList()
if (args->count() > 1)
predicate += "] ";
predicate += "]";
predicate += ']';
}
kDebug() << predicate;