Merge branch 'warnings' of github.com:neolit123/subsurface

This commit is contained in:
Dirk Hohndel 2015-11-07 22:16:30 -08:00
commit 440423ff64
19 changed files with 29 additions and 34 deletions

View file

@ -52,8 +52,7 @@ BtDeviceSelectionDialog::BtDeviceSelectionDialog(QWidget *parent) :
// Initialize WinSock and ask for version 2.2.
ulRetCode = WSAStartup(MAKEWORD(2, 2), &WSAData);
if (ulRetCode != SUCCESS) {
QMessageBox::StandardButton warningBox;
warningBox = QMessageBox::critical(this, "Bluetooth",
QMessageBox::critical(this, "Bluetooth",
tr("Could not initialize Winsock version 2.2"), QMessageBox::Ok);
return;
}

View file

@ -22,7 +22,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
{ NULL, }
};
static enum {
enum Known {
MANUAL,
APD,
APD2,
@ -30,7 +30,7 @@ static enum {
SENSUS,
SEABEAR,
SUBSURFACE
} known;
};
ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(parent)
{

View file

@ -11,8 +11,8 @@
DiveShareExportDialog::DiveShareExportDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::DiveShareExportDialog),
reply(NULL),
exportSelected(false)
exportSelected(false),
reply(NULL)
{
ui->setupUi(this);
}

View file

@ -540,7 +540,6 @@ void DiveLocationLineEdit::fixPopupPosition()
{
const QRect screen = QApplication::desktop()->availableGeometry(this);
const int maxVisibleItems = 5;
Qt::LayoutDirection dir = layoutDirection();
QPoint pos;
int rh, w;
int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3;

View file

@ -1642,6 +1642,6 @@ void MainTab::contextMenuEvent(QContextMenuEvent *event)
popup.addSeparator();
popup.addAction(tr("Delete selected images"), this, SLOT(removeSelectedPhotos()));
popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
QAction *actionTaken = popup.exec(event->globalPos());
popup.exec(event->globalPos());
event->accept();
}

View file

@ -137,8 +137,6 @@ MainWindow::MainWindow() : QMainWindow(),
connect(diveSiteEdit, &LocationInformationWidget::endEditDiveSite,
mainTab, &MainTab::refreshDisplayedDiveSite);
QWidget *diveSitePictures = new QWidget(); // Placeholder
std::pair<QByteArray, QVariant> enabled = std::make_pair("enabled", QVariant(true));
std::pair<QByteArray, QVariant> disabled = std::make_pair("enabled", QVariant(false));
PropertyList enabledList;

View file

@ -7,7 +7,7 @@ FacebookPlugin::FacebookPlugin(QObject* parent): QObject(parent)
bool FacebookPlugin::isConnected()
{
return false;
}
void FacebookPlugin::requestLogin()

View file

@ -1,7 +1,7 @@
#include "abstractpreferenceswidget.h"
AbstractPreferencesWidget::AbstractPreferencesWidget(const QString& name, const QIcon& icon, float positionHeight)
: QWidget(), _name(name), _icon(icon), _positionHeight(positionHeight)
: QWidget(), _icon(icon), _name(name), _positionHeight(positionHeight)
{
}

View file

@ -76,7 +76,7 @@ void PreferencesNetwork::syncSettings()
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
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("");
free(prefs.cloud_storage_newpassword);
prefs.cloud_storage_newpassword = strdup(qPrintable(newpassword));
@ -97,7 +97,7 @@ void PreferencesNetwork::syncSettings()
} else {
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
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) {
@ -110,7 +110,7 @@ void PreferencesNetwork::syncSettings()
}
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
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);
@ -169,4 +169,4 @@ void PreferencesNetwork::proxyType_changed(int idx)
void PreferencesNetwork::passwordUpdateSuccessfull()
{
ui->cloud_storage_password->setText(prefs.cloud_storage_password);
}
}

View file

@ -84,6 +84,7 @@ void PreferencesDialog::buttonClicked(QAbstractButton* btn)
case QDialogButtonBox::AcceptRole : applyRequested(true); return;
case QDialogButtonBox::RejectRole : cancelRequested(); return;
case QDialogButtonBox::ResetRole : defaultsRequested(); return;
default: return;
}
}

View file

@ -188,7 +188,6 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
int i;
struct dive *dive;
for_each_dive (i, dive) {
FILE *f;
char filename[PATH_MAX];
int streamsize;
const char *membuf;
@ -412,6 +411,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
struct dive *d;
struct dive_site *ds;
bool changed = false;
(void)changed;
clear_table(&gps_location_table);
QByteArray url = tr("Webservice").toLocal8Bit();
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL);

View file

@ -1291,7 +1291,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
action->setData(event->globalPos());
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)) {
action = new QAction(&m);
@ -1621,7 +1621,6 @@ void ProfileWidget2::repositionDiveHandlers()
{
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
// Re-position the user generated dive handlers
struct gasmix mix, lastmix;
for (int i = 0; i < plannerModel->rowCount(); i++) {
struct divedatapoint datapoint = plannerModel->at(i);
if (datapoint.time == 0) // those are the magic entries for tanks

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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--)

View file

@ -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)
{
}

View file

@ -2878,7 +2878,6 @@ static struct dive *create_new_copy(struct dive *from)
static void force_fixup_dive(struct dive *d)
{
struct divecomputer *dc = &d->dc;
int old_maxdepth = dc->maxdepth.mm;
int old_temp = dc->watertemp.mkelvin;
int old_mintemp = d->mintemp.mkelvin;
int old_maxtemp = d->maxtemp.mkelvin;

View file

@ -157,6 +157,9 @@ void remember_event(const char *eventname)
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 */
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;
pressure_t a, b;
cylinder_t *cyl;
int duration;
if (first == last)
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)
{
int i = 0, last = 0;
struct plot_data *last_entry = NULL;
for (i = 0; i < pi->nr; i++)
for (int i = 0; i < pi->nr; i++)
fill_sac(dive, pi, i);
}

View file

@ -31,6 +31,7 @@ int main(int argc, char **argv)
bool no_filenames = true;
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
QApplication *application = new QApplication(argc, argv);
(void)application;
QStringList files;
QStringList importedFiles;
QStringList arguments = QCoreApplication::arguments();