Align a partition if it's newly created (or inserted), the one it replaces
was not aligned and aligning is on. svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115135
This commit is contained in:
parent
ee40f89db7
commit
ca76d30c3d
|
@ -19,8 +19,10 @@
|
|||
|
||||
#include "gui/insertdialog.h"
|
||||
#include "gui/sizedialogwidget.h"
|
||||
#include "gui/sizedetailswidget.h"
|
||||
|
||||
#include "core/partition.h"
|
||||
#include "core/partitionalignment.h"
|
||||
|
||||
#include "fs/filesystem.h"
|
||||
|
||||
|
@ -62,6 +64,14 @@ InsertDialog::~InsertDialog()
|
|||
saveDialogSize(kcg);
|
||||
}
|
||||
|
||||
void InsertDialog::setupDialog()
|
||||
{
|
||||
if (detailsWidget().checkAlign().isChecked())
|
||||
PartitionAlignment::alignPartition(device(), partition());
|
||||
|
||||
SizeDialogBase::setupDialog();
|
||||
}
|
||||
|
||||
bool InsertDialog::canGrow() const
|
||||
{
|
||||
return ResizeOperation::canGrow(&partition());
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "gui/sizedialogbase.h"
|
||||
|
||||
|
||||
class Partition;
|
||||
class Device;
|
||||
|
||||
|
@ -44,6 +43,7 @@ class InsertDialog : public SizeDialogBase
|
|||
|
||||
protected:
|
||||
const Partition& destPartition() const { return m_DestPartition; }
|
||||
virtual void setupDialog();
|
||||
virtual bool canGrow() const;
|
||||
virtual bool canShrink() const { return false; }
|
||||
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
|
||||
#include "gui/newdialog.h"
|
||||
#include "gui/sizedialogwidget.h"
|
||||
#include "gui/sizedetailswidget.h"
|
||||
|
||||
#include "core/partition.h"
|
||||
#include "core/device.h"
|
||||
#include "core/partitionalignment.h"
|
||||
|
||||
#include "fs/filesystem.h"
|
||||
#include "fs/filesystemfactory.h"
|
||||
|
@ -60,6 +62,9 @@ NewDialog::~NewDialog()
|
|||
|
||||
void NewDialog::setupDialog()
|
||||
{
|
||||
if (detailsWidget().checkAlign().isChecked())
|
||||
PartitionAlignment::alignPartition(device(), partition());
|
||||
|
||||
QStringList fsNames;
|
||||
foreach (const FileSystem* fs, FileSystemFactory::map())
|
||||
if (fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended)
|
||||
|
|
Loading…
Reference in New Issue