From cde10b2bfdd4c5c7d4d299dd3237b407590144c5 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 19 Apr 2016 20:23:14 +0200 Subject: made spaceapi directory configurable can be configured using the directory=[URL] value in qspaceapi configuration file (which is currently ~/.config/CoderOnline/ qspacestatus.conf and subject to change). It now defaults to github, rather than the SpaceAPI website, because at the time of writing the directory has been down for some weeks. --- mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 812efeb..37b0f19 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -88,8 +88,11 @@ void MainWindow::updateSpaceList() { qDebug() << "updateSpaceList()"; QString defaultSpace = this->qsettings.value("hackerspace").toString(); + QString defaultDirectoryURL = this->qsettings.value("directory").toString(); + if(defaultDirectoryURL == "") + { defaultDirectoryURL = "https://raw.githubusercontent.com/SpaceApi/OpenSpaceDirectory/master/directory.json" ; } - QUrl url("http://spaceapi.net/directory.json"); + QUrl url(defaultDirectoryURL); QJsonObject json = QJsonDocument::fromJson(this->download(url)).object(); ui->comboBox->setDisabled(true); -- cgit v1.2.3