Skip to content

Commit

Permalink
no longer retrieve cached macros
Browse files Browse the repository at this point in the history
  • Loading branch information
octaeder committed Feb 17, 2024
1 parent b467815 commit b58cccd
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/macrobrowserui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,26 @@ void MacroBrowserUI::itemClicked(QTableWidgetItem *item)
requestMacroList(url);
}
}else{
requestMacroList(url,true);
if(cache.contains(url)){
// reuse cached
QByteArray ba = cache.value(url).toUtf8();
QJsonDocument jsonDoc=QJsonDocument::fromJson(ba);
QJsonObject dd=jsonDoc.object();
leName->setText(dd["name"].toString());
QJsonArray array=dd["description"].toArray();
QVariantList vl=array.toVariantList();
QString text;
foreach(auto v,vl){
if(!text.isEmpty()){
text+="\n";
}
text+=v.toString();
}
teDescription->setPlainText(text);
}
else{
requestMacroList(url,true);
}
}
}

Expand Down

0 comments on commit b58cccd

Please sign in to comment.