diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 22:30:00 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 22:31:11 +0100 |
commit | 07f7d52f661a74e6d0c780ca53e724651e3dcc48 (patch) | |
tree | b55b8c0d04a1544ace42f00642adfde4ad045d94 /src/recorder.cpp | |
parent | 6c29cfa167820635ea602b5cc31dcfeb7b04478c (diff) | |
download | mana-client-07f7d52f661a74e6d0c780ca53e724651e3dcc48.tar.gz mana-client-07f7d52f661a74e6d0c780ca53e724651e3dcc48.tar.bz2 mana-client-07f7d52f661a74e6d0c780ca53e724651e3dcc48.tar.xz mana-client-07f7d52f661a74e6d0c780ca53e724651e3dcc48.zip |
Mostly whitespace fixes
Removed tab characters and trailing spaces and added spaces between
"if(", "for(", "while(" and "switch(".
Diffstat (limited to 'src/recorder.cpp')
-rw-r--r-- | src/recorder.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/recorder.cpp b/src/recorder.cpp index 03fa2855..9f166fef 100644 --- a/src/recorder.cpp +++ b/src/recorder.cpp @@ -34,11 +34,16 @@ Recorder::Recorder(ChatWindow *chat) : mChat(chat) mButtonBox->setY(20); } +Recorder::~Recorder() +{ + delete mButtonBox; +} + void Recorder::record(const std::string &msg) { if (mStream.is_open()) { - mStream << msg << std::endl; + mStream << msg << std::endl; } } @@ -48,44 +53,44 @@ void Recorder::respond(const std::string &msg) trim(msgCopy); if (msgCopy == "") { - if (mStream.is_open()) - { - mStream.close(); - mButtonBox->setVisible(false); - /* - * Message should go after mStream is closed so that it isn't - * recorded. - */ - mChat->chatLog("Finishing recording.", BY_SERVER); - } - else - { - mChat->chatLog("Not currently recording.", BY_SERVER); - } - return; + if (mStream.is_open()) + { + mStream.close(); + mButtonBox->setVisible(false); + /* + * Message should go after mStream is closed so that it isn't + * recorded. + */ + mChat->chatLog("Finishing recording.", BY_SERVER); + } + else + { + mChat->chatLog("Not currently recording.", BY_SERVER); + } + return; } if (mStream.is_open()) { - mChat->chatLog("Already recording.", BY_SERVER); + mChat->chatLog("Already recording.", BY_SERVER); } else { - /* - * Message should go before mStream is opened so that it isn't - * recorded. - */ - mChat->chatLog("Starting to record...", BY_SERVER); + /* + * Message should go before mStream is opened so that it isn't + * recorded. + */ + mChat->chatLog("Starting to record...", BY_SERVER); std::string file = std::string(PHYSFS_getUserDir()) + "/.tmw/" + msgCopy; - - mStream.open(file.c_str(), std::ios_base::trunc); - if (mStream.is_open()) - { - mButtonBox->setVisible(true); - } - else - { - mChat->chatLog("Failed to start recording.", BY_SERVER); - } + + mStream.open(file.c_str(), std::ios_base::trunc); + if (mStream.is_open()) + { + mButtonBox->setVisible(true); + } + else + { + mChat->chatLog("Failed to start recording.", BY_SERVER); + } } } @@ -98,7 +103,7 @@ void Recorder::help(const std::string &args) const { mChat->chatLog("Command: /record <filename>", BY_SERVER); mChat->chatLog("This command starts recording the chat log to the file " - "<filename>.", BY_SERVER); + "<filename>.", BY_SERVER); mChat->chatLog("Command: /record", BY_SERVER); mChat->chatLog("This command finishes a recording session.", BY_SERVER); } @@ -107,8 +112,3 @@ void Recorder::buttonBoxRespond() { respond(""); } - -Recorder::~Recorder() -{ - delete mButtonBox; -} |