X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=b2d3a3b8db8f6f56f2c85c3f9c7aee8726d4272c;hb=5e3bcda8c341dbe6846d4723afe7096acca8f304;hp=20f3701d748af90060dd1d9ecfeae5c6de5bd059;hpb=b65b9f7615165e8700a44d59b7275a55558dd45b;p=quassel.git diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 20f3701d..b2d3a3b8 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 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 * @@ -45,6 +45,19 @@ public : 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; } @@ -200,6 +213,14 @@ public: 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 &ircUsers); void part(IrcUser *ircUser); @@ -266,6 +287,13 @@ public : 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); }