Commit b7cf7dda authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt, menus: std::vector -> QVector

parent cfd14b54
...@@ -416,7 +416,7 @@ public: ...@@ -416,7 +416,7 @@ public:
virtual ~StringConfigControl(); virtual ~StringConfigControl();
virtual QString getValue(); virtual QString getValue();
private: private:
std::vector<ModuleCheckBox> checkboxes; QVector<ModuleCheckBox> checkboxes;
QLineEdit *text; QLineEdit *text;
private slot: private slot:
void OnUpdate(); void OnUpdate();
......
...@@ -200,15 +200,15 @@ static QAction * FindActionWithVar( QMenu *menu, const char *psz_var ) ...@@ -200,15 +200,15 @@ static QAction * FindActionWithVar( QMenu *menu, const char *psz_var )
/***************************************************************************** /*****************************************************************************
* Definitions of variables for the dynamic menus * Definitions of variables for the dynamic menus
*****************************************************************************/ *****************************************************************************/
#define PUSH_VAR( var ) varnames.push_back( var ); \ #define PUSH_VAR( var ) varnames.append( var ); \
objects.push_back( VLC_OBJECT(p_object) ) objects.append( VLC_OBJECT(p_object) )
#define PUSH_INPUTVAR( var ) varnames.push_back( var ); \ #define PUSH_INPUTVAR( var ) varnames.append( var ); \
objects.push_back( VLC_OBJECT(p_input) ); objects.append( VLC_OBJECT(p_input) );
static int InputAutoMenuBuilder( input_thread_t *p_object, static int InputAutoMenuBuilder( input_thread_t *p_object,
vector<vlc_object_t *> &objects, QVector<vlc_object_t *> &objects,
vector<const char *> &varnames ) QVector<const char *> &varnames )
{ {
PUSH_VAR( "bookmark" ); PUSH_VAR( "bookmark" );
PUSH_VAR( "title" ); PUSH_VAR( "title" );
...@@ -220,8 +220,8 @@ static int InputAutoMenuBuilder( input_thread_t *p_object, ...@@ -220,8 +220,8 @@ static int InputAutoMenuBuilder( input_thread_t *p_object,
static int VideoAutoMenuBuilder( vout_thread_t *p_object, static int VideoAutoMenuBuilder( vout_thread_t *p_object,
input_thread_t *p_input, input_thread_t *p_input,
vector<vlc_object_t *> &objects, QVector<vlc_object_t *> &objects,
vector<const char *> &varnames ) QVector<const char *> &varnames )
{ {
PUSH_INPUTVAR( "video-es" ); PUSH_INPUTVAR( "video-es" );
PUSH_INPUTVAR( "spu-es" ); PUSH_INPUTVAR( "spu-es" );
...@@ -245,8 +245,8 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object, ...@@ -245,8 +245,8 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object,
static int AudioAutoMenuBuilder( audio_output_t *p_object, static int AudioAutoMenuBuilder( audio_output_t *p_object,
input_thread_t *p_input, input_thread_t *p_input,
vector<vlc_object_t *> &objects, QVector<vlc_object_t *> &objects,
vector<const char *> &varnames ) QVector<const char *> &varnames )
{ {
PUSH_INPUTVAR( "audio-es" ); PUSH_INPUTVAR( "audio-es" );
PUSH_VAR( "audio-channels" ); PUSH_VAR( "audio-channels" );
...@@ -528,10 +528,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface ...@@ -528,10 +528,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface
**/ **/
QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current ) QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
{ {
vector<vlc_object_t *> objects; QVector<vlc_object_t *> objects;
vector<const char *> varnames; QVector<const char *> varnames;
varnames.push_back( "intf-add" ); varnames.append( "intf-add" );
objects.push_back( VLC_OBJECT(p_intf) ); objects.append( VLC_OBJECT(p_intf) );
return Populate( p_intf, current, varnames, objects ); return Populate( p_intf, current, varnames, objects );
} }
...@@ -565,8 +565,8 @@ void QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *extMenu ) ...@@ -565,8 +565,8 @@ void QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *extMenu )
**/ **/
QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current ) QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
{ {
vector<vlc_object_t *> objects; QVector<vlc_object_t *> objects;
vector<const char *> varnames; QVector<const char *> varnames;
audio_output_t *p_aout; audio_output_t *p_aout;
input_thread_t *p_input; input_thread_t *p_input;
...@@ -624,8 +624,8 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current, bool b_subtit ...@@ -624,8 +624,8 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current, bool b_subtit
{ {
vout_thread_t *p_vout; vout_thread_t *p_vout;
input_thread_t *p_input; input_thread_t *p_input;
vector<vlc_object_t *> objects; QVector<vlc_object_t *> objects;
vector<const char *> varnames; QVector<const char *> varnames;
if( current->isEmpty() ) if( current->isEmpty() )
{ {
...@@ -702,8 +702,8 @@ QMenu *QVLCMenu::RebuildNavigMenu( intf_thread_t *p_intf, QMenu *menu ) ...@@ -702,8 +702,8 @@ QMenu *QVLCMenu::RebuildNavigMenu( intf_thread_t *p_intf, QMenu *menu )
{ {
/* */ /* */
input_thread_t *p_object; input_thread_t *p_object;
vector<vlc_object_t *> objects; QVector<vlc_object_t *> objects;
vector<const char *> varnames; QVector<const char *> varnames;
/* Get the input and hold it */ /* Get the input and hold it */
p_object = THEMIM->getInput(); p_object = THEMIM->getInput();
...@@ -748,8 +748,8 @@ QMenu *QVLCMenu::HelpMenu( QWidget *parent ) ...@@ -748,8 +748,8 @@ QMenu *QVLCMenu::HelpMenu( QWidget *parent )
delete menu; menu = NULL; \ delete menu; menu = NULL; \
if( !show ) \ if( !show ) \
return; \ return; \
vector<vlc_object_t *> objects; \ QVector<vlc_object_t *> objects; \
vector<const char *> varnames; \ QVector<const char *> varnames; \
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
#define CREATE_POPUP \ #define CREATE_POPUP \
...@@ -914,7 +914,7 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -914,7 +914,7 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf, bool show )
if( p_input ) if( p_input )
{ {
varnames.push_back( "audio-es" ); varnames.append( "audio-es" );
InputAutoMenuBuilder( p_input, objects, varnames ); InputAutoMenuBuilder( p_input, objects, varnames );
menu->addSeparator(); menu->addSeparator();
} }
...@@ -1020,13 +1020,13 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -1020,13 +1020,13 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
vlc_object_t* p_object = p_intf->p_parent; vlc_object_t* p_object = p_intf->p_parent;
objects.clear(); varnames.clear(); objects.clear(); varnames.clear();
objects.push_back( p_object ); objects.append( p_object );
varnames.push_back( "intf-skins" ); varnames.append( "intf-skins" );
Populate( p_intf, submenu, varnames, objects ); Populate( p_intf, submenu, varnames, objects );
objects.clear(); varnames.clear(); objects.clear(); varnames.clear();
objects.push_back( p_object ); objects.append( p_object );
varnames.push_back( "intf-skins-interactive" ); varnames.append( "intf-skins-interactive" );
Populate( p_intf, submenu, varnames, objects ); Populate( p_intf, submenu, varnames, objects );
} }
else else
...@@ -1105,8 +1105,8 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, ...@@ -1105,8 +1105,8 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi,
*************************************************************************/ *************************************************************************/
QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu * QVLCMenu::Populate( intf_thread_t *p_intf,
QMenu *current, QMenu *current,
vector< const char *> & varnames, QVector< const char *> & varnames,
vector<vlc_object_t *> & objects ) QVector<vlc_object_t *> & objects )
{ {
QMenu *menu = current; QMenu *menu = current;
assert( menu ); assert( menu );
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <QObject> #include <QObject>
#include <QAction> #include <QAction>
#include <QMenu> #include <QMenu>
#include <vector> #include <QVector>
using namespace std; using namespace std;
...@@ -131,7 +131,7 @@ private: ...@@ -131,7 +131,7 @@ private:
/* Generic automenu methods */ /* Generic automenu methods */
static QMenu * Populate( intf_thread_t *, QMenu *current, static QMenu * Populate( intf_thread_t *, QMenu *current,
vector<const char*>&, vector<vlc_object_t *>& ); QVector<const char*>&, QVector<vlc_object_t *>& );
static void CreateAndConnect( QMenu *, const char *, const QString&, static void CreateAndConnect( QMenu *, const char *, const QString&,
const QString&, int, vlc_object_t *, const QString&, int, vlc_object_t *,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment