Convert to TRUE/FALSE to stdbools true/false

I had problems with this one on Qt5.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2014-01-15 09:30:42 +01:00 committed by Dirk Hohndel
parent 7954437665
commit 7e9582631d
12 changed files with 86 additions and 86 deletions

View file

@ -534,7 +534,7 @@ void DiveListView::merge_trip(const QModelIndex &a, int offset)
reload(currentLayout, false); reload(currentLayout, false);
fixMessyQtModelBehaviour(); fixMessyQtModelBehaviour();
restoreSelection(); restoreSelection();
mark_divelist_changed(TRUE); mark_divelist_changed(true);
} }
void DiveListView::mergeTripAbove() void DiveListView::mergeTripAbove()
@ -553,13 +553,13 @@ void DiveListView::removeFromTrip()
struct dive *d; struct dive *d;
for_each_dive(i, d) { for_each_dive(i, d) {
if (d->selected) if (d->selected)
remove_dive_from_trip(d, FALSE); remove_dive_from_trip(d, false);
} }
rememberSelection(); rememberSelection();
reload(currentLayout, false); reload(currentLayout, false);
fixMessyQtModelBehaviour(); fixMessyQtModelBehaviour();
restoreSelection(); restoreSelection();
mark_divelist_changed(TRUE); mark_divelist_changed(true);
} }
void DiveListView::newTripAbove() void DiveListView::newTripAbove()
@ -578,7 +578,7 @@ void DiveListView::newTripAbove()
trip->expanded = 1; trip->expanded = 1;
reload(currentLayout, false); reload(currentLayout, false);
fixMessyQtModelBehaviour(); fixMessyQtModelBehaviour();
mark_divelist_changed(TRUE); mark_divelist_changed(true);
restoreSelection(); restoreSelection();
} }
@ -621,7 +621,7 @@ void DiveListView::addToTripAbove()
} }
} }
trip->expanded = 1; trip->expanded = 1;
mark_divelist_changed(TRUE); mark_divelist_changed(true);
reload(currentLayout, false); reload(currentLayout, false);
restoreSelection(); restoreSelection();
fixMessyQtModelBehaviour(); fixMessyQtModelBehaviour();
@ -642,9 +642,9 @@ void DiveListView::markDiveInvalid()
if (amount_selected == 0) { if (amount_selected == 0) {
mainWindow()->cleanUpEmpty(); mainWindow()->cleanUpEmpty();
} }
mark_divelist_changed(TRUE); mark_divelist_changed(true);
mainWindow()->refreshDisplay(); mainWindow()->refreshDisplay();
if(prefs.display_invalid_dives == FALSE) { if(prefs.display_invalid_dives == false) {
clearSelection(); clearSelection();
// select top dive that isn't marked invalid // select top dive that isn't marked invalid
rememberSelection(); rememberSelection();
@ -673,7 +673,7 @@ void DiveListView::deleteDive()
if (amount_selected == 0) { if (amount_selected == 0) {
mainWindow()->cleanUpEmpty(); mainWindow()->cleanUpEmpty();
} }
mark_divelist_changed(TRUE); mark_divelist_changed(true);
mainWindow()->refreshDisplay(); mainWindow()->refreshDisplay();
if(lastDiveNr != -1){ if(lastDiveNr != -1){
clearSelection(); clearSelection();
@ -771,7 +771,7 @@ void DiveListView::saveSelectedDivesAs()
settings.endGroup(); settings.endGroup();
QByteArray bt = QFile::encodeName(fileName); QByteArray bt = QFile::encodeName(fileName);
save_dives_logic(bt.data(), TRUE); save_dives_logic(bt.data(), true);
} }
void DiveListView::exportSelectedDivesAsUDDF() void DiveListView::exportSelectedDivesAsUDDF()

View file

@ -64,7 +64,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
error = NULL; error = NULL;
} }
} }
process_dives(TRUE, FALSE); process_dives(true, false);
mainWindow()->refreshDisplay(); mainWindow()->refreshDisplay();
} }

View file

@ -1490,7 +1490,7 @@ void DivePlannerPointsModel::createPlan()
cyl->end.mbar = cyl->start.mbar - consumption; cyl->end.mbar = cyl->start.mbar - consumption;
} }
mark_divelist_changed(TRUE); mark_divelist_changed(true);
// Remove and clean the diveplan, so we don't delete // Remove and clean the diveplan, so we don't delete
// the dive by mistake. // the dive by mistake.

View file

@ -350,7 +350,7 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
for (int i = dive_table.nr - 1; i >= previousLast; i--) for (int i = dive_table.nr - 1; i >= previousLast; i--)
delete_single_dive(i); delete_single_dive(i);
} else { } else {
process_dives(TRUE, preferDownloaded()); process_dives(true, preferDownloaded());
} }
} else { } else {
updateState(CANCELLED); updateState(CANCELLED);

View file

@ -266,7 +266,7 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
} }
centerOn(lon, lat, true); centerOn(lon, lat, true);
editingDiveLocation = false; editingDiveLocation = false;
mark_divelist_changed(TRUE); mark_divelist_changed(true);
mainWindow()->refreshDisplay(); mainWindow()->refreshDisplay();
} }

View file

@ -358,7 +358,7 @@ void MainTab::clearStats()
if (!d || d->field.mkelvin == 0) \ if (!d || d->field.mkelvin == 0) \
ui.field->setText(""); \ ui.field->setText(""); \
else \ else \
ui.field->setText(get_temperature_string(d->field, TRUE)) ui.field->setText(get_temperature_string(d->field, true))
bool MainTab::isEditing() bool MainTab::isEditing()
{ {
@ -461,29 +461,29 @@ void MainTab::updateDiveInfo(int dive)
taglist_get_tagstring(d->tag_list, buf, 1024); taglist_get_tagstring(d->tag_list, buf, 1024);
ui.tagWidget->setText(QString(buf)); ui.tagWidget->setText(QString(buf));
} }
ui.maximumDepthText->setText(get_depth_string(d->maxdepth, TRUE)); ui.maximumDepthText->setText(get_depth_string(d->maxdepth, true));
ui.averageDepthText->setText(get_depth_string(d->meandepth, TRUE)); ui.averageDepthText->setText(get_depth_string(d->meandepth, true));
ui.otuText->setText(QString("%1").arg(d->otu)); ui.otuText->setText(QString("%1").arg(d->otu));
ui.waterTemperatureText->setText(get_temperature_string(d->watertemp, TRUE)); ui.waterTemperatureText->setText(get_temperature_string(d->watertemp, true));
ui.airTemperatureText->setText(get_temperature_string(d->airtemp, TRUE)); ui.airTemperatureText->setText(get_temperature_string(d->airtemp, true));
volume_t gases[MAX_CYLINDERS] = {}; volume_t gases[MAX_CYLINDERS] = {};
get_gas_used(d, gases); get_gas_used(d, gases);
QString volumes = get_volume_string(gases[0], TRUE); QString volumes = get_volume_string(gases[0], true);
int mean[MAX_CYLINDERS], duration[MAX_CYLINDERS]; int mean[MAX_CYLINDERS], duration[MAX_CYLINDERS];
per_cylinder_mean_depth(d, select_dc(&d->dc), mean, duration); per_cylinder_mean_depth(d, select_dc(&d->dc), mean, duration);
volume_t sac; volume_t sac;
QString SACs; QString SACs;
if (mean[0] && duration[0]) { if (mean[0] && duration[0]) {
sac.mliter = gases[0].mliter * 1000.0 / (depth_to_mbar(mean[0], d) * duration[0] / 60.0); sac.mliter = gases[0].mliter * 1000.0 / (depth_to_mbar(mean[0], d) * duration[0] / 60.0);
SACs = get_volume_string(sac, TRUE).append(tr("/min")); SACs = get_volume_string(sac, true).append(tr("/min"));
} else { } else {
SACs = QString(tr("unknown")); SACs = QString(tr("unknown"));
} }
for(int i=1; i < MAX_CYLINDERS && gases[i].mliter != 0; i++) { for(int i=1; i < MAX_CYLINDERS && gases[i].mliter != 0; i++) {
volumes.append("\n" + get_volume_string(gases[i], TRUE)); volumes.append("\n" + get_volume_string(gases[i], true));
if (duration[i]) { if (duration[i]) {
sac.mliter = gases[i].mliter * 1000.0 / (depth_to_mbar(mean[i], d) * duration[i] / 60); sac.mliter = gases[i].mliter * 1000.0 / (depth_to_mbar(mean[i], d) * duration[i] / 60);
SACs.append("\n" + get_volume_string(sac, TRUE).append(tr("/min"))); SACs.append("\n" + get_volume_string(sac, true).append(tr("/min")));
} else { } else {
SACs.append("\n"); SACs.append("\n");
} }
@ -509,17 +509,17 @@ void MainTab::updateDiveInfo(int dive)
ui.salinityText->setText(QString("%1g/l").arg(d->salinity/10.0)); ui.salinityText->setText(QString("%1g/l").arg(d->salinity/10.0));
else else
ui.salinityText->clear(); ui.salinityText->clear();
ui.depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, TRUE)); ui.depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true));
ui.depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, TRUE)); ui.depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true));
ui.depthLimits->setAverage(get_depth_string(stats_selection.avg_depth, TRUE)); ui.depthLimits->setAverage(get_depth_string(stats_selection.avg_depth, true));
ui.sacLimits->setMaximum(get_volume_string(stats_selection.max_sac, TRUE).append(tr("/min"))); ui.sacLimits->setMaximum(get_volume_string(stats_selection.max_sac, true).append(tr("/min")));
ui.sacLimits->setMinimum(get_volume_string(stats_selection.min_sac, TRUE).append(tr("/min"))); ui.sacLimits->setMinimum(get_volume_string(stats_selection.min_sac, true).append(tr("/min")));
ui.sacLimits->setAverage(get_volume_string(stats_selection.avg_sac, TRUE).append(tr("/min"))); ui.sacLimits->setAverage(get_volume_string(stats_selection.avg_sac, true).append(tr("/min")));
ui.divesAllText->setText(QString::number(stats_selection.selection_size)); ui.divesAllText->setText(QString::number(stats_selection.selection_size));
temp.mkelvin = stats_selection.max_temp; temp.mkelvin = stats_selection.max_temp;
ui.tempLimits->setMaximum(get_temperature_string(temp, TRUE)); ui.tempLimits->setMaximum(get_temperature_string(temp, true));
temp.mkelvin = stats_selection.min_temp; temp.mkelvin = stats_selection.min_temp;
ui.tempLimits->setMinimum(get_temperature_string(temp, TRUE)); ui.tempLimits->setMinimum(get_temperature_string(temp, true));
if (stats_selection.combined_temp && stats_selection.combined_count) { if (stats_selection.combined_temp && stats_selection.combined_count) {
const char *unit; const char *unit;
get_temp_units(0, &unit); get_temp_units(0, &unit);
@ -580,7 +580,7 @@ void MainTab::acceptChanges()
if (mainWindow() && mainWindow()->dive_list()->selectedTrips().count() == 1) { if (mainWindow() && mainWindow()->dive_list()->selectedTrips().count() == 1) {
if (notesBackup[NULL].notes != ui.notes->toPlainText() || if (notesBackup[NULL].notes != ui.notes->toPlainText() ||
notesBackup[NULL].location != ui.location->text()) notesBackup[NULL].location != ui.location->text())
mark_divelist_changed(TRUE); mark_divelist_changed(true);
} else { } else {
struct dive *curr = current_dive; struct dive *curr = current_dive;
//Reset coordinates field, in case it contains garbage. //Reset coordinates field, in case it contains garbage.
@ -597,7 +597,7 @@ void MainTab::acceptChanges()
notesBackup[curr].datetime != ui.dateTimeEdit->dateTime().toString() || notesBackup[curr].datetime != ui.dateTimeEdit->dateTime().toString() ||
notesBackup[curr].visibility != ui.rating->currentStars() || notesBackup[curr].visibility != ui.rating->currentStars() ||
notesBackup[curr].tags != ui.tagWidget->text()) { notesBackup[curr].tags != ui.tagWidget->text()) {
mark_divelist_changed(TRUE); mark_divelist_changed(true);
} }
if (notesBackup[curr].location != ui.location->text() || if (notesBackup[curr].location != ui.location->text() ||
notesBackup[curr].coordinates != ui.coordinates->text()) { notesBackup[curr].coordinates != ui.coordinates->text()) {
@ -609,7 +609,7 @@ void MainTab::acceptChanges()
if (editMode == MANUALLY_ADDED_DIVE) { if (editMode == MANUALLY_ADDED_DIVE) {
DivePlannerPointsModel::instance()->copyCylinders(curr); DivePlannerPointsModel::instance()->copyCylinders(curr);
} else if (editMode != ADD && cylindersModel->changed) { } else if (editMode != ADD && cylindersModel->changed) {
mark_divelist_changed(TRUE); mark_divelist_changed(true);
Q_FOREACH (dive *d, notesBackup.keys()) { Q_FOREACH (dive *d, notesBackup.keys()) {
for (int i = 0; i < MAX_CYLINDERS; i++) { for (int i = 0; i < MAX_CYLINDERS; i++) {
if (notesBackup.keys().count() > 1) if (notesBackup.keys().count() > 1)
@ -622,7 +622,7 @@ void MainTab::acceptChanges()
} }
if (weightModel->changed) { if (weightModel->changed) {
mark_divelist_changed(TRUE); mark_divelist_changed(true);
Q_FOREACH (dive *d, notesBackup.keys()) { Q_FOREACH (dive *d, notesBackup.keys()) {
for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++) { for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++) {
d->weightsystem[i] = multiEditEquipmentPlaceholder.weightsystem[i]; d->weightsystem[i] = multiEditEquipmentPlaceholder.weightsystem[i];
@ -644,7 +644,7 @@ void MainTab::acceptChanges()
current_dive->number = get_dive(dive_table.nr - 2)->number + 1; current_dive->number = get_dive(dive_table.nr - 2)->number + 1;
DivePlannerPointsModel::instance()->cancelPlan(); DivePlannerPointsModel::instance()->cancelPlan();
mainWindow()->showProfile(); mainWindow()->showProfile();
mark_divelist_changed(TRUE); mark_divelist_changed(true);
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);
} }
// each dive that was selected might have had the temperatures in its active divecomputer changed // each dive that was selected might have had the temperatures in its active divecomputer changed

View file

@ -149,7 +149,7 @@ void MainWindow::on_actionClose_triggered()
QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file.")); QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file."));
return; return;
} }
if (unsaved_changes() && (askSaveChanges() == FALSE)) if (unsaved_changes() && (askSaveChanges() == false))
return; return;
/* free the dives and trips */ /* free the dives and trips */
@ -162,7 +162,7 @@ void MainWindow::on_actionClose_triggered()
existing_filename = NULL; existing_filename = NULL;
cleanUpEmpty(); cleanUpEmpty();
mark_divelist_changed(FALSE); mark_divelist_changed(false);
clear_events(); clear_events();
} }
@ -246,7 +246,7 @@ void MainWindow::on_actionQuit_triggered()
QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file.")); QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file."));
return; return;
} }
if (unsaved_changes() && (askSaveChanges() == FALSE)) if (unsaved_changes() && (askSaveChanges() == false))
return; return;
writeSettings(); writeSettings();
QApplication::quit(); QApplication::quit();
@ -560,7 +560,7 @@ bool MainWindow::askSaveChanges()
#define GET_BOOL(name, field) \ #define GET_BOOL(name, field) \
v = s.value(QString(name)); \ v = s.value(QString(name)); \
if (v.isValid()) \ if (v.isValid()) \
prefs.field = v.toInt() ? TRUE : FALSE; \ prefs.field = v.toInt() ? true : false; \
else \ else \
prefs.field = default_prefs.field prefs.field = default_prefs.field
@ -704,7 +704,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
helpView->deleteLater(); helpView->deleteLater();
} }
if (unsaved_changes() && (askSaveChanges() == FALSE)) { if (unsaved_changes() && (askSaveChanges() == false)) {
event->ignore(); event->ignore();
return; return;
} }
@ -749,9 +749,9 @@ void MainWindow::file_save_as(void)
ui.InfoWidget->acceptChanges(); ui.InfoWidget->acceptChanges();
save_dives(filename.toUtf8().data()); save_dives(filename.toUtf8().data());
set_filename(filename.toUtf8().data(), TRUE); set_filename(filename.toUtf8().data(), true);
setTitle(MWTF_FILENAME); setTitle(MWTF_FILENAME);
mark_divelist_changed(FALSE); mark_divelist_changed(false);
} }
} }
@ -774,7 +774,7 @@ void MainWindow::file_save(void)
current_def_dir.mkpath(current_def_dir.absolutePath()); current_def_dir.mkpath(current_def_dir.absolutePath());
} }
save_dives(existing_filename); save_dives(existing_filename);
mark_divelist_changed(FALSE); mark_divelist_changed(false);
} }
void MainWindow::showError(QString message) void MainWindow::showError(QString message)
@ -822,7 +822,7 @@ void MainWindow::importFiles(const QStringList fileNames)
error = NULL; error = NULL;
} }
} }
process_dives(TRUE, FALSE); process_dives(true, false);
refreshDisplay(); refreshDisplay();
} }
@ -837,7 +837,7 @@ void MainWindow::loadFiles(const QStringList fileNames)
for (int i = 0; i < fileNames.size(); ++i) { for (int i = 0; i < fileNames.size(); ++i) {
fileNamePtr = QFile::encodeName(fileNames.at(i)); fileNamePtr = QFile::encodeName(fileNames.at(i));
parse_file(fileNamePtr.data(), &error); parse_file(fileNamePtr.data(), &error);
set_filename(fileNamePtr.data(), TRUE); set_filename(fileNamePtr.data(), true);
setTitle(MWTF_FILENAME); setTitle(MWTF_FILENAME);
if (error != NULL) { if (error != NULL) {
@ -846,7 +846,7 @@ void MainWindow::loadFiles(const QStringList fileNames)
} }
} }
process_dives(FALSE, FALSE); process_dives(false, false);
refreshDisplay(); refreshDisplay();
ui.actionAutoGroup->setChecked(autogroup); ui.actionAutoGroup->setChecked(autogroup);
@ -869,7 +869,7 @@ void MainWindow::on_actionImportDiveLog_triggered()
if (csvFiles.size()) { if (csvFiles.size()) {
DiveLogImportDialog *diveLogImport = new DiveLogImportDialog(&csvFiles); DiveLogImportDialog *diveLogImport = new DiveLogImportDialog(&csvFiles);
diveLogImport->show(); diveLogImport->show();
process_dives(TRUE, FALSE); process_dives(true, false);
refreshDisplay(); refreshDisplay();
} }
} }

View file

@ -112,23 +112,23 @@ QVariant CylindersModel::data(const QModelIndex& index, int role) const
break; break;
case SIZE: case SIZE:
if (cyl->type.size.mliter) if (cyl->type.size.mliter)
ret = get_volume_string(cyl->type.size, TRUE, cyl->type.workingpressure.mbar); ret = get_volume_string(cyl->type.size, true, cyl->type.workingpressure.mbar);
break; break;
case WORKINGPRESS: case WORKINGPRESS:
if (cyl->type.workingpressure.mbar) if (cyl->type.workingpressure.mbar)
ret = get_pressure_string(cyl->type.workingpressure, TRUE); ret = get_pressure_string(cyl->type.workingpressure, true);
break; break;
case START: case START:
if (cyl->start.mbar) if (cyl->start.mbar)
ret = get_pressure_string(cyl->start, TRUE); ret = get_pressure_string(cyl->start, true);
else if (cyl->sample_start.mbar) else if (cyl->sample_start.mbar)
ret = get_pressure_string(cyl->sample_start, TRUE); ret = get_pressure_string(cyl->sample_start, true);
break; break;
case END: case END:
if (cyl->end.mbar) if (cyl->end.mbar)
ret = get_pressure_string(cyl->end, TRUE); ret = get_pressure_string(cyl->end, true);
else if (cyl->sample_end.mbar) else if (cyl->sample_end.mbar)
ret = get_pressure_string(cyl->sample_end, TRUE); ret = get_pressure_string(cyl->sample_end, true);
break; break;
case O2: case O2:
ret = percent_string(cyl->gasmix.o2); ret = percent_string(cyl->gasmix.o2);
@ -137,7 +137,7 @@ QVariant CylindersModel::data(const QModelIndex& index, int role) const
ret = percent_string(cyl->gasmix.he); ret = percent_string(cyl->gasmix.he);
break; break;
case DEPTH: case DEPTH:
ret = get_depth_string(cyl->depth, TRUE); ret = get_depth_string(cyl->depth, true);
break; break;
} }
break; break;
@ -211,7 +211,7 @@ bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, in
QModelIndexList matches = tanks->match(tanks->index(0,0), Qt::DisplayRole, cyl->type.description); QModelIndexList matches = tanks->match(tanks->index(0,0), Qt::DisplayRole, cyl->type.description);
cyl->type.size = string_to_volume(vString.toUtf8().data(), cyl->type.workingpressure); cyl->type.size = string_to_volume(vString.toUtf8().data(), cyl->type.workingpressure);
mark_divelist_changed(TRUE); mark_divelist_changed(true);
if (!matches.isEmpty()) if (!matches.isEmpty())
tanks->setData(tanks->index(matches.first().row(), TankInfoModel::ML), cyl->type.size.mliter); tanks->setData(tanks->index(matches.first().row(), TankInfoModel::ML), cyl->type.size.mliter);
changed = true; changed = true;
@ -394,7 +394,7 @@ QVariant WeightModel::data(const QModelIndex& index, int role) const
ret = gettextFromC::instance()->tr(ws->description); ret = gettextFromC::instance()->tr(ws->description);
break; break;
case WEIGHT: case WEIGHT:
ret = get_weight_string(ws->weight, TRUE); ret = get_weight_string(ws->weight, true);
break; break;
} }
break; break;
@ -647,7 +647,7 @@ bool WSInfoModel::setData(const QModelIndex& index, const QVariant& value, int r
break; break;
} }
emit dataChanged(index, index); emit dataChanged(index, index);
return TRUE; return true;
} }
void WSInfoModel::clear() void WSInfoModel::clear()
@ -776,7 +776,7 @@ bool TankInfoModel::setData(const QModelIndex& index, const QVariant& value, int
break; break;
} }
emit dataChanged(index, index); emit dataChanged(index, index);
return TRUE; return true;
} }
void TankInfoModel::clear() void TankInfoModel::clear()
@ -1107,7 +1107,7 @@ bool DiveItem::setData(const QModelIndex& index, const QVariant& value, int role
d = getDiveById(diveId); d = getDiveById(diveId);
Q_ASSERT(d != NULL); Q_ASSERT(d != NULL);
d->number = value.toInt(); d->number = value.toInt();
mark_divelist_changed(TRUE); mark_divelist_changed(true);
return true; return true;
} }
@ -1400,7 +1400,7 @@ void DiveComputerModel::dropWorkingList()
void DiveComputerModel::keepWorkingList() void DiveComputerModel::keepWorkingList()
{ {
if (dcList.dcMap != dcWorkingMap) if (dcList.dcMap != dcWorkingMap)
mark_divelist_changed(TRUE); mark_divelist_changed(true);
dcList.dcMap = dcWorkingMap; dcList.dcMap = dcWorkingMap;
} }
@ -1530,7 +1530,7 @@ void YearlyStatisticsModel::update_yearly_stats()
} }
if (stats_by_trip != NULL && stats_by_trip[0].is_trip == TRUE) { if (stats_by_trip != NULL && stats_by_trip[0].is_trip == true) {
YearStatisticsItem *item = new YearStatisticsItem(stats_by_trip[0]); YearStatisticsItem *item = new YearStatisticsItem(stats_by_trip[0]);
for (i = 1; stats_by_trip != NULL && stats_by_trip[i].is_trip; ++i) { for (i = 1; stats_by_trip != NULL && stats_by_trip[i].is_trip; ++i) {
YearStatisticsItem *iChild = new YearStatisticsItem(stats_by_trip[i]); YearStatisticsItem *iChild = new YearStatisticsItem(stats_by_trip[i]);

View file

@ -183,8 +183,8 @@ void ProfileGraphicsView::addBookmark()
QPointF scenePos = mapToScene(viewPos); QPointF scenePos = mapToScene(viewPos);
int seconds = scenePos.x() / gc.maxx * (gc.rightx - gc.leftx) + gc.leftx; int seconds = scenePos.x() / gc.maxx * (gc.rightx - gc.leftx) + gc.leftx;
add_event(current_dc, seconds, SAMPLE_EVENT_BOOKMARK, 0, 0, "bookmark"); add_event(current_dc, seconds, SAMPLE_EVENT_BOOKMARK, 0, 0, "bookmark");
mark_divelist_changed(TRUE); mark_divelist_changed(true);
plot(current_dive, TRUE); plot(current_dive, true);
} }
void ProfileGraphicsView::changeGas() void ProfileGraphicsView::changeGas()
@ -198,8 +198,8 @@ void ProfileGraphicsView::changeGas()
validate_gas(gas.toUtf8().constData(), &o2, &he); validate_gas(gas.toUtf8().constData(), &o2, &he);
int seconds = scenePos.x() / gc.maxx * (gc.rightx - gc.leftx) + gc.leftx; int seconds = scenePos.x() / gc.maxx * (gc.rightx - gc.leftx) + gc.leftx;
add_gas_switch_event(current_dive, current_dc, seconds, get_gasidx(current_dive, o2, he)); add_gas_switch_event(current_dive, current_dc, seconds, get_gasidx(current_dive, o2, he));
mark_divelist_changed(TRUE); mark_divelist_changed(true);
plot(current_dive, TRUE); plot(current_dive, true);
} }
void ProfileGraphicsView::hideEvents() void ProfileGraphicsView::hideEvents()
@ -220,7 +220,7 @@ void ProfileGraphicsView::hideEvents()
} }
} }
} }
plot(current_dive, TRUE); plot(current_dive, true);
} }
} }
@ -229,7 +229,7 @@ void ProfileGraphicsView::unhideEvents()
for (int i = 0; i < evn_used; i++) { for (int i = 0; i < evn_used; i++) {
ev_namelist[i].plot_ev = true; ev_namelist[i].plot_ev = true;
} }
plot(current_dive, TRUE); plot(current_dive, true);
} }
void ProfileGraphicsView::removeEvent() void ProfileGraphicsView::removeEvent()
@ -251,8 +251,8 @@ void ProfileGraphicsView::removeEvent()
*ep = event->next; *ep = event->next;
free(event); free(event);
} }
mark_divelist_changed(TRUE); mark_divelist_changed(true);
plot(current_dive, TRUE); plot(current_dive, true);
} }
} }
@ -348,7 +348,7 @@ void ProfileGraphicsView::clear()
void ProfileGraphicsView::refresh() void ProfileGraphicsView::refresh()
{ {
clear(); clear();
plot(current_dive, TRUE); plot(current_dive, true);
} }
void ProfileGraphicsView::setPrintMode(bool mode, bool grayscale) void ProfileGraphicsView::setPrintMode(bool mode, bool grayscale)
@ -715,7 +715,7 @@ void ProfileGraphicsView::plot_cylinder_pressure_text()
{ {
int i; int i;
int mbar, cyl; int mbar, cyl;
int seen_cyl[MAX_CYLINDERS] = { FALSE, }; int seen_cyl[MAX_CYLINDERS] = { false, };
int last_pressure[MAX_CYLINDERS] = { 0, }; int last_pressure[MAX_CYLINDERS] = { 0, };
int last_time[MAX_CYLINDERS] = { 0, }; int last_time[MAX_CYLINDERS] = { 0, };
struct plot_data *entry; struct plot_data *entry;
@ -740,7 +740,7 @@ void ProfileGraphicsView::plot_cylinder_pressure_text()
plot_gas_value(mbar, entry->sec, LEFT, TOP, plot_gas_value(mbar, entry->sec, LEFT, TOP,
get_o2(&dive->cylinder[cyl].gasmix), get_o2(&dive->cylinder[cyl].gasmix),
get_he(&dive->cylinder[cyl].gasmix)); get_he(&dive->cylinder[cyl].gasmix));
seen_cyl[cyl] = TRUE; seen_cyl[cyl] = true;
} }
} }
last_pressure[cyl] = mbar; last_pressure[cyl] = mbar;
@ -884,8 +884,8 @@ void ProfileGraphicsView::plot_cylinder_pressure()
{ {
int i; int i;
int last_index = -1; int last_index = -1;
int lift_pen = FALSE; int lift_pen = false;
int first_plot = TRUE; int first_plot = true;
if (!get_cylinder_pressure_range(&gc)) if (!get_cylinder_pressure_range(&gc))
return; return;
@ -899,10 +899,10 @@ void ProfileGraphicsView::plot_cylinder_pressure()
mbar = GET_PRESSURE(entry); mbar = GET_PRESSURE(entry);
if (entry->cylinderindex != last_index) { if (entry->cylinderindex != last_index) {
lift_pen = TRUE; lift_pen = true;
} }
if (!mbar) { if (!mbar) {
lift_pen = TRUE; lift_pen = true;
continue; continue;
} }
@ -921,10 +921,10 @@ void ProfileGraphicsView::plot_cylinder_pressure()
item->setPen(pen); item->setPen(pen);
scene()->addItem(item); scene()->addItem(item);
} else { } else {
first_plot = FALSE; first_plot = false;
from = QPointF(SCALEGC(entry->sec, mbar)); from = QPointF(SCALEGC(entry->sec, mbar));
} }
lift_pen = FALSE; lift_pen = false;
} else { } else {
to = QPointF(SCALEGC(entry->sec, mbar)); to = QPointF(SCALEGC(entry->sec, mbar));
QGraphicsLineItem *item = new QGraphicsLineItem(from.x(), from.y(), to.x(), to.y()); QGraphicsLineItem *item = new QGraphicsLineItem(from.x(), from.y(), to.x(), to.y());

View file

@ -100,7 +100,7 @@ private:
class EventItem : public QGraphicsPixmapItem class EventItem : public QGraphicsPixmapItem
{ {
public: public:
explicit EventItem(struct event *ev, QGraphicsItem* parent = 0, bool grayscale = FALSE); explicit EventItem(struct event *ev, QGraphicsItem* parent = 0, bool grayscale = false);
struct event* ev; struct event* ev;
private: private:
@ -131,10 +131,10 @@ public:
enum Mode{DIVE, PLAN}; enum Mode{DIVE, PLAN};
ProfileGraphicsView(QWidget* parent = 0); ProfileGraphicsView(QWidget* parent = 0);
void plot(struct dive *d, bool forceRedraw = FALSE); void plot(struct dive *d, bool forceRedraw = false);
bool eventFilter(QObject* obj, QEvent* event); bool eventFilter(QObject* obj, QEvent* event);
void clear(); void clear();
void setPrintMode(bool mode, bool grayscale = FALSE); void setPrintMode(bool mode, bool grayscale = false);
protected: protected:
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event);

View file

@ -142,7 +142,7 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton* button)
// DANGER, DANGER - this could get our dive_table unsorted... // DANGER, DANGER - this could get our dive_table unsorted...
shift_times(amount); shift_times(amount);
sort_table(&dive_table); sort_table(&dive_table);
mark_divelist_changed(TRUE); mark_divelist_changed(true);
mainWindow()->dive_list()->rememberSelection(); mainWindow()->dive_list()->rememberSelection();
mainWindow()->refreshDisplay(); mainWindow()->refreshDisplay();
mainWindow()->dive_list()->restoreSelection(); mainWindow()->dive_list()->restoreSelection();

View file

@ -34,8 +34,8 @@ static bool is_automatic_fix(struct dive *gpsfix)
if (gpsfix && gpsfix->location && if (gpsfix && gpsfix->location &&
(!strcmp(gpsfix->location, "automatic fix") || (!strcmp(gpsfix->location, "automatic fix") ||
!strcmp(gpsfix->location, "Auto-created dive"))) !strcmp(gpsfix->location, "Auto-created dive")))
return TRUE; return true;
return FALSE; return false;
} }
#define SAME_GROUP 6 * 3600 // six hours #define SAME_GROUP 6 * 3600 // six hours
@ -339,7 +339,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton* button)
/* now merge the data in the gps_location table into the dive_table */ /* now merge the data in the gps_location table into the dive_table */
if (merge_locations_into_dives()) { if (merge_locations_into_dives()) {
mark_divelist_changed(TRUE); mark_divelist_changed(true);
mainWindow()->globe()->repopulateLabels(); mainWindow()->globe()->repopulateLabels();
mainWindow()->globe()->centerOn(current_dive); mainWindow()->globe()->centerOn(current_dive);
mainWindow()->information()->updateDiveInfo(selected_dive); mainWindow()->information()->updateDiveInfo(selected_dive);
@ -866,7 +866,7 @@ void DivelogsDeWebServices::buttonClicked(QAbstractButton* button)
mainWindow()->showError(error); mainWindow()->showError(error);
free(error); free(error);
} }
process_dives(TRUE, FALSE); process_dives(true, false);
mainWindow()->refreshDisplay(); mainWindow()->refreshDisplay();
/* store last entered user/pass in config */ /* store last entered user/pass in config */