diff --git a/src/commands/CmdContext.cpp b/src/commands/CmdContext.cpp index ca0e25e35..4ee5cf3ee 100644 --- a/src/commands/CmdContext.cpp +++ b/src/commands/CmdContext.cpp @@ -137,6 +137,12 @@ void CmdContext::defineContext (const std::vector & words, std::str auto name = "context." + words[1]; auto value = joinWords (words, 2); + // Make sure nobody creates a context with name 'list', 'none' or 'show' + if (words[1] == "none" or words[1] == "list" or words[1] == "show") + { + throw format (STRING_CMD_CONTEXT_DEF_INVLD, words[1]); + } + // Check if the value is a proper filter by filtering current pending.data Filter filter; std::vector filtered; diff --git a/src/l10n/deu-DEU.h b/src/l10n/deu-DEU.h index dfb61b513..034d71a57 100644 --- a/src/l10n/deu-DEU.h +++ b/src/l10n/deu-DEU.h @@ -525,6 +525,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/l10n/eng-USA.h b/src/l10n/eng-USA.h index 0ee834d9f..4e5bc7d31 100644 --- a/src/l10n/eng-USA.h +++ b/src/l10n/eng-USA.h @@ -523,6 +523,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definition aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/l10n/epo-RUS.h b/src/l10n/epo-RUS.h index c6334020d..eccb12261 100644 --- a/src/l10n/epo-RUS.h +++ b/src/l10n/epo-RUS.h @@ -525,6 +525,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/l10n/esp-ESP.h b/src/l10n/esp-ESP.h index dc5efe9b5..cfcb34bb0 100644 --- a/src/l10n/esp-ESP.h +++ b/src/l10n/esp-ESP.h @@ -537,6 +537,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Definición de contexto abortada." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Validación de filtro fallida: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "El filtro '{1}' coincide con 0 tareas pendientes. ¿Quiere continuar?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Contexto '{1}' eliminado." #define STRING_CMD_CONTEXT_DEL_FAIL "Contexto '{1}' no eliminado." #define STRING_CMD_CONTEXT_DEL_USAG "El nombre del contexto necesita ser especificado." diff --git a/src/l10n/fra-FRA.h b/src/l10n/fra-FRA.h index 577ea0da1..2f57802dd 100644 --- a/src/l10n/fra-FRA.h +++ b/src/l10n/fra-FRA.h @@ -527,6 +527,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/l10n/ita-ITA.h b/src/l10n/ita-ITA.h index 5a0081985..22254f7af 100644 --- a/src/l10n/ita-ITA.h +++ b/src/l10n/ita-ITA.h @@ -526,6 +526,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/l10n/jpn-JPN.h b/src/l10n/jpn-JPN.h index 37df07dc1..f749a3fb5 100644 --- a/src/l10n/jpn-JPN.h +++ b/src/l10n/jpn-JPN.h @@ -527,6 +527,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/l10n/pol-POL.h b/src/l10n/pol-POL.h index 31ecea0fd..3b9096aa3 100644 --- a/src/l10n/pol-POL.h +++ b/src/l10n/pol-POL.h @@ -527,6 +527,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/l10n/por-PRT.h b/src/l10n/por-PRT.h index 0f8088983..95671d74f 100644 --- a/src/l10n/por-PRT.h +++ b/src/l10n/por-PRT.h @@ -527,6 +527,7 @@ #define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted." #define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}" #define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?" +#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name." #define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted." #define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted." #define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified." diff --git a/src/libshared b/src/libshared index f1a3cd6bf..198dcd368 160000 --- a/src/libshared +++ b/src/libshared @@ -1 +1 @@ -Subproject commit f1a3cd6bfabfb083fe3c26f580a15c0d60a92ee9 +Subproject commit 198dcd368501076fe31b22d828ae72066d0e6291