mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +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 )
|
void AnkiConnector::sendToAnki( QString const & word, QString const & text, QString const & sentence )
|
||||||
{
|
{
|
||||||
//for simplicity. maybe use QJsonDocument in future?
|
QString postTemplate = R"anki({
|
||||||
QString postTemplate = QString( "{"
|
"action": "addNote",
|
||||||
"\"action\": \"addNote\","
|
"version": 6,
|
||||||
"\"version\": 6,"
|
"params": {
|
||||||
"\"params\": {"
|
"note": {
|
||||||
" \"note\": {"
|
"deckName": "%1",
|
||||||
" \"deckName\": \"%1\","
|
"modelName": "%2",
|
||||||
" \"modelName\": \"%2\","
|
"fields": %3,
|
||||||
" \"fields\":%3,"
|
"options": {
|
||||||
" \"options\": {"
|
"allowDuplicate": true
|
||||||
" \"allowDuplicate\": true"
|
},
|
||||||
" },"
|
"tags": []
|
||||||
" \"tags\": []"
|
}
|
||||||
"}"
|
}
|
||||||
"}"
|
})anki";
|
||||||
"}"
|
|
||||||
"" );
|
|
||||||
|
|
||||||
QJsonObject fields;
|
QJsonObject fields;
|
||||||
fields.insert( cfg.preferences.ankiConnectServer.word, word );
|
fields.insert( cfg.preferences.ankiConnectServer.word, word );
|
||||||
|
|
Loading…
Reference in a new issue