| 69 | |
| 70 | |
| 71 | void LocationEditor::buttonClicked() { |
| 72 | const QWeakPointer<LocationDialog> dialogPtr(new LocationDialog(this)); |
| 73 | if (LocationDialog *const dialog = dialogPtr.data()) { |
| 74 | dialog->setLongitude(this->startLongitude); |
| 75 | dialog->setLatitude(this->startLatitude); |
| 76 | dialog->setAltitude(this->startAltitude); |
| 77 | dialog->exec(); |
| 78 | } |
| 79 | |
| 80 | if (LocationDialog *const dialog = dialogPtr.data()) { |
| 81 | const double lon = dialog->getLongitude(); |
| 82 | const double lat = dialog->getLatitude(); |
| 83 | const double alt = dialog->getAltitude(); |
| 84 | startAltitude = alt; |
| 85 | startLongitude = lon; |
| 86 | startLatitude = lat; |
| 87 | if (dialog->okPressed()) { |
| 88 | NoteTable ntable(global.db); |
| 89 | if (lon == 0.0 && lat == 0.0) { |
| 90 | setText(defaultText); |
| 91 | ntable.resetGeography(currentLid, true); |
| 92 | } else { |
| 93 | setText(dialog->locationText()); |
| 94 | ntable.setGeography(currentLid, lon,lat,alt, true); |
| 95 | } |
| 96 | } |
| 97 | delete dialog; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | |
| 102 | void LocationEditor::setGeography(qint32 lid, double longitude, double latitude, double altitude, QString placeName) { |
nothing calls this directly
no test coverage detected