Git commit 0b0856c222776b49b98c18ce00e9a55676b19909 by Inge Wallin. Committed on 15/11/2014 at 00:20. Pushed by ingwa into branch 'master'.
KLettres is now officially a KF5 based application! Conflicts: klettres.appdata.xml M +48 -12 CMakeLists.txt M +1 -1 doc/CMakeLists.txt M +1 -2 doc/index.docbook M +21 -1 icons/CMakeLists.txt R +- -- icons/hi128-actions-klettres_desert.png [from: icons/hi128-action-klettres_desert.png - 100% similarity] R +- -- icons/hi128-actions-klettres_grownup.png [from: icons/hi128-action-klettres_grownup.png - 100% similarity] R +- -- icons/hi128-actions-klettres_kids.png [from: icons/hi128-action-klettres_kids.png - 100% similarity] R +- -- icons/hi16-actions-klettres_desert.png [from: icons/hi16-action-klettres_desert.png - 100% similarity] R +- -- icons/hi16-actions-klettres_grownup.png [from: icons/hi16-action-klettres_grownup.png - 100% similarity] R +- -- icons/hi16-actions-klettres_kids.png [from: icons/hi16-action-klettres_kids.png - 100% similarity] R +- -- icons/hi22-actions-klettres_desert.png [from: icons/hi22-action-klettres_desert.png - 100% similarity] R +- -- icons/hi22-actions-klettres_grownup.png [from: icons/hi22-action-klettres_grownup.png - 100% similarity] R +- -- icons/hi22-actions-klettres_kids.png [from: icons/hi22-action-klettres_kids.png - 100% similarity] R +- -- icons/hi32-actions-klettres_desert.png [from: icons/hi32-action-klettres_desert.png - 100% similarity] R +- -- icons/hi32-actions-klettres_grownup.png [from: icons/hi32-action-klettres_grownup.png - 100% similarity] R +- -- icons/hi32-actions-klettres_kids.png [from: icons/hi32-action-klettres_kids.png - 100% similarity] R +- -- icons/hi48-actions-klettres_desert.png [from: icons/hi48-action-klettres_desert.png - 100% similarity] R +- -- icons/hi48-actions-klettres_grownup.png [from: icons/hi48-action-klettres_grownup.png - 100% similarity] R +- -- icons/hi48-actions-klettres_kids.png [from: icons/hi48-action-klettres_kids.png - 100% similarity] R +- -- icons/hi64-actions-klettres_desert.png [from: icons/hi64-action-klettres_desert.png - 100% similarity] R +- -- icons/hi64-actions-klettres_grownup.png [from: icons/hi64-action-klettres_grownup.png - 100% similarity] R +- -- icons/hi64-actions-klettres_kids.png [from: icons/hi64-action-klettres_kids.png - 100% similarity] R +- -- icons/hisc-actions-klettres_desert.svgz [from: icons/hisc-action-klettres_desert.svgz - 100% similarity] R +0 -0 icons/hisc-actions-klettres_grownup.svg [from: icons/hisc-action-klettres_grownup.svg - 100% similarity] R +- -- icons/hisc-actions-klettres_grownup.svgz [from: icons/hisc-action-klettres_grownup.svgz - 100% similarity] R +0 -0 icons/hisc-actions-klettres_kids.svg [from: icons/hisc-action-klettres_kids.svg - 100% similarity] R +- -- icons/hisc-actions-klettres_kids.svgz [from: icons/hisc-action-klettres_kids.svgz - 100% similarity] M +0 -18 klettres.appdata.xml M +25 -13 src/CMakeLists.txt M +55 -60 src/klettres.cpp D +0 -190 src/klettres.desktop A +23 -0 src/klettres_debug.cpp [License: LGPL (v2+)] A +27 -0 src/klettres_debug.h [License: LGPL (v2+)] M +17 -17 src/klettresview.cpp M +1 -1 src/klettresview.h M +1 -1 src/kltheme.cpp M +4 -3 src/langutils.cpp M +36 -28 src/main.cpp A +57 -0 src/org.kde.klettres.desktop M +10 -8 src/soundfactory.cpp M +4 -4 src/timer.cpp M +11 -5 tests/CMakeLists.txt M +2 -4 tests/malayalamtest.cpp M +1 -2 tests/malayalamtest.h http://commits.kde.org/klettres/0b0856c222776b49b98c18ce00e9a55676b19909 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c12653..d011e8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,54 @@ project(klettres) -find_package(KDE4 REQUIRED) +#minimum requirements +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) +set(QT_MIN_VERSION "5.2.0") + +# we need some parts of the ECM CMake helpers +find_package (ECM 1.3.0 REQUIRED NO_MODULE) +set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) +include(ECMOptionalAddSubdirectory) +include(CMakePackageConfigHelpers) +include(ECMInstallIcons) + +include(KDEInstallDirs) +include(KDECompilerSettings) +include(KDECMakeSettings) +include(ECMAddTests) + +# Load the frameworks we need + +find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED + Core + Svg + Test + Widgets +) +find_package(Phonon4Qt5) + +find_package(KF5 REQUIRED COMPONENTS + Completion + DocTools + Emoticons + ItemModels + I18n + KDELibs4Support + NewStuff + WidgetsAddons + ConfigWidgets + CoreAddons +) + include(KDE4Defaults) -include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${QT4_INCLUDES}) +include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${QT4_INCLUDES} ${PHONON_INCLUDE_DIR}) add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) -add_subdirectory( doc ) -add_subdirectory( src ) - -add_subdirectory( pics ) -add_subdirectory( data ) -add_subdirectory( sounds ) -add_subdirectory( icons ) -add_subdirectory( themes ) -add_subdirectory( tests ) -install(FILES klettres.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/) +ecm_optional_add_subdirectory( doc ) +ecm_optional_add_subdirectory( src ) +ecm_optional_add_subdirectory( pics ) +ecm_optional_add_subdirectory( data ) +ecm_optional_add_subdirectory( sounds ) +ecm_optional_add_subdirectory( icons ) +ecm_optional_add_subdirectory( themes ) +ecm_optional_add_subdirectory( tests ) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index d186938..61f0cee 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,4 +1,4 @@ ########### install files ############### # # -kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR klettres) +kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR klettres) diff --git a/doc/index.docbook b/doc/index.docbook index 4f84c88..2a525e8 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -1,6 +1,5 @@ <?xml version="1.0" ?> -<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" - "dtd/kdex.dtd" [ +<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [ <!ENTITY kappname "&klettres;"><!-- replace klettres here --> <!ENTITY package "kdeedu"> <!ENTITY % addindex "IGNORE"> diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index 71b6e1b..a4dcf42 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -1 +1,21 @@ -kde4_install_icons( ${DATA_INSTALL_DIR}/klettres/icons ) +ecm_install_icons( ICONS +hi128-actions-klettres_desert.png +hi128-actions-klettres_grownup.png +hi128-actions-klettres_kids.png +hi16-actions-klettres_desert.png +hi16-actions-klettres_grownup.png +hi16-actions-klettres_kids.png +hi22-actions-klettres_desert.png +hi22-actions-klettres_grownup.png +hi22-actions-klettres_kids.png +hi32-actions-klettres_desert.png +hi32-actions-klettres_grownup.png +hi32-actions-klettres_kids.png +hi48-actions-klettres_desert.png +hi48-actions-klettres_grownup.png +hi48-actions-klettres_kids.png +hi64-actions-klettres_desert.png +hi64-actions-klettres_grownup.png +hi64-actions-klettres_kids.png +DESTINATION +${DATA_INSTALL_DIR}/klettres/icons ) diff --git a/icons/hi128-action-klettres_desert.png b/icons/hi128-actions-klettres_desert.png similarity index 100% rename from icons/hi128-action-klettres_desert.png rename to icons/hi128-actions-klettres_desert.png diff --git a/icons/hi128-action-klettres_grownup.png b/icons/hi128-actions-klettres_grownup.png similarity index 100% rename from icons/hi128-action-klettres_grownup.png rename to icons/hi128-actions-klettres_grownup.png diff --git a/icons/hi128-action-klettres_kids.png b/icons/hi128-actions-klettres_kids.png similarity index 100% rename from icons/hi128-action-klettres_kids.png rename to icons/hi128-actions-klettres_kids.png diff --git a/icons/hi16-action-klettres_desert.png b/icons/hi16-actions-klettres_desert.png similarity index 100% rename from icons/hi16-action-klettres_desert.png rename to icons/hi16-actions-klettres_desert.png diff --git a/icons/hi16-action-klettres_grownup.png b/icons/hi16-actions-klettres_grownup.png similarity index 100% rename from icons/hi16-action-klettres_grownup.png rename to icons/hi16-actions-klettres_grownup.png diff --git a/icons/hi16-action-klettres_kids.png b/icons/hi16-actions-klettres_kids.png similarity index 100% rename from icons/hi16-action-klettres_kids.png rename to icons/hi16-actions-klettres_kids.png diff --git a/icons/hi22-action-klettres_desert.png b/icons/hi22-actions-klettres_desert.png similarity index 100% rename from icons/hi22-action-klettres_desert.png rename to icons/hi22-actions-klettres_desert.png diff --git a/icons/hi22-action-klettres_grownup.png b/icons/hi22-actions-klettres_grownup.png similarity index 100% rename from icons/hi22-action-klettres_grownup.png rename to icons/hi22-actions-klettres_grownup.png diff --git a/icons/hi22-action-klettres_kids.png b/icons/hi22-actions-klettres_kids.png similarity index 100% rename from icons/hi22-action-klettres_kids.png rename to icons/hi22-actions-klettres_kids.png diff --git a/icons/hi32-action-klettres_desert.png b/icons/hi32-actions-klettres_desert.png similarity index 100% rename from icons/hi32-action-klettres_desert.png rename to icons/hi32-actions-klettres_desert.png diff --git a/icons/hi32-action-klettres_grownup.png b/icons/hi32-actions-klettres_grownup.png similarity index 100% rename from icons/hi32-action-klettres_grownup.png rename to icons/hi32-actions-klettres_grownup.png diff --git a/icons/hi32-action-klettres_kids.png b/icons/hi32-actions-klettres_kids.png similarity index 100% rename from icons/hi32-action-klettres_kids.png rename to icons/hi32-actions-klettres_kids.png diff --git a/icons/hi48-action-klettres_desert.png b/icons/hi48-actions-klettres_desert.png similarity index 100% rename from icons/hi48-action-klettres_desert.png rename to icons/hi48-actions-klettres_desert.png diff --git a/icons/hi48-action-klettres_grownup.png b/icons/hi48-actions-klettres_grownup.png similarity index 100% rename from icons/hi48-action-klettres_grownup.png rename to icons/hi48-actions-klettres_grownup.png diff --git a/icons/hi48-action-klettres_kids.png b/icons/hi48-actions-klettres_kids.png similarity index 100% rename from icons/hi48-action-klettres_kids.png rename to icons/hi48-actions-klettres_kids.png diff --git a/icons/hi64-action-klettres_desert.png b/icons/hi64-actions-klettres_desert.png similarity index 100% rename from icons/hi64-action-klettres_desert.png rename to icons/hi64-actions-klettres_desert.png diff --git a/icons/hi64-action-klettres_grownup.png b/icons/hi64-actions-klettres_grownup.png similarity index 100% rename from icons/hi64-action-klettres_grownup.png rename to icons/hi64-actions-klettres_grownup.png diff --git a/icons/hi64-action-klettres_kids.png b/icons/hi64-actions-klettres_kids.png similarity index 100% rename from icons/hi64-action-klettres_kids.png rename to icons/hi64-actions-klettres_kids.png diff --git a/icons/hisc-action-klettres_desert.svgz b/icons/hisc-actions-klettres_desert.svgz similarity index 100% rename from icons/hisc-action-klettres_desert.svgz rename to icons/hisc-actions-klettres_desert.svgz diff --git a/icons/hisc-action-klettres_grownup.svg b/icons/hisc-actions-klettres_grownup.svg similarity index 100% rename from icons/hisc-action-klettres_grownup.svg rename to icons/hisc-actions-klettres_grownup.svg diff --git a/icons/hisc-action-klettres_grownup.svgz b/icons/hisc-actions-klettres_grownup.svgz similarity index 100% rename from icons/hisc-action-klettres_grownup.svgz rename to icons/hisc-actions-klettres_grownup.svgz diff --git a/icons/hisc-action-klettres_kids.svg b/icons/hisc-actions-klettres_kids.svg similarity index 100% rename from icons/hisc-action-klettres_kids.svg rename to icons/hisc-actions-klettres_kids.svg diff --git a/icons/hisc-action-klettres_kids.svgz b/icons/hisc-actions-klettres_kids.svgz similarity index 100% rename from icons/hisc-action-klettres_kids.svgz rename to icons/hisc-actions-klettres_kids.svgz diff --git a/klettres.appdata.xml b/klettres.appdata.xml index 2e23618..54f6cd8 100644 --- a/klettres.appdata.xml +++ b/klettres.appdata.xml @@ -9,42 +9,28 @@ <name xml:lang="de">KLettres</name> <name xml:lang="en-GB">KLettres</name> <name xml:lang="es">KLettres</name> - <name xml:lang="et">KLettres</name> <name xml:lang="fi">KLettres</name> - <name xml:lang="hu">KLettres</name> - <name xml:lang="lt">KLettres</name> - <name xml:lang="nds">KLettres</name> <name xml:lang="nl">KLettres</name> <name xml:lang="pl">KLettres</name> <name xml:lang="pt">KLettres</name> <name xml:lang="pt-BR">KLettres</name> <name xml:lang="sk">KLettres</name> - <name xml:lang="sl">KLettres</name> - <name xml:lang="sv">Klettres</name> <name xml:lang="uk">KLettres</name> <name xml:lang="x-test">xxKLettresxx</name> - <name xml:lang="zh-TW">??_KLetters</name> <summary>Learn The Alphabet</summary> <summary xml:lang="ca">Apreneu l'alfabet</summary> <summary xml:lang="cs">V?uka abecedy</summary> <summary xml:lang="de">Lerne das Alphabet</summary> <summary xml:lang="en-GB">Learn The Alphabet</summary> <summary xml:lang="es">Aprende el alfabeto</summary> - <summary xml:lang="et">T?hestiku ?ppimine</summary> <summary xml:lang="fi">Opi aakkoset</summary> - <summary xml:lang="hu">Tanulja meg az ABC-t</summary> - <summary xml:lang="lt">I?mokite ab?c?l?</summary> - <summary xml:lang="nds">Dat Alfabeet lehren</summary> <summary xml:lang="nl">Leer het alfabet</summary> <summary xml:lang="pl">Nauka alfabetu</summary> <summary xml:lang="pt">Aprender o Alfabeto</summary> <summary xml:lang="pt-BR">Aprenda o alfabeto</summary> <summary xml:lang="sk">V?uka abecedy</summary> - <summary xml:lang="sl">Nau?ite se abecedo</summary> - <summary xml:lang="sv">Inl?rning av alfabetet</summary> <summary xml:lang="uk">???????? ??????</summary> <summary xml:lang="x-test">xxLearn The Alphabetxx</summary> - <summary xml:lang="zh-TW">??_KLetters</summary> <description> <p>KLettres is an application specially designed to help the user to learn an alphabet in a new language and then to learn to read simple syllables. The user can be a young child aged from two and a half or an adult that wants to learn the basics of a foreign language. There are currently 25 languages available: Arabian, Brazilian Portuguese, Czech, Danish, Dutch, British English, US English, Phonics English, French, German, Hebrew, Hungarian, Italian, Kannada, Low Saxon, Malayalam, Norwegian Bokm?l, Punjabi, Luganda, Romanized Hindi, Russian, Spanish, Slovak, Telugu and Ukrainian. KLettres provides a special user interface and themes for younger users.</p> <p xml:lang="ca">El KLettres ?s una aplicaci? especialment dissenyada per ajudar a l'usuari a aprendre un alfabet en un idioma nou i despr?s a prendre a llegir s?l?labes senzilles. L'usuari pot ser des d'un nen de dos anys i mig a un adult que vol aprendre les bases d'un idioma estranger. Actualment hi ha 25 idiomes disponibles: ?rab, portugu?s de Brasil, txec, dan?s, holand?s, angl?s brit?nic, angl?s d'EEUU, angl?s f?nic, franc?s, alemany, hebreu, hongar?s, itali?, kanar?s, baix sax?, malai?lam, noruec Bokmal, panjabi, luganda, hindi romanitzat, rus, espanyol, eslovac, telugu i ucra?n?s. El KLettres proporciona una interf?cie d'usuari espacial i temes per usuaris joves.</p> @@ -53,17 +39,13 @@ <p xml:lang="es">KLettres es una aplicaci?n dise?ada especialmente para ayudar al usuario a aprender un alfabeto en otro idioma y despu?s, a aprender a leer s?labas sencillas. El usuario puede ser un ni?o peque?o de dos a?os y medio o un adulto que quiere aprender la base de un idioma extranjero. Actualmente, hay 25 idiomas disponibles: ?rabe, brasile?o, portugu?s, checo, dan?s, holand?s, ingl?s brit?nico, ingl?s de Estados Unidos, ingles f?nico, franc?s, alem?n, hebreo, h?ngaro, italiano, kannada, bajo saj?n, malayo, bokm?l noruego, punjab?, luganda, hindi romanizado, ruso, espa?ol, eslovaco, telug? y ucraniano. KLettres proporciona una interfaz de usuario y temas especiales para los usuarios m?s j?venes.</p> <p xml:lang="et">KLettres on rakendus, mille eesm?rk on aidata ?ppuril omandada uue keele t?hestik ja seej?rel lugeda lihtsamaid silpe. ?ppur v?ib olla v?ike laps (alates umbes 2.5-aastastest) v?i ka t?iskasvanu, kes soovib tundma ?ppida m?ne v??rkeele p?hit?desid. Praegu on v?lja pakkuda 25 keelt: alamsaksa, araabia, Brasiilia portugali, Briti inglise, foneetiline inglise, heebrea, hispaania, hollandi, itaalia, kannada, latiniseeritud hindi, luganda, malajalami, Norra Bokm?li, pand?aabi, prantsuse, saksa, slovaki, taani, telugu, t?ehhi, ukraina, ungari, USA inglise ja vene keel. KLettres pakub eriti noortele ?ppuritele spetsiaalset kasutajaliidest ja teemasid.</p> <p xml:lang="fi">KLettres on sovellus, joka on suunniteltu erityisesti auttamaan k?ytt?j?? oppimaan uuden kielen aakkoset ja oppimaan sitten lukemaan yksinkertaisia tavuja. K?ytt?j? voi olla kaksi ja puoli -vuotiaasta lapsesta aikuiseen, joka haluaa oppia vieraan kielen perusteet. T?ll? hetkell? on saatavilla 25 kielt?: alasaksa, amerikanenglanti, arabia, brasilianportugali, brittienglanti, englannin ??nteet, espanja, ganda, heprea, hollanti, italia, kannada, latinaistettu hindi, malajalam, norjan bokm?l, pand?abi, ranska, saksa, slovakki, tanska, telugu, t?ekki, ukraina, unkari ja ven?j?. KLettresiss? on nuorempia k?ytt?ji? varten oma k?ytt?liittym? ja teemoja.</p> - <p xml:lang="nds">KLettres is en Programm, dat Brukers h?lpt, dat Alfabet in en nieg Spraak to lehren un denn ok eenfach S?lven in disse Spraak to lesen. De Bruker kann en l?tt Blaag vun tweeenhalf Johr oder en Opwussen wesen, de dat Grundweten vun en nieg Spraak lehren will. Opstunns s?nd 25 Spraken verf??gbor: Araabsch, Brasiliaansch Portugeesch, Tschechsch, D??nsch, Nedderlannsch, Britsch Engelsch, US Engelsch, Foneetsch Engelsch, Franz??sch, Hoochd??tsch, Hebr??sch, Ungaarsch, Italieensch, Kannadaansch, Plattd??tsch, Malayalaamsch, Norweegsch (Bokm?l), Pandschaabsch, Lugandsch, Romaniseert Hindi, Russ'sch, Spaansch, Slowaaksch, Telugu un Ukrainsch. KLetrres hett en bes?nner B?versiet un Mustern f?r j?nger Brukers.</p> <p xml:lang="nl">KLettres is een toepassing speciaal ontworpen om de gebruiker te helpen bij het leren van het alfabet van een nieuwe taal en daarna het leren lezen van eenvoudige zinnen. De gebruiker kan een jong kind zijn ij de leeftijd van twee en een half of een volwassene die de basis van een vreemde taal wil leren. Er zijn nu 25 talen beschikbaar: Arabisch, Braziliaans Portugees, Tsjechisch, Deens, Nederlands, Brits Engels, VS Engels, Fonetisch Engels, Frans, Duits, Hebreeuws, Hongaars, Italiaans, Kannada, Nedersaksisch, Malayalam, Noors Bokm?l, Punjabi, Luganda, Geromaniseerd Hindi, Russisch, Spaans, Slowaaks, Telugu en Oekra?ens. KLettres biedt een speciaal gebruikersinterface en thema's voor jonge gebruikers.</p> <p xml:lang="pl">KLettres jest programem specjalnie zaprojektowanym do pomocy u?ytkownikowi przy nauce alfabetu w nowym j?zyku, a nast?pnie do nauki prostych sylab. U?ytkownik mo?e by? ma?ym dzieckiem w wieku dw?ch i p?? roku lub doros?ym, kt?ry chce si? nauczy? podstaw obcego j?zyka. Dost?pnych jest dwadzie?cia j?zyk?w: Arabski, Czeski, Portugalski Brazylijski, Angielski Brytyjski, Du?ski, Holenderski, Angielski, Francuski, Niemiecki, Hebrajski, W?gierski, W?oski, Kanadyjski, Dolno sakso?ski, Luganda, Malayalam, Zromanizowany Hindi, Hiszpa?ski, S?owacki, Telugu i Ukrai?ski. KLettres zapewnia w?asny uk?ad sterowania programem i wystroje dla m?odszych u?ytkownik?w.</p> <p xml:lang="pt">O KLettres ? uma aplica??o desenhada especialmente para ajudar o utilizador a aprender o alfabeto numa nova l?ngua e de depois aprender a ler s?labas simples. O utilizador poder? ser desde uma crian?a de dois anos at? um adulto que deseje aprender as bases de uma l?ngua estrangeira. Est?o dispon?veis de momento 25 l?nguas: ?rabe, Portugu?s do Brasil, Checo, Dinamarqu?s, Holand?s, Ingl?s Brit?nico, Ingl?s dos EUA, Ingl?s Fon?tico, Franc?s, Alem?o, Hebraico, H?ngaro, Italiano, Kannada, Baixo-Sax?o, Malayalam, Noruegu?s Bokm?l, Punjabi, Luganda, Hindu Romanizado, Russo, Espanhol, Eslovaco, Telugu e Ucraniano. O KLettres oferece uma interface de utilizador e temas especiais para os utilizadores mais novos.</p> <p xml:lang="pt-BR">KLettres ? um aplicativo especialmente desenvolvido para ajudar o usu?rio a aprender o alfabeto de um novo idioma e depois aprender a ler s?labas simples. O usu?rio pode ser uma crian?a de idade reduzida, a partir de dois anos e meio, at? um adulto que s? queira aprender as bases de um idioma estrangeiro. Existem 25 idiomas dispon?veis: ?rabe, Portugu?s do Brasil, Tcheco, Dinamarqu?s, Holand?s, Ingl?s Brit?nico, Ingl?s dos EUA, Fon?tica de Ingl?s, Franc?s, Alem?o, Hebraico, H?ngaro, Italiano, Canar?s, Baixo-Sax?o, Malaiala, Noruegu?s, Panjabi, Luganda, Hindi Romanizado, Russo, Espanhol, Eslovaco, Telugu e Ucraniano. O KLettres oferece uma interface de usu?rio especial e temas infantis.</p> <p xml:lang="sk">KLettres je aplik?cia ?peci?lne ur?en? na pomoc pri v?uke abecedy v novom jazyku a potom na nau?enie ??tania jednoduch?ch slab?k. Pou??vate? m??e by? mal? die?a od 2 a pol roka alebo dospel?, ktor? sa chce nau?i? z?klady cudzieho jazyka. Aktu?lne je dostupn?ch 25 jazykov: arab?ina, braz?lska portugal?ina, ?e?tina, d?n?ina, holand?ina, britsk? angli?tina, americk? angli?tina, fonetick? angli?tina, franc?z?tina, nem?ina, hebrej?ina, ma?ar?ina, talian?ina, kannad?ina, doln? sa?tina, malajalam?ina, n?r?ina Bokm?l, pand??b?ina, lugand?ina, romanizovan? hind?ina, ru?tina, ?paniel?ina, sloven?ina, telug?ina a ukrajin?ina. KLettres m? ?peci?lne pou??vate?sk? prostredie a t?my pre mlad??ch pou??vate?ov.</p> - <p xml:lang="sl">KLettres je program, ki je bil zasnovan tako, da pomaga uporabniku pri u?enju abecede njemu neznanega jezika in ga tudi nau?i kako prebrati preproste zloge. Uporabnik je lahko otrok starej?i od dveh let ali pa odrasli, ki se ?eli nau?iti osnov tujega jezika. Trenutno je na voljo 25 jezikov: arab??ina, brazilska portugal??ina, ?e??ina, dan??ina, nizozem??ina, britanska angle??ina, angle??ina ZDA, foneti?na angle??ina, franco??ina, nem??ina, hebrej??ina, mad?ar??ina, italijan??ina, kannad??ina, spodnjesa??ina, malajalam??ina, knji?na norve??ina, pand?ab??ina, jezik Luganda, Romanizirani hindi, ru??ina, ?pan??ina, slova??ina, telu??ina in ukrajin??ina. KLettres za mlaj?e uporabnike ponuja poseben uporabni?ki vmesnik in teme.</p> - <p xml:lang="sv">Klettres ?r ett program som ?r s?rskilt framtaget f?r att hj?lpa anv?ndaren att l?ra sig alfabetet p? ett nytt spr?k och sedan l?ra sig l?sa enkla stavelser. Anv?ndaren kan vara ett litet barn fr?n tv? och ett halvt ?r, eller en vuxen som vill l?ra sig grunderna i ett fr?mmande spr?k. F?r n?rvarande ?r 25 spr?k ?r tillg?ngliga: amerikansk engelska, arabiska, brasiliansk portugisiska, brittisk engelska, danska, franska, hebreiska, holl?ndska, italienska, kanaresiska, luganda, l?gsaxiska, malayalam, norskt bokm?l, phonics engelska, punjabi, romansk hindi, ryska, slovakiska, spanska, telugu, tjeckiska, tyska, ukrainska och ungerska.</p> <p xml:lang="uk">KLettres ? ?? ????????, ?????????? ?????????? ??? ????, ??? ????????? ????????????? ??????? ?????? ????? ????, ? ????? ????????? ?????? ?????? ??????. ???????????? ???? ???? ?? ?????? ????? ??? ???? ? ????????? ?????, ??? ? ??????? ??????, ??? ????? ??????? ?????? ????????? ????. ? ???????? ?????? ?? ?????? ???????????? ?????? ?????????? ??????? ??????: ????????, ??????????? ?????????????, ??????, ???????, ???????????, ?????????? ??????????, ???????????? ??????????, ????????? ??????????, ??????????, ????????, ?????, ????????, ??????????, ???????, ????????????????, ???????, ????????, ???????????? ?????, ?????????, ?????????,?????????, ?????? ?? ??????????.</p> <p xml:lang="x-test">xxKLettres is an application specially designed to help the user to learn an alphabet in a new language and then to learn to read simple syllables. The user can be a young child aged from two and a half or an adult that wants to learn the basics of a foreign language. There are currently 25 languages available: Arabian, Brazilian Portuguese, Czech, Danish, Dutch, British English, US English, Phonics English, French, German, Hebrew, Hungarian, Italian, Kannada, Low Saxon, Malayalam, Norwegian Bokm?l, Punjabi, Luganda, Romanized Hindi, Russian, Spanish, Slovak, Telugu and Ukrainian. KLettres provides a special user interface and themes for younger users.xx</p> - <p xml:lang="zh-TW">KLettres ???????????????????????????????????????????????????????????????????????????????????????????????????? 25 ????KLettres ????????????????????</p> </description> <url type="homepage">http://edu.kde.org/klettres/</url> <url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&product=klettres</url> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1de1981..8e07c51 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,38 +1,50 @@ ########### next target ############### -set(klettres_SRCS - klettres.cpp - main.cpp - klettresview.cpp - soundfactory.cpp +add_definitions(-DTRANSLATION_DOMAIN=\"kletters\") + +set(klettres_SRCS + klettres.cpp + main.cpp + klettresview.cpp + soundfactory.cpp langutils.cpp kltheme.cpp - timer.cpp ) + timer.cpp + klettres_debug.cpp ) -kde4_add_ui_files(klettres_SRCS +ki18n_wrap_ui(klettres_SRCS timerui.ui fontsdlg.ui ) -kde4_add_kcfg_files(klettres_SRCS prefs.kcfgc ) +kconfig_add_kcfg_files(klettres_SRCS prefs.kcfgc ) #kde4_add_app_icon(klettres_SRCS "${KDE4_ICON_DIR}/oxygen/*/apps/klettres.png") #kde4_add_app_icon(klettres_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/ox*-apps-klettres.png") kde4_add_app_icon(klettres_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-apps-klettres.png") -kde4_add_executable(klettres ${klettres_SRCS}) +add_executable(klettres ${klettres_SRCS}) -target_link_libraries(klettres ${KDE4_KNEWSTUFF3_LIBS} ${KDE4_PHONON_LIBS} ${QT_QTXML_LIBRARY}) +target_link_libraries(klettres + KF5::Completion + KF5::Emoticons + KF5::NewStuff + KF5::I18n + KF5::ItemModels + KF5::KDELibs4Support + Qt5::Svg + ${PHONON_LIBRARY} + Qt5::Xml) install(TARGETS klettres ${INSTALL_TARGETS_DEFAULT_ARGS} ) ########### install files ############### -install( PROGRAMS klettres.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) -install( FILES klettresui.rc DESTINATION ${DATA_INSTALL_DIR}/klettres ) +install( PROGRAMS org.kde.klettres.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) +install( FILES klettresui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/klettres ) install( FILES klettres.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) install( FILES klettres.knsrc DESTINATION ${CONFIG_INSTALL_DIR} ) -kde4_install_icons( ${ICON_INSTALL_DIR} ) +ecm_install_icons( ICONS hi128-apps-klettres.png hi16-apps-klettres.png hi22-apps-klettres.png hi32-apps-klettres.png hi48-apps-klettres.png hi64-apps-klettres.png DESTINATION ${ICON_INSTALL_DIR} ) diff --git a/src/klettres.cpp b/src/klettres.cpp index 8d168f7..568f701 100644 --- a/src/klettres.cpp +++ b/src/klettres.cpp @@ -21,33 +21,28 @@ #include "klettres.h" //Qt includes +#include <QAction> #include <QBitmap> -#include <QDir> #include <QFile> #include <QLabel> #include <QPainter> +#include <QStatusBar> #include <QTextStream> #include <QDomDocument> #include <QWidget> //KDE includes -#include <KAction> #include <KActionCollection> -#include <KComboBox> #include <KConfigDialog> -#include <KLocale> -#include <KMenuBar> +#include <KLocalizedString> +#include <QMenuBar> #include <KMessageBox> -#include <KNumInput> #include <KSelectAction> #include <KStandardAction> #include <KStandardDirs> -#include <KStatusBar> -#include <KToggleAction> #include <KToolBar> -#include <KIcon> -#include <KApplication> -#include <KGlobal> +#include <KToggleAction> +#include <QIcon> #include <knewstuff3/downloaddialog.h> //Project includes @@ -58,7 +53,7 @@ #include "kltheme.h" class fontsdlg : public QWidget, public Ui::fontsdlg -{ +{ public: fontsdlg( QWidget * parent ) : QWidget(parent) { @@ -109,17 +104,17 @@ bool KLettres::loadLayout(QDomDocument &layoutDocument) KMessageBox::information( this, mString,i18n("KLettres - Error") ); qApp->quit();//exit(1); } - + if (!layoutFile.open(QIODevice::ReadOnly)) { return false; } - + //Check if document is well-formed if (!layoutDocument.setContent(&layoutFile)) { layoutFile.close(); return false; } - + layoutFile.close(); return true; @@ -127,27 +122,27 @@ bool KLettres::loadLayout(QDomDocument &layoutDocument) void KLettres::setupActions() { - KAction *m_newAction = actionCollection()->addAction("play_new"); + QAction *m_newAction = actionCollection()->addAction("play_new"); m_newAction->setText(i18n("New Sound")); - m_newAction->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_N)); - m_newAction->setIcon(KIcon("document-new")); // ### better icon for this? - connect(m_newAction, SIGNAL(triggered(bool)), m_view, SLOT(game())); + actionCollection()->setDefaultShortcut(m_newAction,QKeySequence(Qt::CTRL+Qt::Key_N)); + m_newAction->setIcon(QIcon::fromTheme("document-new")); // ### better icon for this? + connect(m_newAction, &QAction::triggered, m_view, &KLettresView::game); m_newAction->setToolTip(i18n("Play a new sound")); m_newAction->setWhatsThis(i18n("You can play a new sound by clicking this button or using the File menu, New Sound.")); QAction *m_stuffAction = actionCollection()->addAction("downloadnewstuff"); m_stuffAction->setText(i18n("Get Alphabet in New Language...")); - m_stuffAction->setIcon(KIcon("get-hot-new-stuff")); - connect(m_stuffAction, SIGNAL(triggered(bool)), this, SLOT(slotDownloadNewStuff())); + m_stuffAction->setIcon(QIcon::fromTheme("get-hot-new-stuff")); + connect(m_stuffAction, &QAction::triggered, this, &KLettres::slotDownloadNewStuff); - KAction *m_playAgainAction = actionCollection()->addAction("play_again"); + QAction *m_playAgainAction = actionCollection()->addAction("play_again"); m_playAgainAction->setText(i18n("Replay Sound")); - m_playAgainAction->setShortcut(QKeySequence(Qt::Key_F5)); - m_playAgainAction->setIcon(KIcon("media-playback-start")); + actionCollection()->setDefaultShortcut(m_playAgainAction,QKeySequence(Qt::Key_F5)); + m_playAgainAction->setIcon(QIcon::fromTheme("media-playback-start")); m_playAgainAction->setToolTip(i18n("Play the same sound again")); - connect(m_playAgainAction, SIGNAL(triggered(bool)), m_view, SLOT(slotPlayAgain())); + connect(m_playAgainAction, &QAction::triggered, m_view, &KLettresView::slotPlayAgain); m_playAgainAction->setWhatsThis(i18n("You can replay the same sound again by clicking this button or using the File menu, Replay Sound.")); - KStandardAction::quit(kapp, SLOT(quit()), actionCollection()); + KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); m_menubarAction = KStandardAction::showMenubar(this, SLOT(slotMenubar()), actionCollection()); @@ -176,21 +171,21 @@ void KLettres::setupActions() m_kidAction = actionCollection()->add<KToggleAction>("mode_kid"); m_kidAction->setText(i18n("Mode Kid")); - m_kidAction->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_K)); - m_kidAction->setIcon(KIcon("klettres_kids")); - connect(m_kidAction, SIGNAL(triggered(bool)), this, SLOT(slotModeKid())); + actionCollection()->setDefaultShortcut(m_kidAction,QKeySequence(Qt::CTRL+Qt::Key_K)); + m_kidAction->setIcon(QIcon::fromTheme("klettres_kids")); + connect(m_kidAction, &KToggleAction::triggered, this, &KLettres::slotModeKid); m_kidAction->setWhatsThis(i18n("If you are in the Grown-up mode, clicking on this button will set up the Kid mode. The Kid mode has no menubar and the font is bigger in the statusbar.")); m_grownupAction = actionCollection()->add<KToggleAction>("mode_grownup"); m_grownupAction->setText(i18n("Mode Grown-up")); - m_grownupAction->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_G)); - m_grownupAction->setIcon(KIcon("klettres_grownup")); - connect(m_grownupAction, SIGNAL(triggered(bool)), this, SLOT(slotModeGrownup())); + actionCollection()->setDefaultShortcut(m_grownupAction,QKeySequence(Qt::CTRL+Qt::Key_G)); + m_grownupAction->setIcon(QIcon::fromTheme("klettres_grownup")); + connect(m_grownupAction, &KToggleAction::triggered, this, &KLettres::slotModeGrownup); m_grownupAction->setWhatsThis(i18n("The Grownup mode is the normal mode where you can see the menubar.")); - connect(m_levelAction, SIGNAL(triggered(int)), this, SLOT(slotChangeLevel(int))); - connect(m_languageAction, SIGNAL(triggered(int)), this, SLOT(slotChangeLanguage(int))); - connect(m_themeAction, SIGNAL(triggered(int)), this, SLOT(slotChangeTheme(int))); + connect(m_levelAction, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &KLettres::slotChangeLevel); + connect(m_languageAction, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &KLettres::slotChangeLanguage); + connect(m_themeAction, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &KLettres::slotChangeTheme); KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); @@ -199,12 +194,12 @@ void KLettres::setupActions() void KLettres::setupStatusbar() { - KStatusBar *st=statusBar(); + QStatusBar *st=statusBar(); m_langLabel = new QLabel(st); m_levLabel = new QLabel(st); st->addWidget(m_langLabel); - st->insertFixedItem("", 1);//add a space - st->addWidget(m_levLabel); +// st->insertFixedItem("", 1);//add a space + st->addWidget(m_levLabel); statusBar(); } @@ -220,22 +215,22 @@ void KLettres::optionsPreferences() if(KConfigDialog::showDialog("settings")) { return; } - + KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self()); dialog->addPage(new fontsdlg(0), i18n("Font Settings"), "preferences-desktop-font"); //fontsdlg is the page name, mFont is the widget name, Font Settings is the page display string //fonts is the icon Timer *m_timer = new Timer(); dialog->addPage(m_timer, i18n("Timer"), "chronometer"); - connect(dialog, SIGNAL(settingsChanged(const QString &)), this, SLOT(slotUpdateSettings())); + connect(dialog, &KConfigDialog::settingsChanged, this, &KLettres::slotUpdateSettings); dialog->setAttribute( Qt::WA_DeleteOnClose ); - dialog->setHelp(QString(), "klettres"); + // dialog->setHelp(QString(), "klettres"); dialog->show(); } void KLettres::loadSettings() { - if (LangUtils::getLanguages().indexOf(Prefs::language()) <0) { + if (LangUtils::getLanguages().indexOf(Prefs::language()) < 0) { Prefs::setLanguage("en"); } QString langString = LangUtils::getLanguagesNames(LangUtils::getLanguages())[LangUtils::getLanguages().indexOf(Prefs::language())]; @@ -253,14 +248,14 @@ void KLettres::loadSettings() } else { slotModeKid(); } - + m_menubarAction->setChecked(Prefs::menuBarBool()); slotMenubar(); } void KLettres::slotDownloadNewStuff() { - QPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog("klettres.knsrc", this)); + QPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog("klettres.knsrc", this)); if ( dialog->exec() == QDialog::Accepted ) { // do nothing } @@ -281,7 +276,7 @@ void KLettres::slotMenubar() { menuBar()->setVisible(m_menubarAction->isChecked()); Prefs::setMenuBarBool(m_menubarAction->isChecked()); - Prefs::self()->writeConfig(); + Prefs::self()->save(); } void KLettres::slotUpdateSettings() @@ -295,7 +290,7 @@ void KLettres::slotUpdateSettings() void KLettres::slotChangeLevel(int newLevel) { Prefs::setLevel(newLevel+1); - Prefs::self()->writeConfig(); + Prefs::self()->save(); updateLevMenu(newLevel); //TODO is that necessary? Change level effectively by reloading sounds @@ -318,7 +313,7 @@ void KLettres::slotChangeLanguage(int newIndex) // Write new language ISO in config QString newLanguage = LangUtils::getLanguages()[newIndex]; Prefs::setLanguage(newLanguage); - Prefs::self()->writeConfig(); + Prefs::self()->save(); // Update the StatusBar QString langString = LangUtils::getLanguagesNames(LangUtils::getLanguages())[newIndex]; langString.remove('&'); @@ -326,11 +321,11 @@ void KLettres::slotChangeLanguage(int newIndex) loadLangToolBar(); // Change language effectively bool ok = loadLayout(soundFactory->m_layoutsDocument); - + if (ok) { soundFactory->change(Prefs::language()); } - + m_view->randomInt = 0; m_view->game(); } @@ -338,7 +333,7 @@ void KLettres::slotChangeLanguage(int newIndex) void KLettres::slotChangeTheme(int index) { Prefs::setTheme(index); - Prefs::self()->writeConfig(); + Prefs::self()->save(); m_view->setTheme(KLThemeFactory::instance()->buildTheme(index)); } @@ -358,7 +353,7 @@ void KLettres::slotModeGrownup() menuBar()->show(); m_view->m_timer = Prefs::grownTimer(); Prefs::setMode(Prefs::EnumMode::grownup); - Prefs::self()->writeConfig(); + Prefs::self()->save(); } void KLettres::slotModeKid() @@ -378,7 +373,7 @@ void KLettres::slotModeKid() menuBar()->hide(); m_view->m_timer = Prefs::kidTimer(); Prefs::setMode(Prefs::EnumMode::kid); - Prefs::self()->writeConfig(); + Prefs::self()->save(); } void KLettres::loadLangToolBar() @@ -392,7 +387,7 @@ void KLettres::loadLangToolBar() QString myString=QString("klettres/%1.txt").arg(lang); QFile myFile; myFile.setFileName(KStandardDirs::locate("data",myString)); - + if (!myFile.exists()) { QString mString=i18n("File $KDEDIR/share/apps/klettres/%1.txt not found;\n" "please check your installation.", lang); @@ -400,7 +395,7 @@ void KLettres::loadLangToolBar() i18n("Error") ); qApp->quit(); } - + //we open the file and store info into the stream... QFile openFileStream(myFile.fileName()); openFileStream.open(QIODevice::ReadOnly); @@ -409,17 +404,17 @@ void KLettres::loadLangToolBar() //allData contains all the words from the file allData = readFileStr.readAll().split('\n'); openFileStream.close(); - + for (int i=0; i<(int) allData.count(); ++i) { if (!allData[i].isEmpty()) { QAction *act = specialCharToolbar->addAction(allData.at(i)); act->setIcon(charIcon(allData.at(i).at(0))); // used to carry the id act->setData(i); - connect(act, SIGNAL(triggered(bool)), this, SLOT(slotPasteChar())); + connect(act, &QAction::triggered, this, &KLettres::slotPasteChar); } } - + specialCharToolbar->show(); update(); } else { @@ -436,11 +431,11 @@ void KLettres::slotPasteChar() bool ok = true; int id = act->data().toInt(&ok); - + if (!ok || id < 0 || id >= allData.count()) { return; } - + m_view->m_letterEdit->insert(allData.at(id)); } @@ -482,4 +477,4 @@ QIcon KLettres::charIcon(const QChar & c) return QIcon(pm); } -#include "klettres.moc" + diff --git a/src/klettres.desktop b/src/klettres.desktop deleted file mode 100644 index 57115be..0000000 --- a/src/klettres.desktop +++ /dev/null @@ -1,190 +0,0 @@ -# KDE Config File -[Desktop Entry] -Type=Application -Exec=klettres -caption %c %i -Icon=klettres -X-DocPath=klettres/index.html -Comment=a KDE program to learn the alphabet -Comment[ast]=Un programa de KDE pa deprender l'alfabetu -Comment[bg]=???????? ?? ????? ?? ???????? ? KDE -Comment[bs]=KDE program za u?enje abecede -Comment[ca]=Un programa del KDE per aprendre l'alfabet -Comment[ca at valencia]=Un programa del KDE per aprendre l'alfabet -Comment[cs]=KDE program pro v?uku abecedy -Comment[csb]=KDE programa do na?czi alfab?tu -Comment[da]=Et KDE program til at l?re sig alfabetet -Comment[de]=Ein KDE-Programm zum Erlernen des Alphabets -Comment[el]=??? ???????? ??? KDE ??? ??? ???????? ??? ????????? -Comment[en_GB]=a KDE program to learn the alphabet -Comment[eo]=KDE programo por lerni la alfabeton -Comment[es]=Un programa de KDE para aprender el alfabeto -Comment[et]=KDE t?hestiku omandamise programm -Comment[eu]=Alfabetoa ikasteko KDE programa -Comment[fa]=?? ?????? KDE ???? ??????? ????? -Comment[fi]=Ohjelma aakkosien harjoitteluun -Comment[fr]=Un programme KDE pour apprendre l'alphabet -Comment[ga]=Cl?r KDE chun an aib?tir a fhoghlaim -Comment[gl]=Un programa para aprender o alfabeto con KDE -Comment[gu]=KDE ????????? ?? ?????? ??????? ?? -Comment[he]=????? KDE ?????? ??????? -Comment[hi]=???????? ????? ?? ??? ?? ????? ????????? -Comment[hne]=???????? ????? ?? ?? ????? ????????? -Comment[hr]=KDE program za u?enje abecede -Comment[hu]=KDE-alap? oktat?program az ?b?c? gyakorl?s?hoz -Comment[is]=KDE forrit til a? l?ra stafr?fi? -Comment[it]=Un programma KDE per imparare l'alfabeto -Comment[ja]=??????????????? KDE ????? -Comment[kk]=KDE-??? ?????? ??????? ??????? ???????????? -Comment[km]=???????????????????????????? KDE -Comment[ko]=??? ??? ?? KDE ???? -Comment[lt]=KDE programa ab?c?l?s mokymuisi -Comment[lv]=KDE alfab?ta m?c??an?s programma -Comment[ml]=???????? ?????????????? ??? ????? ??????? -Comment[mr]=???????? ???????????? ?? ????? ????????? -Comment[nb]=et KDE-program for ? l?re alfabetet -Comment[nds]=En KDE-Programm f?r't Lehren vun't Alfabeet -Comment[ne]=???? ??????? ???? ????? ????????? -Comment[nl]=Een KDE-programma waarmee het alfabet geleerd kan worden -Comment[nn]=Eit KDE-program for ? l?ra alfabetet -Comment[pa]=????? ???? ???? ?? KDE ???????? -Comment[pl]=Program do nauki alfabetu dla KDE -Comment[pt]=Um programa do KDE para aprender o alfabeto -Comment[pt_BR]=Um programa do KDE para aprender o alfabeto -Comment[ro]=un program KDE pentru ?nsu?irea alfabetului -Comment[ru]=????????? ??? ???????? ???????? -Comment[sk]=KDE program pre v?uku abecedy -Comment[sl]=Program za u?enje abecede za KDE -Comment[sv]=Ett KDE program f?r att l?ra sig alfabetet -Comment[tr]=Alfabeyi ??renmeye yard?mc? bir KDE uygulamas? -Comment[ug]=KDE ???? ??????? ??????? ??????????? -Comment[uk]=???????? ? ???????? ?????? ??? KDE -Comment[x-test]=xxa KDE program to learn the alphabetxx -Comment[zh_CN]=???????? KDE ?? -Comment[zh_TW]= ????? KDE ?? -Terminal=false -Name=KLettres -Name[af]=K-letters -Name[ast]=KLettres -Name[be]=KLettres -Name[bg]=KLettres -Name[bn]=??-??????? -Name[br]=KLettres -Name[bs]=KLettres -Name[ca]=KLettres -Name[ca at valencia]=KLettres -Name[cs]=KLettres -Name[csb]=KLettres -Name[cy]=KLettres -Name[da]=KLettres -Name[de]=KLettres -Name[el]=KLettres -Name[en_GB]=KLettres -Name[eo]=KLettres -Name[es]=KLettres -Name[et]=KLettres -Name[eu]=KLettres -Name[fi]=KLettres -Name[fr]=KLettres -Name[ga]=KLettres -Name[gl]=KLettres -Name[gu]=KLettres -Name[he]=KLettres -Name[hi]=??-?????? -Name[hne]=??-?????? -Name[hr]=KLettres -Name[hu]=KLettres -Name[is]=KLettres -Name[it]=KLettres -Name[ja]=KLettres -Name[ka]=KLettres -Name[kk]=KLettres -Name[km]=KLettres -Name[ko]=KLettres -Name[lt]=KLettres -Name[lv]=KLettres -Name[mk]=KLettres -Name[ml]=??-?????????? -Name[mr]=??-?????? -Name[ms]=KLettres -Name[nb]=KLettres -Name[nds]=KLettres -Name[ne]=????? ????? -Name[nl]=KLettres -Name[nn]=KBokstavar -Name[oc]=KLettres -Name[pa]=??-???? -Name[pl]=KLettres -Name[pt]=KLettres -Name[pt_BR]=KLettres -Name[ro]=KLettres -Name[ru]=KLettres -Name[se]=KLettres -Name[sk]=KLettres -Name[sl]=KLettres -Name[sv]=Klettres -Name[ta]=?? -Name[tg]=KLettres -Name[tr]=KLettres -Name[ug]=KLettres -Name[uk]=KLettres -Name[vi]=Ch? c?i K -Name[xh]=KLettres -Name[x-test]=xxKLettresxx -Name[zh_CN]=KLettres -Name[zh_TW]=??_KLetters -GenericName=Learn The Alphabet -GenericName[ast]=Deprender l'alfabetu -GenericName[bg]=????????? ?? ???????? -GenericName[bs]=Nau?ite abecedu -GenericName[ca]=Apreneu l'alfabet -GenericName[ca at valencia]=Apreneu l'alfabet -GenericName[cs]=V?uka abecedy -GenericName[csb]=Na?cz? s? alfab?tu -GenericName[da]=L?r alfabetet -GenericName[de]=Lerne das Alphabet -GenericName[el]=???????? ??? ????????? -GenericName[en_GB]=Learn The Alphabet -GenericName[eo]=Lernu la alfabeton -GenericName[es]=Aprender el alfabeto -GenericName[et]=T?hestiku ?ppimine -GenericName[eu]=Ikasi alfabetoa -GenericName[fi]=Opi aakkoset -GenericName[fr]=Apprentissage de l'alphabet -GenericName[ga]=Foghlaim an Aib?tir -GenericName[gl]=Aprender o alfabeto -GenericName[gu]=?????? ???? -GenericName[he]=????? ??????? -GenericName[hne]=???????? ????? -GenericName[hr]=Nau?ite abecedu -GenericName[hu]=?b?c?tan?t? -GenericName[is]=L?ra stafr?fi? -GenericName[it]=Impara l'alfabeto -GenericName[ja]=?????????? -GenericName[kk]=???????? ?????? -GenericName[km]=????????????? -GenericName[ko]=??? ??? -GenericName[lt]=I?mokite ab?c?l? -GenericName[lv]=Iem?cieties alfab?tu -GenericName[ml]=???????? ???????? -GenericName[mr]=???????? ???? -GenericName[nb]=L?r alfabetet -GenericName[nds]=Dat Alfabeet lehren -GenericName[ne]=???? ?????????? -GenericName[nl]=Leer het alfabet -GenericName[nn]=L?r alfabetet -GenericName[pa]=???? ????? -GenericName[pl]=Nauka alfabetu -GenericName[pt]=Aprender o Alfabeto -GenericName[pt_BR]=Aprenda o alfabeto -GenericName[ro]=?nva?? alfabetul -GenericName[ru]=???????? ???????? -GenericName[sk]=V?uka abecedy -GenericName[sl]=Nau?ite se abecedo -GenericName[sv]=Inl?rning av alfabetet -GenericName[tr]=Alfabeyi ??ren -GenericName[ug]=??????? ??????? -GenericName[uk]=???????? ?????? -GenericName[x-test]=xxLearn The Alphabetxx -GenericName[zh_CN]=???? -GenericName[zh_TW]=???? -Categories=Qt;KDE;Education;Languages; diff --git a/src/klettres_debug.cpp b/src/klettres_debug.cpp new file mode 100644 index 0000000..dc941eb --- /dev/null +++ b/src/klettres_debug.cpp @@ -0,0 +1,23 @@ +/* This file is part of the KDE project + Copyright (C) 2014 Laurent Montel <montel at kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "klettres_debug.h" +Q_LOGGING_CATEGORY(KLETTRES_LOG, "log_klettres") + + diff --git a/src/klettres_debug.h b/src/klettres_debug.h new file mode 100644 index 0000000..733670b --- /dev/null +++ b/src/klettres_debug.h @@ -0,0 +1,27 @@ +/* This file is part of the KDE project + Copyright (C) 2014 Laurent Montel <montel at kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KLETTRES_DEBUG_H +#define KLETTRES_DEBUG_H + +#include <QLoggingCategory> +Q_DECLARE_LOGGING_CATEGORY(KLETTRES_LOG) + +#endif + diff --git a/src/klettresview.cpp b/src/klettresview.cpp index bf65536..72c2abc 100644 --- a/src/klettresview.cpp +++ b/src/klettresview.cpp @@ -26,14 +26,14 @@ #include <QFile> #include <QPaintEvent> -#include <KLocale> #include <KStandardDirs> - +#include <KLocalizedString> //Project headers #include "klettres.h" #include "prefs.h" #include "kltheme.h" #include "langutils.h" +#include "klettres_debug.h" KLettresView::KLettresView(KLettres *parent) : QWidget(parent) @@ -64,13 +64,13 @@ void KLettresView::chooseSound() //get the next random sound m_random=m_klettres->soundFactory->randomList[randomInt%m_klettres->soundFactory->sounds]; //The sound is played - kDebug() << "m_random " << m_random; + qCDebug(KLETTRES_LOG) << "m_random " << m_random; m_klettres->soundFactory->playSound(m_random); //store letter or syllable in m_currentLetter m_currentLetter = m_klettres->soundFactory->namesList[m_random]; //Find the length of the syllable m_length=m_klettres->soundFactory->namesList[m_random].length(); - kDebug() << "syllable length " << m_length; + qCDebug(KLETTRES_LOG) << "syllable length " << m_length; int width; if (m_length<3) { @@ -150,7 +150,7 @@ void KLettresView::game() m_cursorPos = 1; //reset everything so when you change language or levels //it all restarts nicely - QObject::disconnect(m_letterEdit, SIGNAL(textChanged(QString)),this,SLOT(slotProcess(QString))); + QObject::disconnect(m_letterEdit, &KLineEdit::textChanged, this, &KLettresView::slotProcess); m_letterEdit->clear(); m_letterEdit->setCursorPosition(0); m_letterEdit->setMaxLength( 1 ); @@ -158,24 +158,24 @@ void KLettresView::game() m_upperLetter.clear(); chooseSound(); randomInt++; - QObject::connect(m_letterEdit, SIGNAL(textChanged(QString)), this, SLOT(slotProcess(QString))); + QObject::connect(m_letterEdit, &KLineEdit::textChanged, this, &KLettresView::slotProcess); } void KLettresView::slotProcess(const QString &inputLetter) { QString lang = Prefs::language(); - QObject::disconnect(m_letterEdit, SIGNAL(textChanged(QString)), this, SLOT(slotProcess(QString))); + QObject::disconnect(m_letterEdit, &KLineEdit::textChanged, this, &KLettresView::slotProcess); //check if backspace if (inputLetter.length() != m_cursorPos) { m_cursorPos--; m_letterEdit->setMaxLength( m_cursorPos ); - QObject::connect(m_letterEdit, SIGNAL(textChanged(QString)),this,SLOT(slotProcess(QString))); + QObject::connect(m_letterEdit, &KLineEdit::textChanged, this, &KLettresView::slotProcess); return; } QChar input_character = inputLetter.at(inputLetter.length()-1); QChar input_character_u; - kDebug() << "input_character " << input_character << endl; + qCDebug(KLETTRES_LOG) << "input_character " << input_character << endl; if ((!LangUtils::isIndian(lang) && (input_character.isLetter())) || (LangUtils::isIndian(lang))) { @@ -190,9 +190,9 @@ void KLettresView::slotProcess(const QString &inputLetter) m_letterEdit->setText(m_upperLetter); QTimer::singleShot(m_timer*100, this, SLOT(slotTimerDone())); } else { - kDebug() << "cursor " << m_cursorPos << endl; + qCDebug(KLETTRES_LOG) << "cursor " << m_cursorPos << endl; m_letterEdit->backspace(); - QObject::connect(m_letterEdit, SIGNAL(textChanged(const QString&)),this,SLOT(slotProcess(const QString&)) ); + QObject::connect(m_letterEdit, &KLineEdit::textChanged, this, &KLettresView::slotProcess); } } @@ -200,8 +200,8 @@ void KLettresView::slotProcess(const QString &inputLetter) void KLettresView::slotTimerDone() { QString match = m_currentLetter.left(m_cursorPos ); - kDebug() << "match " << match.toUpper() << endl; - kDebug() << "m_upperLetter " << m_upperLetter << endl; + qCDebug(KLETTRES_LOG) << "match " << match.toUpper() << endl; + qCDebug(KLETTRES_LOG) << "m_upperLetter " << m_upperLetter << endl; if (match == m_upperLetter) { if (m_cursorPos!=m_length) {//if text in lineEdit not equal to text on button @@ -210,18 +210,18 @@ void KLettresView::slotTimerDone() m_letterEdit->setCursorPosition( m_cursorPos ); m_letterEdit->setFocus(); m_cursorPos ++; - QObject::connect(m_letterEdit, SIGNAL(textChanged(QString)), this, SLOT(slotProcess(QString))); + QObject::connect(m_letterEdit, &KLineEdit::textChanged, this, &KLettresView::slotProcess); } else { game(); //another syllable } } else { //if not, cut it - kDebug() << "wrong letter "<< endl; + qCDebug(KLETTRES_LOG) << "wrong letter "<< endl; m_letterEdit->backspace(); //delete the char to the left and position curseur accordingly m_upperLetter.remove(m_upperLetter.size()-1, 1); m_letterEdit->setFocus(); //play sound again m_klettres->soundFactory->playSound(m_random); - QObject::connect(m_letterEdit, SIGNAL(textChanged(QString)), this, SLOT(slotProcess(QString))); + QObject::connect(m_letterEdit, &KLineEdit::textChanged, this, &KLettresView::slotProcess); } } @@ -238,4 +238,4 @@ void KLettresView::keyReleaseEvent(QKeyEvent * e) } } -#include "klettresview.moc" + diff --git a/src/klettresview.h b/src/klettresview.h index 82b022a..9b375dc 100644 --- a/src/klettresview.h +++ b/src/klettresview.h @@ -99,7 +99,7 @@ public slots: ///Start playing displaying a new letter/syllable, playing the associated sound void game(); -protected slots: +public slots: ///Play the same sound again void slotPlayAgain(); diff --git a/src/kltheme.cpp b/src/kltheme.cpp index b3f75fb..b77e71f 100644 --- a/src/kltheme.cpp +++ b/src/kltheme.cpp @@ -20,7 +20,7 @@ //project headers #include "kltheme.h" -#include <KLocale> +#include <KLocalizedString> KLTheme::KLTheme() { diff --git a/src/langutils.cpp b/src/langutils.cpp index d17ea23..2343cd9 100644 --- a/src/langutils.cpp +++ b/src/langutils.cpp @@ -20,11 +20,12 @@ //project headers #include "langutils.h" #include "prefs.h" +#include "klettres_debug.h" #include <QDir> #include <KGlobal> -#include <KLocale> +#include <KLocalizedString> #include <KStandardDirs> bool LangUtils::hasSpecialChars(const QString& lang) @@ -84,7 +85,7 @@ QStringList LangUtils::getLanguages() } //TODO TEST in FRENCH m_languages.sort(); - kDebug() <<m_languages; + qCDebug(KLETTRES_LOG) <<m_languages; return m_languages; } @@ -119,7 +120,7 @@ QStringList LangUtils::getLanguagesNames(QStringList languagesList) void LangUtils::writeLangConfig() { //write the present languages in config so they cannot be downloaded - KConfigGroup config(KGlobal::config(), "KNewStuffStatus"); + KConfigGroup config(KSharedConfig::openConfig(), "KNewStuffStatus"); QStringList m_languages = getLanguages(); for (int i=0; i<m_languages.count(); i++) { QString tmp = m_languages[i]; diff --git a/src/main.cpp b/src/main.cpp index 2caf2cf..b674078 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,11 +21,12 @@ /*****************************************************/ /* Please save with utf8 encoding, thanks */ /*****************************************************/ +#include <QApplication> #include <kaboutdata.h> -#include <kcmdlineargs.h> -#include <klocale.h> -#include <kapplication.h> + +#include <KLocalizedString> +#include <QCommandLineParser> #include "klettres.h" #include "version.h" @@ -39,46 +40,53 @@ static const char version[] = "2.1"; int main(int argc, char **argv) { - KAboutData about("klettres", 0, ki18n("KLettres"), KLETTRES_VERSION, ki18n(description), - KAboutData::License_GPL, ki18n("(C) 2001-2011 Anne-Marie Mahfouf"),KLocalizedString(), "http://edu.kde.org/klettres", "submit at bugs.kde.org"); - about.addAuthor( ki18n("Anne-Marie Mahfouf"), KLocalizedString(), "annma AT kde DOT org", "http://annma.blogspot.com", "annma"); - about.addCredit(ki18n("Marc Cheng"), - ki18n("Kids and grown-up oxygen icons"), "bdgraue AT web DOT de"); - about.addCredit(ki18n("Danny Allen"), - ki18n("SVG background pictures"), "dannya40uk AT yahoo DOT co DOT uk"); - about.addCredit(ki18n("Robert Gogolok"), - ki18n("Support and coding guidance"), "mail AT robert-gogolok DOT de"); - about.addCredit(ki18n("Peter Hedlund"), - ki18n("Code for generating special characters' icons"), "peter DOT hedlund AT kdemail DOT net"); - about.addCredit(ki18n("Waldo Bastian"), - ki18n("Port to KConfig XT, coding help"), "bastian AT kde DOT org"); - about.addCredit(ki18n("Pino Toscano"), - ki18n("Code cleaning, Theme class"), "toscano DOT pino AT tiscali DOT it"); - about.addCredit(ki18n("Michael Goettsche"), - ki18n("Timer setting widgets"), "michael.goettsche AT kdemail DOT net"); - KCmdLineArgs::init(argc, argv, &about); + KAboutData about("klettres", i18n("KLettres"), QLatin1String(KLETTRES_VERSION), i18n(description), + KAboutLicense::GPL, i18n("(C) 2001-2011 Anne-Marie Mahfouf"),QString(), QLatin1String("http://edu.kde.org/klettres"), QLatin1String("submit at bugs.kde.org")); + about.addAuthor( i18n("Anne-Marie Mahfouf"), QString(), "annma AT kde DOT org", "http://annma.blogspot.com", "annma"); + about.addCredit(i18n("Marc Cheng"), + i18n("Kids and grown-up oxygen icons"), "bdgraue AT web DOT de"); + about.addCredit(i18n("Danny Allen"), + i18n("SVG background pictures"), "dannya40uk AT yahoo DOT co DOT uk"); + about.addCredit(i18n("Robert Gogolok"), + i18n("Support and coding guidance"), "mail AT robert-gogolok DOT de"); + about.addCredit(i18n("Peter Hedlund"), + i18n("Code for generating special characters' icons"), "peter DOT hedlund AT kdemail DOT net"); + about.addCredit(i18n("Waldo Bastian"), + i18n("Port to KConfig XT, coding help"), "bastian AT kde DOT org"); + about.addCredit(i18n("Pino Toscano"), + i18n("Code cleaning, Theme class"), "toscano DOT pino AT tiscali DOT it"); + about.addCredit(i18n("Michael Goettsche"), + i18n("Timer setting widgets"), "michael.goettsche AT kdemail DOT net"); + QApplication app(argc, argv); + QCommandLineParser parser; + KAboutData::setApplicationData(about); + parser.addVersionOption(); + parser.addHelpOption(); + about.setupCommandLine(&parser); + parser.process(app); + about.processCommandLine(&parser); - KCmdLineOptions options; - KCmdLineArgs::addCmdLineOptions(options); - KApplication app; + app.setApplicationName("klettres"); + app.setApplicationVersion(version); + app.setOrganizationDomain("kde.org"); + app.setApplicationDisplayName(i18n("Klettres")); // see if we are starting with session management if (app.isSessionRestored()) { RESTORE(KLettres) } else { // no session.. just start up normally - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - if (args->count() == 0) { + if (parser.positionalArguments().count() == 0) { KLettres *widget = new KLettres; widget->show(); } else { int i = 0; - for (; i < args->count(); i++) { + for (; i < parser.positionalArguments().count(); i++) { KLettres *widget = new KLettres; widget->show(); } } - args->clear(); + } return app.exec(); diff --git a/src/org.kde.klettres.desktop b/src/org.kde.klettres.desktop new file mode 100644 index 0000000..e510645 --- /dev/null +++ b/src/org.kde.klettres.desktop @@ -0,0 +1,57 @@ +# KDE Config File +[Desktop Entry] +Type=Application +Exec=klettres -caption %c %i +Icon=klettres +X-DocPath=klettres/index.html +Comment=a KDE program to learn the alphabet +Comment[ca]=Un programa del KDE per aprendre l'alfabet +Comment[cs]=KDE program pro v?uku abecedy +Comment[de]=Ein KDE-Programm zum Erlernen des Alphabets +Comment[en_GB]=a KDE program to learn the alphabet +Comment[es]=Un programa de KDE para aprender el alfabeto +Comment[fi]=Ohjelma aakkosien harjoitteluun +Comment[fr]=Un programme KDE pour apprendre l'alphabet +Comment[it]=Un programma KDE per imparare l'alfabeto +Comment[nl]=Een KDE-programma waarmee het alfabet geleerd kan worden +Comment[pl]=Program do nauki alfabetu dla KDE +Comment[pt]=Um programa do KDE para aprender o alfabeto +Comment[pt_BR]=Um programa do KDE para aprender o alfabeto +Comment[sk]=KDE program pre v?uku abecedy +Comment[uk]=???????? ? ???????? ?????? ??? KDE +Comment[x-test]=xxa KDE program to learn the alphabetxx +Terminal=false +Name=KLettres +Name[ca]=KLettres +Name[cs]=KLettres +Name[de]=KLettres +Name[en_GB]=KLettres +Name[es]=KLettres +Name[fi]=KLettres +Name[fr]=KLettres +Name[it]=KLettres +Name[nl]=KLettres +Name[pl]=KLettres +Name[pt]=KLettres +Name[pt_BR]=KLettres +Name[sk]=KLettres +Name[uk]=KLettres +Name[x-test]=xxKLettresxx +GenericName=Learn The Alphabet +GenericName[ca]=Apreneu l'alfabet +GenericName[cs]=V?uka abecedy +GenericName[de]=Lerne das Alphabet +GenericName[en_GB]=Learn The Alphabet +GenericName[es]=Aprender el alfabeto +GenericName[fi]=Opi aakkoset +GenericName[fr]=Apprentissage de l'alphabet +GenericName[it]=Impara l'alfabeto +GenericName[nl]=Leer het alfabet +GenericName[pl]=Nauka alfabetu +GenericName[pt]=Aprender o Alfabeto +GenericName[pt_BR]=Aprenda o alfabeto +GenericName[sk]=V?uka abecedy +GenericName[uk]=???????? ?????? +GenericName[x-test]=xxLearn The Alphabetxx +Categories=Qt;KDE;Education;Languages; +X-DBUS-ServiceName=org.kde.kletters diff --git a/src/soundfactory.cpp b/src/soundfactory.cpp index e423cad..8fcfd3f 100644 --- a/src/soundfactory.cpp +++ b/src/soundfactory.cpp @@ -23,12 +23,14 @@ #include "soundfactory.h" + #include <KMessageBox> -#include <KLocale> +#include <KLocalizedString> #include <KRandomSequence> #include <KStandardDirs> -#include <Phonon/MediaObject> +#include <phonon/MediaObject> +#include "klettres_debug.h" #include "klettres.h" #include "prefs.h" @@ -77,7 +79,7 @@ void SoundFactory::playSound(int mySound) } soundFile = KStandardDirs::locate("data", "klettres/" + filesList[mySound]); - kDebug() << "soundFile " << soundFile; + qCDebug(KLETTRES_LOG) << "soundFile " << soundFile; if (soundFile.isEmpty()) { return; @@ -121,10 +123,10 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur codeAttribute = languageElement.attributeNode("code"); if (currentLanguage != codeAttribute.value()) { - kDebug() << "Fail reading language !!! "; + qCDebug(KLETTRES_LOG) << "Fail reading language !!! "; return false; } else { - kDebug() << "current language " << currentLanguage; + qCDebug(KLETTRES_LOG) << "current language " << currentLanguage; } //check here if alphabet and syllables both exist alphabetList = languageElement.elementsByTagName("alphabet"); @@ -143,7 +145,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur if ((Prefs::level() == 3) || (Prefs::level() == 4)) { if (syllablesList.count() != 1) { Prefs::setLevel(1); - Prefs::self()->writeConfig(); + Prefs::self()->save(); return false; } @@ -153,7 +155,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur } //Counts the number of sounds sounds = soundNamesList.count(); - kDebug() << "number of sounds" << sounds << endl; + qCDebug(KLETTRES_LOG) << "number of sounds" << sounds << endl; if (sounds < 1) { return false; } @@ -190,4 +192,4 @@ void SoundFactory::setSoundSequence() randomSequence.randomize(randomList); } -#include "soundfactory.moc" + diff --git a/src/timer.cpp b/src/timer.cpp index c75fbad..ecd5978 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -23,7 +23,7 @@ #include "timer.h" -#include <KLocale> +#include <KLocalizedString> #include "prefs.h" @@ -33,8 +33,8 @@ Timer::Timer() ui_timer.setupUi(this); ui_timer.timeGrownLabel->setText(QString::number(Prefs::grownTimer()) + ' ' + i18n("tenths of second")); ui_timer.timeKidLabel->setText(QString::number(Prefs::kidTimer()) + ' ' + i18n("tenths of second")); - connect(ui_timer.kcfg_GrownTimer, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged())); - connect(ui_timer.kcfg_KidTimer, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged())); + connect(ui_timer.kcfg_GrownTimer, &QSlider::valueChanged, this, &Timer::sliderValueChanged); + connect(ui_timer.kcfg_KidTimer, &QSlider::valueChanged, this, &Timer::sliderValueChanged); } @@ -45,4 +45,4 @@ void Timer::sliderValueChanged() } -#include "timer.moc" + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fcd21d3..9166494 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,9 +1,15 @@ -set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) +include(ECMMarkAsTest) +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) -set(malayalamtest_SOURCES malayalamtest.cpp) +set(malayalamtest_SRCS + malayalamtest.cpp +) -kde4_add_unit_test(malayalamtest ${malayalamtest_SOURCES}) +add_executable(MalayalamTest ${malayalamtest_SRCS}) +add_test(MalayalamTest MalayalamTest) +ecm_mark_as_test(MalayalamTest) +target_link_libraries(MalayalamTest + Qt5::Test +) -target_link_libraries(malayalamtest ${KDE4_KDECORE_LIBS} -${QT_QTTEST_LIBRARY}) diff --git a/tests/malayalamtest.cpp b/tests/malayalamtest.cpp index 0c5a7cc..8b71eea 100644 --- a/tests/malayalamtest.cpp +++ b/tests/malayalamtest.cpp @@ -18,7 +18,7 @@ #include "malayalamtest.h" -#include <QtTest/QtTest> +#include <QTest> #include <QString> void MalayalamTest::matchChar() @@ -49,7 +49,5 @@ void MalayalamTest::decomposeConsonant() } +QTEST_MAIN(MalayalamTest) -QTEST_KDEMAIN_CORE( MalayalamTest ) - -#include "malayalamtest.moc" diff --git a/tests/malayalamtest.h b/tests/malayalamtest.h index efd4482..c33f544 100644 --- a/tests/malayalamtest.h +++ b/tests/malayalamtest.h @@ -19,8 +19,7 @@ #ifndef MALAYALAMTEST_H #define MALAYALAMTEST_H -#include <qtest_kde.h> -#include <QtCore/QObject> +#include <QObject> class MalayalamTest : public QObject {