summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-08-21 15:43:29 +0200
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2013-08-22 12:29:38 +0200
commite829b97371e1dfdf4ce688222ffaf84f54d4a1e0 (patch)
treecda550e3a6165ca3cb2f8354a2079f8814c372bd /src
parent7be0100298b9132fa61760963db3c23db62ad81b (diff)
downloadqt-creator-e829b97371e1dfdf4ce688222ffaf84f54d4a1e0.tar.gz
Add description to pastebin.com-protocol.
The api_paste_name parameter actually is a description/title. Introduce new PostUserNameCapability to enable user name control. Task-number: QTCREATORBUG-9996 Change-Id: I4a40dd88b2a8844fb6f27ba01e47226e2a61a042 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/cpaster/fileshareprotocol.cpp2
-rw-r--r--src/plugins/cpaster/kdepasteprotocol.cpp2
-rw-r--r--src/plugins/cpaster/pastebindotcaprotocol.cpp2
-rw-r--r--src/plugins/cpaster/pastebindotcomprotocol.cpp8
-rw-r--r--src/plugins/cpaster/pasteview.cpp1
-rw-r--r--src/plugins/cpaster/protocol.h3
6 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/cpaster/fileshareprotocol.cpp b/src/plugins/cpaster/fileshareprotocol.cpp
index 0663a5463f..ef3f4eb9f6 100644
--- a/src/plugins/cpaster/fileshareprotocol.cpp
+++ b/src/plugins/cpaster/fileshareprotocol.cpp
@@ -69,7 +69,7 @@ QString FileShareProtocol::name() const
unsigned FileShareProtocol::capabilities() const
{
- return ListCapability|PostDescriptionCapability;
+ return ListCapability | PostDescriptionCapability | PostUserNameCapability;
}
bool FileShareProtocol::hasSettings() const
diff --git a/src/plugins/cpaster/kdepasteprotocol.cpp b/src/plugins/cpaster/kdepasteprotocol.cpp
index 2f62b80ca9..782e574019 100644
--- a/src/plugins/cpaster/kdepasteprotocol.cpp
+++ b/src/plugins/cpaster/kdepasteprotocol.cpp
@@ -61,7 +61,7 @@ QString KdePasteProtocol::protocolName()
unsigned KdePasteProtocol::capabilities() const
{
- return ListCapability;
+ return ListCapability | PostUserNameCapability;
}
bool KdePasteProtocol::checkConfiguration(QString *errorMessage)
diff --git a/src/plugins/cpaster/pastebindotcaprotocol.cpp b/src/plugins/cpaster/pastebindotcaprotocol.cpp
index 1592cd2fd7..2b29416f9b 100644
--- a/src/plugins/cpaster/pastebindotcaprotocol.cpp
+++ b/src/plugins/cpaster/pastebindotcaprotocol.cpp
@@ -49,7 +49,7 @@ PasteBinDotCaProtocol::PasteBinDotCaProtocol() :
unsigned PasteBinDotCaProtocol::capabilities() const
{
- return ListCapability | PostDescriptionCapability;
+ return ListCapability | PostDescriptionCapability | PostUserNameCapability;
}
void PasteBinDotCaProtocol::fetch(const QString &id)
diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp
index a7de02335a..4b0ded6d68 100644
--- a/src/plugins/cpaster/pastebindotcomprotocol.cpp
+++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp
@@ -66,7 +66,7 @@ QString PasteBinDotComProtocol::protocolName()
unsigned PasteBinDotComProtocol::capabilities() const
{
- return ListCapability;
+ return ListCapability | PostDescriptionCapability;
}
static inline QByteArray format(Protocol::ContentType ct)
@@ -112,7 +112,7 @@ static inline QByteArray expirySpecification(int expiryDays)
void PasteBinDotComProtocol::paste(const QString &text,
ContentType ct, int expiryDays,
- const QString &username,
+ const QString & /* username */, // Not used unless registered user
const QString &comment,
const QString &description)
{
@@ -127,8 +127,8 @@ void PasteBinDotComProtocol::paste(const QString &text,
pasteData += expirySpecification(expiryDays);
pasteData += '&';
pasteData += format(ct);
- pasteData += "api_paste_name=";
- pasteData += QUrl::toPercentEncoding(username);
+ pasteData += "api_paste_name="; // Title or name.
+ pasteData += QUrl::toPercentEncoding(description);
pasteData += "&api_paste_code=";
pasteData += QUrl::toPercentEncoding(fixNewLines(text));
// fire request
diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp
index f8de8f9533..7ac1af9f4e 100644
--- a/src/plugins/cpaster/pasteview.cpp
+++ b/src/plugins/cpaster/pasteview.cpp
@@ -114,6 +114,7 @@ void PasteView::protocolChanged(int p)
{
const unsigned caps = m_protocols.at(p)->capabilities();
m_ui.uiDescription->setEnabled(caps & Protocol::PostDescriptionCapability);
+ m_ui.uiUsername->setEnabled(caps & Protocol::PostUserNameCapability);
m_ui.uiComment->setEnabled(caps & Protocol::PostCommentCapability);
}
diff --git a/src/plugins/cpaster/protocol.h b/src/plugins/cpaster/protocol.h
index 343dfeb5db..a2036aabbf 100644
--- a/src/plugins/cpaster/protocol.h
+++ b/src/plugins/cpaster/protocol.h
@@ -58,7 +58,8 @@ public:
enum Capabilities {
ListCapability = 0x1,
PostCommentCapability = 0x2,
- PostDescriptionCapability = 0x4
+ PostDescriptionCapability = 0x4,
+ PostUserNameCapability = 0x8
};
virtual ~Protocol();