feat: remove warning on mac

This commit is contained in:
rankun 2020-04-12 12:21:24 +08:00
parent 5b5a26332b
commit 37eb5b8f06
11 changed files with 26 additions and 25 deletions

View file

@ -53,20 +53,20 @@ void AdbProcess::initSignals()
} else {
emit adbProcessResult(AER_ERROR_START);
QString err = QString("qprocess start error:%1 %2").arg(program()).arg(arguments().join(" "));
qCritical(err.toStdString().c_str());
qCritical() << err.toStdString().c_str();
}
});
connect(this, &QProcess::readyReadStandardError, this, [this]() {
QString tmp = QString::fromUtf8(readAllStandardError()).trimmed();
m_errorOutput += tmp;
qWarning(QString("AdbProcess::error:%1").arg(tmp).toStdString().data());
qWarning() << QString("AdbProcess::error:%1").arg(tmp).toStdString().data();
});
connect(this, &QProcess::readyReadStandardOutput, this, [this]() {
QString tmp = QString::fromUtf8(readAllStandardOutput()).trimmed();
m_standardOutput += tmp;
qInfo(QString("AdbProcess::out:%1").arg(tmp).toStdString().data());
qInfo() << QString("AdbProcess::out:%1").arg(tmp).toStdString().data();
});
connect(this, &QProcess::started, this, [this]() { emit adbProcessResult(AER_SUCCESS_START); });

View file

@ -13,7 +13,7 @@ InputConvertGame::~InputConvertGame() {}
void InputConvertGame::mouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize)
{
// 处理开关按键
if (m_keyMap.isSwitchOnKeyboard() == false && m_keyMap.getSwitchKey() == from->button()) {
if (m_keyMap.isSwitchOnKeyboard() == false && m_keyMap.getSwitchKey() == static_cast<int>(from->button())) {
if (from->type() != QEvent::MouseButtonPress) {
return;
}

View file

@ -24,7 +24,7 @@ private:
void resetCounter();
private:
quint32 m_counterTimer = 0;
qint32 m_counterTimer = 0;
quint32 m_curRendered = 0;
quint32 m_curSkipped = 0;

View file

@ -211,7 +211,7 @@ void Device::initSignals()
connect(m_server, &Server::connectToResult, this, [this](bool success, const QString &deviceName, const QSize &size) {
if (success) {
double diff = m_startTimeCount.elapsed() / 1000.0;
qInfo(QString("server start finish in %1s").arg(diff).toStdString().c_str());
qInfo() << QString("server start finish in %1s").arg(diff).toStdString().c_str();
// update ui
if (m_videoForm) {

View file

@ -102,7 +102,7 @@ bool Recorder::open(const AVCodec *inputCodec)
if (ret < 0) {
char errorbuf[255] = { 0 };
av_strerror(ret, errorbuf, 254);
qCritical(QString("Failed to open output file: %1 %2").arg(errorbuf).arg(m_fileName).toUtf8().toStdString().c_str());
qCritical() << QString("Failed to open output file: %1 %2").arg(errorbuf).arg(m_fileName).toUtf8().toStdString().c_str();
// ostream will be cleaned up during context cleaning
avformat_free_context(m_formatCtx);
m_formatCtx = Q_NULLPTR;
@ -118,10 +118,10 @@ void Recorder::close()
if (m_headerWritten) {
int ret = av_write_trailer(m_formatCtx);
if (ret < 0) {
qCritical(QString("Failed to write trailer to %1").arg(m_fileName).toUtf8().toStdString().c_str());
qCritical() << QString("Failed to write trailer to %1").arg(m_fileName).toUtf8().toStdString().c_str();
m_failed = true;
} else {
qInfo(QString("success record %1").arg(m_fileName).toStdString().c_str());
qInfo() << QString("success record %1").arg(m_fileName).toStdString().c_str();
}
} else {
// the recorded file is empty

View file

@ -12,7 +12,7 @@ class QYUVOpenGLWidget
Q_OBJECT
public:
explicit QYUVOpenGLWidget(QWidget *parent = nullptr);
virtual ~QYUVOpenGLWidget();
virtual ~QYUVOpenGLWidget() override;
QSize minimumSizeHint() const override;
QSize sizeHint() const override;
@ -22,9 +22,9 @@ public:
void updateTextures(quint8 *dataY, quint8 *dataU, quint8 *dataV, quint32 linesizeY, quint32 linesizeU, quint32 linesizeV);
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void initializeGL() override;
void paintGL() override;
void resizeGL(int width, int height) override;
private:
void initShader();

View file

@ -255,7 +255,7 @@ bool Server::startServerByStep()
// try to connect until the server socket is listening on the device.
m_serverSocket.setMaxPendingConnections(2);
if (!m_serverSocket.listen(QHostAddress::LocalHost, m_params.localPort)) {
qCritical(QString("Could not listen on port %1").arg(m_params.localPort).toStdString().c_str());
qCritical() << QString("Could not listen on port %1").arg(m_params.localPort).toStdString().c_str();
m_serverStartStep = SSS_NULL;
if (m_tunnelForward) {
disableTunnelForward();

View file

@ -45,7 +45,7 @@ qint32 VideoSocket::subThreadRecvData(quint8 *buf, qint32 bufSize)
bool VideoSocket::event(QEvent *event)
{
if (event->type() == QScrcpyEvent::VideoSocket) {
if (static_cast<QScrcpyEvent::Type>(event->type()) == QScrcpyEvent::VideoSocket) {
onReadyRead();
return true;
}

View file

@ -27,19 +27,18 @@ static void avLogCallback(void *avcl, int level, const char *fmt, va_list vl)
switch (level) {
case AV_LOG_PANIC:
case AV_LOG_FATAL:
qFatal(localFmt.toUtf8());
break;
qFatal("%s", localFmt.toUtf8().data());
case AV_LOG_ERROR:
qCritical(localFmt.toUtf8());
qCritical() << localFmt.toUtf8();
break;
case AV_LOG_WARNING:
qWarning(localFmt.toUtf8());
qWarning() << localFmt.toUtf8();
break;
case AV_LOG_INFO:
qInfo(localFmt.toUtf8());
qInfo() << localFmt.toUtf8();
break;
case AV_LOG_DEBUG:
//qDebug(localFmt.toUtf8());
// qDebug() << localFmt.toUtf8();
break;
}

View file

@ -212,6 +212,7 @@ void DeviceManage::onControlStateChange(Device *device, Device::GroupControlStat
void DeviceManage::onMouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize)
{
Q_UNUSED(frameSize)
QMapIterator<QString, QPointer<Device>> i(m_devices);
while (i.hasNext()) {
i.next();
@ -228,6 +229,7 @@ void DeviceManage::onMouseEvent(const QMouseEvent *from, const QSize &frameSize,
void DeviceManage::onWheelEvent(const QWheelEvent *from, const QSize &frameSize, const QSize &showSize)
{
Q_UNUSED(frameSize)
QMapIterator<QString, QPointer<Device>> i(m_devices);
while (i.hasNext()) {
i.next();
@ -244,6 +246,7 @@ void DeviceManage::onWheelEvent(const QWheelEvent *from, const QSize &frameSize,
void DeviceManage::onKeyEvent(const QKeyEvent *from, const QSize &frameSize, const QSize &showSize)
{
Q_UNUSED(frameSize)
QMapIterator<QString, QPointer<Device>> i(m_devices);
while (i.hasNext()) {
i.next();

View file

@ -98,10 +98,9 @@ int main(int argc, char *argv[])
g_mainDlg->setWindowTitle(Config::getInstance().getTitle());
g_mainDlg->show();
qInfo(QObject::tr("This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the "
"following address:")
.toUtf8());
qInfo(QString("QtScrcpy %1 <https://github.com/barry-ran/QtScrcpy>").arg(QCoreApplication::applicationVersion()).toUtf8());
qInfo() << QObject::tr("This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the "
"following address:").toUtf8();
qInfo() << QString("QtScrcpy %1 <https://github.com/barry-ran/QtScrcpy>").arg(QCoreApplication::applicationVersion()).toUtf8();
int ret = a.exec();