mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-25 03:07:20 +02:00
- Instrumented version for shadow file testing.
This commit is contained in:
parent
b4b389c27e
commit
ce561a6c43
3 changed files with 11 additions and 2 deletions
|
@ -37,7 +37,6 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
|
@ -34,10 +34,15 @@
|
||||||
<h2 class="title">Task Shadow Files</h2>
|
<h2 class="title">Task Shadow Files</h2>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
|
@ -679,10 +679,12 @@ void updateRecurrenceMask (
|
||||||
// Using gTdb and gConf, generate a report.
|
// Using gTdb and gConf, generate a report.
|
||||||
void onChangeCallback ()
|
void onChangeCallback ()
|
||||||
{
|
{
|
||||||
|
std::cout << "--- callback" << std::endl;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (gConf && gTdb)
|
if (gConf && gTdb)
|
||||||
{
|
{
|
||||||
|
std::cout << "--- valid globals" << std::endl;
|
||||||
gConf->set ("curses", "off");
|
gConf->set ("curses", "off");
|
||||||
gConf->set ("color", "off");
|
gConf->set ("color", "off");
|
||||||
|
|
||||||
|
@ -690,6 +692,7 @@ void onChangeCallback ()
|
||||||
std::string shadowFile = expandPath (gConf->get ("shadow.file"));
|
std::string shadowFile = expandPath (gConf->get ("shadow.file"));
|
||||||
if (shadowFile != "")
|
if (shadowFile != "")
|
||||||
{
|
{
|
||||||
|
std::cout << "--- shadowFile " << shadowFile<< std::endl;
|
||||||
// Capture std::cout for the shadow file.
|
// Capture std::cout for the shadow file.
|
||||||
std::ofstream shadow (shadowFile.c_str ());
|
std::ofstream shadow (shadowFile.c_str ());
|
||||||
std::streambuf* original = std::cout.rdbuf (shadow.rdbuf ());
|
std::streambuf* original = std::cout.rdbuf (shadow.rdbuf ());
|
||||||
|
@ -704,6 +707,8 @@ void onChangeCallback ()
|
||||||
|
|
||||||
// Restore std::cout.
|
// Restore std::cout.
|
||||||
std::cout.rdbuf (original);
|
std::cout.rdbuf (original);
|
||||||
|
shadow.close ();
|
||||||
|
std::cout << "--- Complete " << std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw std::string ("Could not write to '") + shadowFile + "'.";
|
throw std::string ("Could not write to '") + shadowFile + "'.";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue