Merge lp:~nick-dedekind/unity8/StrFTimeFormatter into lp:unity8
- StrFTimeFormatter
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michał Sawicz |
Approved revision: | 473 |
Merged at revision: | 598 |
Proposed branch: | lp:~nick-dedekind/unity8/StrFTimeFormatter |
Merge into: | lp:unity8 |
Prerequisite: | lp:~larsu/unity8/lp1236413 |
Diff against target: |
239 lines (+67/-11) 11 files modified
plugins/Unity/Indicators/CMakeLists.txt (+0/-1) plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml (+2/-1) plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml (+2/-2) plugins/Unity/Indicators/plugin.cpp (+0/-2) plugins/Utils/CMakeLists.txt (+1/-0) plugins/Utils/plugin.cpp (+3/-0) plugins/Utils/timeformatter.cpp (+30/-1) plugins/Utils/timeformatter.h (+15/-3) tests/plugins/Unity/Indicators/CMakeLists.txt (+0/-1) tests/plugins/Utils/CMakeLists.txt (+1/-0) tests/plugins/Utils/timeformattertest.cpp (+13/-0) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/StrFTimeFormatter |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Michał Sawicz | Approve | ||
Lars Karlitski (community) | Approve | ||
Review via email: mp+192343@code.launchpad.net |
Commit message
Added parser for strftime in TimeFormatter.
Moved TimeFormatter to Utils plugin.
Description of the change
Added parser for strftime in TimeFormatter.
PS Jenkins bot (ps-jenkins) wrote : | # |
Lars Karlitski (larsu) wrote : | # |
This patch doesn't check the return value of strftime() and might thus pass an uninitialized buffer into QString().
According to strftime(3), the return value of that function is 0 when the resulting string is longer than the passed in buffer. However, it can also be 0 when the resulting string is legitimately empty. For example, when the format string is "".
I think the best solution is to prepend a " " to the format string. That way, the return value is never smaller than 1, unless there's an error. And then simply return QString(buffer + 1).
You could also use g_date_
Nick Dedekind (nick-dedekind) wrote : | # |
> This patch doesn't check the return value of strftime() and might thus pass an
> uninitialized buffer into QString().
>
> According to strftime(3), the return value of that function is 0 when the
> resulting string is longer than the passed in buffer. However, it can also be
> 0 when the resulting string is legitimately empty. For example, when the
> format string is "".
>
> I think the best solution is to prepend a " " to the format string. That way,
> the return value is never smaller than 1, unless there's an error. And then
> simply return QString(buffer + 1).
>
> You could also use g_date_
> formats as well.
GDateTime it is.
Renamed to GDateTimeFormatter as well.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:470
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:470
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:470
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) wrote : | # |
What did we decide in the end on that? Should this come pre-formatted from the indicator?
Nick Dedekind (nick-dedekind) wrote : | # |
> What did we decide in the end on that? Should this come pre-formatted from the
> indicator?
No, we would need to subscribe to tz changes and update each event in the indicator service and update the actions. The indicator should keep processing to a minimum (times are read in as unix time).
Nick Dedekind (nick-dedekind) wrote : | # |
> What did we decide in the end on that? Should this come pre-formatted from the
> indicator?
I think this is still the correct way to do it. I'm not sure where the indicator gets it's format string from, but perhaps it should be a gsettting somewhere.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:471
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:472
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:473
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'plugins/Unity/Indicators/CMakeLists.txt' | |||
2 | --- plugins/Unity/Indicators/CMakeLists.txt 2013-10-16 19:48:57 +0000 | |||
3 | +++ plugins/Unity/Indicators/CMakeLists.txt 2013-12-13 13:24:49 +0000 | |||
4 | @@ -36,7 +36,6 @@ | |||
5 | 36 | unitymenumodelcache.cpp | 36 | unitymenumodelcache.cpp |
6 | 37 | unitymenumodelstack.cpp | 37 | unitymenumodelstack.cpp |
7 | 38 | visibleindicatorsmodel.cpp | 38 | visibleindicatorsmodel.cpp |
8 | 39 | timeformatter.cpp | ||
9 | 40 | ) | 39 | ) |
10 | 41 | add_definitions(-DUNITYINDICATORS_LIBRARY) | 40 | add_definitions(-DUNITYINDICATORS_LIBRARY) |
11 | 42 | 41 | ||
12 | 43 | 42 | ||
13 | === modified file 'plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml' | |||
14 | --- plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml 2013-10-16 19:48:57 +0000 | |||
15 | +++ plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml 2013-12-13 13:24:49 +0000 | |||
16 | @@ -21,6 +21,7 @@ | |||
17 | 21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 |
18 | 22 | import Ubuntu.Components 0.1 | 22 | import Ubuntu.Components 0.1 |
19 | 23 | import Unity.Indicators 0.1 | 23 | import Unity.Indicators 0.1 |
20 | 24 | import Utils 0.1 as Utils | ||
21 | 24 | 25 | ||
22 | 25 | HeroMessage { | 26 | HeroMessage { |
23 | 26 | id: __heroMessage | 27 | id: __heroMessage |
24 | @@ -50,7 +51,7 @@ | |||
25 | 50 | opacity: 0.0 | 51 | opacity: 0.0 |
26 | 51 | enabled: false | 52 | enabled: false |
27 | 52 | 53 | ||
29 | 53 | TimeFormatter { | 54 | Utils.TimeFormatter { |
30 | 54 | id: timeFormatter | 55 | id: timeFormatter |
31 | 55 | time: __heroMessage.time | 56 | time: __heroMessage.time |
32 | 56 | format: "hh:mm - MMM dd" | 57 | format: "hh:mm - MMM dd" |
33 | 57 | 58 | ||
34 | === modified file 'plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml' | |||
35 | --- plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml 2013-10-16 19:48:57 +0000 | |||
36 | +++ plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml 2013-12-13 13:24:49 +0000 | |||
37 | @@ -20,8 +20,8 @@ | |||
38 | 20 | 20 | ||
39 | 21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 |
40 | 22 | import Ubuntu.Components 0.1 | 22 | import Ubuntu.Components 0.1 |
41 | 23 | import Unity.Indicators 0.1 as Indicators | ||
42 | 24 | import Unity.Indicators 0.1 | 23 | import Unity.Indicators 0.1 |
43 | 24 | import Utils 0.1 as Utils | ||
44 | 25 | 25 | ||
45 | 26 | HeroMessage { | 26 | HeroMessage { |
46 | 27 | id: snapDecision | 27 | id: snapDecision |
47 | @@ -59,7 +59,7 @@ | |||
48 | 59 | height: units.gu(4) | 59 | height: units.gu(4) |
49 | 60 | opacity: 0.0 | 60 | opacity: 0.0 |
50 | 61 | 61 | ||
52 | 62 | TimeFormatter { | 62 | Utils.TimeFormatter { |
53 | 63 | id: timeFormatter | 63 | id: timeFormatter |
54 | 64 | time: snapDecision.time | 64 | time: snapDecision.time |
55 | 65 | format: "hh:mm - MMM dd" | 65 | format: "hh:mm - MMM dd" |
56 | 66 | 66 | ||
57 | === modified file 'plugins/Unity/Indicators/plugin.cpp' | |||
58 | --- plugins/Unity/Indicators/plugin.cpp 2013-10-16 19:48:57 +0000 | |||
59 | +++ plugins/Unity/Indicators/plugin.cpp 2013-12-13 13:24:49 +0000 | |||
60 | @@ -33,7 +33,6 @@ | |||
61 | 33 | #include "unitymenumodelcache.h" | 33 | #include "unitymenumodelcache.h" |
62 | 34 | #include "unitymenumodelstack.h" | 34 | #include "unitymenumodelstack.h" |
63 | 35 | #include "visibleindicatorsmodel.h" | 35 | #include "visibleindicatorsmodel.h" |
64 | 36 | #include "timeformatter.h" | ||
65 | 37 | 36 | ||
66 | 38 | static QObject* menuModelCacheSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) { | 37 | static QObject* menuModelCacheSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) { |
67 | 39 | Q_UNUSED(engine); | 38 | Q_UNUSED(engine); |
68 | @@ -52,7 +51,6 @@ | |||
69 | 52 | qmlRegisterType<RootActionState>(uri, 0, 1, "RootActionState"); | 51 | qmlRegisterType<RootActionState>(uri, 0, 1, "RootActionState"); |
70 | 53 | qmlRegisterType<ModelPrinter>(uri, 0, 1, "ModelPrinter"); | 52 | qmlRegisterType<ModelPrinter>(uri, 0, 1, "ModelPrinter"); |
71 | 54 | qmlRegisterType<VisibleIndicatorsModel>(uri, 0, 1, "VisibleIndicatorsModel"); | 53 | qmlRegisterType<VisibleIndicatorsModel>(uri, 0, 1, "VisibleIndicatorsModel"); |
72 | 55 | qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter"); | ||
73 | 56 | 54 | ||
74 | 57 | qmlRegisterSingletonType<UnityMenuModelCache>(uri, 0, 1, "UnityMenuModelCache", menuModelCacheSingleton); | 55 | qmlRegisterSingletonType<UnityMenuModelCache>(uri, 0, 1, "UnityMenuModelCache", menuModelCacheSingleton); |
75 | 58 | 56 | ||
76 | 59 | 57 | ||
77 | === modified file 'plugins/Utils/CMakeLists.txt' | |||
78 | --- plugins/Utils/CMakeLists.txt 2013-11-22 17:11:03 +0000 | |||
79 | +++ plugins/Utils/CMakeLists.txt 2013-12-13 13:24:49 +0000 | |||
80 | @@ -16,6 +16,7 @@ | |||
81 | 16 | mediaartcache.cpp | 16 | mediaartcache.cpp |
82 | 17 | qlimitproxymodelqml.cpp | 17 | qlimitproxymodelqml.cpp |
83 | 18 | qsortfilterproxymodelqml.cpp | 18 | qsortfilterproxymodelqml.cpp |
84 | 19 | timeformatter.cpp | ||
85 | 19 | unitymenumodelpaths.cpp | 20 | unitymenumodelpaths.cpp |
86 | 20 | plugin.cpp | 21 | plugin.cpp |
87 | 21 | ) | 22 | ) |
88 | 22 | 23 | ||
89 | === modified file 'plugins/Utils/plugin.cpp' | |||
90 | --- plugins/Utils/plugin.cpp 2013-11-22 17:11:03 +0000 | |||
91 | +++ plugins/Utils/plugin.cpp 2013-12-13 13:24:49 +0000 | |||
92 | @@ -30,6 +30,7 @@ | |||
93 | 30 | #include "bottombarvisibilitycommunicatorshell.h" | 30 | #include "bottombarvisibilitycommunicatorshell.h" |
94 | 31 | #include "qlimitproxymodelqml.h" | 31 | #include "qlimitproxymodelqml.h" |
95 | 32 | #include "qsortfilterproxymodelqml.h" | 32 | #include "qsortfilterproxymodelqml.h" |
96 | 33 | #include "timeformatter.h" | ||
97 | 33 | #include "unitymenumodelpaths.h" | 34 | #include "unitymenumodelpaths.h" |
98 | 34 | 35 | ||
99 | 35 | static const char* BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH = "/BottomBarVisibilityCommunicator"; | 36 | static const char* BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH = "/BottomBarVisibilityCommunicator"; |
100 | @@ -42,6 +43,8 @@ | |||
101 | 42 | qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel"); | 43 | qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel"); |
102 | 43 | qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "SortFilterProxyModel"); | 44 | qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "SortFilterProxyModel"); |
103 | 44 | qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths"); | 45 | qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths"); |
104 | 46 | qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter"); | ||
105 | 47 | qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter"); | ||
106 | 45 | qmlRegisterUncreatableType<BottomBarVisibilityCommunicatorShell>(uri, 0, 1, "BottomBarVisibilityCommunicatorShell", "Can't create BottomBarVisibilityCommunicatorShell"); | 48 | qmlRegisterUncreatableType<BottomBarVisibilityCommunicatorShell>(uri, 0, 1, "BottomBarVisibilityCommunicatorShell", "Can't create BottomBarVisibilityCommunicatorShell"); |
107 | 46 | } | 49 | } |
108 | 47 | 50 | ||
109 | 48 | 51 | ||
110 | === renamed file 'plugins/Unity/Indicators/timeformatter.cpp' => 'plugins/Utils/timeformatter.cpp' | |||
111 | --- plugins/Unity/Indicators/timeformatter.cpp 2013-10-16 19:48:57 +0000 | |||
112 | +++ plugins/Utils/timeformatter.cpp 2013-12-13 13:24:49 +0000 | |||
113 | @@ -167,6 +167,35 @@ | |||
114 | 167 | 167 | ||
115 | 168 | void TimeFormatter::update() | 168 | void TimeFormatter::update() |
116 | 169 | { | 169 | { |
118 | 170 | priv->timeString = QDateTime::fromMSecsSinceEpoch(priv->time / 1000).toString(priv->format); | 170 | priv->timeString = formatTime(); |
119 | 171 | Q_EMIT timeStringChanged(priv->timeString); | 171 | Q_EMIT timeStringChanged(priv->timeString); |
120 | 172 | } | 172 | } |
121 | 173 | |||
122 | 174 | QString TimeFormatter::formatTime() const | ||
123 | 175 | { | ||
124 | 176 | return QDateTime::fromMSecsSinceEpoch(time() / 1000).toString(format()); | ||
125 | 177 | } | ||
126 | 178 | |||
127 | 179 | GDateTimeFormatter::GDateTimeFormatter(QObject* parent) | ||
128 | 180 | : TimeFormatter(parent) | ||
129 | 181 | { | ||
130 | 182 | } | ||
131 | 183 | |||
132 | 184 | QString GDateTimeFormatter::formatTime() const | ||
133 | 185 | { | ||
134 | 186 | gchar* time_string; | ||
135 | 187 | GDateTime* datetime; | ||
136 | 188 | QByteArray formatBytes = format().toUtf8(); | ||
137 | 189 | |||
138 | 190 | datetime = g_date_time_new_from_unix_local(time()); | ||
139 | 191 | if (!datetime) { | ||
140 | 192 | return ""; | ||
141 | 193 | } | ||
142 | 194 | |||
143 | 195 | time_string = g_date_time_format(datetime, formatBytes.constData()); | ||
144 | 196 | QString formattedTime(QString::fromUtf8(time_string)); | ||
145 | 197 | |||
146 | 198 | g_free(time_string); | ||
147 | 199 | g_date_time_unref(datetime); | ||
148 | 200 | return formattedTime; | ||
149 | 201 | } | ||
150 | 173 | 202 | ||
151 | === renamed file 'plugins/Unity/Indicators/timeformatter.h' => 'plugins/Utils/timeformatter.h' | |||
152 | --- plugins/Unity/Indicators/timeformatter.h 2013-10-16 19:48:57 +0000 | |||
153 | +++ plugins/Utils/timeformatter.h 2013-12-13 13:24:49 +0000 | |||
154 | @@ -19,10 +19,10 @@ | |||
155 | 19 | #ifndef TIME_FORMATTER_H | 19 | #ifndef TIME_FORMATTER_H |
156 | 20 | #define TIME_FORMATTER_H | 20 | #define TIME_FORMATTER_H |
157 | 21 | 21 | ||
158 | 22 | #include "unityindicatorsglobal.h" | ||
159 | 23 | #include <QObject> | 22 | #include <QObject> |
160 | 24 | 23 | ||
162 | 25 | class UNITYINDICATORS_EXPORT TimeFormatter : public QObject | 24 | // TODO - bug #1260728 |
163 | 25 | class TimeFormatter : public QObject | ||
164 | 26 | { | 26 | { |
165 | 27 | Q_OBJECT | 27 | Q_OBJECT |
166 | 28 | Q_PROPERTY(QString format READ format WRITE setFormat NOTIFY formatChanged) | 28 | Q_PROPERTY(QString format READ format WRITE setFormat NOTIFY formatChanged) |
167 | @@ -31,7 +31,7 @@ | |||
168 | 31 | 31 | ||
169 | 32 | public: | 32 | public: |
170 | 33 | TimeFormatter(QObject *parent = 0); | 33 | TimeFormatter(QObject *parent = 0); |
172 | 34 | ~TimeFormatter(); | 34 | virtual ~TimeFormatter(); |
173 | 35 | 35 | ||
174 | 36 | QString format() const; | 36 | QString format() const; |
175 | 37 | QString timeString() const; | 37 | QString timeString() const; |
176 | @@ -47,8 +47,20 @@ | |||
177 | 47 | void timeStringChanged(const QString &timeString); | 47 | void timeStringChanged(const QString &timeString); |
178 | 48 | void timeChanged(qint64 time); | 48 | void timeChanged(qint64 time); |
179 | 49 | 49 | ||
180 | 50 | protected: | ||
181 | 51 | virtual QString formatTime() const; | ||
182 | 52 | |||
183 | 50 | private: | 53 | private: |
184 | 51 | struct TimeFormatterPrivate *priv; | 54 | struct TimeFormatterPrivate *priv; |
185 | 52 | }; | 55 | }; |
186 | 53 | 56 | ||
187 | 57 | class GDateTimeFormatter : public TimeFormatter | ||
188 | 58 | { | ||
189 | 59 | public: | ||
190 | 60 | GDateTimeFormatter(QObject *parent = 0); | ||
191 | 61 | |||
192 | 62 | protected: | ||
193 | 63 | virtual QString formatTime() const; | ||
194 | 64 | }; | ||
195 | 65 | |||
196 | 54 | #endif | 66 | #endif |
197 | 55 | 67 | ||
198 | === modified file 'tests/plugins/Unity/Indicators/CMakeLists.txt' | |||
199 | --- tests/plugins/Unity/Indicators/CMakeLists.txt 2013-11-06 10:26:58 +0000 | |||
200 | +++ tests/plugins/Unity/Indicators/CMakeLists.txt 2013-12-13 13:24:49 +0000 | |||
201 | @@ -40,4 +40,3 @@ | |||
202 | 40 | indicator_test(menucontentactivatortest ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp) | 40 | indicator_test(menucontentactivatortest ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp) |
203 | 41 | indicator_test(unitymenumodelstacktest ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp) | 41 | indicator_test(unitymenumodelstacktest ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp) |
204 | 42 | indicator_test(rootactionstatetest ADDITIONAL_LIBS IndicatorsQml) | 42 | indicator_test(rootactionstatetest ADDITIONAL_LIBS IndicatorsQml) |
205 | 43 | indicator_test(timeformattertest ADDITIONAL_LIBS IndicatorsQml) | ||
206 | 44 | 43 | ||
207 | === modified file 'tests/plugins/Utils/CMakeLists.txt' | |||
208 | --- tests/plugins/Utils/CMakeLists.txt 2013-06-05 22:03:08 +0000 | |||
209 | +++ tests/plugins/Utils/CMakeLists.txt 2013-12-13 13:24:49 +0000 | |||
210 | @@ -24,4 +24,5 @@ | |||
211 | 24 | run_tests( | 24 | run_tests( |
212 | 25 | qlimitproxymodeltest | 25 | qlimitproxymodeltest |
213 | 26 | qsortfilterproxymodeltest | 26 | qsortfilterproxymodeltest |
214 | 27 | timeformattertest | ||
215 | 27 | ) | 28 | ) |
216 | 28 | 29 | ||
217 | === renamed file 'tests/plugins/Unity/Indicators/timeformattertest.cpp' => 'tests/plugins/Utils/timeformattertest.cpp' | |||
218 | --- tests/plugins/Unity/Indicators/timeformattertest.cpp 2013-10-16 20:17:15 +0000 | |||
219 | +++ tests/plugins/Utils/timeformattertest.cpp 2013-12-13 13:24:49 +0000 | |||
220 | @@ -48,6 +48,19 @@ | |||
221 | 48 | 48 | ||
222 | 49 | QCOMPARE(formatter.timeString(), time.toString(format)); | 49 | QCOMPARE(formatter.timeString(), time.toString(format)); |
223 | 50 | } | 50 | } |
224 | 51 | |||
225 | 52 | void testFormatStrF() | ||
226 | 53 | { | ||
227 | 54 | const QString format = "%d-%m-%Y %I:%M%p"; | ||
228 | 55 | |||
229 | 56 | QDateTime time = QDateTime::currentDateTime(); | ||
230 | 57 | |||
231 | 58 | GDateTimeFormatter formatter; | ||
232 | 59 | formatter.setTime(time.toMSecsSinceEpoch() / 1000); // strftime in seconds since epoc | ||
233 | 60 | formatter.setFormat(format); | ||
234 | 61 | |||
235 | 62 | QCOMPARE(formatter.timeString(), time.toString("dd-MM-yyyy hh:mmAP")); | ||
236 | 63 | } | ||
237 | 51 | }; | 64 | }; |
238 | 52 | 65 | ||
239 | 53 | QTEST_GUILESS_MAIN(TimeFormatterTest) | 66 | QTEST_GUILESS_MAIN(TimeFormatterTest) |
FAILED: Continuous integration, rev:469 jenkins. qa.ubuntu. com/job/ unity8- ci/1480/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 26/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty- touch/26/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- trusty/ 4/console jenkins. qa.ubuntu. com/job/ unity8- trusty- amd64-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity8- trusty- i386-ci/ 4/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/26/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/26/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 10.97.0. 26:8080/ job/unity8- ci/1480/ rebuild
http://