[libcalamares] Merge more from Camilo

- Complete the model for locales
This commit is contained in:
Adriaan de Groot 2020-02-12 13:40:59 +01:00
parent 684c5f477c
commit ca13d1670e
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* Copyright 2019-2020 Adriaan de Groot <groot@kde.org>
* Copyright 2019, Camilo Higuita <milo.h@aol.com>
*
* 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 <QDebug>
#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
{

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* Copyright 2019-2020, Adriaan de Groot <groot@kde.org>
* Copyright 2019, Camilo Higuita <milo.h@aol.com>
*
* 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
*