/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
virtual QVariant data(int column, int row) const;
+ /**
+ * Escapes a string as HTML, ready for Qt markup.
+ *
+ * Implementation depends on Qt version - Qt4 uses Qt::escape, while Qt5 uses .toHtmlEscaped().
+ *
+ * @param[in] string QString to escape
+ * @param[in] useNonbreakingSpaces
+ * @parblock
+ * If true, replace spaces with non-breaking spaces (i.e. ' '), otherwise only HTML escape.
+ * @endparblock
+ */
+ static QString escapeHTML(const QString &string, bool useNonbreakingSpaces = false);
+
inline bool isActive() const { return (bool)_network ? _network->isConnected() : false; }
inline const NetworkId &networkId() const { return _networkId; }
private slots:
void onBeginRemoveChilds(int start, int end);
+ void onNetworkDestroyed();
private:
NetworkId _networkId;
public slots:
virtual inline void setTopic(const QString &) { emit dataChanged(1); }
+ virtual inline void setEncrypted(bool) { emit dataChanged(); }
private:
BufferInfo _bufferInfo;
void attachIrcChannel(IrcChannel *ircChannel);
+ /**
+ * Gets the list of channel modes for a given nick.
+ *
+ * @param[in] nick IrcUser nickname to check
+ * @returns Channel modes as a string if any, otherwise empty string
+ */
+ QString nickChannelModes(const QString &nick) const;
+
public slots:
void join(const QList<IrcUser *> &ircUsers);
void part(IrcUser *ircUser);
private slots:
void ircChannelParted();
+ void ircChannelDestroyed();
private:
IrcChannel *_ircChannel;
virtual QVariant data(int column, int role) const;
virtual QString toolTip(int column) const;
+ /**
+ * Gets the list of channel modes for this nick if parented to channel.
+ *
+ * @returns Channel modes as a string if any, otherwise empty string
+ */
+ QString channelModes() const;
+
private slots:
inline void ircUserQuited() { parent()->removeChild(this); }