on xenial help sign in
more review comments
20589afNick Dedekind
plugins/Utils/relativetimeformatter.cpp+6−6
@@ -39,11 +39,11 @@ gboolean
39is_locale_12h(void)
39is_locale_12h(void)
40{
40{
41 int i;
41 int i;
42− static const char *formats_24h[] = {"%H", "%R", "%T", "%OH", "%k", NULL};
42+ static const char *formats_24h[] = {"%H", "%R", "%T", "%OH", "%k", nullptr};
43 const char* t_fmt = nl_langinfo(T_FMT);
43 const char* t_fmt = nl_langinfo(T_FMT);
44
44
45− for (i=0; formats_24h[i]!=NULL; i++)
45+ for (i=0; formats_24h[i]!=nullptr; i++)
46− if (strstr(t_fmt, formats_24h[i]) != NULL)
46+ if (strstr(t_fmt, formats_24h[i]) != nullptr)
47 return FALSE;
47 return FALSE;
48
48
49 return TRUE;
49 return TRUE;
@@ -129,7 +129,7 @@ getDateProximity(GDateTime* now, GDateTime* time)
129const char*
129const char*
130dgettext_datetime(const char *text)
130dgettext_datetime(const char *text)
131{
131{
132− return dgettext("indicator-datetime", text);
132+ return dgettext("indicator-datetime", text);
133}
133}
134
134
135/**
135/**
@@ -150,9 +150,9 @@ dgettext_datetime(const char *text)
150char* generate_full_format_string_at_time (GDateTime* now,
150char* generate_full_format_string_at_time (GDateTime* now,
151 GDateTime* then)
151 GDateTime* then)
152{
152{
153− GString* ret = g_string_new (NULL);
153+ GString* ret = g_string_new (nullptr);
154
154
155− if (then != NULL) {
155+ if (then != nullptr) {
156 const date_proximity_t prox = getDateProximity(now, then);
156 const date_proximity_t prox = getDateProximity(now, then);
157
157
158 if (is_locale_12h()) {
158 if (is_locale_12h()) {
plugins/Utils/relativetimeformatter.h+1
@@ -21,6 +21,7 @@
21#include "timeformatter.h"
21#include "timeformatter.h"
22
22
23// TODO - move this to the sdk
23// TODO - move this to the sdk
24+// https://blueprints.launchpad.net/ubuntu-ui-toolkit/+spec/time-formatter
24class RelativeTimeFormatter : public GDateTimeFormatter
25class RelativeTimeFormatter : public GDateTimeFormatter
25{
26{
26 Q_OBJECT
27 Q_OBJECT
plugins/Utils/timeformatter.cpp−1
@@ -126,7 +126,6 @@ TimeFormatter::TimeFormatter(const QString &initialFormat, QObject *parent): Tim
126 priv->format = initialFormat;
126 priv->format = initialFormat;
127}
127}
128
128
129−
130TimeFormatter::~TimeFormatter()
129TimeFormatter::~TimeFormatter()
131{
130{
132 if (priv->system_bus) {
131 if (priv->system_bus) {
qml/Panel/Indicators/MenuItemFactory.qml+1−3
@@ -65,7 +65,6 @@ Item {
65 }
65 }
66 }
66 }
67
67
68−
69 function getExtendedProperty(object, propertyName, defaultValue) {
68 function getExtendedProperty(object, propertyName, defaultValue) {
70 if (object && object.hasOwnProperty(propertyName)) {
69 if (object && object.hasOwnProperty(propertyName)) {
71 return object[propertyName];
70 return object[propertyName];
@@ -134,7 +133,6 @@ Item {
134 }
133 }
135 }
134 }
136
135
137−
138 Component {
136 Component {
139 id: buttonMenu;
137 id: buttonMenu;
140
138
@@ -268,7 +266,7 @@ Item {
268 component: menuData.icon ? icon : undefined
266 component: menuData.icon ? icon : undefined
269 Component {
267 Component {
270 id: icon
268 id: icon
271− Icon{
269+ Icon {
272 source: menuData.icon
270 source: menuData.icon
273 height: units.gu(3)
271 height: units.gu(3)
274 width: height
272 width: height
qml/Panel/MenuContent.qml+2
@@ -58,6 +58,7 @@ Rectangle {
58 snapMode: ListView.SnapOneItem
58 snapMode: ListView.SnapOneItem
59 highlightRangeMode: ListView.StrictlyEnforceRange
59 highlightRangeMode: ListView.StrictlyEnforceRange
60 boundsBehavior: Flickable.StopAtBounds
60 boundsBehavior: Flickable.StopAtBounds
61+ // Load all the indicator menus (a big number)
61 cacheBuffer: 1073741823
62 cacheBuffer: 1073741823
62
63
63 delegate: Header {
64 delegate: Header {
@@ -95,6 +96,7 @@ Rectangle {
95 interactive: false
96 interactive: false
96 highlightMoveDuration: 0
97 highlightMoveDuration: 0
97 orientation: ListView.Horizontal
98 orientation: ListView.Horizontal
99+ // Load all the indicator menus (a big number)
98 cacheBuffer: 1073741823
100 cacheBuffer: 1073741823
99
101
100 delegate: Loader {
102 delegate: Loader {