1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2018-06-01 19:07:21 +02:00
parent ca7016176f
commit 815cb6cb91
5 changed files with 12 additions and 33 deletions

View File

@ -13,11 +13,6 @@ FileBrowser::FileBrowser(QObject *parent) : QObject(parent)
_index = -1; _index = -1;
} }
FileBrowser::~FileBrowser()
{
delete _watcher;
}
void FileBrowser::setCurrent(const QString &path) void FileBrowser::setCurrent(const QString &path)
{ {
QFileInfo file(path); QFileInfo file(path);

View File

@ -13,7 +13,6 @@ class FileBrowser : public QObject
public: public:
FileBrowser(QObject *parent = 0); FileBrowser(QObject *parent = 0);
~FileBrowser();
void setFilter(const QStringList &filter); void setFilter(const QStringList &filter);
void setCurrent(const QString &path); void setCurrent(const QString &path);

View File

@ -63,20 +63,14 @@ GraphView::GraphView(QWidget *parent)
GraphView::~GraphView() GraphView::~GraphView()
{ {
if (_xAxis->scene() != _scene) delete _xAxis;
delete _xAxis; delete _yAxis;
if (_yAxis->scene() != _scene) delete _slider;
delete _yAxis; delete _info;
if (_slider->scene() != _scene) delete _grid;
delete _slider;
if (_info->scene() != _scene)
delete _info;
if (_grid->scene() != _scene)
delete _grid;
for (int i = 0; i < _graphs.count(); i++) for (int i = 0; i < _graphs.count(); i++)
if (_graphs.at(i)->scene() != _scene) delete _graphs[i];
delete _graphs[i];
} }
void GraphView::createXLabel() void GraphView::createXLabel()

View File

@ -96,14 +96,6 @@ GUI::GUI()
updateStatusBarInfo(); updateStatusBarInfo();
} }
GUI::~GUI()
{
for (int i = 0; i < _tabs.size(); i++) {
if (_graphTabWidget->indexOf(_tabs.at(i)) < 0)
delete _tabs.at(i);
}
}
void GUI::loadMaps() void GUI::loadMaps()
{ {
_ml = new MapList(this); _ml = new MapList(this);
@ -557,12 +549,12 @@ void GUI::createGraphTabs()
_graphTabWidget->setDocumentMode(true); _graphTabWidget->setDocumentMode(true);
#endif // Q_OS_WIN32 #endif // Q_OS_WIN32
_tabs.append(new ElevationGraph); _tabs.append(new ElevationGraph(_graphTabWidget));
_tabs.append(new SpeedGraph); _tabs.append(new SpeedGraph(_graphTabWidget));
_tabs.append(new HeartRateGraph); _tabs.append(new HeartRateGraph(_graphTabWidget));
_tabs.append(new CadenceGraph); _tabs.append(new CadenceGraph(_graphTabWidget));
_tabs.append(new PowerGraph); _tabs.append(new PowerGraph(_graphTabWidget));
_tabs.append(new TemperatureGraph); _tabs.append(new TemperatureGraph(_graphTabWidget));
for (int i = 0; i < _tabs.count(); i++) for (int i = 0; i < _tabs.count(); i++)
connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), this, connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), this,

View File

@ -35,7 +35,6 @@ class GUI : public QMainWindow
public: public:
GUI(); GUI();
~GUI();
bool openFile(const QString &fileName); bool openFile(const QString &fileName);