mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Random whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3c1a111404
commit
19e95efd6f
5 changed files with 92 additions and 97 deletions
|
@ -38,8 +38,7 @@ extern "C" int gitProgressCB(int percent)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMLManager::QMLManager() :
|
QMLManager::QMLManager() : m_locationServiceEnabled(false),
|
||||||
m_locationServiceEnabled(false),
|
|
||||||
m_verboseEnabled(false),
|
m_verboseEnabled(false),
|
||||||
m_loadFromCloud(false),
|
m_loadFromCloud(false),
|
||||||
reply(0),
|
reply(0),
|
||||||
|
@ -84,7 +83,7 @@ void QMLManager::finishSetup()
|
||||||
struct dive *d;
|
struct dive *d;
|
||||||
process_dives(false, false);
|
process_dives(false, false);
|
||||||
DiveListModel::instance()->clear();
|
DiveListModel::instance()->clear();
|
||||||
for_each_dive(i, d) {
|
for_each_dive (i, d) {
|
||||||
DiveListModel::instance()->addDive(d);
|
DiveListModel::instance()->addDive(d);
|
||||||
}
|
}
|
||||||
appendTextToLog(QString("%1 dives loaded from cache").arg(i));
|
appendTextToLog(QString("%1 dives loaded from cache").arg(i));
|
||||||
|
@ -207,7 +206,7 @@ void QMLManager::provideAuth(QNetworkReply *reply, QAuthenticator *auth)
|
||||||
void QMLManager::handleSslErrors(const QList<QSslError> &errors)
|
void QMLManager::handleSslErrors(const QList<QSslError> &errors)
|
||||||
{
|
{
|
||||||
setStartPageText(tr("Cannot open cloud storage: Error creating https connection"));
|
setStartPageText(tr("Cannot open cloud storage: Error creating https connection"));
|
||||||
Q_FOREACH(QSslError e, errors) {
|
Q_FOREACH (QSslError e, errors) {
|
||||||
qDebug() << e.errorString();
|
qDebug() << e.errorString();
|
||||||
}
|
}
|
||||||
reply->abort();
|
reply->abort();
|
||||||
|
@ -253,7 +252,7 @@ void QMLManager::retrieveUserid()
|
||||||
void QMLManager::loadDiveProgress(int percent)
|
void QMLManager::loadDiveProgress(int percent)
|
||||||
{
|
{
|
||||||
QString text(tr("Loading dive list from cloud storage."));
|
QString text(tr("Loading dive list from cloud storage."));
|
||||||
while(percent > 0) {
|
while (percent > 0) {
|
||||||
text.append(".");
|
text.append(".");
|
||||||
percent -= 10;
|
percent -= 10;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +305,7 @@ void QMLManager::loadDivesWithValidCredentials()
|
||||||
int i;
|
int i;
|
||||||
struct dive *d;
|
struct dive *d;
|
||||||
|
|
||||||
for_each_dive(i, d) {
|
for_each_dive (i, d) {
|
||||||
DiveListModel::instance()->addDive(d);
|
DiveListModel::instance()->addDive(d);
|
||||||
}
|
}
|
||||||
appendTextToLog(QString("%1 dives loaded").arg(i));
|
appendTextToLog(QString("%1 dives loaded").arg(i));
|
||||||
|
@ -320,10 +319,9 @@ void QMLManager::refreshDiveList()
|
||||||
int i;
|
int i;
|
||||||
struct dive *d;
|
struct dive *d;
|
||||||
DiveListModel::instance()->clear();
|
DiveListModel::instance()->clear();
|
||||||
for_each_dive(i, d) {
|
for_each_dive (i, d) {
|
||||||
DiveListModel::instance()->addDive(d);
|
DiveListModel::instance()->addDive(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the dive and return the notes field, stripped of the HTML junk
|
// update the dive and return the notes field, stripped of the HTML junk
|
||||||
|
@ -532,7 +530,6 @@ void QMLManager::downloadGpsData()
|
||||||
{
|
{
|
||||||
locationProvider->downloadFromServer();
|
locationProvider->downloadFromServer();
|
||||||
populateGpsData();
|
populateGpsData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMLManager::populateGpsData()
|
void QMLManager::populateGpsData()
|
||||||
|
@ -678,7 +675,8 @@ void QMLManager::showMap(QString location)
|
||||||
{
|
{
|
||||||
if (!location.isEmpty()) {
|
if (!location.isEmpty()) {
|
||||||
QString link = QString("https://www.google.com/maps/place/%1/@%2,5000m/data=!3m1!1e3!4m2!3m1!1s0x0:0x0")
|
QString link = QString("https://www.google.com/maps/place/%1/@%2,5000m/data=!3m1!1e3!4m2!3m1!1s0x0:0x0")
|
||||||
.arg(location).arg(location);
|
.arg(location)
|
||||||
|
.arg(location);
|
||||||
QDesktopServices::openUrl(link);
|
QDesktopServices::openUrl(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
|
|
||||||
#include "gpslocation.h"
|
#include "gpslocation.h"
|
||||||
|
|
||||||
class QMLManager : public QObject
|
class QMLManager : public QObject {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged)
|
Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged)
|
||||||
Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged)
|
Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged)
|
||||||
|
@ -57,7 +56,7 @@ public:
|
||||||
void setLogText(const QString &logText);
|
void setLogText(const QString &logText);
|
||||||
void appendTextToLog(const QString &newText);
|
void appendTextToLog(const QString &newText);
|
||||||
|
|
||||||
typedef void(QMLManager::*execute_function_type)();
|
typedef void (QMLManager::*execute_function_type)();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void savePreferences();
|
void savePreferences();
|
||||||
|
|
|
@ -18,8 +18,7 @@ struct gpsTracker {
|
||||||
int idx;
|
int idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GpsLocation : QObject
|
class GpsLocation : QObject {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GpsLocation(void (*showMsgCB)(const char *msg), QObject *parent);
|
GpsLocation(void (*showMsgCB)(const char *msg), QObject *parent);
|
||||||
|
|
|
@ -33,8 +33,7 @@ static QString getFormattedCylinder(struct dive *dive, unsigned int idx)
|
||||||
return fmt;
|
return fmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
DiveObjectHelper::DiveObjectHelper(struct dive *d) :
|
DiveObjectHelper::DiveObjectHelper(struct dive *d) : m_number(d->number),
|
||||||
m_number(d->number),
|
|
||||||
m_id(d->id),
|
m_id(d->id),
|
||||||
m_rating(d->rating),
|
m_rating(d->rating),
|
||||||
m_timestamp(d->when),
|
m_timestamp(d->when),
|
||||||
|
@ -68,7 +67,7 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
|
||||||
if (same_string(d->dc.model, "planned dive")) {
|
if (same_string(d->dc.model, "planned dive")) {
|
||||||
QTextDocument notes;
|
QTextDocument notes;
|
||||||
QString notesFormatted = m_notes;
|
QString notesFormatted = m_notes;
|
||||||
#define _NOTES_BR "\n"
|
#define _NOTES_BR "\n"
|
||||||
notesFormatted = notesFormatted.replace("<thead>", "<thead>" _NOTES_BR);
|
notesFormatted = notesFormatted.replace("<thead>", "<thead>" _NOTES_BR);
|
||||||
notesFormatted = notesFormatted.replace("<br>", "<br>" _NOTES_BR);
|
notesFormatted = notesFormatted.replace("<br>", "<br>" _NOTES_BR);
|
||||||
notesFormatted = notesFormatted.replace("<tr>", "<tr>" _NOTES_BR);
|
notesFormatted = notesFormatted.replace("<tr>", "<tr>" _NOTES_BR);
|
||||||
|
@ -76,7 +75,7 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
|
||||||
notes.setHtml(notesFormatted);
|
notes.setHtml(notesFormatted);
|
||||||
m_notes = notes.toPlainText();
|
m_notes = notes.toPlainText();
|
||||||
m_notes.replace(_NOTES_BR, "<br>");
|
m_notes.replace(_NOTES_BR, "<br>");
|
||||||
#undef _NOTES_BR
|
#undef _NOTES_BR
|
||||||
} else {
|
} else {
|
||||||
m_notes.replace("\n", "<br>");
|
m_notes.replace("\n", "<br>");
|
||||||
}
|
}
|
||||||
|
@ -213,7 +212,7 @@ QString DiveObjectHelper::sac() const
|
||||||
|
|
||||||
QStringList DiveObjectHelper::weights() const
|
QStringList DiveObjectHelper::weights() const
|
||||||
{
|
{
|
||||||
return m_weights;
|
return m_weights;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DiveObjectHelper::weight(int idx) const
|
QString DiveObjectHelper::weight(int idx) const
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
QString trip() const;
|
QString trip() const;
|
||||||
QString maxcns() const;
|
QString maxcns() const;
|
||||||
QString otu() const;
|
QString otu() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_number;
|
int m_number;
|
||||||
int m_id;
|
int m_id;
|
||||||
|
@ -86,8 +87,7 @@ private:
|
||||||
QString m_maxcns;
|
QString m_maxcns;
|
||||||
QString m_otu;
|
QString m_otu;
|
||||||
struct dive *m_dive;
|
struct dive *m_dive;
|
||||||
|
|
||||||
};
|
};
|
||||||
Q_DECLARE_METATYPE(DiveObjectHelper*)
|
Q_DECLARE_METATYPE(DiveObjectHelper *)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue