aboutsummaryrefslogtreecommitdiffstats
path: root/smclient
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-16 23:25:56 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:09:00 +0800
commit777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 (patch)
treedfab9ca8f30c7b1539f86dfe19b8bf761d6a899c /smclient
parent83675abbc2b3a3bc6421094a56651d021fc0cdcd (diff)
downloadgsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.gz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.bz2
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.lz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.xz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.zst
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'smclient')
-rw-r--r--smclient/eggdesktopfile.c149
-rw-r--r--smclient/eggsmclient-xsmp.c120
-rw-r--r--smclient/eggsmclient.c26
3 files changed, 154 insertions, 141 deletions
diff --git a/smclient/eggdesktopfile.c b/smclient/eggdesktopfile.c
index 9020a2626d..19dc355273 100644
--- a/smclient/eggdesktopfile.c
+++ b/smclient/eggdesktopfile.c
@@ -53,7 +53,8 @@ struct EggDesktopFile {
* Return value: the new #EggDesktopFile, or %NULL on error.
**/
EggDesktopFile *
-egg_desktop_file_new (const gchar *desktop_file_path, GError **error)
+egg_desktop_file_new (const gchar *desktop_file_path,
+ GError **error)
{
GKeyFile *key_file;
@@ -80,8 +81,8 @@ egg_desktop_file_new (const gchar *desktop_file_path, GError **error)
* Return value: the new #EggDesktopFile, or %NULL on error.
**/
EggDesktopFile *
-egg_desktop_file_new_from_data_dirs (const gchar *desktop_file_path,
- GError **error)
+egg_desktop_file_new_from_data_dirs (const gchar *desktop_file_path,
+ GError **error)
{
EggDesktopFile *desktop_file;
GKeyFile *key_file;
@@ -115,9 +116,9 @@ egg_desktop_file_new_from_data_dirs (const gchar *desktop_file_path,
* Return value: the new #EggDesktopFile, or %NULL on error.
**/
EggDesktopFile *
-egg_desktop_file_new_from_dirs (const gchar *desktop_file_path,
- const gchar **search_dirs,
- GError **error)
+egg_desktop_file_new_from_dirs (const gchar *desktop_file_path,
+ const gchar **search_dirs,
+ GError **error)
{
EggDesktopFile *desktop_file;
GKeyFile *key_file;
@@ -151,9 +152,9 @@ egg_desktop_file_new_from_dirs (const gchar *desktop_file_path,
* Return value: the new #EggDesktopFile, or %NULL on error.
**/
EggDesktopFile *
-egg_desktop_file_new_from_key_file (GKeyFile *key_file,
- const gchar *source,
- GError **error)
+egg_desktop_file_new_from_key_file (GKeyFile *key_file,
+ const gchar *source,
+ GError **error)
{
EggDesktopFile *desktop_file;
gchar *version, *type;
@@ -381,9 +382,9 @@ egg_desktop_file_get_icon (EggDesktopFile *desktop_file)
}
gboolean
-egg_desktop_file_has_key (EggDesktopFile *desktop_file,
- const gchar *key,
- GError **error)
+egg_desktop_file_has_key (EggDesktopFile *desktop_file,
+ const gchar *key,
+ GError **error)
{
return g_key_file_has_key (desktop_file->key_file,
EGG_DESKTOP_FILE_GROUP, key,
@@ -391,9 +392,9 @@ egg_desktop_file_has_key (EggDesktopFile *desktop_file,
}
gchar *
-egg_desktop_file_get_string (EggDesktopFile *desktop_file,
- const gchar *key,
- GError **error)
+egg_desktop_file_get_string (EggDesktopFile *desktop_file,
+ const gchar *key,
+ GError **error)
{
return g_key_file_get_string (desktop_file->key_file,
EGG_DESKTOP_FILE_GROUP, key,
@@ -401,10 +402,10 @@ egg_desktop_file_get_string (EggDesktopFile *desktop_file,
}
gchar *
-egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file,
- const gchar *key,
- const gchar *locale,
- GError **error)
+egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file,
+ const gchar *key,
+ const gchar *locale,
+ GError **error)
{
return g_key_file_get_locale_string (desktop_file->key_file,
EGG_DESKTOP_FILE_GROUP, key, locale,
@@ -412,9 +413,9 @@ egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file,
}
gboolean
-egg_desktop_file_get_boolean (EggDesktopFile *desktop_file,
- const gchar *key,
- GError **error)
+egg_desktop_file_get_boolean (EggDesktopFile *desktop_file,
+ const gchar *key,
+ GError **error)
{
return g_key_file_get_boolean (desktop_file->key_file,
EGG_DESKTOP_FILE_GROUP, key,
@@ -422,9 +423,9 @@ egg_desktop_file_get_boolean (EggDesktopFile *desktop_file,
}
gdouble
-egg_desktop_file_get_numeric (EggDesktopFile *desktop_file,
- const gchar *key,
- GError **error)
+egg_desktop_file_get_numeric (EggDesktopFile *desktop_file,
+ const gchar *key,
+ GError **error)
{
return g_key_file_get_double (desktop_file->key_file,
EGG_DESKTOP_FILE_GROUP, key,
@@ -432,10 +433,10 @@ egg_desktop_file_get_numeric (EggDesktopFile *desktop_file,
}
gchar **
-egg_desktop_file_get_string_list (EggDesktopFile *desktop_file,
- const gchar *key,
- gsize *length,
- GError **error)
+egg_desktop_file_get_string_list (EggDesktopFile *desktop_file,
+ const gchar *key,
+ gsize *length,
+ GError **error)
{
return g_key_file_get_string_list (desktop_file->key_file,
EGG_DESKTOP_FILE_GROUP, key, length,
@@ -443,11 +444,11 @@ egg_desktop_file_get_string_list (EggDesktopFile *desktop_file,
}
gchar **
-egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file,
- const gchar *key,
- const gchar *locale,
- gsize *length,
- GError **error)
+egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file,
+ const gchar *key,
+ const gchar *locale,
+ gsize *length,
+ GError **error)
{
return g_key_file_get_locale_string_list (desktop_file->key_file,
EGG_DESKTOP_FILE_GROUP, key,
@@ -477,7 +478,7 @@ egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file,
**/
gboolean
egg_desktop_file_can_launch (EggDesktopFile *desktop_file,
- const gchar *desktop_environment)
+ const gchar *desktop_environment)
{
gchar *try_exec, *found_program;
gchar **only_show_in, **not_show_in;
@@ -599,10 +600,10 @@ egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file)
}
static void
-append_quoted_word (GString *str,
- const gchar *s,
- gboolean in_single_quotes,
- gboolean in_double_quotes)
+append_quoted_word (GString *str,
+ const gchar *s,
+ gboolean in_single_quotes,
+ gboolean in_double_quotes)
{
const gchar *p;
@@ -632,11 +633,11 @@ append_quoted_word (GString *str,
static void
do_percent_subst (EggDesktopFile *desktop_file,
- gchar code,
- GString *str,
- GSList **documents,
- gboolean in_single_quotes,
- gboolean in_double_quotes)
+ gchar code,
+ GString *str,
+ GSList **documents,
+ gboolean in_single_quotes,
+ gboolean in_double_quotes)
{
GSList *d;
gchar *doc;
@@ -710,9 +711,9 @@ do_percent_subst (EggDesktopFile *desktop_file,
}
static gchar *
-parse_exec (EggDesktopFile *desktop_file,
- GSList **documents,
- GError **error)
+parse_exec (EggDesktopFile *desktop_file,
+ GSList **documents,
+ GError **error)
{
gchar *exec, *p, *command;
gboolean escape, single_quot, double_quot;
@@ -803,7 +804,8 @@ parse_exec (EggDesktopFile *desktop_file,
}
static GSList *
-translate_document_list (EggDesktopFile *desktop_file, GSList *documents)
+translate_document_list (EggDesktopFile *desktop_file,
+ GSList *documents)
{
gboolean accepts_uris = egg_desktop_file_accepts_uris (desktop_file);
GSList *ret, *d;
@@ -863,9 +865,9 @@ free_document_list (GSList *documents)
* Return value: the parsed Exec string
**/
gchar *
-egg_desktop_file_parse_exec (EggDesktopFile *desktop_file,
- GSList *documents,
- GError **error)
+egg_desktop_file_parse_exec (EggDesktopFile *desktop_file,
+ GSList *documents,
+ GError **error)
{
GSList *translated, *docs;
gchar *command;
@@ -878,10 +880,10 @@ egg_desktop_file_parse_exec (EggDesktopFile *desktop_file,
}
static gboolean
-parse_link (EggDesktopFile *desktop_file,
- EggDesktopFile **app_desktop_file,
- GSList **documents,
- GError **error)
+parse_link (EggDesktopFile *desktop_file,
+ EggDesktopFile **app_desktop_file,
+ GSList **documents,
+ GError **error)
{
gchar *url;
GKeyFile *key_file;
@@ -910,12 +912,12 @@ parse_link (EggDesktopFile *desktop_file,
}
static gchar *
-start_startup_notification (GdkDisplay *display,
- EggDesktopFile *desktop_file,
- const gchar *argv0,
- gint screen,
- gint workspace,
- guint32 launch_time)
+start_startup_notification (GdkDisplay *display,
+ EggDesktopFile *desktop_file,
+ const gchar *argv0,
+ gint screen,
+ gint workspace,
+ guint32 launch_time)
{
static gint sequence = 0;
gchar *startup_id;
@@ -944,15 +946,15 @@ start_startup_notification (GdkDisplay *display,
return NULL;
}
- if (launch_time == (guint32)-1)
+ if (launch_time == (guint32) - 1)
launch_time = gdk_x11_display_get_user_time (display);
startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
g_get_prgname (),
- (unsigned long) getpid (),
+ (gulong) getpid (),
g_get_host_name (),
argv0,
sequence++,
- (unsigned long) launch_time);
+ (gulong) launch_time);
description = g_strdup_printf (_("Starting %s"), desktop_file->name);
screen_str = g_strdup_printf ("%d", screen);
@@ -979,7 +981,7 @@ start_startup_notification (GdkDisplay *display,
static void
end_startup_notification (GdkDisplay *display,
- const gchar *startup_id)
+ const gchar *startup_id)
{
gdk_x11_display_broadcast_startup_message (display, "remove",
"ID", startup_id,
@@ -1008,7 +1010,7 @@ startup_notification_timeout (gpointer data)
static void
set_startup_notification_timeout (GdkDisplay *display,
- const gchar *startup_id)
+ const gchar *startup_id)
{
StartupNotificationData *sn_data;
@@ -1021,7 +1023,8 @@ set_startup_notification_timeout (GdkDisplay *display,
}
static GPtrArray *
-array_putenv (GPtrArray *env, gchar *variable)
+array_putenv (GPtrArray *env,
+ gchar *variable)
{
guint i, keylen;
@@ -1066,8 +1069,9 @@ array_putenv (GPtrArray *env, gchar *variable)
static gboolean
egg_desktop_file_launchv (EggDesktopFile *desktop_file,
- GSList *documents, va_list args,
- GError **error)
+ GSList *documents,
+ va_list args,
+ GError **error)
{
EggDesktopFileLaunchOption option;
GSList *translated_documents = NULL, *docs = NULL;
@@ -1082,7 +1086,7 @@ egg_desktop_file_launchv (EggDesktopFile *desktop_file,
GdkScreen *screen = NULL;
gint workspace = -1;
const gchar *directory = NULL;
- guint32 launch_time = (guint32)-1;
+ guint32 launch_time = (guint32) - 1;
GSpawnFlags flags = G_SPAWN_SEARCH_PATH;
GSpawnChildSetupFunc setup_func = NULL;
gpointer setup_data = NULL;
@@ -1341,8 +1345,9 @@ egg_desktop_file_launchv (EggDesktopFile *desktop_file,
**/
gboolean
egg_desktop_file_launch (EggDesktopFile *desktop_file,
- GSList *documents, GError **error,
- ...)
+ GSList *documents,
+ GError **error,
+ ...)
{
va_list args;
gboolean success;
diff --git a/smclient/eggsmclient-xsmp.c b/smclient/eggsmclient-xsmp.c
index c643284701..3622d95d89 100644
--- a/smclient/eggsmclient-xsmp.c
+++ b/smclient/eggsmclient-xsmp.c
@@ -176,7 +176,7 @@ static gboolean process_ice_messages (IceConn ice_conn);
static void smc_error_handler (SmcConn smc_conn,
Bool swap,
gint offending_minor_opcode,
- unsigned long offending_sequence,
+ gulong offending_sequence,
gint error_class,
gint severity,
SmPointer values);
@@ -323,7 +323,7 @@ sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp)
static void
sm_client_xsmp_startup (EggSMClient *client,
- const gchar *client_id)
+ const gchar *client_id)
{
EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client;
SmcCallbacks callbacks;
@@ -399,9 +399,9 @@ sm_client_xsmp_startup (EggSMClient *client,
}
static void
-sm_client_xsmp_set_restart_command (EggSMClient *client,
- gint argc,
- const gchar **argv)
+sm_client_xsmp_set_restart_command (EggSMClient *client,
+ gint argc,
+ const gchar **argv)
{
EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client;
gint i;
@@ -418,7 +418,7 @@ sm_client_xsmp_set_restart_command (EggSMClient *client,
static void
sm_client_xsmp_will_quit (EggSMClient *client,
- gboolean will_quit)
+ gboolean will_quit)
{
EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client;
@@ -455,9 +455,9 @@ sm_client_xsmp_will_quit (EggSMClient *client,
}
static gboolean
-sm_client_xsmp_end_session (EggSMClient *client,
- EggSMClientEndStyle style,
- gboolean request_confirmation)
+sm_client_xsmp_end_session (EggSMClient *client,
+ EggSMClientEndStyle style,
+ gboolean request_confirmation)
{
EggSMClientXSMP *xsmp = (EggSMClientXSMP *) client;
gint save_type;
@@ -603,9 +603,10 @@ update_pending_events (EggSMClientXSMP *xsmp)
}
static void
-fix_broken_state (EggSMClientXSMP *xsmp, const gchar *message,
- gboolean send_interact_done,
- gboolean send_save_yourself_done)
+fix_broken_state (EggSMClientXSMP *xsmp,
+ const gchar *message,
+ gboolean send_interact_done,
+ gboolean send_save_yourself_done)
{
g_warning ("Received XSMP %s message in state %s: client or server error",
message, EGG_SM_CLIENT_XSMP_STATE (xsmp));
@@ -626,12 +627,12 @@ fix_broken_state (EggSMClientXSMP *xsmp, const gchar *message,
/* SM callbacks */
static void
-xsmp_save_yourself (SmcConn smc_conn,
- SmPointer client_data,
- gint save_type,
- Bool shutdown,
- gint interact_style,
- Bool fast)
+xsmp_save_yourself (SmcConn smc_conn,
+ SmPointer client_data,
+ gint save_type,
+ Bool shutdown,
+ gint interact_style,
+ Bool fast)
{
EggSMClientXSMP *xsmp = client_data;
gboolean wants_quit_requested;
@@ -946,8 +947,8 @@ save_state (EggSMClientXSMP *xsmp)
}
static void
-xsmp_interact (SmcConn smc_conn,
- SmPointer client_data)
+xsmp_interact (SmcConn smc_conn,
+ SmPointer client_data)
{
EggSMClientXSMP *xsmp = client_data;
EggSMClient *client = client_data;
@@ -966,8 +967,8 @@ xsmp_interact (SmcConn smc_conn,
}
static void
-xsmp_die (SmcConn smc_conn,
- SmPointer client_data)
+xsmp_die (SmcConn smc_conn,
+ SmPointer client_data)
{
EggSMClientXSMP *xsmp = client_data;
EggSMClient *client = client_data;
@@ -980,8 +981,8 @@ xsmp_die (SmcConn smc_conn,
}
static void
-xsmp_save_complete (SmcConn smc_conn,
- SmPointer client_data)
+xsmp_save_complete (SmcConn smc_conn,
+ SmPointer client_data)
{
EggSMClientXSMP *xsmp = client_data;
@@ -995,8 +996,8 @@ xsmp_save_complete (SmcConn smc_conn,
}
static void
-xsmp_shutdown_cancelled (SmcConn smc_conn,
- SmPointer client_data)
+xsmp_shutdown_cancelled (SmcConn smc_conn,
+ SmPointer client_data)
{
EggSMClientXSMP *xsmp = client_data;
EggSMClient *client = client_data;
@@ -1059,8 +1060,9 @@ xsmp_shutdown_cancelled (SmcConn smc_conn,
* then free the array, but not its contents.
*/
static GPtrArray *
-generate_command (gchar **restart_command, const gchar *client_id,
- const gchar *state_file)
+generate_command (gchar **restart_command,
+ const gchar *client_id,
+ const gchar *state_file)
{
GPtrArray *cmd;
gint i;
@@ -1091,7 +1093,8 @@ generate_command (gchar **restart_command, const gchar *client_id,
* frees them.
*/
static void
-set_properties (EggSMClientXSMP *xsmp, ...)
+set_properties (EggSMClientXSMP *xsmp,
+ ...)
{
GPtrArray *props;
SmProp *prop;
@@ -1122,7 +1125,8 @@ set_properties (EggSMClientXSMP *xsmp, ...)
/* Takes a NULL-terminated list of property names and deletes them. */
static void
-delete_properties (EggSMClientXSMP *xsmp, ...)
+delete_properties (EggSMClientXSMP *xsmp,
+ ...)
{
GPtrArray *props;
gchar *prop;
@@ -1149,7 +1153,8 @@ delete_properties (EggSMClientXSMP *xsmp, ...)
* until you're done with the SmProp.
*/
static SmProp *
-array_prop (const gchar *name, ...)
+array_prop (const gchar *name,
+ ...)
{
SmProp *prop;
SmPropValue pv;
@@ -1184,7 +1189,8 @@ array_prop (const gchar *name, ...)
* remain valid until you're done with the SmProp.
*/
static SmProp *
-ptrarray_prop (const gchar *name, GPtrArray *values)
+ptrarray_prop (const gchar *name,
+ GPtrArray *values)
{
SmProp *prop;
SmPropValue pv;
@@ -1217,7 +1223,8 @@ ptrarray_prop (const gchar *name, GPtrArray *values)
* done with the SmProp.
*/
static SmProp *
-string_prop (const gchar *name, const gchar *value)
+string_prop (const gchar *name,
+ const gchar *value)
{
SmProp *prop;
@@ -1236,7 +1243,8 @@ string_prop (const gchar *name, const gchar *value)
/* Takes a gchar and creates a CARD8 property. */
static SmProp *
-card8_prop (const gchar *name, guchar value)
+card8_prop (const gchar *name,
+ guchar value)
{
SmProp *prop;
gchar *card8val;
@@ -1277,7 +1285,7 @@ card8_prop (const gchar *name, guchar value)
static void ice_error_handler (IceConn ice_conn,
Bool swap,
gint offending_minor_opcode,
- unsigned long offending_sequence,
+ gulong offending_sequence,
gint error_class,
gint severity,
IcePointer values);
@@ -1322,18 +1330,18 @@ process_ice_messages (IceConn ice_conn)
}
static gboolean
-ice_iochannel_watch (GIOChannel *channel,
- GIOCondition condition,
- gpointer client_data)
+ice_iochannel_watch (GIOChannel *channel,
+ GIOCondition condition,
+ gpointer client_data)
{
return process_ice_messages (client_data);
}
static void
-ice_connection_watch (IceConn ice_conn,
- IcePointer client_data,
- Bool opening,
- IcePointer *watch_data)
+ice_connection_watch (IceConn ice_conn,
+ IcePointer client_data,
+ Bool opening,
+ IcePointer *watch_data)
{
guint watch_id;
@@ -1358,13 +1366,13 @@ ice_connection_watch (IceConn ice_conn,
}
static void
-ice_error_handler (IceConn ice_conn,
- Bool swap,
- gint offending_minor_opcode,
- unsigned long offending_sequence,
- gint error_class,
- gint severity,
- IcePointer values)
+ice_error_handler (IceConn ice_conn,
+ Bool swap,
+ gint offending_minor_opcode,
+ gulong offending_sequence,
+ gint error_class,
+ gint severity,
+ IcePointer values)
{
/* Do nothing */
}
@@ -1376,13 +1384,13 @@ ice_io_error_handler (IceConn ice_conn)
}
static void
-smc_error_handler (SmcConn smc_conn,
- Bool swap,
- gint offending_minor_opcode,
- unsigned long offending_sequence,
- gint error_class,
- gint severity,
- SmPointer values)
+smc_error_handler (SmcConn smc_conn,
+ Bool swap,
+ gint offending_minor_opcode,
+ gulong offending_sequence,
+ gint error_class,
+ gint severity,
+ SmPointer values)
{
/* Do nothing */
}
diff --git a/smclient/eggsmclient.c b/smclient/eggsmclient.c
index bbe352625b..91720c2832 100644
--- a/smclient/eggsmclient.c
+++ b/smclient/eggsmclient.c
@@ -182,10 +182,10 @@ static gchar *sm_client_id = NULL;
static gchar *sm_config_prefix = NULL;
static gboolean
-sm_client_post_parse_func (GOptionContext *context,
- GOptionGroup *group,
- gpointer data,
- GError **error)
+sm_client_post_parse_func (GOptionContext *context,
+ GOptionGroup *group,
+ gpointer data,
+ GError **error)
{
EggSMClient *client = egg_sm_client_get ();
@@ -435,9 +435,9 @@ egg_sm_client_get_state_file (EggSMClient *client)
* a list of filenames to open when the application is resumed.)
**/
void
-egg_sm_client_set_restart_command (EggSMClient *client,
- gint argc,
- const gchar **argv)
+egg_sm_client_set_restart_command (EggSMClient *client,
+ gint argc,
+ const gchar **argv)
{
g_return_if_fail (EGG_IS_SM_CLIENT (client));
@@ -465,7 +465,7 @@ egg_sm_client_set_restart_command (EggSMClient *client,
**/
void
egg_sm_client_will_quit (EggSMClient *client,
- gboolean will_quit)
+ gboolean will_quit)
{
g_return_if_fail (EGG_IS_SM_CLIENT (client));
@@ -490,8 +490,8 @@ egg_sm_client_will_quit (EggSMClient *client,
* be (eg, because it could not connect to the session manager).
**/
gboolean
-egg_sm_client_end_session (EggSMClientEndStyle style,
- gboolean request_confirmation)
+egg_sm_client_end_session (EggSMClientEndStyle style,
+ gboolean request_confirmation)
{
EggSMClient *client = egg_sm_client_get ();
@@ -576,9 +576,9 @@ egg_sm_client_quit (EggSMClient *client)
static void
egg_sm_client_debug_handler (const gchar *log_domain,
- GLogLevelFlags log_level,
- const gchar *message,
- gpointer user_data)
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer user_data)
{
static gint debug = -1;