Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.36 KB | None | 0 0
  1. From 804dcc94a581447dabfe9815406e974bc88d06fd Mon Sep 17 00:00:00 2001
  2. From: Matt Thirtytwo <matt.59491@gmail.com>
  3. Date: Mon, 2 Mar 2015 21:18:41 +0100
  4. Subject: [PATCH] Fix compiler warning in clock plugin about shadowed 'time'
  5. variable
  6.  
  7. ---
  8. plugins/clock/clock-analog.c | 20 ++++++------
  9. plugins/clock/clock-binary.c | 28 ++++++++---------
  10. plugins/clock/clock-digital.c | 8 ++---
  11. plugins/clock/clock-fuzzy.c | 6 ++--
  12. plugins/clock/clock-lcd.c | 34 ++++++++++-----------
  13. plugins/clock/clock-time.c | 68 ++++++++++++++++++++---------------------
  14. plugins/clock/clock.c | 12 ++++----
  15. 7 files changed, 88 insertions(+), 88 deletions(-)
  16.  
  17. diff --git a/plugins/clock/clock-analog.c b/plugins/clock/clock-analog.c
  18. index 2e96a09..910450d 100644
  19. --- a/plugins/clock/clock-analog.c
  20. +++ b/plugins/clock/clock-analog.c
  21. @@ -216,7 +216,7 @@ xfce_clock_analog_expose_event (GtkWidget *widget,
  22. gdouble xc, yc;
  23. gdouble angle, radius;
  24. cairo_t *cr;
  25. - GDateTime *time;
  26. + GDateTime *date_time;
  27.  
  28. panel_return_val_if_fail (XFCE_CLOCK_IS_ANALOG (analog), FALSE);
  29.  
  30. @@ -239,7 +239,7 @@ xfce_clock_analog_expose_event (GtkWidget *widget,
  31. cairo_clip (cr);
  32.  
  33. /* get the local time */
  34. - time = clock_time_get_time (analog->time);
  35. + date_time = clock_time_get_time (analog->time);
  36.  
  37. /* set the line properties */
  38. cairo_set_line_width (cr, 1);
  39. @@ -251,20 +251,20 @@ xfce_clock_analog_expose_event (GtkWidget *widget,
  40. if (analog->show_seconds)
  41. {
  42. /* second pointer */
  43. - angle = TICKS_TO_RADIANS (g_date_time_get_second (time));
  44. + angle = TICKS_TO_RADIANS (g_date_time_get_second (date_time));
  45. xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.7, TRUE);
  46. }
  47.  
  48. /* minute pointer */
  49. - angle = TICKS_TO_RADIANS (g_date_time_get_minute (time));
  50. + angle = TICKS_TO_RADIANS (g_date_time_get_minute (date_time));
  51. xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.8, FALSE);
  52.  
  53. /* hour pointer */
  54. - angle = HOURS_TO_RADIANS (g_date_time_get_hour (time), g_date_time_get_minute (time));
  55. + angle = HOURS_TO_RADIANS (g_date_time_get_hour (date_time), g_date_time_get_minute (date_time));
  56. xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.5, FALSE);
  57.  
  58. /* cleanup */
  59. - g_date_time_unref (time);
  60. + g_date_time_unref (date_time);
  61. cairo_destroy (cr);
  62. }
  63.  
  64. @@ -347,12 +347,12 @@ xfce_clock_analog_draw_pointer (cairo_t *cr,
  65.  
  66. static gboolean
  67. xfce_clock_analog_update (XfceClockAnalog *analog,
  68. - ClockTime *time)
  69. + ClockTime *clock_time)
  70. {
  71. GtkWidget *widget = GTK_WIDGET (analog);
  72.  
  73. panel_return_val_if_fail (XFCE_CLOCK_IS_ANALOG (analog), FALSE);
  74. - panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), FALSE);
  75. + panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), FALSE);
  76.  
  77. /* update if the widget if visible */
  78. if (G_LIKELY (GTK_WIDGET_VISIBLE (widget)))
  79. @@ -364,11 +364,11 @@ xfce_clock_analog_update (XfceClockAnalog *analog,
  80.  
  81.  
  82. GtkWidget *
  83. -xfce_clock_analog_new (ClockTime *time)
  84. +xfce_clock_analog_new (ClockTime *clock_time)
  85. {
  86. XfceClockAnalog *analog = g_object_new (XFCE_CLOCK_TYPE_ANALOG, NULL);
  87.  
  88. - analog->time = time;
  89. + analog->time = clock_time;
  90. analog->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
  91. analog->time,
  92. G_CALLBACK (xfce_clock_analog_update), analog);
  93. diff --git a/plugins/clock/clock-binary.c b/plugins/clock/clock-binary.c
  94. index 4751c51..46b852c 100644
  95. --- a/plugins/clock/clock-binary.c
  96. +++ b/plugins/clock/clock-binary.c
  97. @@ -262,7 +262,7 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
  98. GtkAllocation *alloc)
  99. {
  100. GdkColor *active, *inactive;
  101. - GDateTime *time;
  102. + GDateTime *date_time;
  103. gint row, rows;
  104. static gint binary_table[] = { 32, 16, 8, 4, 2, 1 };
  105. gint col, cols = G_N_ELEMENTS (binary_table);
  106. @@ -282,7 +282,7 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
  107. active = &(GTK_WIDGET (binary)->style->dark[GTK_STATE_SELECTED]);
  108. }
  109.  
  110. - time = clock_time_get_time (binary->time);
  111. + date_time = clock_time_get_time (binary->time);
  112.  
  113. /* init sizes */
  114. remain_h = alloc->height;
  115. @@ -293,11 +293,11 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
  116. {
  117. /* get the time this row represents */
  118. if (row == 0)
  119. - ticks = g_date_time_get_hour (time);
  120. + ticks = g_date_time_get_hour (date_time);
  121. else if (row == 1)
  122. - ticks = g_date_time_get_minute (time);
  123. + ticks = g_date_time_get_minute (date_time);
  124. else
  125. - ticks = g_date_time_get_second (time);
  126. + ticks = g_date_time_get_second (date_time);
  127.  
  128. /* reset sizes */
  129. remain_w = alloc->width;
  130. @@ -336,7 +336,7 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
  131. offset_y += h;
  132. }
  133.  
  134. - g_date_time_unref (time);
  135. + g_date_time_unref (date_time);
  136. }
  137.  
  138.  
  139. @@ -348,7 +348,7 @@ xfce_clock_binary_expose_event_binary (XfceClockBinary *binary,
  140. {
  141. GdkColor *active, *inactive;
  142. static gint binary_table[] = { 80, 40, 20, 10, 8, 4, 2, 1 };
  143. - GDateTime *time;
  144. + GDateTime *date_time;
  145. gint row, rows = G_N_ELEMENTS (binary_table) / 2;
  146. gint col, cols;
  147. gint digit;
  148. @@ -368,7 +368,7 @@ xfce_clock_binary_expose_event_binary (XfceClockBinary *binary,
  149. active = &(GTK_WIDGET (binary)->style->dark[GTK_STATE_SELECTED]);
  150. }
  151.  
  152. - time = clock_time_get_time (binary->time);
  153. + date_time = clock_time_get_time (binary->time);
  154.  
  155. remain_w = alloc->width;
  156. offset_x = alloc->x;
  157. @@ -379,11 +379,11 @@ xfce_clock_binary_expose_event_binary (XfceClockBinary *binary,
  158. {
  159. /* get the time this row represents */
  160. if (col == 0)
  161. - ticks = g_date_time_get_hour (time);
  162. + ticks = g_date_time_get_hour (date_time);
  163. else if (col == 2)
  164. - ticks = g_date_time_get_minute (time);
  165. + ticks = g_date_time_get_minute (date_time);
  166. else if (col == 4)
  167. - ticks = g_date_time_get_second (time);
  168. + ticks = g_date_time_get_second (date_time);
  169.  
  170. /* reset sizes */
  171. remain_h = alloc->height;
  172. @@ -520,7 +520,7 @@ xfce_clock_binary_expose_event (GtkWidget *widget,
  173.  
  174. static gboolean
  175. xfce_clock_binary_update (XfceClockBinary *binary,
  176. - ClockTime *time)
  177. + ClockTime *clock_time)
  178. {
  179. GtkWidget *widget = GTK_WIDGET (binary);
  180.  
  181. @@ -536,11 +536,11 @@ xfce_clock_binary_update (XfceClockBinary *binary,
  182.  
  183.  
  184. GtkWidget *
  185. -xfce_clock_binary_new (ClockTime *time)
  186. +xfce_clock_binary_new (ClockTime *clock_time)
  187. {
  188. XfceClockBinary *binary = g_object_new (XFCE_CLOCK_TYPE_BINARY, NULL);
  189.  
  190. - binary->time = time;
  191. + binary->time = clock_time;
  192. binary->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
  193. binary->time,
  194. G_CALLBACK (xfce_clock_binary_update), binary);
  195. diff --git a/plugins/clock/clock-digital.c b/plugins/clock/clock-digital.c
  196. index c293ed2..34e7019 100644
  197. --- a/plugins/clock/clock-digital.c
  198. +++ b/plugins/clock/clock-digital.c
  199. @@ -194,12 +194,12 @@ xfce_clock_digital_finalize (GObject *object)
  200.  
  201. static gboolean
  202. xfce_clock_digital_update (XfceClockDigital *digital,
  203. - ClockTime *time)
  204. + ClockTime *clock_time)
  205. {
  206. gchar *string;
  207.  
  208. panel_return_val_if_fail (XFCE_CLOCK_IS_DIGITAL (digital), FALSE);
  209. - panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), FALSE);
  210. + panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), FALSE);
  211.  
  212. /* set time string */
  213. string = clock_time_strdup_strftime (digital->time, digital->format);
  214. @@ -212,11 +212,11 @@ xfce_clock_digital_update (XfceClockDigital *digital,
  215.  
  216.  
  217. GtkWidget *
  218. -xfce_clock_digital_new (ClockTime *time)
  219. +xfce_clock_digital_new (ClockTime *clock_time)
  220. {
  221. XfceClockDigital *digital = g_object_new (XFCE_CLOCK_TYPE_DIGITAL, NULL);
  222.  
  223. - digital->time = time;
  224. + digital->time = clock_time;
  225. digital->timeout = clock_time_timeout_new (clock_time_interval_from_format (digital->format),
  226. digital->time,
  227. G_CALLBACK (xfce_clock_digital_update), digital);
  228. diff --git a/plugins/clock/clock-fuzzy.c b/plugins/clock/clock-fuzzy.c
  229. index 7b0aa41..4b361dd 100644
  230. --- a/plugins/clock/clock-fuzzy.c
  231. +++ b/plugins/clock/clock-fuzzy.c
  232. @@ -275,7 +275,7 @@ xfce_clock_fuzzy_finalize (GObject *object)
  233.  
  234. static gboolean
  235. xfce_clock_fuzzy_update (XfceClockFuzzy *fuzzy,
  236. - ClockTime *time)
  237. + ClockTime *clock_time)
  238. {
  239. GDateTime *date_time;
  240. gint sector;
  241. @@ -353,11 +353,11 @@ xfce_clock_fuzzy_update (XfceClockFuzzy *fuzzy,
  242.  
  243.  
  244. GtkWidget *
  245. -xfce_clock_fuzzy_new (ClockTime *time)
  246. +xfce_clock_fuzzy_new (ClockTime *clock_time)
  247. {
  248. XfceClockFuzzy *fuzzy = g_object_new (XFCE_CLOCK_TYPE_FUZZY, NULL);
  249.  
  250. - fuzzy->time = time;
  251. + fuzzy->time = clock_time;
  252. fuzzy->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
  253. fuzzy->time,
  254. G_CALLBACK (xfce_clock_fuzzy_update), fuzzy);
  255. diff --git a/plugins/clock/clock-lcd.c b/plugins/clock/clock-lcd.c
  256. index 84e74e6..b180d30 100644
  257. --- a/plugins/clock/clock-lcd.c
  258. +++ b/plugins/clock/clock-lcd.c
  259. @@ -285,7 +285,7 @@ xfce_clock_lcd_expose_event (GtkWidget *widget,
  260. gint ticks, i;
  261. gdouble size;
  262. gdouble ratio;
  263. - GDateTime *time;
  264. + GDateTime *date_time;
  265.  
  266. panel_return_val_if_fail (XFCE_CLOCK_IS_LCD (lcd), FALSE);
  267.  
  268. @@ -317,10 +317,10 @@ xfce_clock_lcd_expose_event (GtkWidget *widget,
  269. cairo_set_line_width (cr, MAX (size * 0.05, 1.5));
  270.  
  271. /* get the local time */
  272. - time = clock_time_get_time (lcd->time);
  273. + date_time = clock_time_get_time (lcd->time);
  274.  
  275. /* draw the hours */
  276. - ticks = g_date_time_get_hour (time);
  277. + ticks = g_date_time_get_hour (date_time);
  278.  
  279. /* convert 24h clock to 12h clock */
  280. if (!lcd->show_military && ticks > 12)
  281. @@ -333,8 +333,8 @@ xfce_clock_lcd_expose_event (GtkWidget *widget,
  282. * because we might miss the exact second (due to slightly delayed
  283. * timeout) we queue a resize the first 3 seconds or anything in
  284. * the first minute */
  285. - if ((ticks == 10 || ticks == 0) && g_date_time_get_minute (time) == 0
  286. - && (!lcd->show_seconds || g_date_time_get_second (time) < 3))
  287. + if ((ticks == 10 || ticks == 0) && g_date_time_get_minute (date_time) == 0
  288. + && (!lcd->show_seconds || g_date_time_get_second (date_time) < 3))
  289. g_object_notify (G_OBJECT (lcd), "size-ratio");
  290.  
  291. if (ticks >= 10)
  292. @@ -352,7 +352,7 @@ xfce_clock_lcd_expose_event (GtkWidget *widget,
  293. if (i == 0)
  294. {
  295. /* get the minutes */
  296. - ticks = g_date_time_get_minute (time);
  297. + ticks = g_date_time_get_minute (date_time);
  298. }
  299. else
  300. {
  301. @@ -361,11 +361,11 @@ xfce_clock_lcd_expose_event (GtkWidget *widget,
  302. break;
  303.  
  304. /* get the seconds */
  305. - ticks = g_date_time_get_second (time);
  306. + ticks = g_date_time_get_second (date_time);
  307. }
  308.  
  309. /* draw the dots */
  310. - if (lcd->flash_separators && (g_date_time_get_second (time) % 2) == 1)
  311. + if (lcd->flash_separators && (g_date_time_get_second (date_time) % 2) == 1)
  312. offset_x += size * RELATIVE_SPACE * 2;
  313. else
  314. offset_x = xfce_clock_lcd_draw_dots (cr, size, offset_x, offset_y);
  315. @@ -380,14 +380,14 @@ xfce_clock_lcd_expose_event (GtkWidget *widget,
  316. if (lcd->show_meridiem)
  317. {
  318. /* am or pm? */
  319. - ticks = g_date_time_get_hour (time) >= 12 ? 11 : 10;
  320. + ticks = g_date_time_get_hour (date_time) >= 12 ? 11 : 10;
  321.  
  322. /* draw the digit */
  323. offset_x = xfce_clock_lcd_draw_digit (cr, ticks, size, offset_x, offset_y);
  324. }
  325.  
  326. /* drop the pushed group */
  327. - g_date_time_unref (time);
  328. + g_date_time_unref (date_time);
  329. cairo_pop_group_to_source (cr);
  330. cairo_paint (cr);
  331. cairo_destroy (cr);
  332. @@ -403,16 +403,16 @@ xfce_clock_lcd_get_ratio (XfceClockLcd *lcd)
  333. {
  334. gdouble ratio;
  335. gint ticks;
  336. - GDateTime *time;
  337. + GDateTime *date_time;
  338.  
  339. /* get the local time */
  340. - time = clock_time_get_time (lcd->time);
  341. + date_time = clock_time_get_time (lcd->time);
  342.  
  343. /* 8:8(space)8 */
  344. ratio = (3 * RELATIVE_DIGIT) + RELATIVE_DOTS + RELATIVE_SPACE;
  345.  
  346. - ticks = g_date_time_get_hour (time);
  347. - g_date_time_unref (time);
  348. + ticks = g_date_time_get_hour (date_time);
  349. + g_date_time_unref (date_time);
  350.  
  351. if (!lcd->show_military && ticks > 12)
  352. ticks -= 12;
  353. @@ -584,7 +584,7 @@ xfce_clock_lcd_draw_digit (cairo_t *cr,
  354.  
  355. static gboolean
  356. xfce_clock_lcd_update (XfceClockLcd *lcd,
  357. - ClockTime *time)
  358. + ClockTime *clock_time)
  359. {
  360. GtkWidget *widget = GTK_WIDGET (lcd);
  361.  
  362. @@ -600,11 +600,11 @@ xfce_clock_lcd_update (XfceClockLcd *lcd,
  363.  
  364.  
  365. GtkWidget *
  366. -xfce_clock_lcd_new (ClockTime *time)
  367. +xfce_clock_lcd_new (ClockTime *clock_time)
  368. {
  369. XfceClockLcd *lcd = g_object_new (XFCE_CLOCK_TYPE_LCD, NULL);
  370.  
  371. - lcd->time = time;
  372. + lcd->time = clock_time;
  373. lcd->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
  374. lcd->time,
  375. G_CALLBACK (xfce_clock_lcd_update), lcd);
  376. diff --git a/plugins/clock/clock-time.c b/plugins/clock/clock-time.c
  377. index 16b0f89..b015b13 100644
  378. --- a/plugins/clock/clock-time.c
  379. +++ b/plugins/clock/clock-time.c
  380. @@ -107,10 +107,10 @@ clock_time_class_init (ClockTimeClass *klass)
  381.  
  382.  
  383. static void
  384. -clock_time_init (ClockTime *time)
  385. +clock_time_init (ClockTime *clock_time)
  386. {
  387. - time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
  388. - time->timezone = g_time_zone_new_local ();
  389. + clock_time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
  390. + clock_time->timezone = g_time_zone_new_local ();
  391. }
  392.  
  393.  
  394. @@ -118,11 +118,11 @@ clock_time_init (ClockTime *time)
  395. static void
  396. clock_time_finalize (GObject *object)
  397. {
  398. - ClockTime *time = XFCE_CLOCK_TIME (object);
  399. + ClockTime *clock_time = XFCE_CLOCK_TIME (object);
  400.  
  401. - g_free (time->timezone_name);
  402. + g_free (clock_time->timezone_name);
  403.  
  404. - g_time_zone_unref (time->timezone);
  405. + g_time_zone_unref (clock_time->timezone);
  406.  
  407. G_OBJECT_CLASS (clock_time_parent_class)->finalize (object);
  408. }
  409. @@ -135,12 +135,12 @@ clock_time_get_property (GObject *object,
  410. GValue *value,
  411. GParamSpec *pspec)
  412. {
  413. - ClockTime *time = XFCE_CLOCK_TIME (object);
  414. + ClockTime *clock_time = XFCE_CLOCK_TIME (object);
  415.  
  416. switch (prop_id)
  417. {
  418. case PROP_TIMEZONE:
  419. - g_value_set_string (value, time->timezone_name);
  420. + g_value_set_string (value, clock_time->timezone_name);
  421. break;
  422.  
  423. default:
  424. @@ -157,29 +157,29 @@ clock_time_set_property (GObject *object,
  425. const GValue *value,
  426. GParamSpec *pspec)
  427. {
  428. - ClockTime *time = XFCE_CLOCK_TIME (object);
  429. + ClockTime *clock_time = XFCE_CLOCK_TIME (object);
  430. const gchar *str_value;
  431.  
  432. switch (prop_id)
  433. {
  434. case PROP_TIMEZONE:
  435. str_value = g_value_get_string (value);
  436. - if (g_strcmp0 (time->timezone_name, str_value) != 0)
  437. + if (g_strcmp0 (clock_time->timezone_name, str_value) != 0)
  438. {
  439. - g_free (time->timezone_name);
  440. - g_time_zone_unref (time->timezone);
  441. + g_free (clock_time->timezone_name);
  442. + g_time_zone_unref (clock_time->timezone);
  443. if (str_value == NULL || g_strcmp0 (str_value, "") == 0)
  444. {
  445. - time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
  446. - time->timezone = g_time_zone_new_local ();
  447. + clock_time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
  448. + clock_time->timezone = g_time_zone_new_local ();
  449. }
  450. else
  451. {
  452. - time->timezone_name = g_strdup (str_value);
  453. - time->timezone = g_time_zone_new (str_value);
  454. + clock_time->timezone_name = g_strdup (str_value);
  455. + clock_time->timezone = g_time_zone_new (str_value);
  456. }
  457.  
  458. - g_signal_emit (G_OBJECT (time), clock_time_signals[TIME_CHANGED], 0);
  459. + g_signal_emit (G_OBJECT (clock_time), clock_time_signals[TIME_CHANGED], 0);
  460. }
  461. break;
  462.  
  463. @@ -192,14 +192,14 @@ clock_time_set_property (GObject *object,
  464.  
  465.  
  466. GDateTime *
  467. -clock_time_get_time (ClockTime *time)
  468. +clock_time_get_time (ClockTime *clock_time)
  469. {
  470. GDateTime *date_time;
  471.  
  472. - panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), NULL);
  473. + panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), NULL);
  474.  
  475. - if (time->timezone != NULL)
  476. - date_time = g_date_time_new_now (time->timezone);
  477. + if (clock_time->timezone != NULL)
  478. + date_time = g_date_time_new_now (clock_time->timezone);
  479. else
  480. date_time = g_date_time_new_now_local ();
  481.  
  482. @@ -209,15 +209,15 @@ clock_time_get_time (ClockTime *time)
  483.  
  484.  
  485. gchar *
  486. -clock_time_strdup_strftime (ClockTime *time,
  487. +clock_time_strdup_strftime (ClockTime *clock_time,
  488. const gchar *format)
  489. {
  490. GDateTime *date_time;
  491. gchar *str;
  492.  
  493. - panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), NULL);
  494. + panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), NULL);
  495.  
  496. - date_time = clock_time_get_time (time);
  497. + date_time = clock_time_get_time (clock_time);
  498. str = g_date_time_format (date_time, format);
  499.  
  500. g_date_time_unref (date_time);
  501. @@ -262,7 +262,7 @@ static gboolean
  502. clock_time_timeout_running (gpointer user_data)
  503. {
  504. ClockTimeTimeout *timeout = user_data;
  505. - GDateTime *time;
  506. + GDateTime *date_time;
  507.  
  508. g_signal_emit (G_OBJECT (timeout->time), clock_time_signals[TIME_CHANGED], 0);
  509.  
  510. @@ -270,8 +270,8 @@ clock_time_timeout_running (gpointer user_data)
  511. if (timeout->interval == CLOCK_INTERVAL_MINUTE)
  512. {
  513. /* sync again when we don't run on time */
  514. - time = clock_time_get_time (timeout->time);
  515. - timeout->restart = (g_date_time_get_second (time) != 0);
  516. + date_time = clock_time_get_time (timeout->time);
  517. + timeout->restart = (g_date_time_get_second (date_time) != 0);
  518. }
  519.  
  520. return !timeout->restart;
  521. @@ -312,13 +312,13 @@ clock_time_timeout_sync (gpointer user_data)
  522.  
  523. ClockTimeTimeout *
  524. clock_time_timeout_new (guint interval,
  525. - ClockTime *time,
  526. + ClockTime *clock_time,
  527. GCallback c_handler,
  528. gpointer gobject)
  529. {
  530. ClockTimeTimeout *timeout;
  531.  
  532. - panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), NULL);
  533. + panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), NULL);
  534.  
  535. panel_return_val_if_fail (interval > 0, NULL);
  536.  
  537. @@ -326,10 +326,10 @@ clock_time_timeout_new (guint interval,
  538. timeout->interval = 0;
  539. timeout->timeout_id = 0;
  540. timeout->restart = FALSE;
  541. - timeout->time = time;
  542. + timeout->time = clock_time;
  543.  
  544. timeout->time_changed_id =
  545. - g_signal_connect_swapped (G_OBJECT (time), "time-changed",
  546. + g_signal_connect_swapped (G_OBJECT (clock_time), "time-changed",
  547. c_handler, gobject);
  548.  
  549. g_object_ref (G_OBJECT (timeout->time));
  550. @@ -345,7 +345,7 @@ void
  551. clock_time_timeout_set_interval (ClockTimeTimeout *timeout,
  552. guint interval)
  553. {
  554. - GDateTime *time;
  555. + GDateTime *date_time;
  556. guint next_interval;
  557. gboolean restart;
  558.  
  559. @@ -372,8 +372,8 @@ clock_time_timeout_set_interval (ClockTimeTimeout *timeout,
  560. /* get the seconds to the next internal */
  561. if (interval == CLOCK_INTERVAL_MINUTE)
  562. {
  563. - time = clock_time_get_time (timeout->time);
  564. - next_interval = 60 - g_date_time_get_second (time);
  565. + date_time = clock_time_get_time (timeout->time);
  566. + next_interval = 60 - g_date_time_get_second (date_time);
  567. }
  568. else
  569. {
  570. diff --git a/plugins/clock/clock.c b/plugins/clock/clock.c
  571. index 6c80978..e07c17b 100644
  572. --- a/plugins/clock/clock.c
  573. +++ b/plugins/clock/clock.c
  574. @@ -1113,17 +1113,17 @@ static void
  575. clock_plugin_calendar_show_event (GtkWidget *calendar_window,
  576. ClockPlugin *plugin)
  577. {
  578. - GDateTime *time;
  579. + GDateTime *date_time;
  580.  
  581. panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
  582.  
  583. clock_plugin_reposition_calendar (plugin);
  584.  
  585. - time = clock_time_get_time (plugin->time);
  586. - gtk_calendar_select_month (GTK_CALENDAR (plugin->calendar), g_date_time_get_month (time) - 1,
  587. - g_date_time_get_year (time));
  588. - gtk_calendar_select_day (GTK_CALENDAR (plugin->calendar), g_date_time_get_day_of_month (time));
  589. - g_date_time_unref (time);
  590. + date_time = clock_time_get_time (plugin->time);
  591. + gtk_calendar_select_month (GTK_CALENDAR (plugin->calendar), g_date_time_get_month (date_time) - 1,
  592. + g_date_time_get_year (date_time));
  593. + gtk_calendar_select_day (GTK_CALENDAR (plugin->calendar), g_date_time_get_day_of_month (date_time));
  594. + g_date_time_unref (date_time);
  595. }
  596.  
  597.  
  598. --
  599. 1.7.9.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement