equal
deleted
inserted
replaced
15 * Definition file for class ClockCitySelectionList. |
15 * Definition file for class ClockCitySelectionList. |
16 * |
16 * |
17 */ |
17 */ |
18 |
18 |
19 //System Include |
19 //System Include |
20 #include<HbApplication> |
20 #include<HbTranslator> |
21 #include<QTranslator> |
|
22 |
21 |
23 |
22 |
24 // User includes |
23 // User includes |
25 #include "clockcityselectionlist.h" |
24 #include "clockcityselectionlist.h" |
26 #include "clockcityselectionlist_p.h" |
25 #include "clockcityselectionlist_p.h" |
53 TimezoneClient *client, QObject *parent) |
52 TimezoneClient *client, QObject *parent) |
54 :QObject(parent), |
53 :QObject(parent), |
55 d_ptr(new ClockCitySelectionListPrivate(client, this)) |
54 d_ptr(new ClockCitySelectionListPrivate(client, this)) |
56 { |
55 { |
57 // Load the translation file and install the editor specific translator |
56 // Load the translation file and install the editor specific translator |
58 mTranslator = new QTranslator; |
57 mTranslator = new HbTranslator("clockcityselectionlist"); |
59 //QString lang = QLocale::system().name(); |
58 mTranslator->loadCommon(); |
60 //QString path = "Z:/resource/qt/translations/"; |
|
61 mTranslator->load("clockcityselectionlist",":/translations"); |
|
62 // TODO: Load the appropriate .qm file based on locale |
|
63 //bool loaded = mTranslator->load("caleneditor_" + lang, path); |
|
64 HbApplication::instance()->installTranslator(mTranslator); |
|
65 } |
59 } |
66 |
60 |
67 /*! |
61 /*! |
68 Default constructor. |
62 Default constructor. |
69 |
63 |
72 ClockCitySelectionList::ClockCitySelectionList(QObject *parent) |
66 ClockCitySelectionList::ClockCitySelectionList(QObject *parent) |
73 :QObject(parent), |
67 :QObject(parent), |
74 d_ptr(new ClockCitySelectionListPrivate(0, this)) |
68 d_ptr(new ClockCitySelectionListPrivate(0, this)) |
75 { |
69 { |
76 // Load the translation file and install the editor specific translator |
70 // Load the translation file and install the editor specific translator |
77 mTranslator = new QTranslator; |
71 mTranslator = new HbTranslator("clockcityselectionlist"); |
78 //QString lang = QLocale::system().name(); |
72 mTranslator->loadCommon(); |
79 //QString path = "Z:/resource/qt/translations/"; |
|
80 mTranslator->load("clockcityselectionlist",":/translations"); |
|
81 // TODO: Load the appropriate .qm file based on locale |
|
82 //bool loaded = mTranslator->load("caleneditor_" + lang, path); |
|
83 HbApplication::instance()->installTranslator(mTranslator); |
|
84 |
|
85 } |
73 } |
86 |
74 |
87 ClockCitySelectionList::~ClockCitySelectionList() |
75 ClockCitySelectionList::~ClockCitySelectionList() |
88 { |
76 { |
89 // Remove the translator |
77 // Remove the translator |
90 HbApplication::instance()->removeTranslator(mTranslator); |
|
91 if (mTranslator) { |
78 if (mTranslator) { |
92 delete mTranslator; |
79 delete mTranslator; |
93 mTranslator = 0; |
80 mTranslator = 0; |
94 } |
81 } |
95 } |
82 } |