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:
Paul Beckingham 2009-03-02 23:47:41 -05:00
parent 6e956b45ad
commit 1e70400143
5 changed files with 72 additions and 108 deletions

View file

@ -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) ();
}
////////////////////////////////////////////////////////////////////////////////