diff options
Diffstat (limited to 'src/kvirc/kvs/kvi_kvs_object.cpp')
-rw-r--r-- | src/kvirc/kvs/kvi_kvs_object.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/kvirc/kvs/kvi_kvs_object.cpp b/src/kvirc/kvs/kvi_kvs_object.cpp index eaae3fd9..e5ff0a50 100644 --- a/src/kvirc/kvs/kvi_kvs_object.cpp +++ b/src/kvirc/kvs/kvi_kvs_object.cpp @@ -69,11 +69,11 @@ [big]Basic concepts[/big] Objects are arranged in tree structures. - Each object that you create is either toplevel object or a tqchildren + Each object that you create is either toplevel object or a children of another object. A toplevel object is a parentless one. - Obviously all objects can have tqchildren objects.[br][br] + Obviously all objects can have children objects.[br][br] - When an object is destroyed , all its tqchildren are also destroyed. + When an object is destroyed , all its children are also destroyed. The toplevel objects are automatically destroyed when KVIrc quits. The objects are global to the entire application (this is different from previous KVIrc releases where the objects were local @@ -121,7 +121,7 @@ [example] [cmd]delete[/cmd] %myobject [/example] - If the destroyed object has tqchildren objects , these are destroyed too.[br][br] + If the destroyed object has children objects , these are destroyed too.[br][br] [big]Fields : objects as pseudo-structures[/big] @@ -196,15 +196,15 @@ [cmd]delete[/cmd] %tmp [/example] Another cool function exported by the [class:object]object[/class] class is the - [classfnc:object]$tqchildren[/classfnc]() function. - It returns a comma separated list of tqchildren identifiers.[br] + [classfnc:object]$children[/classfnc]() function. + It returns a comma separated list of children identifiers.[br] [example] %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject) %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child1) %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child2) %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child3) - [cmd]echo[/cmd] The object's tqchildren list is : %tmp->[classfnc:object]$tqchildren[/classfnc]() - # Destroy the object and the tqchildren + [cmd]echo[/cmd] The object's children list is : %tmp->[classfnc:object]$children[/classfnc]() + # Destroy the object and the children [cmd]delete[/cmd] %tmp [/example] There are two special functions for each objects: the "constructor" and the "destructor". @@ -230,25 +230,25 @@ [cmd]privateimpl[/cmd](%tmp,destructor) { %count = 0; - [cmd]foreach[/cmd](%t,[fnc]$this[/fnc]->[classfnc:object]$tqchildren[/classfnc]()) + [cmd]foreach[/cmd](%t,[fnc]$this[/fnc]->[classfnc:object]$children[/classfnc]()) { [cmd]echo[/cmd] Children : %t->[classfnc:object]$name[/classfnc]() with class %t->[classfnc:object]$class[/classfnc]() %count++ } - [cmd]echo[/cmd] Just before destroying my %count tqchildren. + [cmd]echo[/cmd] Just before destroying my %count children. } - # Destroy the object and the tqchildren + # Destroy the object and the children [cmd]delete[/cmd] %tmp [/example] In the example above four objects have been created. - A "parent" object named "myobject" , and three tqchildren objects. + A "parent" object named "myobject" , and three children objects. The destructor has been reimplemented for each child object, to make it "say" its name (Please note the usage of [fnc]$this[/fnc]). - In the parent destructor the tqchildren have been counted and listed.[br] + In the parent destructor the children have been counted and listed.[br] Then the parent object is destroyed causing to:[br] - trigger the parent destructor.[br] - - destroy all the tqchildren (and conseguently trigger all the "individual" destructors).[br][br] + - destroy all the children (and conseguently trigger all the "individual" destructors).[br][br] Not all the object functions must return a value: If a function does not return a meaningful value , or you just want to ignore it , you can call it in the following way:[br] @@ -339,7 +339,7 @@ The above class is named "helloworld". It inherits the [class]object[/class] class. This means that it acquires all the [class]object[/class] fuunctions: [classfnc:object]$name[/classfnc]() , - [classfnc:object]$class[/class]() , [classfnc:object]$tqchildren[/classfnc]()... + [classfnc:object]$class[/class]() , [classfnc:object]$children[/classfnc]()... Additionally , it has the $sayhello() function, that "echoes Hello world" to the console. Now you can create an instance of this class: [example] @@ -486,7 +486,7 @@ @description: This is the base class for all the builtin KVirc object classes. It exports the functions to retrieve the object name, to iterate - through tqchildren objects and to lookup a child object by name or class. + through children objects and to lookup a child object by name or class. Additionally , this class provides the builtin timer functionality. The [classfnc]$constructor[/classfnc] and [classfnc]$destructor[/classfnc] functions are empty implementations that all the other classes inherit. @@ -521,15 +521,15 @@ Returns the first child that matches <class> and <name>. If <class> is an empty string, any class matches, if <name> is an empty string, any name matches. - This function traverses the entire tree of tqchildren + This function traverses the entire tree of children but is NOT recursive. !fn: $childCount() - Returns the number of tqchildren objects + Returns the number of children objects !fn: $emit(<signal_name>[,parameters]) Emits the signal <signal_name> passing the optional [parameters]. See the [doc:objects]objects documentation[/doc] for an overview of signals and slots. - !fn: $tqchildren() - Returns an array of tqchildren object identifiers. + !fn: $children() + Returns an array of children object identifiers. !fn: $signalSender() Returns the current signal sender when in a slot connected to a signal. In other contexts this function returns an empty string. @@ -955,7 +955,7 @@ bool KviKvsObject::function_destructor(KviKvsObjectFunctionCall * c) return true; } -bool KviKvsObject::function_tqchildren(KviKvsObjectFunctionCall * c) +bool KviKvsObject::function_children(KviKvsObjectFunctionCall * c) { KviKvsArray * a = new KviKvsArray(); int id=0; |