mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
57e83240dd
commit
b1a929260f
1 changed files with 91 additions and 82 deletions
|
@ -67,7 +67,8 @@ bool LocationInformationWidget::eventFilter(QObject*, QEvent *ev)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationInformationWidget::mergeSelectedDiveSites() {
|
void LocationInformationWidget::mergeSelectedDiveSites()
|
||||||
|
{
|
||||||
if (QMessageBox::warning(MainWindow::instance(), tr("Merging dive sites"),
|
if (QMessageBox::warning(MainWindow::instance(), tr("Merging dive sites"),
|
||||||
tr("You are about to merge dive sites, you can't undo that action \n Are you sure you want to continue?"),
|
tr("You are about to merge dive sites, you can't undo that action \n Are you sure you want to continue?"),
|
||||||
QMessageBox::Ok, QMessageBox::Cancel) != QMessageBox::Ok)
|
QMessageBox::Ok, QMessageBox::Cancel) != QMessageBox::Ok)
|
||||||
|
@ -194,9 +195,7 @@ void LocationInformationWidget::markChangedWidget(QWidget *w)
|
||||||
if (!modified)
|
if (!modified)
|
||||||
enableEdition();
|
enableEdition();
|
||||||
qApp->palette().color(QPalette::Text).getHslF(&h, &s, &l, &a);
|
qApp->palette().color(QPalette::Text).getHslF(&h, &s, &l, &a);
|
||||||
p.setBrush(QPalette::Base, (l <= 0.3) ? QColor(Qt::yellow).lighter()
|
p.setBrush(QPalette::Base, (l <= 0.3) ? QColor(Qt::yellow).lighter() : (l <= 0.6) ? QColor(Qt::yellow).light() : /* else */ QColor(Qt::yellow).darker(300));
|
||||||
: (l <= 0.6) ? QColor(Qt::yellow).light()
|
|
||||||
: /* else */ QColor(Qt::yellow).darker(300));
|
|
||||||
w->setPalette(p);
|
w->setPalette(p);
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
@ -268,7 +267,6 @@ void LocationInformationWidget::reverseGeocode()
|
||||||
|
|
||||||
DiveLocationFilterProxyModel::DiveLocationFilterProxyModel(QObject *parent)
|
DiveLocationFilterProxyModel::DiveLocationFilterProxyModel(QObject *parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DiveLocationLineEdit *location_line_edit = 0;
|
DiveLocationLineEdit *location_line_edit = 0;
|
||||||
|
@ -309,9 +307,12 @@ QVariant DiveLocationModel::data(const QModelIndex& index, int role) const
|
||||||
return RECENTLY_ADDED_DIVESITE;
|
return RECENTLY_ADDED_DIVESITE;
|
||||||
}
|
}
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole : return new_ds_value[index.row()];
|
case Qt::DisplayRole:
|
||||||
case Qt::ToolTipRole : return "Create a new dive site";
|
return new_ds_value[index.row()];
|
||||||
case Qt::DecorationRole : return plusIcon;
|
case Qt::ToolTipRole:
|
||||||
|
return "Create a new dive site";
|
||||||
|
case Qt::DecorationRole:
|
||||||
|
return plusIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,12 +322,18 @@ QVariant DiveLocationModel::data(const QModelIndex& index, int role) const
|
||||||
case Qt::EditRole:
|
case Qt::EditRole:
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case UUID: return ds->uuid;
|
case UUID:
|
||||||
case NAME: return ds->name;
|
return ds->uuid;
|
||||||
case LATITUDE: return ds->latitude.udeg;
|
case NAME:
|
||||||
case LONGITUDE: return ds->longitude.udeg;
|
return ds->name;
|
||||||
case DESCRIPTION: return ds->description;
|
case LATITUDE:
|
||||||
case NOTES: return ds->name;
|
return ds->latitude.udeg;
|
||||||
|
case LONGITUDE:
|
||||||
|
return ds->longitude.udeg;
|
||||||
|
case DESCRIPTION:
|
||||||
|
return ds->description;
|
||||||
|
case NOTES:
|
||||||
|
return ds->name;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::DecorationRole: {
|
case Qt::DecorationRole: {
|
||||||
|
@ -361,7 +368,9 @@ bool DiveLocationModel::setData(const QModelIndex& index, const QVariant& value,
|
||||||
}
|
}
|
||||||
|
|
||||||
DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent) : QLineEdit(parent),
|
DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent) : QLineEdit(parent),
|
||||||
proxy(new DiveLocationFilterProxyModel()), model(new DiveLocationModel()), view(new DiveLocationListView())
|
proxy(new DiveLocationFilterProxyModel()),
|
||||||
|
model(new DiveLocationModel()),
|
||||||
|
view(new DiveLocationListView())
|
||||||
{
|
{
|
||||||
currUuid = 0;
|
currUuid = 0;
|
||||||
location_line_edit = this;
|
location_line_edit = this;
|
||||||
|
@ -448,7 +457,8 @@ void DiveLocationLineEdit::refreshDiveSiteCache()
|
||||||
model->resetModel();
|
model->resetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dive_site *get_dive_site_name_start_which_str(const QString& str) {
|
static struct dive_site *get_dive_site_name_start_which_str(const QString &str)
|
||||||
|
{
|
||||||
struct dive_site *ds;
|
struct dive_site *ds;
|
||||||
int i;
|
int i;
|
||||||
for_each_dive_site (i, ds) {
|
for_each_dive_site (i, ds) {
|
||||||
|
@ -572,7 +582,6 @@ uint32_t DiveLocationLineEdit::currDiveSiteUuid() const
|
||||||
|
|
||||||
DiveLocationListView::DiveLocationListView(QWidget *parent)
|
DiveLocationListView::DiveLocationListView(QWidget *parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveLocationListView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
|
void DiveLocationListView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
|
||||||
|
|
Loading…
Add table
Reference in a new issue