From 684cafc46a709fa405c52da4f100e9f1571428c9 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Wed, 5 Sep 2007 15:32:06 +0000 Subject: [PATCH] Qt4 - Cleanup and start code to get the possibility on Windows to open the containing folder... --- modules/gui/qt4/playlist_model.cpp | 40 +++++++++--------------------- modules/gui/qt4/playlist_model.hpp | 5 +--- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/modules/gui/qt4/playlist_model.cpp b/modules/gui/qt4/playlist_model.cpp index 0bbe46ff15..aa7677f6e8 100644 --- a/modules/gui/qt4/playlist_model.cpp +++ b/modules/gui/qt4/playlist_model.cpp @@ -251,7 +251,6 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent ) } #undef ADD_META - } /************************************************************************* @@ -259,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; @@ -969,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() ) ); } - // 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 );*/ +#ifdef WIN32 + menu->addSeparator(); + menu->addAction( qfu( I_POP_EXPLORE ), this SLOT( popupExplore() ) ); +#endif menu->popup( point ); } else @@ -1095,6 +1072,13 @@ void PLModel::popupSave() fprintf( stderr, "Save not implemented\n" ); } +#ifdef WIN32 +void PLModel::popupExplore() +{ + ShellExecuteW(NULL, L"explore", L"C:\\", NULL, NULL, SW_SHOWNORMAL ); +} +#endif + /********************************************************************** * Playlist callbacks **********************************************************************/ diff --git a/modules/gui/qt4/playlist_model.hpp b/modules/gui/qt4/playlist_model.hpp index 981acf2f33..3b6d3d33c9 100644 --- a/modules/gui/qt4/playlist_model.hpp +++ b/modules/gui/qt4/playlist_model.hpp @@ -142,10 +142,7 @@ public: void sendArt( QString url ); void removeArt( ); - int shownFlags() - { - return rootItem->i_showflags; - } + int shownFlags() { return rootItem->i_showflags; } private: void addCallbacks(); void delCallbacks(); -- 2.39.5