Merge branch 'master' into git_is_pepega
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#include "util/Clipboard.hpp"
|
||||
#include <QApplication>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
void crossPlatformCopy(const QString &text)
|
||||
{
|
||||
auto clipboard = QApplication::clipboard();
|
||||
clipboard->setText(text);
|
||||
if (clipboard->supportsSelection())
|
||||
{
|
||||
clipboard->setText(text, QClipboard::Selection);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
void crossPlatformCopy(const QString &text);
|
||||
|
||||
} // namespace chatterino
|
||||
@@ -1,16 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <QString>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
template <typename... Args>
|
||||
auto fS(Args &&... args)
|
||||
{
|
||||
return fmt::format(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
QString generateUuid();
|
||||
|
||||
QString formatRichLink(const QString &url, bool file = false);
|
||||
@@ -21,13 +14,3 @@ QString formatRichNamedLink(const QString &url, const QString &name,
|
||||
QString shortenString(const QString &str, unsigned maxWidth = 50);
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
namespace fmt {
|
||||
|
||||
// format_arg for QString
|
||||
inline void format_arg(BasicFormatter<char> &f, const char *&, const QString &v)
|
||||
{
|
||||
f.writer().write("{}", v.toStdString());
|
||||
}
|
||||
|
||||
} // namespace fmt
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include <QSettings>
|
||||
#include <QVariant>
|
||||
|
||||
#include "debug/Log.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
namespace {
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -63,7 +61,7 @@ namespace {
|
||||
if (command.isNull())
|
||||
return QString();
|
||||
|
||||
log(command);
|
||||
qDebug() << command;
|
||||
|
||||
// inject switch to enable private browsing
|
||||
command = injectPrivateSwitch(command);
|
||||
|
||||
@@ -22,6 +22,19 @@ static void setStringItem(QStandardItem *item, const QString &value,
|
||||
(editable ? (Qt::ItemIsEditable) : 0)));
|
||||
}
|
||||
|
||||
static void setFilePathItem(QStandardItem *item, const QUrl &value)
|
||||
{
|
||||
item->setData(value, Qt::UserRole);
|
||||
item->setData(value.fileName(), Qt::DisplayRole);
|
||||
item->setFlags(Qt::ItemFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable));
|
||||
}
|
||||
|
||||
static void setColorItem(QStandardItem *item, const QColor &value)
|
||||
{
|
||||
item->setData(value, Qt::DecorationRole);
|
||||
item->setFlags(Qt::ItemFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable));
|
||||
}
|
||||
|
||||
static QStandardItem *emptyItem()
|
||||
{
|
||||
auto *item = new QStandardItem();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "util/StreamLink.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "widgets/dialogs/QualityPopup.hpp"
|
||||
@@ -92,7 +91,7 @@ namespace {
|
||||
}
|
||||
else
|
||||
{
|
||||
log("Error occured {}", err);
|
||||
qDebug() << "Error occured" << err;
|
||||
}
|
||||
|
||||
p->deleteLater();
|
||||
@@ -119,7 +118,7 @@ void getStreamQualities(const QString &channelURL,
|
||||
[=](int res) {
|
||||
if (res != 0)
|
||||
{
|
||||
log("Got error code {}", res);
|
||||
qDebug() << "Got error code" << res;
|
||||
// return;
|
||||
}
|
||||
QString lastLine = QString(p->readAllStandardOutput());
|
||||
|
||||
Reference in New Issue
Block a user