forked from qt-creator/qt-creator
Fix capitalization of "Pastebin.Ca".
Task-number: QTCREATORBUG-9997 Change-Id: Ia68c927723b31baa8ba83cbc2115e25a28d732e1 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
static const char urlC[] = "http://pastebin.ca/";
|
static const char urlC[] = "http://pastebin.ca/";
|
||||||
|
static const char protocolNameC[] = "Pastebin.Ca";
|
||||||
|
|
||||||
namespace CodePaster {
|
namespace CodePaster {
|
||||||
PasteBinDotCaProtocol::PasteBinDotCaProtocol() :
|
PasteBinDotCaProtocol::PasteBinDotCaProtocol() :
|
||||||
@@ -47,6 +48,11 @@ PasteBinDotCaProtocol::PasteBinDotCaProtocol() :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString PasteBinDotCaProtocol::protocolName()
|
||||||
|
{
|
||||||
|
return QLatin1String(protocolNameC);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned PasteBinDotCaProtocol::capabilities() const
|
unsigned PasteBinDotCaProtocol::capabilities() const
|
||||||
{
|
{
|
||||||
return ListCapability | PostDescriptionCapability | PostUserNameCapability;
|
return ListCapability | PostDescriptionCapability | PostUserNameCapability;
|
||||||
@@ -115,7 +121,7 @@ void PasteBinDotCaProtocol::paste(const QString &text,
|
|||||||
void PasteBinDotCaProtocol::pasteFinished()
|
void PasteBinDotCaProtocol::pasteFinished()
|
||||||
{
|
{
|
||||||
if (m_pasteReply->error()) {
|
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 {
|
} else {
|
||||||
/// returns ""SUCCESS:[id]""
|
/// returns ""SUCCESS:[id]""
|
||||||
const QByteArray data = m_pasteReply->readAll();
|
const QByteArray data = m_pasteReply->readAll();
|
||||||
@@ -134,7 +140,7 @@ void PasteBinDotCaProtocol::fetchFinished()
|
|||||||
if (error) {
|
if (error) {
|
||||||
content = m_fetchReply->errorString();
|
content = m_fetchReply->errorString();
|
||||||
} else {
|
} else {
|
||||||
title = QString::fromLatin1("Pastebin.ca: %1").arg(m_fetchId);
|
title = name() + QLatin1String(": ") + m_fetchId;
|
||||||
const QByteArray data = m_fetchReply->readAll();
|
const QByteArray data = m_fetchReply->readAll();
|
||||||
content = QString::fromUtf8(data);
|
content = QString::fromUtf8(data);
|
||||||
content.remove(QLatin1Char('\r'));
|
content.remove(QLatin1Char('\r'));
|
||||||
@@ -220,7 +226,7 @@ void PasteBinDotCaProtocol::listFinished()
|
|||||||
{
|
{
|
||||||
const bool error = m_listReply->error();
|
const bool error = m_listReply->error();
|
||||||
if (error)
|
if (error)
|
||||||
qWarning("pastebin.ca list failed: %s", qPrintable(m_listReply->errorString()));
|
qWarning("%s list failed: %s", protocolNameC, qPrintable(m_listReply->errorString()));
|
||||||
else
|
else
|
||||||
emit listDone(name(), parseLists(m_listReply));
|
emit listDone(name(), parseLists(m_listReply));
|
||||||
m_listReply->deleteLater();
|
m_listReply->deleteLater();
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class PasteBinDotCaProtocol : public NetworkProtocol
|
|||||||
public:
|
public:
|
||||||
explicit PasteBinDotCaProtocol();
|
explicit PasteBinDotCaProtocol();
|
||||||
|
|
||||||
static QString protocolName() { return QLatin1String("Pastebin.Ca"); }
|
static QString protocolName();
|
||||||
QString name() const { return protocolName(); }
|
QString name() const { return protocolName(); }
|
||||||
|
|
||||||
virtual bool hasSettings() const { return false; }
|
virtual bool hasSettings() const { return false; }
|
||||||
|
|||||||
Reference in New Issue
Block a user