[vlmc-devel] About: Don't make the about window a singleton

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 29 01:06:34 CET 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Feb 28 19:12:53 2016 +0100| [9988f26d43ba2ce037ad423b49159907091e60c2] | committer: Hugo Beauzée-Luyssen

About: Don't make the about window a singleton

> https://code.videolan.org/videolan/vlmc/commit/9988f26d43ba2ce037ad423b49159907091e60c2
---

 src/Gui/About.cpp      | 24 ------------------------
 src/Gui/About.h        |  9 +++------
 src/Gui/MainWindow.cpp |  3 ++-
 3 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/src/Gui/About.cpp b/src/Gui/About.cpp
index b703cfc..ab99fcf 100644
--- a/src/Gui/About.cpp
+++ b/src/Gui/About.cpp
@@ -50,30 +50,6 @@ About::About( QWidget *parent ) : QDialog( parent )
     m_ui.labelCopyright->setText(
         m_ui.labelCopyright->text().arg( PROJECT_COPYRIGHT, PROJECT_CONTACT,
                                          ORG_WEBSITE ) );
-
-    connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( deleteLater() ) );
-}
-
-void
-About::changeEvent( QEvent *e )
-{
-    QDialog::changeEvent( e );
-    switch ( e->type() )
-    {
-        case QEvent::LanguageChange:
-            m_ui.retranslateUi( this );
-            m_ui.labelTitle->setText(
-                m_ui.labelTitle->text().arg( PROJECT_VERSION, CODENAME ) );
-            m_ui.labelBuild->setText(
-                m_ui.labelBuild->text().arg( HOSTNAME, SYSNAME,
-                                             QT_VERSION_STR, qVersion() ) );
-            m_ui.labelCopyright->setText(
-                m_ui.labelCopyright->text().arg( PROJECT_COPYRIGHT,
-                                                 PROJECT_CONTACT, ORG_WEBSITE ) );
-            break;
-        default:
-            break;
-    }
 }
 
 void
diff --git a/src/Gui/About.h b/src/Gui/About.h
index 6d3c229..743c2aa 100644
--- a/src/Gui/About.h
+++ b/src/Gui/About.h
@@ -31,18 +31,15 @@
 
 class QPlainTextEdit;
 
-class About : public QDialog, public QSingleton<About>
+class About : public QDialog
 {
     Q_OBJECT
     Q_DISABLE_COPY( About )
 
-    friend class    QSingleton<About>;
-
-protected:
-    virtual void    changeEvent( QEvent *e );
+public:
+    explicit        About( QWidget *parent = 0 );
 
 private:
-    explicit        About( QWidget *parent = 0 );
     void            setText( const QString& filename, QPlainTextEdit* widget );
     Ui::AboutVLMC   m_ui;
 };
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 0f3ca77..247362a 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -566,7 +566,8 @@ MainWindow::on_actionPreferences_triggered()
 void
 MainWindow::on_actionAbout_triggered()
 {
-    About::getInstance()->exec();
+    About about( this );
+    about.exec();
 }
 
 bool



More information about the Vlmc-devel mailing list