mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
193c456f06
commit
3c4fd5d599
9 changed files with 38 additions and 41 deletions
|
@ -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();
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
INITIAL,
|
||||
DOWNLOADING,
|
||||
CANCELLING,
|
||||
ERROR,
|
||||
ERRORED,
|
||||
DONE,
|
||||
};
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
NONE,
|
||||
DIVE,
|
||||
MANUALLY_ADDED_DIVE,
|
||||
IGNORE
|
||||
IGNORE_MODE
|
||||
};
|
||||
|
||||
MainTab(QWidget *parent = 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue