From f1583c98feca72540c43048c7387a4c06d629ce0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 22 Aug 2013 15:31:19 +0200 Subject: [PATCH] Fix capitalization of "Pastebin.Ca". Task-number: QTCREATORBUG-9997 Change-Id: Ia68c927723b31baa8ba83cbc2115e25a28d732e1 Reviewed-by: Robert Loehning --- src/plugins/cpaster/pastebindotcaprotocol.cpp | 12 +++++++++--- src/plugins/cpaster/pastebindotcaprotocol.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/cpaster/pastebindotcaprotocol.cpp b/src/plugins/cpaster/pastebindotcaprotocol.cpp index 2b29416f9bc..435e315142a 100644 --- a/src/plugins/cpaster/pastebindotcaprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcaprotocol.cpp @@ -37,6 +37,7 @@ #include static const char urlC[] = "http://pastebin.ca/"; +static const char protocolNameC[] = "Pastebin.Ca"; namespace CodePaster { PasteBinDotCaProtocol::PasteBinDotCaProtocol() : @@ -47,6 +48,11 @@ PasteBinDotCaProtocol::PasteBinDotCaProtocol() : { } +QString PasteBinDotCaProtocol::protocolName() +{ + return QLatin1String(protocolNameC); +} + unsigned PasteBinDotCaProtocol::capabilities() const { return ListCapability | PostDescriptionCapability | PostUserNameCapability; @@ -115,7 +121,7 @@ void PasteBinDotCaProtocol::paste(const QString &text, void PasteBinDotCaProtocol::pasteFinished() { if (m_pasteReply->error()) { - qWarning("Pastebin.ca protocol error: %s", qPrintable(m_pasteReply->errorString())); + qWarning("%s protocol error: %s", protocolNameC, qPrintable(m_pasteReply->errorString())); } else { /// returns ""SUCCESS:[id]"" const QByteArray data = m_pasteReply->readAll(); @@ -134,7 +140,7 @@ void PasteBinDotCaProtocol::fetchFinished() if (error) { content = m_fetchReply->errorString(); } else { - title = QString::fromLatin1("Pastebin.ca: %1").arg(m_fetchId); + title = name() + QLatin1String(": ") + m_fetchId; const QByteArray data = m_fetchReply->readAll(); content = QString::fromUtf8(data); content.remove(QLatin1Char('\r')); @@ -220,7 +226,7 @@ void PasteBinDotCaProtocol::listFinished() { const bool error = m_listReply->error(); if (error) - qWarning("pastebin.ca list failed: %s", qPrintable(m_listReply->errorString())); + qWarning("%s list failed: %s", protocolNameC, qPrintable(m_listReply->errorString())); else emit listDone(name(), parseLists(m_listReply)); m_listReply->deleteLater(); diff --git a/src/plugins/cpaster/pastebindotcaprotocol.h b/src/plugins/cpaster/pastebindotcaprotocol.h index 181220f5d11..1a091e9a951 100644 --- a/src/plugins/cpaster/pastebindotcaprotocol.h +++ b/src/plugins/cpaster/pastebindotcaprotocol.h @@ -39,7 +39,7 @@ class PasteBinDotCaProtocol : public NetworkProtocol public: explicit PasteBinDotCaProtocol(); - static QString protocolName() { return QLatin1String("Pastebin.Ca"); } + static QString protocolName(); QString name() const { return protocolName(); } virtual bool hasSettings() const { return false; }