Change to deployment, do not deploy via absolute path, makes DMG path structure ugly. Refacroting, removed old Qt S-S syntax.¨

This commit is contained in:
Martin Rotter 2020-11-27 11:24:43 +01:00
parent 902570a0e0
commit 8af1f2dfe4
18 changed files with 57 additions and 42 deletions

3
.gitignore vendored
View File

@ -23,4 +23,5 @@
# Other files.
*.autosave
*.user*
localization/*qm
localization/*qm
*.TMP

View File

@ -28,8 +28,8 @@ install_name_tool -change "librssguard.dylib" "@executable_path/librssguard.dyli
install_name_tool -change "librssguard.dylib" "@executable_path/librssguard.dylib" "rssguard"
otool -L "RSS Guard.app/Contents/MacOS/rssguard"
make dmg
macdeployqt "./RSS Guard.app" -dmg
#make dmg
# Rename DMG.
set -- *.dmg

View File

@ -1 +1 @@
<a class="button primary" href="%1">%2 (%3)</a>
<a class="button small primary" href="%1">%2 <span style="line-height: 100%; vertical-align: middle; font-size: 55%;">%3</span></a>

View File

@ -1,5 +1,5 @@
<div class="card filled fluid" dir="auto">
<h4 class="doc section">%1 <a class="button primary" href="%3">URL</a> %6</h4>
<h5 class="doc section">%1 <a class="button small primary" href="%3">URL</a> %6</h5>
<div class="doc section">
<div style="text-align: center;">
%2, %5

View File

@ -805,7 +805,9 @@ void FormMain::changeEvent(QEvent* event) {
SystemTrayIcon::isSystemTrayActivated() &&
qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideMainWindowWhenMinimized)).toBool()) {
event->ignore();
QTimer::singleShot(CHANGE_EVENT_DELAY, this, SLOT(switchVisibility()));
QTimer::singleShot(CHANGE_EVENT_DELAY, this, [this]() {
switchVisibility();
});
}
break;

View File

@ -20,10 +20,13 @@ FormRestoreDatabaseSettings::FormRestoreDatabaseSettings(QWidget& parent) : QDia
m_shouldRestart = true;
close();
});
connect(m_ui.m_btnSelectFolder, SIGNAL(clicked()), this, SLOT(selectFolder()));
connect(m_ui.m_groupDatabase, SIGNAL(toggled(bool)), this, SLOT(checkOkButton()));
connect(m_ui.m_groupSettings, SIGNAL(toggled(bool)), this, SLOT(checkOkButton()));
connect(m_ui.m_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(performRestoration()));
connect(m_ui.m_btnSelectFolder, &QPushButton::clicked, this, [this]() {
selectFolder();
});
connect(m_ui.m_groupDatabase, &QGroupBox::toggled, this, &FormRestoreDatabaseSettings::checkOkButton);
connect(m_ui.m_groupSettings, &QGroupBox::toggled, this, &FormRestoreDatabaseSettings::checkOkButton);
connect(m_ui.m_buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked,
this, &FormRestoreDatabaseSettings::performRestoration);
selectFolder(qApp->documentsFolder());
}

View File

@ -133,8 +133,8 @@ void MessagesToolBar::initializeHighlighter() {
m_actionMessageHighlighter->setIcon(m_btnMessageHighlighter->icon());
m_actionMessageHighlighter->setProperty("type", HIGHLIGHTER_ACTION_NAME);
m_actionMessageHighlighter->setProperty("name", tr("Message highlighter"));
connect(m_menuMessageHighlighter, SIGNAL(triggered(QAction*)),
this, SLOT(handleMessageHighlighterChange(QAction*)));
connect(m_menuMessageHighlighter, &QMenu::triggered, this, &MessagesToolBar::handleMessageHighlighterChange);
}
QStringList MessagesToolBar::defaultActions() const {

View File

@ -390,7 +390,7 @@ void MessagesView::openSelectedSourceMessagesExternally() {
// Finally, mark opened messages as read.
if (!selectionModel()->selectedRows().isEmpty()) {
QTimer::singleShot(0, this, SLOT(markSelectedMessagesRead()));
QTimer::singleShot(0, this, &MessagesView::markSelectedMessagesRead);
}
QTimer::singleShot(1000, this, []() {

View File

@ -16,7 +16,7 @@ TrayIconMenu::TrayIconMenu(const QString& title, QWidget* parent) : QMenu(title,
bool TrayIconMenu::event(QEvent* event) {
if (event->type() == QEvent::Show && Application::activeModalWidget() != nullptr) {
QTimer::singleShot(0, this, SLOT(hide()));
QTimer::singleShot(0, this, &TrayIconMenu::hide);
qApp->showGuiMessage(QSL(APP_LONG_NAME),
tr("Close opened modal dialogs first."),
QSystemTrayIcon::Warning, qApp->mainFormWidget(), true);
@ -93,7 +93,7 @@ void SystemTrayIcon::show() {
#else
// Delay avoids race conditions and tray icon is properly displayed.
qDebugNN << LOGSEC_GUI << "Showing tray icon with 1000 ms delay.";
QTimer::singleShot(1000, this, SLOT(showPrivate()));
QTimer::singleShot(1000, this, &SystemTrayIcon::showPrivate);
#endif
}

View File

@ -23,7 +23,7 @@
TreeWidget::TreeWidget(QWidget* parent)
: QTreeWidget(parent), m_refreshAllItemsNeeded(true), m_showMode(ItemShowMode::ItemsCollapsed) {
connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(sheduleRefresh()));
connect(this, &TreeWidget::itemChanged, this, &TreeWidget::sheduleRefresh);
}
void TreeWidget::clear() {

View File

@ -110,7 +110,7 @@ void WebViewer::loadMessages(const QList<Message>& messages, RootItem* root) {
enc_url = QUrl::fromPercentEncoding(enc_url.toUtf8());
enclosures += skin.m_enclosureMarkup.arg(enc_url,
tr("Attachment"), enclosure.m_mimeType);
QSL("📎"), enclosure.m_mimeType);
if (enclosure.m_mimeType.startsWith(QSL("image/"))) {
// Add thumbnail image.

View File

@ -160,5 +160,5 @@ void AdBlockDialog::load() {
}
m_loaded = true;
QTimer::singleShot(50, this, SLOT(loadSubscriptions()));
QTimer::singleShot(50, this, &AdBlockDialog::loadSubscriptions);
}

View File

@ -38,8 +38,11 @@ AdBlockIcon::AdBlockIcon(AdBlockManager* parent)
setText(QSL("AdBlock"));
setMenu(new QMenu());
setIcon(m_enabled ? qApp->icons()->miscIcon(ADBLOCK_ICON_ACTIVE) : qApp->icons()->miscIcon(ADBLOCK_ICON_DISABLED));
connect(m_manager, SIGNAL(enabledChanged(bool)), this, SLOT(setEnabled(bool)));
connect(menu(), SIGNAL(aboutToShow()), this, SLOT(createMenu()));
connect(m_manager, &AdBlockManager::enabledChanged, this, &AdBlockIcon::setEnabled);
connect(menu(), &QMenu::aboutToShow, this, [this]() {
createMenu();
});
connect(this, &QAction::triggered, m_manager, &AdBlockManager::showDialog);
}
@ -64,6 +67,7 @@ void AdBlockIcon::popupBlocked(const QString& ruleString, const QUrl& url) {
}
QPair<AdBlockRule*, QUrl> pair;
pair.first = new AdBlockRule(filter, subscription);
pair.second = url;
m_blockedPopups.append(pair);
@ -96,7 +100,7 @@ void AdBlockIcon::createMenu(QMenu* menu) {
WebPage* page = qApp->mainForm()->tabWidget()->currentWidget()->webBrowser()->viewer()->page();
const QUrl pageUrl = page->url();
menu->addAction(tr("Show AdBlock &settings"), m_manager, SLOT(showDialog()));
menu->addAction(tr("Show AdBlock &settings"), m_manager, &AdBlockManager::showDialog);
menu->addSeparator();
if (!pageUrl.host().isEmpty() && m_enabled && m_manager->canRunOnScheme(pageUrl.scheme())) {
@ -108,12 +112,12 @@ void AdBlockIcon::createMenu(QMenu* menu) {
act->setCheckable(true);
act->setChecked(customList->containsFilter(hostFilter));
act->setData(hostFilter);
connect(act, SIGNAL(triggered()), this, SLOT(toggleCustomFilter()));
connect(act, &QAction::triggered, this, &AdBlockIcon::toggleCustomFilter);
act = menu->addAction(tr("Disable only on this page"));
act->setCheckable(true);
act->setChecked(customList->containsFilter(pageFilter));
act->setData(pageFilter);
connect(act, SIGNAL(triggered()), this, SLOT(toggleCustomFilter()));
connect(act, &QAction::triggered, this, &AdBlockIcon::toggleCustomFilter);
menu->addSeparator();
}
}
@ -164,7 +168,7 @@ void AdBlockIcon::animateIcon() {
void AdBlockIcon::stopAnimation() {
m_timerTicks = 0;
m_flashTimer->stop();
disconnect(m_flashTimer, SIGNAL(timeout()), this, SLOT(animateIcon()));
disconnect(m_flashTimer, &QTimer::timeout, this, &AdBlockIcon::animateIcon);
setEnabled(m_enabled);
}

View File

@ -285,11 +285,11 @@ void AdBlockManager::load() {
// Load all subscriptions.
for (AdBlockSubscription* subscription : m_subscriptions) {
subscription->loadSubscription(m_disabledRules);
connect(subscription, SIGNAL(subscriptionChanged()), this, SLOT(updateMatcher()));
connect(subscription, &AdBlockSubscription::subscriptionChanged, this, &AdBlockManager::updateMatcher);
}
if (lastUpdate.addDays(ADBLOCK_UPDATE_DAYS_INTERVAL) < QDateTime::currentDateTime()) {
QTimer::singleShot(1000 * 60, this, SLOT(updateAllSubscriptions()));
QTimer::singleShot(1000 * 60, this, &AdBlockManager::updateAllSubscriptions);
}
m_matcher->update();

View File

@ -89,7 +89,7 @@ void AdBlockSubscription::loadSubscription(const QStringList& disabledRules) {
QFile file(m_filePath);
if (!file.exists()) {
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
return;
}
@ -98,7 +98,7 @@ void AdBlockSubscription::loadSubscription(const QStringList& disabledRules) {
<< "Unable to open adblock file"
<< QUOTE_W_SPACE(m_filePath)
<< "for reading.";
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
return;
}
@ -115,7 +115,7 @@ void AdBlockSubscription::loadSubscription(const QStringList& disabledRules) {
qWarningNN << LOGSEC_ADBLOCK
<< "Invalid format of AdBlock file"
<< QUOTE_W_SPACE_DOT(m_filePath);
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
return;
}
@ -133,7 +133,7 @@ void AdBlockSubscription::loadSubscription(const QStringList& disabledRules) {
// Initial update.
if (m_rules.isEmpty() && !m_updated) {
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
}
}

View File

@ -35,10 +35,11 @@ AdBlockTreeWidget::AdBlockTreeWidget(AdBlockSubscription* subscription, QWidget*
setAlternatingRowColors(true);
setLayoutDirection(Qt::LeftToRight);
setIndentation(5);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemChanged(QTreeWidgetItem*)));
connect(m_subscription, SIGNAL(subscriptionUpdated()), this, SLOT(subscriptionUpdated()));
connect(m_subscription, SIGNAL(subscriptionError(QString)), this, SLOT(subscriptionError(QString)));
connect(this, &AdBlockTreeWidget::customContextMenuRequested, this, &AdBlockTreeWidget::contextMenuRequested);
connect(this, &AdBlockTreeWidget::itemChanged, this, &AdBlockTreeWidget::itemChanged);
connect(m_subscription, &AdBlockSubscription::subscriptionUpdated, this, &AdBlockTreeWidget::subscriptionUpdated);
connect(m_subscription, &AdBlockSubscription::subscriptionError, this, &AdBlockTreeWidget::subscriptionError);
}
AdBlockSubscription* AdBlockTreeWidget::subscription() const {
@ -76,9 +77,9 @@ void AdBlockTreeWidget::contextMenuRequested(const QPoint& pos) {
QMenu menu;
menu.addAction(tr("Add rule"), this, SLOT(addRule()));
menu.addAction(tr("Add rule"), this, &AdBlockTreeWidget::addRule);
menu.addSeparator();
QAction* deleteAction = menu.addAction(tr("Remove rule"), this, SLOT(removeRule()));
QAction* deleteAction = menu.addAction(tr("Remove rule"), this, &AdBlockTreeWidget::removeRule);
if (item->parent() == nullptr) {
deleteAction->setDisabled(true);

View File

@ -192,7 +192,9 @@ QAction* WebFactory::engineSettingsAction() {
m_engineSettings = new QAction(qApp->icons()->fromTheme(QSL("applications-internet")), tr("Web engine settings"), this);
m_engineSettings->setMenu(new QMenu());
createMenu(m_engineSettings->menu());
connect(m_engineSettings->menu(), SIGNAL(aboutToShow()), this, SLOT(createMenu()));
connect(m_engineSettings->menu(), &QMenu::aboutToShow, this, [this]() {
createMenu();
});
}
return m_engineSettings;

View File

@ -39,13 +39,15 @@ FormStandardCategoryDetails::~FormStandardCategoryDetails() {
void FormStandardCategoryDetails::createConnections() {
// General connections.
connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(apply()));
connect(m_ui->m_txtTitle->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onTitleChanged(QString)));
connect(m_ui->m_txtDescription->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onDescriptionChanged(QString)));
connect(m_ui->m_buttonBox, &QDialogButtonBox::accepted, this, &FormStandardCategoryDetails::apply);
connect(m_ui->m_txtTitle->lineEdit(), &BaseLineEdit::textChanged,
this, &FormStandardCategoryDetails::onTitleChanged);
connect(m_ui->m_txtDescription->lineEdit(), &BaseLineEdit::textChanged,
this, &FormStandardCategoryDetails::onDescriptionChanged);
// Icon connections.
connect(m_actionLoadIconFromFile, SIGNAL(triggered()), this, SLOT(onLoadIconFromFile()));
connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon()));
connect(m_actionLoadIconFromFile, &QAction::triggered, this, &FormStandardCategoryDetails::onLoadIconFromFile);
connect(m_actionUseDefaultIcon, &QAction::triggered, this, &FormStandardCategoryDetails::onUseDefaultIcon);
}
void FormStandardCategoryDetails::setEditableCategory(StandardCategory* editable_category) {