From 6209529aaaeb1b6196a0ffb1149b095f6daab33f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 9 Aug 2014 20:26:51 -0400 Subject: [PATCH] TDB2 - In debug mode, if any TF2 objects are dirty, they speak up. --- src/TDB2.cpp | 3 +++ src/eng-USA.h | 1 + src/esp-ESP.h | 1 + src/fra-FRA.h | 1 + src/ita-ITA.h | 1 + src/por-PRT.h | 1 + 6 files changed, 8 insertions(+) diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 296be7118..e0eaf83eb 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -57,6 +57,9 @@ TF2::TF2 () //////////////////////////////////////////////////////////////////////////////// TF2::~TF2 () { + if (_dirty && context.verbose ("debug")) + std::cout << format (STRING_TDB2_DIRTY_EXIT, _file) + << "\n"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/eng-USA.h b/src/eng-USA.h index dda17832a..aee957e9a 100644 --- a/src/eng-USA.h +++ b/src/eng-USA.h @@ -861,6 +861,7 @@ #define STRING_TDB2_REMOVED "Task removed." #define STRING_TDB2_UNDO_COMPLETE "Undo complete." #define STRING_TDB2_UNDO_SYNCED "Cannot undo change because the task was already synced. Modify the task instead." +#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" // text // A comma-separated list of commands is appended. diff --git a/src/esp-ESP.h b/src/esp-ESP.h index 7cc58505c..84a4cf0f0 100644 --- a/src/esp-ESP.h +++ b/src/esp-ESP.h @@ -874,6 +874,7 @@ #define STRING_TDB2_REMOVED "Tarea eliminada." #define STRING_TDB2_UNDO_COMPLETE "Deshacer completado." #define STRING_TDB2_UNDO_SYNCED "No se puede deshacer el cambio porque la tarea ya ha sido sincronizada. Como alternativa, modifique la tarea." +#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" // text // Se añade al final una lista de comandos separados por comas. diff --git a/src/fra-FRA.h b/src/fra-FRA.h index c855a9949..d9e57bafb 100644 --- a/src/fra-FRA.h +++ b/src/fra-FRA.h @@ -860,6 +860,7 @@ #define STRING_TDB2_REMOVED "Tâche retirée." #define STRING_TDB2_UNDO_COMPLETE "Annulation terminée." #define STRING_TDB2_UNDO_SYNCED "Impossible d'annuler les changements car la tâche a déjà été synchronysée. Modifiez plutôt la tâche." +#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" // text // A comma-separated list of commands is appended. diff --git a/src/ita-ITA.h b/src/ita-ITA.h index aaff2d231..ee496ed33 100644 --- a/src/ita-ITA.h +++ b/src/ita-ITA.h @@ -861,6 +861,7 @@ #define STRING_TDB2_REMOVED "Task rimosso." #define STRING_TDB2_UNDO_COMPLETE "Undo completato." #define STRING_TDB2_UNDO_SYNCED "Cannot undo change because the task was already synced. Modify the task instead." +#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" // text // A comma-separated list of commands is appended. diff --git a/src/por-PRT.h b/src/por-PRT.h index 12fc23f94..f54e29b3c 100644 --- a/src/por-PRT.h +++ b/src/por-PRT.h @@ -861,6 +861,7 @@ #define STRING_TDB2_REMOVED "Tarefa removida." #define STRING_TDB2_UNDO_COMPLETE "Reversão concluída." #define STRING_TDB2_UNDO_SYNCED "Não é possível reverter a alteração porque a tarefa já foi syncronizada. Em vez disso modifique a tarefa." +#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" // text // A comma-separated list of commands is appended.