Allow accessing untranslated partition roles.
This commit is contained in:
parent
dff6086e64
commit
ec89795326
|
@ -391,7 +391,7 @@ QTextStream& operator<<(QTextStream& stream, const Partition& p)
|
||||||
<< p.firstSector() << sep
|
<< p.firstSector() << sep
|
||||||
<< p.lastSector() << sep
|
<< p.lastSector() << sep
|
||||||
<< p.fileSystem().name({ QStringLiteral("C") }) << sep
|
<< p.fileSystem().name({ QStringLiteral("C") }) << sep
|
||||||
<< p.roles().toString() << sep
|
<< p.roles().toString({ QStringLiteral("C") }) << sep
|
||||||
<< "\"" << p.fileSystem().label() << QStringLiteral("\"") << sep
|
<< "\"" << p.fileSystem().label() << QStringLiteral("\"") << sep
|
||||||
<< "\"" << flagList.join(QStringLiteral(",")) << QStringLiteral("\"")
|
<< "\"" << flagList.join(QStringLiteral(",")) << QStringLiteral("\"")
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
|
|
@ -19,29 +19,28 @@
|
||||||
|
|
||||||
#include "core/partitionrole.h"
|
#include "core/partitionrole.h"
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
/** @return the role as string */
|
/** @return the role as string */
|
||||||
QString PartitionRole::toString() const
|
QString PartitionRole::toString(const QStringList& languages) const
|
||||||
{
|
{
|
||||||
if (roles() & Unallocated)
|
if (roles() & Unallocated)
|
||||||
return xi18nc("@item partition role", "unallocated");
|
return kxi18nc("@item partition role", "unallocated").toString(languages);
|
||||||
|
|
||||||
if (roles() & Logical)
|
if (roles() & Logical)
|
||||||
return xi18nc("@item partition role", "logical");
|
return kxi18nc("@item partition role", "logical").toString(languages);
|
||||||
|
|
||||||
if (roles() & Extended)
|
if (roles() & Extended)
|
||||||
return xi18nc("@item partition role", "extended");
|
return kxi18nc("@item partition role", "extended").toString(languages);
|
||||||
|
|
||||||
if (roles() & Primary)
|
if (roles() & Primary)
|
||||||
return xi18nc("@item partition role", "primary");
|
return kxi18nc("@item partition role", "primary").toString(languages);
|
||||||
|
|
||||||
if (roles() & Luks)
|
if (roles() & Luks)
|
||||||
return xi18nc("@item partition role", "LUKS");
|
return kxi18nc("@item partition role", "LUKS").toString(languages);
|
||||||
|
|
||||||
if (roles() & Lvm_Lv)
|
if (roles() & Lvm_Lv)
|
||||||
return xi18nc("@item partition role", "LVM logical volume");
|
return kxi18nc("@item partition role", "LVM logical volume").toString(languages);
|
||||||
|
|
||||||
return xi18nc("@item partition role", "none");
|
return kxi18nc("@item partition role", "none").toString(languages);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
#include "util/libpartitionmanagerexport.h"
|
#include "util/libpartitionmanagerexport.h"
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <QStringList>
|
||||||
class QString;
|
|
||||||
|
|
||||||
/** A Partition's role.
|
/** A Partition's role.
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ public:
|
||||||
return !operator==(other); /**< @param other object to compare with @return true if not the same */
|
return !operator==(other); /**< @param other object to compare with @return true if not the same */
|
||||||
}
|
}
|
||||||
|
|
||||||
QString toString() const;
|
QString toString(const QStringList& languages = {}) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Roles m_Roles;
|
Roles m_Roles;
|
||||||
|
|
Loading…
Reference in New Issue