Browse Source

Follow project coding style. Issue #2192.

--HG--
branch : magao-dev
Tim Delaney 8 years ago
parent
commit
2e66ddb0a0
  1. 20
      src/gui/mainwindow.cpp

20
src/gui/mainwindow.cpp

@ -118,7 +118,10 @@ namespace @@ -118,7 +118,10 @@ namespace
const QString KEY_DOWNLOAD_TRACKER_FAVICON = NOTIFICATIONS_SETTINGS_KEY("DownloadTrackerFavicon");
// just a shortcut
inline SettingsStorage *settings() { return SettingsStorage::instance(); }
inline SettingsStorage *settings()
{
return SettingsStorage::instance();
}
}
MainWindow::MainWindow(QWidget *parent)
@ -609,7 +612,6 @@ void MainWindow::displayRSSTab(bool enable) @@ -609,7 +612,6 @@ void MainWindow::displayRSSTab(bool enable)
else if (m_rssWidget) {
delete m_rssWidget;
}
}
void MainWindow::updateRSSTabLabel(int count)
@ -630,7 +632,6 @@ void MainWindow::displaySearchTab(bool enable) @@ -630,7 +632,6 @@ void MainWindow::displaySearchTab(bool enable)
else if (m_searchWidget) {
delete m_searchWidget;
}
}
void MainWindow::updateNbTorrents()
@ -854,10 +855,9 @@ void MainWindow::on_actionSetGlobalDownloadLimit_triggered() @@ -854,10 +855,9 @@ void MainWindow::on_actionSetGlobalDownloadLimit_triggered()
void MainWindow::on_actionExit_triggered()
{
// UI locking enforcement.
if (isHidden() && m_uiLocked) {
if (isHidden() && m_uiLocked)
// Ask for UI lock password
if (!unlockUI()) return;
}
m_forceExit = true;
close();
@ -999,12 +999,11 @@ void MainWindow::closeEvent(QCloseEvent *e) @@ -999,12 +999,11 @@ void MainWindow::closeEvent(QCloseEvent *e)
m_forceExit = false;
return;
}
if (confirmBox.clickedButton() == alwaysBtn) {
if (confirmBox.clickedButton() == alwaysBtn)
// Remember choice
Preferences::instance()->setConfirmOnExit(false);
}
}
}
// abort search if any
if (m_searchWidget)
@ -1348,8 +1347,8 @@ void MainWindow::downloadFromURLList(const QStringList& urlList) @@ -1348,8 +1347,8 @@ void MainWindow::downloadFromURLList(const QStringList& urlList)
{
const bool useTorrentAdditionDialog = AddNewTorrentDialog::isEnabled();
foreach (QString url, urlList) {
if ((url.size() == 40 && !url.contains(QRegExp("[^0-9A-Fa-f]")))
|| (url.size() == 32 && !url.contains(QRegExp("[^2-7A-Za-z]"))))
if (((url.size() == 40) && !url.contains(QRegExp("[^0-9A-Fa-f]")))
|| ((url.size() == 32) && !url.contains(QRegExp("[^2-7A-Za-z]"))))
url = "magnet:?xt=urn:btih:" + url;
if (useTorrentAdditionDialog)
@ -1590,6 +1589,7 @@ void MainWindow::handleUpdateCheckFinished(bool updateAvailable, QString newVers @@ -1590,6 +1589,7 @@ void MainWindow::handleUpdateCheckFinished(bool updateAvailable, QString newVers
if (Preferences::instance()->isUpdateCheckEnabled() && (answer == QMessageBox::Yes))
m_programUpdateTimer->start();
}
#endif
void MainWindow::on_actionDonateMoney_triggered()
@ -1734,6 +1734,7 @@ void MainWindow::checkProgramUpdate() @@ -1734,6 +1734,7 @@ void MainWindow::checkProgramUpdate()
connect(updater, SIGNAL(updateCheckFinished(bool,QString,bool)), SLOT(handleUpdateCheckFinished(bool,QString,bool)));
updater->checkForUpdates();
}
#endif
#ifdef Q_OS_WIN
@ -1812,4 +1813,5 @@ void MainWindow::pythonDownloadFailure(const QString &url, const QString &error) @@ -1812,4 +1813,5 @@ void MainWindow::pythonDownloadFailure(const QString &url, const QString &error)
setCursor(QCursor(Qt::ArrowCursor));
QMessageBox::warning(this, tr("Download error"), tr("Python setup could not be downloaded, reason: %1.\nPlease install it manually.").arg(error));
}
#endif

Loading…
Cancel
Save