aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index 69d42d930..26635c6e8 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -32,11 +32,12 @@ struct mydescriptor {
unsigned int model;
};
-namespace DownloadFromDcGlobal {
+namespace DownloadFromDcGlobal
+{
const char *err_string;
};
-DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f),
+DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f),
thread(0),
downloading(false),
previousLast(0),
@@ -87,7 +88,7 @@ void DownloadFromDCWidget::updateProgressBar()
ui.progressBar->setFormat(progress_bar_text);
} else {
ui.progressBar->setFormat("%p%");
- ui.progressBar->setValue(progress_bar_fraction *100);
+ ui.progressBar->setValue(progress_bar_fraction * 100);
}
}
@@ -111,8 +112,7 @@ void DownloadFromDCWidget::updateState(states state)
// user pressed cancel but the application isn't doing anything.
// means close the window
- else if ((currentState == INITIAL || currentState == CANCELLED || currentState == DONE || currentState == ERROR)
- && state == CANCELLING) {
+ else if ((currentState == INITIAL || currentState == CANCELLED || currentState == DONE || currentState == ERROR) && state == CANCELLING) {
timer->stop();
reject();
ui.ok->setText(tr("OK"));
@@ -168,7 +168,7 @@ void DownloadFromDCWidget::updateState(states state)
currentState = state;
}
-void DownloadFromDCWidget::on_vendor_currentIndexChanged(const QString& vendor)
+void DownloadFromDCWidget::on_vendor_currentIndexChanged(const QString &vendor)
{
QAbstractItemModel *currentModel = ui.product->model();
if (!currentModel)
@@ -205,7 +205,7 @@ void DownloadFromDCWidget::fill_computer_list()
QStringList computer;
dc_descriptor_iterator(&iterator);
- while (dc_iterator_next (iterator, &descriptor) == DC_STATUS_SUCCESS) {
+ while (dc_iterator_next(iterator, &descriptor) == DC_STATUS_SUCCESS) {
const char *vendor = dc_descriptor_get_vendor(descriptor);
const char *product = dc_descriptor_get_product(descriptor);
@@ -225,7 +225,7 @@ void DownloadFromDCWidget::fill_computer_list()
this WILL BREAK if libdivecomputer changes the dc_descriptor struct...
eventually the UEMIS code needs to move into libdivecomputer, I guess */
- mydescriptor = (struct mydescriptor*) malloc(sizeof(struct mydescriptor));
+ mydescriptor = (struct mydescriptor *)malloc(sizeof(struct mydescriptor));
mydescriptor->vendor = "Uemis";
mydescriptor->product = "Zurich";
mydescriptor->type = DC_FAMILY_NULL;
@@ -246,9 +246,9 @@ void DownloadFromDCWidget::on_search_clicked()
{
if (ui.vendor->currentText() == "Uemis") {
QString dirName = QFileDialog::getExistingDirectory(this,
- tr("Find Uemis dive computer"),
- QDir::homePath(),
- QFileDialog::ShowDirsOnly);
+ tr("Find Uemis dive computer"),
+ QDir::homePath(),
+ QFileDialog::ShowDirsOnly);
qDebug() << dirName;
if (ui.device->findText(dirName) == -1)
ui.device->addItem(dirName);
@@ -284,7 +284,7 @@ void DownloadFromDCWidget::on_ok_clicked()
thread = new DownloadThread(this, &data);
connect(thread, SIGNAL(finished()),
- this, SLOT(onDownloadThreadFinished()), Qt::QueuedConnection);
+ this, SLOT(onDownloadThreadFinished()), Qt::QueuedConnection);
MainWindow *w = MainWindow::instance();
connect(thread, SIGNAL(finished()), w, SLOT(refreshDisplay()));
@@ -311,7 +311,7 @@ void DownloadFromDCWidget::checkLogFile(int state)
void DownloadFromDCWidget::pickLogFile()
{
- QString filename = existing_filename ? : prefs.default_filename;
+ QString filename = existing_filename ?: prefs.default_filename;
QFileInfo fi(filename);
filename = fi.absolutePath().append(QDir::separator()).append("subsurface.log");
logFile = QFileDialog::getSaveFileName(this, tr("Choose file for divecomputer download logfile"),
@@ -340,7 +340,7 @@ void DownloadFromDCWidget::checkDumpFile(int state)
void DownloadFromDCWidget::pickDumpFile()
{
- QString filename = existing_filename ? : prefs.default_filename;
+ QString filename = existing_filename ?: prefs.default_filename;
QFileInfo fi(filename);
filename = fi.absolutePath().append(QDir::separator()).append("subsurface.bin");
dumpFile = QFileDialog::getSaveFileName(this, tr("Choose file for divecomputer binary dump file"),
@@ -429,7 +429,7 @@ void DownloadFromDCWidget::fill_device_list()
ui.device->setCurrentIndex(deviceIndex);
}
-DownloadThread::DownloadThread(QObject* parent, device_data_t* data): QThread(parent),
+DownloadThread::DownloadThread(QObject *parent, device_data_t *data) : QThread(parent),
data(data)
{
}
@@ -438,7 +438,7 @@ static QString str_error(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- const QString str = QString().vsprintf( fmt, args );
+ const QString str = QString().vsprintf(fmt, args);
va_end(args);
return str;
@@ -453,5 +453,5 @@ void DownloadThread::run()
else
errorText = do_libdivecomputer_import(data);
if (errorText)
- error = str_error(errorText, data->devname, data->vendor, data->product);
+ error = str_error(errorText, data->devname, data->vendor, data->product);
}