turns out which sector alignment is used on import is determined by the app

wide default in the settings. well. for now, include the information in the
export, but ignore it on import.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113752
This commit is contained in:
Volker Lanz 2010-04-11 17:16:43 +00:00
parent 34f7a37010
commit cf9ecebd1f
3 changed files with 8 additions and 5 deletions

3
TODO
View File

@ -9,9 +9,6 @@ Plans and ideas for 1.1:
* don't hardcode any support for libparted-related stuff like shrinking fat16
in the file system classes.
* import/export must save the partition alignment used for msdos tables and use
this on import
===============================================================================
Bugs to fix for 1.1:

View File

@ -689,8 +689,9 @@ static bool isPartitionLessThan(const Partition* p1, const Partition* p2)
QTextStream& operator<<(QTextStream& stream, const PartitionTable& ptable)
{
stream << "type: \"" << ptable.typeName() << "\"\n\n"
<< "# number start end type roles label flags\n";
stream << "type: \"" << ptable.typeName() << "\"\n"
<< "align: \"" << (ptable.type() == PartitionTable::msdos ? "cylinder" : "sector") << "\"\n"
<< "\n# number start end type roles label flags\n";
QList<const Partition*> partitions;

View File

@ -755,6 +755,7 @@ void MainWindow::onImportPartitionTable()
QByteArray line;
QRegExp rxPartition("(\\d+);(\\d+);(\\d+);(\\w+);(\\w+);(\"\\w*\");(\"[^\"]*\")");
QRegExp rxType("type:\\s\"(.+)\"");
QRegExp rxAlign("align:\\s\"(cylinder|sector)\"");
QRegExp rxMagic("^##|v(\\d+)|##");
quint32 lineNo = 0;
bool haveMagic = false;
@ -805,6 +806,10 @@ void MainWindow::onImportPartitionTable()
ptable = new PartitionTable(tableType, PartitionTable::defaultFirstUsable(device, tableType), PartitionTable::defaultLastUsable(device, tableType));
operationStack().push(new CreatePartitionTableOperation(device, ptable));
}
else if (rxAlign.indexIn(line) != -1)
{
// currently ignored
}
else if (rxPartition.indexIn(line) != -1)
{
if (ptable == NULL)