From: Flavio Tordini Date: Sun, 30 Aug 2015 10:07:28 +0000 (+0200) Subject: history stack as non-pointer member X-Git-Tag: 2.5~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=eaa30e06ea78fcf9c555c62ab274a86a056c69a0;p=minitube history stack as non-pointer member --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 6eb56c9..feb1a7a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -105,7 +105,6 @@ MainWindow::MainWindow() : #endif // views mechanism - history = new QStack(); views = new QStackedWidget(); views->hide(); setCentralWidget(views); @@ -165,10 +164,6 @@ MainWindow::MainWindow() : QTimer::singleShot(0, this, SLOT(lazyInit())); } -MainWindow::~MainWindow() { - delete history; -} - void MainWindow::lazyInit() { #ifdef APP_PHONON initPhonon(); @@ -947,9 +942,9 @@ void MainWindow::writeSettings() { } void MainWindow::goBack() { - if ( history->size() > 1 ) { - history->pop(); - QWidget *widget = history->pop(); + if (history.size() > 1) { + history.pop(); + QWidget *widget = history.pop(); showWidget(widget); } } @@ -1012,7 +1007,7 @@ void MainWindow::showWidget(QWidget* widget, bool transition) { */ } - history->push(widget); + history.push(widget); } void MainWindow::about() { diff --git a/src/mainwindow.h b/src/mainwindow.h index 6cccabd..060a8c3 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -48,7 +48,6 @@ class MainWindow : public QMainWindow { public: static MainWindow* instance(); MainWindow(); - ~MainWindow(); #ifdef APP_PHONON_SEEK Phonon::SeekSlider* getSeekSlider() { return seekSlider; } #else @@ -173,7 +172,7 @@ private: // view mechanism QStackedWidget *views; - QStack *history; + QStack history; QList viewActions; // view widgets