clear chat history bug fix (tracker 2992786)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4013 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2011-02-05 18:37:12 +00:00
parent e972ddea3e
commit f55391f7e4
3 changed files with 16 additions and 1 deletions

View File

@ -20,6 +20,7 @@
****************************************************************/ ****************************************************************/
#include "IMHistoryKeeper.h" #include "IMHistoryKeeper.h"
#include <iostream>
#include <QFile> #include <QFile>
#include <QIODevice> #include <QIODevice>
@ -249,6 +250,14 @@ void IMHistoryKeeper::removeMessages(QList<int> &hiids)
} }
} }
void IMHistoryKeeper::clearHistory(){
IMHistoryWriter wri;
if(!wri.remove(hfName))
std::cerr << "\nFailed to remove history file" << std::endl;
}
//============================================================================= //=============================================================================
void IMHistoryKeeper::saveHistory() void IMHistoryKeeper::saveHistory()

View File

@ -93,6 +93,9 @@ public:
//! Remove items //! Remove items
void removeMessages(QList<int> &hiids); void removeMessages(QList<int> &hiids);
//! Remove history
void clearHistory(void);
private: private:
bool loadHistoryFile(); bool loadHistoryFile();

View File

@ -37,6 +37,9 @@ public:
bool write(QList<IMHistoryItem>& itemList, bool write(QList<IMHistoryItem>& itemList,
const QString fileName ); const QString fileName );
//! remove history file
bool remove(const QString& fileName);
QString errorMessage(); QString errorMessage();
private: private: