]> git.sesse.net Git - vlc/blobdiff - plugins/kde/kde_preferences.cpp
* ALL: new module API. Makes a few things a lot simpler, and we gain
[vlc] / plugins / kde / kde_preferences.cpp
index a08908edfd70db785b6f92c0af73c4f0306c548f..523886e663ad13b6ec53590e5bc13c6b381fc633 100644 (file)
@@ -37,11 +37,11 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
     this->p_intf = p_intf;
 
     /* Look for the selected module */
-    for( p_module = p_intf->p_vlc->module_bank.first ; p_module != NULL ;
+    for( p_module = p_intf->p_vlc->p_module_bank->first ; p_module != NULL ;
          p_module = p_module->next )
     {
 
-        if( psz_module_name && !strcmp( psz_module_name, p_module->psz_name ) )
+        if( psz_module_name && !strcmp( psz_module_name, p_module->psz_object_name ) )
             break;
     }
     if( !p_module ) return;
@@ -51,13 +51,13 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
         switch( p_item->i_type )
         {
 
-        case MODULE_CONFIG_HINT_CATEGORY:
-        case MODULE_CONFIG_HINT_END:
+        case CONFIG_HINT_CATEGORY:
+        case CONFIG_HINT_END:
 
             /*
              * Now we can start taking care of the new category
              */
-            if( p_item->i_type == MODULE_CONFIG_HINT_CATEGORY )
+            if( p_item->i_type == CONFIG_HINT_CATEGORY )
             {
                 category_label = new QString( p_item->psz_text );
                 QFrame *page = addPage( *category_label );
@@ -74,7 +74,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
 
             break;
 
-        case MODULE_CONFIG_ITEM_MODULE:
+        case CONFIG_ITEM_MODULE:
 
             {
                 
@@ -95,21 +95,23 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
                 
                 /* build a list of available plugins */
                 
-                for( p_module_bis = p_intf->p_vlc->module_bank.first ;
+#if 0 /* FIXME */
+                for( p_module_bis = p_intf->p_vlc->p_module_bank->first ;
                      p_module_bis != NULL ;
                      p_module_bis = p_module_bis->next ) {
                     if( p_module_bis->i_capabilities & (1 << p_item->i_value)){
                         new QListViewItem(item_frame->getListView(),
-                                          p_module_bis->psz_name,
+                                          p_module_bis->psz_object_name,
                                           p_module_bis->psz_longname);
                     }
                 }
+#endif
                 vlc_mutex_unlock( p_item->p_lock );
             }
             break;
 
-        case MODULE_CONFIG_ITEM_STRING:
-        case MODULE_CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_FILE:
 
             {
                 QHBox *hb = new QHBox(category_table);
@@ -134,7 +136,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
             }
             break;
 
-        case MODULE_CONFIG_ITEM_INTEGER:
+        case CONFIG_ITEM_INTEGER:
             /* add input box with default value */
             {
                 QHBox *hb = new QHBox(category_table);
@@ -151,7 +153,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
             }
             break;
 
-        case MODULE_CONFIG_ITEM_FLOAT:
+        case CONFIG_ITEM_FLOAT:
             {
                 QHBox *hb = new QHBox(category_table);
                 hb->setSpacing(spacingHint());
@@ -169,7 +171,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
             break;
                                                   
                 
-        case MODULE_CONFIG_ITEM_BOOL:
+        case CONFIG_ITEM_BOOL:
 
             /* add check button */
             {
@@ -190,7 +192,7 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
 
         p_item++;
     }
-    while( p_item->i_type != MODULE_CONFIG_HINT_END );
+    while( p_item->i_type != CONFIG_HINT_END );
     exec();
     
 }
@@ -208,10 +210,10 @@ KPreferences::~KPreferences()
 bool KPreferences::isConfigureable(QString module)
 {
     module_t *p_module;
-    for( p_module = p_intf->p_vlc->module_bank.first ;
+    for( p_module = p_intf->p_vlc->p_module_bank->first ;
          p_module != NULL ;
          p_module = p_module->next ) {
-        if( !module.compare( p_module->psz_name ) ) {
+        if( !module.compare( p_module->psz_object_name ) ) {
             return p_module->i_config_items != 0;
         }
     }
@@ -236,9 +238,9 @@ void KPreferences::slotApply()
 
         switch( p_config->getType() ) {
 
-        case MODULE_CONFIG_ITEM_STRING:
-        case MODULE_CONFIG_ITEM_FILE:
-        case MODULE_CONFIG_ITEM_MODULE:
+        case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_MODULE:
             if (p_config->sValue()) {
                 config_PutPsz( p_intf, p_config->name(),
                                strdup(p_config->sValue().latin1()));
@@ -247,11 +249,11 @@ void KPreferences::slotApply()
                 config_PutPsz( p_intf, p_config->name(), NULL );
             }
             break;
-        case MODULE_CONFIG_ITEM_INTEGER:
-        case MODULE_CONFIG_ITEM_BOOL:
+        case CONFIG_ITEM_INTEGER:
+        case CONFIG_ITEM_BOOL:
             config_PutInt( p_intf, p_config->name(), p_config->iValue() );
             break;
-        case MODULE_CONFIG_ITEM_FLOAT:
+        case CONFIG_ITEM_FLOAT:
             config_PutFloat( p_intf, p_config->name(), p_config->fValue() );
             break;
         }