From 43e34bd2027007f701d91e1ffb3022567aba364d Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sun, 12 Feb 2012 07:48:41 +0800 Subject: [PATCH] Use CString::ToBool for the argument to ReplayAll --- logsqlite.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/logsqlite.cpp b/logsqlite.cpp index abb578e..c467f99 100755 --- a/logsqlite.cpp +++ b/logsqlite.cpp @@ -47,20 +47,14 @@ public: void ReplayAllCommand(const CString &sLine) { CString sArgs = sLine.Token(1, true); - if (sArgs.empty()) { - CString status = (replayAll ? "On" : "Off"); - PutModule("ReplayAll is set to: "+status); - } else { - if (sArgs.Equals("ON") || sArgs.Equals("1") || sArgs.Equals("true")) { - replayAll = true; - SetSetting("replayAll", "1"); - } else { - replayAll = false; - SetSetting("replayAll", "0"); - } - CString status = (replayAll ? "On" : "Off"); - PutModule("ReplayAll is now set to: "+status); + if (!sArgs.empty()) { + replayAll = sArgs.ToBool(); + SetSetting("replayAll", replayAll ? "1" : "0"); } + + CString status = (replayAll ? "On" : "Off"); + CString sNow = (sArgs.empty() ? "" : "now "); + PutModule("ReplayAll is " + sNow + "set to: "+ status); } void LogLimitCommand(const CString &sLine) {