mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
clean up warnings
This commit is contained in:
parent
a2fb4ca104
commit
cd571a7e25
7 changed files with 28 additions and 30 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "DownloadManager.hpp"
|
||||
|
||||
#include "debug/Log.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
|
||||
#include <QDesktopServices>
|
||||
|
@ -42,8 +43,7 @@ void DownloadManager::setFile(QString fileURL, const QString &channelName)
|
|||
|
||||
void DownloadManager::onDownloadProgress(qint64 bytesRead, qint64 bytesTotal)
|
||||
{
|
||||
qDebug(QString::number(bytesRead).toLatin1() + " - " +
|
||||
QString::number(bytesTotal).toLatin1());
|
||||
log("Download progress: {}/{}", bytesRead, bytesTotal);
|
||||
}
|
||||
|
||||
void DownloadManager::onFinished(QNetworkReply *reply)
|
||||
|
@ -53,7 +53,7 @@ void DownloadManager::onFinished(QNetworkReply *reply)
|
|||
qDebug("file is downloaded successfully.");
|
||||
} break;
|
||||
default: {
|
||||
qDebug(reply->errorString().toLatin1());
|
||||
qDebug() << reply->errorString().toLatin1();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#include "common/NetworkWorker.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
class NetworkData;
|
||||
|
||||
struct NetworkData;
|
||||
|
||||
class NetworkRequest
|
||||
{
|
||||
|
|
|
@ -62,9 +62,10 @@ namespace detail {
|
|||
while (true) {
|
||||
this->index_ %= this->items_.size();
|
||||
|
||||
if (this->index_ >= this->items_.size()) {
|
||||
this->index_ = this->index_;
|
||||
}
|
||||
// TODO: Figure out what this was supposed to achieve
|
||||
// if (this->index_ >= this->items_.size()) {
|
||||
// this->index_ = this->index_;
|
||||
// }
|
||||
|
||||
if (this->durationOffset_ > this->items_[this->index_].duration) {
|
||||
this->durationOffset_ -= this->items_[this->index_].duration;
|
||||
|
@ -310,7 +311,7 @@ void Image::load()
|
|||
|
||||
return Success;
|
||||
});
|
||||
req.onError([that = this, weak = weakOf(this)](auto result) -> bool {
|
||||
req.onError([weak = weakOf(this)](auto result) -> bool {
|
||||
auto shared = weak.lock();
|
||||
if (!shared) return false;
|
||||
|
||||
|
|
|
@ -35,37 +35,33 @@ bool Toasts::isEnabled()
|
|||
|
||||
void Toasts::sendChannelNotification(const QString &channelName, Platform p)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
auto sendChannelNotification = [this, channelName, p] {
|
||||
this->sendWindowsNotification(channelName, p);
|
||||
};
|
||||
#else
|
||||
auto sendChannelNotification = [] {
|
||||
// Unimplemented for OSX and Linux
|
||||
};
|
||||
#endif
|
||||
// Fetch user profile avatar
|
||||
if (p == Platform::Twitch) {
|
||||
QFileInfo check_file(getPaths()->twitchProfileAvatars + "/twitch/" +
|
||||
channelName + ".png");
|
||||
if (check_file.exists() && check_file.isFile()) {
|
||||
#ifdef Q_OS_WIN
|
||||
this->sendWindowsNotification(channelName, p);
|
||||
#endif
|
||||
// OSX
|
||||
|
||||
// LINUX
|
||||
|
||||
sendChannelNotification();
|
||||
} else {
|
||||
this->fetchChannelAvatar(
|
||||
channelName, [this, channelName, p](QString avatarLink) {
|
||||
channelName,
|
||||
[channelName, sendChannelNotification](QString avatarLink) {
|
||||
DownloadManager *manager = new DownloadManager();
|
||||
manager->setFile(avatarLink, channelName);
|
||||
manager->connect(
|
||||
manager, &DownloadManager::downloadComplete,
|
||||
[this, channelName, p]() {
|
||||
#ifdef Q_OS_WIN
|
||||
this->sendWindowsNotification(channelName, p);
|
||||
#endif
|
||||
// OSX
|
||||
|
||||
// LINUX
|
||||
});
|
||||
manager->connect(manager,
|
||||
&DownloadManager::downloadComplete,
|
||||
sendChannelNotification);
|
||||
});
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace chatterino {
|
||||
|
||||
class Link;
|
||||
struct Link;
|
||||
class ChannelView;
|
||||
class Channel;
|
||||
using ChannelPtr = std::shared_ptr<Channel>;
|
||||
|
|
|
@ -139,7 +139,7 @@ HighlightingPage::HighlightingPage()
|
|||
auto selectFile =
|
||||
customSound.emplace<QPushButton>("Select custom sound file");
|
||||
QObject::connect(selectFile.getElement(), &QPushButton::clicked,
|
||||
this, [this, app] {
|
||||
this, [this] {
|
||||
auto fileName = QFileDialog::getOpenFileName(
|
||||
this, tr("Open Sound"), "",
|
||||
tr("Audio Files (*.mp3 *.wav)"));
|
||||
|
|
|
@ -90,7 +90,7 @@ ModerationPage::ModerationPage()
|
|||
|
||||
// Logs (copied from LoggingMananger)
|
||||
getSettings()->logPath.connect(
|
||||
[app, logsPathLabel](const QString &logPath, auto) mutable {
|
||||
[logsPathLabel](const QString &logPath, auto) mutable {
|
||||
QString pathOriginal;
|
||||
|
||||
if (logPath == "") {
|
||||
|
|
Loading…
Reference in a new issue