Changeset d600320 in subsurface


Ignore:
Timestamp:
Mar 24, 2017, 9:35:00 AM (8 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
d83449f
Parents:
6e38619
git-author:
Jan Mulder <jlmulder@…> (03/21/17 09:52:29)
git-committer:
Dirk Hohndel <dirk@…> (03/24/17 09:35:00)
Message:

Subsurface-mobile: do send decimal GPS to Google

Sending nicely readable formatted coordinates to Google Maps does not
result in a correctly positioned map. Google likes unreadable
decimal format.

Little hacky solution. Added a gps_decimal attribute, populate that
with the standard function for format a coordinate to string, but
reset the preferences value temporarly so that it always converts it
to decimal style.

Signed-off-by: Jan Mulder <jlmulder@…>

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/subsurface-qt/DiveObjectHelper.cpp

    r08c4281 rd600320  
    110110        return ds ? QString(printGPSCoords(ds->latitude.udeg, ds->longitude.udeg)) : QString();
    111111}
     112
     113QString DiveObjectHelper::gps_decimal() const
     114{
     115        bool savep = prefs.coordinates_traditional;
     116        QString val;
     117
     118        prefs.coordinates_traditional = false;
     119        val = gps();
     120        prefs.coordinates_traditional = savep;
     121        return(val);
     122}
     123
    112124QString DiveObjectHelper::duration() const
    113125{
  • core/subsurface-qt/DiveObjectHelper.h

    r674d833 rd600320  
    1919        Q_PROPERTY(QString location READ location CONSTANT)
    2020        Q_PROPERTY(QString gps READ gps CONSTANT)
     21        Q_PROPERTY(QString gps_decimal READ gps_decimal CONSTANT)
    2122        Q_PROPERTY(QString duration READ duration CONSTANT)
    2223        Q_PROPERTY(bool noDive READ noDive CONSTANT)
     
    6162        QString location() const;
    6263        QString gps() const;
     64        QString gps_decimal() const;
    6365        QString duration() const;
    6466        bool noDive() const;
  • mobile-widgets/qml/DiveDetails.qml

    r5941734 rd600320  
    9090                iconName: "gps"
    9191                onTriggered: {
    92                         showMap(diveDetailsListView.currentItem.modelData.dive.gps)
     92                        showMap(diveDetailsListView.currentItem.modelData.dive.gps_decimal)
    9393                }
    9494        }
  • mobile-widgets/qml/DiveDetailsView.qml

    r869a7fc rd600320  
    5454                                anchors.fill: parent
    5555                                onClicked: {
    56                                         if (dive.gps !== "")
    57                                                 showMap(dive.gps)
     56                                        if (dive.gps_decimal !== "")
     57                                                showMap(dive.gps_decimal)
    5858                                }
    5959                        }
Note: See TracChangeset for help on using the changeset viewer.