diff options
author | Paul Buxton <paulbuxton.mail@googlemail.com> | 2019-08-28 10:21:24 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-08-29 12:55:25 -0700 |
commit | 3c4fd5d5999db218878563a98e9c76903d63d2bb (patch) | |
tree | 9c3bf3bba466063e5ad599d43795254acce9d798 /desktop-widgets | |
parent | 193c456f06c022c1d83d4f0238c46c541a726c3c (diff) | |
download | subsurface-3c4fd5d5999db218878563a98e9c76903d63d2bb.tar.gz |
Fix broken windows build with latest MXE
Replaces some enums with names that do not clash with windows #defines.
Specifically:
ERROR -> ERRORED, PASCAL->PASCALS, IGNORE->IGNORED,FLOAT->FLOATVAL
Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 8 | ||||
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.h | 2 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 30 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.h | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 769d4a913..65c4c5236 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -244,7 +244,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 == DONE || currentState == ERROR) && state == CANCELLING) { + else if ((currentState == INITIAL || currentState == DONE || currentState == ERRORED) && state == CANCELLING) { timer->stop(); reject(); } @@ -294,7 +294,7 @@ void DownloadFromDCWidget::updateState(states state) } // got an error - else if (state == ERROR) { + else if (state == ERRORED) { timer->stop(); QMessageBox::critical(this, TITLE_OR_TEXT(tr("Error"), thread.error), QMessageBox::Ok); @@ -503,7 +503,7 @@ void DownloadFromDCWidget::onDownloadThreadFinished() if (thread.error.isEmpty()) updateState(DONE); else - updateState(ERROR); + updateState(ERRORED); } else if (currentState == CANCELLING) { updateState(DONE); } @@ -524,7 +524,7 @@ void DownloadFromDCWidget::on_cancel_clicked() void DownloadFromDCWidget::on_ok_clicked() { - if (currentState != DONE && currentState != ERROR) + if (currentState != DONE && currentState != ERRORED) return; struct dive_table *table = thread.table(); struct dive_site_table *sites = thread.sites(); diff --git a/desktop-widgets/downloadfromdivecomputer.h b/desktop-widgets/downloadfromdivecomputer.h index c70ee651a..5b5b18e66 100644 --- a/desktop-widgets/downloadfromdivecomputer.h +++ b/desktop-widgets/downloadfromdivecomputer.h @@ -32,7 +32,7 @@ public: INITIAL, DOWNLOADING, CANCELLING, - ERROR, + ERRORED, DONE, }; diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 4b88f555b..613398109 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -438,7 +438,7 @@ void MainTab::updateDiveInfo() for (int i = 0; i < extraWidgets.size() - 1; ++i) extraWidgets[i]->setEnabled(enabled); - editMode = IGNORE; // don't trigger on changes to the widgets + editMode = IGNORE_MODE; // don't trigger on changes to the widgets for (TabBase *widget: extraWidgets) widget->updateData(); @@ -619,7 +619,7 @@ void MainTab::acceptChanges() stealFocus(); EditMode lastMode = editMode; - editMode = IGNORE; + editMode = IGNORE_MODE; tabBar()->setTabIcon(0, QIcon()); // Notes tabBar()->setTabIcon(1, QIcon()); // Equipment ui.dateEdit->setEnabled(true); @@ -746,7 +746,7 @@ static QStringList stringToList(const QString &s) void MainTab::on_buddy_editingFinished() { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; divesEdited(Command::editBuddies(stringToList(ui.buddy->toPlainText()), false)); @@ -754,7 +754,7 @@ void MainTab::on_buddy_editingFinished() void MainTab::on_divemaster_editingFinished() { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; divesEdited(Command::editDiveMaster(stringToList(ui.divemaster->toPlainText()), false)); @@ -762,7 +762,7 @@ void MainTab::on_divemaster_editingFinished() void MainTab::on_duration_editingFinished() { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; // Duration editing is special: we only edit the current dive. @@ -771,7 +771,7 @@ void MainTab::on_duration_editingFinished() void MainTab::on_depth_editingFinished() { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; // Depth editing is special: we only edit the current dive. @@ -783,14 +783,14 @@ void MainTab::on_airtemp_editingFinished() // If the field wasn't modified by the user, don't post a new undo command. // Owing to rounding errors, this might lead to undo commands that have // no user visible effects. These can be very confusing. - if (editMode == IGNORE || !ui.airtemp->isModified() || !current_dive) + if (editMode == IGNORE_MODE || !ui.airtemp->isModified() || !current_dive) return; divesEdited(Command::editAirTemp(parseTemperatureToMkelvin(ui.airtemp->text()), false)); } void MainTab::divetype_Changed(int index) { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; divesEdited(Command::editMode(dc_number, (enum divemode_t)index, false)); } @@ -800,7 +800,7 @@ void MainTab::on_watertemp_editingFinished() // If the field wasn't modified by the user, don't post a new undo command. // Owing to rounding errors, this might lead to undo commands that have // no user visible effects. These can be very confusing. - if (editMode == IGNORE || !ui.watertemp->isModified() || !current_dive) + if (editMode == IGNORE_MODE || !ui.watertemp->isModified() || !current_dive) return; divesEdited(Command::editWaterTemp(parseTemperatureToMkelvin(ui.watertemp->text()), false)); } @@ -826,7 +826,7 @@ static void shiftTime(QDateTime &dateTime) void MainTab::on_dateEdit_dateChanged(const QDate &date) { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(1000*current_dive->when, Qt::UTC); dateTime.setTimeSpec(Qt::UTC); @@ -836,7 +836,7 @@ void MainTab::on_dateEdit_dateChanged(const QDate &date) void MainTab::on_timeEdit_timeChanged(const QTime &time) { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(1000*current_dive->when, Qt::UTC); dateTime.setTimeSpec(Qt::UTC); @@ -846,7 +846,7 @@ void MainTab::on_timeEdit_timeChanged(const QTime &time) void MainTab::on_tagWidget_editingFinished() { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; divesEdited(Command::editTags(ui.tagWidget->getBlockStringList(), false)); @@ -854,7 +854,7 @@ void MainTab::on_tagWidget_editingFinished() void MainTab::on_location_diveSiteSelected() { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; struct dive_site *newDs = ui.location->currDiveSite(); @@ -892,7 +892,7 @@ void MainTab::on_notes_editingFinished() void MainTab::on_rating_valueChanged(int value) { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; divesEdited(Command::editRating(value, false)); @@ -900,7 +900,7 @@ void MainTab::on_rating_valueChanged(int value) void MainTab::on_visibility_valueChanged(int value) { - if (editMode == IGNORE || !current_dive) + if (editMode == IGNORE_MODE || !current_dive) return; divesEdited(Command::editVisibility(value, false)); diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index a60ac5613..55227c993 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -30,7 +30,7 @@ public: NONE, DIVE, MANUALLY_ADDED_DIVE, - IGNORE + IGNORE_MODE }; MainTab(QWidget *parent = 0); |