diff -u -r src/boxes.c /home/makesub/mc-4.6.3-r504-my/src/boxes.c
old
|
new
|
|
269 | 269 | return result; |
270 | 270 | } |
271 | 271 | |
272 | | static int SORT_X = 40, SORT_Y = 14; |
| 272 | static int SORT_X = 60, SORT_Y = 14; |
273 | 273 | |
274 | 274 | static const char *sort_orders_names [SORT_TYPES]; |
275 | 275 | |
276 | 276 | sortfn * |
277 | | sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive) |
| 277 | sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive, int *exec_first) |
278 | 278 | { |
279 | 279 | int i, r, l; |
280 | 280 | sortfn *result; |
281 | | WCheck *c, *case_sense; |
| 281 | WCheck *c, *case_sense, *exec_ff; |
282 | 282 | |
283 | 283 | const char *ok_button = _("&OK"); |
284 | 284 | const char *cancel_button = _("&Cancel"); |
285 | 285 | const char *reverse_label = _("&Reverse"); |
286 | 286 | const char *case_label = _("case sensi&tive"); |
287 | 287 | const char *sort_title = _("Sort order"); |
| 288 | const char *exec_label = _("Executable first"); |
288 | 289 | |
289 | 290 | static int i18n_sort_flag = 0, check_pos = 0, button_pos = 0; |
290 | 291 | |
… |
… |
|
342 | 343 | button_new (9, button_pos, B_ENTER, DEFPUSH_BUTTON, |
343 | 344 | ok_button, 0)); |
344 | 345 | |
| 346 | exec_ff = check_new (5, check_pos, *exec_first, exec_label); |
| 347 | add_widget (dd, exec_ff); |
345 | 348 | case_sense = check_new (4, check_pos, *case_sensitive, case_label); |
346 | 349 | add_widget (dd, case_sense); |
347 | 350 | c = check_new (3, check_pos, *reverse, reverse_label); |
… |
… |
|
355 | 358 | |
356 | 359 | r = dd->ret_value; |
357 | 360 | if (r != B_CANCEL) { |
358 | | result = (sortfn *) sort_orders[my_radio->sel].sort_fn; |
359 | | *reverse = c->state & C_BOOL; |
360 | | *case_sensitive = case_sense->state & C_BOOL; |
361 | | } else |
362 | | result = sort_fn; |
| 361 | result = (sortfn *) sort_orders[my_radio->sel].sort_fn; |
| 362 | *reverse = c->state & C_BOOL; |
| 363 | *case_sensitive = case_sense->state & C_BOOL; |
| 364 | *exec_first = exec_ff->state & C_BOOL; |
| 365 | } else { |
| 366 | result = sort_fn; |
| 367 | } |
363 | 368 | destroy_dlg (dd); |
364 | 369 | |
365 | 370 | return result; |
diff -u -r src/boxes.h /home/makesub/mc-4.6.3-r504-my/src/boxes.h
old
|
new
|
|
7 | 7 | int display_box (WPanel *p, char **user, char **mini, |
8 | 8 | int *use_msformat, int num); |
9 | 9 | sortfn *sort_box (sortfn *sort_fn, int *reverse, |
10 | | int *case_sensitive); |
| 10 | int *case_sensitive, int *exec_first); |
11 | 11 | void confirm_box (void); |
12 | 12 | void display_bits_box (void); |
13 | 13 | void file_highlighting_box (void); |
diff -u -r src/dir.c /home/makesub/mc-4.6.3-r504-my/src/dir.c
old
|
new
|
|
48 | 48 | |
49 | 49 | /* Are the files sorted case sensitively? */ |
50 | 50 | static int case_sensitive = OS_SORT_CASE_SENSITIVE_DEFAULT; |
| 51 | static int exec_first = 1; |
51 | 52 | |
52 | 53 | #ifdef ENABLE_DNOTIFY |
53 | 54 | extern int panel_dnotify_handler_set; |
54 | 55 | #endif |
55 | 56 | |
56 | | #define MY_ISDIR(x) ( (S_ISDIR (x->st.st_mode) || x->f.link_to_dir) ? 1 : 0) |
| 57 | #define MY_ISDIR(x) ( (is_exe (x->st.st_mode) && !(S_ISDIR (x->st.st_mode) || x->f.link_to_dir) && (exec_first == 1)) ? 1 : ( (S_ISDIR (x->st.st_mode) || x->f.link_to_dir) ? 2 : 0) ) |
57 | 58 | |
58 | 59 | sort_orders_t sort_orders [SORT_TYPES_TOTAL] = { |
59 | 60 | { N_("&Unsorted"), unsorted }, |
… |
… |
|
233 | 234 | |
234 | 235 | |
235 | 236 | void |
236 | | do_sort (dir_list *list, sortfn *sort, int top, int reverse_f, int case_sensitive_f) |
| 237 | do_sort (dir_list *list, sortfn *sort, int top, int reverse_f, int case_sensitive_f, int exec_first_f) |
237 | 238 | { |
238 | 239 | int dot_dot_found = 0; |
239 | 240 | |
… |
… |
|
247 | 248 | |
248 | 249 | reverse = reverse_f ? -1 : 1; |
249 | 250 | case_sensitive = case_sensitive_f; |
| 251 | exec_first = exec_first_f; |
250 | 252 | qsort (&(list->list) [dot_dot_found], |
251 | 253 | top + 1 - dot_dot_found, sizeof (file_entry), sort); |
252 | 254 | } |
… |
… |
|
400 | 402 | #ifdef ENABLE_DNOTIFY |
401 | 403 | _GNU_INLINE_ int _ATTRIBUTE_ALWAYS_INLINE_ |
402 | 404 | do_load_dir (const char *path, dir_list *list, sortfn *sort, int local_reverse, |
403 | | int case_sens, const char *filter, |
| 405 | int case_sens, int exec_ff, const char *filter, |
404 | 406 | int *dn_fd, char *dn_dir, void (*dn_hd)(int, siginfo_t *, void *)) |
405 | 407 | #else |
406 | 408 | _GNU_INLINE_ int _ATTRIBUTE_ALWAYS_INLINE_ |
407 | 409 | do_load_dir (const char *path, dir_list *list, sortfn *sort, int local_reverse, |
408 | | int case_sens, const char *filter) |
| 410 | int case_sens, int exec_ff, const char *filter) |
409 | 411 | #endif |
410 | 412 | { |
411 | 413 | DIR *dirp; |
… |
… |
|
518 | 520 | } |
519 | 521 | |
520 | 522 | if (next_free) { |
521 | | do_sort (list, sort, next_free - 1, local_reverse, case_sens); |
| 523 | do_sort (list, sort, next_free - 1, local_reverse, case_sens, exec_ff); |
522 | 524 | } |
523 | 525 | |
524 | 526 | mc_closedir (dirp); |
… |
… |
|
574 | 576 | /* If filter is null, then it is a match */ |
575 | 577 | int |
576 | 578 | do_reload_dir (const char *path, dir_list *list, sortfn *sort, int count, |
577 | | int rev, int do_case_sensitive, const char *filter) |
| 579 | int rev, int do_case_sensitive, int do_exec_first, const char *filter) |
578 | 580 | { |
579 | 581 | DIR *dirp; |
580 | 582 | struct dirent *dp; |
… |
… |
|
671 | 673 | tree_store_end_check (); |
672 | 674 | g_hash_table_destroy (marked_files); |
673 | 675 | if (next_free) { |
674 | | do_sort (list, sort, next_free - 1, rev, do_case_sensitive); |
| 676 | do_sort (list, sort, next_free - 1, rev, do_case_sensitive, do_exec_first); |
675 | 677 | } |
676 | 678 | clean_dir (&dir_copy, count); |
677 | 679 | return next_free; |
diff -u -r src/dir.h /home/makesub/mc-4.6.3-r504-my/src/dir.h
old
|
new
|
|
31 | 31 | typedef int sortfn (const void *, const void *); |
32 | 32 | |
33 | 33 | void do_sort (dir_list * list, sortfn * sort, int top, int reverse, |
34 | | int case_sensitive); |
| 34 | int case_sensitive, int exec_first); |
35 | 35 | int do_reload_dir (const char *path, dir_list * list, sortfn * sort, int count, |
36 | | int reverse, int case_sensitive, const char *filter); |
| 36 | int reverse, int case_sensitive, int exec_first, const char *filter); |
37 | 37 | void clean_dir (dir_list * list, int count); |
38 | 38 | int set_zero_dir (dir_list * list); |
39 | 39 | int handle_path (dir_list *list, const char *path, struct stat *buf1, |
Только в /home/makesub/mc-4.6.3-r504-my/src: hotlist.o
Только в /home/makesub/mc-4.6.3-r504-my/src: info.o
diff -u -r src/inline_dir.h /home/makesub/mc-4.6.3-r504-my/src/inline_dir.h
old
|
new
|
|
15 | 15 | #ifdef ENABLE_DNOTIFY |
16 | 16 | extern int |
17 | 17 | do_load_dir (const char *path, dir_list *list, sortfn *sort, int local_reverse, |
18 | | int case_sens, const char *filter, |
| 18 | int case_sens, int exec_ff, const char *filter, |
19 | 19 | int *dn_fd, char *dn_dir, void (*dn_hd)(int, siginfo_t *, void *)); |
20 | 20 | #else |
21 | 21 | extern int |
22 | 22 | do_load_dir (const char *path, dir_list *list, sortfn *sort, int local_reverse, |
23 | | int case_sens, const char *filter); |
| 23 | int case_sens, int exec_ff, const char *filter); |
24 | 24 | #endif |
25 | 25 | |
26 | 26 | #ifdef __cplusplus |
diff -u -r src/main.c /home/makesub/mc-4.6.3-r504-my/src/main.c
old
|
new
|
|
696 | 696 | panel_clean_dir (panel); |
697 | 697 | panel->count = |
698 | 698 | do_load_dir (panel->cwd, &panel->dir, panel->sort_type, |
699 | | panel->reverse, panel->case_sensitive, panel->filter |
| 699 | panel->reverse, panel->case_sensitive, panel->exec_first, panel->filter |
700 | 700 | #ifdef ENABLE_DNOTIFY |
701 | 701 | # ifdef __linux__ |
702 | 702 | , &panel->dnotify_fd, panel->dnotify_dir, panel_dnotify_handler); |
… |
… |
|
852 | 852 | return; |
853 | 853 | |
854 | 854 | p = MENU_PANEL; |
855 | | sort_order = sort_box (p->sort_type, &p->reverse, &p->case_sensitive); |
| 855 | sort_order = sort_box (p->sort_type, &p->reverse, &p->case_sensitive, &p->exec_first); |
856 | 856 | |
857 | 857 | panel_set_sort_order (p, sort_order); |
858 | 858 | |
diff -u -r src/panel.h /home/makesub/mc-4.6.3-r504-my/src/panel.h
old
|
new
|
|
51 | 51 | int selected; /* Index to the selected file */ |
52 | 52 | int reverse; /* Show listing in reverse? */ |
53 | 53 | int case_sensitive; /* Listing is case sensitive? */ |
| 54 | int exec_first; /* Show executable first */ |
54 | 55 | int split; /* Split panel to allow two columns */ |
55 | 56 | int is_panelized; /* Flag: special filelisting, can't reload */ |
56 | 57 | int frame_size; /* half or full frame */ |
Только в /home/makesub/mc-4.6.3-r504-my/src: panelize.o
Только в /home/makesub/mc-4.6.3-r504-my/src: profile.o
Только в /home/makesub/mc-4.6.3-r504-my/src: recode.o
Только в /home/makesub/mc-4.6.3-r504-my/src: regex.o
Только в /home/makesub/mc-4.6.3-r504-my/src: rxvt.o
diff -u -r src/screen.c /home/makesub/mc-4.6.3-r504-my/src/screen.c
old
|
new
|
|
1642 | 1642 | /* Load the default format */ |
1643 | 1643 | panel->count = |
1644 | 1644 | do_load_dir (panel->cwd, &panel->dir, panel->sort_type, |
1645 | | panel->reverse, panel->case_sensitive, panel->filter |
| 1645 | panel->reverse, panel->case_sensitive, panel->exec_first, panel->filter |
1646 | 1646 | #ifdef ENABLE_DNOTIFY |
1647 | 1647 | # ifdef __linux__ |
1648 | 1648 | , &panel->dnotify_fd, panel->dnotify_dir, panel_dnotify_handler); |
… |
… |
|
1684 | 1684 | |
1685 | 1685 | panel->count = |
1686 | 1686 | do_reload_dir (panel->cwd, &panel->dir, panel->sort_type, |
1687 | | panel->count, panel->reverse, panel->case_sensitive, |
| 1687 | panel->count, panel->reverse, panel->case_sensitive,panel->exec_first, |
1688 | 1688 | panel->filter); |
1689 | 1689 | |
1690 | 1690 | panel->dirty = 1; |
… |
… |
|
3162 | 3162 | |
3163 | 3163 | filename = g_strdup (selection (panel)->fname); |
3164 | 3164 | unselect_item (panel); |
3165 | | do_sort (&panel->dir, panel->sort_type, panel->count-1, panel->reverse, panel->case_sensitive); |
| 3165 | do_sort (&panel->dir, panel->sort_type, panel->count-1, panel->reverse, panel->case_sensitive, panel->exec_first); |
3166 | 3166 | panel->selected = -1; |
3167 | 3167 | for (i = panel->count; i; i--){ |
3168 | 3168 | if (!strcmp (panel->dir.list [i-1].fname, filename)){ |
diff -u -r src/setup.c /home/makesub/mc-4.6.3-r504-my/src/setup.c
old
|
new
|
|
270 | 270 | save_string (section, "reverse", buffer, profile_name); |
271 | 271 | g_snprintf (buffer, sizeof (buffer), "%d", panel->case_sensitive); |
272 | 272 | save_string (section, "case_sensitive", buffer, profile_name); |
| 273 | g_snprintf (buffer, sizeof (buffer), "%d", panel->exec_first); |
| 274 | save_string (section, "exec_first", buffer, profile_name); |
273 | 275 | for (i = 0; sort_names [i].key; i++) |
274 | 276 | if (sort_names [i].sort_type == (sortfn *) panel->sort_type){ |
275 | 277 | save_string (section, "sort_order", |
… |
… |
|
423 | 425 | |
424 | 426 | panel->reverse = load_int (section, "reverse", 0); |
425 | 427 | panel->case_sensitive = load_int (section, "case_sensitive", OS_SORT_CASE_SENSITIVE_DEFAULT); |
| 428 | panel->exec_first = load_int (section, "exec_first", 0); |
426 | 429 | |
427 | 430 | /* Load sort order */ |
428 | 431 | load_string (section, "sort_order", "name", buffer, sizeof (buffer)); |