[vlc-devel] commit: qt4: change QIcon( QPixmap( x ) ) -> QIcon( x ) (Ilkka Ollakka )

git version control git at videolan.org
Thu Nov 5 20:59:49 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at iki.fi> | Thu Nov  5 21:40:44 2009 +0200| [8d266a98961fb789822e7c8403131b0c6b11ac6e] | committer: Ilkka Ollakka 

qt4: change QIcon( QPixmap( x ) ) -> QIcon( x )

Seemed to work just fine, and didn't find any reason to keep that form.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8d266a98961fb789822e7c8403131b0c6b11ac6e
---

 .../gui/qt4/components/complete_preferences.cpp    |    2 +-
 .../gui/qt4/components/playlist/playlist_model.cpp |    2 +-
 modules/gui/qt4/dialogs/vlm.cpp                    |   18 +++++++++---------
 modules/gui/qt4/main_interface.cpp                 |    4 ++--
 modules/gui/qt4/qt4.cpp                            |    4 ++--
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp
index cf3ff4f..f8dd3d8 100644
--- a/modules/gui/qt4/components/complete_preferences.cpp
+++ b/modules/gui/qt4/components/complete_preferences.cpp
@@ -61,7 +61,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
     setTextElideMode( Qt::ElideNone );
 
     /* Nice icons */
-#define BI( a,b) QIcon a##_icon = QIcon( QPixmap( b ))
+#define BI( a,b) QIcon a##_icon = QIcon( b )
     BI( audio, ":/prefsmenu/advanced/audio" );
     BI( video, ":/prefsmenu/advanced/video" );
     BI( input, ":/prefsmenu/advanced/codec" );
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 1cf0c87..235a94c 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -77,7 +77,7 @@ PLModel::PLModel( playlist_t *_p_playlist,  /* THEPL */
     rootItem          = NULL; /* PLItem rootItem, will be set in rebuild( ) */
 
     /* Icons initialization */
-#define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( QPixmap( x ) )
+#define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( x )
     ADD_ICON( UNKNOWN , type_unknown_xpm );
     ADD_ICON( FILE, ":/type/file" );
     ADD_ICON( DIRECTORY, ":/type/directory" );
diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp
index a542378..c0734d7 100644
--- a/modules/gui/qt4/dialogs/vlm.cpp
+++ b/modules/gui/qt4/dialogs/vlm.cpp
@@ -496,11 +496,11 @@ VLMAWidget::VLMAWidget( const QString& _name,
     objLayout->addWidget( time, 1, 3, 1, 2 );*/
 
     QToolButton *modifyButton = new QToolButton;
-    modifyButton->setIcon( QIcon( QPixmap( ":/menu/settings" ) ) );
+    modifyButton->setIcon( QIcon( ":/menu/settings" ) );
     objLayout->addWidget( modifyButton, 0, 5 );
 
     QToolButton *deleteButton = new QToolButton;
-    deleteButton->setIcon( QIcon( QPixmap( ":/menu/quit" ) ) );
+    deleteButton->setIcon( QIcon( ":/menu/quit" ) );
     objLayout->addWidget( deleteButton, 0, 6 );
 
     BUTTONACT( modifyButton, modify() );
@@ -537,12 +537,12 @@ VLMBroadcast::VLMBroadcast( const QString& _name, const QString& _input,
     b_looped = _looped;
 
     playButton = new QToolButton;
-    playButton->setIcon( QIcon( QPixmap( ":/menu/play" ) ) );
+    playButton->setIcon( QIcon( ":/menu/play" ) );
     objLayout->addWidget( playButton, 1, 0 );
     b_playing = true;
 
     QToolButton *stopButton = new QToolButton;
-    stopButton->setIcon( QIcon( QPixmap( ":/toolbar/stop_b" ) ) );
+    stopButton->setIcon( QIcon( ":/toolbar/stop_b" ) );
     objLayout->addWidget( stopButton, 1, 1 );
 
     loopButton = new QToolButton;
@@ -559,9 +559,9 @@ void VLMBroadcast::update()
 {
     VLMWrapper::EditBroadcast( name, input, output, b_enabled, b_looped );
     if( b_looped )
-        loopButton->setIcon( QIcon( QPixmap( ":/buttons/playlist/repeat_all" ) ) );
+        loopButton->setIcon( QIcon( ":/buttons/playlist/repeat_all" ) );
     else
-        loopButton->setIcon( QIcon( QPixmap( ":/buttons/playlist/repeat_off" ) ) );
+        loopButton->setIcon( QIcon( ":/buttons/playlist/repeat_off" ) );
 }
 
 void VLMBroadcast::togglePlayPause()
@@ -569,12 +569,12 @@ void VLMBroadcast::togglePlayPause()
     if( b_playing )
     {
         VLMWrapper::ControlBroadcast( name, ControlBroadcastPause );
-        playButton->setIcon( QIcon( QPixmap( ":/menu/pause" ) ) );
+        playButton->setIcon( QIcon( ":/menu/pause" ) );
     }
     else
     {
         VLMWrapper::ControlBroadcast( name, ControlBroadcastPlay );
-        playButton->setIcon( QIcon( QPixmap( ":/menu/play" ) ) );
+        playButton->setIcon( QIcon( ":/menu/play" ) );
     }
     b_playing = !b_playing;
 }
@@ -588,7 +588,7 @@ void VLMBroadcast::toggleLoop()
 void VLMBroadcast::stop()
 {
     VLMWrapper::ControlBroadcast( name, ControlBroadcastStop );
-    playButton->setIcon( QIcon( QPixmap( ":/menu/play" ) ) );
+    playButton->setIcon( QIcon( ":/menu/play" ) );
 }
 
 /****************
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 40a8722..a967e06 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -1111,9 +1111,9 @@ void MainInterface::createSystray()
 {
     QIcon iconVLC;
     if( QDate::currentDate().dayOfYear() >= 354 )
-        iconVLC =  QIcon( QPixmap( ":/logo/vlc128-christmas.png" ) );
+        iconVLC =  QIcon( ":/logo/vlc128-christmas.png" );
     else
-        iconVLC =  QIcon( QPixmap( ":/logo/vlc128.png" ) );
+        iconVLC =  QIcon( ":/logo/vlc128.png" );
     sysTray = new QSystemTrayIcon( iconVLC, this );
     sysTray->setToolTip( qtr( "VLC media player" ));
 
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 5c298df..92be217 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -381,9 +381,9 @@ static void *Thread( void *obj )
 
     /* Icon setting */
     if( QDate::currentDate().dayOfYear() >= 352 ) /* One Week before Xmas */
-        app.setWindowIcon( QIcon( QPixmap(vlc_christmas_xpm) ) );
+        app.setWindowIcon( QIcon(vlc_christmas_xpm) );
     else
-        app.setWindowIcon( QIcon( QPixmap(vlc_xpm) ) );
+        app.setWindowIcon( QIcon(vlc_xpm) );
 
     /* Initialize timers and the Dialog Provider */
     DialogsProvider::getInstance( p_intf );




More information about the vlc-devel mailing list