diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-10-22 19:03:55 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-10-22 19:03:55 +0300 |
commit | c0e55378c31321e2ab7a117cefb3bd63a609e474 (patch) | |
tree | ef6f08864d713a4fc6dc49b24018156abfdec048 /src | |
parent | Remove cache updates from the main thread (diff) | |
download | nheko-c0e55378c31321e2ab7a117cefb3bd63a609e474.tar.xz |
Remove extra inline keywords
Diffstat (limited to 'src')
-rw-r--r-- | src/Cache.cc | 9 | ||||
-rw-r--r-- | src/RoomInfoListItem.cc | 15 | ||||
-rw-r--r-- | src/TopRoomBar.cc | 28 |
3 files changed, 52 insertions, 0 deletions
diff --git a/src/Cache.cc b/src/Cache.cc index 010b4aa9..befb3a0a 100644 --- a/src/Cache.cc +++ b/src/Cache.cc @@ -272,3 +272,12 @@ Cache::nextBatchToken() const return QString::fromUtf8(token.data(), token.size()); } + +void +Cache::deleteData() +{ + qInfo() << "Deleting cache data"; + + if (!cacheDirectory_.isEmpty()) + QDir(cacheDirectory_).removeRecursively(); +} diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index cd15d839..588ee5c8 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -313,4 +313,19 @@ RoomInfoListItem::mousePressEvent(QMouseEvent *event) ripple_overlay_->addRipple(ripple); } +void +RoomInfoListItem::setAvatar(const QImage &img) +{ + roomAvatar_ = QPixmap::fromImage( + img.scaled(IconSize, IconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + update(); +} + +void +RoomInfoListItem::setDescriptionMessage(const DescInfo &info) +{ + lastMsgInfo_ = info; + update(); +} + RoomInfoListItem::~RoomInfoListItem() {} diff --git a/src/TopRoomBar.cc b/src/TopRoomBar.cc index 4d1f4195..72aef92a 100644 --- a/src/TopRoomBar.cc +++ b/src/TopRoomBar.cc @@ -202,4 +202,32 @@ TopRoomBar::setRoomSettings(QSharedPointer<RoomSettings> settings) roomSettings_ = settings; } +void +TopRoomBar::updateRoomAvatar(const QImage &avatar_image) +{ + avatar_->setImage(avatar_image); + update(); +} + +void +TopRoomBar::updateRoomAvatar(const QIcon &icon) +{ + avatar_->setIcon(icon); + update(); +} + +void +TopRoomBar::updateRoomName(const QString &name) +{ + roomName_ = name; + update(); +} + +void +TopRoomBar::updateRoomTopic(QString topic) +{ + roomTopic_ = topic; + update(); +} + TopRoomBar::~TopRoomBar() {} |