forked from flathub/flathub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtspell-0.8.5-utf8.patch
67 lines (64 loc) · 2.52 KB
/
qtspell-0.8.5-utf8.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff -Naur qtspell-0.8.5.orig/src/Checker.cpp qtspell-0.8.5/src/Checker.cpp
--- qtspell-0.8.5.orig/src/Checker.cpp 2018-06-15 13:20:29.000000000 +0200
+++ qtspell-0.8.5/src/Checker.cpp 2019-01-13 03:43:42.537961418 +0100
@@ -25,6 +25,7 @@
#include <QLocale>
#include <QMenu>
#include <QTranslator>
+#include <QtDebug>
static void dict_describe_cb(const char* const lang_tag,
const char* const /*provider_name*/,
@@ -107,7 +108,7 @@
if(m_lang.isEmpty()){
m_lang = QLocale::system().name();
if(m_lang.toLower() == "c" || m_lang.isEmpty()){
- qWarning("Cannot use system locale %s", m_lang.toLatin1().data());
+ qWarning() << "Cannot use system locale " << m_lang;
m_lang = QString::null;
return false;
}
@@ -117,7 +118,7 @@
try {
m_speller = get_enchant_broker()->request_dict(m_lang.toStdString());
} catch(enchant::Exception& e) {
- qWarning("Failed to load dictionary: %s", e.what());
+ qWarning() << "Failed to load dictionary: " << e.what();
m_lang = QString::null;
return false;
}
diff -Naur qtspell-0.8.5.orig/src/Codetable.cpp qtspell-0.8.5/src/Codetable.cpp
--- qtspell-0.8.5.orig/src/Codetable.cpp 2018-06-15 13:20:29.000000000 +0200
+++ qtspell-0.8.5/src/Codetable.cpp 2019-01-13 03:41:28.521427145 +0100
@@ -21,6 +21,7 @@
#include <QDir>
#include <QFile>
#include <QXmlStreamReader>
+#include <QtDebug>
#include <libintl.h>
#define ISO_639_DOMAIN "iso_639"
@@ -77,7 +78,7 @@
QString name = xml.attributes().value("name").toString();
QString code = xml.attributes().value("iso_639_1_code").toString();
if(!name.isEmpty() && !code.isEmpty()){
- name = QString::fromUtf8(dgettext(ISO_639_DOMAIN, name.toLatin1().data()));
+ name = QString::fromUtf8(dgettext(ISO_639_DOMAIN, name.toUtf8().constData()));
table.insert(code, name);
}
}
@@ -89,7 +90,7 @@
QString name = xml.attributes().value("name").toString();
QString code = xml.attributes().value("alpha_2_code").toString();
if(!name.isEmpty() && !code.isEmpty()){
- name = QString::fromUtf8(dgettext(ISO_3166_DOMAIN, name.toLatin1().data()));;
+ name = QString::fromUtf8(dgettext(ISO_3166_DOMAIN, name.toUtf8().constData()));
table.insert(code, name);
}
}
@@ -100,7 +101,7 @@
QString filename = QDir(QDir(dataDir.filePath("xml")).filePath("iso-codes")).absoluteFilePath(basename);
QFile file(filename);
if(!file.open(QIODevice::ReadOnly)){
- qWarning("Failed to open %s for reading", file.fileName().toLatin1().data());
+ qWarning() << "Failed to open " << file.fileName() << " for reading";
return;
}