mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
fixes "unable to login", discovered during #780,
* fixed bootstrap file * improved timeout of connect, now in single static function * some minor tweaks
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
"url": "http://crashreports.swift-project.org/crash_upload"
|
||||
},
|
||||
"dbDebugFlag": false,
|
||||
"dbHttpPort": 5080,
|
||||
"dbHttpsPort": 50443,
|
||||
"dbHttpPort": 80,
|
||||
"dbHttpsPort": 443,
|
||||
"dbRootDirectoryUrl": {
|
||||
"url": "https://datastore.swift-project.org"
|
||||
},
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace BlackCore
|
||||
|
||||
if (this->m_shutdown) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "Shutdown in progress")); return msgs; }
|
||||
|
||||
QString un(username.trimmed());
|
||||
QString pw(password.trimmed());
|
||||
const QString un(username.trimmed());
|
||||
const QString pw(password.trimmed());
|
||||
if (un.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No user name/id")); }
|
||||
if (pw.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No password")); }
|
||||
if (!msgs.isEmpty()) { return msgs; }
|
||||
|
||||
@@ -90,9 +90,9 @@ namespace BlackGui
|
||||
|
||||
void CDbLoginComponent::ps_onLoginClicked()
|
||||
{
|
||||
QString un(ui->le_Username->text().trimmed());
|
||||
QString pw(ui->le_Password->text().trimmed());
|
||||
CStatusMessageList msgs = m_loginService.login(un, pw);
|
||||
const QString un(ui->le_Username->text().trimmed());
|
||||
const QString pw(ui->le_Password->text().trimmed());
|
||||
const CStatusMessageList msgs = m_loginService.login(un, pw);
|
||||
|
||||
if (msgs.hasWarningOrErrorMessages())
|
||||
{
|
||||
|
||||
@@ -38,6 +38,11 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Network
|
||||
{
|
||||
int CNetworkUtils::getTimeoutMs()
|
||||
{
|
||||
return 2000;
|
||||
}
|
||||
|
||||
bool CNetworkUtils::hasConnectedInterface(bool withDebugOutput)
|
||||
{
|
||||
// http://stackoverflow.com/questions/2475266/verfiying-the-network-connection-using-qt-4-4
|
||||
|
||||
@@ -47,6 +47,9 @@ namespace BlackMisc
|
||||
Multipart
|
||||
};
|
||||
|
||||
//! Default for timeout
|
||||
static int getTimeoutMs();
|
||||
|
||||
//! Is a connected interface available?
|
||||
//! \param withDebugOutput enables some debugging output
|
||||
//! \return
|
||||
@@ -58,29 +61,29 @@ namespace BlackMisc
|
||||
//! \param timeoutMs
|
||||
//! \param message human readable message
|
||||
//! \return
|
||||
static bool canConnect(const QString &hostAddress, int port, QString &message, int timeoutMs = 1500);
|
||||
static bool canConnect(const QString &hostAddress, int port, QString &message, int timeoutMs = getTimeoutMs());
|
||||
|
||||
//! Can connect to server?
|
||||
//! \param server
|
||||
//! \param message human readable message
|
||||
//! \param timeoutMs
|
||||
//! \return
|
||||
static bool canConnect(const BlackMisc::Network::CServer &server, QString &message, int timeoutMs = 1500);
|
||||
static bool canConnect(const BlackMisc::Network::CServer &server, QString &message, int timeoutMs = getTimeoutMs());
|
||||
|
||||
//! Can connect to URL?
|
||||
static bool canConnect(const QString &url, QString &message, int timeoutMs = 1500);
|
||||
static bool canConnect(const QString &url, QString &message, int timeoutMs = getTimeoutMs());
|
||||
|
||||
//! Can connect to URL?
|
||||
static bool canConnect(const QUrl &url, QString &message, int timeoutMs = 1500);
|
||||
static bool canConnect(const QUrl &url, QString &message, int timeoutMs = getTimeoutMs());
|
||||
|
||||
//! Can connect to URL?
|
||||
static bool canConnect(const QUrl &url, int timeoutMs = 1500);
|
||||
static bool canConnect(const QUrl &url, int timeoutMs = getTimeoutMs());
|
||||
|
||||
//! Can connect to URL?
|
||||
static bool canConnect(const BlackMisc::Network::CUrl &url, QString &message, int timeoutMs = 1500);
|
||||
static bool canConnect(const BlackMisc::Network::CUrl &url, QString &message, int timeoutMs = getTimeoutMs());
|
||||
|
||||
//! Can connect to URL?
|
||||
static bool canConnect(const BlackMisc::Network::CUrl &url, int timeoutMs = 1500);
|
||||
static bool canConnect(const BlackMisc::Network::CUrl &url, int timeoutMs = getTimeoutMs());
|
||||
|
||||
//! Find out my IPv4 address, empty if not possible
|
||||
static QStringList getKnownIpAddresses();
|
||||
|
||||
Reference in New Issue
Block a user