]> git.sesse.net Git - vlc/blobdiff - src/interface/interaction.c
Small cleanup
[vlc] / src / interface / interaction.c
index f0ebee540e2ac25667654b5798dd74c06441ccb9..91032368f85b6e532991d154cbfa867211e73118 100644 (file)
@@ -61,7 +61,6 @@ struct interaction_t
     int                         i_dialogs;      ///< Number of dialogs
     interaction_dialog_t      **pp_dialogs;     ///< Dialogs
     intf_thread_t              *p_intf;         ///< Interface to use
-    int                         i_last_id;      ///< Last attributed ID
 };
 
 static interaction_t *          InteractionGet( vlc_object_t * );
@@ -77,7 +76,7 @@ static int DialogSend( interaction_dialog_t * );
         if( !p_new ) return err;                        \
         p_new->p_parent = vlc_object_hold( p_this );    \
         p_new->b_cancelled = false;                     \
-        p_new->i_status = NEW_DIALOG;                   \
+        p_new->i_status = SENT_DIALOG;                  \
         p_new->i_flags = 0;                             \
         p_new->i_type = INTERACT_DIALOG_##type;         \
         p_new->psz_returned[0] = NULL;                  \
@@ -164,8 +163,7 @@ int __intf_UserYesNo( vlc_object_t *p_this,
     p_new->i_flags = DIALOG_YES_NO_CANCEL;
     p_new->psz_default_button = strdup( psz_default );
     p_new->psz_alternate_button = strdup( psz_alternate );
-    if( psz_other )
-        p_new->psz_other_button = strdup( psz_other );
+    p_new->psz_other_button = psz_other ? strdup( psz_other ) : NULL;
 
     return DialogSend( p_new );
 }
@@ -362,7 +360,6 @@ interaction_t * interaction_Init( libvlc_int_t *p_libvlc )
     p_interaction->i_dialogs = 0;
     p_interaction->pp_dialogs = NULL;
     p_interaction->p_intf = NULL;
-    p_interaction->i_last_id = 0;
 
     vlc_cond_init( &p_interaction->wait );
 
@@ -502,7 +499,12 @@ static int DialogSend( interaction_dialog_t *p_dialog )
         p_dialog->i_flags & DIALOG_BLOCKING_ERROR ||
         p_dialog->i_flags & DIALOG_NONBLOCKING_ERROR )
     {
+        vlc_value_t val;
+
         p_dialog->p_interaction = p_interaction;
+        p_dialog->i_action = INTERACT_NEW;
+        val.p_address = p_dialog;
+        var_Set( p_dialog->p_interface, "interaction", val );
 
         /* Check if we have already added this dialog */
         vlc_object_lock( p_interaction );
@@ -612,14 +614,6 @@ static void InteractionManage( interaction_t *p_interaction )
             i_index--;
             DialogDestroy( p_dialog );
             break;
-        case NEW_DIALOG:
-            /* This is truly a new dialog, send it. */
-
-            p_dialog->i_action = INTERACT_NEW;
-            val.p_address = p_dialog;
-            var_Set( p_dialog->p_interface, "interaction", val );
-            p_dialog->i_status = SENT_DIALOG;
-            break;
         }
     }
 }