Skip to content

Commit

Permalink
Make logToFile a member of ImageUploader
Browse files Browse the repository at this point in the history
  • Loading branch information
Mm2PL committed Nov 18, 2023
1 parent 3068a39 commit bf4fc8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/singletons/ImageUploader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ std::optional<QByteArray> convertToPng(const QImage &image)
namespace chatterino {

// logging information on successful uploads to a json file
void logToFile(const QString originalFilePath, QString imageLink,
QString deletionLink, ChannelPtr channel)
void ImageUploader::logToFile(const QString &originalFilePath,
const QString &imageLink,
const QString &deletionLink, ChannelPtr channel)
{
const QString logFileName =
combinePath((getSettings()->logPath.getValue().isEmpty()
Expand Down Expand Up @@ -247,7 +248,7 @@ void ImageUploader::handleSuccessfulUpload(const NetworkResult &result,
});
}

logToFile(originalFilePath, link, deletionLink, channel);
this->logToFile(originalFilePath, link, deletionLink, channel);
}

void ImageUploader::upload(const QMimeData *source, ChannelPtr channel,
Expand Down
3 changes: 3 additions & 0 deletions src/singletons/ImageUploader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class ImageUploader final : public Singleton
ResizingTextEdit &textEdit);
void handleFailedUpload(const NetworkResult &result, ChannelPtr channel);

void logToFile(const QString &originalFilePath, const QString &imageLink,
const QString &deletionLink, ChannelPtr channel);

// These variables are only used from the main thread.
QMutex uploadMutex_;
std::queue<RawImageData> uploadQueue_;
Expand Down

0 comments on commit bf4fc8c

Please sign in to comment.