mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
disabled updates as a test
This commit is contained in:
parent
2b9b96abb5
commit
f8c4ac8c17
21
src/debug/AssertInGuiThread.hpp
Normal file
21
src/debug/AssertInGuiThread.hpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QThread>
|
||||
#include <cassert>
|
||||
|
||||
namespace AB_NAMESPACE {
|
||||
|
||||
static bool isGuiThread()
|
||||
{
|
||||
return QCoreApplication::instance()->thread() == QThread::currentThread();
|
||||
}
|
||||
|
||||
static void assertInGuiThread()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
assert(isGuiThread());
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace AB_NAMESPACE
|
2
src/debug/Benchmark.cpp
Normal file
2
src/debug/Benchmark.cpp
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include "Inject.hpp"
|
||||
#include "Inject.hpp" #include "Inject.hpp" #include "Inject.hpp"
|
22
src/debug/Benchmark.hpp
Normal file
22
src/debug/Benchmark.hpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include "debug/Log.hpp"
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
namespace AB_NAMESPACE {
|
||||
|
||||
class BenchmarkGuard : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
BenchmarkGuard(const QString &_name);
|
||||
~BenchmarkGuard();
|
||||
qreal getElapsedMs();
|
||||
|
||||
private:
|
||||
QElapsedTimer timer_;
|
||||
QString name_;
|
||||
};
|
||||
|
||||
} // namespace AB_NAMESPACE
|
29
src/debug/Log.hpp
Normal file
29
src/debug/Log.hpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "util/Helpers.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTime>
|
||||
|
||||
namespace AB_NAMESPACE {
|
||||
|
||||
template <typename... Args>
|
||||
inline void log(const std::string &formatString, Args &&... args)
|
||||
{
|
||||
qDebug().noquote() << QTime::currentTime().toString("hh:mm:ss.zzz")
|
||||
<< fS(formatString, std::forward<Args>(args)...).c_str();
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
inline void log(const char *formatString, Args &&... args)
|
||||
{
|
||||
log(std::string(formatString), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
inline void log(const QString &formatString, Args &&... args)
|
||||
{
|
||||
log(formatString.toStdString(), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
} // namespace AB_NAMESPACE
|
|
@ -207,6 +207,8 @@ void Updates::checkForUpdates()
|
|||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
|
||||
QString url =
|
||||
"https://notitia.chatterino.com/version/chatterino/" CHATTERINO_OS "/" +
|
||||
currentBranch();
|
||||
|
|
Loading…
Reference in a new issue