Random whitespace cleanup

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-01-11 06:14:45 -08:00
parent 3c1a111404
commit 19e95efd6f
5 changed files with 92 additions and 97 deletions

View file

@ -38,8 +38,7 @@ extern "C" int gitProgressCB(int percent)
return 0;
}
QMLManager::QMLManager() :
m_locationServiceEnabled(false),
QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_verboseEnabled(false),
m_loadFromCloud(false),
reply(0),
@ -84,7 +83,7 @@ void QMLManager::finishSetup()
struct dive *d;
process_dives(false, false);
DiveListModel::instance()->clear();
for_each_dive(i, d) {
for_each_dive (i, d) {
DiveListModel::instance()->addDive(d);
}
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)
{
setStartPageText(tr("Cannot open cloud storage: Error creating https connection"));
Q_FOREACH(QSslError e, errors) {
Q_FOREACH (QSslError e, errors) {
qDebug() << e.errorString();
}
reply->abort();
@ -253,7 +252,7 @@ void QMLManager::retrieveUserid()
void QMLManager::loadDiveProgress(int percent)
{
QString text(tr("Loading dive list from cloud storage."));
while(percent > 0) {
while (percent > 0) {
text.append(".");
percent -= 10;
}
@ -306,7 +305,7 @@ void QMLManager::loadDivesWithValidCredentials()
int i;
struct dive *d;
for_each_dive(i, d) {
for_each_dive (i, d) {
DiveListModel::instance()->addDive(d);
}
appendTextToLog(QString("%1 dives loaded").arg(i));
@ -320,10 +319,9 @@ void QMLManager::refreshDiveList()
int i;
struct dive *d;
DiveListModel::instance()->clear();
for_each_dive(i, d) {
for_each_dive (i, d) {
DiveListModel::instance()->addDive(d);
}
}
// update the dive and return the notes field, stripped of the HTML junk
@ -532,7 +530,6 @@ void QMLManager::downloadGpsData()
{
locationProvider->downloadFromServer();
populateGpsData();
}
void QMLManager::populateGpsData()
@ -678,7 +675,8 @@ void QMLManager::showMap(QString location)
{
if (!location.isEmpty()) {
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);
}
}

View file

@ -7,8 +7,7 @@
#include "gpslocation.h"
class QMLManager : public QObject
{
class QMLManager : public QObject {
Q_OBJECT
Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged)
Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged)
@ -57,7 +56,7 @@ public:
void setLogText(const QString &logText);
void appendTextToLog(const QString &newText);
typedef void(QMLManager::*execute_function_type)();
typedef void (QMLManager::*execute_function_type)();
public slots:
void savePreferences();

View file

@ -18,8 +18,7 @@ struct gpsTracker {
int idx;
};
class GpsLocation : QObject
{
class GpsLocation : QObject {
Q_OBJECT
public:
GpsLocation(void (*showMsgCB)(const char *msg), QObject *parent);

View file

@ -33,8 +33,7 @@ static QString getFormattedCylinder(struct dive *dive, unsigned int idx)
return fmt;
}
DiveObjectHelper::DiveObjectHelper(struct dive *d) :
m_number(d->number),
DiveObjectHelper::DiveObjectHelper(struct dive *d) : m_number(d->number),
m_id(d->id),
m_rating(d->rating),
m_timestamp(d->when),
@ -68,7 +67,7 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
if (same_string(d->dc.model, "planned dive")) {
QTextDocument notes;
QString notesFormatted = m_notes;
#define _NOTES_BR "&#92n"
#define _NOTES_BR "&#92n"
notesFormatted = notesFormatted.replace("<thead>", "<thead>" _NOTES_BR);
notesFormatted = notesFormatted.replace("<br>", "<br>" _NOTES_BR);
notesFormatted = notesFormatted.replace("<tr>", "<tr>" _NOTES_BR);
@ -76,7 +75,7 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
notes.setHtml(notesFormatted);
m_notes = notes.toPlainText();
m_notes.replace(_NOTES_BR, "<br>");
#undef _NOTES_BR
#undef _NOTES_BR
} else {
m_notes.replace("\n", "<br>");
}
@ -213,7 +212,7 @@ QString DiveObjectHelper::sac() const
QStringList DiveObjectHelper::weights() const
{
return m_weights;
return m_weights;
}
QString DiveObjectHelper::weight(int idx) const

View file

@ -60,6 +60,7 @@ public:
QString trip() const;
QString maxcns() const;
QString otu() const;
private:
int m_number;
int m_id;
@ -86,8 +87,7 @@ private:
QString m_maxcns;
QString m_otu;
struct dive *m_dive;
};
Q_DECLARE_METATYPE(DiveObjectHelper*)
Q_DECLARE_METATYPE(DiveObjectHelper *)
#endif