MessageFilter and its derivatives call their idString() method
during construction in order to access their settings. This is fine,
but causes (legitimate) warnings in static analysis.
Make the scope explicit when calling idString() to avoid the warning,
and make it clear to readers that we're not interested in the derived
version.
_messageTypeFilter = defaultSettings.messageFilter();
defaultSettings.notify("MessageTypeFilter", this, SLOT(messageTypeFilterChanged()));
_messageTypeFilter = defaultSettings.messageFilter();
defaultSettings.notify("MessageTypeFilter", this, SLOT(messageTypeFilterChanged()));
- BufferSettings mySettings(idString());
+ BufferSettings mySettings(MessageFilter::idString());
if (mySettings.hasFilter())
_messageTypeFilter = mySettings.messageFilter();
mySettings.notify("MessageTypeFilter", this, SLOT(messageTypeFilterChanged()));
if (mySettings.hasFilter())
_messageTypeFilter = mySettings.messageFilter();
mySettings.notify("MessageTypeFilter", this, SLOT(messageTypeFilterChanged()));
public:
MessageFilter(MessageModel *, const QList<BufferId> &buffers = QList<BufferId>(), QObject *parent = 0);
public:
MessageFilter(MessageModel *, const QList<BufferId> &buffers = QList<BufferId>(), QObject *parent = 0);
- virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
virtual QString idString() const;
virtual QString idString() const;
- inline bool isSingleBufferFilter() const { return _validBuffers.count() == 1; }
+
+ bool isSingleBufferFilter() const { return _validBuffers.count() == 1; }
BufferId singleBufferId() const { return *(_validBuffers.constBegin()); }
BufferId singleBufferId() const { return *(_validBuffers.constBegin()); }
- inline bool containsBuffer(const BufferId &id) const { return _validBuffers.contains(id); }
- inline QSet<BufferId> containedBuffers() const { return _validBuffers; }
+ bool containsBuffer(const BufferId &id) const { return _validBuffers.contains(id); }
+ QSet<BufferId> containedBuffers() const { return _validBuffers; }
+
+ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
public slots:
void messageTypeFilterChanged();
public slots:
void messageTypeFilterChanged();
// and ChatMonitorSettingsPage::defaults() to match
// Chat Monitor specific configuration
// and ChatMonitorSettingsPage::defaults() to match
// Chat Monitor specific configuration
- ChatViewSettings viewSettings(idString());
+ ChatViewSettings viewSettings(ChatMonitorFilter::idString());
_showFields = viewSettings.value("ShowFields", AllFields).toInt();
_showOwnMessages = viewSettings.value("ShowOwnMsgs", true).toBool();
viewSettings.notify("ShowFields", this, SLOT(showFieldsSettingChanged(const QVariant &)));
_showFields = viewSettings.value("ShowFields", AllFields).toInt();
_showOwnMessages = viewSettings.value("ShowOwnMsgs", true).toBool();
viewSettings.notify("ShowFields", this, SLOT(showFieldsSettingChanged(const QVariant &)));
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef CHATMONITORFILTER_H_
-#define CHATMONITORFILTER_H_
bool _includeRead;
bool _showSenderBrackets; /// If true, show brackets around sender names
};
bool _includeRead;
bool _showSenderBrackets; /// If true, show brackets around sender names
};