Browse Source

Add const to a few pointer arguments

adaptive-webui-19844
thalieht 6 years ago
parent
commit
77aea3c59e
  1. 2
      src/base/net/downloadmanager.cpp
  2. 2
      src/base/net/downloadmanager.h
  3. 2
      src/base/net/smtp.cpp
  4. 2
      src/base/net/smtp.h
  5. 2
      src/base/rss/rss_article.cpp
  6. 2
      src/base/rss/rss_article.h
  7. 4
      src/base/rss/rss_autodownloader.cpp
  8. 4
      src/base/rss/rss_autodownloader.h
  9. 2
      src/gui/properties/piecesbar.cpp
  10. 2
      src/gui/properties/piecesbar.h

2
src/base/net/downloadmanager.cpp

@ -253,7 +253,7 @@ void Net::DownloadManager::applyProxySettings() @@ -253,7 +253,7 @@ void Net::DownloadManager::applyProxySettings()
m_networkManager.setProxy(proxy);
}
void Net::DownloadManager::handleReplyFinished(QNetworkReply *reply)
void Net::DownloadManager::handleReplyFinished(const QNetworkReply *reply)
{
const ServiceID id = ServiceID::fromURL(reply->url());
const auto waitingJobsIter = m_waitingJobs.find(id);

2
src/base/net/downloadmanager.h

@ -115,7 +115,7 @@ namespace Net @@ -115,7 +115,7 @@ namespace Net
explicit DownloadManager(QObject *parent = nullptr);
void applyProxySettings();
void handleReplyFinished(QNetworkReply *reply);
void handleReplyFinished(const QNetworkReply *reply);
static DownloadManager *m_instance;
QNetworkAccessManager m_networkManager;

2
src/base/net/smtp.cpp

@ -285,7 +285,7 @@ void Smtp::readyRead() @@ -285,7 +285,7 @@ void Smtp::readyRead()
}
}
QByteArray Smtp::encodeMimeHeader(const QString &key, const QString &value, QTextCodec *latin1, const QByteArray &prefix)
QByteArray Smtp::encodeMimeHeader(const QString &key, const QString &value, const QTextCodec *latin1, const QByteArray &prefix)
{
QByteArray rv = "";
QByteArray line = key.toLatin1() + ": ";

2
src/base/net/smtp.h

@ -90,7 +90,7 @@ namespace Net @@ -90,7 +90,7 @@ namespace Net
AuthCramMD5
};
QByteArray encodeMimeHeader(const QString &key, const QString &value, QTextCodec *latin1, const QByteArray &prefix = {});
QByteArray encodeMimeHeader(const QString &key, const QString &value, const QTextCodec *latin1, const QByteArray &prefix = {});
void ehlo();
void helo();
void parseEhloResponse(const QByteArray &code, bool continued, const QString &line);

2
src/base/rss/rss_article.cpp

@ -142,7 +142,7 @@ QJsonObject Article::toJsonObject() const @@ -142,7 +142,7 @@ QJsonObject Article::toJsonObject() const
return jsonObj;
}
bool Article::articleDateRecentThan(Article *article, const QDateTime &date)
bool Article::articleDateRecentThan(const Article *article, const QDateTime &date)
{
return article->date() > date;
}

2
src/base/rss/rss_article.h

@ -74,7 +74,7 @@ namespace RSS @@ -74,7 +74,7 @@ namespace RSS
QJsonObject toJsonObject() const;
static bool articleDateRecentThan(Article *article, const QDateTime &date);
static bool articleDateRecentThan(const Article *article, const QDateTime &date);
signals:
void read(Article *article = nullptr);

4
src/base/rss/rss_autodownloader.cpp

@ -347,7 +347,7 @@ void AutoDownloader::handleTorrentDownloadFailed(const QString &url) @@ -347,7 +347,7 @@ void AutoDownloader::handleTorrentDownloadFailed(const QString &url)
// TODO: Re-schedule job here.
}
void AutoDownloader::handleNewArticle(Article *article)
void AutoDownloader::handleNewArticle(const Article *article)
{
if (!article->isRead() && !article->torrentUrl().isEmpty())
addJobForArticle(article);
@ -358,7 +358,7 @@ void AutoDownloader::setRule_impl(const AutoDownloadRule &rule) @@ -358,7 +358,7 @@ void AutoDownloader::setRule_impl(const AutoDownloadRule &rule)
m_rules.insert(rule.name(), rule);
}
void AutoDownloader::addJobForArticle(Article *article)
void AutoDownloader::addJobForArticle(const Article *article)
{
const QString torrentURL = article->torrentUrl();
if (m_waitingJobs.contains(torrentURL)) return;

4
src/base/rss/rss_autodownloader.h

@ -110,14 +110,14 @@ namespace RSS @@ -110,14 +110,14 @@ namespace RSS
void process();
void handleTorrentDownloadFinished(const QString &url);
void handleTorrentDownloadFailed(const QString &url);
void handleNewArticle(Article *article);
void handleNewArticle(const Article *article);
private:
void timerEvent(QTimerEvent *event) override;
void setRule_impl(const AutoDownloadRule &rule);
void resetProcessingQueue();
void startProcessing();
void addJobForArticle(Article *article);
void addJobForArticle(const Article *article);
void processJob(const QSharedPointer<ProcessingJob> &job);
void load();
void loadRules(const QByteArray &data);

2
src/gui/properties/piecesbar.cpp

@ -118,7 +118,7 @@ PiecesBar::PiecesBar(QWidget *parent) @@ -118,7 +118,7 @@ PiecesBar::PiecesBar(QWidget *parent)
setMouseTracking(true);
}
void PiecesBar::setTorrent(BitTorrent::TorrentHandle *torrent)
void PiecesBar::setTorrent(const BitTorrent::TorrentHandle *torrent)
{
m_torrent = torrent;
if (!m_torrent)

2
src/gui/properties/piecesbar.h

@ -50,7 +50,7 @@ class PiecesBar : public QWidget @@ -50,7 +50,7 @@ class PiecesBar : public QWidget
public:
explicit PiecesBar(QWidget *parent = nullptr);
void setTorrent(BitTorrent::TorrentHandle *torrent);
void setTorrent(const BitTorrent::TorrentHandle *torrent);
void setColors(const QColor &background, const QColor &border, const QColor &complete);
virtual void clear();

Loading…
Cancel
Save