From 9b20a5bd4feb39574d5d82324dadbc9308cd85e3 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 7 Nov 2015 22:56:55 +0200 Subject: divelocationmodel: fix some signed/unsigned warnings Use uint32_t for divesite UUIDs. Signed-off-by: Lubomir I. Ivanov --- qt-models/divelocationmodel.cpp | 8 ++++---- qt-models/divelocationmodel.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'qt-models') diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index e7c9aa30d..d185de1fe 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -128,7 +128,7 @@ void LocationInformationModel::update() endResetModel(); } -int32_t LocationInformationModel::addDiveSite(const QString& name, timestamp_t divetime, int lon, int lat) +uint32_t LocationInformationModel::addDiveSite(const QString& name, timestamp_t divetime, int lon, int lat) { degrees_t latitude, longitude; latitude.udeg = lat; @@ -189,10 +189,10 @@ bool filter_same_gps_cb (QAbstractItemModel *model, int sourceRow, const QModelI { int ref_lat = displayed_dive_site.latitude.udeg; int ref_lon = displayed_dive_site.longitude.udeg; - int ref_uuid = displayed_dive_site.uuid; + uint32_t ref_uuid = displayed_dive_site.uuid; QSortFilterProxyModel *self = (QSortFilterProxyModel*) model; - int ds_uuid = self->sourceModel()->index(sourceRow, LocationInformationModel::UUID, parent).data().toInt(); + uint32_t ds_uuid = self->sourceModel()->index(sourceRow, LocationInformationModel::UUID, parent).data().toUInt(); struct dive_site *ds = get_dive_site_by_uuid(ds_uuid); if (!ds) @@ -202,4 +202,4 @@ bool filter_same_gps_cb (QAbstractItemModel *model, int sourceRow, const QModelI return false; return (ds->latitude.udeg == ref_lat && ds->longitude.udeg == ref_lon && ds->uuid != ref_uuid); -} \ No newline at end of file +} diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h index d5b8705ce..f3e9cac1f 100644 --- a/qt-models/divelocationmodel.h +++ b/qt-models/divelocationmodel.h @@ -22,7 +22,7 @@ public: int columnCount(const QModelIndex &parent) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const; - int32_t addDiveSite(const QString& name, timestamp_t divetime, int lat = 0, int lon = 0); + uint32_t addDiveSite(const QString& name, timestamp_t divetime, int lat = 0, int lon = 0); bool setData(const QModelIndex &index, const QVariant &value, int role); bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex()); void setFirstRowTextField(QLineEdit *textField); -- cgit v1.2.3-70-g09d2 From 44c0f978b33154611966b3f9db4c7e0cf54a9ffc Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 7 Nov 2015 23:04:54 +0200 Subject: filtermodels.cpp: fix an argument order warning Signed-off-by: Lubomir I. Ivanov --- qt-models/filtermodels.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index f56f4be1c..cbb83d06f 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -295,9 +295,9 @@ void LocationFilterModel::repopulate() MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent), + divesDisplayed(0), justCleared(false), - curr_dive_site(NULL), - divesDisplayed(0) + curr_dive_site(NULL) { } -- cgit v1.2.3-70-g09d2 From a8d8ec4ae9e7f34165af01a2cf9c562b7aa9516f Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 7 Nov 2015 23:06:59 +0200 Subject: diveplannermodel.cpp: move unused variables into a commented section Signed-off-by: Lubomir I. Ivanov --- qt-models/diveplannermodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 70a7c6f62..5e2315318 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -691,8 +691,6 @@ divedatapoint DivePlannerPointsModel::at(int row) void DivePlannerPointsModel::remove(const QModelIndex &index) { - int i; - int rows = rowCount(); if (index.column() != REMOVE || rowCount() == 1) return; @@ -707,6 +705,8 @@ void DivePlannerPointsModel::remove(const QModelIndex &index) * remove method that will pass the first and last index of the * removed rows, and remove those in a go. */ +// int i; +// int rows = rowCount(); // if (QApplication::keyboardModifiers() & Qt::ControlModifier) { // beginRemoveRows(QModelIndex(), index.row(), rows - 1); // for (i = rows - 1; i >= index.row(); i--) -- cgit v1.2.3-70-g09d2