Bug 400331

Summary: partition flags are not imported
Product: [Applications] partitionmanager Reporter: Christoph Vogtländer <kde>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Christoph Vogtländer 2018-10-26 11:49:46 UTC
Importing an exported partition table will not set "flag" attributes.


STEPS TO REPRODUCE
1. Device -> Export Partition Table: save file
2. Device -> Import Partition Table: load file (might fail completely due to Bug 400330)


OBSERVED RESULT
only the partition table, partition type, label and size are imported. "Flags" (like "boot") are not present.

EXPECTED RESULT
Flags should be restored

SOFTWARE VERSIONS
(available in About System)
partitionmanager: 3.3.1
KPMcore: 3.3.0
KDE Plasma Version: 5.14.1
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Content of my exported partition table file (8GB SD-card):
##|v1|## partition table of /dev/sdd
# on Wednesday, 10 October 2018 11:06:58 CEST
type: "msdos"
align: "sector"

# number start end type roles label flags
1;2048;1050623;fat32;primary;"";"boot"
2;1050624;15325183;ext4;primary;"";""
Comment 1 Andrius Štikonas 2018-10-27 18:25:30 UTC
Thanks for reporting this.

Looks like flags are read from file and then that variable is unused.

Not sure why, maybe it was forgotten...
Comment 2 Andrius Štikonas 2019-02-28 00:15:35 UTC
Git commit 92065f7a23cf83a52a82d87c1b4002c8e233a8cc by Andrius Štikonas.
Committed on 28/02/2019 at 00:15.
Pushed by stikonas into branch 'master'.

Add a function to convert QStringList of flag names to flags.

M  +14   -0    src/core/partitiontable.cpp
M  +1    -0    src/core/partitiontable.h

https://invent.kde.org/kde/kpmcore/commit/92065f7a23cf83a52a82d87c1b4002c8e233a8cc
Comment 3 Andrius Štikonas 2019-02-28 00:17:59 UTC
Git commit a6861bf202a60462dd8063064749417b07df4117 by Andrius Štikonas.
Committed on 28/02/2019 at 00:16.
Pushed by stikonas into branch 'master'.

When importing partition table, pass the flags to Partition class.

Note, this is not enough for flags to work. We need to run a job to set flags.

M  +1    -1    src/gui/mainwindow.cpp

https://invent.kde.org/kde/partitionmanager/commit/a6861bf202a60462dd8063064749417b07df4117
Comment 4 Andrius Štikonas 2020-10-04 15:59:20 UTC
Git commit e0906e3e26eb03fbdafbc5382f5b3f18df6c1ee1 by Andrius Štikonas.
Committed on 04/10/2020 at 15:58.
Pushed by stikonas into branch 'master'.

Import partition flags when importing partition table.

M  +6    -1    src/gui/mainwindow.cpp

https://invent.kde.org/system/partitionmanager/commit/e0906e3e26eb03fbdafbc5382f5b3f18df6c1ee1