debug_print("Reading actions configurations...\n");
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACTIONS_RC, NULL);
- if ((fp = fopen(rcpath, "rb")) == NULL) {
+ if ((fp = g_fopen(rcpath, "rb")) == NULL) {
if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
g_free(rcpath);
return;
}
strncpy(action, entry_text, PREFSBUFSIZE - 1);
+
+ while (strstr(action, "//")) {
+ char *to_move = strstr(action, "//")+1;
+ char *where = strstr(action, "//");
+ int old_len = strlen(action);
+ memmove(where, to_move, strlen(to_move));
+ action[old_len-1] = '\0';
+ }
+
g_strstrip(action);
/* Keep space for the ': ' delimiter */
{
GtkTreePath *prev, *sel, *try;
GtkTreeIter isel;
- GtkListStore *store;
+ GtkListStore *store = NULL;
GtkTreeIter iprev;
if (!gtk_tree_selection_get_selected
(gtk_tree_view_get_selection
(GTK_TREE_VIEW(actions.actions_list_view)),
- (GtkTreeModel **) &store,
+ (GtkTreeModel **)(GtkListStore *) store,
&isel))
return;
static void prefs_actions_down(GtkWidget *w, gpointer data)
{
- GtkListStore *store;
+ GtkListStore *store = NULL;
GtkTreeIter next, sel;
GtkTreePath *try;
if (!gtk_tree_selection_get_selected
(gtk_tree_view_get_selection
(GTK_TREE_VIEW(actions.actions_list_view)),
- (GtkTreeModel **) &store,
+ (GtkTreeModel **)(GtkListStore *) store,
&sel))
return;
{
if (modified && alertpanel(_("Entry not saved"),
_("The entry was not saved. Close anyway?"),
- _("Yes"), _("No"), NULL) != G_ALERTDEFAULT) {
+ GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT) {
return;
}
modified = FALSE;
if (modified && alertpanel(_("Entry not saved"),
_("The entry was not saved. Close anyway?"),
- _("Yes"), _("No"), NULL) != G_ALERTDEFAULT) {
+ GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT) {
return;
}
modified = FALSE;