diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-06-01 18:17:20 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-06-01 18:17:20 +0900 |
commit | 245d13f9d1ecf2d4ab6ab321709e10c8c261f7a7 (patch) | |
tree | c0e496204cda4a895921ccd48320719d0041aa23 /kjsembed | |
parent | 9055b21d6a4e7da5a959336eec39471b63490ee3 (diff) | |
download | tdebindings-245d13f9d1ecf2d4ab6ab321709e10c8c261f7a7.tar.gz tdebindings-245d13f9d1ecf2d4ab6ab321709e10c8c261f7a7.zip |
Adjusted to use new TQStringVariantMap type.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kjsembed')
-rw-r--r-- | kjsembed/docs/ChangeLog | 6 | ||||
-rw-r--r-- | kjsembed/docs/embedding/simple-embed/embedviewimp.cpp | 6 | ||||
-rw-r--r-- | kjsembed/jsbinding.cpp | 10 | ||||
-rw-r--r-- | kjsembed/jsbinding.h | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/kjsembed/docs/ChangeLog b/kjsembed/docs/ChangeLog index 49c861ea..c8e11eb3 100644 --- a/kjsembed/docs/ChangeLog +++ b/kjsembed/docs/ChangeLog @@ -78,7 +78,7 @@ in C++. Conversions break down as follows: TQStringList -> Array of javascript strings. TQValueList<TQVariant> -> Array of Javascript values. - TQMap<TQString,TQVariant> -> Object/Array that has each TQString key as + TQStringVariantMap -> Object/Array that has each TQString key as a property, and the TQVariant is mapped to a Javascript value. From Javascript the conversions are a little different. @@ -91,10 +91,10 @@ = convertToVariant( exec, someArrayValue).toList(); Now if the Javascript value is a Javascript object or a map then - the conversion will go to a TQMap<TQString,TQVariant>. An example of + the conversion will go to a TQStringVariantMap. An example of this would be like: KJS::Value someJSObject; - TQMap<TQString,TQVariant> map = convertToVariant(exec,someJSObject) + TQStringVariantMap map = convertToVariant(exec,someJSObject) .toMap(); TQString someVal = map["someProp"].toString(); diff --git a/kjsembed/docs/embedding/simple-embed/embedviewimp.cpp b/kjsembed/docs/embedding/simple-embed/embedviewimp.cpp index b71521d5..fd645ca5 100644 --- a/kjsembed/docs/embedding/simple-embed/embedviewimp.cpp +++ b/kjsembed/docs/embedding/simple-embed/embedviewimp.cpp @@ -30,7 +30,7 @@ void EmbedViewImp::okClicked() { KJS::List args; KJS::Value val = m_part->callMethod("handleOk", args); - TQMap<TQString, TQVariant> personalData = KJSEmbed::convertToVariant(m_part->globalExec(), val).toMap(); + TQStringVariantMap personalData = KJSEmbed::convertToVariant(m_part->globalExec(), val).toMap(); TQDate birthday = personalData["birthday"].toDate(); TQColor eyecolor = personalData["eyeColor"].toColor(); TQString notes = personalData["notes"].toString(); @@ -60,7 +60,7 @@ bool EmbedViewImp::runScript( const TQString &file ) TQVariant EmbedViewImp::someValue() const { - TQMap<TQString,TQVariant> returnMap; + TQStringVariantMap returnMap; returnMap["name"] = m_name->text(); returnMap["title"] = m_title->text(); returnMap["dept"] = m_dept->text(); @@ -69,7 +69,7 @@ TQVariant EmbedViewImp::someValue() const void EmbedViewImp::setSomeValue( const TQVariant &val ) { - TQMap<TQString,TQVariant> map = val.toMap(); + TQStringVariantMap map = val.toMap(); m_name->setText(map["name"].toString()); m_title->setText(map["title"].toString()); m_dept->setText(map["dept"].toString()); diff --git a/kjsembed/jsbinding.cpp b/kjsembed/jsbinding.cpp index cb6316d7..d015e7b5 100644 --- a/kjsembed/jsbinding.cpp +++ b/kjsembed/jsbinding.cpp @@ -138,8 +138,8 @@ namespace KJSEmbed { } case TQVariant::Map: { - TQMap<TQString,TQVariant> map = val.toMap(); - TQMap<TQString,TQVariant>::Iterator idx = map.begin(); + TQStringVariantMap map = val.toMap(); + TQStringVariantMap::Iterator idx = map.begin(); KJS::Object array( exec->interpreter() ->builtinArray().construct( exec, 0 ) ); for ( ; idx != map.end(); ++idx ) array.put(exec, KJS::Identifier(idx.key().latin1()), convertToValue( exec, idx.data() ) ); @@ -267,7 +267,7 @@ namespace KJSEmbed { /* kdDebug( 80001 ) << "convertToVariant() got a JSProxy" << endl; val = prxy->typeName(); */ - } else { // Last resort map the object to a TQMap<TQString,TQVariant> + } else { // Last resort map the object to a TQStringVariantMap kdDebug( 80001 ) << "convertToVariant() map to struct." << endl; val = convertArrayToMap(exec, v); } @@ -628,8 +628,8 @@ namespace KJSEmbed { return None; } - TQMap<TQString, TQVariant> convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ) { - TQMap<TQString, TQVariant> returnMap; + TQStringVariantMap convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ) { + TQStringVariantMap returnMap; KJS::Object obj = value.toObject(exec); // if( obj.className().qstring() == "Array" ) { KJS::ReferenceList lst = obj.propList(exec,false); diff --git a/kjsembed/jsbinding.h b/kjsembed/jsbinding.h index 6646d9c2..74c4b140 100644 --- a/kjsembed/jsbinding.h +++ b/kjsembed/jsbinding.h @@ -122,7 +122,7 @@ namespace KJSEmbed { KJSEMBED_EXPORT TQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value); KJSEMBED_EXPORT TQDateTime convertDateToDateTime(KJS::ExecState *exec, const KJS::Value &value); KJSEMBED_EXPORT TQValueList<TQVariant> convertArrayToList( KJS::ExecState *exec, const KJS::Value &value ); - KJSEMBED_EXPORT TQMap<TQString, TQVariant> convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ); + KJSEMBED_EXPORT TQStringVariantMap convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ); /** * This will throw an exception with the error string. |