Browse Source

Initialize boolean variables

adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
48e7191ef7
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/gui/properties/propertieswidget.cpp
  2. 2
      src/gui/properties/trackerlistwidget.cpp
  3. 6
      src/gui/rss/rsswidget.cpp
  4. 2
      src/gui/transferlistwidget.cpp

2
src/gui/properties/propertieswidget.cpp

@ -710,7 +710,7 @@ void PropertiesWidget::configure() @@ -710,7 +710,7 @@ void PropertiesWidget::configure()
void PropertiesWidget::askWebSeed()
{
bool ok;
bool ok = false;
// Ask user for a new url seed
const QString urlSeed = AutoExpandableDialog::getText(this, tr("New URL seed", "New HTTP source"),
tr("New URL seed:"), QLineEdit::Normal,

2
src/gui/properties/trackerlistwidget.cpp

@ -482,7 +482,7 @@ void TrackerListWidget::editSelectedTracker() @@ -482,7 +482,7 @@ void TrackerListWidget::editSelectedTracker()
// During multi-select only process item selected last
const QUrl trackerURL = selectedTrackerItems.last()->text(COL_URL);
bool ok;
bool ok = false;
const QUrl newTrackerURL = AutoExpandableDialog::getText(this, tr("Tracker editing"), tr("Tracker URL:"),
QLineEdit::Normal, trackerURL.toString(), &ok).trimmed();
if (!ok) return;

6
src/gui/rss/rsswidget.cpp

@ -216,7 +216,7 @@ void RSSWidget::displayItemsListMenu(const QPoint &) @@ -216,7 +216,7 @@ void RSSWidget::displayItemsListMenu(const QPoint &)
void RSSWidget::askNewFolder()
{
bool ok;
bool ok = false;
QString newName = AutoExpandableDialog::getText(
this, tr("Please choose a folder name"), tr("Folder name:"), QLineEdit::Normal
, tr("New folder"), &ok);
@ -257,7 +257,7 @@ void RSSWidget::on_newFeedButton_clicked() @@ -257,7 +257,7 @@ void RSSWidget::on_newFeedButton_clicked()
const QString clipText = qApp->clipboard()->text();
const QString defaultURL = Net::DownloadManager::hasSupportedScheme(clipText) ? clipText : "http://";
bool ok;
bool ok = false;
QString newURL = AutoExpandableDialog::getText(
this, tr("Please type a RSS feed URL"), tr("Feed URL:"), QLineEdit::Normal, defaultURL, &ok);
if (!ok) return;
@ -386,7 +386,7 @@ void RSSWidget::renameSelectedRSSItem() @@ -386,7 +386,7 @@ void RSSWidget::renameSelectedRSSItem()
RSS::Item *rssItem = m_feedListWidget->getRSSItem(item);
const QString parentPath = RSS::Item::parentPath(rssItem->path());
bool ok;
bool ok = false;
do {
QString newName = AutoExpandableDialog::getText(
this, tr("Please choose a new name for this RSS feed"), tr("New feed name:")

2
src/gui/transferlistwidget.cpp

@ -1003,7 +1003,7 @@ void TransferListWidget::renameSelectedTorrent() @@ -1003,7 +1003,7 @@ void TransferListWidget::renameSelectedTorrent()
if (!torrent) return;
// Ask for a new Name
bool ok;
bool ok = false;
QString name = AutoExpandableDialog::getText(this, tr("Rename"), tr("New name:"), QLineEdit::Normal, torrent->name(), &ok);
if (ok && !name.isEmpty()) {
name.replace(QRegularExpression("\r?\n|\r"), " ");

Loading…
Cancel
Save