code cleanup: whitespace cleanup

A lot of whitespace issues have snuck in recently, this just cleans those up so
that I don't need to hand-edit patches every time I touch this file (since
QtCreator automatically fixes whitespace when I make changes).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-01-26 16:51:01 -08:00
parent 2268b6b212
commit 5b81997459

View file

@ -146,15 +146,15 @@ void QMLManager::btRescan()
} }
QMLManager::QMLManager() : m_locationServiceEnabled(false), QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_verboseEnabled(false), m_verboseEnabled(false),
deletedDive(0), deletedDive(0),
deletedTrip(0), deletedTrip(0),
m_updateSelectedDive(-1), m_updateSelectedDive(-1),
m_selectedDiveTimestamp(0), m_selectedDiveTimestamp(0),
alreadySaving(false), alreadySaving(false),
m_pluggedInDeviceName(""), m_pluggedInDeviceName(""),
m_showNonDiveComputers(false), m_showNonDiveComputers(false),
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN) m_oldStatus(qPrefCloudStorage::CS_UNKNOWN)
{ {
m_instance = this; m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio(); m_lastDevicePixelRatio = qApp->devicePixelRatio();
@ -164,31 +164,31 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
// make upload signals available in QML // make upload signals available in QML
// Remark: signal - signal connect // Remark: signal - signal connect
connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadFinish, connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadFinish,
this, &QMLManager::uploadFinish); this, &QMLManager::uploadFinish);
connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadProgress, connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadProgress,
this, &QMLManager::uploadProgress); this, &QMLManager::uploadProgress);
connect(uploadDiveShare::instance(), &uploadDiveShare::uploadProgress, connect(uploadDiveShare::instance(), &uploadDiveShare::uploadProgress,
this, &QMLManager::uploadProgress); this, &QMLManager::uploadProgress);
// uploadDiveShare::uploadFinish() is defined with 3 parameters, // uploadDiveShare::uploadFinish() is defined with 3 parameters,
// whereas QMLManager::uploadFinish() is defined with 2 parameters, // whereas QMLManager::uploadFinish() is defined with 2 parameters,
// Solution add a slot as landing zone. // Solution add a slot as landing zone.
connect(uploadDiveShare::instance(), &uploadDiveShare::uploadFinish, connect(uploadDiveShare::instance(), &uploadDiveShare::uploadFinish,
this, &QMLManager::uploadFinishSlot); this, &QMLManager::uploadFinishSlot);
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
// on Android we first try the GenericDataLocation (typically /storage/emulated/0) and if that fails // on Android we first try the GenericDataLocation (typically /storage/emulated/0) and if that fails
// (as happened e.g. on a Sony Xperia phone) we try several other default locations, with the TempLocation as last resort // (as happened e.g. on a Sony Xperia phone) we try several other default locations, with the TempLocation as last resort
QStringList fileLocations = QStringList fileLocations =
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation) + QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation) +
QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation) + QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation) +
QStandardPaths::standardLocations(QStandardPaths::DownloadLocation) + QStandardPaths::standardLocations(QStandardPaths::DownloadLocation) +
QStandardPaths::standardLocations(QStandardPaths::TempLocation); QStandardPaths::standardLocations(QStandardPaths::TempLocation);
#elif defined(Q_OS_IOS) #elif defined(Q_OS_IOS)
// on iOS we should save the data to the DocumentsLocation so it becomes accessible to the user // on iOS we should save the data to the DocumentsLocation so it becomes accessible to the user
QStringList fileLocations = QStringList fileLocations =
QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation); QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
#endif #endif
appLogFileOpen = false; appLogFileOpen = false;
for (const QString &fileLocation : fileLocations) { for (const QString &fileLocation : fileLocations) {
@ -196,8 +196,8 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
appLogFile.setFileName(appLogFileName); appLogFile.setFileName(appLogFileName);
if (!appLogFile.open(QIODevice::ReadWrite|QIODevice::Truncate)) { if (!appLogFile.open(QIODevice::ReadWrite|QIODevice::Truncate)) {
appendTextToLog("Failed to open logfile " + appLogFileName appendTextToLog("Failed to open logfile " + appLogFileName
+ " at " + QDateTime::currentDateTime().toString() + " at " + QDateTime::currentDateTime().toString()
+ " error: " + appLogFile.errorString()); + " error: " + appLogFile.errorString());
} else { } else {
// found a directory that works // found a directory that works
appLogFileOpen = true; appLogFileOpen = true;
@ -206,7 +206,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
} }
if (appLogFileOpen) { if (appLogFileOpen) {
appendTextToLog("Successfully opened logfile " + appLogFileName appendTextToLog("Successfully opened logfile " + appLogFileName
+ " at " + QDateTime::currentDateTime().toString()); + " at " + QDateTime::currentDateTime().toString());
// if we were able to write the overall logfile, also write the libdivecomputer logfile // if we were able to write the overall logfile, also write the libdivecomputer logfile
QString libdcLogFileName = appLogFileName.replace("/subsurface.log", "/libdivecomputer.log"); QString libdcLogFileName = appLogFileName.replace("/subsurface.log", "/libdivecomputer.log");
// remove the existing libdivecomputer logfile so we don't copy an old one by mistake // remove the existing libdivecomputer logfile so we don't copy an old one by mistake
@ -236,7 +236,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
BTDiscovery *btDiscovery = BTDiscovery::instance(); BTDiscovery *btDiscovery = BTDiscovery::instance();
m_btEnabled = btDiscovery->btAvailable(); m_btEnabled = btDiscovery->btAvailable();
connect(&btDiscovery->localBtDevice, &QBluetoothLocalDevice::hostModeStateChanged, connect(&btDiscovery->localBtDevice, &QBluetoothLocalDevice::hostModeStateChanged,
this, &QMLManager::btHostModeChange); this, &QMLManager::btHostModeChange);
// create location manager service // create location manager service
locationProvider = new GpsLocation(&appendTextToLogStandalone, this); locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
@ -451,7 +451,7 @@ void QMLManager::finishSetup()
alreadySaving = true; alreadySaving = true;
openLocalThenRemote(url); openLocalThenRemote(url);
} else if (!empty_string(existing_filename) && } else if (!empty_string(existing_filename) &&
qPrefCloudStorage::cloud_verification_status() != qPrefCloudStorage::CS_UNKNOWN) { qPrefCloudStorage::cloud_verification_status() != qPrefCloudStorage::CS_UNKNOWN) {
setOldStatus((qPrefCloudStorage::cloud_status)qPrefCloudStorage::cloud_verification_status()); setOldStatus((qPrefCloudStorage::cloud_status)qPrefCloudStorage::cloud_verification_status());
set_filename(NOCLOUD_LOCALSTORAGE); set_filename(NOCLOUD_LOCALSTORAGE);
qPrefCloudStorage::set_cloud_verification_status(qPrefCloudStorage::CS_NOCLOUD); qPrefCloudStorage::set_cloud_verification_status(qPrefCloudStorage::CS_NOCLOUD);
@ -501,8 +501,8 @@ void QMLManager::saveCloudCredentials(const QString &newEmail, const QString &ne
if (!noCloud) { if (!noCloud) {
// in case of NO_CLOUD, the email address + passwd do not care, so do not check it. // in case of NO_CLOUD, the email address + passwd do not care, so do not check it.
if (newPassword.isEmpty() || if (newPassword.isEmpty() ||
!regExp.match(newPassword).hasMatch() || !regExp.match(newPassword).hasMatch() ||
!regExp.match(newEmail).hasMatch()) { !regExp.match(newEmail).hasMatch()) {
setStartPageText(RED_FONT + tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.") + END_FONT); setStartPageText(RED_FONT + tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.") + END_FONT);
return; return;
} }
@ -522,13 +522,13 @@ void QMLManager::saveCloudCredentials(const QString &newEmail, const QString &ne
} }
if (qPrefCloudStorage::cloud_verification_status() != qPrefCloudStorage::CS_NOCLOUD && if (qPrefCloudStorage::cloud_verification_status() != qPrefCloudStorage::CS_NOCLOUD &&
!cloudCredentialsChanged) { !cloudCredentialsChanged) {
// just go back to the dive list // just go back to the dive list
qPrefCloudStorage::set_cloud_verification_status(m_oldStatus); qPrefCloudStorage::set_cloud_verification_status(m_oldStatus);
} }
if (!noCloud && if (!noCloud &&
!verifyCredentials(newEmail, newPassword, pin)) !verifyCredentials(newEmail, newPassword, pin))
return; return;
qPrefCloudStorage::set_cloud_storage_email(newEmail); qPrefCloudStorage::set_cloud_storage_email(newEmail);
@ -541,7 +541,7 @@ void QMLManager::saveCloudCredentials(const QString &newEmail, const QString &ne
appendTextToLog("transitioning from no-cloud to cloud and have dives"); appendTextToLog("transitioning from no-cloud to cloud and have dives");
} }
if (qPrefCloudStorage::cloud_storage_email().isEmpty() || if (qPrefCloudStorage::cloud_storage_email().isEmpty() ||
qPrefCloudStorage::cloud_storage_password().isEmpty()) { qPrefCloudStorage::cloud_storage_password().isEmpty()) {
setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT); setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT);
} else if (cloudCredentialsChanged) { } else if (cloudCredentialsChanged) {
// let's make sure there are no unsaved changes // let's make sure there are no unsaved changes
@ -705,8 +705,8 @@ void QMLManager::retrieveUserid()
auto *reply = qobject_cast<QNetworkReply *>(sender()); auto *reply = qobject_cast<QNetworkReply *>(sender());
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) != 302) { if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) != 302) {
appendTextToLog(QStringLiteral("Cloud storage connection not working correctly: (%1) %2") appendTextToLog(QStringLiteral("Cloud storage connection not working correctly: (%1) %2")
.arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()) .arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt())
.arg(QString(reply->readAll()))); .arg(QString(reply->readAll())));
setStartPageText(RED_FONT + tr("Cannot connect to cloud storage") + END_FONT); setStartPageText(RED_FONT + tr("Cannot connect to cloud storage") + END_FONT);
revertToNoCloudIfNeeded(); revertToNoCloudIfNeeded();
return; return;
@ -1071,8 +1071,8 @@ bool QMLManager::checkDepth(const DiveObjectHelper &myDive, dive *d, QString dep
// update the dive and return the notes field, stripped of the HTML junk // update the dive and return the notes field, stripped of the HTML junk
void QMLManager::commitChanges(QString diveId, QString number, QString date, QString location, QString gps, QString duration, QString depth, void QMLManager::commitChanges(QString diveId, QString number, QString date, QString location, QString gps, QString duration, QString depth,
QString airtemp, QString watertemp, QString suit, QString buddy, QString diveMaster, QString weight, QString notes, QString airtemp, QString watertemp, QString suit, QString buddy, QString diveMaster, QString weight, QString notes,
QStringList startpressure, QStringList endpressure, QStringList gasmix, QStringList usedCylinder, int rating, int visibility, QString state) QStringList startpressure, QStringList endpressure, QStringList gasmix, QStringList usedCylinder, int rating, int visibility, QString state)
{ {
struct dive *d = get_dive_by_uniq_id(diveId.toInt()); struct dive *d = get_dive_by_uniq_id(diveId.toInt());
@ -1147,8 +1147,8 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
int he = parseGasMixHE(gasmix[j]); int he = parseGasMixHE(gasmix[j]);
// the QML code SHOULD only accept valid gas mixes, but just to make sure // the QML code SHOULD only accept valid gas mixes, but just to make sure
if (o2 >= 0 && o2 <= 1000 && if (o2 >= 0 && o2 <= 1000 &&
he >= 0 && he <= 1000 && he >= 0 && he <= 1000 &&
o2 + he <= 1000) { o2 + he <= 1000) {
diveChanged = true; diveChanged = true;
get_cylinder(d, i)->gasmix.o2.permille = o2; get_cylinder(d, i)->gasmix.o2.permille = o2;
get_cylinder(d, i)->gasmix.he.permille = he; get_cylinder(d, i)->gasmix.he.permille = he;
@ -2015,74 +2015,74 @@ void QMLManager::showDownloadPage(QString deviceString)
// the rest is based on the vendor and product IDs // the rest is based on the vendor and product IDs
if (deviceString.contains("HeinrichsWeikamp OSTC3")) { if (deviceString.contains("HeinrichsWeikamp OSTC3")) {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(vendorList.indexOf("Heinrichs Weikamp")) .arg(vendorList.indexOf("Heinrichs Weikamp"))
.arg(productList["Heinrichs Weikamp"].indexOf("OSTC 3")) .arg(productList["Heinrichs Weikamp"].indexOf("OSTC 3"))
.arg(connectionListModel.indexOf("FTDI")); .arg(connectionListModel.indexOf("FTDI"));
} else if (deviceString.contains("HeinrichsWeikamp OSTC 2N")) { } else if (deviceString.contains("HeinrichsWeikamp OSTC 2N")) {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(vendorList.indexOf("Heinrichs Weikamp")) .arg(vendorList.indexOf("Heinrichs Weikamp"))
.arg(productList["Heinrichs Weikamp"].indexOf("OSTC 2N")) .arg(productList["Heinrichs Weikamp"].indexOf("OSTC 2N"))
.arg(connectionListModel.indexOf("FTDI")); .arg(connectionListModel.indexOf("FTDI"));
} else if (deviceString.contains("mManufacturerName=ATOMIC AQUATICS") && } else if (deviceString.contains("mManufacturerName=ATOMIC AQUATICS") &&
deviceString.contains("mProductName=COBALT")) { deviceString.contains("mProductName=COBALT")) {
if (deviceString.contains("mVersion=2")) { if (deviceString.contains("mVersion=2")) {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(vendorList.indexOf("Atomic Aquatics")) .arg(vendorList.indexOf("Atomic Aquatics"))
.arg(productList["Atomic Aquatics"].indexOf("Cobalt 2")) .arg(productList["Atomic Aquatics"].indexOf("Cobalt 2"))
.arg(connectionListModel.indexOf("USB device")); .arg(connectionListModel.indexOf("USB device"));
} else { } else {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(vendorList.indexOf("Atomic Aquatics")) .arg(vendorList.indexOf("Atomic Aquatics"))
.arg(productList["Atomic Aquatics"].indexOf("Cobalt")) .arg(productList["Atomic Aquatics"].indexOf("Cobalt"))
.arg(connectionListModel.indexOf("USB device")); .arg(connectionListModel.indexOf("USB device"));
} }
} else if (deviceString.contains("mVendorId=5267") && // 0x1493 / 0x0030 } else if (deviceString.contains("mVendorId=5267") && // 0x1493 / 0x0030
deviceString.contains("mProductId=48")) { deviceString.contains("mProductId=48")) {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(connectionListModel.indexOf("Suunto")) .arg(connectionListModel.indexOf("Suunto"))
.arg(productList["Suunto"].indexOf("EON Steel")) .arg(productList["Suunto"].indexOf("EON Steel"))
.arg(connectionListModel.indexOf("USB device")); .arg(connectionListModel.indexOf("USB device"));
} else if (deviceString.contains("mVendorId=5267") && // 0x1493 / 0x0033 } else if (deviceString.contains("mVendorId=5267") && // 0x1493 / 0x0033
deviceString.contains("mProductId=51")) { deviceString.contains("mProductId=51")) {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(connectionListModel.indexOf("Suunto")) .arg(connectionListModel.indexOf("Suunto"))
.arg(productList["Suunto"].indexOf("EON Core")) .arg(productList["Suunto"].indexOf("EON Core"))
.arg(connectionListModel.indexOf("USB device")); .arg(connectionListModel.indexOf("USB device"));
} else if (deviceString.contains("mVendorId=11884") && // 0x2e6c / 0x3201,0x3211,0x4201 } else if (deviceString.contains("mVendorId=11884") && // 0x2e6c / 0x3201,0x3211,0x4201
(deviceString.contains("mProductId=12801") || (deviceString.contains("mProductId=12801") ||
deviceString.contains("mProductId=12817") || deviceString.contains("mProductId=12817") ||
deviceString.contains("mProductId=16897"))) { deviceString.contains("mProductId=16897"))) {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(connectionListModel.indexOf("Scubapro")) .arg(connectionListModel.indexOf("Scubapro"))
.arg(productList["Scubapro"].indexOf("G2")) .arg(productList["Scubapro"].indexOf("G2"))
.arg(connectionListModel.indexOf("USB device")); .arg(connectionListModel.indexOf("USB device"));
} else if (deviceString.contains("mVendorId=49745") && // 0xc251 / 0x2006 } else if (deviceString.contains("mVendorId=49745") && // 0xc251 / 0x2006
deviceString.contains("mProductId=8198")) { deviceString.contains("mProductId=8198")) {
name = QString("%1;%2;%3") name = QString("%1;%2;%3")
.arg(connectionListModel.indexOf("Scubapro")) .arg(connectionListModel.indexOf("Scubapro"))
.arg(productList["Scubapro"].indexOf("Aladin Square")) .arg(productList["Scubapro"].indexOf("Aladin Square"))
.arg(connectionListModel.indexOf("USB device")); .arg(connectionListModel.indexOf("USB device"));
} else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0x6001,0x6010,0x6011,0x6015 } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0x6001,0x6010,0x6011,0x6015
(deviceString.contains("mProductId=24577") || (deviceString.contains("mProductId=24577") ||
deviceString.contains("mProductId=24592") || deviceString.contains("mProductId=24592") ||
deviceString.contains("mProductId=24593") || deviceString.contains("mProductId=24593") ||
deviceString.contains("mProductId=24597"))) { deviceString.contains("mProductId=24597"))) {
name = QString("-1;-1;%1").arg(connectionListModel.indexOf("FTDI")); name = QString("-1;-1;%1").arg(connectionListModel.indexOf("FTDI"));
} else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0xf460 } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0xf460
deviceString.contains("mProductId=62560")) { deviceString.contains("mProductId=62560")) {
name = QString("%1;-1;%2") name = QString("%1;-1;%2")
.arg(vendorList.indexOf("Oceanic")) .arg(vendorList.indexOf("Oceanic"))
.arg(connectionListModel.indexOf("FTDI")); .arg(connectionListModel.indexOf("FTDI"));
} else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0xf680 } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0xf680
deviceString.contains("mProductId=63104")) { deviceString.contains("mProductId=63104")) {
name = QString("%1;-1;%2") name = QString("%1;-1;%2")
.arg(vendorList.indexOf("Suunto")) .arg(vendorList.indexOf("Suunto"))
.arg(connectionListModel.indexOf("FTDI")); .arg(connectionListModel.indexOf("FTDI"));
} else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0x87d0 } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0x87d0
deviceString.contains("mProductId=34768")) { deviceString.contains("mProductId=34768")) {
name = QString("%1;-1;%2") name = QString("%1;-1;%2")
.arg(vendorList.indexOf("Cressi")) .arg(vendorList.indexOf("Cressi"))
.arg(connectionListModel.indexOf("FTDI")); .arg(connectionListModel.indexOf("FTDI"));
} }
// inform the QML UI that it should show the download page // inform the QML UI that it should show the download page
m_pluggedInDeviceName = strdup(qPrintable(name)); m_pluggedInDeviceName = strdup(qPrintable(name));
@ -2094,11 +2094,11 @@ void QMLManager::setFilter(const QString filterText)
// show that we are doing something, then do something in another thread in order not to block the UI // show that we are doing something, then do something in another thread in order not to block the UI
QMetaObject::invokeMethod(qmlWindow, "showBusyAndDisconnectModel"); QMetaObject::invokeMethod(qmlWindow, "showBusyAndDisconnectModel");
QtConcurrent::run(QThreadPool::globalInstance(), QtConcurrent::run(QThreadPool::globalInstance(),
[=]{ [=]{
DiveListSortModel::instance()->setFilter(filterText); DiveListSortModel::instance()->setFilter(filterText);
CollapsedDiveListSortModel::instance()->updateFilterState(); CollapsedDiveListSortModel::instance()->updateFilterState();
QMetaObject::invokeMethod(qmlWindow, "hideBusyAndConnectModel"); QMetaObject::invokeMethod(qmlWindow, "hideBusyAndConnectModel");
}); });
} }
void QMLManager::setShowNonDiveComputers(bool show) void QMLManager::setShowNonDiveComputers(bool show)
@ -2127,45 +2127,45 @@ void QMLManager::exportToFile(export_types type, QString dir, bool anonymize)
switch (type) switch (type)
{ {
case EX_DIVES_XML: case EX_DIVES_XML:
save_dives_logic(qPrintable(fileName + ".ssrf"), false, anonymize); save_dives_logic(qPrintable(fileName + ".ssrf"), false, anonymize);
break; break;
case EX_DIVE_SITES_XML: case EX_DIVE_SITES_XML:
{ {
std::vector<const dive_site *> sites = exportFuncs::instance()->getDiveSitesToExport(false); std::vector<const dive_site *> sites = exportFuncs::instance()->getDiveSitesToExport(false);
save_dive_sites_logic(qPrintable(fileName + ".xml"), &sites[0], (int)sites.size(), anonymize); save_dive_sites_logic(qPrintable(fileName + ".xml"), &sites[0], (int)sites.size(), anonymize);
break; break;
} }
case EX_UDDF: case EX_UDDF:
exportFuncs::instance()->exportUsingStyleSheet(fileName + ".uddf", true, 0, "uddf-export.xslt", anonymize); exportFuncs::instance()->exportUsingStyleSheet(fileName + ".uddf", true, 0, "uddf-export.xslt", anonymize);
break; break;
case EX_CSV_DIVE_PROFILE: case EX_CSV_DIVE_PROFILE:
exportFuncs::instance()->exportUsingStyleSheet(fileName + ".uddf", true, 0, "xml2csv.xslt", anonymize); exportFuncs::instance()->exportUsingStyleSheet(fileName + ".uddf", true, 0, "xml2csv.xslt", anonymize);
break; break;
case EX_CSV_DETAILS: case EX_CSV_DETAILS:
exportFuncs::instance()->exportUsingStyleSheet(fileName + ".uddf", true, 0, "xml2manualcsv.xslt", anonymize); exportFuncs::instance()->exportUsingStyleSheet(fileName + ".uddf", true, 0, "xml2manualcsv.xslt", anonymize);
break; break;
case EX_CSV_PROFILE: case EX_CSV_PROFILE:
save_profiledata(qPrintable(fileName + ".csv"), true); save_profiledata(qPrintable(fileName + ".csv"), true);
break; break;
case EX_PROFILE_PNG: case EX_PROFILE_PNG:
exportFuncs::instance()->exportProfile(qPrintable(fileName + ".png"), false); exportFuncs::instance()->exportProfile(qPrintable(fileName + ".png"), false);
break; break;
case EX_WORLD_MAP: case EX_WORLD_MAP:
export_worldmap_HTML(qPrintable(fileName + ".html"), true); export_worldmap_HTML(qPrintable(fileName + ".html"), true);
break; break;
case EX_TEX: case EX_TEX:
exportFuncs::instance()->export_TeX(qPrintable(fileName + ".tex"), true, true); exportFuncs::instance()->export_TeX(qPrintable(fileName + ".tex"), true, true);
break; break;
case EX_LATEX: case EX_LATEX:
exportFuncs::instance()->export_TeX(qPrintable(fileName + ".tex"), true, false); exportFuncs::instance()->export_TeX(qPrintable(fileName + ".tex"), true, false);
break; break;
case EX_IMAGE_DEPTHS: case EX_IMAGE_DEPTHS:
exportFuncs::instance()->export_depths(qPrintable(fileName), false); exportFuncs::instance()->export_depths(qPrintable(fileName), false);
break; break;
default: default:
qDebug() << "export to unknown type " << type << " using " << dir << " remove names " << anonymize; qDebug() << "export to unknown type " << type << " using " << dir << " remove names " << anonymize;
break; break;
} }
} }
@ -2178,15 +2178,15 @@ void QMLManager::exportToWEB(export_types type, QString userId, QString password
{ {
switch (type) switch (type)
{ {
case EX_DIVELOGS_DE: case EX_DIVELOGS_DE:
uploadDiveLogsDE::instance()->doUpload(false, userId, password); uploadDiveLogsDE::instance()->doUpload(false, userId, password);
break; break;
case EX_DIVESHARE: case EX_DIVESHARE:
uploadDiveShare::instance()->doUpload(false, userId, anonymize); uploadDiveShare::instance()->doUpload(false, userId, anonymize);
break; break;
default: default:
qDebug() << "upload to unknown type " << type << " using " << userId << "/" << password << " remove names " << anonymize; qDebug() << "upload to unknown type " << type << " using " << userId << "/" << password << " remove names " << anonymize;
break; break;
} }
} }