summaryrefslogtreecommitdiffstats
path: root/x11-libs/gtk+/files/gtk+-1.2.10-rh-deletedir.patch
blob: 7a1151c96528b3e3401e78cd824c597187d9359d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
--- gtk+-1.2.10/gtk/gtkfilesel.c.deletedir	Thu Feb 15 23:36:19 2001
+++ gtk+-1.2.10/gtk/gtkfilesel.c	Wed Apr 17 20:36:25 2002
@@ -325,7 +325,8 @@
 
 static void gtk_file_selection_populate      (GtkFileSelection      *fs,
 					      gchar                 *rel_path,
-					      gint                   try_complete);
+					      gboolean               try_complete,
+					      gboolean               reset_entry);
 static void gtk_file_selection_abort         (GtkFileSelection      *fs);
 
 static void gtk_file_selection_update_history_menu (GtkFileSelection       *fs,
@@ -522,7 +523,7 @@
     }
   else
     {
-      gtk_file_selection_populate (filesel, "", FALSE);
+      gtk_file_selection_populate (filesel, "", FALSE, TRUE);
     }
 
   gtk_widget_grab_focus (filesel->selection_entry);
@@ -637,7 +638,7 @@
       name = last_slash + 1;
     }
 
-  gtk_file_selection_populate (filesel, buf, FALSE);
+  gtk_file_selection_populate (filesel, buf, FALSE, TRUE);
 
   if (filesel->selection_entry)
     gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), name);
@@ -673,7 +674,7 @@
 
   if (filesel->selection_entry)
     gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern);
-  gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE);
+  gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE, TRUE);
 }
 
 static void
@@ -806,7 +807,7 @@
   g_free (full_path);
   
   gtk_widget_destroy (fs->fileop_dialog);
-  gtk_file_selection_populate (fs, "", FALSE);
+  gtk_file_selection_populate (fs, "", FALSE, FALSE);
 }
   
 static void
@@ -903,7 +904,7 @@
   g_free (full_path);
   
   gtk_widget_destroy (fs->fileop_dialog);
-  gtk_file_selection_populate (fs, "", FALSE);
+  gtk_file_selection_populate (fs, "", FALSE, TRUE);
 }
 
 static void
@@ -1009,8 +1010,9 @@
   g_free (new_filename);
   g_free (old_filename);
   
+  gtk_file_selection_populate (fs, "", FALSE, FALSE);
+  gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), file);
   gtk_widget_destroy (fs->fileop_dialog);
-  gtk_file_selection_populate (fs, "", FALSE);
 }
   
 static void
@@ -1112,7 +1114,7 @@
 
       text = g_strdup (text);
 
-      gtk_file_selection_populate (fs, text, TRUE);
+      gtk_file_selection_populate (fs, text, TRUE, TRUE);
 
       g_free (text);
 
@@ -1124,7 +1126,6 @@
   return FALSE;
 }
 
-
 static void
 gtk_file_selection_history_callback (GtkWidget *widget, gpointer data)
 {
@@ -1142,7 +1143,7 @@
     
     if (callback_arg->menu_item == widget)
       {
-	gtk_file_selection_populate (fs, callback_arg->directory, FALSE);
+	gtk_file_selection_populate (fs, callback_arg->directory, FALSE, FALSE);
 	break;
       }
     
@@ -1272,7 +1273,7 @@
 			       gpointer user_data)
 {
   GtkFileSelection *fs = NULL;
-  gchar *filename, *temp = NULL;
+  gchar *filename = NULL;
 
   g_return_if_fail (GTK_IS_CLIST (widget));
 
@@ -1280,39 +1281,23 @@
   g_return_if_fail (fs != NULL);
   g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
 
-  gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp);
-  filename = g_strdup (temp);
-
-  if (filename)
-    {
-      if (bevent)
-	switch (bevent->type)
-	  {
-	  case GDK_2BUTTON_PRESS:
-	    gtk_file_selection_populate (fs, filename, FALSE);
-	    break;
-	  
-	  default:
-	    gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename);
-	    break;
-	  }
-      else
-	gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename);
-
-      g_free (filename);
-    }
+  gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &filename);
+  
+  if (filename && bevent && bevent->type == GDK_2BUTTON_PRESS)
+    gtk_file_selection_populate (fs, filename, FALSE, FALSE);
 }
 
 static void
 gtk_file_selection_populate (GtkFileSelection *fs,
 			     gchar            *rel_path,
-			     gint              try_complete)
+			     gboolean          try_complete,
+			     gboolean          reset_entry)
 {
   CompletionState *cmpl_state;
   PossibleCompletion* poss;
   gchar* filename;
   gint row;
-  gchar* rem_path = rel_path;
+  gchar* rem_path;
   gchar* sel_text;
   gchar* text[2];
   gint did_recurse = FALSE;
@@ -1323,6 +1308,8 @@
   
   g_return_if_fail (fs != NULL);
   g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
+
+  rem_path = rel_path = g_strdup (rel_path);
   
   cmpl_state = (CompletionState*) fs->cmpl_state;
   poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state);
@@ -1422,7 +1409,7 @@
 
               did_recurse = TRUE;
 
-              gtk_file_selection_populate (fs, dir_name, TRUE);
+              gtk_file_selection_populate (fs, dir_name, TRUE, TRUE);
 
               g_free (dir_name);
             }
@@ -1441,7 +1428,7 @@
 	    gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path);
         }
     }
-  else
+  else if (reset_entry)
     {
       if (fs->selection_entry)
 	gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), "");
@@ -1466,8 +1453,9 @@
 	{
 	  gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state));
 	}
-      
     }
+
+  g_free (rel_path);
 }
 
 static void