Commit b84f8bd2 authored by Nicolas Fella's avatar Nicolas Fella

Merge branch 'Plasma/5.18'

parents 6724c903 0ec354f7
......@@ -68,13 +68,12 @@ public:
QPixmap requestPixmap(const QString &id, QSize *_size, const QSize &requestedSize) override
{
QPixmap dummy;
const QString renderString = id.mid(1); //drop initial /
QSize size = requestedSize;
QFont font;
if (!size.isValid()) {
QPixmap dummy;
QFontMetrics fm(font, &dummy);
size = { fm.horizontalAdvance(renderString), fm.height() };
} else {
......@@ -133,18 +132,26 @@ public:
EmojiModel() {
QLocale locale;
QVector<QString> dicts;
const auto bcp = locale.bcp47Name();
const QString dictName = "ibus/dicts/emoji-" + QString(bcp).replace(QLatin1Char('-'), QLatin1Char('_')) + ".dict";
const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, dictName);
if (path.isEmpty()) {
qWarning() << "could not find" << dictName;
return;
if (!path.isEmpty()) {
dicts << path;
}
QVector<QString> dicts = {path};
const auto idxSpecific = bcp.indexOf(QLatin1Char('-'));
if (idxSpecific > 0) {
const QString genericDictName = "ibus/dicts/emoji-" + bcp.left(idxSpecific) + ".dict";
const QString genericDictName = "ibus/dicts/emoji-" + bcp.leftRef(idxSpecific) + ".dict";
const QString genericPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, genericDictName);
if (!genericPath.isEmpty()) {
dicts << genericPath;
}
}
if (dicts.isEmpty()) {
const QString genericDictName = "ibus/dicts/emoji-en.dict";
const QString genericPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, genericDictName);
if (!genericPath.isEmpty()) {
......@@ -152,6 +159,11 @@ public:
}
}
if (dicts.isEmpty()) {
qWarning() << "could not find ibus emoji dictionaries." << dictName;
return;
}
QSet<QString> categories;
QSet<QString> processedEmoji;
for (const auto &dictPath : qAsConst(dicts)) {
......@@ -246,7 +258,7 @@ private:
int i = 0;
m_emoji.clear();
for (const QString &c : recent) {
m_emoji += { c, recentDescriptions.at(i++), QString{} };
m_emoji += { c, recentDescriptions.at(i++), QString{}, {} };
}
endResetModel();
}
......@@ -353,8 +365,8 @@ int main(int argc, char** argv)
KLocalizedString::setApplicationDomain("org.kde.plasma.emojier");
KAboutData about(QStringLiteral("org.kde.plasma.emojier"), i18n("Emoji Selector"), QStringLiteral(WORKSPACE_VERSION_STRING), i18n("Emoji Selector"),
KAboutLicense::GPL, i18n("(C) 2019 Aleix Pol i Gonzalez"));
KAboutData about(QStringLiteral("plasma.emojier"), i18n("Emoji Selector"), QStringLiteral(WORKSPACE_VERSION_STRING), i18n("Emoji Selector"),
KAboutLicense::GPL, i18n("(C) 2019 Aleix Pol i Gonzalez"));
about.addAuthor( QStringLiteral("Aleix Pol i Gonzalez"), QString(), QStringLiteral("aleixpol@kde.org") );
about.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails"));
// about.setProductName("");
......@@ -367,7 +379,7 @@ int main(int argc, char** argv)
QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
KDBusService::StartupOptions startup = nullptr;
KDBusService::StartupOptions startup = {};
{
QCommandLineParser parser;
......
......@@ -37,6 +37,8 @@ ColumnLayout {
ListView {
id: activitiesList
clip: true
model: Activities.ActivityModel {
id: kactivities
}
......
......@@ -29,6 +29,7 @@ QQC2.ScrollView {
GridView {
id: gridView
clip: true
cellHeight: Kirigami.Units.gridUnit * 5
cellWidth: Kirigami.Units.gridUnit * 9
model: applicationModel
......
......@@ -72,6 +72,7 @@ KCM.SimpleKCM {
ListView {
id: fileExcludeList
clip: true
model: kcm.filteredModel
delegate: Kirigami.BasicListItem {
icon: model.decoration
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment