Commit Graph

108 Commits

Author SHA1 Message Date
Andrew Borodin 725997c8d0 (mc_config_get_groups): optimization of function itself and usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:06 +04:00
Andrew Borodin e62906473b (mc_config_get_keys): optimization of function itself and usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:06 +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 705afe88c0 (mc_config_new_or_override_file): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:51 +04:00
Andrew Borodin 8454f12f8f Ticket #2954: fix typo: occured -> occurred.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:18 +04:00
Slava Zanko e50c3f8475 mc_config_get_string(): if default parameter is NULL, then no any config entities will be created
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Slava Zanko 5b63c39459 mc_config_get_string_raw(): if default parameter is NULL, then no any config entities will be created
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Andrew Borodin 60727b9b79 Clarify usage of AM_CPPFLAGS.
Use AM_CPPFLAGS not AM_CFLAGS for includes. GLIB_CFLAGS are CPPFLAGS, actually.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-18 16:27:49 +04:00
Andrew Borodin dc62fdf5bd lib/mcconfig/paths.c: indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-09 10:35:46 +04:00
Andrew Borodin f9b6abde52 Don't exit after migration of configuration files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-09 10:05:13 +04:00
Andrew Borodin d82757d233 Ticket #2917: Makefile.ams cleanup: remove unused AM_CPPFLAGS.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-10-20 15:24:30 +04:00
Andrew Borodin 908e747861 Optimization of ini files load.
Some ini files (keymaps, skins) are loaded in read-only mode. For those
files, we don't need load and keep comments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-31 14:50:11 +04:00
Andrew Borodin b37af47023 Makefile.ams cleanup.
Set defines via CPPFLAGS variable not via CFLAGS one.
Use AM_CPPFLAGS and AM_CFLAGS variables instead of per-target ones.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-17 17:04:05 +04:00
Andrew Borodin c937060676 Ticket #1851: fixed support of XDG_* shell variables
...broken in 13a660d2e0

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-04-04 15:52:08 +04:00
Andrew Borodin 13a660d2e0 Allow setup mc home directory using MC_HOME environment variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:43:55 +03:00
Slava Zanko 4945d0f9a6 Changed interface of function mc_open() for handle vfs_path_t object as parameter
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:25 +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
Slava Zanko 1dffc24f9b Fixed user defined home dir, if home dir contain tilda (~/)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-12 12:30:35 +03:00
Andrew Borodin b49c165c59 (mc_config_normalize_before_save): fixed possible memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-12-12 12:23:25 +03:00
Slava Zanko 29ba0a0cda Show error and don't start if config directory is a regular file
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Slava Zanko 6b2c8d4800 Fixed migration rules
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Slava Zanko 162a330f42 Added unit test for mc_config_get_full_path() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Slava Zanko 6c32fa3b84 Added function mc_config_get_full_path() for search user's config files by short names.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Slava Zanko 25c9267ac3 Some config files moved to more appropriate places.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Slava Zanko a8c3ab345d Changed source code for respect '--enable-homedir' configure option.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Andrew Savchenko 6d99accfe0 Ticket #2676 (save of some learned keys is broken)
fixed saving of 'F13'-'F20' learned keys.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-12-06 11:42:20 +04: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
Slava Zanko bb12a1296f Direct commit: fixed broken build
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 13:49:56 +03:00
Andrew Borodin 8ff0da42cd lib/mcconfig/paths.c: cleanup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 12:38:03 +03:00
Slava Zanko c057627979 Ticket #1851: Home config directory [xdg-user-dirs]
Fixed migrating user config files.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 12:38:03 +03:00
Slava Zanko be0f9dda56 mcconfig: make parameters in some functions as const mc_config_t *
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +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
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
Slava Zanko 7dad2df6a8 Moved initialization of mc_global.share_data_dir and mc_global.sysconf_dir to library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko 746653fda2 Removed mc_main_error_quark() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko 6016620f42 Remove backlinks from lib to src - move global variables(used in lib) to mc_global structure (see lib/global.c)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:50 +02:00
Slava Zanko 6c5f5bf768 VFS structure changes:
* moved from lib/vfs/mc-vfs to lib/vfs;
  * split by directories for VFS-plugins and moved to src/vfs;
  * lib/vfs/vfs-impl.h was merged into lib/vfs/vfs.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 11:48:26 +02:00
Andrew Borodin 6484b1dce7 Allow remove key with empty value from target config.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin f28ec51c77 (mc_config_init): don't drop file name if file is not exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-03 20:48:31 +00:00
Ilia Maslakov 8509b74f73 Ticket #323 (reimplimented editor macros)
Reimplemented editor macro engine:

    * added string binding "InsertChar" for action - "CK_Insert_Char"
    * added keybind_lookup_actionname - found action name by numeric constant
    * replaced struct macro to struct macro_action_t
    * added struct macros_t for describe editor scripts
    * rewritten edit_load_macro_cmd, edit_execute_macro
    * renamed edit_save_macro_cmd into edit_store_macro_cmd (WEdit * edit);
    * dropped Wedit properties: macro_i, macro_depth, macro[MAX_MACRO_LENGTH]
    * added GArray *macros_list to the store macroses of mcedit
    * added edit_get_macro

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 11:16:44 +00:00
Andrew Borodin 5b9a7dd43f (mc_config_del_param): renamed to mc_config_del_key.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-05 16:54:56 +02:00
Slava Zanko acbe048486 Ticket #1851: Home config directory [xdg-user-dirs]
Instead of hardcoded (via MC_USERCONF_DIR) path mc mc now used
dynamic directories specified by environment variables:
 * XDG_CONFIG_HOME - dir for config files . By default is ~/.config/mc
 * XDG_DATA_HOME - dir for some data, such as user defuned Syntax file, menu etc By default is ~/.local/share/mc
 * XDG_CACHE_HOME - dir for temp files, such as cooledit.clip etc. By default is ~/.cache/mc

This is mainstream standard already adopted by many projects.

Old settings will be migrated at first time from ~/.mc to these dirs.

See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html for more info.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-20 17:38:27 +02:00
Slava Zanko dc0a963304 Refactoring: removed unused variable
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Andrew Borodin 1ae9172d2a Renamed mc_config_direct_set_string() to mc_config_set_string_raw()
... and avoid any string modification before save to ini.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin bbb6233049 Optimization of confguration library: delete extra checks
...and simplified codeset conversion in mc_config_get_string().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin 8d1708225c Don't include lib/util.h via lib/global.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin 1192d34bd1 Clean up some empty lines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:46 +03:00
Slava Zanko feb733663f Code indentation in lib directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:27:20 +03:00
Andrew Borodin 4c0ba932a8 Remove extra check before call mc_config_deinit()
...and minor cleanup of related code.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:26:27 +03:00
Andrew Borodin 5b68413e62 Applied MC indentation policy.
Applied MC indentation policy to all files modified in this branch
with some simple manual modifications.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:22 +04:00
Vit Rosin c6a5837f6d Ticket #2069: fixed memory leaks.
Fixed memory leak in mc_config_read_file().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:21 +04:00
Slava Zanko 8d1eebc30e lib/mcconfig/common.c: fixed memory leak
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-02 21:56:01 +03:00
Slava Zanko 25155c311a Move all interface includes from subdirs lib/*/*.h into lib/*.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko cd4dbf3a09 Changes for build after moving strutil into lib
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko 93dbc46e9c Reorganization of sources. Part 1.
* moved src/global.h into lib/global.h
 * moved glibcompat.[ch] from ./src/ into ./lib/
 * moved fs.h from ./src/ into ./lib/

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko 39d5b94cac Reorganized pathes to files in '#include' directives 2010-01-26 10:30:22 +02:00
Slava Zanko 4f11e4b665 Massive moved some dirs from $(srcdir)/src into $(srcdir)/lib
Moved subdirs:
 * filehighlight
 * mcconfig
 * search
 * skin
 * tty

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:22 +02:00