X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbufferviewoverlay.h;h=4f3ab46401d11ca11fa794bfe09df7699a1abc3e;hp=70fb92763d66e1af68e16d8c2cd6d732e494f344;hb=8f2ee00f4edef1693628d3af0bdee84d725eb754;hpb=7fc418e5841a1633f651e08a34ccd2123ba6e0db diff --git a/src/client/bufferviewoverlay.h b/src/client/bufferviewoverlay.h index 70fb9276..4f3ab464 100644 --- a/src/client/bufferviewoverlay.h +++ b/src/client/bufferviewoverlay.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,11 +15,12 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERVIEWOVERLAY_H -#define BUFFERVIEWOVERLAY_H +#pragma once + +#include "client-export.h" #include @@ -28,59 +29,64 @@ class BufferViewConfig; class ClientBufferViewConfig; -class BufferViewOverlay : public QObject { - Q_OBJECT +class CLIENT_EXPORT BufferViewOverlay : public QObject +{ + Q_OBJECT public: - BufferViewOverlay(QObject *parent = 0); + BufferViewOverlay(QObject *parent = nullptr); + + inline const QSet &bufferViewIds() { return _bufferViewIds; } + bool allNetworks(); - bool allNetworks(); + const QSet &networkIds(); + const QSet &bufferIds(); + const QSet &removedBufferIds(); + const QSet &tempRemovedBufferIds(); - const QSet &networkIds(); - const QSet &bufferIds(); - const QSet &removedBufferIds(); - const QSet &tempRemovedBufferIds(); + int allowedBufferTypes(); + int minimumActivity(); - bool addBuffersAutomatically(); - bool hideInactiveBuffers(); - int allowedBufferTypes(); - int minimumActivity(); + inline bool isInitialized() { return _uninitializedViewCount == 0; } public slots: - void addView(int viewId); - void removeView(int viewId); + void addView(int viewId); + void removeView(int viewId); - // updates propagated from the actual views - void update(); + void reset(); + void save(); + void restore(); + + // updates propagated from the actual views + void update(); signals: - void hasChanged(); + void hasChanged(); + void initDone(); protected: - virtual void customEvent(QEvent *event); + void customEvent(QEvent *event) override; private slots: - void viewInitialized(); - void viewInitialized(BufferViewConfig *config); + void viewInitialized(); + void viewInitialized(BufferViewConfig *config); private: - void updateHelper(); - bool _aboutToUpdate; + void updateHelper(); + QSet filterBuffersByConfig(const QList &buffers, const BufferViewConfig *config); - QSet _bufferViewIds; + bool _aboutToUpdate{false}; - QSet _networkIds; + QSet _bufferViewIds; + int _uninitializedViewCount{0}; - bool _addBuffersAutomatically; - bool _hideInactiveBuffers; - int _allowedBufferTypes; - int _minimumActivity; + QSet _networkIds; + int _allowedBufferTypes{0}; + int _minimumActivity{0}; - QSet _buffers; - QSet _removedBuffers; - QSet _tempRemovedBuffers; + QSet _buffers; + QSet _removedBuffers; + QSet _tempRemovedBuffers; - static const int _updateEventId; + static const int _updateEventId; }; - -#endif //BUFFERVIEWOVERLAY_H