Merge lp:~abreu-alexandre/cordova-ubuntu/fix-icu-dev-version into lp:cordova-ubuntu/2.8

Proposed by Robert Bruce Park
Status: Rejected
Rejected by: Robert Bruce Park
Proposed branch: lp:~abreu-alexandre/cordova-ubuntu/fix-icu-dev-version
Merge into: lp:cordova-ubuntu/2.8
Diff against target: 78 lines (+6/-25)
2 files modified
debian/control (+0/-1)
src/plugins/globalization.cpp (+6/-24)
To merge this branch: bzr merge lp:~abreu-alexandre/cordova-ubuntu/fix-icu-dev-version
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Disapprove
Review via email: mp+203800@code.launchpad.net

Commit message

Rip out ICU, which was conflicting with an incompatible version of ICU pulled in by Qt itself.

To post a comment you must log in.
Revision history for this message
Robert Bruce Park (robru) wrote :

dholbach and I both tested that this allows the tests to run.

review: Approve
Revision history for this message
Robert Bruce Park (robru) wrote :

nm, no change rebuild has same results...

review: Disapprove

Unmerged revisions

253. By Alexandre Abreu

remove icu references for now

252. By Alexandre Abreu

Fix icu dev version pulled

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2013-10-16 21:11:15 +0000
+++ debian/control 2014-01-29 17:38:55 +0000
@@ -5,7 +5,6 @@
5Build-Depends: cmake,5Build-Depends: cmake,
6 debhelper (>= 9),6 debhelper (>= 9),
7 libx11-dev,7 libx11-dev,
8 libicu-dev,
9 pkg-config,8 pkg-config,
10 qtbase5-dev,9 qtbase5-dev,
11 qtchooser,10 qtchooser,
1211
=== modified file 'src/plugins/globalization.cpp'
--- src/plugins/globalization.cpp 2013-08-30 10:50:41 +0000
+++ src/plugins/globalization.cpp 2014-01-29 17:38:55 +0000
@@ -1,7 +1,5 @@
11
2#include <ctime> //TODO: switch to QTimeZone (QT 5.1)2#include <ctime> //TODO: switch to QTimeZone (QT 5.1)
3#include <unicode/decimfmt.h>
4#include <unicode/timezone.h>
53
6#include "globalization.h"4#include "globalization.h"
75
@@ -232,25 +230,13 @@
232 this->callback(ecId, QString("new GlobalizationError(%1, 'parsing error')").arg(Globalization::PARSING_ERROR));230 this->callback(ecId, QString("new GlobalizationError(%1, 'parsing error')").arg(Globalization::PARSING_ERROR));
233}231}
234232
235static QString ustr2qstr(UnicodeString &ustr) {
236 std::string res;
237 ustr.toUTF8String(res);
238
239 return QString(res.c_str());
240}
241
242void Globalization::getNumberPattern(int scId, int ecId, int type) {233void Globalization::getNumberPattern(int scId, int ecId, int type) {
243 Q_UNUSED(ecId);234 Q_UNUSED(ecId);
244 UErrorCode status = U_ZERO_ERROR;
245 icu::DecimalFormat icu(status);
246
247 icu::UnicodeString pattern;
248 icu.toPattern(pattern);
249235
250 QLocale locale;236 QLocale locale;
251 QVariantMap obj;237 QVariantMap obj;
252238
253 obj.insert("pattern", ustr2qstr(pattern));239 obj.insert("pattern", "#,##0.###");
254240
255 switch ((NumberType)type) {241 switch ((NumberType)type) {
256 case Globalization::DECIMAL:242 case Globalization::DECIMAL:
@@ -264,8 +250,8 @@
264 break;250 break;
265 };251 };
266252
267 obj.insert("fraction", icu.getMaximumFractionDigits());253 obj.insert("fraction", 0);
268 obj.insert("rounding", icu.getRoundingIncrement());254 obj.insert("rounding", 0);
269 obj.insert("positive", QString(locale.positiveSign()));255 obj.insert("positive", QString(locale.positiveSign()));
270 obj.insert("negative", QString(locale.negativeSign()));256 obj.insert("negative", QString(locale.negativeSign()));
271 obj.insert("decimal", QString(locale.decimalPoint()));257 obj.insert("decimal", QString(locale.decimalPoint()));
@@ -303,13 +289,9 @@
303 break;289 break;
304 };290 };
305291
306 UnicodeString result;292 res.insert("timezone", "");
307 QSharedPointer<TimeZone> timezone = QSharedPointer<TimeZone>(TimeZone::createDefault());293 res.insert("utc_offset", 0);
308 timezone->getDisplayName(inDayLightSavingsTime(), TimeZone::SHORT, result);294 res.insert("dst_offset", 0);
309
310 res.insert("timezone", ustr2qstr(result));
311 res.insert("utc_offset", timezone->getRawOffset() / 1000 + timezone->getDSTSavings() / 1000);
312 res.insert("dst_offset", timezone->getDSTSavings() / 1000);
313295
314 this->cb(scId, res);296 this->cb(scId, res);
315}297}

Subscribers

People subscribed via source and target branches