aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpaster/pastebindotcomprotocol.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-08-20 17:08:09 +0200
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-08-20 17:08:09 +0200
commit94babbd9ca5eaf22817a41e2df29f2fc8dcad352 (patch)
tree69abc82cef309b100a67fdc3bbf634edad0cc39a /src/plugins/cpaster/pastebindotcomprotocol.cpp
parenta18c8f9e96df59ea7b77ed64927d29fd10ea085d (diff)
CodePaster: Do better checking on hosts.
Do an initial connection check on the host (once per host). Add utility function to NetworkProtocol, displaying connection check message box. Move the 'Paste' handling into the PasteView dialog, such that the checking happens there and the dialog stays open if something fails. Task-number: QTCREATORBUG-2117
Diffstat (limited to 'src/plugins/cpaster/pastebindotcomprotocol.cpp')
-rw-r--r--src/plugins/cpaster/pastebindotcomprotocol.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp
index 2e7876b9eb..3c2349fbdf 100644
--- a/src/plugins/cpaster/pastebindotcomprotocol.cpp
+++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp
@@ -55,7 +55,8 @@ PasteBinDotComProtocol::PasteBinDotComProtocol(const NetworkAccessManagerProxyPt
m_pasteReply(0),
m_listReply(0),
m_fetchId(-1),
- m_postId(-1)
+ m_postId(-1),
+ m_hostChecked(false)
{
}
@@ -69,6 +70,16 @@ unsigned PasteBinDotComProtocol::capabilities() const
return ListCapability;
}
+bool PasteBinDotComProtocol::checkConfiguration(QString *errorMessage)
+{
+ if (m_hostChecked) // Check the host once.
+ return true;
+ const bool ok = httpStatus(hostName(false), errorMessage);
+ if (ok)
+ m_hostChecked = true;
+ return ok;
+}
+
QString PasteBinDotComProtocol::hostName(bool withSubDomain) const
{