mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -07:00
Reuse code path in switch cases
This commit is contained in:
parent
9b5df92078
commit
8fe8cbd3d1
1 changed files with 1 additions and 3 deletions
|
@ -267,12 +267,10 @@ void WebApplication::doProcessRequest()
|
|||
try {
|
||||
const QVariant result = controller->run(action, m_params, data);
|
||||
switch (result.userType()) {
|
||||
case QMetaType::QString:
|
||||
print(result.toString(), Http::CONTENT_TYPE_TXT);
|
||||
break;
|
||||
case QMetaType::QJsonDocument:
|
||||
print(result.toJsonDocument().toJson(QJsonDocument::Compact), Http::CONTENT_TYPE_JSON);
|
||||
break;
|
||||
case QMetaType::QString:
|
||||
default:
|
||||
print(result.toString(), Http::CONTENT_TYPE_TXT);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue