locationsystemui/locationsysui/posindicator/posindicatorplugin/src/posindicator.cpp
equal
deleted
inserted
replaced
42 ApiLogger::OpenLogFile(); |
42 ApiLogger::OpenLogFile(); |
43 #ifndef POSINDICATOR_NFT |
43 #ifndef POSINDICATOR_NFT |
44 qInstallMsgHandler(ApiLogger::MyOutputHandler); |
44 qInstallMsgHandler(ApiLogger::MyOutputHandler); |
45 #endif |
45 #endif |
46 #endif |
46 #endif |
47 |
47 |
48 qDebug() << "+ PosIndicatorPlugin::PosIndicatorPlugin()"; |
48 qDebug() << "+ PosIndicatorPlugin::PosIndicatorPlugin()"; |
49 |
|
50 mTranslator = new QTranslator(); |
|
51 |
|
52 QString locale = QLocale::system().name(); |
|
53 QString path = "z:/resource/qt/translations/"; |
|
54 mTranslator->load(path + QString("lilocationmw_") + locale); |
|
55 qApp->installTranslator(mTranslator); |
|
56 |
|
57 mIndicatorTypes.append(typeOfIndicator); |
49 mIndicatorTypes.append(typeOfIndicator); |
58 qDebug() << "- PosIndicatorPlugin::PosIndicatorPlugin()"; |
50 qDebug() << "- PosIndicatorPlugin::PosIndicatorPlugin()"; |
59 |
51 |
60 } |
52 } |
61 |
53 |
93 // |
85 // |
94 HbIndicatorInterface* PosIndicatorPlugin::createIndicator( |
86 HbIndicatorInterface* PosIndicatorPlugin::createIndicator( |
95 const QString &indicatorType) |
87 const QString &indicatorType) |
96 { |
88 { |
97 qDebug() << "+ PosIndicatorPlugin::createIndicator()"; |
89 qDebug() << "+ PosIndicatorPlugin::createIndicator()"; |
|
90 InstallTranslator(); |
98 ApiLogger::NftLogger("Before launching indicator"); |
91 ApiLogger::NftLogger("Before launching indicator"); |
99 PosIndicator* ind = new PosIndicator( indicatorType ); |
92 PosIndicator* ind = new PosIndicator( indicatorType ); |
100 ApiLogger::NftLogger("After launching indicator"); |
93 ApiLogger::NftLogger("After launching indicator"); |
101 return ind; |
94 return ind; |
102 } |
95 } |
128 int PosIndicatorPlugin::error() const |
121 int PosIndicatorPlugin::error() const |
129 { |
122 { |
130 qDebug() << "+ PosIndicatorPlugin::error()"; |
123 qDebug() << "+ PosIndicatorPlugin::error()"; |
131 return mError; |
124 return mError; |
132 } |
125 } |
|
126 |
|
127 // --------------------------------------------------------------------------- |
|
128 // PosIndicatorPlugin::InstallTranslator |
|
129 // --------------------------------------------------------------------------- |
|
130 // |
|
131 void PosIndicatorPlugin::InstallTranslator() |
|
132 { |
|
133 qDebug() << "+ PosIndicator::InstallTranslator()"; |
|
134 bool loaded = false; |
|
135 mTranslator = new QTranslator(); |
|
136 //if creation fails in Out of Memory Cases then return |
|
137 if (!mTranslator) |
|
138 { |
|
139 return; |
|
140 } |
|
141 QString locale = QLocale::system().name(); |
|
142 QString path = "z:/resource/qt/translations/"; |
|
143 loaded = mTranslator->load(path + QString("lilocationmw_") + locale); |
|
144 if (loaded) |
|
145 { |
|
146 qApp->installTranslator(mTranslator); |
|
147 } |
|
148 qDebug() << "- PosIndicator::InstallTranslator()"; |
|
149 } |
|
150 |
133 |
151 |
134 // --------------------------------------------------------------------------- |
152 // --------------------------------------------------------------------------- |
135 // PosIndicator::PosIndicator |
153 // PosIndicator::PosIndicator |
136 // --------------------------------------------------------------------------- |
154 // --------------------------------------------------------------------------- |
137 // |
155 // |