projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
997fd2f
)
bufferviews are now saved periodically
author
Marcus Eggenberger
<egs@quassel-irc.org>
Mon, 5 Jan 2009 17:20:15 +0000
(18:20 +0100)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Mon, 5 Jan 2009 17:20:15 +0000
(18:20 +0100)
src/common/buffersyncer.cpp
patch
|
blob
|
history
src/common/buffersyncer.h
patch
|
blob
|
history
src/core/corebuffersyncer.cpp
patch
|
blob
|
history
src/core/corebufferviewmanager.cpp
patch
|
blob
|
history
src/core/corebufferviewmanager.h
patch
|
blob
|
history
src/core/coresession.cpp
patch
|
blob
|
history
diff --git
a/src/common/buffersyncer.cpp
b/src/common/buffersyncer.cpp
index
c6fa1e7
..
3392403
100644
(file)
--- a/
src/common/buffersyncer.cpp
+++ b/
src/common/buffersyncer.cpp
@@
-25,6
+25,11
@@
BufferSyncer::BufferSyncer(QObject *parent)
{
}
{
}
+BufferSyncer::BufferSyncer(const QHash<BufferId, MsgId> &lastSeenMsg, QObject *parent)
+ : SyncableObject(parent),
+ _lastSeenMsg(lastSeenMsg)
+{
+}
MsgId BufferSyncer::lastSeenMsg(BufferId buffer) const {
if(_lastSeenMsg.contains(buffer))
MsgId BufferSyncer::lastSeenMsg(BufferId buffer) const {
if(_lastSeenMsg.contains(buffer))
diff --git
a/src/common/buffersyncer.h
b/src/common/buffersyncer.h
index
f57caae
..
40df958
100644
(file)
--- a/
src/common/buffersyncer.h
+++ b/
src/common/buffersyncer.h
@@
-29,6
+29,8
@@
class BufferSyncer : public SyncableObject {
public:
explicit BufferSyncer(QObject *parent);
public:
explicit BufferSyncer(QObject *parent);
+ explicit BufferSyncer(const QHash<BufferId, MsgId> &lastSeenMsg, QObject *parent);
+
inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
MsgId lastSeenMsg(BufferId buffer) const;
inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
MsgId lastSeenMsg(BufferId buffer) const;
diff --git
a/src/core/corebuffersyncer.cpp
b/src/core/corebuffersyncer.cpp
index
5f035a9
..
2334e9d
100644
(file)
--- a/
src/core/corebuffersyncer.cpp
+++ b/
src/core/corebuffersyncer.cpp
@@
-26,7
+26,7
@@
#include "ircchannel.h"
CoreBufferSyncer::CoreBufferSyncer(CoreSession *parent)
#include "ircchannel.h"
CoreBufferSyncer::CoreBufferSyncer(CoreSession *parent)
- : BufferSyncer(parent),
+ : BufferSyncer(
Core::bufferLastSeenMsgIds(parent->user()),
parent),
_coreSession(parent)
{
}
_coreSession(parent)
{
}
diff --git
a/src/core/corebufferviewmanager.cpp
b/src/core/corebufferviewmanager.cpp
index
bf18fee
..
5dd179a
100644
(file)
--- a/
src/core/corebufferviewmanager.cpp
+++ b/
src/core/corebufferviewmanager.cpp
@@
-40,7
+40,7
@@
CoreBufferViewManager::CoreBufferViewManager(SignalProxy *proxy, CoreSession *pa
}
}
}
}
-
CoreBufferViewManager::~CoreBufferViewManager
() {
+
void CoreBufferViewManager::saveBufferViews
() {
QVariantMap views;
BufferViewConfigHash::const_iterator iter = bufferViewConfigHash().constBegin();
QVariantMap views;
BufferViewConfigHash::const_iterator iter = bufferViewConfigHash().constBegin();
diff --git
a/src/core/corebufferviewmanager.h
b/src/core/corebufferviewmanager.h
index
c251002
..
079e39b
100644
(file)
--- a/
src/core/corebufferviewmanager.h
+++ b/
src/core/corebufferviewmanager.h
@@
-30,7
+30,6
@@
class CoreBufferViewManager : public BufferViewManager {
public:
CoreBufferViewManager(SignalProxy *proxy, CoreSession *parent);
public:
CoreBufferViewManager(SignalProxy *proxy, CoreSession *parent);
- ~CoreBufferViewManager();
inline virtual const QMetaObject *syncMetaObject() const { return &BufferViewManager::staticMetaObject; }
inline virtual const QMetaObject *syncMetaObject() const { return &BufferViewManager::staticMetaObject; }
@@
-40,6
+39,8
@@
public slots:
virtual void requestDeleteBufferView(int bufferViewId);
virtual void requestDeleteBufferViews(const QVariantList &bufferViews);
virtual void requestDeleteBufferView(int bufferViewId);
virtual void requestDeleteBufferViews(const QVariantList &bufferViews);
+ void saveBufferViews();
+
private:
CoreSession *_coreSession;
};
private:
CoreSession *_coreSession;
};
diff --git
a/src/core/coresession.cpp
b/src/core/coresession.cpp
index
557c9a8
..
491e99a
100644
(file)
--- a/
src/core/coresession.cpp
+++ b/
src/core/coresession.cpp
@@
-51,7
+51,6
@@
CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent)
_coreInfo(this),
scriptEngine(new QScriptEngine(this))
{
_coreInfo(this),
scriptEngine(new QScriptEngine(this))
{
-
SignalProxy *p = signalProxy();
connect(p, SIGNAL(peerRemoved(QIODevice *)), this, SLOT(removeClient(QIODevice *)));
SignalProxy *p = signalProxy();
connect(p, SIGNAL(peerRemoved(QIODevice *)), this, SLOT(removeClient(QIODevice *)));
@@
-75,29
+74,18
@@
CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent)
loadSettings();
initScriptEngine();
loadSettings();
initScriptEngine();
- // init BufferSyncer
- QHash<BufferId, MsgId> lastSeenHash = Core::bufferLastSeenMsgIds(user());
- foreach(BufferId id, lastSeenHash.keys())
- _bufferSyncer->requestSetLastSeenMsg(id, lastSeenHash[id]);
-
connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), _bufferSyncer, SLOT(storeDirtyIds()));
connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), _bufferSyncer, SLOT(storeDirtyIds()));
- p->synchronize(_bufferSyncer);
-
+ connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), _bufferViewManager, SLOT(saveBufferViews()));
- // init alias manager
+ p->synchronize(_bufferSyncer);
p->synchronize(&aliasManager());
p->synchronize(&aliasManager());
-
- // init BacklogManager
p->synchronize(_backlogManager);
p->synchronize(_backlogManager);
-
- // init IrcListHelper
p->synchronize(ircListHelper());
p->synchronize(ircListHelper());
-
- // init CoreInfo
p->synchronize(&_coreInfo);
// Restore session state
p->synchronize(&_coreInfo);
// Restore session state
- if(restoreState) restoreSessionState();
+ if(restoreState)
+ restoreSessionState();
emit initialized();
}
emit initialized();
}
@@
-159,6
+147,7
@@
void CoreSession::loadSettings() {
void CoreSession::saveSessionState() const {
_bufferSyncer->storeDirtyIds();
void CoreSession::saveSessionState() const {
_bufferSyncer->storeDirtyIds();
+ _bufferViewManager->saveBufferViews();
}
void CoreSession::restoreSessionState() {
}
void CoreSession::restoreSessionState() {