From a12d6a4764310d21016bcfc5fd094a1e303a02ed Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 21 Jul 2017 10:10:02 +0200 Subject: [PATCH] Fix pad lines. --- .astylerc | 4 +- src/core/feedsproxymodel.cpp | 3 +- src/gui/dialogs/formsettings.cpp | 3 +- src/gui/dialogs/formupdate.cpp | 3 +- src/gui/feedmessageviewer.cpp | 6 +- src/gui/settings/settingsbrowsermail.cpp | 21 +++-- src/gui/settings/settingsdatabase.cpp | 18 ++-- src/gui/settings/settingsdownloads.cpp | 3 +- src/gui/settings/settingsfeedsmessages.cpp | 12 ++- src/gui/settings/settingsgui.cpp | 6 +- src/miscellaneous/application.cpp | 6 +- src/miscellaneous/application.h | 2 +- src/miscellaneous/databasefactory.cpp | 3 +- src/miscellaneous/databasequeries.cpp | 9 +- .../adblock/adblockaddsubscriptiondialog.cpp | 35 +++---- .../adblock/adblockaddsubscriptiondialog.ui | 94 ++++++++++++++----- src/network-web/adblock/adblockdialog.cpp | 3 +- src/network-web/adblock/adblockmanager.cpp | 10 +- src/network-web/adblock/adblockmatcher.cpp | 3 +- src/network-web/adblock/adblocksearchtree.cpp | 3 +- .../adblock/adblocksubscription.cpp | 10 +- src/network-web/basenetworkaccessmanager.cpp | 3 +- src/network-web/networkurlinterceptor.cpp | 2 +- .../silentnetworkaccessmanager.cpp | 2 +- src/network-web/silentnetworkaccessmanager.h | 2 +- src/network-web/webfactory.cpp | 6 +- src/network-web/webfactory.h | 8 +- src/services/abstract/gui/formfeeddetails.cpp | 6 +- src/services/abstract/serviceroot.cpp | 8 +- .../owncloud/gui/formowncloudfeeddetails.cpp | 12 ++- .../owncloud/owncloudserviceentrypoint.cpp | 3 +- .../standard/gui/formstandardfeeddetails.cpp | 3 +- .../tt-rss/gui/formeditttrssaccount.cpp | 6 +- .../tt-rss/gui/formttrssfeeddetails.cpp | 3 +- .../tt-rss/network/ttrssnetworkfactory.cpp | 27 ++++-- 35 files changed, 225 insertions(+), 123 deletions(-) diff --git a/.astylerc b/.astylerc index a0a7254db..310eab12b 100755 --- a/.astylerc +++ b/.astylerc @@ -7,7 +7,7 @@ --indent-preproc-define --indent-col1-comments --max-continuation-indent=100 ---break-blocks=all +--break-blocks --unpad-paren --pad-oper --pad-comma @@ -19,7 +19,7 @@ --add-braces --convert-tabs --close-templates ---max-code-length=200 +--max-code-length=140 --lineend=linux -t -p -M60Ucv \ No newline at end of file diff --git a/src/core/feedsproxymodel.cpp b/src/core/feedsproxymodel.cpp index 16de9e1c6..9b7acea14 100755 --- a/src/core/feedsproxymodel.cpp +++ b/src/core/feedsproxymodel.cpp @@ -127,7 +127,8 @@ QModelIndexList FeedsProxyModel::match(const QModelIndex& start, int role, const } if (recurse && hasChildren(idx)) { - result += match(index(0, idx.column(), idx), role, (entered_text.isEmpty() ? value : entered_text), (all_hits ? -1 : hits - result.count()), flags); + result += match(index(0, idx.column(), idx), role, (entered_text.isEmpty() ? value : entered_text), (all_hits ? -1 : hits - result.count()), + flags); } } diff --git a/src/gui/dialogs/formsettings.cpp b/src/gui/dialogs/formsettings.cpp index 8d8428d84..9e5c7591b 100755 --- a/src/gui/dialogs/formsettings.cpp +++ b/src/gui/dialogs/formsettings.cpp @@ -33,7 +33,8 @@ #include "gui/settings/settingsshortcuts.h" -FormSettings::FormSettings(QWidget* parent) : QDialog(parent), m_panels(QList()), m_ui(new Ui::FormSettings), m_settings(qApp->settings()) { +FormSettings::FormSettings(QWidget* parent) : QDialog(parent), m_panels(QList()), m_ui(new Ui::FormSettings), + m_settings(qApp->settings()) { m_ui->setupUi(this); // Set flags and attributes. setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint); diff --git a/src/gui/dialogs/formupdate.cpp b/src/gui/dialogs/formupdate.cpp index 386d5fc43..68fd72bfb 100755 --- a/src/gui/dialogs/formupdate.cpp +++ b/src/gui/dialogs/formupdate.cpp @@ -181,7 +181,8 @@ void FormUpdate::updateCompleted(QNetworkReply::NetworkError status, QByteArray switch (status) { case QNetworkReply::NoError: saveUpdateFile(contents); - m_ui->m_lblStatus->setStatus(WidgetWithStatus::Ok, tr("Downloaded successfully"), tr("Package was downloaded successfully.\nYou can install it now.")); + m_ui->m_lblStatus->setStatus(WidgetWithStatus::Ok, tr("Downloaded successfully"), + tr("Package was downloaded successfully.\nYou can install it now.")); m_btnUpdate->setText(tr("Install")); m_btnUpdate->setEnabled(true); break; diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index 0045dd0f3..488c45e29 100755 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -124,8 +124,10 @@ void FeedMessageViewer::loadSize() { const Settings* settings = qApp->settings(); // Restore offsets of splitters. m_feedSplitter->restoreState(QByteArray::fromBase64(settings->value(GROUP(GUI), SETTING(GUI::SplitterFeeds)).toString().toLocal8Bit())); - m_messageSplitter->restoreState(QByteArray::fromBase64(settings->value(GROUP(GUI), SETTING(GUI::SplitterMessages)).toString().toLocal8Bit())); - m_messagesView->header()->restoreState(QByteArray::fromBase64(settings->value(GROUP(GUI), SETTING(GUI::MessageViewState)).toString().toLocal8Bit())); + m_messageSplitter->restoreState(QByteArray::fromBase64(settings->value(GROUP(GUI), + SETTING(GUI::SplitterMessages)).toString().toLocal8Bit())); + m_messagesView->header()->restoreState(QByteArray::fromBase64(settings->value(GROUP(GUI), + SETTING(GUI::MessageViewState)).toString().toLocal8Bit())); } void FeedMessageViewer::loadMessageViewerFonts() { diff --git a/src/gui/settings/settingsbrowsermail.cpp b/src/gui/settings/settingsbrowsermail.cpp index 5bdc399a4..62b97d109 100755 --- a/src/gui/settings/settingsbrowsermail.cpp +++ b/src/gui/settings/settingsbrowsermail.cpp @@ -37,7 +37,8 @@ SettingsBrowserMail::SettingsBrowserMail(Settings* settings, QWidget* parent) #else connect(m_ui->m_checkOpenLinksInExternal, &QCheckBox::stateChanged, this, &SettingsBrowserMail::dirtifySettings); #endif - connect(m_ui->m_cmbProxyType, static_cast(&QComboBox::currentIndexChanged), this, &SettingsBrowserMail::dirtifySettings); + connect(m_ui->m_cmbProxyType, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsBrowserMail::dirtifySettings); connect(m_ui->m_txtProxyHost, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings); connect(m_ui->m_txtProxyPassword, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings); connect(m_ui->m_txtProxyUsername, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings); @@ -48,11 +49,14 @@ SettingsBrowserMail::SettingsBrowserMail(Settings* settings, QWidget* parent) connect(m_ui->m_txtExternalBrowserExecutable, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings); connect(m_ui->m_txtExternalEmailArguments, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings); connect(m_ui->m_txtExternalEmailExecutable, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings); - connect(m_ui->m_cmbProxyType, static_cast(&QComboBox::currentIndexChanged), this, &SettingsBrowserMail::onProxyTypeChanged); + connect(m_ui->m_cmbProxyType, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsBrowserMail::onProxyTypeChanged); connect(m_ui->m_checkShowPassword, &QCheckBox::stateChanged, this, &SettingsBrowserMail::displayProxyPassword); - connect(m_ui->m_cmbExternalBrowserPreset, static_cast(&QComboBox::currentIndexChanged), this, &SettingsBrowserMail::changeDefaultBrowserArguments); + connect(m_ui->m_cmbExternalBrowserPreset, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsBrowserMail::changeDefaultBrowserArguments); connect(m_ui->m_btnExternalBrowserExecutable, &QPushButton::clicked, this, &SettingsBrowserMail::selectBrowserExecutable); - connect(m_ui->m_cmbExternalEmailPreset, static_cast(&QComboBox::currentIndexChanged), this, &SettingsBrowserMail::changeDefaultEmailArguments); + connect(m_ui->m_cmbExternalEmailPreset, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsBrowserMail::changeDefaultEmailArguments); connect(m_ui->m_btnExternalEmailExecutable, &QPushButton::clicked, this, &SettingsBrowserMail::selectEmailExecutable); } @@ -139,8 +143,10 @@ void SettingsBrowserMail::loadSettings() { #endif // Load settings of web browser GUI. m_ui->m_cmbExternalBrowserPreset->addItem(tr("Opera 12 or older"), QSL("-nosession %1")); - m_ui->m_txtExternalBrowserExecutable->setText(settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserExecutable)).toString()); - m_ui->m_txtExternalBrowserArguments->setText(settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserArguments)).toString()); + m_ui->m_txtExternalBrowserExecutable->setText(settings()->value(GROUP(Browser), + SETTING(Browser::CustomExternalBrowserExecutable)).toString()); + m_ui->m_txtExternalBrowserArguments->setText(settings()->value(GROUP(Browser), + SETTING(Browser::CustomExternalBrowserArguments)).toString()); m_ui->m_grpCustomExternalBrowser->setChecked(settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserEnabled)).toBool()); // Load settings of e-mail. m_ui->m_cmbExternalEmailPreset->addItem(tr("Mozilla Thunderbird"), QSL("-compose \"subject='%1',body='%2'\"")); @@ -152,7 +158,8 @@ void SettingsBrowserMail::loadSettings() { m_ui->m_cmbProxyType->addItem(tr("Socks5"), QNetworkProxy::Socks5Proxy); m_ui->m_cmbProxyType->addItem(tr("Http"), QNetworkProxy::HttpProxy); // Load the settings. - QNetworkProxy::ProxyType selected_proxy_type = static_cast(settings()->value(GROUP(Proxy), SETTING(Proxy::Type)).toInt()); + QNetworkProxy::ProxyType selected_proxy_type = static_cast(settings()->value(GROUP(Proxy), + SETTING(Proxy::Type)).toInt()); m_ui->m_cmbProxyType->setCurrentIndex(m_ui->m_cmbProxyType->findData(selected_proxy_type)); m_ui->m_txtProxyHost->setText(settings()->value(GROUP(Proxy), SETTING(Proxy::Host)).toString()); m_ui->m_txtProxyUsername->setText(settings()->value(GROUP(Proxy), SETTING(Proxy::Username)).toString()); diff --git a/src/gui/settings/settingsdatabase.cpp b/src/gui/settings/settingsdatabase.cpp index b311d0b3f..5c250736e 100755 --- a/src/gui/settings/settingsdatabase.cpp +++ b/src/gui/settings/settingsdatabase.cpp @@ -30,7 +30,8 @@ SettingsDatabase::SettingsDatabase(Settings* settings, QWidget* parent) GuiUtilities::setLabelAsNotice(m_ui->m_lblDataStorageWarning, true); GuiUtilities::setLabelAsNotice(m_ui->m_lblMysqlInfo, false); GuiUtilities::setLabelAsNotice(m_ui->m_lblSqliteInMemoryWarnings, true); - connect(m_ui->m_cmbDatabaseDriver, static_cast(&QComboBox::currentIndexChanged), this, &SettingsDatabase::dirtifySettings); + connect(m_ui->m_cmbDatabaseDriver, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsDatabase::dirtifySettings); connect(m_ui->m_checkSqliteUseInMemoryDatabase, &QCheckBox::toggled, this, &SettingsDatabase::dirtifySettings); connect(m_ui->m_txtMysqlDatabase->lineEdit(), &QLineEdit::textChanged, this, &SettingsDatabase::dirtifySettings); connect(m_ui->m_txtMysqlHostname->lineEdit(), &QLineEdit::textChanged, this, &SettingsDatabase::dirtifySettings); @@ -38,14 +39,16 @@ SettingsDatabase::SettingsDatabase(Settings* settings, QWidget* parent) connect(m_ui->m_checkUseTransactions, &QCheckBox::toggled, this, &SettingsDatabase::dirtifySettings); connect(m_ui->m_txtMysqlUsername->lineEdit(), &QLineEdit::textChanged, this, &SettingsDatabase::dirtifySettings); connect(m_ui->m_spinMysqlPort, static_cast(&QSpinBox::valueChanged), this, &SettingsDatabase::dirtifySettings); - connect(m_ui->m_cmbDatabaseDriver, static_cast(&QComboBox::currentIndexChanged), this, &SettingsDatabase::selectSqlBackend); + connect(m_ui->m_cmbDatabaseDriver, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsDatabase::selectSqlBackend); connect(m_ui->m_checkMysqlShowPassword, &QCheckBox::toggled, this, &SettingsDatabase::switchMysqlPasswordVisiblity); connect(m_ui->m_txtMysqlUsername->lineEdit(), &BaseLineEdit::textChanged, this, &SettingsDatabase::onMysqlUsernameChanged); connect(m_ui->m_txtMysqlHostname->lineEdit(), &BaseLineEdit::textChanged, this, &SettingsDatabase::onMysqlHostnameChanged); connect(m_ui->m_txtMysqlPassword->lineEdit(), &BaseLineEdit::textChanged, this, &SettingsDatabase::onMysqlPasswordChanged); connect(m_ui->m_txtMysqlDatabase->lineEdit(), &BaseLineEdit::textChanged, this, &SettingsDatabase::onMysqlDatabaseChanged); connect(m_ui->m_btnMysqlTestSetup, &QPushButton::clicked, this, &SettingsDatabase::mysqlTestConnection); - connect(m_ui->m_cmbDatabaseDriver, static_cast(&QComboBox::currentIndexChanged), this, &SettingsDatabase::requireRestart); + connect(m_ui->m_cmbDatabaseDriver, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsDatabase::requireRestart); connect(m_ui->m_checkSqliteUseInMemoryDatabase, &QCheckBox::toggled, this, &SettingsDatabase::requireRestart); connect(m_ui->m_spinMysqlPort, &QSpinBox::editingFinished, this, &SettingsDatabase::requireRestart); connect(m_ui->m_txtMysqlHostname->lineEdit(), &BaseLineEdit::textEdited, this, &SettingsDatabase::requireRestart); @@ -140,7 +143,8 @@ void SettingsDatabase::switchMysqlPasswordVisiblity(bool visible) { void SettingsDatabase::loadSettings() { onBeginLoadSettings(); m_ui->m_checkUseTransactions->setChecked(qApp->settings()->value(GROUP(Database), SETTING(Database::UseTransactions)).toBool()); - m_ui->m_lblMysqlTestResult->setStatus(WidgetWithStatus::Information, tr("No connection test triggered so far."), tr("You did not executed any connection test yet.")); + m_ui->m_lblMysqlTestResult->setStatus(WidgetWithStatus::Information, tr("No connection test triggered so far."), + tr("You did not executed any connection test yet.")); // Load SQLite. m_ui->m_cmbDatabaseDriver->addItem(qApp->database()->humanDriverName(DatabaseFactory::SQLITE), APP_DB_SQLITE_DRIVER); // Load in-memory database status. @@ -160,13 +164,15 @@ void SettingsDatabase::loadSettings() { m_ui->m_txtMysqlDatabase->lineEdit()->setPlaceholderText(tr("Working database which you have full access to.")); m_ui->m_txtMysqlHostname->lineEdit()->setText(settings()->value(GROUP(Database), SETTING(Database::MySQLHostname)).toString()); m_ui->m_txtMysqlUsername->lineEdit()->setText(settings()->value(GROUP(Database), SETTING(Database::MySQLUsername)).toString()); - m_ui->m_txtMysqlPassword->lineEdit()->setText(TextFactory::decrypt(settings()->value(GROUP(Database), SETTING(Database::MySQLPassword)).toString())); + m_ui->m_txtMysqlPassword->lineEdit()->setText(TextFactory::decrypt(settings()->value(GROUP(Database), + SETTING(Database::MySQLPassword)).toString())); m_ui->m_txtMysqlDatabase->lineEdit()->setText(settings()->value(GROUP(Database), SETTING(Database::MySQLDatabase)).toString()); m_ui->m_spinMysqlPort->setValue(settings()->value(GROUP(Database), SETTING(Database::MySQLPort)).toInt()); m_ui->m_checkMysqlShowPassword->setChecked(false); } - int index_current_backend = m_ui->m_cmbDatabaseDriver->findData(settings()->value(GROUP(Database), SETTING(Database::ActiveDriver)).toString()); + int index_current_backend = m_ui->m_cmbDatabaseDriver->findData(settings()->value(GROUP(Database), + SETTING(Database::ActiveDriver)).toString()); if (index_current_backend >= 0) { m_ui->m_cmbDatabaseDriver->setCurrentIndex(index_current_backend); diff --git a/src/gui/settings/settingsdownloads.cpp b/src/gui/settings/settingsdownloads.cpp index cfe82729e..deffd394b 100755 --- a/src/gui/settings/settingsdownloads.cpp +++ b/src/gui/settings/settingsdownloads.cpp @@ -61,7 +61,8 @@ void SettingsDownloads::loadSettings() { void SettingsDownloads::saveSettings() { onBeginSaveSettings(); - settings()->setValue(GROUP(Downloads), Downloads::ShowDownloadsWhenNewDownloadStarts, m_ui->m_checkOpenManagerWhenDownloadStarts->isChecked()); + settings()->setValue(GROUP(Downloads), Downloads::ShowDownloadsWhenNewDownloadStarts, + m_ui->m_checkOpenManagerWhenDownloadStarts->isChecked()); settings()->setValue(GROUP(Downloads), Downloads::TargetDirectory, m_ui->m_txtDownloadsTargetDirectory->text()); settings()->setValue(GROUP(Downloads), Downloads::AlwaysPromptForFilename, m_ui->m_rbDownloadsAskEachFile->isChecked()); qApp->downloadManager()->setDownloadDirectory(m_ui->m_txtDownloadsTargetDirectory->text()); diff --git a/src/gui/settings/settingsfeedsmessages.cpp b/src/gui/settings/settingsfeedsmessages.cpp index 41e6ffda6..a2fbe56e8 100755 --- a/src/gui/settings/settingsfeedsmessages.cpp +++ b/src/gui/settings/settingsfeedsmessages.cpp @@ -46,10 +46,13 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent connect(m_ui->m_spinHeightImageAttachments, static_cast(&QSpinBox::valueChanged), this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkAutoUpdate, &QCheckBox::toggled, m_ui->m_spinAutoUpdateInterval, &TimeSpinBox::setEnabled); - connect(m_ui->m_spinFeedUpdateTimeout, static_cast(&QSpinBox::valueChanged), this, &SettingsFeedsMessages::dirtifySettings); - connect(m_ui->m_cmbMessagesDateTimeFormat, static_cast(&QComboBox::currentIndexChanged), this, &SettingsFeedsMessages::dirtifySettings); + connect(m_ui->m_spinFeedUpdateTimeout, static_cast(&QSpinBox::valueChanged), this, + &SettingsFeedsMessages::dirtifySettings); + connect(m_ui->m_cmbMessagesDateTimeFormat, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_cmbCountsFeedList, &QComboBox::currentTextChanged, this, &SettingsFeedsMessages::dirtifySettings); - connect(m_ui->m_cmbCountsFeedList, static_cast(&QComboBox::currentIndexChanged), this, &SettingsFeedsMessages::dirtifySettings); + connect(m_ui->m_cmbCountsFeedList, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_btnChangeMessagesFont, &QPushButton::clicked, this, &SettingsFeedsMessages::changeMessagesFont); if (!m_ui->m_spinFeedUpdateTimeout->suffix().startsWith(' ')) { @@ -100,7 +103,8 @@ void SettingsFeedsMessages::loadSettings() { m_ui->m_spinHeightImageAttachments->setValue(settings()->value(GROUP(Messages), SETTING(Messages::MessageHeadImageHeight)).toInt()); initializeMessageDateFormats(); m_ui->m_checkMessagesDateTimeFormat->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::UseCustomDate)).toBool()); - const int index_format = m_ui->m_cmbMessagesDateTimeFormat->findData(settings()->value(GROUP(Messages), SETTING(Messages::CustomDateFormat)).toString()); + const int index_format = m_ui->m_cmbMessagesDateTimeFormat->findData(settings()->value(GROUP(Messages), + SETTING(Messages::CustomDateFormat)).toString()); if (index_format >= 0) { m_ui->m_cmbMessagesDateTimeFormat->setCurrentIndex(index_format); diff --git a/src/gui/settings/settingsgui.cpp b/src/gui/settings/settingsgui.cpp index a9b7bbe91..304600fb7 100755 --- a/src/gui/settings/settingsgui.cpp +++ b/src/gui/settings/settingsgui.cpp @@ -62,12 +62,14 @@ SettingsGui::SettingsGui(Settings* settings, QWidget* parent) : SettingsPanel(se connect(m_ui->m_checkCloseTabsMiddleClick, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings); connect(m_ui->m_checkNewTabDoubleClick, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings); connect(m_ui->m_grbCloseTabs, &QGroupBox::toggled, this, &SettingsGui::dirtifySettings); - connect(m_ui->m_cmbToolbarButtonStyle, static_cast(&QComboBox::currentIndexChanged), this, &SettingsGui::dirtifySettings); + connect(m_ui->m_cmbToolbarButtonStyle, static_cast(&QComboBox::currentIndexChanged), this, + &SettingsGui::dirtifySettings); connect(m_ui->m_editorFeedsToolbar, &ToolBarEditor::setupChanged, this, &SettingsGui::dirtifySettings); connect(m_ui->m_editorMessagesToolbar, &ToolBarEditor::setupChanged, this, &SettingsGui::dirtifySettings); connect(m_ui->m_editorStatusbar, &ToolBarEditor::setupChanged, this, &SettingsGui::dirtifySettings); connect(m_ui->m_listStyles, &QListWidget::currentItemChanged, this, &SettingsGui::dirtifySettings); - connect(m_ui->m_cmbSelectToolBar, static_cast(&QComboBox::currentIndexChanged), m_ui->m_stackedToolbars, &QStackedWidget::setCurrentIndex); + connect(m_ui->m_cmbSelectToolBar, static_cast(&QComboBox::currentIndexChanged), m_ui->m_stackedToolbars, + &QStackedWidget::setCurrentIndex); } SettingsGui::~SettingsGui() { diff --git a/src/miscellaneous/application.cpp b/src/miscellaneous/application.cpp index 49798aa5e..6392d7854 100755 --- a/src/miscellaneous/application.cpp +++ b/src/miscellaneous/application.cpp @@ -56,7 +56,7 @@ Application::Application(const QString& id, int& argc, char** argv) m_urlInterceptor(new NetworkUrlInterceptor(this)), #endif - m_feedReader(nullptr), + m_feedReader(nullptr), m_updateFeedsLock(nullptr), m_userActions(QList()), m_mainForm(nullptr), m_trayIcon(nullptr), m_settings(nullptr), m_system(nullptr), m_skins(nullptr), m_localization(nullptr), m_icons(nullptr), m_database(nullptr), m_downloadManager(nullptr), m_shouldRestart(false) { @@ -68,8 +68,8 @@ Application::Application(const QString& id, int& argc, char** argv) connect(QWebEngineProfile::defaultProfile(), &QWebEngineProfile::downloadRequested, this, &Application::downloadRequested); QWebEngineProfile::defaultProfile()->setRequestInterceptor(m_urlInterceptor); - // TODO: Call load settings when saving app settings from dialog. - // Will need add that if I add more settings in the future. + // TODO: Call load settings when saving app settings from dialog. + // Will need add that if I add more settings in the future. m_urlInterceptor->loadSettings(); #endif } diff --git a/src/miscellaneous/application.h b/src/miscellaneous/application.h index 0836dfca9..47ecde42a 100755 --- a/src/miscellaneous/application.h +++ b/src/miscellaneous/application.h @@ -120,7 +120,7 @@ class Application : public QtSingleApplication { // Returns pointer to "GOD" application singleton. inline static Application* instance() { - return static_cast(QCoreApplication::instance()); + return static_cast(QCoreApplication::instance()); } public slots: diff --git a/src/miscellaneous/databasefactory.cpp b/src/miscellaneous/databasefactory.cpp index 5641b48e6..93eaf9320 100755 --- a/src/miscellaneous/databasefactory.cpp +++ b/src/miscellaneous/databasefactory.cpp @@ -654,7 +654,8 @@ QSqlDatabase DatabaseFactory::mysqlInitializeDatabase(const QString& connection_ QSqlQuery query_db(database); query_db.setForwardOnly(true); - if (!query_db.exec(QString("USE %1").arg(database_name)) || !query_db.exec(QSL("SELECT inf_value FROM Information WHERE inf_key = 'schema_version'"))) { + if (!query_db.exec(QString("USE %1").arg(database_name)) + || !query_db.exec(QSL("SELECT inf_value FROM Information WHERE inf_key = 'schema_version'"))) { // If no "rssguard" database exists or schema version is wrong, then initialize it. qWarning("Error occurred. MySQL database is not initialized. Initializing now."); QFile file_init(APP_SQL_PATH + QDir::separator() + APP_DB_MYSQL_INIT); diff --git a/src/miscellaneous/databasequeries.cpp b/src/miscellaneous/databasequeries.cpp index 6b055ff14..a060cd37d 100755 --- a/src/miscellaneous/databasequeries.cpp +++ b/src/miscellaneous/databasequeries.cpp @@ -551,9 +551,11 @@ int DatabaseQueries::updateMessages(QSqlDatabase db, // Now, we update it if at least one of next conditions is true: // 1) Message has custom ID AND (its date OR read status OR starred status are changed). // 2) Message has its date fetched from feed AND its date is different from date in DB and contents is changed. - if (/* 1 */ (!message.m_customId.isEmpty() && (message.m_created.toMSecsSinceEpoch() != date_existing_message || message.m_isRead != is_read_existing_message + if (/* 1 */ (!message.m_customId.isEmpty() && (message.m_created.toMSecsSinceEpoch() != date_existing_message + || message.m_isRead != is_read_existing_message || message.m_isImportant != is_important_existing_message)) || - /* 2 */ (message.m_createdFromFeed && message.m_created.toMSecsSinceEpoch() != date_existing_message && message.m_contents != contents_existing_message)) { + /* 2 */ (message.m_createdFromFeed && message.m_created.toMSecsSinceEpoch() != date_existing_message + && message.m_contents != contents_existing_message)) { // Message exists, it is changed, update it. query_update.bindValue(QSL(":title"), message.m_title); query_update.bindValue(QSL(":is_read"), (int) message.m_isRead); @@ -730,7 +732,8 @@ bool DatabaseQueries::cleanFeeds(QSqlDatabase db, const QStringList& ids, bool c bool DatabaseQueries::purgeLeftoverMessages(QSqlDatabase db, int account_id) { QSqlQuery q(db); q.setForwardOnly(true); - q.prepare(QSL("DELETE FROM Messages WHERE account_id = :account_id AND feed NOT IN (SELECT custom_id FROM Feeds WHERE account_id = :account_id);")); + q.prepare( + QSL("DELETE FROM Messages WHERE account_id = :account_id AND feed NOT IN (SELECT custom_id FROM Feeds WHERE account_id = :account_id);")); q.bindValue(QSL(":account_id"), account_id); if (!q.exec()) { diff --git a/src/network-web/adblock/adblockaddsubscriptiondialog.cpp b/src/network-web/adblock/adblockaddsubscriptiondialog.cpp index 46d83e5f3..86305b5d6 100755 --- a/src/network-web/adblock/adblockaddsubscriptiondialog.cpp +++ b/src/network-web/adblock/adblockaddsubscriptiondialog.cpp @@ -28,37 +28,41 @@ AdBlockAddSubscriptionDialog::AdBlockAddSubscriptionDialog(QWidget* parent) m_ui->setupUi(this); m_knownSubscriptions << Subscription(QSL("EasyList (English)"), ADBLOCK_EASYLIST_URL) << Subscription(QSL("BSI Lista Polska (Polish)"), QSL("http://www.bsi.info.pl/filtrABP.txt")) - << Subscription(QSL("EasyList Czech and Slovak (Czech)"), QSL("https://raw.githubusercontent.com/tomasko126/easylistczechandslovak/master/filters.txt")) + << Subscription(QSL("EasyList Czech and Slovak (Czech)"), + QSL("https://raw.githubusercontent.com/tomasko126/easylistczechandslovak/master/filters.txt")) << Subscription(QSL("dutchblock (Dutch)"), QSL("http://groenewoudt.net/dutchblock/list.txt")) << Subscription(QSL("Filtros Nauscopicos (Spanish)"), QSL("http://abp.mozilla-hispano.org/nauscopio/filtros.txt")) << Subscription(QSL("IsraelList (Hebrew)"), QSL("http://secure.fanboy.co.nz/israelilist/IsraelList.txt")) << Subscription(QSL("NLBlock (Dutch)"), QSL("http://www.verzijlbergh.com/adblock/nlblock.txt")) - << Subscription(QSL("Peter Lowe's list (English)"), QSL("http://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext")) + << Subscription(QSL("Peter Lowe's list (English)"), + QSL("http://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&mimetype=plaintext")) << Subscription(QSL("PLgeneral (Polish)"), QSL("http://www.niecko.pl/adblock/adblock.txt")) << Subscription(QSL("Schacks Adblock Plus liste (Danish)"), QSL("http://adblock.schack.dk/block.txt")) << Subscription(QSL("Xfiles (Italian)"), QSL("http://mozilla.gfsolone.com/filtri.txt")) << Subscription(QSL("EasyPrivacy (English)"), QSL("http://easylist-downloads.adblockplus.org/easyprivacy.txt")) << Subscription(QSL("RU Adlist (Russian)"), QSL("https://easylist-downloads.adblockplus.org/advblock.txt")) - << Subscription(QSL("ABPindo (Indonesian)"), QSL("https://raw.githubusercontent.com/heradhis/indonesianadblockrules/master/subscriptions/abpindo.txt")) + << Subscription(QSL("ABPindo (Indonesian)"), + QSL("https://raw.githubusercontent.com/heradhis/indonesianadblockrules/master/subscriptions/abpindo.txt")) << Subscription(QSL("Easylist China (Chinese)"), QSL("https://easylist-downloads.adblockplus.org/easylistchina.txt")) - << Subscription(QSL("Anti-Adblock Killer"), QSL("https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt")) + << Subscription(QSL("Anti-Adblock Killer"), + QSL("https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt")) << Subscription(tr("Other..."), QString()); foreach (const Subscription& subscription, m_knownSubscriptions) { - m_ui->comboBox->addItem(subscription.m_title); + m_ui->m_cmbPresets->addItem(subscription.m_title); } - connect(m_ui->comboBox, static_cast(&QComboBox::currentIndexChanged), - this, &AdBlockAddSubscriptionDialog::indexChanged); + connect(m_ui->comboBox, static_cast(&QComboBox::currentIndexChanged), this, + &AdBlockAddSubscriptionDialog::indexChanged); indexChanged(0); } QString AdBlockAddSubscriptionDialog::title() const { - return m_ui->title->text(); + return m_ui->m_txtTitle->text(); } QString AdBlockAddSubscriptionDialog::url() const { - return m_ui->url->text(); + return m_ui->m_txtUrl->text(); } void AdBlockAddSubscriptionDialog::indexChanged(int index) { @@ -66,10 +70,9 @@ void AdBlockAddSubscriptionDialog::indexChanged(int index) { // "Other..." entry. if (subscription.m_url.isEmpty()) { - m_ui->title->clear(); - m_ui->url->clear(); + m_ui->m_txtTitle->clear(); + m_ui->m_txtUrl->clear(); } - else { int pos = subscription.m_title.indexOf(QLatin1Char('(')); QString title = subscription.m_title; @@ -78,10 +81,10 @@ void AdBlockAddSubscriptionDialog::indexChanged(int index) { title = title.left(pos).trimmed(); } - m_ui->title->setText(title); - m_ui->title->setCursorPosition(0); - m_ui->url->setText(subscription.m_url); - m_ui->url->setCursorPosition(0); + m_ui->m_txtTitle->setText(title); + m_ui->m_txtTitle->setCursorPosition(0); + m_ui->m_txtUrl->setText(subscription.m_url); + m_ui->m_txtUrl->setCursorPosition(0); } } diff --git a/src/network-web/adblock/adblockaddsubscriptiondialog.ui b/src/network-web/adblock/adblockaddsubscriptiondialog.ui index 88b77db8a..c59e2bc69 100755 --- a/src/network-web/adblock/adblockaddsubscriptiondialog.ui +++ b/src/network-web/adblock/adblockaddsubscriptiondialog.ui @@ -7,36 +7,68 @@ 0 0 557 - 162 + 145 Add Subscription - - + + + + + + Use predefined subscription + + + + + + + + 0 + 0 + + + + + + + + + + Title + + + m_txtTitle + + + + + + + Title of subscription + + - + - Title: + URL + + + m_txtUrl - - - - - - Address: + + + Absolute URL to online subscription file - - - @@ -47,15 +79,27 @@ - - - - Add new subscription to AdBlock: + + + + Qt::Vertical - + + + 20 + 40 + + + + + m_cbUsePredefined + m_cmbPresets + m_txtTitle + m_txtUrl + @@ -65,12 +109,12 @@ accept() - 248 - 254 + 283 + 111 157 - 274 + 132 @@ -81,12 +125,12 @@ reject() - 316 - 260 + 351 + 111 286 - 274 + 132 diff --git a/src/network-web/adblock/adblockdialog.cpp b/src/network-web/adblock/adblockdialog.cpp index 31bddec46..113758623 100755 --- a/src/network-web/adblock/adblockdialog.cpp +++ b/src/network-web/adblock/adblockdialog.cpp @@ -31,7 +31,8 @@ AdBlockDialog::AdBlockDialog(QWidget* parent) - : QWidget(parent), m_ui(new Ui::AdBlockDialog), m_manager(AdBlockManager::instance()), m_currentTreeWidget(0), m_currentSubscription(0), m_loaded(false) { + : QWidget(parent), m_ui(new Ui::AdBlockDialog), m_manager(AdBlockManager::instance()), m_currentTreeWidget(0), m_currentSubscription(0), + m_loaded(false) { setAttribute(Qt::WA_DeleteOnClose); m_ui->setupUi(this); #ifdef Q_OS_MACOS diff --git a/src/network-web/adblock/adblockmanager.cpp b/src/network-web/adblock/adblockmanager.cpp index 88cd65ea5..1aee6ae7b 100755 --- a/src/network-web/adblock/adblockmanager.cpp +++ b/src/network-web/adblock/adblockmanager.cpp @@ -102,7 +102,7 @@ bool AdBlockManager::block(QWebEngineUrlRequestInfo& request) { res = true; if (request.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) { - // NOTE: We are blocking main URL frame, we can display "AdBlock error page" or + // NOTE: We are blocking main URL frame, we can display "AdBlock error page" or // redirect to somewhere. request.block(true); } @@ -182,7 +182,7 @@ AdBlockSubscription* AdBlockManager::addSubscription(const QString& title, const subscription->setFilePath(filePath); subscription->loadSubscription(m_disabledRules); m_subscriptions.insert(m_subscriptions.count() - 1, subscription); - // TODO: Reload user stylesheet. + // TODO: Reload user stylesheet. // connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet())); connect(subscription, SIGNAL(subscriptionChanged()), this, SLOT(updateMatcher())); return subscription; @@ -272,11 +272,11 @@ void AdBlockManager::load() { AdBlockCustomList* customList = new AdBlockCustomList(this); m_subscriptions.append(customList); - // Load all subscriptions. + // Load all subscriptions. foreach (AdBlockSubscription* subscription, m_subscriptions) { subscription->loadSubscription(m_disabledRules); - // TODO: Reload user stylesheet. - // connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet())); + // TODO: Reload user stylesheet. + // connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet())); connect(subscription, SIGNAL(subscriptionChanged()), this, SLOT(updateMatcher())); } diff --git a/src/network-web/adblock/adblockmatcher.cpp b/src/network-web/adblock/adblockmatcher.cpp index b2ef565f0..73712f898 100755 --- a/src/network-web/adblock/adblockmatcher.cpp +++ b/src/network-web/adblock/adblockmatcher.cpp @@ -32,7 +32,8 @@ AdBlockMatcher::~AdBlockMatcher() { clear(); } -const AdBlockRule* AdBlockMatcher::match(const QWebEngineUrlRequestInfo& request, const QString& urlDomain, const QString& urlString) const { +const AdBlockRule* AdBlockMatcher::match(const QWebEngineUrlRequestInfo& request, const QString& urlDomain, + const QString& urlString) const { // Exception rules. if (m_networkExceptionTree.find(request, urlDomain, urlString)) { return 0; diff --git a/src/network-web/adblock/adblocksearchtree.cpp b/src/network-web/adblock/adblocksearchtree.cpp index 2ca8b17ed..0096586b6 100755 --- a/src/network-web/adblock/adblocksearchtree.cpp +++ b/src/network-web/adblock/adblocksearchtree.cpp @@ -86,7 +86,8 @@ const AdBlockRule* AdBlockSearchTree::find(const QWebEngineUrlRequestInfo& reque return 0; } -const AdBlockRule* AdBlockSearchTree::prefixSearch(const QWebEngineUrlRequestInfo& request, const QString& domain, const QString& urlString, const QChar* string, int len) const { +const AdBlockRule* AdBlockSearchTree::prefixSearch(const QWebEngineUrlRequestInfo& request, const QString& domain, const QString& urlString, + const QChar* string, int len) const { if (len <= 0) { return 0; } diff --git a/src/network-web/adblock/adblocksubscription.cpp b/src/network-web/adblock/adblocksubscription.cpp index c5b93cd27..7c262b2e4 100755 --- a/src/network-web/adblock/adblocksubscription.cpp +++ b/src/network-web/adblock/adblocksubscription.cpp @@ -208,7 +208,7 @@ const AdBlockRule* AdBlockSubscription::enableRule(int offset) { emit subscriptionChanged(); if (rule->isCssRule()) { - // TODO: Reload user stylesheet. + // TODO: Reload user stylesheet. } return rule; @@ -230,7 +230,7 @@ const AdBlockRule* AdBlockSubscription::disableRule(int offset) { emit subscriptionChanged(); if (rule->isCssRule()) { - // TODO: Reload user stylesheet. + // TODO: Reload user stylesheet. } return rule; @@ -365,7 +365,7 @@ int AdBlockCustomList::addRule(AdBlockRule* rule) { emit subscriptionChanged(); if (rule->isCssRule()) { - // TODO: Reload user stylesheet. + // TODO: Reload user stylesheet. } return m_rules.count() - 1; @@ -382,7 +382,7 @@ bool AdBlockCustomList::removeRule(int offset) { emit subscriptionChanged(); if (rule->isCssRule()) { - // TODO: Reload user stylesheet. + // TODO: Reload user stylesheet. } AdBlockManager::instance()->removeDisabledRule(filter); @@ -400,7 +400,7 @@ const AdBlockRule* AdBlockCustomList::replaceRule(AdBlockRule* rule, int offset) emit subscriptionChanged(); if (rule->isCssRule() || oldRule->isCssRule()) { - // TODO: Reload user stylesheet. + // TODO: Reload user stylesheet. } delete oldRule; diff --git a/src/network-web/basenetworkaccessmanager.cpp b/src/network-web/basenetworkaccessmanager.cpp index 00965aa51..03e989397 100755 --- a/src/network-web/basenetworkaccessmanager.cpp +++ b/src/network-web/basenetworkaccessmanager.cpp @@ -63,7 +63,8 @@ void BaseNetworkAccessManager::loadSettings() { } void BaseNetworkAccessManager::onSslErrors(QNetworkReply* reply, const QList& error) { - qWarning("Ignoring SSL errors for '%s': '%s' (code %d).", qPrintable(reply->url().toString()), qPrintable(reply->errorString()), (int) reply->error()); + qWarning("Ignoring SSL errors for '%s': '%s' (code %d).", qPrintable(reply->url().toString()), qPrintable(reply->errorString()), + (int) reply->error()); reply->ignoreSslErrors(error); } diff --git a/src/network-web/networkurlinterceptor.cpp b/src/network-web/networkurlinterceptor.cpp index 7ded97813..f645752c2 100755 --- a/src/network-web/networkurlinterceptor.cpp +++ b/src/network-web/networkurlinterceptor.cpp @@ -32,7 +32,7 @@ void NetworkUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo& info) { info.setHttpHeader(QByteArrayLiteral("DNT"), QByteArrayLiteral("1")); } - // NOTE: Here we can add custom headers for each webengine request, for example "User-Agent". + // NOTE: Here we can add custom headers for each webengine request, for example "User-Agent". foreach (UrlInterceptor* interceptor, m_interceptors) { interceptor->interceptRequest(info); diff --git a/src/network-web/silentnetworkaccessmanager.cpp b/src/network-web/silentnetworkaccessmanager.cpp index 4af3d0f4e..3a83105ef 100755 --- a/src/network-web/silentnetworkaccessmanager.cpp +++ b/src/network-web/silentnetworkaccessmanager.cpp @@ -36,7 +36,7 @@ SilentNetworkAccessManager::~SilentNetworkAccessManager() { } SilentNetworkAccessManager* SilentNetworkAccessManager::instance() { - return qz_silent_acmanager(); + return qz_silent_acmanager(); } void SilentNetworkAccessManager::onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator) { diff --git a/src/network-web/silentnetworkaccessmanager.h b/src/network-web/silentnetworkaccessmanager.h index 0d1a362ee..1f162ad67 100755 --- a/src/network-web/silentnetworkaccessmanager.h +++ b/src/network-web/silentnetworkaccessmanager.h @@ -38,7 +38,7 @@ class SilentNetworkAccessManager : public BaseNetworkAccessManager { public slots: // This cannot do any GUI stuff. - void onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator); + void onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator); }; #endif // SILENTNETWORKACCESSMANAGER_H diff --git a/src/network-web/webfactory.cpp b/src/network-web/webfactory.cpp index 0acbb5852..a8e0871e5 100755 --- a/src/network-web/webfactory.cpp +++ b/src/network-web/webfactory.cpp @@ -28,7 +28,7 @@ Q_GLOBAL_STATIC(WebFactory, qz_webfactory) WebFactory::WebFactory() - : m_escapes(QMap()), m_deEscapes(QMap()) { + : m_escapes(QMap()), m_deEscapes(QMap()) { } WebFactory::~WebFactory() { @@ -71,7 +71,7 @@ bool WebFactory::openUrlInExternalBrowser(const QString& url) { } WebFactory* WebFactory::instance() { - return qz_webfactory(); + return qz_webfactory(); } QString WebFactory::stripTags(QString text) { @@ -80,7 +80,7 @@ QString WebFactory::stripTags(QString text) { QString WebFactory::escapeHtml(const QString& html) { if (m_escapes.isEmpty()) { - genereteEscapes(); + genereteEscapes(); } QString output = html; diff --git a/src/network-web/webfactory.h b/src/network-web/webfactory.h index 2571d3b4d..ff50fe889 100755 --- a/src/network-web/webfactory.h +++ b/src/network-web/webfactory.h @@ -27,8 +27,8 @@ class QWebEngineSettings; class WebFactory { public: - // Constructor. - explicit WebFactory(); + // Constructor. + explicit WebFactory(); // Destructor. virtual ~WebFactory(); @@ -52,10 +52,10 @@ class WebFactory { private: // Escape sequences generators. - void genereteEscapes(); + void genereteEscapes(); void generateDeescapes(); - QMap m_escapes; + QMap m_escapes; QMap m_deEscapes; }; diff --git a/src/services/abstract/gui/formfeeddetails.cpp b/src/services/abstract/gui/formfeeddetails.cpp index aa85e4304..6237042dc 100755 --- a/src/services/abstract/gui/formfeeddetails.cpp +++ b/src/services/abstract/gui/formfeeddetails.cpp @@ -134,7 +134,8 @@ void FormFeedDetails::onUrlChanged(const QString& new_url) { else if (!new_url.simplified().isEmpty()) { // New url is not well-formed but is not empty on the other hand. - m_ui->m_txtUrl->setStatus(LineEditWithStatus::Warning, tr("The URL does not meet standard pattern. Does your URL start with \"http://\" or \"https://\" prefix.")); + m_ui->m_txtUrl->setStatus(LineEditWithStatus::Warning, + tr("The URL does not meet standard pattern. Does your URL start with \"http://\" or \"https://\" prefix.")); } else { @@ -301,7 +302,8 @@ void FormFeedDetails::createConnections() { connect(m_ui->m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &FormFeedDetails::onUsernameChanged); connect(m_ui->m_txtPassword->lineEdit(), &BaseLineEdit::textChanged, this, &FormFeedDetails::onPasswordChanged); connect(m_ui->m_gbAuthentication, &QGroupBox::toggled, this, &FormFeedDetails::onAuthenticationSwitched); - connect(m_ui->m_cmbAutoUpdateType, static_cast(&QComboBox::currentIndexChanged), this, &FormFeedDetails::onAutoUpdateTypeChanged); + connect(m_ui->m_cmbAutoUpdateType, static_cast(&QComboBox::currentIndexChanged), this, + &FormFeedDetails::onAutoUpdateTypeChanged); connect(m_ui->m_btnFetchMetadata, &QPushButton::clicked, this, &FormFeedDetails::guessFeed); // Icon connections. connect(m_actionFetchIcon, &QAction::triggered, this, &FormFeedDetails::guessIconOnly); diff --git a/src/services/abstract/serviceroot.cpp b/src/services/abstract/serviceroot.cpp index 39e31b649..5cca7ed4e 100755 --- a/src/services/abstract/serviceroot.cpp +++ b/src/services/abstract/serviceroot.cpp @@ -382,14 +382,16 @@ void ServiceRoot::setAccountId(int account_id) { bool ServiceRoot::loadMessagesForItem(RootItem* item, MessagesModel* model) { if (item->kind() == RootItemKind::Bin) { - model->setFilter(QString("Messages.is_deleted = 1 AND Messages.is_pdeleted = 0 AND Messages.account_id = %1").arg(QString::number(accountId()))); + model->setFilter(QString("Messages.is_deleted = 1 AND Messages.is_pdeleted = 0 AND Messages.account_id = %1").arg(QString::number( + accountId()))); } else { QList children = item->getSubTreeFeeds(); QString filter_clause = textualFeedIds(children).join(QSL(", ")); - model->setFilter(QString("Feeds.custom_id IN (%1) AND Messages.is_deleted = 0 AND Messages.is_pdeleted = 0 AND Messages.account_id = %2").arg(filter_clause, - QString::number(accountId()))); + model->setFilter( + QString("Feeds.custom_id IN (%1) AND Messages.is_deleted = 0 AND Messages.is_pdeleted = 0 AND Messages.account_id = %2").arg(filter_clause, + QString::number(accountId()))); qDebug("Loading messages from feeds: %s.", qPrintable(filter_clause)); } diff --git a/src/services/owncloud/gui/formowncloudfeeddetails.cpp b/src/services/owncloud/gui/formowncloudfeeddetails.cpp index f1ff70d1a..196e54ce0 100755 --- a/src/services/owncloud/gui/formowncloudfeeddetails.cpp +++ b/src/services/owncloud/gui/formowncloudfeeddetails.cpp @@ -43,7 +43,8 @@ void FormOwnCloudFeedDetails::apply() { bool renamed = false; if (m_ui->m_txtTitle->lineEdit()->text() != m_editableFeed->title()) { - if (!qobject_cast(m_serviceRoot)->network()->renameFeed(m_ui->m_txtTitle->lineEdit()->text(), m_editableFeed->customId())) { + if (!qobject_cast(m_serviceRoot)->network()->renameFeed(m_ui->m_txtTitle->lineEdit()->text(), + m_editableFeed->customId())) { qWarning("ownCloud: Došlo k problému při prejmenování kanálu s ownCloud ID '%d'.", m_editableFeed->customId()); } @@ -54,7 +55,8 @@ void FormOwnCloudFeedDetails::apply() { // User edited auto-update status. Save it. OwnCloudFeed* new_feed_data = new OwnCloudFeed(); - new_feed_data->setAutoUpdateType(static_cast(m_ui->m_cmbAutoUpdateType->itemData(m_ui->m_cmbAutoUpdateType->currentIndex()).toInt())); + new_feed_data->setAutoUpdateType(static_cast(m_ui->m_cmbAutoUpdateType->itemData( + m_ui->m_cmbAutoUpdateType->currentIndex()).toInt())); new_feed_data->setAutoUpdateInitialInterval(m_ui->m_spinAutoUpdateInterval->value()); qobject_cast(m_editableFeed)->editItself(new_feed_data); delete new_feed_data; @@ -65,9 +67,11 @@ void FormOwnCloudFeedDetails::apply() { } else { - const RootItem* parent = static_cast(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value()); + const RootItem* parent = static_cast(m_ui->m_cmbParentCategory->itemData( + m_ui->m_cmbParentCategory->currentIndex()).value()); const int category_id = parent->kind() == RootItemKind::ServiceRoot ? 0 : parent->customId(); - const bool response = qobject_cast(m_serviceRoot)->network()->createFeed(m_ui->m_txtUrl->lineEdit()->text(), category_id); + const bool response = qobject_cast(m_serviceRoot)->network()->createFeed(m_ui->m_txtUrl->lineEdit()->text(), + category_id); if (response) { // Feed was added online. diff --git a/src/services/owncloud/owncloudserviceentrypoint.cpp b/src/services/owncloud/owncloudserviceentrypoint.cpp index c8fda2ba9..48ca47bf4 100755 --- a/src/services/owncloud/owncloudserviceentrypoint.cpp +++ b/src/services/owncloud/owncloudserviceentrypoint.cpp @@ -55,7 +55,8 @@ QString OwnCloudServiceEntryPoint::code() const { } QString OwnCloudServiceEntryPoint::description() const { - return QObject::tr("The News app is an RSS/Atom feed aggregator. It is part of Nextcloud suite. This plugin implements %1 API.").arg(API_VERSION); + return QObject::tr("The News app is an RSS/Atom feed aggregator. It is part of Nextcloud suite. This plugin implements %1 API.").arg( + API_VERSION); } QString OwnCloudServiceEntryPoint::version() const { diff --git a/src/services/standard/gui/formstandardfeeddetails.cpp b/src/services/standard/gui/formstandardfeeddetails.cpp index 9f01ae692..4bd85bbf8 100755 --- a/src/services/standard/gui/formstandardfeeddetails.cpp +++ b/src/services/standard/gui/formstandardfeeddetails.cpp @@ -41,7 +41,8 @@ void FormStandardFeedDetails::apply() { new_feed->setPasswordProtected(m_ui->m_gbAuthentication->isChecked()); new_feed->setUsername(m_ui->m_txtUsername->lineEdit()->text()); new_feed->setPassword(m_ui->m_txtPassword->lineEdit()->text()); - new_feed->setAutoUpdateType(static_cast(m_ui->m_cmbAutoUpdateType->itemData(m_ui->m_cmbAutoUpdateType->currentIndex()).toInt())); + new_feed->setAutoUpdateType(static_cast(m_ui->m_cmbAutoUpdateType->itemData( + m_ui->m_cmbAutoUpdateType->currentIndex()).toInt())); new_feed->setAutoUpdateInitialInterval(m_ui->m_spinAutoUpdateInterval->value()); if (m_editableFeed == nullptr) { diff --git a/src/services/tt-rss/gui/formeditttrssaccount.cpp b/src/services/tt-rss/gui/formeditttrssaccount.cpp index 7b65ce388..7b934fd41 100755 --- a/src/services/tt-rss/gui/formeditttrssaccount.cpp +++ b/src/services/tt-rss/gui/formeditttrssaccount.cpp @@ -144,14 +144,16 @@ void FormEditTtRssAccount::performTest() { else if (result.apiLevel() < MINIMAL_API_LEVEL) { m_ui->m_lblTestResult->setStatus(WidgetWithStatus::Error, - tr("Selected Tiny Tiny RSS server is running unsupported version of API (%1). At least API level %2 is required.").arg(QString::number(result.apiLevel()), + tr("Selected Tiny Tiny RSS server is running unsupported version of API (%1). At least API level %2 is required.").arg(QString::number( + result.apiLevel()), QString::number(MINIMAL_API_LEVEL)), tr("Selected Tiny Tiny RSS server is running unsupported version of API.")); } else { m_ui->m_lblTestResult->setStatus(WidgetWithStatus::Ok, - tr("Tiny Tiny RSS server is okay, running with API level %1, while at least API level %2 is required.").arg(QString::number(result.apiLevel()), + tr("Tiny Tiny RSS server is okay, running with API level %1, while at least API level %2 is required.").arg(QString::number( + result.apiLevel()), QString::number(MINIMAL_API_LEVEL)), tr("Tiny Tiny RSS server is okay.")); } diff --git a/src/services/tt-rss/gui/formttrssfeeddetails.cpp b/src/services/tt-rss/gui/formttrssfeeddetails.cpp index 1fc8a6e7a..d7b3cce63 100755 --- a/src/services/tt-rss/gui/formttrssfeeddetails.cpp +++ b/src/services/tt-rss/gui/formttrssfeeddetails.cpp @@ -43,7 +43,8 @@ void FormTtRssFeedDetails::apply() { if (m_editableFeed != nullptr) { // User edited auto-update status. Save it. TtRssFeed* new_feed_data = new TtRssFeed(); - new_feed_data->setAutoUpdateType(static_cast(m_ui->m_cmbAutoUpdateType->itemData(m_ui->m_cmbAutoUpdateType->currentIndex()).toInt())); + new_feed_data->setAutoUpdateType(static_cast(m_ui->m_cmbAutoUpdateType->itemData( + m_ui->m_cmbAutoUpdateType->currentIndex()).toInt())); new_feed_data->setAutoUpdateInitialInterval(m_ui->m_spinAutoUpdateInterval->value()); qobject_cast(m_editableFeed)->editItself(new_feed_data); delete new_feed_data; diff --git a/src/services/tt-rss/network/ttrssnetworkfactory.cpp b/src/services/tt-rss/network/ttrssnetworkfactory.cpp index 0d01d0399..f4a3fbae5 100755 --- a/src/services/tt-rss/network/ttrssnetworkfactory.cpp +++ b/src/services/tt-rss/network/ttrssnetworkfactory.cpp @@ -34,7 +34,8 @@ TtRssNetworkFactory::TtRssNetworkFactory() - : m_bareUrl(QString()), m_fullUrl(QString()), m_username(QString()), m_password(QString()), m_forceServerSideUpdate(false), m_authIsUsed(false), + : m_bareUrl(QString()), m_fullUrl(QString()), m_username(QString()), m_password(QString()), m_forceServerSideUpdate(false), + m_authIsUsed(false), m_authUsername(QString()), m_authPassword(QString()), m_sessionId(QString()), m_lastLoginTime(QDateTime()), m_lastError(QNetworkReply::NoError) { } @@ -155,7 +156,8 @@ TtRssGetFeedsCategoriesResponse TtRssNetworkFactory::getFeedsCategories() { json["include_empty"] = true; const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt(); QByteArray result_raw; - NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), + NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, + QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); @@ -165,7 +167,8 @@ TtRssGetFeedsCategoriesResponse TtRssNetworkFactory::getFeedsCategories() { // We are not logged in. login(); json["sid"] = m_sessionId; - network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, + network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), + CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); result = TtRssGetFeedsCategoriesResponse(QString::fromUtf8(result_raw)); @@ -194,7 +197,8 @@ TtRssGetHeadlinesResponse TtRssNetworkFactory::getHeadlines(int feed_id, int lim json["sanitize"] = sanitize; const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt(); QByteArray result_raw; - NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), + NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, + QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); @@ -204,7 +208,8 @@ TtRssGetHeadlinesResponse TtRssNetworkFactory::getHeadlines(int feed_id, int lim // We are not logged in. login(); json["sid"] = m_sessionId; - network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, + network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), + CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); result = TtRssGetHeadlinesResponse(QString::fromUtf8(result_raw)); @@ -231,7 +236,8 @@ TtRssUpdateArticleResponse TtRssNetworkFactory::updateArticles(const QStringList json["field"] = (int) field; const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt(); QByteArray result_raw; - NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), + NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, + QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); @@ -272,7 +278,8 @@ TtRssSubscribeToFeedResponse TtRssNetworkFactory::subscribeToFeed(const QString& const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt(); QByteArray result_raw; - NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), + NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, + QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); @@ -304,7 +311,8 @@ TtRssUnsubscribeFeedResponse TtRssNetworkFactory::unsubscribeFeed(int feed_id) { json["feed_id"] = feed_id; const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt(); QByteArray result_raw; - NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, + NetworkResult network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, + QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); TtRssUnsubscribeFeedResponse result(QString::fromUtf8(result_raw)); @@ -313,7 +321,8 @@ TtRssUnsubscribeFeedResponse TtRssNetworkFactory::unsubscribeFeed(int feed_id) { // We are not logged in. login(); json["sid"] = m_sessionId; - network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), CONTENT_TYPE, result_raw, + network_reply = NetworkFactory::performNetworkOperation(m_fullUrl, timeout, QJsonDocument(json).toJson(QJsonDocument::Compact), + CONTENT_TYPE, result_raw, QNetworkAccessManager::PostOperation, m_authIsUsed, m_authUsername, m_authPassword); result = TtRssUnsubscribeFeedResponse(QString::fromUtf8(result_raw));