[vlc-devel] [PATCH 6/6] Comments deleted. Empty lines deleted.
Martin Zeman
dileptor at gmail.com
Sat Mar 9 00:17:24 CET 2013
---
modules/gui/qt4/components/playlist/playlist.cpp | 3 +-
.../gui/qt4/components/playlist/standardpanel.cpp | 61 +++++++++-----------
2 files changed, 29 insertions(+), 35 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index 4138f3f..daf6948 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -128,8 +128,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
shuffleButton->setIcon(QIcon( ":/buttons/playlist/shuffle_playlist"));
shuffleButton->setToolTip( qtr("Shuffle the playlist") );
topbarLayout->addWidget( shuffleButton );
-
- CONNECT( shuffleButton, clicked(), mainView, shufflePlaylist() ); /* cycleViews will be replaced by the shuffle method*/
+ CONNECT( shuffleButton, clicked(), mainView, shufflePlaylist() );
/* Search */
searchEdit = new SearchLineEdit( this );
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 6004e1a..adc4e72 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -724,42 +724,37 @@ void StandardPLPanel::shufflePlaylist()
i_max = strlen(p_item->psz_uri) > i_max ? strlen(p_item->psz_uri) : i_max;
}
-
-
-
if( i_rowCount > 1 )
{
-
char shuffle[i_rowCount][i_max + 1];
- QModelIndexList l;
- for( int i = 0; i < i_rowCount; i++)
- {
- QModelIndex indexrecord = p_plModel->index( i, 0, QModelIndex() );
- input_item_t * p_item = p_plModel->getInputItem(indexrecord);
- strcpy( shuffle[i], p_item->psz_uri );
- l.append( indexrecord );
- }
- p_plModel->doDelete(l);
-
- srand( time(NULL) );
- char psz_tmp[i_max + 1];
- int i_limit = RAND_MAX - RAND_MAX % i_rowCount;
- int i_j;
- for( int i = i_rowCount-1; i > 0; i--)
- {
- do
- {
- i_j = rand();
- } while (i_j >= i_limit);
- i_j %= i_rowCount;
- strcpy( psz_tmp, shuffle[i_j] );
- strcpy( shuffle[i_j], shuffle[i] );
- strcpy( shuffle[i], psz_tmp );
- }
- for( int i = 0; i < i_rowCount; i++)
- {
- playlist_Add( THEPL, shuffle[i], NULL, PLAYLIST_APPEND, PLAYLIST_END, true,false );
- }
+ QModelIndexList l;
+ for( int i = 0; i < i_rowCount; i++)
+ {
+ QModelIndex indexrecord = p_plModel->index( i, 0, QModelIndex() );
+ input_item_t * p_item = p_plModel->getInputItem(indexrecord);
+ strcpy( shuffle[i], p_item->psz_uri );
+ l.append( indexrecord );
+ }
+ p_plModel->doDelete(l);
+ srand( time(NULL) );
+ char psz_tmp[i_max + 1];
+ int i_limit = RAND_MAX - RAND_MAX % i_rowCount;
+ int i_j;
+ for( int i = i_rowCount-1; i > 0; i--)
+ {
+ do
+ {
+ i_j = rand();
+ } while (i_j >= i_limit);
+ i_j %= i_rowCount;
+ strcpy( psz_tmp, shuffle[i_j] );
+ strcpy( shuffle[i_j], shuffle[i] );
+ strcpy( shuffle[i], psz_tmp );
+ }
+ for( int i = 0; i < i_rowCount; i++)
+ {
+ playlist_Add( THEPL, shuffle[i], NULL, PLAYLIST_APPEND, PLAYLIST_END, true,false );
+ }
}
}
--
1.7.9.5
More information about the vlc-devel
mailing list