Convert dpatch to quilt.
authorAndrew Lee (李健秋) <ajqlee@debian.org>
Sun, 23 May 2010 11:57:56 +0000 (19:57 +0800)
committerAndrew Lee (李健秋) <ajqlee@debian.org>
Sun, 23 May 2010 11:57:56 +0000 (19:57 +0800)
debian/patches/00list [deleted file]
debian/patches/01_default-config.dpatch [deleted file]
debian/patches/01_default-config.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/patches/sort_dirmenu.patch [new file with mode: 0644]
debian/rules

diff --git a/debian/patches/00list b/debian/patches/00list
deleted file mode 100644 (file)
index 0ac59e1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-01_default-config.dpatch
diff --git a/debian/patches/01_default-config.dpatch b/debian/patches/01_default-config.dpatch
deleted file mode 100755 (executable)
index 77744a4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 01_default-config.dpatch by Andrew Lee <andrew@linux.org.tw>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Change default terminal and web browser.
-
-@DPATCH@
-diff -urNad lxpanel-0.3.7~/data/default/panels/panel.in lxpanel-0.3.7/data/default/panels/panel.in
---- lxpanel-0.3.7~/data/default/panels/panel.in        2008-04-27 00:47:22.000000000 +0800
-+++ lxpanel-0.3.7/data/default/panels/panel.in 2008-06-14 05:50:44.000000000 +0800
-@@ -53,10 +53,7 @@
-             id=pcmanfm.desktop
-         }
-         Button {
--            id=gnome-terminal.desktop
--        }
--        Button {
--            id=firefox.desktop
-+            id=lxde-x-www-browser.desktop
-         }
-     }
- }
diff --git a/debian/patches/01_default-config.patch b/debian/patches/01_default-config.patch
new file mode 100644 (file)
index 0000000..770f2ab
--- /dev/null
@@ -0,0 +1,16 @@
+Author: Andrew Lee <andrew@linux.org.tw>
+Description: Change default terminal and web browser.
+--- a/data/default/panels/panel.in
++++ b/data/default/panels/panel.in
+@@ -53,10 +53,7 @@
+             id=pcmanfm.desktop
+         }
+         Button {
+-            id=gnome-terminal.desktop
+-        }
+-        Button {
+-            id=firefox.desktop
++            id=lxde-x-www-browser.desktop
+         }
+     }
+ }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..3cbd83a
--- /dev/null
@@ -0,0 +1,2 @@
+01_default-config.patch
+sort_dirmenu.patch
diff --git a/debian/patches/sort_dirmenu.patch b/debian/patches/sort_dirmenu.patch
new file mode 100644 (file)
index 0000000..ceb5555
--- /dev/null
@@ -0,0 +1,116 @@
+commit 8456e26ac9b583a48d82ea17c196bf8756ed9dd5
+Author: Marty Jack <martyj@linux.local>
+Date:   Sun Apr 18 11:06:47 2010 -0400
+
+    Sort menu items in Directory Menu (Bug2977155)
+
+diff --git a/src/plugins/dirmenu.c b/src/plugins/dirmenu.c
+index cfaa12b..50852a1 100644
+--- a/src/plugins/dirmenu.c
++++ b/src/plugins/dirmenu.c
+@@ -28,6 +28,13 @@
+ #include "plugin.h"
+ #include "dbg.h"
++/* Temporary for sort of directory names. */
++typedef struct _directory_name {
++    struct _directory_name * flink;
++    char * directory_name;
++    char * directory_name_collate_key;
++} DirectoryName;
++
+ /* Private context for directory menu plugin. */
+ typedef struct {
+     Plugin * plugin;                  /* Back pointer to plugin */
+@@ -162,11 +169,12 @@ static GtkWidget * dirmenu_create_menu(Plugin * p, const char * path, gboolean o
+     g_object_set_data_full(G_OBJECT(menu), "path", g_strdup(path), g_free);
+     /* Scan the specified directory to populate the menu with its subdirectories. */
++    DirectoryName * dir_list = NULL;
+     GDir * dir = g_dir_open(path, 0, NULL);
+     if (dir != NULL)
+     {
+         const char * name;
+-        while ((name = g_dir_read_name(dir)) != NULL)
++        while ((name = g_dir_read_name(dir)) != NULL) /* Memory owned by glib */
+         {
+             /* Omit hidden files. */
+             if (name[0] != '.')
+@@ -174,19 +182,33 @@ static GtkWidget * dirmenu_create_menu(Plugin * p, const char * path, gboolean o
+                 char * full = g_build_filename(path, name, NULL);
+                 if (g_file_test(full, G_FILE_TEST_IS_DIR))
+                 {
+-                    char * disp = g_filename_display_name(name);
+-                    GtkWidget * item = gtk_image_menu_item_new_with_label(disp);
+-                    g_free(disp);
+-
+-                    g_object_set_data_full(G_OBJECT(item), "name", g_strdup(name), g_free);
+-                    gtk_image_menu_item_set_image(
+-                        GTK_IMAGE_MENU_ITEM(item),
+-                        gtk_image_new_from_stock(GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU));
+-                    GtkWidget * dummy = gtk_menu_new();
+-                    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), dummy);
+-                    gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+-                    g_signal_connect(item, "select", G_CALLBACK(dirmenu_menuitem_select), p);
+-                    g_signal_connect(item, "deselect", G_CALLBACK(dirmenu_menuitem_deselect), p);
++                    /* Convert name to UTF-8 and to the collation key. */
++                    char * directory_name = g_filename_display_name(name);
++                    char * directory_name_collate_key = g_utf8_collate_key(directory_name, -1);
++
++                    /* Locate insertion point. */
++                    DirectoryName * dir_pred = NULL;
++                    DirectoryName * dir_cursor;
++                    for (dir_cursor = dir_list; dir_cursor != NULL; dir_pred = dir_cursor, dir_cursor = dir_cursor->flink)
++                    {
++                        if (strcmp(directory_name_collate_key, dir_cursor->directory_name_collate_key) <= 0)
++                            break;
++                    }
++
++                    /* Allocate and initialize sorted directory name entry. */
++                    dir_cursor = g_new0(DirectoryName, 1);
++                    dir_cursor->directory_name = directory_name;
++                    dir_cursor->directory_name_collate_key = directory_name_collate_key;
++                    if (dir_pred == NULL)
++                    {
++                        dir_cursor->flink = dir_list;
++                        dir_list = dir_cursor;
++                    }
++                    else
++                    {
++                        dir_cursor->flink = dir_pred->flink;
++                        dir_pred->flink = dir_cursor;
++                    }
+                 }
+                 g_free(full);
+             }
+@@ -194,6 +216,30 @@ static GtkWidget * dirmenu_create_menu(Plugin * p, const char * path, gboolean o
+         g_dir_close(dir);
+     }
++    /* The sorted directory name list is complete.  Loop to create the menu. */
++    DirectoryName * dir_cursor;
++    while ((dir_cursor = dir_list) != NULL)
++    {
++        /* Create and initialize menu item. */
++        GtkWidget * item = gtk_image_menu_item_new_with_label(dir_cursor->directory_name);
++        gtk_image_menu_item_set_image(
++            GTK_IMAGE_MENU_ITEM(item),
++            gtk_image_new_from_stock(GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU));
++        GtkWidget * dummy = gtk_menu_new();
++        gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), dummy);
++        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++        /* Unlink and free sorted directory name element, but reuse the directory name string. */
++        dir_list = dir_cursor->flink;
++        g_object_set_data_full(G_OBJECT(item), "name", dir_cursor->directory_name, g_free);
++        g_free(dir_cursor->directory_name_collate_key);
++        g_free(dir_cursor);
++
++        /* Connect signals. */
++        g_signal_connect(G_OBJECT(item), "select", G_CALLBACK(dirmenu_menuitem_select), p);
++        g_signal_connect(G_OBJECT(item), "deselect", G_CALLBACK(dirmenu_menuitem_deselect), p);
++    }
++
+     /* Create "Open" and "Open in Terminal" items. */
+     GtkWidget * item = gtk_image_menu_item_new_from_stock( GTK_STOCK_OPEN, NULL );
+     g_signal_connect(item, "activate", G_CALLBACK(dirmenu_menuitem_open_directory), p);
index 511e802..760bab7 100755 (executable)
@@ -9,7 +9,7 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-include /usr/share/dpatch/dpatch.make
+include /usr/share/quilt/quilt.make
 
 # These are used for cross-compiling and for saving the configure script
 # from having to guess our platform (since we know it already)
@@ -36,7 +36,7 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
     MAKEFLAGS += -j$(NUMJOBS)
 endif
 
-config.status: configure patch-stamp
+config.status: configure $(QUILT_STAMPFN)
        dh_testdir
        # Add here commands to configure the package.
 ifneq "$(wildcard /usr/share/misc/config.sub)" ""