projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sanified multiple inheritance for AbstractChatView.
[quassel.git]
/
src
/
uisupport
/
abstractbuffercontainer.cpp
diff --git
a/src/uisupport/abstractbuffercontainer.cpp
b/src/uisupport/abstractbuffercontainer.cpp
index
78ead27
..
1444027
100644
(file)
--- a/
src/uisupport/abstractbuffercontainer.cpp
+++ b/
src/uisupport/abstractbuffercontainer.cpp
@@
-42,13
+42,10
@@
void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex &parent, in
if(model()->rowCount(parent) != end - start + 1)
return;
if(model()->rowCount(parent) != end - start + 1)
return;
- AbstractChatView *chatView;
- QHash<BufferId, AbstractChatView *>::iterator iter = _chatViews.begin();
- while(iter != _chatViews.end()) {
- chatView = *iter;
- iter = _chatViews.erase(iter);
- removeChatView(chatView);
+ foreach(BufferId id, _chatViews.keys()) {
+ removeChatView(id);
}
}
+ _chatViews.clear();
} else {
// check if there are explicitly buffers removed
for(int i = start; i <= end; i++) {
} else {
// check if there are explicitly buffers removed
for(int i = start; i <= end; i++) {
@@
-63,19
+60,21
@@
void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex &parent, in
}
void AbstractBufferContainer::removeBuffer(BufferId bufferId) {
}
void AbstractBufferContainer::removeBuffer(BufferId bufferId) {
+ if(Client::buffer(bufferId)) Client::buffer(bufferId)->setVisible(false);
if(!_chatViews.contains(bufferId))
return;
if(!_chatViews.contains(bufferId))
return;
- if(Client::buffer(bufferId)) Client::buffer(bufferId)->setVisible(false);
- AbstractChatView *chatView = _chatViews.take(bufferId);
- removeChatView(chatView);
+ removeChatView(bufferId);
+ _chatViews.take(bufferId);
}
void AbstractBufferContainer::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) {
BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
BufferId oldBufferId = previous.data(NetworkModel::BufferIdRole).value<BufferId>();
}
void AbstractBufferContainer::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) {
BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
BufferId oldBufferId = previous.data(NetworkModel::BufferIdRole).value<BufferId>();
- if(newBufferId != oldBufferId)
+ if(newBufferId != oldBufferId)
{
setCurrentBuffer(newBufferId);
setCurrentBuffer(newBufferId);
+ emit currentChanged(newBufferId);
+ }
}
void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) {
}
void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) {
@@
-102,7
+101,7
@@
void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) {
_chatViews[bufferId] = chatView;
}
_currentBuffer = bufferId;
_chatViews[bufferId] = chatView;
}
_currentBuffer = bufferId;
- showChatView(
chatView
);
+ showChatView(
bufferId
);
buf->setVisible(true);
setFocus();
}
buf->setVisible(true);
setFocus();
}