From ca13d1670e0ab958a3aa985e0d95ec5277be9c47 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Feb 2020 13:40:59 +0100 Subject: [PATCH] [libcalamares] Merge more from Camilo - Complete the model for locales --- src/libcalamares/locale/LabelModel.cpp | 10 ++++++++-- src/libcalamares/locale/LabelModel.h | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/libcalamares/locale/LabelModel.cpp b/src/libcalamares/locale/LabelModel.cpp index faec3edec..da4e1a9f7 100644 --- a/src/libcalamares/locale/LabelModel.cpp +++ b/src/libcalamares/locale/LabelModel.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * - * Copyright 2019, Adriaan de Groot + * Copyright 2019-2020 Adriaan de Groot + * Copyright 2019, Camilo Higuita * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +18,6 @@ */ #include "LabelModel.h" -#include #include "Lookup.h" @@ -74,6 +74,12 @@ LabelModel::data( const QModelIndex& index, int role ) const } } +QHash< int, QByteArray > +LabelModel::roleNames() const +{ + return { { LabelRole, "label" }, { EnglishLabelRole, "englishLabel" } }; +} + const Label& LabelModel::locale( int row ) const { diff --git a/src/libcalamares/locale/LabelModel.h b/src/libcalamares/locale/LabelModel.h index 55dd35b8b..7bd1fad67 100644 --- a/src/libcalamares/locale/LabelModel.h +++ b/src/libcalamares/locale/LabelModel.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * - * Copyright 2019, Adriaan de Groot + * Copyright 2019-2020, Adriaan de Groot + * Copyright 2019, Camilo Higuita * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,6 +49,7 @@ public: int rowCount( const QModelIndex& parent ) const override; QVariant data( const QModelIndex& index, int role ) const override; + QHash< int, QByteArray > roleNames() const override; /** @brief Gets locale information for entry #n *