Skip to content

Commit d8d2b8d

Browse files
committed
Replaced include guards with #pragma once as its easier to maintain; renamed EzBuilder to Builder; removed unused parameters in SpinParser functions.
1 parent 17f0759 commit d8d2b8d

23 files changed

+45
-110
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#include "EzBuilder.h"
1+
#include "Builder.h"
22

3-
EzBuilder::EzBuilder(QObject *parent) : QObject(parent)
3+
Builder::Builder(QObject *parent) : QObject(parent)
44
{
55
}
66

7-
void EzBuilder::setParameters(QString comp, QString incl, QString compPath, QString projFile, QString compstat)
7+
void Builder::setParameters(QString comp, QString incl, QString compPath, QString projFile, QString compstat)
88
{
99
compilerStr = comp;
1010
compilerPath = compPath;
@@ -13,15 +13,15 @@ void EzBuilder::setParameters(QString comp, QString incl, QString compPath, QStr
1313
compileResult = compstat;
1414
}
1515

16-
void EzBuilder::setObjects(QLabel *stat, QLabel *progsize, QProgressBar *progbar, QComboBox *ports)
16+
void Builder::setObjects(QLabel *stat, QLabel *progsize, QProgressBar *progbar, QComboBox *ports)
1717
{
1818
msgLabel = stat;
1919
sizeLabel = progsize;
2020
progress = progbar;
2121
cbPort = ports;
2222
}
2323

24-
QString EzBuilder::filePathName(QString fileName)
24+
QString Builder::filePathName(QString fileName)
2525
{
2626
QString rets;
2727
if(fileName.lastIndexOf("/") > -1)
@@ -31,28 +31,28 @@ QString EzBuilder::filePathName(QString fileName)
3131
return rets;
3232
}
3333

34-
int EzBuilder::runCompiler(QString copts)
34+
int Builder::runCompiler(QString copts)
3535
{
3636
// satisfy warnings only
3737
if(copts.length())
3838
return 0;
3939
return 0;
4040
}
4141

42-
void EzBuilder::compilerError(QProcess::ProcessError error)
42+
void Builder::compilerError(QProcess::ProcessError error)
4343
{
4444
// satisfy warnings only
4545
if(error != QProcess::Crashed) return;
4646
}
4747

48-
void EzBuilder::compilerFinished(int exitCode, QProcess::ExitStatus status)
48+
void Builder::compilerFinished(int exitCode, QProcess::ExitStatus status)
4949
{
5050
// satisfy warnings only
5151
if(exitCode) return;
5252
if(status != QProcess::CrashExit) return;
5353
}
5454

55-
void EzBuilder::procReadyRead()
55+
void Builder::procReadyRead()
5656
{
5757
}
5858

src/propelleride/EzBuilder.h renamed to src/propelleride/Builder.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef EZBUILDER_H
2-
#define EZBUILDER_H
1+
#pragma once
32

43
#include <QObject>
54
#include <QString>
@@ -9,11 +8,11 @@
98
#include <QProcess>
109
#include <QMutex>
1110

12-
class EzBuilder : public QObject
11+
class Builder : public QObject
1312
{
1413
Q_OBJECT
1514
public:
16-
explicit EzBuilder(QObject *parent = 0);
15+
explicit Builder(QObject *parent = 0);
1716

1817
void setParameters(QString comp, QString incl, QString compPath, QString projFile, QString compstat);
1918
void setObjects(QLabel *stat, QLabel *progsize, QProgressBar *progbar, QComboBox *ports);
@@ -53,5 +52,3 @@ public slots:
5352
QMutex procMutex;
5453
bool procDone;
5554
};
56-
57-
#endif // EZBUILDER_H

src/propelleride/PortConnectionMonitor.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef PORTCONNECTIONMONITOR_H
2-
#define PORTCONNECTIONMONITOR_H
1+
#pragma once
32

43
#include <QThread>
54
#include <QObject>
@@ -27,5 +26,3 @@ public slots:
2726
bool running;
2827

2928
};
30-
31-
#endif // PORTCONNECTIONMONITOR_H

src/propelleride/PortListener.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef PORTLISTENER_H_
2-
#define PORTLISTENER_H_
1+
#pragma once
32

43
#include <QObject>
54
#include <QThread>
@@ -170,6 +169,3 @@ public slots:
170169
void flushPort();
171170

172171
};
173-
174-
175-
#endif /*PORTLISTENER_H_*/

src/propelleride/Preferences.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef PREFERENCES_H
2-
#define PREFERENCES_H
1+
#pragma once
32

43
#include <Qt>
54
#include <QWidget>
@@ -217,5 +216,3 @@ public slots:
217216

218217
QVector<PColor*> propertyColors;
219218
};
220-
221-
#endif // PREFERENCES_H

src/propelleride/Sleeper.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef SLEEPER_H
2-
#define SLEEPER_H
1+
#pragma once
32

43
#include <QThread>
54

@@ -15,6 +14,3 @@ class Sleeper : QThread
1514
sleep(s);
1615
}
1716
};
18-
19-
20-
#endif // SLEEPER_H

src/propelleride/SpinBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "Sleeper.h"
1111

12-
SpinBuilder::SpinBuilder() : EzBuilder(0)
12+
SpinBuilder::SpinBuilder() : Builder(0)
1313
{
1414
}
1515

src/propelleride/SpinBuilder.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#ifndef SPINBUILDER_H
2-
#define SPINBUILDER_H
1+
#pragma once
32

4-
#include "EzBuilder.h"
3+
#include "Builder.h"
54

65
#include <QStringList>
76
#include <QProcess>
87

9-
class SpinBuilder : public EzBuilder
8+
class SpinBuilder : public Builder
109
{
1110
public:
1211
SpinBuilder();
@@ -26,5 +25,3 @@ class SpinBuilder : public EzBuilder
2625
QStringList getCompilerParameters();
2726
bool receiving;
2827
};
29-
30-
#endif // SPINBUILDER_H

src/propelleride/SpinModel.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef SPINMODEL_H
2-
#define SPINMODEL_H
1+
#pragma once
32

43
#include <QAbstractItemModel>
54
#include <QModelIndex>
@@ -24,6 +23,3 @@ class SpinModel : public TreeModel
2423
bool isSectionHead(QString s, QString nocmp);
2524
QString removeComments(QString text);
2625
};
27-
//! [0]
28-
29-
#endif

src/propelleride/SpinParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ QStringList SpinParser::spinMethods(QString file, QString objname)
220220
return list;
221221
}
222222

223-
QStringList SpinParser::spinDat(QString file, QString objname)
223+
QStringList SpinParser::spinDat(QString objname)
224224
{
225225
QStringList list;
226226
QStringList keys = db.keys();
@@ -240,7 +240,7 @@ QStringList SpinParser::spinDat(QString file, QString objname)
240240
return list;
241241
}
242242

243-
QStringList SpinParser::spinVars(QString file, QString objname)
243+
QStringList SpinParser::spinVars(QString objname)
244244
{
245245
QStringList list;
246246
QStringList keys = db.keys();
@@ -260,7 +260,7 @@ QStringList SpinParser::spinVars(QString file, QString objname)
260260
return list;
261261
}
262262

263-
QStringList SpinParser::spinObjects(QString file, QString objname)
263+
QStringList SpinParser::spinObjects(QString objname)
264264
{
265265
QStringList list;
266266
QStringList keys = db.keys();

0 commit comments

Comments
 (0)