X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbufferviewoverlay.h;h=bfe9e0c34fa0970c0f99760631d1f865c6c95020;hp=483a3302dfefb7b69d6fd439ff49ae5334b82e92;hb=52209badc8e769e50aa3019b63689dda0e79e9d0;hpb=71ef3ec0c4c4d02431aa560ed83b379c416798c5 diff --git a/src/client/bufferviewoverlay.h b/src/client/bufferviewoverlay.h index 483a3302..bfe9e0c3 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-2019 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(); - inline bool allNetworks() const { return _networkIds.contains(NetworkId()); } + const QSet& networkIds(); + const QSet& bufferIds(); + const QSet& removedBufferIds(); + const QSet& tempRemovedBufferIds(); - inline const QSet &networkIds() const { return _networkIds; } - inline const QSet &bufferIds() const { return _buffers; } - inline const QSet &removedBufferIds() const { return _removedBuffers; } - inline const QSet &tempRemovedBufferIds() const { return _tempRemovedBuffers; } + int allowedBufferTypes(); + int minimumActivity(); - inline bool addBuffersAutomatically() const { return _addBuffersAutomatically; } - inline bool hideInactiveBuffers() const { return _hideInactiveBuffers; } - inline int allowedBufferTypes() const { return _allowedBufferTypes; } - inline int minimumActivity() const { return _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