From f211a839f6e55769288ee82051b00618dc719e99 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 5 Nov 2011 12:53:29 +0100 Subject: [PATCH] core: rename options weechat.history.{max_lines|max_minutes} to weechat.history.{max_buffer_lines_number|max_buffer_lines_minutes} --- ChangeLog | 5 +++-- NEWS | 5 +++-- doc/de/autogen/user/weechat_options.txt | 14 +++++++------- doc/en/autogen/user/weechat_options.txt | 14 +++++++------- doc/fr/autogen/user/weechat_options.txt | 14 +++++++------- doc/it/autogen/user/weechat_options.txt | 14 +++++++------- src/core/wee-config.c | 12 ++++++------ src/core/wee-config.h | 4 ++-- src/gui/gui-line.c | 9 +++++---- 9 files changed, 47 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d22b49b0..92e47614a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,8 +7,9 @@ v0.3.7-dev, 2011-11-05 Version 0.3.7 (under dev!) -------------------------- -* core: add option weechat.history.max_minutes: maximum number of minutes in - history per buffer (task #10900) +* core: add option weechat.history.max_buffer_lines_minutes: maximum number of + minutes in history per buffer (task #10900), rename option + weechat.history.max_lines to weechat.history.max_buffer_lines_number * core: fix help on plugin option when config_set_desc_plugin is called to set help on newly created option * core: add WEECHAT_HOME option in cmake and configure to setup default diff --git a/NEWS b/NEWS index 1c0e4b11f..d86785a9d 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,14 @@ WeeChat News ============ Sébastien Helleu -v0.3.7-dev, 2011-10-22 +v0.3.7-dev, 2011-11-05 Version 0.3.7 (under dev!) -------------------------- -No release note. +* option 'weechat.history.max_lines' has been renamed to + 'weechat.history.max_buffer_lines_number' Version 0.3.6 (2011-10-22) -------------------------- diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt index 9d7aa47d9..68f454acd 100644 --- a/doc/de/autogen/user/weechat_options.txt +++ b/doc/de/autogen/user/weechat_options.txt @@ -318,20 +318,20 @@ ** Typ: integer ** Werte: 0 .. 2147483647 (Standardwert: `5`) -* *weechat.history.max_commands* -** Beschreibung: `maximale Anzahl an Befehlen im Verlauf (0: kein Begrenzung)` +* *weechat.history.max_buffer_lines_minutes* +** Beschreibung: `maximum number of minutes in history per buffer (0 = unlimited, examples: 1440 = one day, 10080 = one week, 43200 = one month, 525600 = one year)` ** Typ: integer -** Werte: 0 .. 2147483647 (Standardwert: `100`) +** Werte: 0 .. 2147483647 (Standardwert: `0`) -* *weechat.history.max_lines* +* *weechat.history.max_buffer_lines_number* ** Beschreibung: `maximale Anzahl an Zeilen im Verlaufsspeicher. Dies gilt pro Buffer (0: keine Zeilenbegrenzung)` ** Typ: integer ** Werte: 0 .. 2147483647 (Standardwert: `4096`) -* *weechat.history.max_minutes* -** Beschreibung: `maximum number of minutes in history per buffer (0 = unlimited, examples: 1440 = one day, 10080 = one week, 43200 = one month, 525600 = one year)` +* *weechat.history.max_commands* +** Beschreibung: `maximale Anzahl an Befehlen im Verlauf (0: kein Begrenzung)` ** Typ: integer -** Werte: 0 .. 2147483647 (Standardwert: `0`) +** Werte: 0 .. 2147483647 (Standardwert: `100`) * *weechat.history.max_visited_buffers* ** Beschreibung: `maximale Anzahl an besuchten Buffern welche im Speicher gehalten werden sollen` diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt index 3ed8e3929..55a318d71 100644 --- a/doc/en/autogen/user/weechat_options.txt +++ b/doc/en/autogen/user/weechat_options.txt @@ -318,20 +318,20 @@ ** type: integer ** values: 0 .. 2147483647 (default value: `5`) -* *weechat.history.max_commands* -** description: `maximum number of user commands in history (0 = unlimited)` +* *weechat.history.max_buffer_lines_minutes* +** description: `maximum number of minutes in history per buffer (0 = unlimited, examples: 1440 = one day, 10080 = one week, 43200 = one month, 525600 = one year)` ** type: integer -** values: 0 .. 2147483647 (default value: `100`) +** values: 0 .. 2147483647 (default value: `0`) -* *weechat.history.max_lines* +* *weechat.history.max_buffer_lines_number* ** description: `maximum number of lines in history per buffer (0 = unlimited)` ** type: integer ** values: 0 .. 2147483647 (default value: `4096`) -* *weechat.history.max_minutes* -** description: `maximum number of minutes in history per buffer (0 = unlimited, examples: 1440 = one day, 10080 = one week, 43200 = one month, 525600 = one year)` +* *weechat.history.max_commands* +** description: `maximum number of user commands in history (0 = unlimited)` ** type: integer -** values: 0 .. 2147483647 (default value: `0`) +** values: 0 .. 2147483647 (default value: `100`) * *weechat.history.max_visited_buffers* ** description: `maximum number of visited buffers to keep in memory` diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt index 106dc7a37..d434baaff 100644 --- a/doc/fr/autogen/user/weechat_options.txt +++ b/doc/fr/autogen/user/weechat_options.txt @@ -318,20 +318,20 @@ ** type: entier ** valeurs: 0 .. 2147483647 (valeur par défaut: `5`) -* *weechat.history.max_commands* -** description: `nombre maximum de commandes utilisateur dans l'historique (0 = sans limite)` +* *weechat.history.max_buffer_lines_minutes* +** description: `nombre maximum de minutes dans l'historique par tampon (0 = sans limite, exemples: 1440 = une journée, 10080 = une semaine, 43200 = un mois, 525600 = une année)` ** type: entier -** valeurs: 0 .. 2147483647 (valeur par défaut: `100`) +** valeurs: 0 .. 2147483647 (valeur par défaut: `0`) -* *weechat.history.max_lines* +* *weechat.history.max_buffer_lines_number* ** description: `nombre maximum de lignes dans l'historique par tampon (0 = sans limite)` ** type: entier ** valeurs: 0 .. 2147483647 (valeur par défaut: `4096`) -* *weechat.history.max_minutes* -** description: `nombre maximum de minutes dans l'historique par tampon (0 = sans limite, exemples: 1440 = une journée, 10080 = une semaine, 43200 = un mois, 525600 = une année)` +* *weechat.history.max_commands* +** description: `nombre maximum de commandes utilisateur dans l'historique (0 = sans limite)` ** type: entier -** valeurs: 0 .. 2147483647 (valeur par défaut: `0`) +** valeurs: 0 .. 2147483647 (valeur par défaut: `100`) * *weechat.history.max_visited_buffers* ** description: `nombre maximum de tampons visités à garder en mémoire` diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt index ac27669a2..d20dab998 100644 --- a/doc/it/autogen/user/weechat_options.txt +++ b/doc/it/autogen/user/weechat_options.txt @@ -318,20 +318,20 @@ ** tipo: intero ** valori: 0 .. 2147483647 (valore predefinito: `5`) -* *weechat.history.max_commands* -** descrizione: `numero massimo di comandi utente nella cronologia (0 = nessun limite)` +* *weechat.history.max_buffer_lines_minutes* +** descrizione: `maximum number of minutes in history per buffer (0 = unlimited, examples: 1440 = one day, 10080 = one week, 43200 = one month, 525600 = one year)` ** tipo: intero -** valori: 0 .. 2147483647 (valore predefinito: `100`) +** valori: 0 .. 2147483647 (valore predefinito: `0`) -* *weechat.history.max_lines* +* *weechat.history.max_buffer_lines_number* ** descrizione: `numero massimo di righe nella cronologia per buffer (0 = nessun limite)` ** tipo: intero ** valori: 0 .. 2147483647 (valore predefinito: `4096`) -* *weechat.history.max_minutes* -** descrizione: `maximum number of minutes in history per buffer (0 = unlimited, examples: 1440 = one day, 10080 = one week, 43200 = one month, 525600 = one year)` +* *weechat.history.max_commands* +** descrizione: `numero massimo di comandi utente nella cronologia (0 = nessun limite)` ** tipo: intero -** valori: 0 .. 2147483647 (valore predefinito: `0`) +** valori: 0 .. 2147483647 (valore predefinito: `100`) * *weechat.history.max_visited_buffers* ** descrizione: `numero massimo di buffer visitati da memorizzare` diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 863b2942e..8ac9010c1 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -215,8 +215,8 @@ struct t_config_option *config_completion_partial_completion_count; /* config, history section */ -struct t_config_option *config_history_max_lines; -struct t_config_option *config_history_max_minutes; +struct t_config_option *config_history_max_buffer_lines_number; +struct t_config_option *config_history_max_buffer_lines_minutes; struct t_config_option *config_history_max_commands; struct t_config_option *config_history_max_visited_buffers; struct t_config_option *config_history_display_default; @@ -2495,15 +2495,15 @@ config_weechat_init_options () return 0; } - config_history_max_lines = config_file_new_option ( + config_history_max_buffer_lines_number = config_file_new_option ( weechat_config_file, ptr_section, - "max_lines", "integer", + "max_buffer_lines_number", "integer", N_("maximum number of lines in history per buffer " "(0 = unlimited)"), NULL, 0, INT_MAX, "4096", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); - config_history_max_minutes = config_file_new_option ( + config_history_max_buffer_lines_minutes = config_file_new_option ( weechat_config_file, ptr_section, - "max_minutes", "integer", + "max_buffer_lines_minutes", "integer", N_("maximum number of minutes in history per buffer " "(0 = unlimited, examples: 1440 = one day, 10080 = one week, " "43200 = one month, 525600 = one year)"), diff --git a/src/core/wee-config.h b/src/core/wee-config.h index ba87792cb..57ffd7941 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -233,8 +233,8 @@ extern struct t_config_option *config_completion_partial_completion_command_arg; extern struct t_config_option *config_completion_partial_completion_other; extern struct t_config_option *config_completion_partial_completion_count; -extern struct t_config_option *config_history_max_lines; -extern struct t_config_option *config_history_max_minutes; +extern struct t_config_option *config_history_max_buffer_lines_number; +extern struct t_config_option *config_history_max_buffer_lines_minutes; extern struct t_config_option *config_history_max_commands; extern struct t_config_option *config_history_max_visited_buffers; extern struct t_config_option *config_history_display_default; diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index 00f5c2699..26d0baac7 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -806,11 +806,12 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date, lines_removed = 0; current_time = time (NULL); while (buffer->own_lines->first_line - && (((CONFIG_INTEGER(config_history_max_lines) > 0) - && (buffer->own_lines->lines_count + 1 > CONFIG_INTEGER(config_history_max_lines))) - || ((CONFIG_INTEGER(config_history_max_minutes) > 0) + && (((CONFIG_INTEGER(config_history_max_buffer_lines_number) > 0) + && (buffer->own_lines->lines_count + 1 > + CONFIG_INTEGER(config_history_max_buffer_lines_number))) + || ((CONFIG_INTEGER(config_history_max_buffer_lines_minutes) > 0) && (current_time - buffer->own_lines->first_line->data->date_printed > - CONFIG_INTEGER(config_history_max_minutes) * 60)))) + CONFIG_INTEGER(config_history_max_buffer_lines_minutes) * 60)))) { gui_line_free (buffer, buffer->own_lines->first_line); lines_removed++;