Commit Graph

39 Commits

Author SHA1 Message Date
Andrew Borodin
2789e6e390 Ticket #3431: add missing default cases.
Introduce -Wswitch-default check.

Some minor cosmetics.

Thanks Andreas Mohr <and at gmx dot li> for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:50 +03:00
Andrew Borodin
42e7e39bd8 Add IS_PATH_SEP macro and use it.
Also massive use of PATH_SEP and PATH_SEP_STR macros.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:13:02 +03:00
Andrew Borodin
454479549c Update copyright years. 2015-02-26 09:12:08 +03:00
Andrew Borodin
d6004701cc Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-02 15:57:56 +04:00
Andrew Borodin
6d82155270 Massive use of MC_PTR_FREE macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-02 15:32:36 +04:00
Andrew Borodin
e5203cb023 Fix name of FSF in all *.c files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:17 +04:00
Andrew Borodin
f0da49345a Collapse list of copyright years to ranges. Add 2014 year.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
7df67031a2 Refactoring of WListbox widget.
Use GQueue instead of GList to store listbox entries.

g_list_append() function is slow because it uses g_list_last()
internally to traverse from the beginning to the end of a list, so
forming a list of results has O(n*n) complexity instead of O(n).
GQueue contains pointers to head and tail of list and list length.
So in this case we don't need seach end of list every time when we
want append listbox entry to the listbox.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-01-14 14:13:38 +04:00
Slava Zanko
0ed4a91d7d Reduce cppcheck warnings (style) in lib subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
0d489acd58 cppcheck: reduce variable scope.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
bd69b8dd31 Suppress cppcheck errors
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Andrew Borodin
09f1818bed Ticket #3018: broken directory completion.
In the command line, the subdirectory completion in current directory
isn't performed if stub isn't starting with './'.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 21:23:43 +04:00
Andrew Borodin
de94164cb5 Remove WInput::field_width. Use Widget::cols instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
ab3f53fbbe Add DIR_IS_DOT and DIR_IS_DOTDOT macros
...to detect "." and ".." directories, respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:24 +04:00
Andrew Borodin
48abe8735f Rename functions:
init_widget -> widget_init
create_dlg -> dlg_create
init_dlg -> dlg_init
run_dlg -> dlg_run
destroy_dlg -> dlg_destroy

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin
e7dc599e42 Use "'" instead of "`" for messages and comments quoting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:03 +03:00
Andrew Borodin
30959e0b7d Clarify widget redraw in runtime.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:19 +04:00
Andrew Borodin
b66a1e0592 Code indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-02-14 14:42:27 +04:00
Andrew Borodin
d8340c30da Ticket #2626: special chars are not escaped in autocompletion of filenames.
Test case:
1. Create a file with name that contains some special chars:
   touch attachment.cgi?id=564208
2. Press F6.
3. Press a. Now only the 'a' letter is in input line.
4. Press Esc Tab Enter.
5a. Input line is filled by 'attachment.cgi?id=564208'...
5b. but 'attachment.cgi\?id=564208' is expected.
6. Add 'patch_' before file name:
   'patch_attachment.cgi?id=564208'.
7. Press Enter.
8a. Result: 'patch_attachment.cgiattachment.cgi?id=564208id=564208'.
8b. Expected result: 'patch_attachment.cgi?id=564208'.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-02-14 14:30:38 +04:00
Andrew Borodin
0608af276e lib/widget/input_complete.c: minor refactoring and optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-02-04 15:48:21 +03:00
Slava Zanko
f7109ab46b Fix for input completions with spaces in names.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-04 15:48:21 +03:00
Andrew Borodin
c308d5ed21 lib/widget/input_complete.c: refactoring:
* (filename_completion_function): use GString to ret rid of hand-made
  low-level memory allocation.
  * (variable_completion_function): likewise.
  * (hostname_completion_function): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-02-04 15:48:21 +03:00
Slava Zanko
9935acea33 Ticket #55: savannah: tab completion vs. spaces and escaping
* Split big functions.
* Add unit tests

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-04 15:29:15 +03:00
Andrew Borodin
2ec122bc05 Add useful macros for widget type cast.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:44:14 +04:00
Andrew Borodin
665d238ffa Unify widget and dialog message handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:44:14 +04:00
Andrew Borodin
843dcd104e Rename Dlg_head to WDialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:42:47 +04:00
Andrew Borodin
0078874613 Rename default callbacks of widget and dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:42:47 +04:00
Andrew Borodin
c6ddd28366 Unification of widget and dialog callback functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:42:44 +04:00
Andrew Borodin
05d7f3c84e Aggressive use WIDGET macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-19 21:42:44 +04:00
Andrew Borodin
f3cc7de694 Ticket #2898: fix broken path completion on paths starting with ~/.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-09-27 14:25:18 +04:00
Ilia Maslakov
55c8f041da fixed doxygen documentation
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2012-09-10 14:29:53 +03:00
Andrew Borodin
83e3945c24 Ticket #2817: add mouse handler to the dialog.
Currently, dialog itself doesn't handle mouse events. It just
resends mouse event to each its widget. If we can several overlapped
widgets (especially, menu bar), there is some problem to decide which
widget must get event at first.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-05-30 13:23:12 +04:00
Slava Zanko
8562a215be Code refactoring: removed concat_dir_and_file() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:30 +03:00
Slava Zanko
034252a71a Changed interface of function mc_opendir()
...to handle vfs_path_t object as parameter.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:24 +03:00
Slava Zanko
eeaad790ab Changed interface of mc_stat() and mc_lstat() functions
...to handle vfs_path_t object as parameter.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:24 +03:00
Andrew Borodin
bff2736906 Support of disable of shell variables substitution in autocompletion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-02-24 09:39:04 +03:00
Slava Zanko
0138645541 Ticket 1551: Update GPL version from 2 to 3
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-18 14:08:34 +03:00
Andrew Borodin
f68b35b475 (try_complete): fixed warinig:
input_complete.c:874:26:  warning: use of logical && with constant
operand; switch to  bitwise & or remove constant
[-Wconstant-logical-operand]
    if (q && q[1] == '(' && INPUT_COMPLETE_COMMANDS)
                         ^  ~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-09 12:01:56 +03:00
Slava Zanko
e784cf65a5 Move src/filemanager/complete.c to lib/widget/input_complete.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00