don't try to move a partition if first sector or last sector don't change

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114076
This commit is contained in:
Volker Lanz 2010-04-12 17:51:21 +00:00
parent f1bc4afde8
commit d349fbd591
1 changed files with 7 additions and 0 deletions

View File

@ -174,6 +174,10 @@ bool PartResizerWidget::movePartition(qint64 newFirstSector)
newFirstSector = minimumFirstSector();
qint64 delta = newFirstSector - partition().firstSector();
if (delta == 0)
return false;
qint64 newLastSector = partition().lastSector() + delta;
if (minimumLastSector() > -1 && newLastSector < minimumLastSector())
@ -190,6 +194,9 @@ bool PartResizerWidget::movePartition(qint64 newFirstSector)
newLastSector -= deltaLast;
}
if (newLastSector == partition().lastSector())
return false;
if (newLastSector - newFirstSector + 1 != partition().length() ||
(maximumFirstSector() > -1 && newFirstSector > maximumFirstSector()) ||
(minimumFirstSector() > -1 && newFirstSector < minimumFirstSector()) ||