Mercurial > projects > xwrited
comparison main.c @ 1:0907cc7064d4
Add support for newer glib versions
Do not call g_type_init() in glib >= 2.35 where it has been deprecated.
glib >= 2.32 only shows debug messages if the G_MESSAGES_DEBUG environment
variable contains the log domain or "all", so add the log domain to
G_MESSAGES_DEBUG if necessary if the "-d" commandline option was specified.
author | Guido Berhoerster <guido+xwrited@berhoerster.name> |
---|---|
date | Sun, 27 Apr 2014 23:12:06 +0200 |
parents | 52694b49dcc4 |
children | fd2e275436a4 |
comparison
equal
deleted
inserted
replaced
0:52694b49dcc4 | 1:0907cc7064d4 |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Guido Berhoerster <guido+xwrited@berhoerster.name> | 2 * Copyright (C) 2014 Guido Berhoerster <guido+xwrited@berhoerster.name> |
3 * | 3 * |
4 * Permission is hereby granted, free of charge, to any person obtaining | 4 * Permission is hereby granted, free of charge, to any person obtaining |
5 * a copy of this software and associated documentation files (the | 5 * a copy of this software and associated documentation files (the |
6 * "Software"), to deal in the Software without restriction, including | 6 * "Software"), to deal in the Software without restriction, including |
7 * without limitation the rights to use, copy, modify, merge, publish, | 7 * without limitation the rights to use, copy, modify, merge, publish, |
286 setlocale(LC_ALL, ""); | 286 setlocale(LC_ALL, ""); |
287 bindtextdomain(PACKAGE, LOCALEDIR); | 287 bindtextdomain(PACKAGE, LOCALEDIR); |
288 bind_textdomain_codeset(PACKAGE, "UTF-8"); | 288 bind_textdomain_codeset(PACKAGE, "UTF-8"); |
289 textdomain(PACKAGE); | 289 textdomain(PACKAGE); |
290 | 290 |
291 #if !GLIB_CHECK_VERSION(2, 35, 0) | |
292 /* deprecated in glib >= 2.35 */ | |
291 g_type_init(); | 293 g_type_init(); |
294 #endif | |
292 | 295 |
293 context = g_option_context_new("- display write and wall messages as " | 296 context = g_option_context_new("- display write and wall messages as " |
294 "desktop notifications"); | 297 "desktop notifications"); |
295 g_option_context_add_main_entries(context, options, PACKAGE); | 298 g_option_context_add_main_entries(context, options, PACKAGE); |
296 g_option_context_set_translation_domain(context, PACKAGE); | 299 g_option_context_set_translation_domain(context, PACKAGE); |