mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
removed unused files
This commit is contained in:
parent
4713862620
commit
a7cd1fbf97
|
@ -82,11 +82,10 @@ SOURCES += \
|
|||
src/common/DownloadManager.cpp \
|
||||
src/common/Env.cpp \
|
||||
src/common/LinkParser.cpp \
|
||||
src/common/NetworkData.cpp \
|
||||
src/common/NetworkPrivate.cpp \
|
||||
src/common/NetworkManager.cpp \
|
||||
src/common/NetworkRequest.cpp \
|
||||
src/common/NetworkResult.cpp \
|
||||
src/common/NetworkTimer.cpp \
|
||||
src/common/UsernameSet.cpp \
|
||||
src/controllers/accounts/Account.cpp \
|
||||
src/controllers/accounts/AccountController.cpp \
|
||||
|
@ -241,13 +240,10 @@ HEADERS += \
|
|||
src/common/DownloadManager.hpp \
|
||||
src/common/LinkParser.hpp \
|
||||
src/common/NetworkCommon.hpp \
|
||||
src/common/NetworkData.hpp \
|
||||
src/common/NetworkPrivate.hpp \
|
||||
src/common/NetworkManager.hpp \
|
||||
src/common/NetworkRequest.hpp \
|
||||
src/common/NetworkRequester.hpp \
|
||||
src/common/NetworkResult.hpp \
|
||||
src/common/NetworkTimer.hpp \
|
||||
src/common/NetworkWorker.hpp \
|
||||
src/common/NullablePtr.hpp \
|
||||
src/common/ProviderId.hpp \
|
||||
src/common/SignalVector.hpp \
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
#include "common/NetworkData.hpp"
|
||||
#include "common/NetworkPrivate.hpp"
|
||||
|
||||
#include "common/NetworkManager.hpp"
|
||||
#include "common/NetworkRequester.hpp"
|
||||
#include "common/NetworkResult.hpp"
|
||||
#include "common/NetworkWorker.hpp"
|
||||
#include "common/Outcome.hpp"
|
||||
#include "debug/AssertInGuiThread.hpp"
|
||||
#include "debug/Log.hpp"
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/NetworkCommon.hpp"
|
||||
#include "common/NetworkTimer.hpp"
|
||||
|
||||
#include <QNetworkRequest>
|
||||
#include <functional>
|
||||
|
@ -12,6 +11,22 @@ namespace chatterino {
|
|||
|
||||
class NetworkResult;
|
||||
|
||||
class NetworkRequester : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void requestUrl();
|
||||
};
|
||||
|
||||
class NetworkWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void doneUrl();
|
||||
};
|
||||
|
||||
struct NetworkData {
|
||||
NetworkData();
|
||||
~NetworkData();
|
|
@ -1,7 +1,6 @@
|
|||
#include "common/NetworkRequest.hpp"
|
||||
|
||||
#include "common/NetworkData.hpp"
|
||||
//#include "common/NetworkManager.hpp"
|
||||
#include "common/NetworkPrivate.hpp"
|
||||
#include "common/Outcome.hpp"
|
||||
#include "common/Version.hpp"
|
||||
#include "debug/AssertInGuiThread.hpp"
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/NetworkCommon.hpp"
|
||||
#include "common/NetworkRequester.hpp"
|
||||
#include "common/NetworkResult.hpp"
|
||||
#include "common/NetworkTimer.hpp"
|
||||
#include "common/NetworkWorker.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class NetworkRequester : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void requestUrl();
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
|
@ -1,41 +0,0 @@
|
|||
#include "common/NetworkTimer.hpp"
|
||||
|
||||
#include "common/NetworkWorker.hpp"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
void NetworkTimer::start()
|
||||
{
|
||||
if (this->timeoutMS_ <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->timer_ = new QTimer;
|
||||
this->timer_->start(this->timeoutMS_);
|
||||
QObject::connect(this->timer_, &QTimer::timeout, [timer = this->timer_] {
|
||||
timer->deleteLater(); //
|
||||
});
|
||||
|
||||
this->started_ = true;
|
||||
}
|
||||
|
||||
bool NetworkTimer::isStarted() const
|
||||
{
|
||||
return this->started_;
|
||||
}
|
||||
|
||||
void NetworkTimer::onTimeout(NetworkWorker *worker,
|
||||
std::function<void()> cb) const
|
||||
{
|
||||
assert(this->timer_ != nullptr);
|
||||
assert(worker != nullptr);
|
||||
|
||||
QObject::connect(this->timer_, &QTimer::timeout, worker, cb);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
|
@ -1,36 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
class QTimer;
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class NetworkWorker;
|
||||
|
||||
class NetworkTimer
|
||||
{
|
||||
QTimer *timer_ = nullptr;
|
||||
|
||||
bool started_{};
|
||||
|
||||
public:
|
||||
int timeoutMS_ = -1;
|
||||
|
||||
NetworkTimer() = default;
|
||||
~NetworkTimer() = default;
|
||||
|
||||
NetworkTimer(const NetworkTimer &other) = delete;
|
||||
NetworkTimer &operator=(const NetworkTimer &other) = delete;
|
||||
|
||||
NetworkTimer(NetworkTimer &&other) = default;
|
||||
NetworkTimer &operator=(NetworkTimer &&other) = default;
|
||||
|
||||
void start();
|
||||
|
||||
void onTimeout(NetworkWorker *worker, std::function<void()> cb) const;
|
||||
|
||||
bool isStarted() const;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
|
@ -1,15 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class NetworkWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void doneUrl();
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
Loading…
Reference in a new issue