Location service: instantiate location provider in the desktop UI

We still aren't doing anything with it, but at least it's there now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-11-18 18:52:44 -08:00
parent 456cc3955a
commit ff5bd062f6
4 changed files with 10 additions and 0 deletions

View file

@ -205,6 +205,7 @@ MainWindow::MainWindow() : QMainWindow(),
enableDisableCloudActions(); enableDisableCloudActions();
#endif #endif
GpsLocation *locationProvider = new GpsLocation(&report_message, this);
ui.mainErrorMessage->hide(); ui.mainErrorMessage->hide();
graphics()->setEmptyState(); graphics()->setEmptyState();
initialUiSetup(); initialUiSetup();

View file

@ -16,6 +16,7 @@
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "notificationwidget.h" #include "notificationwidget.h"
#include "windowtitleupdate.h" #include "windowtitleupdate.h"
#include "gpslocation.h"
struct DiveList; struct DiveList;
class QSortFilterProxyModel; class QSortFilterProxyModel;
@ -93,6 +94,7 @@ public:
NotificationWidget *getNotificationWidget(); NotificationWidget *getNotificationWidget();
void enableDisableCloudActions(); void enableDisableCloudActions();
void showError(); void showError();
private private
slots: slots:
/* file menu action */ /* file menu action */
@ -254,6 +256,7 @@ private:
QHash<QByteArray, PropertiesForQuadrant> stateProperties; QHash<QByteArray, PropertiesForQuadrant> stateProperties;
WindowTitleUpdate *wtu; WindowTitleUpdate *wtu;
GpsLocation *locationProvider;
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

View file

@ -637,6 +637,7 @@ extern "C" {
#endif #endif
extern int report_error(const char *fmt, ...); extern int report_error(const char *fmt, ...);
extern void report_message(const char *msg);
extern const char *get_error_string(void); extern const char *get_error_string(void);
extern struct dive *find_dive_including(timestamp_t when); extern struct dive *find_dive_including(timestamp_t when);

View file

@ -445,6 +445,11 @@ int report_error(const char *fmt, ...)
return -1; return -1;
} }
void report_message(const char *msg)
{
(void)report_error("%s", msg);
}
/* /*
* libgit2 has a "git_treebuilder" concept, but it's broken, and can not * libgit2 has a "git_treebuilder" concept, but it's broken, and can not
* be used to do a flat tree (like the git "index") nor a recursive tree. * be used to do a flat tree (like the git "index") nor a recursive tree.