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;
}
FileBrowser::~FileBrowser()
{
delete _watcher;
}
void FileBrowser::setCurrent(const QString &path)
{
QFileInfo file(path);

View File

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

View File

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

View File

@ -96,14 +96,6 @@ GUI::GUI()
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()
{
_ml = new MapList(this);
@ -557,12 +549,12 @@ void GUI::createGraphTabs()
_graphTabWidget->setDocumentMode(true);
#endif // Q_OS_WIN32
_tabs.append(new ElevationGraph);
_tabs.append(new SpeedGraph);
_tabs.append(new HeartRateGraph);
_tabs.append(new CadenceGraph);
_tabs.append(new PowerGraph);
_tabs.append(new TemperatureGraph);
_tabs.append(new ElevationGraph(_graphTabWidget));
_tabs.append(new SpeedGraph(_graphTabWidget));
_tabs.append(new HeartRateGraph(_graphTabWidget));
_tabs.append(new CadenceGraph(_graphTabWidget));
_tabs.append(new PowerGraph(_graphTabWidget));
_tabs.append(new TemperatureGraph(_graphTabWidget));
for (int i = 0; i < _tabs.count(); i++)
connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), this,

View File

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