mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove three obsolete preferences options for geocoding
These options are not used any longer/were never used and can be removed to not confuse the users. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
c78a864e15
commit
4e320cca5b
7 changed files with 0 additions and 122 deletions
|
@ -28,9 +28,6 @@ typedef struct {
|
||||||
} facebook_prefs_t;
|
} facebook_prefs_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool enable_geocoding;
|
|
||||||
bool parse_dive_without_gps;
|
|
||||||
bool tag_existing_dives;
|
|
||||||
enum taxonomy_category category[3];
|
enum taxonomy_category category[3];
|
||||||
} geocoding_prefs_t;
|
} geocoding_prefs_t;
|
||||||
|
|
||||||
|
|
|
@ -770,21 +770,6 @@ GeocodingPreferences::GeocodingPreferences(QObject *parent) :
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GeocodingPreferences::enableGeocoding() const
|
|
||||||
{
|
|
||||||
return prefs.geocoding.enable_geocoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GeocodingPreferences::parseDiveWithoutGps() const
|
|
||||||
{
|
|
||||||
return prefs.geocoding.parse_dive_without_gps;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GeocodingPreferences::tagExistingDives() const
|
|
||||||
{
|
|
||||||
return prefs.geocoding.tag_existing_dives;
|
|
||||||
}
|
|
||||||
|
|
||||||
taxonomy_category GeocodingPreferences::firstTaxonomyCategory() const
|
taxonomy_category GeocodingPreferences::firstTaxonomyCategory() const
|
||||||
{
|
{
|
||||||
return prefs.geocoding.category[0];
|
return prefs.geocoding.category[0];
|
||||||
|
@ -800,39 +785,6 @@ taxonomy_category GeocodingPreferences::thirdTaxonomyCategory() const
|
||||||
return prefs.geocoding.category[2];
|
return prefs.geocoding.category[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeocodingPreferences::setEnableGeocoding(bool value)
|
|
||||||
{
|
|
||||||
if (value == prefs.geocoding.enable_geocoding)
|
|
||||||
return;
|
|
||||||
QSettings s;
|
|
||||||
s.beginGroup(group);
|
|
||||||
s.setValue("enable_geocoding", value);
|
|
||||||
prefs.geocoding.enable_geocoding = value;
|
|
||||||
emit enableGeocodingChanged(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GeocodingPreferences::setParseDiveWithoutGps(bool value)
|
|
||||||
{
|
|
||||||
if (value == prefs.geocoding.parse_dive_without_gps)
|
|
||||||
return;
|
|
||||||
QSettings s;
|
|
||||||
s.beginGroup(group);
|
|
||||||
s.setValue("parse_dives_without_gps", value);
|
|
||||||
prefs.geocoding.parse_dive_without_gps = value;
|
|
||||||
emit parseDiveWithoutGpsChanged(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GeocodingPreferences::setTagExistingDives(bool value)
|
|
||||||
{
|
|
||||||
if (value == prefs.geocoding.tag_existing_dives)
|
|
||||||
return;
|
|
||||||
QSettings s;
|
|
||||||
s.beginGroup(group);
|
|
||||||
s.setValue("tag_existing_dives", value);
|
|
||||||
prefs.geocoding.tag_existing_dives = value;
|
|
||||||
emit tagExistingDivesChanged(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GeocodingPreferences::setFirstTaxonomyCategory(taxonomy_category value)
|
void GeocodingPreferences::setFirstTaxonomyCategory(taxonomy_category value)
|
||||||
{
|
{
|
||||||
if (value == prefs.geocoding.category[0])
|
if (value == prefs.geocoding.category[0])
|
||||||
|
@ -2335,10 +2287,6 @@ void SettingsObjectWrapper::load()
|
||||||
// GeoManagement
|
// GeoManagement
|
||||||
s.beginGroup("geocoding");
|
s.beginGroup("geocoding");
|
||||||
|
|
||||||
GET_BOOL("enable_geocoding", geocoding.enable_geocoding);
|
|
||||||
GET_BOOL("parse_dives_without_gps", geocoding.parse_dive_without_gps);
|
|
||||||
GET_BOOL("tag_existing_dives", geocoding.tag_existing_dives);
|
|
||||||
|
|
||||||
GET_ENUM("cat0", taxonomy_category, geocoding.category[0]);
|
GET_ENUM("cat0", taxonomy_category, geocoding.category[0]);
|
||||||
GET_ENUM("cat1", taxonomy_category, geocoding.category[1]);
|
GET_ENUM("cat1", taxonomy_category, geocoding.category[1]);
|
||||||
GET_ENUM("cat2", taxonomy_category, geocoding.category[2]);
|
GET_ENUM("cat2", taxonomy_category, geocoding.category[2]);
|
||||||
|
|
|
@ -256,33 +256,21 @@ private:
|
||||||
/* Control the state of the Geocoding preferences */
|
/* Control the state of the Geocoding preferences */
|
||||||
class GeocodingPreferences : public QObject {
|
class GeocodingPreferences : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool enable_geocoding READ enableGeocoding WRITE setEnableGeocoding NOTIFY enableGeocodingChanged)
|
|
||||||
Q_PROPERTY(bool parse_dive_without_gps READ parseDiveWithoutGps WRITE setParseDiveWithoutGps NOTIFY parseDiveWithoutGpsChanged)
|
|
||||||
Q_PROPERTY(bool tag_existing_dives READ tagExistingDives WRITE setTagExistingDives NOTIFY tagExistingDivesChanged)
|
|
||||||
Q_PROPERTY(taxonomy_category first_category READ firstTaxonomyCategory WRITE setFirstTaxonomyCategory NOTIFY firstTaxonomyCategoryChanged)
|
Q_PROPERTY(taxonomy_category first_category READ firstTaxonomyCategory WRITE setFirstTaxonomyCategory NOTIFY firstTaxonomyCategoryChanged)
|
||||||
Q_PROPERTY(taxonomy_category second_category READ secondTaxonomyCategory WRITE setSecondTaxonomyCategory NOTIFY secondTaxonomyCategoryChanged)
|
Q_PROPERTY(taxonomy_category second_category READ secondTaxonomyCategory WRITE setSecondTaxonomyCategory NOTIFY secondTaxonomyCategoryChanged)
|
||||||
Q_PROPERTY(taxonomy_category third_category READ thirdTaxonomyCategory WRITE setThirdTaxonomyCategory NOTIFY thirdTaxonomyCategoryChanged)
|
Q_PROPERTY(taxonomy_category third_category READ thirdTaxonomyCategory WRITE setThirdTaxonomyCategory NOTIFY thirdTaxonomyCategoryChanged)
|
||||||
public:
|
public:
|
||||||
GeocodingPreferences(QObject *parent);
|
GeocodingPreferences(QObject *parent);
|
||||||
bool enableGeocoding() const;
|
|
||||||
bool parseDiveWithoutGps() const;
|
|
||||||
bool tagExistingDives() const;
|
|
||||||
taxonomy_category firstTaxonomyCategory() const;
|
taxonomy_category firstTaxonomyCategory() const;
|
||||||
taxonomy_category secondTaxonomyCategory() const;
|
taxonomy_category secondTaxonomyCategory() const;
|
||||||
taxonomy_category thirdTaxonomyCategory() const;
|
taxonomy_category thirdTaxonomyCategory() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setEnableGeocoding(bool value);
|
|
||||||
void setParseDiveWithoutGps(bool value);
|
|
||||||
void setTagExistingDives(bool value);
|
|
||||||
void setFirstTaxonomyCategory(taxonomy_category value);
|
void setFirstTaxonomyCategory(taxonomy_category value);
|
||||||
void setSecondTaxonomyCategory(taxonomy_category value);
|
void setSecondTaxonomyCategory(taxonomy_category value);
|
||||||
void setThirdTaxonomyCategory(taxonomy_category value);
|
void setThirdTaxonomyCategory(taxonomy_category value);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void enableGeocodingChanged(bool value);
|
|
||||||
void parseDiveWithoutGpsChanged(bool value);
|
|
||||||
void tagExistingDivesChanged(bool value);
|
|
||||||
void firstTaxonomyCategoryChanged(taxonomy_category value);
|
void firstTaxonomyCategoryChanged(taxonomy_category value);
|
||||||
void secondTaxonomyCategoryChanged(taxonomy_category value);
|
void secondTaxonomyCategoryChanged(taxonomy_category value);
|
||||||
void thirdTaxonomyCategoryChanged(taxonomy_category value);
|
void thirdTaxonomyCategoryChanged(taxonomy_category value);
|
||||||
|
|
|
@ -83,9 +83,6 @@ struct preferences default_prefs = {
|
||||||
.defaultsetpoint = 1100,
|
.defaultsetpoint = 1100,
|
||||||
.cloud_background_sync = true,
|
.cloud_background_sync = true,
|
||||||
.geocoding = {
|
.geocoding = {
|
||||||
.enable_geocoding = true,
|
|
||||||
.parse_dive_without_gps = false,
|
|
||||||
.tag_existing_dives = false,
|
|
||||||
.category = { 0 }
|
.category = { 0 }
|
||||||
},
|
},
|
||||||
.locale = {
|
.locale = {
|
||||||
|
|
|
@ -24,9 +24,6 @@ PreferencesGeoreference::~PreferencesGeoreference()
|
||||||
|
|
||||||
void PreferencesGeoreference::refreshSettings()
|
void PreferencesGeoreference::refreshSettings()
|
||||||
{
|
{
|
||||||
ui->enable_geocoding->setChecked(prefs.geocoding.enable_geocoding);
|
|
||||||
ui->parse_without_gps->setChecked(prefs.geocoding.parse_dive_without_gps);
|
|
||||||
ui->tag_existing_dives->setChecked(prefs.geocoding.tag_existing_dives);
|
|
||||||
ui->first_item->setCurrentIndex(prefs.geocoding.category[0]);
|
ui->first_item->setCurrentIndex(prefs.geocoding.category[0]);
|
||||||
ui->second_item->setCurrentIndex(prefs.geocoding.category[1]);
|
ui->second_item->setCurrentIndex(prefs.geocoding.category[1]);
|
||||||
ui->third_item->setCurrentIndex(prefs.geocoding.category[2]);
|
ui->third_item->setCurrentIndex(prefs.geocoding.category[2]);
|
||||||
|
@ -35,9 +32,6 @@ void PreferencesGeoreference::refreshSettings()
|
||||||
void PreferencesGeoreference::syncSettings()
|
void PreferencesGeoreference::syncSettings()
|
||||||
{
|
{
|
||||||
auto geocoding = SettingsObjectWrapper::instance()->geocoding;
|
auto geocoding = SettingsObjectWrapper::instance()->geocoding;
|
||||||
geocoding->setEnableGeocoding(ui->enable_geocoding->isChecked());
|
|
||||||
geocoding->setParseDiveWithoutGps(ui->parse_without_gps->isChecked());
|
|
||||||
geocoding->setTagExistingDives(ui->tag_existing_dives->isChecked());
|
|
||||||
geocoding->setFirstTaxonomyCategory((taxonomy_category) ui->first_item->currentIndex());
|
geocoding->setFirstTaxonomyCategory((taxonomy_category) ui->first_item->currentIndex());
|
||||||
geocoding->setSecondTaxonomyCategory((taxonomy_category) ui->second_item->currentIndex());
|
geocoding->setSecondTaxonomyCategory((taxonomy_category) ui->second_item->currentIndex());
|
||||||
geocoding->setThirdTaxonomyCategory((taxonomy_category) ui->third_item->currentIndex());
|
geocoding->setThirdTaxonomyCategory((taxonomy_category) ui->third_item->currentIndex());
|
||||||
|
|
|
@ -14,36 +14,6 @@
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_Geocoding">
|
|
||||||
<property name="title">
|
|
||||||
<string>Dive site geo lookup</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="enable_geocoding">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable geocoding for dive site management</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="parse_without_gps">
|
|
||||||
<property name="text">
|
|
||||||
<string>Parse site without GPS data</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="tag_existing_dives">
|
|
||||||
<property name="text">
|
|
||||||
<string>Same format for existing dives</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_12">
|
<widget class="QGroupBox" name="groupBox_12">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
|
|
@ -231,14 +231,6 @@ void TestPreferences::testPreferences()
|
||||||
TEST(fb->albumId(), QStringLiteral("album-id-2"));
|
TEST(fb->albumId(), QStringLiteral("album-id-2"));
|
||||||
|
|
||||||
auto geo = pref->geocoding;
|
auto geo = pref->geocoding;
|
||||||
geo->setEnableGeocoding(true);
|
|
||||||
geo->setParseDiveWithoutGps(true);
|
|
||||||
geo->setTagExistingDives(true);
|
|
||||||
|
|
||||||
TEST(geo->enableGeocoding(),true);
|
|
||||||
TEST(geo->parseDiveWithoutGps(),true);
|
|
||||||
TEST(geo->tagExistingDives(),true);
|
|
||||||
|
|
||||||
geo->setFirstTaxonomyCategory(TC_NONE);
|
geo->setFirstTaxonomyCategory(TC_NONE);
|
||||||
geo->setSecondTaxonomyCategory(TC_OCEAN);
|
geo->setSecondTaxonomyCategory(TC_OCEAN);
|
||||||
geo->setThirdTaxonomyCategory(TC_COUNTRY);
|
geo->setThirdTaxonomyCategory(TC_COUNTRY);
|
||||||
|
@ -247,14 +239,6 @@ void TestPreferences::testPreferences()
|
||||||
TEST(geo->secondTaxonomyCategory(), TC_OCEAN);
|
TEST(geo->secondTaxonomyCategory(), TC_OCEAN);
|
||||||
TEST(geo->thirdTaxonomyCategory(), TC_COUNTRY);
|
TEST(geo->thirdTaxonomyCategory(), TC_COUNTRY);
|
||||||
|
|
||||||
geo->setEnableGeocoding(false);
|
|
||||||
geo->setParseDiveWithoutGps(false);
|
|
||||||
geo->setTagExistingDives(false);
|
|
||||||
|
|
||||||
TEST(geo->enableGeocoding(),false);
|
|
||||||
TEST(geo->parseDiveWithoutGps(),false);
|
|
||||||
TEST(geo->tagExistingDives(),false);
|
|
||||||
|
|
||||||
geo->setFirstTaxonomyCategory(TC_OCEAN);
|
geo->setFirstTaxonomyCategory(TC_OCEAN);
|
||||||
geo->setSecondTaxonomyCategory(TC_COUNTRY);
|
geo->setSecondTaxonomyCategory(TC_COUNTRY);
|
||||||
geo->setThirdTaxonomyCategory(TC_NONE);
|
geo->setThirdTaxonomyCategory(TC_NONE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue