24 // Constant definitions |
24 // Constant definitions |
25 const char *TS_FILE_TELEPHONE_CP = "telephone_cp"; |
25 const char *TS_FILE_TELEPHONE_CP = "telephone_cp"; |
26 const char *TS_FILE_COMMON = "common"; |
26 const char *TS_FILE_COMMON = "common"; |
27 |
27 |
28 /*! |
28 /*! |
29 \class CpPhoneLocalisation |
29 \class PhoneLocalisation |
30 \brief Localisation utility class for |
30 \brief Localisation utility class for |
31 Telephony control panel plugins. |
31 Telephony control panel plugins. |
32 |
32 |
33 Use installTranslator function for installing |
33 Use installTranslator function for installing |
34 needed translation files. |
34 needed translation files. |
35 |
35 |
36 Takes ownership of the created QTranslator objects |
36 Takes ownership of the created QTranslator objects |
37 and destroys them when CpPhoneLocalisation |
37 and destroys them when PhoneLocalisation |
38 object is destructed. |
38 object is destructed. |
39 */ |
39 */ |
40 |
40 |
41 |
41 |
42 /*! |
42 /*! |
43 CpPhoneLocalisation::CpPhoneLocalisation() |
43 PhoneLocalisation::PhoneLocalisation() |
44 */ |
44 */ |
45 CpPhoneLocalisation::CpPhoneLocalisation(QObject *parent) |
45 PhoneLocalisation::PhoneLocalisation(QObject *parent) |
46 :QObject(parent) |
46 :QObject(parent) |
47 { |
47 { |
48 DPRINT; |
48 DPRINT; |
49 } |
49 } |
50 |
50 |
51 |
51 |
52 /*! |
52 /*! |
53 CpPhoneLocalisation::~CpPhoneLocalisation() |
53 PhoneLocalisation::~PhoneLocalisation() |
54 */ |
54 */ |
55 CpPhoneLocalisation::~CpPhoneLocalisation() |
55 PhoneLocalisation::~PhoneLocalisation() |
56 { |
56 { |
57 DPRINT << ":IN"; |
57 DPRINT << ":IN"; |
58 removeTranslators(); |
58 removeTranslators(); |
59 DPRINT << ":OUT"; |
59 DPRINT << ":OUT"; |
60 } |
60 } |
61 |
61 |
62 |
62 |
63 /*! |
63 /*! |
64 CpPhoneLocalisation::installTranslator() |
64 PhoneLocalisation::installTranslator() |
65 */ |
65 */ |
66 bool CpPhoneLocalisation::installTranslator( |
66 bool PhoneLocalisation::installTranslator( |
67 TranslationFileId translationFileId) |
67 TranslationFileId translationFileId) |
68 { |
68 { |
69 DPRINT << ": IN"; |
69 DPRINT << ": IN"; |
70 |
70 |
71 QString lang = QLocale::system().name(); |
71 QString lang = QLocale::system().name(); |
104 return translatorLoaded; |
104 return translatorLoaded; |
105 } |
105 } |
106 |
106 |
107 |
107 |
108 /*! |
108 /*! |
109 CpPhoneLocalisation::removeTranslators() |
109 PhoneLocalisation::removeTranslators() |
110 */ |
110 */ |
111 void CpPhoneLocalisation::removeTranslators() |
111 void PhoneLocalisation::removeTranslators() |
112 { |
112 { |
113 DPRINT << ": IN"; |
113 DPRINT << ": IN"; |
114 |
114 |
115 foreach (QTranslator *translator, m_translators) { |
115 foreach (QTranslator *translator, m_translators) { |
116 qApp->removeTranslator(translator); |
116 qApp->removeTranslator(translator); |