-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 4490_cleanup: (46 commits) Update po/*.po files. (mc_config_history_save): remove check because condition is always true here. (mc_config_history_get_recent_item): new API. Fix comments of history and panels.ini files location. lib/mcconfig/history.c: fix comments. src/editor/edit.c: fix coding style. (edit_insert_file): change variable type from int to gboolean. (edit_user_menu): avoid inverse logic. mcedit: rename user_menu() to edit_user_menu(). mcedit: minor optimization. (edit_cursor_to_eol): reduce variable scope. (edit_execute_cmd): refactor loop. (insert_spaces_tab): refactor loop. Refactoring: avoid create an empty strings. (expand_format): remove intermediate variable. (strip_ext): refactor loop. mc.ext.ini.in: support webp images. tar: type accuracy. (oldgnu_get_sparse_info) fix conditional-uninitialized warning. (edit_print_string): refactor loop. ...
- Loading branch information
Showing
104 changed files
with
5,628 additions
and
4,361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Widgets for the Midnight Commander | ||
Configure module for the Midnight Commander | ||
Copyright (C) 1994-2023 | ||
Free Software Foundation, Inc. | ||
|
@@ -10,7 +10,7 @@ | |
Jakub Jelinek, 1995 | ||
Andrej Borsenkow, 1996 | ||
Norbert Warmuth, 1997 | ||
Andrew Borodin <[email protected]>, 2009-2019 | ||
Andrew Borodin <[email protected]>, 2009-2023 | ||
This file is part of the Midnight Commander. | ||
|
@@ -65,7 +65,7 @@ int num_history_items_recorded = 60; | |
/* --------------------------------------------------------------------------------------------- */ | ||
|
||
/** | ||
* Load the history from the ${XDG_CACHE_HOME}/mc/history file. | ||
* Load the history from the ${XDG_DATA_HOME}/mc/history file. | ||
* It is called with the widgets history name and returns the GList list. | ||
*/ | ||
|
||
|
@@ -94,6 +94,33 @@ mc_config_history_get (const char *name) | |
|
||
/* --------------------------------------------------------------------------------------------- */ | ||
|
||
/** | ||
* Get the recent item of a history from the ${XDG_DATA_HOME}/mc/history file. | ||
* | ||
* TODO: get rid of load the entire history to get the only top item. | ||
*/ | ||
|
||
char * | ||
mc_config_history_get_recent_item (const char *name) | ||
{ | ||
GList *history; | ||
char *item = NULL; | ||
|
||
history = mc_config_history_get (name); | ||
if (history != NULL) | ||
{ | ||
/* FIXME: can history->data be NULL? */ | ||
item = (char *) history->data; | ||
history->data = NULL; | ||
history = g_list_first (history); | ||
g_list_free_full (history, g_free); | ||
} | ||
|
||
return item; | ||
} | ||
|
||
/* --------------------------------------------------------------------------------------------- */ | ||
|
||
/** | ||
* Load history from the mc_config | ||
*/ | ||
|
@@ -177,8 +204,7 @@ mc_config_history_save (mc_config_t * cfg, const char *name, GList * h) | |
for (i = 0; (i < num_history_items_recorded - 1) && (h->prev != NULL); i++) | ||
h = g_list_previous (h); | ||
|
||
if (name != NULL) | ||
mc_config_del_group (cfg, name); | ||
mc_config_del_group (cfg, name); | ||
|
||
/* create charset conversion handler to convert strings | ||
from system codepage to UTF-8 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.