代码拉取完成,页面将自动刷新
#include "error.h"
#include "main.h"
#include <QApplication>
#include <QtDebug>
#include <QFile>
#include <QTextStream>
#include <QtGlobal>
#include <stdio.h>
#include "updatedialog.h"
#include "singleapplication.h"
#define DEBUG 1
#define SERVER_IP "172.17.152.171"
#define SERVER_PORT 8080
QFile *outFile;
// Save log to file by invoked the callback function in application
void _loghandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
QString txt;
txt = QString("%1").arg(msg);
outFile = new QFile("./OtahelperClient.log");
outFile->open(QIODevice::WriteOnly | QIODevice::Append);
QTextStream ts(outFile);
ts << txt << endl;
}
static void initLog()
{
#if (DEBUG == 1)
QDir currDir(".");
if (currDir.exists("OtahelperClient.log"))
currDir.remove("OtahelperClient.log");
qInstallMessageHandler(_loghandler);
#endif
}
static void help()
{
qDebug() << "" \
" qt_simudisp [-p], process libota_sa.so popup_window request and simulate HU send user inputs events to host\n" \
" -a, address of server socket or user_action pipe file path (default path: ${ESYNC_DATA_DIR}}/misc/ota_events/user_action)\n" \
" -p, port of server socket";
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
initLog();
OtaHelperCli u;
UpdateDialog w(&u);
a.installEventFilter(&w);
QCommandLineParser parser;
QCommandLineOption pathOp(QStringList() << "a" << "addr" << "Socket ipaddress or Pipe \"user_action\" path");
parser.addOption(pathOp);
QCommandLineOption portOp(QStringList() << "p" << "port" << "Socket port,(such as 5037)");
parser.addOption(portOp);
parser.process(a.arguments());
QString addrPath = parser.value(pathOp);
QString port = parser.value(portOp);
if (addrPath.isEmpty() || port.isEmpty() || port.toInt()) {
qDebug() << "ERROR: Not give the addrPath or port!" << endl;
help();
//exit(1);
}
//u.setSocketNetPath(addrPath.toLatin1(), port.toInt());
u.setSocketNetPath(QByteArray(SERVER_IP), SERVER_PORT);
u.start();
w.showNormal();
w.activateWindow();
a.exec();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。