diff options
Diffstat (limited to 'plugins/keyboard/msd-xmodmap.c')
-rw-r--r-- | plugins/keyboard/msd-xmodmap.c | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/plugins/keyboard/msd-xmodmap.c b/plugins/keyboard/msd-xmodmap.c index 7539382..5bea2da 100644 --- a/plugins/keyboard/msd-xmodmap.c +++ b/plugins/keyboard/msd-xmodmap.c @@ -16,8 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301, USA. */ #include "config.h" @@ -37,38 +37,35 @@ void msd_load_modmap_files (void) { GSettings *settings; - GSList *tmp; - GSList *loaded_file_list; + GSList *tmp = NULL; + GSList *loaded_file_list = NULL; + gchar **settings_list; + gint i; settings = g_settings_new (KEYBOARD_SCHEMA); - - gchar **settings_list; settings_list = g_settings_get_strv (settings, LOADED_FILES_KEY); + if (settings_list != NULL) { - gint i; - for (i = 0; i < G_N_ELEMENTS (settings_list); i++) { - if (settings_list[i] != NULL) - loaded_file_list = - g_slist_append (loaded_file_list, g_strdup (settings_list[i])); + for (i = 0; settings_list[i] != NULL; i++) { + loaded_file_list = + g_slist_append (loaded_file_list, g_strdup (settings_list[i])); } - g_strfreev (settings_list); - } - - for (tmp = loaded_file_list; tmp != NULL; tmp = tmp->next) { - gchar *file; - gchar *command; + for (tmp = loaded_file_list; tmp != NULL; tmp = tmp->next) { + gchar *file; + gchar *command; - file = g_build_filename (g_get_home_dir (), (gchar *) tmp->data, NULL); - command = g_strconcat ("xmodmap ", file, NULL); - g_free (file); + file = g_build_filename (g_get_home_dir (), (gchar *) tmp->data, NULL); + command = g_strconcat ("xmodmap ", file, NULL); + g_free (file); - g_spawn_command_line_async (command, NULL); + g_spawn_command_line_async (command, NULL); - g_free (command); - g_free (tmp->data); + g_free (command); + g_free (tmp->data); + } + g_strfreev (settings_list); + g_slist_free (loaded_file_list); } - - g_slist_free (loaded_file_list); g_object_unref (settings); } |