From 01a0fff4c2dab8ba6aa1aa3b9d49b8c58190e684 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 3 Jan 2022 12:13:32 +0800 Subject: [PATCH] Add missing field initial value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suppresses the following warning: qBittorrent/src/base/bittorrent/categoryoptions.cpp: In static member function ‘static BitTorrent::CategoryOptions BitTorrent::CategoryOptions::fromJSON(const QJsonObject&)’: qBittorrent/src/base/bittorrent/categoryoptions.cpp:44:59: warning: missing initializer for member ‘BitTorrent::CategoryOptions::DownloadPathOption::path’ [-Wmissing-field-initializers] 44 | options.downloadPath = {downloadPathValue.toBool()}; --- src/base/bittorrent/categoryoptions.cpp | 2 +- src/gui/torrentcategorydialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/bittorrent/categoryoptions.cpp b/src/base/bittorrent/categoryoptions.cpp index 6807e59c0..3efc0cbf9 100644 --- a/src/base/bittorrent/categoryoptions.cpp +++ b/src/base/bittorrent/categoryoptions.cpp @@ -41,7 +41,7 @@ BitTorrent::CategoryOptions BitTorrent::CategoryOptions::fromJSON(const QJsonObj const QJsonValue downloadPathValue = jsonObj.value(OPTION_DOWNLOADPATH); if (downloadPathValue.isBool()) - options.downloadPath = {downloadPathValue.toBool()}; + options.downloadPath = {downloadPathValue.toBool(), {}}; else if (downloadPathValue.isString()) options.downloadPath = {true, downloadPathValue.toString()}; diff --git a/src/gui/torrentcategorydialog.cpp b/src/gui/torrentcategorydialog.cpp index 728610a3c..948791882 100644 --- a/src/gui/torrentcategorydialog.cpp +++ b/src/gui/torrentcategorydialog.cpp @@ -142,7 +142,7 @@ BitTorrent::CategoryOptions TorrentCategoryDialog::categoryOptions() const if (m_ui->comboUseDownloadPath->currentIndex() == 1) categoryOptions.downloadPath = {true, m_ui->comboDownloadPath->selectedPath()}; else if (m_ui->comboUseDownloadPath->currentIndex() == 2) - categoryOptions.downloadPath = {false}; + categoryOptions.downloadPath = {false, {}}; return categoryOptions; }