define vars in proper places and don't leak the entire list of settings

This commit is contained in:
Mikael Magnusson 2006-06-08 10:34:15 +00:00
parent 3c3415d87b
commit 9aeb9d9fb5
4 changed files with 10 additions and 6 deletions

View file

@ -80,7 +80,7 @@ gint config_resist_edge;
gboolean config_resist_layers_below;
GSList *per_app_settings;
GSList *config_per_app_settings;
/*
<applications>
@ -174,7 +174,7 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
setting->layer = 0;
}
per_app_settings = g_slist_append(per_app_settings,
config_per_app_settings = g_slist_append(config_per_app_settings,
(gpointer) setting);
}
@ -728,7 +728,7 @@ void config_startup(ObParseInst *i)
parse_register(i, "menu", parse_menu, NULL);
per_app_settings = NULL;
config_per_app_settings = NULL;
parse_register(i, "applications", parse_per_app_settings, NULL);
}
@ -748,4 +748,8 @@ void config_shutdown()
for (it = config_menu_files; it; it = g_slist_next(it))
g_free(it->data);
g_slist_free(config_menu_files);
for (it = config_per_app_settings; it; it = g_slist_next(it))
g_free(it->data);
g_slist_free(config_per_app_settings);
}

View file

@ -23,7 +23,6 @@
#include "misc.h"
#include "stacking.h"
#include "place.h"
#include "per_app_settings.h"
#include <glib.h>
@ -129,6 +128,8 @@ extern guint config_submenu_show_delay;
extern gboolean config_menu_client_list_icons;
/*! User-specified menu files */
extern GSList *config_menu_files;
/*! Per app settings */
extern GSList *config_per_app_settings;
void config_startup(struct _ObParseInst *i);
void config_shutdown();

View file

@ -18,6 +18,7 @@
#include "per_app_settings.h"
#include "screen.h"
#include "config.h"
GSList *per_app_settings;

View file

@ -40,8 +40,6 @@ struct _ObAppSetting
guint layer;
};
extern GSList *per_app_settings;
ObAppSetting *get_client_settings(ObClient *client);
void place_window_from_settings(ObAppSetting *setting, ObClient *client, gint *x, gint *y);