Commit Graph

657 Commits

Author SHA1 Message Date
Slava Zanko c188153507 Add more tests for VFS
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko a12fdfbb0e VFS: many changes for use vfs_path_t
* completed vfs_path_from_str();
 * completed vfs_path_to_str() and vfs_path_to_str_elements_count();
 * removed deprecated vfs_split();
 * changes in all related code;
 * new unit tests.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko 9e4dc03e9e lib/vfs/direntry.c: vfs_s_inode_from_path() and vfs_s_get_path() now handle vfs_path_t
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko 9a28ce8c8d Add more tests for VFS
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko 6329976c89 VFS: fixed # sign in passwd or in path string
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko 91f3d8f4fd Added strrstr_skip_count() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko fc8a86766b Add more tests for VFS
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko 152124d9b7 Following prototypes of functions was changed in VFS-module API:
* getid
 * mkdir
 * rmdir
 * setctl

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko d67da5dfa8 Following prototypes of functions was changed in VFS-module API:
* readlink
 * symlink
 * rename
 * link
 * unlink
 * mknod

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko 1406eb5035 Following prototypes of functions was changed in VFS-module API:
* opendir
 * stat
 * lstat
 * chdir

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko bf54195f07 added tests for get_vfs_class() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko dd19ca201d Following prototypes of functions was changed in VFS-module API:
* chmod
 * chown
 * utime

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko 479902f83e Following prototypes of functions was changed in VFS-module API:
* open
 * getlocalcopy
 * ungetlocalcopy

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko 41f2e27f8d VFS: Use vfs_path_t in some interface functions
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko 3a1936aade Added vfs_path_t structure
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:57 +03:00
Slava Zanko 2c0ae5aa55 Moved interface functions from lib/vfs/vfs.[ch] to lib/vfs/interface.[ch]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:57 +03:00
Andrew Borodin 42bc3171c3 Ticket #2361: VFS URI reimplementation
Created vfs_url_t structure

...and use it to parse and store network VFS options.

vfs_s_super structure now has a special member for network VFS options.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:57 +03:00
Andrew Borodin ccd42c0fab (mc_config_new_or_override_file): create file w/o O_SYNC flag.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin 82b27ead4d Optimization of history load.
Formerly, each widget loaded its history self in its constructor.
Thus, history file was read as many times as many widgets with history
are in dialog.

Now all widget histories are read from ${XDG_CACHE_HOME}/mc/history
file at one time after dialog initialization.

The ev_history_load_save_t event is apllied to load  histories.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin cff5925598 Optimization of history save.
Formerly, each widget saved its history self in WIDGET_DESTROY stage.
Thus, history file was read and written as many times as many widgets
with history are in dialog.

Now all widget histories are written to ${XDG_CACHE_HOME}/mc/history
file at one time before dialog destruction.

An ev_history_load_save_t event type is created to use new event engine
to save histories.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Slava Zanko b473577525 Event system: added addition parameter event_init_data to mc_event_del() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-21 16:13:10 +04:00
Andrew Borodin 3aa74a2320 Added event_group member to the Dlg_head structure
...to start use the new event engine in widgets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin 7d469f841c (history_save): new function to save widget history
...to some in-memory created config without write it to file.

(history_put): now uses history_save().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Slava Zanko b375236b53 Ticket #2544: search dialog trim spaces
What steps will reproduce the problem?

 * View some text (log) file (F3), or edit (F4).
 * Open search dialog (F7).
 * Enter string starting with space and ending with space (I used " ERROR " without quotes), press Enter
 * Press F7 to open search dialog again.

What is the expected output?
 * Original string in search dialog (" ERROR " without quotes)

What do you see instead?
 * "ERROR " (without leading space!)

What solution?
 * In function mc_config_set_string_raw() use g_key_file_set_string() instead of g_key_file_set_value()
 * change src/learn.c for handle new behavior
 * write some tests for new behavior

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-05-31 18:50:31 +03:00
Andrew Borodin 05ae0b187d Ticket #2459: if active panel changed type from file listing to info, inactive panel is not become active.
How to reproduce:

1. Run mc.
2. Change both panels to listing modes.
3. Switch to the right panel.
4. Switch type of active right panel to info using menu.

Result: left panel is not active.
Expected result: left panel must become active.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-05-04 17:07:25 +04:00
Andrew Borodin 47115e97ad Fix of terminal resize handling
...and fix of <sys/ioctl.h> includes
and includes cleanup in src/filemanager/layout.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin 291abae262 (str_choose_str_functions): small fix.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin d92a2a4fd6 Get rid of some function forward declarations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin 330e3c60bc Dlg_head::parent is unused. Removed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Ilia Maslakov 5acb75c6cd Check whether VFS provides an open_archive() method.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-04-12 12:53:49 +04:00
Andrew Borodin 1796c8536a Ticket #2535: segfault in FTP VFS
...because of uninitialized pointer usage. The bug was introduced
in 68628184b1 commit.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-12 12:31:55 +04:00
Slava Zanko b46d2a3d62 Renamed struct vfs_s_fh to vfs_file_handler_t
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin 68628184b1 vfs_s_super and vfs_s_fh now don't contain members specific to any vfs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin 519246eccd Use GList to store directory content in vfs_s_inode.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin 401aaa5014 Ticket #2501: continue split of VFS core library and VFS plugins.
Use GList for list of vfs_s_super objects in vfs_s_subclass.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin 32bffa8890 Ticket #2516: Fix build failure on DragonFly BSD
DragonFly BSD doesn't provide MAXNAMLEN macro to define size of d_name
member of dirent structure. NAME_MAX is used if MAXNAMLEN is not
provided by OS.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-07 13:32:40 +04:00
Andrew Borodin f83bdadfa8 Ticket #2520: SIGINT generated by Ctrl-g pressing closes file panels.
When SIGINT signal is raised, the CK_Cancel message is handled by
dlg_execute_cmd() and midnight_dlg is closed.

The solution: CK_Cancel is sent to current dialog via callback, and if
current dialog doesn't handle CK_Cancel message, then handle it with common
way using dlg_execute_cmd().

Since Ctrl-g is used to generate SIGINT in MC, remove this shortcut from
all sections of keymaps except the [dialog] section.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-30 16:17:16 +04:00
Pavel Vasilyev f4cbe4a4f3 Ticket #2515: Unused variable if without WITH_BACKGROUND
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-25 14:19:40 +01:00
Slava Zanko 994254917c Added test for checking if library is independ to $(topsrcdir)/src
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:53 +02:00
Slava Zanko 06f99484de Added configure parameter --enable-mclib for build own shared library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:53 +02:00
Slava Zanko 7df04e95e2 Added manual for events (Russian and English).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:53 +02:00
Slava Zanko f40887c3c6 Lib: removed includes to "src" directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko 6621250292 Added events for handle parent_call_string() and parent_call()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko a01b8edd7a Use events for suspend mc (by pressing on CTRL+Z)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko aad40e52fb Moved mc_refresh() to lib/widget
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko 5f8a5e4290 Use events for calling help window
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko 62207c8d4d Use events for operate with clipboard (copy/paste to external clipboard, save/load to file)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko c2dfb82f61 Use events for update panels
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko 3634716374 Moved input_map, listbox_map and dialog_map variables to 'lib' subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko c58365fa64 Move check_for_default() function from lib/util.c to src/util.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00