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 <iostream>
#include <QFile>
#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()

View File

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

View File

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