mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Shadow File Rewrite
- No longer writes shadow files based on TDB onChange trigger. - Addressed bug whereby adding a recurring task trigger a shadow file rewrite, which in turn performs trigger another rewrite...
This commit is contained in:
parent
6e956b45ad
commit
1e70400143
5 changed files with 72 additions and 108 deletions
20
src/TDB.cpp
20
src/TDB.cpp
|
@ -308,7 +308,6 @@ bool TDB::overwritePending (std::vector <T>& all)
|
|||
fputs (it->compose ().c_str (), out);
|
||||
|
||||
fclose (out);
|
||||
dbChanged ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -329,7 +328,6 @@ bool TDB::writePending (const T& t)
|
|||
fputs (t.compose ().c_str (), out);
|
||||
|
||||
fclose (out);
|
||||
dbChanged ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -350,8 +348,6 @@ bool TDB::writeCompleted (const T& t)
|
|||
fputs (t.compose ().c_str (), out);
|
||||
|
||||
fclose (out);
|
||||
// Note: No call to dbChanged here because this call never occurs by itself.
|
||||
// It is always accompanied by an overwritePending call.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -436,20 +432,4 @@ int TDB::nextId ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void TDB::onChange (void (*callback)())
|
||||
{
|
||||
if (callback)
|
||||
mOnChange.push_back (callback);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Iterate over callbacks.
|
||||
void TDB::dbChanged ()
|
||||
{
|
||||
foreach (i, mOnChange)
|
||||
if (*i)
|
||||
(**i) ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue