+
+void FreeSound::slotParseResults(KJob* job)
+{
+#ifdef USE_QJSON
+ KIO::StoredTransferJob* storedQueryJob = static_cast<KIO::StoredTransferJob*>( job );
+ QJson::Parser parser;
+ bool ok;
+ QVariant data = parser.parse(storedQueryJob->data(), &ok);
+ if (data.canConvert(QVariant::Map)) {
+ QMap <QString, QVariant> infos = data.toMap();
+ if (m_currentId != infos.value("id").toInt()) return;
+ if (infos.contains("samplerate"))
+ new QTreeWidgetItem(info_widget, QStringList() << i18n("Samplerate") << QString::number(infos.value("samplerate").toDouble()));
+ if (infos.contains("channels"))
+ new QTreeWidgetItem(info_widget, QStringList() << i18n("Channels") << QString::number(infos.value("channels").toInt()));
+ if (infos.contains("filesize")) {
+ KIO::filesize_t fSize = infos.value("filesize").toDouble();
+ new QTreeWidgetItem(info_widget, QStringList() << i18n("File size") << KIO::convertSize(fSize));
+ }
+ if (infos.contains("description")) {
+ item_description->setHtml(infos.value("description").toString());
+ }
+ if (infos.contains("license")) {
+ parseLicense(infos.value("license").toString());
+ }
+ }
+ info_widget->resizeColumnToContents(0);
+ info_widget->resizeColumnToContents(1);
+#endif
+}
+
+