From 584edda88ebc6394c12e9cd1565d8ff49f65940d Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 21 Jun 2022 13:23:40 +0200 Subject: [PATCH] const'ify method + use nullptr --- src/lib/bookmarks/bookmarksitemdelegate.h | 2 +- src/lib/downloads/downloaditem.h | 6 +++--- src/lib/downloads/downloadmanager.h | 2 +- src/lib/history/historyitem.h | 2 +- src/lib/plugins/qml/qmlengine.cpp | 4 ++-- src/lib/plugins/qml/qmlengine.h | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/bookmarks/bookmarksitemdelegate.h b/src/lib/bookmarks/bookmarksitemdelegate.h index b8234c93a..56acacaaf 100644 --- a/src/lib/bookmarks/bookmarksitemdelegate.h +++ b/src/lib/bookmarks/bookmarksitemdelegate.h @@ -29,7 +29,7 @@ class FALKON_EXPORT BookmarksItemDelegate : public QStyledItemDelegate Q_OBJECT public: - explicit BookmarksItemDelegate(QTreeView* parent = 0); + explicit BookmarksItemDelegate(QTreeView* parent = nullptr); void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; diff --git a/src/lib/downloads/downloaditem.h b/src/lib/downloads/downloaditem.h index fac639571..981b4ff59 100644 --- a/src/lib/downloads/downloaditem.h +++ b/src/lib/downloads/downloaditem.h @@ -43,10 +43,10 @@ class FALKON_EXPORT DownloadItem : public QWidget public: explicit DownloadItem(QListWidgetItem* item, QWebEngineDownloadItem* downloadItem, const QString &path, const QString &fileName, bool openFile, DownloadManager* manager); - bool isDownloading() { return m_downloading; } + bool isDownloading() const { return m_downloading; } bool isCancelled(); - QTime remainingTime() { return m_remTime; } - double currentSpeed() { return m_currSpeed; } + QTime remainingTime() const { return m_remTime; } + double currentSpeed() const { return m_currSpeed; } int progress(); ~DownloadItem(); void setDownTimer(const QTime &timer) { m_downTimer = timer; } diff --git a/src/lib/downloads/downloadmanager.h b/src/lib/downloads/downloadmanager.h index 7cde467f4..da2ed9adb 100644 --- a/src/lib/downloads/downloadmanager.h +++ b/src/lib/downloads/downloadmanager.h @@ -51,7 +51,7 @@ public: bool askWhatToDo; bool forceChoosingPath; - DownloadInfo(WebPage* p = 0) { + DownloadInfo(WebPage* p = nullptr) { page = p; suggestedFileName = QString(); askWhatToDo = true; diff --git a/src/lib/history/historyitem.h b/src/lib/history/historyitem.h index 2397eba43..01539b05b 100644 --- a/src/lib/history/historyitem.h +++ b/src/lib/history/historyitem.h @@ -26,7 +26,7 @@ class FALKON_EXPORT HistoryItem { public: - explicit HistoryItem(HistoryItem* parent = 0); + explicit HistoryItem(HistoryItem* parent = nullptr); ~HistoryItem(); void changeParent(HistoryItem* parent); diff --git a/src/lib/plugins/qml/qmlengine.cpp b/src/lib/plugins/qml/qmlengine.cpp index 131d5b2a4..5b98b0e6a 100644 --- a/src/lib/plugins/qml/qmlengine.cpp +++ b/src/lib/plugins/qml/qmlengine.cpp @@ -22,7 +22,7 @@ QmlEngine::QmlEngine(QObject *parent) { } -QString QmlEngine::extensionName() +QString QmlEngine::extensionName() const { return m_extensionName; } @@ -32,7 +32,7 @@ void QmlEngine::setExtensionName(const QString &name) m_extensionName = name; } -QString QmlEngine::extensionPath() +QString QmlEngine::extensionPath() const { return m_extensionPath; } diff --git a/src/lib/plugins/qml/qmlengine.h b/src/lib/plugins/qml/qmlengine.h index 064774c97..a904bd66a 100644 --- a/src/lib/plugins/qml/qmlengine.h +++ b/src/lib/plugins/qml/qmlengine.h @@ -24,9 +24,9 @@ class QmlEngine : public QQmlEngine Q_OBJECT public: explicit QmlEngine(QObject *parent = nullptr); - QString extensionName(); + QString extensionName() const; void setExtensionName(const QString &name); - QString extensionPath(); + QString extensionPath() const; void setExtensionPath(const QString &path); private: QString m_extensionName;