]> 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 60e340de30a1899632dfc91954e4ec0f382d83e0..96e3f981f4e410d53d2b31c92fa0eeebde3b7f7f 100644 (file)
@@ -33,8 +33,7 @@
 #include <vlc_intf_strings.h>
 
 #include "pixmaps/type_unknown.xpm"
-#include "pixmaps/type_afile.xpm"
-#include "pixmaps/type_vfile.xpm"
+#include "pixmaps/type_file.xpm"
 #include "pixmaps/type_net.xpm"
 #include "pixmaps/type_card.xpm"
 #include "pixmaps/type_disc.xpm"
@@ -73,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" );
@@ -81,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( "" );
     }
 }
 
@@ -91,11 +89,11 @@ void PLItem::updateview( void )
 
     if( model->i_depth == 1 )  //left window for playlist etc.
     {
-        strings.append( qtr("") );   
+        strings.append( "" );
         return;
     }
 
-    for( int i_index=1; i_index <= VLC_META_ENGINE_MB_TRM_ID; i_index = i_index*2 )
+    for( int i_index=1; i_index <= VLC_META_ENGINE_ART_URL; i_index = i_index*2 )
     {
         if( i_showflags & i_index )
         {
@@ -195,7 +193,7 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
 
     if( model->i_depth == 1 )  //left window for playlist etc.
     {
-        strings.append( p_item->p_input->psz_name );
+        strings.append( qfu( p_item->p_input->psz_name ) );
         return;
     }
 
@@ -205,7 +203,7 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
       strings.append( qfu( psz_meta ) ); \
       free( psz_meta );
 
-    for( int i_index=1; i_index <= VLC_META_ENGINE_MB_TRM_ID; i_index = i_index * 2 )
+    for( int i_index=1; i_index <= VLC_META_ENGINE_ART_URL; i_index = i_index * 2 )
     {
         if( parentItem->i_showflags & i_index )
         {
@@ -231,7 +229,8 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
                     ADD_META( p_item, Description );
                     break;
                 case VLC_META_ENGINE_DURATION:
-                    secstotimestr( psz_duration, p_item->p_input->i_duration / 1000000 );
+                    secstotimestr( psz_duration,
+                        input_item_GetDuration( p_item->p_input ) / 1000000 );
                     strings.append( QString( psz_duration ) );
                     break;
                 case VLC_META_ENGINE_GENRE:
@@ -252,7 +251,6 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
 
     }
 #undef ADD_META
-
 }
 
 /*************************************************************************
@@ -260,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;
@@ -275,8 +273,7 @@ PLModel::PLModel( playlist_t *_p_playlist, intf_thread_t *_p_intf,
 
 #define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( QPixmap( type_##x##_xpm ) );
     ADD_ICON( UNKNOWN , unknown );
-    ADD_ICON( AFILE,afile );
-    ADD_ICON( VFILE, vfile );
+    ADD_ICON( FILE, file );
     ADD_ICON( DIRECTORY, directory );
     ADD_ICON( DISC, disc );
     ADD_ICON( CDDA, cdda );
@@ -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
  **********************************************************************/