[Pkg-xfce-devel] Bug#524963: please save status of “MatchCase” option

Mirosław Gabruś mirekgab at wp.pl
Tue Mar 22 09:18:14 UTC 2011


Hi


I make patch for mousepad which save status of two checbox: mach_case 
and replace_all.
This is old bug, but maybe this patch will be usefull for  someone

With regards
Mirek

********************************************************************************
--- mousepad-0.2.16.orig/src/main.c    2008-06-27 22:01:33.000000000 +0200
+++ mousepad-0.2.16/src/main.c    2011-03-21 11:26:53.000000000 +0100
@@ -37,6 +37,8 @@
      sd->conf.linenumbers = FALSE;
      sd->conf.autoindent = FALSE;
      sd->conf.charset = NULL;
+    sd->search.match_case = FALSE;
+    sd->search.replace_all = FALSE;

      path = xfce_resource_lookup(XFCE_RESOURCE_CONFIG, 
g_build_filename(PACKAGE,
                                                                         
g_strconcat(PACKAGE, "rc", NULL),
@@ -100,6 +102,18 @@
              sd->conf.autoindent = atoi(buf);
          else
              return -1;
+
+        if (!fgets(buf, sizeof(buf), fp)) return -1;
+        if (buf[0] >= '0' && buf[0] <= '1')
+            sd->search.match_case = atoi(buf);
+        else
+            return -1;
+
+        if (!fgets(buf, sizeof(buf), fp)) return -1;
+        if (buf[0] >= '0' && buf[0] <= '1')
+            sd->search.replace_all = atoi(buf);
+        else
+            return -1;

          if (!fgets(buf, sizeof(buf), fp)) return -1;
          if (strcmp(buf, "0") != 0)
@@ -119,8 +133,11 @@
      GtkItemFactory *ifactory;
      gint width, height;
      gchar *fontname;
-    gboolean wordwrap, linenumbers, autoindent;
+    gboolean wordwrap, linenumbers, autoindent, match_case, replace_all;

+    match_case = sd->search.match_case;
+    replace_all = sd->search.replace_all;
+
      gtk_window_get_size(GTK_WINDOW(sd->mainwin->window), &width, &height);
      fontname = get_font_name_from_widget(sd->mainwin->textview);
      ifactory = gtk_item_factory_from_widget(sd->mainwin->menubar);
@@ -150,6 +167,8 @@
      fprintf(fp, "%d\n", wordwrap);
      fprintf(fp, "%d\n", linenumbers);
      fprintf(fp, "%d\n", autoindent);
+    fprintf(fp, "%d\n", match_case);
+    fprintf(fp, "%d\n", replace_all);
      if (sd->fi->manual_charset)
          fprintf(fp, "%s", sd->fi->manual_charset);
      else
***********************************************************************************





More information about the Pkg-xfce-devel mailing list