]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/playlist_model.cpp
Removes trailing spaces. Removes tabs.
[vlc] / modules / gui / qt4 / playlist_model.cpp
index ddd4eb707eea777a94f40e5f132bfe58a8da46f1..96e3f981f4e410d53d2b31c92fa0eeebde3b7f7f 100644 (file)
@@ -72,7 +72,6 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m)
     i_id = _i_id; i_input_id = _i_input_id;
     model = m;
 
-
     if( parentItem == NULL )
     {
         i_showflags = config_GetInt( model->p_intf , "qt-pl-showflags" );
@@ -80,7 +79,7 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m)
     } else {
         i_showflags = parentItem->i_showflags;
         //Add empty string and update() handles data appending
-        strings.append( qtr("") );
+        strings.append( "" );
     }
 }
 
@@ -90,7 +89,7 @@ void PLItem::updateview( void )
 
     if( model->i_depth == 1 )  //left window for playlist etc.
     {
-        strings.append( qtr("") );
+        strings.append( "" );
         return;
     }
 
@@ -194,8 +193,7 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
 
     if( model->i_depth == 1 )  //left window for playlist etc.
     {
-        const QString psz_name = QString::fromUtf8( p_item->p_input->psz_name );
-        strings.append( psz_name );
+        strings.append( qfu( p_item->p_input->psz_name ) );
         return;
     }
 
@@ -253,7 +251,6 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
 
     }
 #undef ADD_META
-
 }
 
 /*************************************************************************
@@ -261,7 +258,7 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
  *************************************************************************/
 
 PLModel::PLModel( playlist_t *_p_playlist, intf_thread_t *_p_intf,
-                  playlist_item_t * p_root, int _i_depth, QObject *parent)
+                    playlist_item_t * p_root, int _i_depth, QObject *parent)
                                     : QAbstractItemModel(parent)
 {
     i_depth = _i_depth;
@@ -290,7 +287,6 @@ PLModel::PLModel( playlist_t *_p_playlist, intf_thread_t *_p_intf,
     rebuild( p_root );
 }
 
-
 PLModel::~PLModel()
 {
     delCallbacks();
@@ -972,32 +968,10 @@ void PLModel::popup( QModelIndex & index, QPoint &point, QModelIndexList list )
             menu->addAction( qfu(I_POP_SORT), this, SLOT( popupSort() ) );
             menu->addAction( qfu(I_POP_ADD), this, SLOT( popupAdd() ) );
         }
+#ifdef WIN32
         menu->addSeparator();
-
-        ContextUpdateMapper = new QSignalMapper(this);
-
-        QMenu *selectColMenu = new QMenu( qtr("Show columns") );
-
-#define ADD_META_ACTION( meta ) { \
-   QAction* option = selectColMenu->addAction( qfu(VLC_META_##meta) );     \
-   option->setCheckable( true );                                           \
-   option->setChecked( rootItem->i_showflags & VLC_META_ENGINE_##meta );   \
-   ContextUpdateMapper->setMapping( option, VLC_META_ENGINE_##meta );      \
-   CONNECT( option, triggered(), ContextUpdateMapper, map() );             \
-   }
-        CONNECT(ContextUpdateMapper, mapped( int ), this, viewchanged( int ) );
-
-        ADD_META_ACTION( TITLE );
-        ADD_META_ACTION( ARTIST );
-        ADD_META_ACTION( DURATION );
-        ADD_META_ACTION( COLLECTION );
-        ADD_META_ACTION( GENRE );
-        ADD_META_ACTION( SEQ_NUM );
-        ADD_META_ACTION( RATING );
-        ADD_META_ACTION( DESCRIPTION );
-
-#undef ADD_META_ACTION
-        menu->addMenu( selectColMenu );
+        menu->addAction( qfu( I_POP_EXPLORE ), this, SLOT( popupExplore() ) );
+#endif
         menu->popup( point );
     }
     else
@@ -1098,6 +1072,14 @@ void PLModel::popupSave()
     fprintf( stderr, "Save not implemented\n" );
 }
 
+#ifdef WIN32
+#include <shellapi.h>
+void PLModel::popupExplore()
+{
+    ShellExecuteW(NULL, L"explore", L"C:\\", NULL, NULL, SW_SHOWNORMAL );
+}
+#endif
+
 /**********************************************************************
  * Playlist callbacks
  **********************************************************************/