]> git.sur5r.net Git - minitube/commitdiff
history stack as non-pointer member
authorFlavio Tordini <flavio.tordini@gmail.com>
Sun, 30 Aug 2015 10:07:28 +0000 (12:07 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Sun, 30 Aug 2015 10:07:28 +0000 (12:07 +0200)
src/mainwindow.cpp
src/mainwindow.h

index 6eb56c95089e589d5984c42e9cde51ddfacff562..feb1a7ae5db1713e8b7490a9d3fd4662499de9fe 100644 (file)
@@ -105,7 +105,6 @@ MainWindow::MainWindow() :
 #endif
 
     // views mechanism
-    history = new QStack<QWidget*>();
     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() {
index 6cccabdb343f2401797d54ab4a93175d40e40bb0..060a8c34f85d1006bd38ae63bbaf48aeca9c71bc 100644 (file)
@@ -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<QWidget*> *history;
+    QStack<QWidget*> history;
     QList<QAction*> viewActions;
 
     // view widgets