From f90a5705bd65a4ebb5edc9df003a383039fec555 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 29 Apr 2018 08:17:30 +0200 Subject: Change design, fix crash when closing application --- src/Channel.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/Channel.cpp') diff --git a/src/Channel.cpp b/src/Channel.cpp index ef252f6..4fa99a0 100644 --- a/src/Channel.cpp +++ b/src/Channel.cpp @@ -1,6 +1,4 @@ #include "../include/Channel.hpp" -#include "../include/UsersSidePanel.hpp" -#include "../include/ChannelSidePanel.hpp" #include #include #include @@ -9,6 +7,8 @@ using namespace std; namespace dchat { + static Channel *currentChannel; + Channel::Channel(const string &_name, const odhtdb::DatabaseNode &_databaseNodeInfo, User *_localUser, odhtdb::Database *_database) : database(_database), databaseNodeInfo(_databaseNodeInfo), @@ -131,9 +131,17 @@ namespace dchat void Channel::draw(sf::RenderWindow &window, Cache &cache) { - ChannelSidePanel::draw(window); messageBoard.draw(window, cache); chatbar.draw(window); - UsersSidePanel::draw(window); + } + + void Channel::setCurrent(Channel *channel) + { + currentChannel = channel; + } + + Channel* Channel::getCurrent() + { + return currentChannel; } } -- cgit v1.2.3