Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ void Plugin::updateDocsetList()
docsets_.clear();

QJsonParseError parse_error;
const QJsonDocument json_document = QJsonDocument::fromJson(replyData, &parse_error);
bool local = false;
QJsonDocument json_document = QJsonDocument::fromJson(replyData, &parse_error);
again:
if (parse_error.error == QJsonParseError::NoError)
{
for (const QJsonValue &val : json_document.array())
Expand All @@ -183,7 +185,19 @@ void Plugin::updateDocsetList()
if (dir.exists())
docsets_.back().path = dir.path();
}
debug(tr("Docset list updated."));
if (local)
debug("Custom docsets have been added.");
else
debug(tr("Docset list updated."));

QFile customDocsetListFile(QDir(dataLocation()).filePath("custom_docsets.json"));
if (!local && customDocsetListFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
QByteArray customData = customDocsetListFile.readAll();
customDocsetListFile.close();
json_document = QJsonDocument::fromJson(customData, &parse_error);
local = true;
goto again;
}

if (reply->error() == QNetworkReply::NoError)
{
Expand Down