Merge lp:~ubuntu-weather-dev/ubuntu-weather-app/timezone-plugin into lp:ubuntu-weather-app/obsolete.trunk
- timezone-plugin
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 384 |
Merged at revision: | 376 |
Proposed branch: | lp:~ubuntu-weather-dev/ubuntu-weather-app/timezone-plugin |
Merge into: | lp:ubuntu-weather-app/obsolete.trunk |
Diff against target: |
336 lines (+194/-9) 13 files modified
CMakeLists.txt (+21/-1) click/manifest.json.in (+1/-1) debian/changelog (+7/-0) debian/control (+20/-6) debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install (+1/-0) debian/rules (+3/-0) plugins/CMakeLists.txt (+27/-0) plugins/TimeZone/qmldir (+2/-0) plugins/TimeZone/timezone.cpp (+30/-0) plugins/TimeZone/timezone.h (+48/-0) plugins/TimeZone/timezone_plugin.cpp (+15/-0) plugins/TimeZone/timezone_plugin.h (+18/-0) po/com.ubuntu.weather.pot (+1/-1) |
To merge this branch: | bzr merge lp:~ubuntu-weather-dev/ubuntu-weather-app/timezone-plugin |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Nicholas Skaggs | Pending | ||
Daniel Holbach | Pending | ||
Review via email: mp+237613@code.launchpad.net |
This proposal supersedes a proposal from 2014-09-20.
Commit message
Adds a TimeZone plugin for getting the Utc offset for a given timezone
Also adds an additional availableTimeZo
of IANA zoneIds known by the system/Qt.
Description of the change
Adds a TimeZone plugin for getting the Utc offset for a given timezone
Also adds an additional availableTimeZo
of IANA zoneIds known by the system/Qt.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:371
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Dan Chapman (dpniel) wrote : Posted in a previous version of this proposal | # |
I'm not sure what's wrong here with qtdeclarative5-dev being an unmet build dep. Could someone check i've done the debian/controls changes correctly.
Martin Borho (martin-borho) wrote : Posted in a previous version of this proposal | # |
dpniel: Can't see what's wrong with the control file, too.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:371
http://
Executed test runs:
FAILURE: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:372
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:374
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
See comments, I think it might solve the build deps.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:376
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Dan Chapman (dpniel) wrote : Posted in a previous version of this proposal | # |
also it seems the http://
Dan Chapman (dpniel) : Posted in a previous version of this proposal | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:377
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
Dan, do note the debian control file needs dependencies specified for each package. It seems like you need qtdeclarative5-
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:378
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:379
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:380
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:381
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:383
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
I'll ask dholbach to have a look as we're quite stuck.
Dan Chapman (dpniel) wrote : Posted in a previous version of this proposal | # |
> I'll ask dholbach to have a look as we're quite stuck.
thanks Nicholas :-)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:383
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:383
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:383
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:383
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:383
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:383
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : | # |
I merged daniel's tweaks and placed them in all in a common branch everyone can tweak.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:384
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-09-08 16:24:06 +0000 | |||
3 | +++ CMakeLists.txt 2014-10-08 15:07:35 +0000 | |||
4 | @@ -3,6 +3,11 @@ | |||
5 | 3 | find_program(INTLTOOL_MERGE intltool-merge) | 3 | find_program(INTLTOOL_MERGE intltool-merge) |
6 | 4 | find_program(INTLTOOL_EXTRACT intltool-extract) | 4 | find_program(INTLTOOL_EXTRACT intltool-extract) |
7 | 5 | 5 | ||
8 | 6 | find_package(Qt5Core REQUIRED) | ||
9 | 7 | find_package(Qt5Qml REQUIRED) | ||
10 | 8 | find_package(Qt5Quick REQUIRED) | ||
11 | 9 | set(CMAKE_AUTOMOC ON) | ||
12 | 10 | |||
13 | 6 | # Standard install paths | 11 | # Standard install paths |
14 | 7 | include(GNUInstallDirs) | 12 | include(GNUInstallDirs) |
15 | 8 | 13 | ||
16 | @@ -17,6 +22,19 @@ | |||
17 | 17 | set(AUTOPILOT_DIR ubuntu_weather_app) | 22 | set(AUTOPILOT_DIR ubuntu_weather_app) |
18 | 18 | set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file") | 23 | set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file") |
19 | 19 | 24 | ||
20 | 25 | # components PATH | ||
21 | 26 | execute_process( | ||
22 | 27 | COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH | ||
23 | 28 | OUTPUT_VARIABLE ARCH_TRIPLET | ||
24 | 29 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
25 | 30 | ) | ||
26 | 31 | set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}") | ||
27 | 32 | execute_process( | ||
28 | 33 | COMMAND dpkg-architecture -qDEB_HOST_ARCH | ||
29 | 34 | OUTPUT_VARIABLE CLICK_ARCH | ||
30 | 35 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
31 | 36 | ) | ||
32 | 37 | |||
33 | 20 | if(CLICK_MODE) | 38 | if(CLICK_MODE) |
34 | 21 | if(NOT DEFINED BZR_SOURCE) | 39 | if(NOT DEFINED BZR_SOURCE) |
35 | 22 | set(BZR_SOURCE "lp:${APP_HARDCODE}") | 40 | set(BZR_SOURCE "lp:${APP_HARDCODE}") |
36 | @@ -26,7 +44,7 @@ | |||
37 | 26 | set(CMAKE_INSTALL_BINDIR /) | 44 | set(CMAKE_INSTALL_BINDIR /) |
38 | 27 | set(DATA_DIR /) | 45 | set(DATA_DIR /) |
39 | 28 | set(ICON ${ICON_FILE}) | 46 | set(ICON ${ICON_FILE}) |
41 | 29 | set(EXEC "qmlscene ${MAIN_QML}") | 47 | set(EXEC "qmlscene $@ ${MAIN_QML}") |
42 | 30 | set(DESKTOP_DIR ${DATA_DIR}) | 48 | set(DESKTOP_DIR ${DATA_DIR}) |
43 | 31 | else(CLICK_MODE) | 49 | else(CLICK_MODE) |
44 | 32 | set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE}) | 50 | set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE}) |
45 | @@ -73,3 +91,5 @@ | |||
46 | 73 | add_subdirectory(po) | 91 | add_subdirectory(po) |
47 | 74 | add_subdirectory(tests) | 92 | add_subdirectory(tests) |
48 | 75 | add_subdirectory(components) | 93 | add_subdirectory(components) |
49 | 94 | add_subdirectory(plugins) | ||
50 | 95 | |||
51 | 76 | 96 | ||
52 | === modified file 'click/manifest.json.in' | |||
53 | --- click/manifest.json.in 2014-09-08 16:24:06 +0000 | |||
54 | +++ click/manifest.json.in 2014-10-08 15:07:35 +0000 | |||
55 | @@ -1,5 +1,5 @@ | |||
56 | 1 | { | 1 | { |
58 | 2 | "architecture": "all", | 2 | "architecture": "@CLICK_ARCH@", |
59 | 3 | "description": "A weather forecast application for Ubuntu with support for multiple online weather data sources", | 3 | "description": "A weather forecast application for Ubuntu with support for multiple online weather data sources", |
60 | 4 | "framework": "ubuntu-sdk-14.10-qml-dev3", | 4 | "framework": "ubuntu-sdk-14.10-qml-dev3", |
61 | 5 | "hooks": { | 5 | "hooks": { |
62 | 6 | 6 | ||
63 | === modified file 'debian/changelog' | |||
64 | --- debian/changelog 2014-05-02 12:52:42 +0000 | |||
65 | +++ debian/changelog 2014-10-08 15:07:35 +0000 | |||
66 | @@ -1,3 +1,10 @@ | |||
67 | 1 | ubuntu-weather-app (1.8.3ubuntu1) utopic; urgency=low | ||
68 | 2 | |||
69 | 3 | [ Dan Chapman ] | ||
70 | 4 | * Add timezone c++ extension plugin | ||
71 | 5 | |||
72 | 6 | -- Dan Chapman <dpniel@ubuntu.com> Thu, 25 Sep 2014 10:46:29 +0100 | ||
73 | 7 | |||
74 | 1 | ubuntu-weather-app (1.8.3) raring; urgency=low | 8 | ubuntu-weather-app (1.8.3) raring; urgency=low |
75 | 2 | 9 | ||
76 | 3 | [ Martin Borho ] | 10 | [ Martin Borho ] |
77 | 4 | 11 | ||
78 | === modified file 'debian/control' | |||
79 | --- debian/control 2014-09-08 20:35:30 +0000 | |||
80 | +++ debian/control 2014-10-08 15:07:35 +0000 | |||
81 | @@ -3,32 +3,46 @@ | |||
82 | 3 | Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net> | 3 | Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net> |
83 | 4 | Build-Depends: cmake, | 4 | Build-Depends: cmake, |
84 | 5 | debhelper (>= 9), | 5 | debhelper (>= 9), |
85 | 6 | gettext, | ||
86 | 6 | intltool, | 7 | intltool, |
89 | 7 | python3, | 8 | python3 | python-all | python3-dev | python3-all-dev, |
90 | 8 | Standards-Version: 3.9.4 | 9 | python3-minimal, |
91 | 10 | qtbase5-dev, | ||
92 | 11 | qtbase5-dev-tools, | ||
93 | 12 | qtdeclarative5-dev, | ||
94 | 13 | qtdeclarative5-dev-tools, | ||
95 | 14 | qtdeclarative5-ubuntu-ui-toolkit-plugin, | ||
96 | 15 | Standards-Version: 3.9.5 | ||
97 | 9 | Section: misc | 16 | Section: misc |
98 | 10 | Homepage: https://launchpad.net/ubuntu-weather-app | 17 | Homepage: https://launchpad.net/ubuntu-weather-app |
99 | 11 | Vcs-Bzr: https://code.launchpad.net/~ubuntu-weather-dev/ubuntu-weather-app/trunk | 18 | Vcs-Bzr: https://code.launchpad.net/~ubuntu-weather-dev/ubuntu-weather-app/trunk |
100 | 12 | 19 | ||
101 | 13 | Package: ubuntu-weather-app | 20 | Package: ubuntu-weather-app |
102 | 14 | Section: misc | ||
103 | 15 | Architecture: all | 21 | Architecture: all |
104 | 16 | Depends: qmlscene, | 22 | Depends: qmlscene, |
105 | 17 | qtdeclarative5-localstorage-plugin, | 23 | qtdeclarative5-localstorage-plugin, |
106 | 18 | qtdeclarative5-qtquick2-plugin, | 24 | qtdeclarative5-qtquick2-plugin, |
107 | 19 | qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu, | 25 | qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu, |
108 | 20 | suru-icon-theme | ubuntu-mobile-icons, | 26 | suru-icon-theme | ubuntu-mobile-icons, |
110 | 21 | ${misc:Depends}, | 27 | qtdeclarative5-ubuntuweather-timezone-plugin1.0 (>= ${source:Version}), |
111 | 28 | ${misc:Depends} | ||
112 | 22 | Description: Weather application | 29 | Description: Weather application |
113 | 23 | Core Weather application | 30 | Core Weather application |
114 | 24 | 31 | ||
115 | 32 | Package: qtdeclarative5-ubuntuweather-timezone-plugin1.0 | ||
116 | 33 | Architecture: any | ||
117 | 34 | Depends: ${shlibs:Depends}, ${misc:Depends} | ||
118 | 35 | Description: Timezone plugin, used by the Ubuntu Weather app | ||
119 | 36 | This package contains the timezone plugin written for the Ubuntu | ||
120 | 37 | Weather app. | ||
121 | 38 | |||
122 | 25 | Package: ubuntu-weather-app-autopilot | 39 | Package: ubuntu-weather-app-autopilot |
123 | 26 | Architecture: all | 40 | Architecture: all |
124 | 27 | Depends: libautopilot-qt (>= 1.4), | 41 | Depends: libautopilot-qt (>= 1.4), |
125 | 28 | libqt5test5, | 42 | libqt5test5, |
126 | 29 | libqt5widgets5, | 43 | libqt5widgets5, |
127 | 30 | ubuntu-ui-toolkit-autopilot, | 44 | ubuntu-ui-toolkit-autopilot, |
130 | 31 | ubuntu-weather-app (= ${source:Version}), | 45 | ubuntu-weather-app (>= ${source:Version}), |
131 | 32 | ${misc:Depends}, | 46 | ${misc:Depends} |
132 | 33 | Description: Test package for the weather app | 47 | Description: Test package for the weather app |
133 | 34 | Autopilot tests for the weather app package | 48 | Autopilot tests for the weather app package |
134 | 35 | 49 | ||
135 | === added file 'debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install' | |||
136 | --- debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install 1970-01-01 00:00:00 +0000 | |||
137 | +++ debian/qtdeclarative5-ubuntuweather-timezone-plugin1.0.install 2014-10-08 15:07:35 +0000 | |||
138 | @@ -0,0 +1,1 @@ | |||
139 | 1 | usr/lib/*/qt5/ | ||
140 | 0 | 2 | ||
141 | === modified file 'debian/rules' | |||
142 | --- debian/rules 2014-09-08 16:24:06 +0000 | |||
143 | +++ debian/rules 2014-10-08 15:07:35 +0000 | |||
144 | @@ -9,3 +9,6 @@ | |||
145 | 9 | 9 | ||
146 | 10 | override_dh_auto_configure: | 10 | override_dh_auto_configure: |
147 | 11 | dh_auto_configure -- -DCLICK_MODE=OFF | 11 | dh_auto_configure -- -DCLICK_MODE=OFF |
148 | 12 | |||
149 | 13 | override_dh_install: | ||
150 | 14 | dh_install --list-missing | ||
151 | 12 | 15 | ||
152 | === added directory 'plugins' | |||
153 | === added file 'plugins/CMakeLists.txt' | |||
154 | --- plugins/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
155 | +++ plugins/CMakeLists.txt 2014-10-08 15:07:35 +0000 | |||
156 | @@ -0,0 +1,27 @@ | |||
157 | 1 | include_directories( | ||
158 | 2 | ${CMAKE_CURRENT_SOURCE_DIR} | ||
159 | 3 | ) | ||
160 | 4 | |||
161 | 5 | set( | ||
162 | 6 | timeZone_SRCS | ||
163 | 7 | TimeZone/timezone.cpp | ||
164 | 8 | TimeZone/timezone_plugin.cpp | ||
165 | 9 | ) | ||
166 | 10 | |||
167 | 11 | add_library(TimeZoneBackend MODULE | ||
168 | 12 | ${timeZone_SRCS} | ||
169 | 13 | ) | ||
170 | 14 | set_target_properties(TimeZoneBackend PROPERTIES | ||
171 | 15 | LIBRARY_OUTPUT_DIRECTORY TimeZone) | ||
172 | 16 | |||
173 | 17 | qt5_use_modules(TimeZoneBackend Gui Qml Quick) | ||
174 | 18 | |||
175 | 19 | # Copy qmldir file to build dir for running in QtCreator | ||
176 | 20 | add_custom_target(TimeZoneBackend-qmldir ALL | ||
177 | 21 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/TimeZone/qmldir ${CMAKE_CURRENT_BINARY_DIR}/TimeZone | ||
178 | 22 | DEPENDS ${QML_JS_FILES} | ||
179 | 23 | ) | ||
180 | 24 | |||
181 | 25 | # Install plugin file | ||
182 | 26 | install(TARGETS TimeZoneBackend DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/) | ||
183 | 27 | install(FILES TimeZone/qmldir DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/) | ||
184 | 0 | 28 | ||
185 | === added directory 'plugins/TimeZone' | |||
186 | === added file 'plugins/TimeZone/qmldir' | |||
187 | --- plugins/TimeZone/qmldir 1970-01-01 00:00:00 +0000 | |||
188 | +++ plugins/TimeZone/qmldir 2014-10-08 15:07:35 +0000 | |||
189 | @@ -0,0 +1,2 @@ | |||
190 | 1 | module TimeZone | ||
191 | 2 | plugin TimeZoneBackend | ||
192 | 0 | \ No newline at end of file | 3 | \ No newline at end of file |
193 | 1 | 4 | ||
194 | === added file 'plugins/TimeZone/timezone.cpp' | |||
195 | --- plugins/TimeZone/timezone.cpp 1970-01-01 00:00:00 +0000 | |||
196 | +++ plugins/TimeZone/timezone.cpp 2014-10-08 15:07:35 +0000 | |||
197 | @@ -0,0 +1,30 @@ | |||
198 | 1 | #include "timezone.h" | ||
199 | 2 | |||
200 | 3 | TimeZone::TimeZone(QObject *parent) : | ||
201 | 4 | QObject(parent) | ||
202 | 5 | { | ||
203 | 6 | } | ||
204 | 7 | /** @short helper property that returns a list of available IANA timezone id's */ | ||
205 | 8 | QVariantList TimeZone::availableTimeZoneIds() const | ||
206 | 9 | { | ||
207 | 10 | QVariantList timeZoneList; | ||
208 | 11 | Q_FOREACH(const QByteArray &id, QTimeZone::availableTimeZoneIds()) { | ||
209 | 12 | timeZoneList.append(QString(id)); | ||
210 | 13 | } | ||
211 | 14 | return timeZoneList; | ||
212 | 15 | } | ||
213 | 16 | |||
214 | 17 | int TimeZone::getUtcOffsetFromTimeZoneId(const QByteArray &timeZoneId) | ||
215 | 18 | { | ||
216 | 19 | QTimeZone tzone(timeZoneId); | ||
217 | 20 | if (tzone.isValid()) { | ||
218 | 21 | QDateTime tzOffset; | ||
219 | 22 | tzOffset.setTimeSpec(Qt::TimeZone); | ||
220 | 23 | tzOffset.setTimeZone(tzone); | ||
221 | 24 | // Now return the offset from the current UTC time in hours | ||
222 | 25 | return tzOffset.timeZone().offsetFromUtc(QDateTime::currentDateTimeUtc()) / 3600; | ||
223 | 26 | } else { | ||
224 | 27 | emit error(QString("Time zone id %1 is not a valid IANA timezone id").arg(QString(timeZoneId))); | ||
225 | 28 | return 0; | ||
226 | 29 | } | ||
227 | 30 | } | ||
228 | 0 | 31 | ||
229 | === added file 'plugins/TimeZone/timezone.h' | |||
230 | --- plugins/TimeZone/timezone.h 1970-01-01 00:00:00 +0000 | |||
231 | +++ plugins/TimeZone/timezone.h 2014-10-08 15:07:35 +0000 | |||
232 | @@ -0,0 +1,48 @@ | |||
233 | 1 | #ifndef TIMEZONE_H | ||
234 | 2 | #define TIMEZONE_H | ||
235 | 3 | |||
236 | 4 | #include <QObject> | ||
237 | 5 | #include <QtQuick> | ||
238 | 6 | #include <QDateTime> | ||
239 | 7 | #include <QTimeZone> | ||
240 | 8 | |||
241 | 9 | /* | ||
242 | 10 | * Usage: | ||
243 | 11 | * | ||
244 | 12 | * import QtQuick 2.2 | ||
245 | 13 | * import Ubuntu.Components 1.1 | ||
246 | 14 | * import TimeZone 1.0 | ||
247 | 15 | * | ||
248 | 16 | * MainView { | ||
249 | 17 | * id: root | ||
250 | 18 | * | ||
251 | 19 | * Label { text: i18n.tr("UTC offset for America/Phoenix is: %1").arg(parseInt(timeZone.getUtcOffsetFromTimeZoneId("America/Phoenix")) } | ||
252 | 20 | * | ||
253 | 21 | * TimeZone { | ||
254 | 22 | * id: timeZone | ||
255 | 23 | * } | ||
256 | 24 | * ## Also the availalbe timezone ids can be used as a listmodel or a list to query using the usual | ||
257 | 25 | * ## list methods | ||
258 | 26 | * ListView { | ||
259 | 27 | * model: timeZone.availableTimeZoneIds | ||
260 | 28 | * delegate: Label {text: modelData} | ||
261 | 29 | * } | ||
262 | 30 | * | ||
263 | 31 | * */ | ||
264 | 32 | |||
265 | 33 | class TimeZone : public QObject | ||
266 | 34 | { | ||
267 | 35 | Q_OBJECT | ||
268 | 36 | Q_PROPERTY(QVariantList availableTimeZoneIds READ availableTimeZoneIds CONSTANT) | ||
269 | 37 | public: | ||
270 | 38 | explicit TimeZone(QObject *parent = 0); | ||
271 | 39 | |||
272 | 40 | QVariantList availableTimeZoneIds() const; | ||
273 | 41 | Q_INVOKABLE int getUtcOffsetFromTimeZoneId(const QByteArray &timeZoneId); | ||
274 | 42 | |||
275 | 43 | signals: | ||
276 | 44 | void error(const QString &errorMsg); | ||
277 | 45 | |||
278 | 46 | }; | ||
279 | 47 | |||
280 | 48 | #endif // TIMEZONE_H | ||
281 | 0 | 49 | ||
282 | === added file 'plugins/TimeZone/timezone_plugin.cpp' | |||
283 | --- plugins/TimeZone/timezone_plugin.cpp 1970-01-01 00:00:00 +0000 | |||
284 | +++ plugins/TimeZone/timezone_plugin.cpp 2014-10-08 15:07:35 +0000 | |||
285 | @@ -0,0 +1,15 @@ | |||
286 | 1 | #include <QtQml> | ||
287 | 2 | #include <QtQml/QQmlContext> | ||
288 | 3 | #include "timezone_plugin.h" | ||
289 | 4 | #include "timezone.h" | ||
290 | 5 | |||
291 | 6 | void timezone_plugin::registerTypes(const char *uri) | ||
292 | 7 | { | ||
293 | 8 | //@uri TimeZone | ||
294 | 9 | qmlRegisterType<TimeZone>(uri, 1, 0, "TimeZone"); | ||
295 | 10 | } | ||
296 | 11 | |||
297 | 12 | void timezone_plugin::initializeEngine(QQmlEngine *engine, const char *uri) | ||
298 | 13 | { | ||
299 | 14 | QQmlExtensionPlugin::initializeEngine(engine, uri); | ||
300 | 15 | } | ||
301 | 0 | 16 | ||
302 | === added file 'plugins/TimeZone/timezone_plugin.h' | |||
303 | --- plugins/TimeZone/timezone_plugin.h 1970-01-01 00:00:00 +0000 | |||
304 | +++ plugins/TimeZone/timezone_plugin.h 2014-10-08 15:07:35 +0000 | |||
305 | @@ -0,0 +1,18 @@ | |||
306 | 1 | #ifndef TIMEZONE_PLUGIN_H | ||
307 | 2 | #define TIMEZONE_PLUGIN_H | ||
308 | 3 | |||
309 | 4 | #include <QtQml/QQmlEngine> | ||
310 | 5 | #include <QtQml/QQmlExtensionPlugin> | ||
311 | 6 | |||
312 | 7 | class timezone_plugin : public QQmlExtensionPlugin | ||
313 | 8 | { | ||
314 | 9 | Q_OBJECT | ||
315 | 10 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | ||
316 | 11 | |||
317 | 12 | public: | ||
318 | 13 | void registerTypes(const char *uri); | ||
319 | 14 | void initializeEngine(QQmlEngine *engine, const char *uri); | ||
320 | 15 | |||
321 | 16 | }; | ||
322 | 17 | |||
323 | 18 | #endif // TIMEZONE_PLUGIN_H | ||
324 | 0 | 19 | ||
325 | === modified file 'po/com.ubuntu.weather.pot' | |||
326 | --- po/com.ubuntu.weather.pot 2014-09-20 10:55:31 +0000 | |||
327 | +++ po/com.ubuntu.weather.pot 2014-10-08 15:07:35 +0000 | |||
328 | @@ -8,7 +8,7 @@ | |||
329 | 8 | msgstr "" | 8 | msgstr "" |
330 | 9 | "Project-Id-Version: ubuntu-weather-app\n" | 9 | "Project-Id-Version: ubuntu-weather-app\n" |
331 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
333 | 11 | "POT-Creation-Date: 2014-09-20 02:38-0700\n" | 11 | "POT-Creation-Date: 2014-09-25 10:14+0100\n" |
334 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
335 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
336 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
FAILED: Continuous integration, rev:370 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 271/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic- weather- app-python3/ 9/console 91.189. 93.70:8080/ job/ubuntu- weather- app-utopic- amd64-ci/ 77/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 271/rebuild
http://