mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'warnings' of github.com:neolit123/subsurface
This commit is contained in:
commit
440423ff64
19 changed files with 29 additions and 34 deletions
|
@ -52,8 +52,7 @@ BtDeviceSelectionDialog::BtDeviceSelectionDialog(QWidget *parent) :
|
||||||
// Initialize WinSock and ask for version 2.2.
|
// Initialize WinSock and ask for version 2.2.
|
||||||
ulRetCode = WSAStartup(MAKEWORD(2, 2), &WSAData);
|
ulRetCode = WSAStartup(MAKEWORD(2, 2), &WSAData);
|
||||||
if (ulRetCode != SUCCESS) {
|
if (ulRetCode != SUCCESS) {
|
||||||
QMessageBox::StandardButton warningBox;
|
QMessageBox::critical(this, "Bluetooth",
|
||||||
warningBox = QMessageBox::critical(this, "Bluetooth",
|
|
||||||
tr("Could not initialize Winsock version 2.2"), QMessageBox::Ok);
|
tr("Could not initialize Winsock version 2.2"), QMessageBox::Ok);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
|
||||||
{ NULL, }
|
{ NULL, }
|
||||||
};
|
};
|
||||||
|
|
||||||
static enum {
|
enum Known {
|
||||||
MANUAL,
|
MANUAL,
|
||||||
APD,
|
APD,
|
||||||
APD2,
|
APD2,
|
||||||
|
@ -30,7 +30,7 @@ static enum {
|
||||||
SENSUS,
|
SENSUS,
|
||||||
SEABEAR,
|
SEABEAR,
|
||||||
SUBSURFACE
|
SUBSURFACE
|
||||||
} known;
|
};
|
||||||
|
|
||||||
ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(parent)
|
ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
DiveShareExportDialog::DiveShareExportDialog(QWidget *parent) :
|
DiveShareExportDialog::DiveShareExportDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::DiveShareExportDialog),
|
ui(new Ui::DiveShareExportDialog),
|
||||||
reply(NULL),
|
exportSelected(false),
|
||||||
exportSelected(false)
|
reply(NULL)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -540,7 +540,6 @@ void DiveLocationLineEdit::fixPopupPosition()
|
||||||
{
|
{
|
||||||
const QRect screen = QApplication::desktop()->availableGeometry(this);
|
const QRect screen = QApplication::desktop()->availableGeometry(this);
|
||||||
const int maxVisibleItems = 5;
|
const int maxVisibleItems = 5;
|
||||||
Qt::LayoutDirection dir = layoutDirection();
|
|
||||||
QPoint pos;
|
QPoint pos;
|
||||||
int rh, w;
|
int rh, w;
|
||||||
int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3;
|
int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3;
|
||||||
|
|
|
@ -1642,6 +1642,6 @@ void MainTab::contextMenuEvent(QContextMenuEvent *event)
|
||||||
popup.addSeparator();
|
popup.addSeparator();
|
||||||
popup.addAction(tr("Delete selected images"), this, SLOT(removeSelectedPhotos()));
|
popup.addAction(tr("Delete selected images"), this, SLOT(removeSelectedPhotos()));
|
||||||
popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
|
popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
|
||||||
QAction *actionTaken = popup.exec(event->globalPos());
|
popup.exec(event->globalPos());
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,8 +137,6 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
connect(diveSiteEdit, &LocationInformationWidget::endEditDiveSite,
|
connect(diveSiteEdit, &LocationInformationWidget::endEditDiveSite,
|
||||||
mainTab, &MainTab::refreshDisplayedDiveSite);
|
mainTab, &MainTab::refreshDisplayedDiveSite);
|
||||||
|
|
||||||
QWidget *diveSitePictures = new QWidget(); // Placeholder
|
|
||||||
|
|
||||||
std::pair<QByteArray, QVariant> enabled = std::make_pair("enabled", QVariant(true));
|
std::pair<QByteArray, QVariant> enabled = std::make_pair("enabled", QVariant(true));
|
||||||
std::pair<QByteArray, QVariant> disabled = std::make_pair("enabled", QVariant(false));
|
std::pair<QByteArray, QVariant> disabled = std::make_pair("enabled", QVariant(false));
|
||||||
PropertyList enabledList;
|
PropertyList enabledList;
|
||||||
|
|
|
@ -7,7 +7,7 @@ FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent)
|
||||||
|
|
||||||
bool FacebookPlugin::isConnected()
|
bool FacebookPlugin::isConnected()
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FacebookPlugin::requestLogin()
|
void FacebookPlugin::requestLogin()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "abstractpreferenceswidget.h"
|
#include "abstractpreferenceswidget.h"
|
||||||
|
|
||||||
AbstractPreferencesWidget::AbstractPreferencesWidget(const QString& name, const QIcon& icon, float positionHeight)
|
AbstractPreferencesWidget::AbstractPreferencesWidget(const QString& name, const QIcon& icon, float positionHeight)
|
||||||
: QWidget(), _name(name), _icon(icon), _positionHeight(positionHeight)
|
: QWidget(), _icon(icon), _name(name), _positionHeight(positionHeight)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ void PreferencesNetwork::syncSettings()
|
||||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||||
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
||||||
connect(cloudAuth, SIGNAL(passwordChangeSuccessful()), this, SLOT(passwordUpdateSuccessfull()));
|
connect(cloudAuth, SIGNAL(passwordChangeSuccessful()), this, SLOT(passwordUpdateSuccessfull()));
|
||||||
QNetworkReply *reply = cloudAuth->backend(email, password, "", newpassword);
|
cloudAuth->backend(email, password, "", newpassword);
|
||||||
ui->cloud_storage_new_passwd->setText("");
|
ui->cloud_storage_new_passwd->setText("");
|
||||||
free(prefs.cloud_storage_newpassword);
|
free(prefs.cloud_storage_newpassword);
|
||||||
prefs.cloud_storage_newpassword = strdup(qPrintable(newpassword));
|
prefs.cloud_storage_newpassword = strdup(qPrintable(newpassword));
|
||||||
|
@ -97,7 +97,7 @@ void PreferencesNetwork::syncSettings()
|
||||||
} else {
|
} else {
|
||||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||||
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
||||||
QNetworkReply *reply = cloudAuth->backend(email, password);
|
cloudAuth->backend(email, password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (prefs.cloud_verification_status == CS_NEED_TO_VERIFY) {
|
} else if (prefs.cloud_verification_status == CS_NEED_TO_VERIFY) {
|
||||||
|
@ -110,7 +110,7 @@ void PreferencesNetwork::syncSettings()
|
||||||
}
|
}
|
||||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||||
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
||||||
QNetworkReply *reply = cloudAuth->backend(email, password, pin);
|
cloudAuth->backend(email, password, pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SAVE_OR_REMOVE("email", default_prefs.cloud_storage_email, email);
|
SAVE_OR_REMOVE("email", default_prefs.cloud_storage_email, email);
|
||||||
|
@ -169,4 +169,4 @@ void PreferencesNetwork::proxyType_changed(int idx)
|
||||||
void PreferencesNetwork::passwordUpdateSuccessfull()
|
void PreferencesNetwork::passwordUpdateSuccessfull()
|
||||||
{
|
{
|
||||||
ui->cloud_storage_password->setText(prefs.cloud_storage_password);
|
ui->cloud_storage_password->setText(prefs.cloud_storage_password);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,7 @@ void PreferencesDialog::buttonClicked(QAbstractButton* btn)
|
||||||
case QDialogButtonBox::AcceptRole : applyRequested(true); return;
|
case QDialogButtonBox::AcceptRole : applyRequested(true); return;
|
||||||
case QDialogButtonBox::RejectRole : cancelRequested(); return;
|
case QDialogButtonBox::RejectRole : cancelRequested(); return;
|
||||||
case QDialogButtonBox::ResetRole : defaultsRequested(); return;
|
case QDialogButtonBox::ResetRole : defaultsRequested(); return;
|
||||||
|
default: return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,6 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
|
||||||
int i;
|
int i;
|
||||||
struct dive *dive;
|
struct dive *dive;
|
||||||
for_each_dive (i, dive) {
|
for_each_dive (i, dive) {
|
||||||
FILE *f;
|
|
||||||
char filename[PATH_MAX];
|
char filename[PATH_MAX];
|
||||||
int streamsize;
|
int streamsize;
|
||||||
const char *membuf;
|
const char *membuf;
|
||||||
|
@ -412,6 +411,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
|
||||||
struct dive *d;
|
struct dive *d;
|
||||||
struct dive_site *ds;
|
struct dive_site *ds;
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
(void)changed;
|
||||||
clear_table(&gps_location_table);
|
clear_table(&gps_location_table);
|
||||||
QByteArray url = tr("Webservice").toLocal8Bit();
|
QByteArray url = tr("Webservice").toLocal8Bit();
|
||||||
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL);
|
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL);
|
||||||
|
|
|
@ -1291,7 +1291,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
|
||||||
action->setData(event->globalPos());
|
action->setData(event->globalPos());
|
||||||
|
|
||||||
if (same_string(current_dc->model, "manually added dive"))
|
if (same_string(current_dc->model, "manually added dive"))
|
||||||
QAction *editProfileAction = m.addAction(tr("Edit the profile"), this, SIGNAL(editCurrentDive()));
|
m.addAction(tr("Edit the profile"), this, SIGNAL(editCurrentDive()));
|
||||||
|
|
||||||
if (DiveEventItem *item = dynamic_cast<DiveEventItem *>(sceneItem)) {
|
if (DiveEventItem *item = dynamic_cast<DiveEventItem *>(sceneItem)) {
|
||||||
action = new QAction(&m);
|
action = new QAction(&m);
|
||||||
|
@ -1621,7 +1621,6 @@ void ProfileWidget2::repositionDiveHandlers()
|
||||||
{
|
{
|
||||||
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
||||||
// Re-position the user generated dive handlers
|
// Re-position the user generated dive handlers
|
||||||
struct gasmix mix, lastmix;
|
|
||||||
for (int i = 0; i < plannerModel->rowCount(); i++) {
|
for (int i = 0; i < plannerModel->rowCount(); i++) {
|
||||||
struct divedatapoint datapoint = plannerModel->at(i);
|
struct divedatapoint datapoint = plannerModel->at(i);
|
||||||
if (datapoint.time == 0) // those are the magic entries for tanks
|
if (datapoint.time == 0) // those are the magic entries for tanks
|
||||||
|
|
|
@ -128,7 +128,7 @@ void LocationInformationModel::update()
|
||||||
endResetModel();
|
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;
|
degrees_t latitude, longitude;
|
||||||
latitude.udeg = lat;
|
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_lat = displayed_dive_site.latitude.udeg;
|
||||||
int ref_lon = displayed_dive_site.longitude.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;
|
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);
|
struct dive_site *ds = get_dive_site_by_uuid(ds_uuid);
|
||||||
|
|
||||||
if (!ds)
|
if (!ds)
|
||||||
|
@ -202,4 +202,4 @@ bool filter_same_gps_cb (QAbstractItemModel *model, int sourceRow, const QModelI
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (ds->latitude.udeg == ref_lat && ds->longitude.udeg == ref_lon && ds->uuid != ref_uuid);
|
return (ds->latitude.udeg == ref_lat && ds->longitude.udeg == ref_lon && ds->uuid != ref_uuid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public:
|
||||||
int columnCount(const QModelIndex &parent) const;
|
int columnCount(const QModelIndex &parent) const;
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) 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 setData(const QModelIndex &index, const QVariant &value, int role);
|
||||||
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
|
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
|
||||||
void setFirstRowTextField(QLineEdit *textField);
|
void setFirstRowTextField(QLineEdit *textField);
|
||||||
|
|
|
@ -691,8 +691,6 @@ divedatapoint DivePlannerPointsModel::at(int row)
|
||||||
|
|
||||||
void DivePlannerPointsModel::remove(const QModelIndex &index)
|
void DivePlannerPointsModel::remove(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
int rows = rowCount();
|
|
||||||
if (index.column() != REMOVE || rowCount() == 1)
|
if (index.column() != REMOVE || rowCount() == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -707,6 +705,8 @@ void DivePlannerPointsModel::remove(const QModelIndex &index)
|
||||||
* remove method that will pass the first and last index of the
|
* remove method that will pass the first and last index of the
|
||||||
* removed rows, and remove those in a go.
|
* removed rows, and remove those in a go.
|
||||||
*/
|
*/
|
||||||
|
// int i;
|
||||||
|
// int rows = rowCount();
|
||||||
// if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
|
// if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
|
||||||
// beginRemoveRows(QModelIndex(), index.row(), rows - 1);
|
// beginRemoveRows(QModelIndex(), index.row(), rows - 1);
|
||||||
// for (i = rows - 1; i >= index.row(); i--)
|
// for (i = rows - 1; i >= index.row(); i--)
|
||||||
|
|
|
@ -295,9 +295,9 @@ void LocationFilterModel::repopulate()
|
||||||
|
|
||||||
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) :
|
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) :
|
||||||
QSortFilterProxyModel(parent),
|
QSortFilterProxyModel(parent),
|
||||||
|
divesDisplayed(0),
|
||||||
justCleared(false),
|
justCleared(false),
|
||||||
curr_dive_site(NULL),
|
curr_dive_site(NULL)
|
||||||
divesDisplayed(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2878,7 +2878,6 @@ static struct dive *create_new_copy(struct dive *from)
|
||||||
static void force_fixup_dive(struct dive *d)
|
static void force_fixup_dive(struct dive *d)
|
||||||
{
|
{
|
||||||
struct divecomputer *dc = &d->dc;
|
struct divecomputer *dc = &d->dc;
|
||||||
int old_maxdepth = dc->maxdepth.mm;
|
|
||||||
int old_temp = dc->watertemp.mkelvin;
|
int old_temp = dc->watertemp.mkelvin;
|
||||||
int old_mintemp = d->mintemp.mkelvin;
|
int old_mintemp = d->mintemp.mkelvin;
|
||||||
int old_maxtemp = d->maxtemp.mkelvin;
|
int old_maxtemp = d->maxtemp.mkelvin;
|
||||||
|
|
|
@ -157,6 +157,9 @@ void remember_event(const char *eventname)
|
||||||
evn_used++;
|
evn_used++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* UNUSED! */
|
||||||
|
static int get_local_sac(struct plot_data *entry1, struct plot_data *entry2, struct dive *dive) __attribute__((unused));
|
||||||
|
|
||||||
/* Get local sac-rate (in ml/min) between entry1 and entry2 */
|
/* Get local sac-rate (in ml/min) between entry1 and entry2 */
|
||||||
static int get_local_sac(struct plot_data *entry1, struct plot_data *entry2, struct dive *dive)
|
static int get_local_sac(struct plot_data *entry1, struct plot_data *entry2, struct dive *dive)
|
||||||
{
|
{
|
||||||
|
@ -720,7 +723,6 @@ static int sac_between(struct dive *dive, struct plot_data *first, struct plot_d
|
||||||
double pressuretime;
|
double pressuretime;
|
||||||
pressure_t a, b;
|
pressure_t a, b;
|
||||||
cylinder_t *cyl;
|
cylinder_t *cyl;
|
||||||
int duration;
|
|
||||||
|
|
||||||
if (first == last)
|
if (first == last)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -808,10 +810,7 @@ static void fill_sac(struct dive *dive, struct plot_info *pi, int idx)
|
||||||
|
|
||||||
static void calculate_sac(struct dive *dive, struct plot_info *pi)
|
static void calculate_sac(struct dive *dive, struct plot_info *pi)
|
||||||
{
|
{
|
||||||
int i = 0, last = 0;
|
for (int i = 0; i < pi->nr; i++)
|
||||||
struct plot_data *last_entry = NULL;
|
|
||||||
|
|
||||||
for (i = 0; i < pi->nr; i++)
|
|
||||||
fill_sac(dive, pi, i);
|
fill_sac(dive, pi, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ int main(int argc, char **argv)
|
||||||
bool no_filenames = true;
|
bool no_filenames = true;
|
||||||
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
|
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
|
||||||
QApplication *application = new QApplication(argc, argv);
|
QApplication *application = new QApplication(argc, argv);
|
||||||
|
(void)application;
|
||||||
QStringList files;
|
QStringList files;
|
||||||
QStringList importedFiles;
|
QStringList importedFiles;
|
||||||
QStringList arguments = QCoreApplication::arguments();
|
QStringList arguments = QCoreApplication::arguments();
|
||||||
|
|
Loading…
Add table
Reference in a new issue