diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index 691e8ba03..33f5b23b6 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -26,7 +26,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/src/librssguard/gui/webbrowser.cpp b/src/librssguard/gui/webbrowser.cpp index 6c5269346..28503e48d 100644 --- a/src/librssguard/gui/webbrowser.cpp +++ b/src/librssguard/gui/webbrowser.cpp @@ -91,13 +91,7 @@ void WebBrowser::setHtml(const QString& html, const QUrl& base_url) { m_webView->setHtml(html, base_url); } -WebBrowser::~WebBrowser() { - //m_toolBar->removeAction(m_txtLocationAction); - //m_toolBar->removeAction(m_btnDiscoverFeedsAction); - - // Delete members. Do not use scoped pointers here. - //delete m_layout; -} +WebBrowser::~WebBrowser() {} double WebBrowser::verticalScrollBarPosition() const { return m_webView->verticalScrollBarPosition(); @@ -284,9 +278,9 @@ void WebBrowser::initializeLayout() { m_actionOpenInSystemBrowser->setEnabled(false); m_actionReadabilePage->setEnabled(false); - m_btnDiscoverFeedsAction->setDefaultWidget(new QWidget(this)); + //m_btnDiscoverFeedsAction->setDefaultWidget(new QWidget(this)); - //m_btnDiscoverFeedsAction->setDefaultWidget(m_btnDiscoverFeeds); + m_btnDiscoverFeedsAction->setDefaultWidget(m_btnDiscoverFeeds); // Add needed actions into toolbar. m_toolBar->addAction(m_actionBack); @@ -296,8 +290,8 @@ void WebBrowser::initializeLayout() { m_toolBar->addAction(m_actionOpenInSystemBrowser); m_toolBar->addAction(m_actionReadabilePage); - //m_toolBar->addAction(m_btnDiscoverFeedsAction); - //m_txtLocationAction = m_toolBar->addWidget(m_txtLocation); + m_toolBar->addAction(m_btnDiscoverFeedsAction); + m_txtLocationAction = m_toolBar->addWidget(m_txtLocation); m_loadingProgress = new QProgressBar(this); m_loadingProgress->setFixedHeight(10); diff --git a/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.cpp b/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.cpp index e63dc5ef0..1295f6e76 100644 --- a/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.cpp +++ b/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.cpp @@ -150,29 +150,13 @@ void LiteHtmlViewer::applyFont(const QFont& fon) { QLiteHtmlWidget::setDefaultFont(fon); } -bool LiteHtmlViewer::canZoomIn() const { - return zoomFactor() <= double(MAX_ZOOM_FACTOR) - double(ZOOM_FACTOR_STEP); -} - -bool LiteHtmlViewer::canZoomOut() const { - return zoomFactor() >= double(MIN_ZOOM_FACTOR) + double(ZOOM_FACTOR_STEP); -} - qreal LiteHtmlViewer::zoomFactor() const { return QLiteHtmlWidget::zoomFactor(); } -void LiteHtmlViewer::zoomIn() { - setZoomFactor(zoomFactor() + double(ZOOM_FACTOR_STEP)); -} - -void LiteHtmlViewer::zoomOut() { - setZoomFactor(zoomFactor() - double(ZOOM_FACTOR_STEP)); -} - void LiteHtmlViewer::setZoomFactor(qreal zoom_factor) { if (zoom_factor == 0.0) { - QLiteHtmlWidget::setZoomFactor(0.1); + QLiteHtmlWidget::setZoomFactor(MIN_ZOOM_FACTOR); } else { QLiteHtmlWidget::setZoomFactor(zoom_factor); diff --git a/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.h b/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.h index d1c76ea4d..c5db891d5 100644 --- a/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.h +++ b/src/librssguard/gui/webviewers/litehtml/litehtmlviewer.h @@ -30,11 +30,7 @@ class LiteHtmlViewer : public QLiteHtmlWidget, public WebViewer { virtual double verticalScrollBarPosition() const; virtual void setVerticalScrollBarPosition(double pos); virtual void applyFont(const QFont& fon); - virtual bool canZoomIn() const; - virtual bool canZoomOut() const; virtual qreal zoomFactor() const; - virtual void zoomIn(); - virtual void zoomOut(); virtual void setZoomFactor(qreal zoom_factor); private slots: diff --git a/src/librssguard/gui/webviewers/webengine/webengineviewer.cpp b/src/librssguard/gui/webviewers/webengine/webengineviewer.cpp index a9a73f68c..3d3ae13f9 100644 --- a/src/librssguard/gui/webviewers/webengine/webengineviewer.cpp +++ b/src/librssguard/gui/webviewers/webengine/webengineviewer.cpp @@ -221,26 +221,10 @@ void WebEngineViewer::applyFont(const QFont& fon) { QWebEngineProfile::defaultProfile()->settings()->setFontSize(QWebEngineSettings::DefaultFontSize, pixel_size); } -bool WebEngineViewer::canZoomIn() const { - return zoomFactor() <= double(MAX_ZOOM_FACTOR) - double(ZOOM_FACTOR_STEP); -} - -bool WebEngineViewer::canZoomOut() const { - return zoomFactor() >= double(MIN_ZOOM_FACTOR) + double(ZOOM_FACTOR_STEP); -} - qreal WebEngineViewer::zoomFactor() const { return QWebEngineView::zoomFactor(); } -void WebEngineViewer::zoomIn() { - setZoomFactor(zoomFactor() + double(ZOOM_FACTOR_STEP)); -} - -void WebEngineViewer::zoomOut() { - setZoomFactor(zoomFactor() - double(ZOOM_FACTOR_STEP)); -} - void WebEngineViewer::setZoomFactor(qreal zoom_factor) { QWebEngineView::setZoomFactor(zoom_factor); } diff --git a/src/librssguard/gui/webviewers/webengine/webengineviewer.h b/src/librssguard/gui/webviewers/webengine/webengineviewer.h index 28397fc77..78ff7d275 100644 --- a/src/librssguard/gui/webviewers/webengine/webengineviewer.h +++ b/src/librssguard/gui/webviewers/webengine/webengineviewer.h @@ -32,11 +32,7 @@ class WebEngineViewer : public QWebEngineView, public WebViewer { virtual double verticalScrollBarPosition() const; virtual void setVerticalScrollBarPosition(double pos); virtual void applyFont(const QFont& fon); - virtual bool canZoomIn() const; - virtual bool canZoomOut() const; virtual qreal zoomFactor() const; - virtual void zoomIn(); - virtual void zoomOut(); virtual void setZoomFactor(qreal zoom_factor); virtual QString html() const; virtual QUrl url() const; diff --git a/src/librssguard/gui/webviewers/webviewer.h b/src/librssguard/gui/webviewers/webviewer.h index c5f796390..0e94590c8 100644 --- a/src/librssguard/gui/webviewers/webviewer.h +++ b/src/librssguard/gui/webviewers/webviewer.h @@ -51,14 +51,30 @@ class WebViewer { virtual void applyFont(const QFont& fon) = 0; // Zooming. - virtual bool canZoomIn() const = 0; - virtual bool canZoomOut() const = 0; - virtual void zoomIn() = 0; - virtual void zoomOut() = 0; + virtual bool canZoomIn() const; + virtual bool canZoomOut() const; + virtual void zoomIn(); + virtual void zoomOut(); virtual qreal zoomFactor() const = 0; virtual void setZoomFactor(qreal zoom_factor) = 0; }; inline WebViewer::~WebViewer() {} +inline void WebViewer::zoomIn() { + setZoomFactor(zoomFactor() + double(ZOOM_FACTOR_STEP)); +} + +inline void WebViewer::zoomOut() { + setZoomFactor(zoomFactor() - double(ZOOM_FACTOR_STEP)); +} + +inline bool WebViewer::canZoomIn() const { + return zoomFactor() <= double(MAX_ZOOM_FACTOR) - double(ZOOM_FACTOR_STEP); +} + +inline bool WebViewer::canZoomOut() const { + return zoomFactor() >= double(MIN_ZOOM_FACTOR) + double(ZOOM_FACTOR_STEP); +} + #endif // WEBVIEWER_H diff --git a/src/librssguard/services/gmail/gmailserviceroot.cpp b/src/librssguard/services/gmail/gmailserviceroot.cpp index 147e42bdf..ac30d08b2 100644 --- a/src/librssguard/services/gmail/gmailserviceroot.cpp +++ b/src/librssguard/services/gmail/gmailserviceroot.cpp @@ -26,9 +26,9 @@ GmailServiceRoot::GmailServiceRoot(RootItem* parent) } GmailServiceRoot::~GmailServiceRoot() { - /*if (!m_emailPreview.isNull()) { - m_emailPreview->deleteLater(); - }*/ + if (!m_emailPreview.isNull()) { + m_emailPreview->deleteLater(); + } } void GmailServiceRoot::updateTitle() { @@ -106,7 +106,7 @@ bool GmailServiceRoot::wantsBaggedIdsOfExistingMessages() const { CustomMessagePreviewer* GmailServiceRoot::customMessagePreviewer() { if (m_emailPreview.isNull()) { - m_emailPreview.reset(new EmailPreviewer()); + m_emailPreview = new EmailPreviewer(); } return m_emailPreview.data(); diff --git a/src/librssguard/services/gmail/gmailserviceroot.h b/src/librssguard/services/gmail/gmailserviceroot.h index 5a53232ed..7d48d1dde 100644 --- a/src/librssguard/services/gmail/gmailserviceroot.h +++ b/src/librssguard/services/gmail/gmailserviceroot.h @@ -50,7 +50,7 @@ class GmailServiceRoot : public ServiceRoot, public CacheForServiceRoot { void updateTitle(); private: - QScopedPointer m_emailPreview; + QPointer m_emailPreview; GmailNetworkFactory* m_network; QAction* m_actionReply; Message m_replyToMessage;