Don't try to connect to subsonic on startup if nothing is configured.
This commit is contained in:
parent
6904b06cf8
commit
0ae323bfff
|
@ -155,13 +155,22 @@ void SubsonicService::ReloadSettings() {
|
|||
Login();
|
||||
}
|
||||
|
||||
bool SubsonicService::IsConfigured() const {
|
||||
return !server_.isEmpty() &&
|
||||
!username_.isEmpty() &&
|
||||
!password_.isEmpty();
|
||||
}
|
||||
|
||||
void SubsonicService::Login() {
|
||||
// Forget session ID
|
||||
network_->setCookieJar(new QNetworkCookieJar(network_));
|
||||
// Forget login state whilst waiting
|
||||
login_state_ = LoginState_Unknown;
|
||||
// Ping is enough to check credentials
|
||||
Ping();
|
||||
|
||||
if (IsConfigured()) {
|
||||
// Ping is enough to check credentials
|
||||
Ping();
|
||||
}
|
||||
}
|
||||
|
||||
void SubsonicService::Login(
|
||||
|
|
|
@ -58,6 +58,8 @@ class SubsonicService : public InternetService
|
|||
|
||||
typedef QMap<QString, QString> RequestOptions;
|
||||
|
||||
bool IsConfigured() const;
|
||||
|
||||
QStandardItem* CreateRootItem();
|
||||
void LazyPopulate(QStandardItem *item);
|
||||
void ShowContextMenu(const QPoint &global_pos);
|
||||
|
|
Loading…
Reference in New Issue