mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
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:
parent
e972ddea3e
commit
f55391f7e4
@ -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()
|
||||
|
@ -93,6 +93,9 @@ public:
|
||||
//! Remove items
|
||||
void removeMessages(QList<int> &hiids);
|
||||
|
||||
//! Remove history
|
||||
void clearHistory(void);
|
||||
|
||||
private:
|
||||
bool loadHistoryFile();
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user