[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kjsembed
Subject:    [kjsembed] KDE/kdebindings/kjsembed
From:       Ian Reinhart Geiser <geiseri () kde ! org>
Date:       2005-09-11 0:35:40
Message-ID: 1126398940.527148.20407.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 459471 by geiseri:

For some reason QListBox::removeItem(...) was in the enums but not in the exported
methods.  This should fix that and now you can remove items from the listbox.

CCMAIL: Matej Cepl <ceplm@seznam.cz> 


 M  +19 -0     customobject_imp.cpp  
 M  +2 -1      customobject_imp.h  


--- trunk/KDE/kdebindings/kjsembed/customobject_imp.cpp #459470:459471
@@ -130,6 +130,8 @@
 	if ( listbox ) {
 	    obj = new CustomObjectImp( exec, ListBoxInsertItem, proxy );
 	    object.put( exec, "insertItem", KJS::Object(obj) );
+            obj = new CustomObjectImp( exec, ListBoxRemoveItem, proxy );
+            object.put( exec, "removeItem", KJS::Object(obj) );
 	}
 
 	QListView *listview = dynamic_cast<QListView *>( widget );
@@ -339,6 +341,10 @@
 	    listBoxInsertItem( exec, self, args );
 	    return KJS::Value();
 	    break;
+        case ListBoxRemoveItem:
+            listBoxRemoveItem( exec, self, args );
+            return KJS::Value();
+            break;
 	case ListViewAddColumn:
 	    listViewAddColumn( exec, self, args );
 	    return KJS::Value();
@@ -626,6 +632,19 @@
     lb->insertItem( s );
 }
 
+void CustomObjectImp::listBoxRemoveItem( KJS::ExecState *exec, KJS::Object &, const KJS::List &args )
+{
+    if ( args.size() != 1 )
+        return;
+
+    QListBox *lb = dynamic_cast<QListBox *>( proxy->object() );
+    if ( !lb )
+        return;
+
+   int itm = extractInt( exec, args, 0 );
+   lb->removeItem( itm );
+}
+
 void CustomObjectImp::listViewAddColumn( KJS::ExecState *exec, KJS::Object &, const KJS::List &args )
 {
     if ( args.size() != 1 )
--- trunk/KDE/kdebindings/kjsembed/customobject_imp.h #459470:459471
@@ -136,7 +136,8 @@
     void widgetDrawText( KJS::ExecState *exec, KJS::Object &, const KJS::List &args );
 
     void listBoxInsertItem( KJS::ExecState *exec, KJS::Object &, const KJS::List &args );
-
+    void listBoxRemoveItem( KJS::ExecState *exec, KJS::Object &, const KJS::List &args );
+	
     void listViewAddColumn( KJS::ExecState *exec, KJS::Object &, const KJS::List &args );
     void listViewInsertItem( KJS::ExecState *exec, KJS::Object &, const KJS::List &args );
     KJS::Value listViewSelectedItem( KJS::ExecState *exec, KJS::Object &, const KJS::List & );
_______________________________________________
kjsembed mailing list
kjsembed@kde.org
https://mail.kde.org/mailman/listinfo/kjsembed

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic