|
|
|
@ -12,6 +12,7 @@ |
|
|
|
#include <QPixmap> |
|
|
|
#include <QPixmap> |
|
|
|
#include <QDateTime> |
|
|
|
#include <QDateTime> |
|
|
|
#include <QFile> |
|
|
|
#include <QFile> |
|
|
|
|
|
|
|
#include <QApplication> |
|
|
|
#include <QDebug> |
|
|
|
#include <QDebug> |
|
|
|
#include <vector> |
|
|
|
#include <vector> |
|
|
|
#include <memory> |
|
|
|
#include <memory> |
|
|
|
@ -165,6 +166,7 @@ MessageList::MessageList(DbManager* db, QWidget *parent) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MessageList::loadChannel(const QString& channelId) { |
|
|
|
void MessageList::loadChannel(const QString& channelId) { |
|
|
|
|
|
|
|
QWidget* prevFocus = QApplication::focusWidget(); |
|
|
|
m_model->clear(); |
|
|
|
m_model->clear(); |
|
|
|
m_avatarCache.clear(); |
|
|
|
m_avatarCache.clear(); |
|
|
|
m_currentChannelId = channelId; |
|
|
|
m_currentChannelId = channelId; |
|
|
|
@ -197,7 +199,10 @@ void MessageList::loadChannel(const QString& channelId) { |
|
|
|
|
|
|
|
|
|
|
|
if (m_model->rowCount() > 0) |
|
|
|
if (m_model->rowCount() > 0) |
|
|
|
m_view->scrollToBottom(); |
|
|
|
m_view->scrollToBottom(); |
|
|
|
m_inputBar->setFocus(); |
|
|
|
if (prevFocus) |
|
|
|
|
|
|
|
prevFocus->setFocus(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
m_inputBar->setFocus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MessageList::refresh() { |
|
|
|
void MessageList::refresh() { |
|
|
|
|