Browse Source

Fix compiler warnings in clock and handle xfconf init error.

upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
6cfc64c5f6
  1. 24
      panel/main.c
  2. 32
      plugins/clock/clock-lcd.c

24
panel/main.c

@ -149,19 +149,17 @@ main (gint argc, gchar **argv)
if (G_LIKELY (error))
{
/* print error */
g_print ("%s: %s.\n", G_LOG_DOMAIN, error->message);
g_print ("%s: %s.\n", PACKAGE_NAME, error->message);
g_print (_("Type '%s --help' for usage."), G_LOG_DOMAIN);
g_print ("\n");
/* cleanup */
g_error_free (error);
}
else
{
g_error ("Unable to open display.");
}
return EXIT_FAILURE;
}
else
{
g_error ("Unable to open display.");
}
/* leave */
return EXIT_FAILURE;
@ -230,8 +228,14 @@ main (gint argc, gchar **argv)
}
/* initialize xfconf */
/* TODO */
xfconf_init (NULL);
if (!xfconf_init (&error))
{
/* print error and exit */
g_error ("Failed to connect to xfconf daemon: %s.", error->message);
g_error_free (error);
return EXIT_FAILURE;
}
/* create dbus service */
dbus_service = panel_dbus_service_get ();

32
plugins/clock/clock-lcd.c

@ -454,8 +454,6 @@ xfce_clock_lcd_draw_digit (cairo_t *cr,
gdouble x, y;
gdouble rel_x, rel_y;
panel_return_val_if_fail (number <= 11, offset_x);
/* ##1##
* 6 2
* ##7##
@ -464,20 +462,20 @@ xfce_clock_lcd_draw_digit (cairo_t *cr,
*/
/* coordicates to draw for each segment */
gdouble segments_x[][6] = { { 0.02, 0.48, 0.38, 0.12, -1.0, 0.00 }, /* 1x */
{ 0.40, 0.505, 0.505, 0.40, -1.0, 0.00 }, /* 2x */
{ 0.40, 0.505, 0.505, 0.40, -1.0, 0.00 }, /* 3x */
{ 0.12, 0.38, 0.48, 0.02, -1.0, 0.00 }, /* 4x */
{ 0.00, 0.105, 0.105, 0.00, -1.0, 0.00 }, /* 5x */
{ 0.00, 0.105, 0.105, 0.00, -1.0, 0.00 }, /* 6x */
{ 0.00, 0.10, 0.40, 0.50, 0.40, 0.10 } }; /* 7x */
gdouble segments_y[][6] = { { 0.00, 0.00, 0.105, 0.105, -1.0, 0.00 }, /* 1y */
{ 0.12, 0.02, 0.48, 0.43, -1.0, 0.00 }, /* 2y */
{ 0.57, 0.52, 0.98, 0.88, -1.0, 0.00 }, /* 3y */
{ 0.90, 0.90, 1.00, 1.00, -1.0, 0.00 }, /* 4y */
{ 0.52, 0.57, 0.88, 0.98, -1.0, 0.00 }, /* 5y */
{ 0.02, 0.12, 0.43, 0.48, -1.0, 0.00 }, /* 6y */
{ 0.50, 0.445, 0.445, 0.50, 0.55, 0.55 } }; /* 7y */
gdouble segments_x[][6] = { { 0.02, 0.48, 0.38, 0.12, -1.0, 0.00 }, /* 1x */
{ 0.40, 0.505, 0.505, 0.40, -1.0, 0.00 }, /* 2x */
{ 0.40, 0.505, 0.505, 0.40, -1.0, 0.00 }, /* 3x */
{ 0.12, 0.38, 0.48, 0.02, -1.0, 0.00 }, /* 4x */
{ 0.00, 0.105, 0.105, 0.00, -1.0, 0.00 }, /* 5x */
{ 0.00, 0.105, 0.105, 0.00, -1.0, 0.00 }, /* 6x */
{ 0.00, 0.10, 0.40, 0.50, 0.40, 0.10 } }; /* 7x */
gdouble segments_y[][6] = { { 0.00, 0.00, 0.105, 0.105, -1.0, 0.00 }, /* 1y */
{ 0.12, 0.02, 0.48, 0.43, -1.0, 0.00 }, /* 2y */
{ 0.57, 0.52, 0.98, 0.88, -1.0, 0.00 }, /* 3y */
{ 0.90, 0.90, 1.00, 1.00, -1.0, 0.00 }, /* 4y */
{ 0.52, 0.57, 0.88, 0.98, -1.0, 0.00 }, /* 5y */
{ 0.02, 0.12, 0.43, 0.48, -1.0, 0.00 }, /* 6y */
{ 0.50, 0.445, 0.445, 0.50, 0.55, 0.55 } }; /* 7y */
/* segment to draw for each number: 0, 1, ..., 9, A, P */
gint numbers[][8] = { { 0, 1, 2, 3, 4, 5, -1 },
@ -493,6 +491,8 @@ xfce_clock_lcd_draw_digit (cairo_t *cr,
{ 4, 5, 0, 1, 2, 6, -1 },
{ 4, 5, 0, 1, 6, -1 } };
panel_return_val_if_fail (number <= 11, offset_x);
for (i = 0; i < 9; i++)
{
/* get the segment we're going to draw */

Loading…
Cancel
Save