1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-13 10:32:11 +01:00

const'ify method + use nullptr

This commit is contained in:
Laurent Montel 2022-06-21 13:23:40 +02:00
parent f6b26af2c7
commit 584edda88e
6 changed files with 10 additions and 10 deletions

View File

@ -29,7 +29,7 @@ class FALKON_EXPORT BookmarksItemDelegate : public QStyledItemDelegate
Q_OBJECT Q_OBJECT
public: public:
explicit BookmarksItemDelegate(QTreeView* parent = 0); explicit BookmarksItemDelegate(QTreeView* parent = nullptr);
void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;

View File

@ -43,10 +43,10 @@ class FALKON_EXPORT DownloadItem : public QWidget
public: public:
explicit DownloadItem(QListWidgetItem* item, QWebEngineDownloadItem* downloadItem, const QString &path, const QString &fileName, bool openFile, DownloadManager* manager); 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(); bool isCancelled();
QTime remainingTime() { return m_remTime; } QTime remainingTime() const { return m_remTime; }
double currentSpeed() { return m_currSpeed; } double currentSpeed() const { return m_currSpeed; }
int progress(); int progress();
~DownloadItem(); ~DownloadItem();
void setDownTimer(const QTime &timer) { m_downTimer = timer; } void setDownTimer(const QTime &timer) { m_downTimer = timer; }

View File

@ -51,7 +51,7 @@ public:
bool askWhatToDo; bool askWhatToDo;
bool forceChoosingPath; bool forceChoosingPath;
DownloadInfo(WebPage* p = 0) { DownloadInfo(WebPage* p = nullptr) {
page = p; page = p;
suggestedFileName = QString(); suggestedFileName = QString();
askWhatToDo = true; askWhatToDo = true;

View File

@ -26,7 +26,7 @@
class FALKON_EXPORT HistoryItem class FALKON_EXPORT HistoryItem
{ {
public: public:
explicit HistoryItem(HistoryItem* parent = 0); explicit HistoryItem(HistoryItem* parent = nullptr);
~HistoryItem(); ~HistoryItem();
void changeParent(HistoryItem* parent); void changeParent(HistoryItem* parent);

View File

@ -22,7 +22,7 @@ QmlEngine::QmlEngine(QObject *parent)
{ {
} }
QString QmlEngine::extensionName() QString QmlEngine::extensionName() const
{ {
return m_extensionName; return m_extensionName;
} }
@ -32,7 +32,7 @@ void QmlEngine::setExtensionName(const QString &name)
m_extensionName = name; m_extensionName = name;
} }
QString QmlEngine::extensionPath() QString QmlEngine::extensionPath() const
{ {
return m_extensionPath; return m_extensionPath;
} }

View File

@ -24,9 +24,9 @@ class QmlEngine : public QQmlEngine
Q_OBJECT Q_OBJECT
public: public:
explicit QmlEngine(QObject *parent = nullptr); explicit QmlEngine(QObject *parent = nullptr);
QString extensionName(); QString extensionName() const;
void setExtensionName(const QString &name); void setExtensionName(const QString &name);
QString extensionPath(); QString extensionPath() const;
void setExtensionPath(const QString &path); void setExtensionPath(const QString &path);
private: private:
QString m_extensionName; QString m_extensionName;