From f92dd279a1e26dad7507d5d6944567c23834d440 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 27 May 2010 09:45:12 +0000 Subject: A lot of session handling. A lot of new unit tests. Add of a more structured commit/discard handling. Fix of some wierd line break bugs in journalwriter --- server/src/journalwriter.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'server/src/journalwriter.cc') diff --git a/server/src/journalwriter.cc b/server/src/journalwriter.cc index c73a841..4b2b4be 100644 --- a/server/src/journalwriter.cc +++ b/server/src/journalwriter.cc @@ -187,7 +187,9 @@ void JournalWriter::addEntry(Transaction &transaction, Commit &commit, PRACRO_DEBUG(journal, "addEntry: template(%s)\n", templ->attributes["name"].c_str()); - // Add the template resume as the header (ie. first entry) of the journal entry. +#if 0 // this feature is no longer nessecary... + // Add the template resume as the header (ie. first entry) + // of the journal entry. if(entrylist.size() == 0 && templ->attributes["name"] != "") { std::string template_resume = templ->attributes["resume"]; @@ -200,16 +202,23 @@ void JournalWriter::addEntry(Transaction &transaction, Commit &commit, entrylist[-1] = re; // Make sure it comes first. } } +#endif - // Test if the username or the cpr has changed... if so, commit and clear the list. + // Test if the username or the cpr has changed... + // if so, commit and clear the list. if(currentuser != transaction.user || currentcpr != transaction.cpr) { this->commit(); entrylist.clear(); } + addEntry(resume, commit.macro, index); +} + +void JournalWriter::addEntry(std::string resume, std::string macro, int index) +{ // Strip trailing whitespace, and add newlines. std::string r = stripTrailingWhitepace(addNewlines(resume, 60)); - std::string m = commit.macro; + std::string m = macro; ResumeEntry re; re.resume = r; -- cgit v1.2.3