mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-07 23:36:15 +00:00
Dive site: un-globalize displayed_dive_site
The global object displayed_dive_site is used a a backing-store by the dive-site-edit widget. All external accesses were removed, therefore make the object local to the widget. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
954820aa81
commit
5d3967ce84
4 changed files with 4 additions and 3 deletions
|
@ -18,7 +18,6 @@
|
||||||
* it's used in the UI, but it seems to make the most sense to have it
|
* it's used in the UI, but it seems to make the most sense to have it
|
||||||
* here */
|
* here */
|
||||||
struct dive displayed_dive;
|
struct dive displayed_dive;
|
||||||
struct dive_site displayed_dive_site;
|
|
||||||
|
|
||||||
struct tag_entry *g_tag_list = NULL;
|
struct tag_entry *g_tag_list = NULL;
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,6 @@ struct dive_table {
|
||||||
|
|
||||||
extern struct dive_table dive_table, downloadTable;
|
extern struct dive_table dive_table, downloadTable;
|
||||||
extern struct dive displayed_dive;
|
extern struct dive displayed_dive;
|
||||||
extern struct dive_site displayed_dive_site;
|
|
||||||
extern unsigned int dc_number;
|
extern unsigned int dc_number;
|
||||||
extern struct dive *current_dive;
|
extern struct dive *current_dive;
|
||||||
#define current_dc (get_dive_dc(current_dive, dc_number))
|
#define current_dc (get_dive_dc(current_dive, dc_number))
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBox(parent), modified(false)
|
LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBox(parent), modified(false)
|
||||||
{
|
{
|
||||||
|
memset(&displayed_dive_site, 0, sizeof(displayed_dive_site));
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
ui.diveSiteMessage->setCloseButtonVisible(false);
|
ui.diveSiteMessage->setCloseButtonVisible(false);
|
||||||
|
|
||||||
|
@ -373,7 +374,7 @@ QVariant DiveLocationModel::data(const QModelIndex &index, int role) const
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
return new_ds_value[index.row()];
|
return new_ds_value[index.row()];
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
return displayed_dive_site.uuid ?
|
return displayed_dive.dive_site_uuid ?
|
||||||
tr("Create a new dive site, copying relevant information from the current dive.") :
|
tr("Create a new dive site, copying relevant information from the current dive.") :
|
||||||
tr("Create a new dive site with this name");
|
tr("Create a new dive site with this name");
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#define LOCATIONINFORMATION_H
|
#define LOCATIONINFORMATION_H
|
||||||
|
|
||||||
#include "core/units.h"
|
#include "core/units.h"
|
||||||
|
#include "core/divesite.h"
|
||||||
#include "ui_locationInformation.h"
|
#include "ui_locationInformation.h"
|
||||||
#include "qt-models/divelocationmodel.h"
|
#include "qt-models/divelocationmodel.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -50,6 +51,7 @@ private:
|
||||||
bool modified;
|
bool modified;
|
||||||
QAction *acceptAction, *rejectAction;
|
QAction *acceptAction, *rejectAction;
|
||||||
GPSLocationInformationModel filter_model;
|
GPSLocationInformationModel filter_model;
|
||||||
|
dive_site displayed_dive_site;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DiveLocationFilterProxyModel : public QSortFilterProxyModel {
|
class DiveLocationFilterProxyModel : public QSortFilterProxyModel {
|
||||||
|
|
Loading…
Add table
Reference in a new issue