Image 01
profile-image

alex789

alex Savin
test
VK_search

Amarok 2.x Scripts 109 comments

Score 78.3%
Feb 06 2014
Please, can you add ability to listen "my music" and music of my friends? (or post it's as another script...)

anyway, thanks for script) - Dec 20 2011
Please, can you add ability to listen "my music" and music of my friends? (or post it's as another script...)

anyway, thanks for script) - Dec 20 2011
translatoid

Plasma 4 Extensions 284 comments

by dridk
Score 68.0%
Nov 30 2010
this bug have very long history, and still unfixed - Jun 27 2010
No, I have no such problem

can you describe more detail?
is it really depend to my patch?
(i didn't touch translate() function...)

also what version you use?
(i use 1.1b)

for easy testing you can use
/usr/bin/plasmoidviewer translatoid - Jun 27 2010
now all should work good! - Jun 26 2010
i know it, now test final patch:

https://build.opensuse.org/package/view_file?file=json-parser.patch&package=share_for_patchs&project=home%3Aalexqwesa

or

-- plasmoid-translatoid/package/ktranslatoid.cpp 2009-11-19 22:59:15.000000000 +0300
+++ ktranslatoid.cpp 2010-06-27 05:23:31.000000000 +0400
@@ -302,57 +302,59 @@
m_job = 0;
//kDebug() << "HTTP Request done." << m_data;

+ if (m_data.at(m_data.size()-6) == ',' &&
+ m_data.at(m_data.size()-7) == ','){
+ m_data.insert((m_data.size()-6), '"');
+ m_data.insert((m_data.size()-6), '"');
+ }
QString text;
+ QString dictionnary;
+ QString textToReturn = QString();
text = text.fromUtf8(m_data);
+ kDebug() << text;
/* m_data.clear();
kDebug() << "All data is read.";*/

- QVariantMap sentences;
- QVariantList dict;
- QString textToReturn = QString();
QJson::Parser parser;
bool ok;
- QVariantMap result = parser.parse(m_data,&ok).toMap();
+ QVariantList result = parser.parse(m_data,&ok).toList();

if (!ok) {
kDebug()<<"An error occured during parsing";
+ m_destText->setText(text);
return;
}

- if (result.contains("sentences"))
- sentences = result["sentences"].toList().at(0).toMap();
-
- if (result.contains("dict"))
- dict = result["dict"].toList();
-
- if ( sentences.contains("trans"))
- textToReturn += sentences["trans"].toString()+"<hr/>";
-
-
- QString dictionnary=QString();
- foreach ( QVariant var, dict)
+ foreach ( QVariant map, result)
{
-
- if ( var.type() == QVariant::Map)
+ if ( map.type() == QVariant::List)
{
- foreach ( QVariant map, var.toMap())
+ foreach ( QVariant map2, map.toList())
{
- if ( map.type() == QVariant::String)
- dictionnary+="<b>"+map.toString()+"</b><br/>";
-
- if ( map.type() == QVariant::List)
+ if ( map2.type() == QVariant::List)
{
- foreach ( QVariant word, map.toList())
- {
- dictionnary+=( word.toString() + " ");
+ bool ishow = true;
+ foreach ( QVariant var, map2.toList()){
+ if ( (var.type() == QVariant::String) && ishow){
+ ishow=false;
+ dictionnary+=("<b>" + var.toString() + "</b><br/>\n");
+ }
+ if ( var.type() == QVariant::List){
+ foreach ( QVariant var2, var.toList()){
+ if ( var2.type() == QVariant::String)
+ dictionnary+=(var2.toString()+"<br/>\n");
+ }
+ }
}
+ dictionnary+="<hr/>\n";
}
}
}
}
-
textToReturn += dictionnary;
- m_destText->setText(textToReturn);
+
+ m_destText->setText("<html><body>" + textToReturn + "</body></html>");
+ //m_destText->setHtml(textToReturn);
}

//===================================================================================
- Jun 26 2010
if json failed - just return raw text data, it is more usable than do nothing

Index: ktranslatoid.cpp
===================================================================
--- ktranslatoid.cpp (revision 1142885)
+++ ktranslatoid.cpp (working copy)
@@ -318,6 +318,7 @@

if (!ok) {
kDebug()<<"An error occured during parsing";
+ m_destText->setText(text);
return;
} - Jun 26 2010
if json failed - just return raw text data, it is more usable than do nothing

Index: ktranslatoid.cpp
===================================================================
--- ktranslatoid.cpp (revision 1142885)
+++ ktranslatoid.cpp (working copy)
@@ -318,6 +318,7 @@

if (!ok) {
kDebug()<<"An error occured during parsing";
+ m_destText->setText(text);
return;
} - Jun 26 2010
also such problem:

json_parser - syntax error found, forcing abort - Jun 25 2010
+1

last version of translatoid is very big - I need small plasmoid

Please, fix it

thanks - Dec 24 2009
Daisy

Plasma 4 Extensions 574 comments

Score 81.9%
Jul 14 2012
what about this bug:
https://bugs.kde.org/show_bug.cgi?id=216398 - Dec 03 2009
VK_search

Amarok 2.x Scripts
by alternativshik

Score 78.3%
Dec 20 2011
VK_search

Amarok 2.x Scripts
by alternativshik

Score 78.3%
9   Dec 25 2011