X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbufferviewoverlay.h;h=bfe9e0c34fa0970c0f99760631d1f865c6c95020;hp=96f632384ea650bf8e84ff813d6144d77c8672fa;hb=52209badc8e769e50aa3019b63689dda0e79e9d0;hpb=e2667bcfa59d0a3b7843235dd6235d912cc0c992 diff --git a/src/client/bufferviewoverlay.h b/src/client/bufferviewoverlay.h index 96f63238..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,64 +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 const QSet& bufferViewIds() { return _bufferViewIds; } + 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(); - bool addBuffersAutomatically(); - bool hideInactiveBuffers(); - int allowedBufferTypes(); - int minimumActivity(); + int allowedBufferTypes(); + int minimumActivity(); - inline bool isInitialized() { return _uninitializedViewCount == 0; } + inline bool isInitialized() { return _uninitializedViewCount == 0; } public slots: - void addView(int viewId); - void removeView(int viewId); + void addView(int viewId); + void removeView(int viewId); + + void reset(); + void save(); + void restore(); - // updates propagated from the actual views - void update(); + // updates propagated from the actual views + void update(); signals: - void hasChanged(); - void initDone(); + 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; - int _uninitializedViewCount; + 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