mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Whitespace: fix indentation in subsurfacewebservices.* to use tabs
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
parent
7c8e95e1b5
commit
0ed95678ba
2 changed files with 44 additions and 44 deletions
|
@ -70,36 +70,36 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton* button)
|
|||
{
|
||||
ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||
switch(ui.buttonBox->buttonRole(button)){
|
||||
case QDialogButtonBox::ApplyRole:{
|
||||
clear_table(&gps_location_table);
|
||||
QByteArray url = tr("Webservice").toLocal8Bit();
|
||||
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL, NULL);
|
||||
case QDialogButtonBox::ApplyRole:{
|
||||
clear_table(&gps_location_table);
|
||||
QByteArray url = tr("Webservice").toLocal8Bit();
|
||||
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL, NULL);
|
||||
|
||||
/* now merge the data in the gps_location table into the dive_table */
|
||||
if (merge_locations_into_dives()) {
|
||||
mark_divelist_changed(TRUE);
|
||||
}
|
||||
|
||||
/* store last entered uid in config */
|
||||
QSettings s;
|
||||
s.setValue("subsurface_webservice_uid", ui.userID->text().toUpper());
|
||||
s.sync();
|
||||
hide();
|
||||
close();
|
||||
/* now merge the data in the gps_location table into the dive_table */
|
||||
if (merge_locations_into_dives()) {
|
||||
mark_divelist_changed(TRUE);
|
||||
}
|
||||
|
||||
/* store last entered uid in config */
|
||||
QSettings s;
|
||||
s.setValue("subsurface_webservice_uid", ui.userID->text().toUpper());
|
||||
s.sync();
|
||||
hide();
|
||||
close();
|
||||
}
|
||||
break;
|
||||
case QDialogButtonBox::RejectRole:
|
||||
// we may want to clean up after ourselves, but this
|
||||
// makes Subsurface throw a SIGSEGV...
|
||||
// manager->deleteLater();
|
||||
// reply->deleteLater();
|
||||
ui.progressBar->setMaximum(1);
|
||||
break;
|
||||
case QDialogButtonBox::HelpRole:
|
||||
QDesktopServices::openUrl(QUrl("http://api.hohndel.org"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case QDialogButtonBox::RejectRole:
|
||||
// we may want to clean up after ourselves, but this
|
||||
// makes Subsurface throw a SIGSEGV...
|
||||
// manager->deleteLater();
|
||||
// reply->deleteLater();
|
||||
ui.progressBar->setMaximum(1);
|
||||
break;
|
||||
case QDialogButtonBox::HelpRole:
|
||||
QDesktopServices::openUrl(QUrl("http://api.hohndel.org"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ void SubsurfaceWebServices::startDownload()
|
|||
|
||||
connect(reply, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
|
||||
this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||
this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||
}
|
||||
|
||||
void SubsurfaceWebServices::downloadFinished()
|
||||
|
@ -167,7 +167,7 @@ void SubsurfaceWebServices::download_dialog_traverse_xml(xmlNodePtr node, unsign
|
|||
xmlNodePtr cur_node;
|
||||
for (cur_node = node; cur_node; cur_node = cur_node->next) {
|
||||
if ((!strcmp((const char *)cur_node->name, (const char *)"download")) &&
|
||||
(!strcmp((const char *)xmlNodeGetContent(cur_node), (const char *)"ok"))) {
|
||||
(!strcmp((const char *)xmlNodeGetContent(cur_node), (const char *)"ok"))) {
|
||||
*download_status = DD_STATUS_OK;
|
||||
return;
|
||||
} else if (!strcmp((const char *)cur_node->name, (const char *)"error")) {
|
||||
|
@ -192,16 +192,16 @@ unsigned int SubsurfaceWebServices::download_dialog_parse_response(const QByteAr
|
|||
}
|
||||
if (root->children)
|
||||
download_dialog_traverse_xml(root->children, &status);
|
||||
end:
|
||||
xmlFreeDoc(doc);
|
||||
return status;
|
||||
end:
|
||||
xmlFreeDoc(doc);
|
||||
return status;
|
||||
}
|
||||
|
||||
static bool is_automatic_fix(struct dive *gpsfix)
|
||||
{
|
||||
if (gpsfix && gpsfix->location &&
|
||||
(!strcmp(gpsfix->location, "automatic fix") ||
|
||||
!strcmp(gpsfix->location, "Auto-created dive")))
|
||||
(!strcmp(gpsfix->location, "automatic fix") ||
|
||||
!strcmp(gpsfix->location, "Auto-created dive")))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -223,9 +223,9 @@ static bool merge_locations_into_dives(void)
|
|||
struct tm tm;
|
||||
utc_mkdate(gpsfix->when, &tm);
|
||||
printf("found dive named %s @ %04d-%02d-%02d %02d:%02d:%02d\n",
|
||||
gpsfix->location,
|
||||
tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
gpsfix->location,
|
||||
tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
#endif
|
||||
changed++;
|
||||
copy_gps_location(gpsfix, dive);
|
||||
|
@ -252,9 +252,9 @@ static bool merge_locations_into_dives(void)
|
|||
utc_mkdate(gpsfix->when, &tm);
|
||||
#if DEBUG_WEBSERVICE
|
||||
printf("didn't find dive matching gps fix named %s @ %04d-%02d-%02d %02d:%02d:%02d\n",
|
||||
gpsfix->location,
|
||||
tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
gpsfix->location,
|
||||
tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ class QNetworkReply;
|
|||
class WebServices : public QDialog{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WebServices(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
explicit WebServices(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
void hidePassword();
|
||||
void hideUpload();
|
||||
|
||||
|
@ -41,7 +41,7 @@ private slots:
|
|||
void downloadError(QNetworkReply::NetworkError error);
|
||||
void startUpload(){} /*no op*/
|
||||
private:
|
||||
explicit SubsurfaceWebServices(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
explicit SubsurfaceWebServices(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
void setStatusText(int status);
|
||||
void download_dialog_traverse_xml(xmlNodePtr node, unsigned int *download_status);
|
||||
unsigned int download_dialog_parse_response(const QByteArray& length);
|
||||
|
@ -57,9 +57,9 @@ private slots:
|
|||
void buttonClicked(QAbstractButton* button);
|
||||
void downloadFinished();
|
||||
void downloadError(QNetworkReply::NetworkError error);
|
||||
void startUpload();
|
||||
void startUpload();
|
||||
private:
|
||||
explicit DivelogsDeWebServices (QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
explicit DivelogsDeWebServices (QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
void setStatusText(int status);
|
||||
void download_dialog_traverse_xml(xmlNodePtr node, unsigned int *download_status);
|
||||
unsigned int download_dialog_parse_response(const QByteArray& length);
|
||||
|
|
Loading…
Reference in a new issue