summaryrefslogtreecommitdiff
blob: 9529370cdbae7ce1880be152eb146e549adb705a (plain)
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
Fix building without spellcheck

Upcoming changes to tdesktop include language recognition, which is a bit of a
doozy, and as is tradition, "unusual" compilation flags go untested.

Regular builds would always return false here, anyway, as linux isn't a
priority with these things.

/var/tmp/portage/net-im/telegram-desktop-4.3.4/work/tdesktop-4.3.4-full/Telegram/SourceFiles/boxes/translate_box.cpp:18:10: fatal error: spellcheck/platform/platform_language.h: No such file or directory
   18 | #include "spellcheck/platform/platform_language.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

--- tdesktop-4.3.4-full.orig/Telegram/SourceFiles/boxes/translate_box.cpp
+++ tdesktop-4.3.4-full/Telegram/SourceFiles/boxes/translate_box.cpp
@@ -15,7 +15,9 @@
 #include "main/main_session.h"
 #include "mtproto/sender.h"
 #include "settings/settings_common.h"
+#ifndef TDESKTOP_DISABLE_SPELLCHECK
 #include "spellcheck/platform/platform_language.h"
+#endif
 #include "ui/effects/loading_element.h"
 #include "ui/layers/generic_box.h"
 #include "ui/widgets/buttons.h"
@@ -331,6 +333,7 @@
 	if (!hasLetters) {
 		return true;
 	}
+#ifndef TDESKTOP_DISABLE_SPELLCHECK
 	const auto result = Platform::Language::Recognize(text);
 	if (result.unknown) {
 		return false;
@@ -343,6 +346,9 @@
 		? QLocale::English
 		: settingsLang;
 	return (result.locale.language() == skip);
+#else
+    return false;
+#endif
 }
 
 } // namespace Ui