renamed members in Helpers.cpp

This commit is contained in:
fourtf 2019-09-18 16:31:51 +02:00
parent ffd63d9407
commit 88d8bf7cec
5 changed files with 16 additions and 15 deletions

View file

@ -4,19 +4,19 @@
namespace AB_NAMESPACE {
QString CreateUUID()
QString generateUuid()
{
auto uuid = QUuid::createUuid();
return uuid.toString();
}
QString createLink(const QString &url, bool file)
QString formatRichLink(const QString &url, bool file)
{
return QString("<a href=\"") + (file ? "file:///" : "") + url + "\">" +
url + "</a>";
}
QString createNamedLink(const QString &url, const QString &name, bool file)
QString formatRichNamedLink(const QString &url, const QString &name, bool file)
{
return QString("<a href=\"") + (file ? "file:///" : "") + url + "\">" +
name + "</a>";

View file

@ -11,12 +11,12 @@ auto fS(Args &&... args)
return fmt::format(std::forward<Args>(args)...);
}
QString CreateUUID();
QString generateUuid();
QString createLink(const QString &url, bool file = false);
QString formatRichLink(const QString &url, bool file = false);
QString createNamedLink(const QString &url, const QString &name,
bool file = false);
QString formatRichNamedLink(const QString &url, const QString &name,
bool file = false);
QString shortenString(const QString &str, unsigned maxWidth = 50);

View file

@ -65,7 +65,7 @@ namespace detail {
Listener{topic.GetString(), false, false, false});
}
auto uuid = CreateUUID();
auto uuid = generateUuid();
rj::set(message, "nonce", uuid);
@ -102,9 +102,9 @@ namespace detail {
auto message = createUnlistenMessage(topics);
auto uuid = CreateUUID();
auto uuid = generateUuid();
rj::set(message, "nonce", CreateUUID());
rj::set(message, "nonce", generateUuid());
std::string payload = rj::stringify(message);
sentMessages[uuid] = payload;

View file

@ -30,8 +30,9 @@ ExternalToolsPage::ExternalToolsPage()
description->setStyleSheet("color: #bbb");
auto links = new QLabel(
createNamedLink("https://streamlink.github.io/", "Website") + " " +
createNamedLink(
formatRichNamedLink("https://streamlink.github.io/", "Website") +
" " +
formatRichNamedLink(
"https://github.com/streamlink/streamlink/releases/latest",
"Download"));
links->setTextFormat(Qt::RichText);

View file

@ -438,10 +438,10 @@ void GeneralPage::initLayout(SettingsLayout &layout)
layout.addDescription("The browser extension replaces the default "
"Twitch.tv chat with chatterino.");
layout.addDescription(formatRichNamedLink(CHROME_EXTENSION_LINK,
"Download for Google Chrome"));
layout.addDescription(
createNamedLink(CHROME_EXTENSION_LINK, "Download for Google Chrome"));
layout.addDescription(
createNamedLink(FIREFOX_EXTENSION_LINK, "Download for Firefox"));
formatRichNamedLink(FIREFOX_EXTENSION_LINK, "Download for Firefox"));
#endif
layout.addTitle("Miscellaneous");