2020-09-20 20:33:16 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2008 Volker Lanz <vl@fidra.de>
|
|
|
|
SPDX-FileCopyrightText: 2014-2017 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
SPDX-FileCopyrightText: 2016 Teo Mrnjavac <teo@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2015-06-04 01:29:22 +01:00
|
|
|
|
|
|
|
#include "core/partitionrole.h"
|
|
|
|
|
|
|
|
#include <KLocalizedString>
|
|
|
|
|
|
|
|
/** @return the role as string */
|
2017-09-15 13:09:01 +01:00
|
|
|
QString PartitionRole::toString(const QStringList& languages) const
|
2015-06-04 01:29:22 +01:00
|
|
|
{
|
2015-07-13 15:16:36 +01:00
|
|
|
if (roles() & Unallocated)
|
2017-09-15 13:09:01 +01:00
|
|
|
return kxi18nc("@item partition role", "unallocated").toString(languages);
|
2015-06-04 01:29:22 +01:00
|
|
|
|
2015-07-13 15:16:36 +01:00
|
|
|
if (roles() & Logical)
|
2017-09-15 13:09:01 +01:00
|
|
|
return kxi18nc("@item partition role", "logical").toString(languages);
|
2015-06-04 01:29:22 +01:00
|
|
|
|
2015-07-13 15:16:36 +01:00
|
|
|
if (roles() & Extended)
|
2017-09-15 13:09:01 +01:00
|
|
|
return kxi18nc("@item partition role", "extended").toString(languages);
|
2015-06-04 01:29:22 +01:00
|
|
|
|
2015-07-13 15:16:36 +01:00
|
|
|
if (roles() & Primary)
|
2017-09-15 13:09:01 +01:00
|
|
|
return kxi18nc("@item partition role", "primary").toString(languages);
|
2015-06-04 01:29:22 +01:00
|
|
|
|
2016-04-19 15:46:18 +01:00
|
|
|
if (roles() & Luks)
|
2017-09-15 13:09:01 +01:00
|
|
|
return kxi18nc("@item partition role", "LUKS").toString(languages);
|
2016-04-15 14:43:21 +01:00
|
|
|
|
2017-09-15 12:59:10 +01:00
|
|
|
if (roles() & Lvm_Lv)
|
2017-09-15 13:09:01 +01:00
|
|
|
return kxi18nc("@item partition role", "LVM logical volume").toString(languages);
|
2017-09-15 12:50:05 +01:00
|
|
|
|
2017-09-15 13:09:01 +01:00
|
|
|
return kxi18nc("@item partition role", "none").toString(languages);
|
2015-06-04 01:29:22 +01:00
|
|
|
}
|