[vlmc-devel] commit: About.cpp: Fix retranslation event bug and apply HACKINGS. ( Rohit Yadav )

git at videolan.org git at videolan.org
Wed Oct 6 02:56:36 CEST 2010


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Wed Oct  6 06:38:44 2010 +0530| [e41e70d15f2da1fd736d7584c5a2b13d228dae86] | committer: Rohit Yadav 

About.cpp: Fix retranslation event bug and apply HACKINGS.
Problem: If we're using any variables (in constructor) to set text
in a QLabel (of a ui file) using %1, %2...%n and then if we change
the locale from the "preferences", all those string which are translated
will set the %1...%n as such so fix this behaviour;

NOTES: PL. APPLY this kind of rectification in any other file.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=e41e70d15f2da1fd736d7584c5a2b13d228dae86
---

 src/Gui/About.cpp |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/Gui/About.cpp b/src/Gui/About.cpp
index 4af9532..19baf5e 100644
--- a/src/Gui/About.cpp
+++ b/src/Gui/About.cpp
@@ -44,32 +44,44 @@ About::About( QWidget *parent ) : QDialog( parent )
         "cross-platform, non-linear video editing software based on the VLC "
         "Media Player.\n" ) );
 
-    m_ui.labelTitle->setText( 
+    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.labelBuild->text().arg( HOSTNAME, SYSNAME,
+                                     QT_VERSION_STR, qVersion() ) );
 
-    m_ui.labelCopyright->setText( 
-        m_ui.labelCopyright->text().arg( PROJECT_COPYRIGHT, PROJECT_CONTACT, ORG_WEBSITE ) );
+    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 )
+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 About::setText( const QString& filename, QPlainTextEdit* widget )
+void
+About::setText( const QString& filename, QPlainTextEdit* widget )
 {
     QFile file( filename );
 



More information about the Vlmc-devel mailing list