X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=cc230d02f49ae56dff2126e269427f7be6ec9fa8;hp=f2342e8f632da82dc311d649ed0efe31e7af5c2b;hb=b60e07cf184dc374b135489c4d5ec7db1e5f3651;hpb=60d19a8ddad9f989f4fa03ba66c47e3d7bb66df1 diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index f2342e8f..cc230d02 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -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; }