]> git.sesse.net Git - vlc/commitdiff
Remove configuration item actions for now
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 19 Aug 2012 17:37:40 +0000 (20:37 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 19 Aug 2012 21:07:11 +0000 (00:07 +0300)
This hinders the following commits. This was only used in a single
plugin on a single platform, and was poorly designed.

include/vlc_configuration.h
include/vlc_plugin.h
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.hpp
src/config/core.c
src/modules/cache.c
src/modules/entry.c

index 30e309e474f5d1574cb69c7d164b04684ca88bf8..883712955a9c5bd99b9cc642ecb44dd16faebc67 100644 (file)
@@ -76,11 +76,6 @@ struct module_config_t
     unsigned    b_unsaveable:1;               /* Config should not be saved */
     unsigned    b_safe:1;       /* Safe to use in web plugins and playlists */
 
-    /* Actions list */
-    int            i_action;                           /* actions list size */
-    vlc_callback_t *ppf_action;    /* List of possible actions for a config */
-    char          **ppsz_action_text;         /* Friendly names for actions */
-
     /* Deprecated */
     bool        b_removed;
 };
index b8cece448b40f18b3901a62dd3b9e07d6047ac4b..49adb532edf14dae5ea2be2b14339bab091d6b2b 100644 (file)
@@ -95,9 +95,8 @@ enum vlc_module_properties
     /* possible values list
      * (args=const char *, size_t, const <type> *, const char *const *) */
 
-    VLC_CONFIG_ADD_ACTION,
-    /* add value change callback
-     * (args=const char *, vlc_callback_t, const char *) */
+    VLC_CONFIG_ADD_ACTION_OBSOLETE,
+    /* unused (ignored) */
 
     /* Insert new VLC_CONFIG_* here */
 };
@@ -494,8 +493,7 @@ VLC_METADATA_EXPORTS
     vlc_config_set (VLC_CONFIG_RANGE, (double)(minv), (double)(maxv));
 
 #define change_action_add( pf_action, text ) \
-    vlc_config_set (VLC_CONFIG_ADD_ACTION, \
-                    (vlc_callback_t)(pf_action), (const char *)(text));
+    (void)(pf_action, text);
 
 /* For options that are saved but hidden from the preferences panel */
 #define change_private() \
index 16106f52aaf38479ca43ba343acde24027849305..1b08f4474380437e4a2ee77be95575e835556dae 100644 (file)
@@ -25,7 +25,6 @@
 
 /**
  * Todo:
- *  - i_action handler for IntegerLists, but I don't see any module using it...
  *  - Validator for modulelist
  */
 #ifdef HAVE_CONFIG_H
@@ -394,23 +393,6 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
     module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
 
     finish( p_module_config );
-
-    if( p_item->i_action )
-    {
-        QSignalMapper *signalMapper = new QSignalMapper(this);
-
-        /* Some stringLists like Capture listings have action associated */
-        for( int i = 0; i < p_item->i_action; i++ )
-        {
-            QPushButton *button =
-                new QPushButton( qtr( p_item->ppsz_action_text[i] ), p );
-            buttons << button;
-            CONNECT( button, clicked(), signalMapper, map() );
-            signalMapper->setMapping( button, i );
-        }
-        CONNECT( signalMapper, mapped( int ),
-                this, actionRequested( int ) );
-    }
 }
 
 void StringListConfigControl::fillGrid( QGridLayout *l, int line )
@@ -419,7 +401,7 @@ void StringListConfigControl::fillGrid( QGridLayout *l, int line )
     l->addWidget( combo, line, LAST_COLUMN, Qt::AlignRight );
     int i = 0;
     foreach( QPushButton *button, buttons )
-        l->addWidget( button, line, LAST_COLUMN - p_item->i_action + i++,
+        l->addWidget( button, line, LAST_COLUMN + i++,
                       Qt::AlignRight );
 }
 
@@ -429,24 +411,6 @@ void StringListConfigControl::comboIndexChanged( int i_index )
     emit changed();
 }
 
-void StringListConfigControl::actionRequested( int i_action )
-{
-    /* Supplementary check for boundaries */
-    if( i_action < 0 || i_action >= p_item->i_action ) return;
-
-    module_config_t *p_module_config = config_FindConfig( p_this, getName() );
-    if(!p_module_config) return;
-
-    vlc_value_t val;
-    val.psz_string = const_cast<char *>
-        qtu( (combo->itemData( combo->currentIndex() ).toString() ) );
-
-    p_module_config->ppf_action[i_action]( p_this, getName(), val, val, 0 );
-
-    combo->clear();
-    finish( p_module_config );
-}
-
 StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
                 module_config_t *_p_item, QLabel *_label, QComboBox *_combo,
                 bool ) : VStringConfigControl( _p_this, _p_item )
@@ -910,24 +874,6 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
     module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
 
     finish( p_module_config );
-
-    if( p_item->i_action )
-    {
-        QSignalMapper *signalMapper = new QSignalMapper(this);
-
-        /* Some stringLists like Capture listings have action associated */
-        for( int i = 0; i < p_item->i_action; i++ )
-        {
-            QPushButton *button =
-                    new QPushButton( qfu( p_item->ppsz_action_text[i] ), p );
-            buttons << button;
-            CONNECT( button, clicked(), signalMapper, map() );
-            signalMapper->setMapping( button, i );
-        }
-        CONNECT( signalMapper, mapped( int ),
-                this, actionRequested( int ) );
-    }
-
 }
 
 void IntegerListConfigControl::fillGrid( QGridLayout *l, int line )
@@ -936,7 +882,7 @@ void IntegerListConfigControl::fillGrid( QGridLayout *l, int line )
     l->addWidget( combo, line, LAST_COLUMN, Qt::AlignRight );
     int i = 0;
     foreach( QPushButton *button, buttons )
-        l->addWidget( button, line, LAST_COLUMN - p_item->i_action + i++,
+        l->addWidget( button, line, LAST_COLUMN + i++,
                       Qt::AlignRight );
 }
 
@@ -982,24 +928,6 @@ void IntegerListConfigControl::finish(module_config_t *p_module_config )
         label->setBuddy( combo );
 }
 
-void IntegerListConfigControl::actionRequested( int i_action )
-{
-    /* Supplementary check for boundaries */
-    if( i_action < 0 || i_action >= p_item->i_action ) return;
-
-    module_config_t *p_module_config = config_FindConfig( p_this, getName() );
-    if(!p_module_config) return;
-
-
-    vlc_value_t val;
-    val.i_int = combo->itemData( combo->currentIndex() ).toInt();
-
-    p_module_config->ppf_action[i_action]( p_this, getName(), val, val, 0 );
-
-    combo->clear();
-    finish( p_module_config );
-}
-
 int IntegerListConfigControl::getValue() const
 {
     return combo->itemData( combo->currentIndex() ).toInt();
index 6a2180bfd58a72511aa02b6d302d40802c75c132..ba67a770eb4424f746ba9c0def2653a2a418e56c 100644 (file)
@@ -196,9 +196,6 @@ private:
     QLabel *label;
     QComboBox *combo;
     QList<QPushButton *> buttons;
-private slots:
-    void actionRequested( int );
-
 };
 
 class BoolConfigControl : public VIntConfigControl
@@ -456,7 +453,6 @@ private:
     QLabel *label;
     QList<QPushButton *> buttons;
 private slots:
-    void actionRequested( int );
     void comboIndexChanged( int );
 };
 
index d2795a5cd0c6738951cb3f63c4834de3d23943e7..72a7b453d69531485a1d1e02ed57f05e165e9ef3 100644 (file)
@@ -550,14 +550,6 @@ void config_Free (module_config_t *config, size_t confsize)
         free( p_item->ppsz_list );
         free( p_item->ppsz_list_text );
         free( p_item->pi_list );
-
-        if( p_item->i_action )
-        {
-            for (int i = 0; i < p_item->i_action; i++)
-                free( p_item->ppsz_action_text[i] );
-            free( p_item->ppf_action );
-            free( p_item->ppsz_action_text );
-        }
     }
 
     free (config);
index 8075e4f60847b9dbaf7ca5e495fd96e42f66997e..d1cd9159d6c0273a051d7ca07016a7ab9c427626 100644 (file)
@@ -341,20 +341,6 @@ static int CacheLoadConfig( module_t *p_module, FILE *file )
                       xmalloc( p_module->p_config[i].i_list * sizeof(char *) );
         for( int j = 0; j < p_module->p_config[i].i_list; j++ )
             LOAD_STRING( p_module->p_config[i].ppsz_list_text[j] );
-
-        if( p_module->p_config[i].i_action )
-        {
-            p_module->p_config[i].ppf_action =
-                xmalloc( p_module->p_config[i].i_action * sizeof(void *) );
-            p_module->p_config[i].ppsz_action_text =
-                xmalloc( p_module->p_config[i].i_action * sizeof(char *) );
-
-            for (int j = 0; j < p_module->p_config[i].i_action; j++)
-            {
-                p_module->p_config[i].ppf_action[j] = NULL;
-                LOAD_STRING( p_module->p_config[i].ppsz_action_text[j] );
-            }
-        }
     }
 
     return VLC_SUCCESS;
@@ -551,9 +537,6 @@ static int CacheSaveConfig (FILE *file, const module_t *p_module)
 
         for (int j = 0; j < p_module->p_config[i].i_list; j++)
             SAVE_STRING( p_module->p_config[i].ppsz_list_text[j] );
-
-        for (int j = 0; j < p_module->p_config[i].i_action; j++)
-            SAVE_STRING( p_module->p_config[i].ppsz_action_text[j] );
     }
     return 0;
 
index 2865a3d25531f9892de238c71fd7d048b05f4e52..a23ea6a436eb0bfd33535d0f94c4462c7d87f0ad 100644 (file)
@@ -423,36 +423,6 @@ static int vlc_plugin_setter (void *plugin, void *tgt, int propid, ...)
             break;
         }
 
-        case VLC_CONFIG_ADD_ACTION:
-        {
-            vlc_callback_t cb = va_arg (ap, vlc_callback_t), *tabcb;
-            const char *name = va_arg (ap, const char *);
-            char **tabtext;
-
-            tabcb = realloc (item->ppf_action,
-                             (item->i_action + 2) * sizeof (cb));
-            if (tabcb == NULL)
-                break;
-            item->ppf_action = tabcb;
-            tabcb[item->i_action] = cb;
-            tabcb[item->i_action + 1] = NULL;
-
-            tabtext = realloc (item->ppsz_action_text,
-                               (item->i_action + 2) * sizeof (name));
-            if (tabtext == NULL)
-                break;
-            item->ppsz_action_text = tabtext;
-
-            if (name)
-                tabtext[item->i_action] = strdup (name);
-            else
-                tabtext[item->i_action] = NULL;
-            tabtext[item->i_action + 1] = NULL;
-
-            item->i_action++;
-            break;
-        }
-
         default:
             fprintf (stderr, "LibVLC: unknown module property %d\n", propid);
             fprintf (stderr, "LibVLC: too old to use this module?\n");