[vlmc-devel] commit: Remove ugly code. (Ludovic Fauvet )

git at videolan.org git at videolan.org
Tue Apr 13 12:11:29 CEST 2010


vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Tue Apr 13 11:03:09 2010 +0200| [7e268b026ed717a4ddec736eec58c10505f131a5] | committer: Ludovic Fauvet 

Remove ugly code.

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

 src/Gui/DockWidgetManager.cpp |   27 ++++++---------------------
 src/Gui/DockWidgetManager.h   |    2 --
 2 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/src/Gui/DockWidgetManager.cpp b/src/Gui/DockWidgetManager.cpp
index 0302bee..239ff11 100644
--- a/src/Gui/DockWidgetManager.cpp
+++ b/src/Gui/DockWidgetManager.cpp
@@ -39,11 +39,11 @@ QDockWidget* DockWidgetManager::addDockedWidget( QWidget *widget,
                                        Qt::DockWidgetArea startArea)
 {
     if ( m_dockWidgets.contains( qs_name ) )
-        return  0;
+        return 0;
 
-    QDockWidget* dock = new QDockWidget( qs_name.toStdString().c_str(), m_mainWin );
+    QDockWidget* dock = new QDockWidget( qs_name, m_mainWin );
 
-    m_dockWidgets.insert(qs_name, dock);
+    m_dockWidgets.insert( qs_name, dock );
     dock->setWidget( widget );
     dock->setAllowedAreas( areas );
     dock->setFeatures( features );
@@ -67,23 +67,8 @@ DockWidgetManager::DockWidgetManager( QObject *parent )
 DockWidgetManager::~DockWidgetManager()
 {
     QList<QDockWidget*> widgets = m_dockWidgets.values();
-    QDockWidget* widget;
+    QDockWidget* dockWidget;
 
-    foreach(widget, widgets)
-    {
-        delete widget;
-    }
-}
-
-void DockWidgetManager::transLateWidgetTitle()
-{
-    QMap<QString, QDockWidget*>::iterator ed = m_dockWidgets.end();
-    QMap<QString, QDockWidget*>::iterator it;
-
-    for ( it = m_dockWidgets.begin() ; it != ed ; ++it )
-    {
-        QDockWidget *widget = it.value();
-        widget->setWindowTitle( QApplication::translate( "MainWindow",
-                                                         it.key().toStdString().c_str() ) );
-    }
+    foreach( dockWidget, widgets )
+        delete dockWidget;
 }
diff --git a/src/Gui/DockWidgetManager.h b/src/Gui/DockWidgetManager.h
index cfd78ad..e46d2a5 100644
--- a/src/Gui/DockWidgetManager.h
+++ b/src/Gui/DockWidgetManager.h
@@ -57,8 +57,6 @@ class DockWidgetManager : public QObject, public QSingleton<DockWidgetManager>
 
         MainWindow *m_mainWin;
         QMap<QString, QDockWidget*> m_dockWidgets;
-    public slots:
-        void transLateWidgetTitle();
 
         friend  class   QSingleton<DockWidgetManager>;
 };



More information about the Vlmc-devel mailing list