mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
use raw string in post template
This commit is contained in:
parent
06946e559a
commit
94fefe8ce9
|
@ -19,23 +19,21 @@ AnkiConnector::AnkiConnector( QObject * parent, Config::Class const & _cfg ) : Q
|
|||
|
||||
void AnkiConnector::sendToAnki( QString const & word, QString const & text, QString const & sentence )
|
||||
{
|
||||
//for simplicity. maybe use QJsonDocument in future?
|
||||
QString postTemplate = QString( "{"
|
||||
"\"action\": \"addNote\","
|
||||
"\"version\": 6,"
|
||||
"\"params\": {"
|
||||
" \"note\": {"
|
||||
" \"deckName\": \"%1\","
|
||||
" \"modelName\": \"%2\","
|
||||
" \"fields\":%3,"
|
||||
" \"options\": {"
|
||||
" \"allowDuplicate\": true"
|
||||
" },"
|
||||
" \"tags\": []"
|
||||
"}"
|
||||
"}"
|
||||
"}"
|
||||
"" );
|
||||
QString postTemplate = R"anki({
|
||||
"action": "addNote",
|
||||
"version": 6,
|
||||
"params": {
|
||||
"note": {
|
||||
"deckName": "%1",
|
||||
"modelName": "%2",
|
||||
"fields": %3,
|
||||
"options": {
|
||||
"allowDuplicate": true
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
})anki";
|
||||
|
||||
QJsonObject fields;
|
||||
fields.insert( cfg.preferences.ankiConnectServer.word, word );
|
||||
|
|
Loading…
Reference in a new issue