Commit 414b82a6 by Amnes1a

提交后拉取

parents 6778b3aa ddf1d57b
......@@ -6,9 +6,12 @@
*.res
*.pdb
*.zip
!linux_lib.zip
!*/plugins/linux_plugins.zip
*.rar
*_manifest.rc
*/plugins/*.dll
!*/plugins/org_commontk_eventadmin*.dll
*/plugins/*.lib
*/plugins/*.pdb
*/plugins/*.rc
......@@ -17,5 +20,7 @@
*/res/resource.h
*/res/MANIFEST.MF
*/res/*.rc
fmPOS/version.h
release/bins/database/Fmtakeout.s3db
release/plugins/FreemudPOS.ini
fmPos.pro.user.d496c5a
......@@ -44,6 +44,8 @@ int main(int argc, char *argv[])
#ifdef Q_OS_WIN
QSettings sets(QCoreApplication::applicationDirPath() + "/" + QString(app).replace(".exe", ".ini"), QSettings::IniFormat);
#else
QSettings sets(QCoreApplication::applicationDirPath() + "/" + QString(app), QSettings::IniFormat);
#endif
download_dir = sets.value(FMP_INIKEY_DOWNLOADPATH, "download").toString();
deploy_dir = sets.value(FMP_INIKEY_DEPLOYPATH, "..").toString();
......@@ -68,95 +70,90 @@ int main(int argc, char *argv[])
QStringList dFilesInfo, bUpdFiles;
QString error;
bool updateReault = true;
bool process_closed = false;
// 开始替换文件
if(dInfoFile.open(QIODevice::ReadOnly))
{
dFilesInfo = QString(dInfoFile.readAll()).split(",");
dInfoFile.close();
}else
{
error = QString("open dfilesInfo.txt failed [%1]").arg(dInfoFile.errorString());
qDebug() << error;
updateReault = false;
goto end;
}
//! 如果更新包含主程序,则关闭主程序
bool process_closed = false;
if (dFilesInfo.contains(app)) {
KillProcessByPid(instance_pid);
//! 如果更新包含主程序,则关闭主程序
if (dFilesInfo.contains(app)) {
KillProcessByPid(instance_pid);
process_closed = true;
}
foreach(QString dfile, dFilesInfo) {
if(!dfile.isEmpty()) {
QString downloadFile = QString("%1/%2").arg(download_dir, dfile);
QString oldFile = QString("%1/%2").arg(deploy_dir, dfile);
QString newName = QString("%1.bak").arg(oldFile);
qDebug() << QString("checking file [%1]").arg(oldFile);
if(!QFile(oldFile).exists()) {
qDebug() << "file not exists";
QDir parent_dir(oldFile.section("/", 0, -2));
if(!parent_dir.exists()) {
if (parent_dir.mkpath(parent_dir.path())) {
qDebug() << "mkdir successful";
process_closed = true;
}
foreach(QString dfile, dFilesInfo) {
if(!dfile.isEmpty()) {
QString downloadFile = QString("%1/%2").arg(download_dir, dfile);
QString oldFile = QString("%1/%2").arg(deploy_dir, dfile);
QString newName = QString("%1.bak").arg(oldFile);
qDebug() << QString("checking file [%1]").arg(oldFile);
if(!QFile(oldFile).exists()) {
qDebug() << "file not exists";
QDir parent_dir(oldFile.section("/", 0, -2));
if(!parent_dir.exists()) {
if (parent_dir.mkpath(parent_dir.path())) {
qDebug() << "mkdir successful";
}
else {
qDebug() << "mkdir failed";
}
}
}
else {
qDebug() << "file exists";
QFile(newName).remove();
if(QFile().rename(oldFile, newName)) {
qDebug() << "rename successful";
}
else {
qDebug() << "mkdir failed";
qDebug() << "rename failed";
}
}
}
else {
qDebug() << "file exists";
QFile(newName).remove();
if(QFile().rename(oldFile, newName)) {
qDebug() << "rename successful";
if(QFile().copy(downloadFile, oldFile)) {
qDebug() << "copy file successful";
}
else {
qDebug() << "rename failed";
}
}
if(QFile().copy(downloadFile, oldFile)) {
qDebug() << "copy file successful";
}
else {
error = "copy file failed";
qDebug() << error;
updateReault = false;
// 回滚文件
foreach(QString file, bUpdFiles) {
qDebug() << QString("rollback file [%1]").arg(file);
QFile(file).remove();
QFile().rename(QString("%1.bak").arg(file), file);
error = "copy file failed";
qDebug() << error;
updateReault = false;
// 回滚文件
foreach(QString file, bUpdFiles) {
qDebug() << QString("rollback file [%1]").arg(file);
QFile(file).remove();
QFile().rename(QString("%1.bak").arg(file), file);
}
break;
}
break;
bUpdFiles.append(oldFile);
}
bUpdFiles.append(oldFile);
}
}
end:
if(resultFile.open(QIODevice::WriteOnly))
if (process_closed) {
// 启动服务
QProcess::startDetached(fmscupdPath, QStringList());
}
}else
{
QByteArray buf;
if(updateReault)
{
buf = "1";
}else
error = QString("open dfilesInfo.txt failed [%1]").arg(dInfoFile.errorString());
qDebug() << error;
updateReault = false;
if(resultFile.open(QIODevice::WriteOnly))
{
buf = QString("0%1").arg(error).toLatin1();
QByteArray buf;
if(updateReault)
{
buf = "1";
}else
{
buf = QString("0%1").arg(error).toLatin1();
}
resultFile.write(buf);
resultFile.close();
}
resultFile.write(buf);
resultFile.close();
}
if (process_closed) {
// 启动服务
QProcess::startDetached(fmscupdPath, QStringList());
}
return 0;
}
......
[Home]
Position=1552, 58
Position=862, 24
......@@ -10,8 +10,8 @@ SUBDIRS += fmp_manager \
fmp_epay \
fmp_home \
fmp_vip \
fmp_takeout \
fmp_printer \
# fmp_takeout \
# fmp_printer \
FreemudPOS \
FreemudSyncer \
fmp_redeem
......
......@@ -40,7 +40,7 @@ FMPLogger::~FMPLogger()
if (d_ptr) {
delete d_ptr;
d_ptr = nullptr;
d_ptr = 0;
}
}
......@@ -104,4 +104,4 @@ short FMPLogger::GetLogLevel() const
void FMPLogger::SetLogLevel(short level)
{
d_func()->SetLogLevel(level);
}
\ No newline at end of file
}
......@@ -30,8 +30,14 @@ unix {
#Target name
VER = $$system($$PWD/../fmprc.bat $$TARGET)
#VER = 0.1.1
ORIGIN_TARGET = $$TARGET
TARGET = $${TARGET}_$${VER}
win32{
TARGET = $${TARGET}_$${VER}
}
else{
TARGET = $${TARGET}
}
#Header path
INCLUDEPATH += $$PWD/../include/common \
......@@ -44,7 +50,12 @@ LIBS += -L$$PWD/../lib
CONFIG(debug, debug|release) {
#Linking library
LIBS += -lCTKCored -lCTKPluginFrameworkd -llog4cxxd
win32 {
LIBS += -lCTKCored -lCTKPluginFrameworkd -llog4cxxd
}else{
LIBS += -lCTKCore -lCTKPluginFramework -llog4cxx
}
#Destination path
DESTDIR = $$PWD/../debug/plugins
} else {
......
......@@ -36,8 +36,8 @@ int FMPLoggerPrivate::Init()
fn_setenv(L"FMP_PID", pid.toStdWString().c_str());
lib.unload();
#else
setenv("FMP_APP", path.toStdString().c_str());
setenv("FMP_PID", pid.toStdString().c_str());
setenv("FMP_APP", path.toStdString().c_str(),0);
setenv("FMP_PID", pid.toStdString().c_str(),0);
#endif
......
......@@ -32,7 +32,7 @@ public:
if (_stream) {
delete _stream;
_stream = nullptr;
_stream = 0;
}
}
......
......@@ -5,13 +5,13 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 65
#define VER_BUILD 74
//! Convert version numbers to string
#define _STR(S) #S
#define STR(S) _STR(S)
#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)
#define _MAK_VER(maj, min, rev, build) STR(maj.min.rev.build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
......
......@@ -13,7 +13,7 @@
#include <fmp_settings_i.h>
#include <fmp_syncer_i.h>
FMPluginManager::FMPluginManager() : fwContext(nullptr)
FMPluginManager::FMPluginManager() : fwContext(0)
{
}
......@@ -39,7 +39,15 @@ void FMPluginManager::InitService()
fwContext->connectPluginListener(this, SLOT(OnPluginEvent(ctkPluginEvent)));
fwContext->connectServiceListener(this, "OnServiceEvent");
fw->start();
qDebug()<<"fw start";
try{
fw->start();
}
catch(const ctkPluginException &except)
{
qCritical() << "pluginFramework init failed!";
qDebug()<<except.what();
}
//! 设置模块必须第一个加载
FMP_INFO() << "======================== Started ========================";
......@@ -111,7 +119,7 @@ void FMPluginManager::UninitService()
p->stop(ctkPlugin::STOP_TRANSIENT);
}
FMP_INFO() << "======================== Quit ========================";
fwContext = nullptr;
fwContext = 0;
fw->stop();
fw->waitForStop(30000);
qApp->quit();
......@@ -135,14 +143,23 @@ int FMPluginManager::LoadPlugin(const QString &plugin)
try {
if(!plugin.isEmpty()) {
QFileInfo pluginInfo = GetPluginInfo(plugin);
if (pluginInfo.path().isEmpty()) throw ctkPluginException("Empty path for plugin " + plugin);
if (pluginInfo.canonicalPath().isEmpty()) throw ctkPluginException("Empty path for plugin " + plugin);
//! 设置程序当前目录为插件目录,防止插件依赖 Dll 搜索不到导致无法加载
QDir::setCurrent(pluginInfo.path());
QSharedPointer<ctkPlugin> p = fwContext->installPlugin(QUrl::fromLocalFile(pluginInfo.canonicalFilePath()));
if (!p.isNull()) {
p->start(ctkPlugin::START_TRANSIENT);
plugins << p;
QDir::setCurrent(pluginInfo.canonicalPath());
try
{
QSharedPointer<ctkPlugin> p = fwContext->installPlugin(QUrl::fromLocalFile(pluginInfo.canonicalFilePath()));
if (!p.isNull()) {
p->start(ctkPlugin::START_TRANSIENT);
plugins << p;
}
}
catch(ctkPluginException &except)
{
qDebug()<<"install failed:"<<pluginInfo.canonicalFilePath();
qDebug()<<except.what();
}
}
else {
......@@ -282,7 +299,13 @@ QStringList FMPluginManager::GetNewPlugins()
if (fileBasename.startsWith("lib")) fileBasename = fileBasename.mid(3);
QString pluginName;
# ifdef Q_OS_LINUX
pluginName = fileBasename.section("_", 0, 1).replace("_", "."); //ubuntu use soft link
#else
pluginName = fileBasename.section("_", 0, -2).replace("_", ".");
#endif
if(pluginName.contains(QString("commontk")))
continue;
if (!loadedPlugins.contains(pluginName)) {
newPlugins << pluginName;
}
......@@ -328,7 +351,7 @@ QVariantList FMPluginManager::GetExpiredPlugins()
QSharedPointer<ctkPlugin> p;
if (loadedPlugins.contains(pluginName) && (p = loadedPlugins[pluginName])
&& plugin_ver > p->getVersion().toString()) {
expiredPlugins << p->getPluginId();
expiredPlugins << (int)p->getPluginId();
}
}
......
......@@ -15,8 +15,14 @@ HEADERS += \
#Target name
VER = $$system($$PWD/../fmprc.bat $$TARGET)
ORIGIN_TARGET = $$TARGET
TARGET = $${TARGET}_$${VER}
win32{
TARGET = $${TARGET}_$${VER}
}
else{
TARGET = $${TARGET}
}
#Header path
INCLUDEPATH += $$PWD/../include/ctk \
......@@ -27,7 +33,11 @@ LIBS += -L$$PWD/../lib
CONFIG(debug, debug|release) {
#Linking library
LIBS += -lCTKCored -lCTKPluginFrameworkd
win32 {
LIBS += -lCTKCored -lCTKPluginFrameworkd
}else{
LIBS += -lCTKCore -lCTKPluginFramework
}
#Destination path
DESTDIR = $$PWD/../debug/plugins
} else {
......
#ifndef FMP_MANAGER_I_H
#define FMP_MANAGER_I_H
#include <QDebug>
#include <QSharedPointer>
#include <QPluginLoader>
#include <QDir>
......@@ -66,7 +67,7 @@ public:
template <class T>
T* GetService()
{
T* svc = nullptr;
T* svc = 0;
FMPContext ctx = GetContext();
if (ctx) {
try {
......@@ -95,7 +96,7 @@ public:
template <class T>
T* GetService(const QString &svcName)
{
T* svc = nullptr;
T* svc = 0;
FMPContext ctx = GetContext();
if (ctx) {
try {
......@@ -199,16 +200,18 @@ public:
}
private:
explicit FMP() : svc(nullptr)
explicit FMP() : svc(0)
{
props[FMP_PROPKEY_LOADER] = "fmp.manager";
props[FMP_PROPKEY_PLUGINPATH] = "../plugins";
props[FMP_PROPKEY_ENTRY] = "fmp.home";
props[FMP_PROPKEY_CFG] = "FreemudPOS.ini";
QFile f(qApp->applicationDirPath() + "/" + props[FMP_PROPKEY_CFG].toString());
QString strFileName = qApp->applicationDirPath() + "/" + props[FMP_PROPKEY_CFG].toString();
QFile f(strFileName);
if (f.exists() && f.open(QFile::ReadWrite)) {
QJsonDocument d = QJsonDocument::fromJson(f.readAll());
QJsonParseError err;
QJsonDocument d = QJsonDocument::fromJson(f.readAll(),&err);
if (!d.isEmpty()) {
props = d.object();
}
......@@ -223,6 +226,7 @@ private:
void Load()
{
QString loaderPath = GetPluginPath( props[FMP_PROPKEY_LOADER].toString());
qDebug()<<"path: "<<loaderPath;
loader.setFileName(loaderPath);
bool loaded = loader.load();
if (!loaded) {
......@@ -251,12 +255,14 @@ private:
filters << pluginFileName + "*" + ".dll";
#else
# ifdef Q_OS_LINUX
filters << pluginFileName + "*" + ".so";
filters << "lib" + pluginFileName + "*" + ".so";
//filters <<"libfmp_manager*.so";
# else
filters << pluginFileName + "*" + ".dylib";
# endif
#endif
QDirIterator dirIter(qApp->applicationDirPath() + "/" + props[FMP_PROPKEY_PLUGINPATH].toString(), filters, QDir::Files);
QString strPluginPath = qApp->applicationDirPath() + "/" + props[FMP_PROPKEY_PLUGINPATH].toString();
QDirIterator dirIter(strPluginPath, filters,QDir::Files);
QString pluginVersion;
QFileInfo pluginFileInfo;
while(dirIter.hasNext()) {
......
......@@ -5,13 +5,13 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 65
#define VER_BUILD 74
//! Convert version numbers to string
#define _STR(S) #S
#define STR(S) _STR(S)
#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)
#define _MAK_VER(maj, min, rev, build) STR(maj.min.rev.build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
......
#ifndef _VERSION_H_
#define _VERSION_H_
#define VER_MAJOR 0
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 65
//! Convert version numbers to string
#define _STR(S) #S
#define STR(S) _STR(S)
#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
#define RES_FILE_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_PRODUCT_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_STR_FILE_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_STR_PRODUCT_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_COMPANY_NAME "上海非码网络科技有限公司\0"
#define RES_COPYRIGHT "Freemud Ltd. Copyright (C) 2014-2017\0"
#define RES_FILE_DESC "fmp.manager\0"
#define RES_INTER_NAME "fmp.manager\0"
#define RES_FILE_NAME "fmp.manager\0"
#define RES_PRODUCT_NAME "fmp.manager\0"
#define RES_FILE_EXT "*\0"
#endif //!_VERSION_H_
......@@ -25,7 +25,12 @@ HEADERS += fmp_network_plugin_p.h \
#Target name
VER = $$system($$PWD/../fmprc.bat $$TARGET)
ORIGIN_TARGET = $$TARGET
TARGET = $${TARGET}_$${VER}
win32{
TARGET = $${TARGET}_$${VER}
}
else{
TARGET = $${TARGET}
}
#Header path
INCLUDEPATH += $$PWD/../include/ctk \
......@@ -36,7 +41,11 @@ LIBS += -L$$PWD/../lib
CONFIG(debug, debug|release) {
#Linking library
win32 {
LIBS += -lCTKCored -lCTKPluginFrameworkd
}else{
LIBS += -lCTKCore -lCTKPluginFramework
}
#Destination path
DESTDIR = $$PWD/../debug/plugins
} else {
......
......@@ -5,13 +5,13 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 65
#define VER_BUILD 74
//! Convert version numbers to string
#define _STR(S) #S
#define STR(S) _STR(S)
#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)
#define _MAK_VER(maj, min, rev, build) STR(maj.min.rev.build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
......
......@@ -5,7 +5,14 @@
#-------------------------------------------------
TEMPLATE = lib
win32 {
QT += core gui network winextras
}
else{
QT += core gui network x11extras
}
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
......@@ -17,7 +24,12 @@ unix {
#Target name
VER = $$system($$PWD/../fmprc.bat $$TARGET)
ORIGIN_TARGET = $$TARGET
TARGET = $${TARGET}_$${VER}
win32{
TARGET = $${TARGET}_$${VER}
}
else{
TARGET = $${TARGET}
}
#Header path
INCLUDEPATH += $$PWD/../include/ctk \
......@@ -31,7 +43,11 @@ LIBS += -L$$PWD/../lib
CONFIG(debug, debug|release) {
#Linking library
win32 {
LIBS += -lCTKCored -lCTKPluginFrameworkd
}else{
LIBS += -lCTKCore -lCTKPluginFramework
}
#Destination path
DESTDIR = $$PWD/../debug/plugins
} else {
......@@ -78,4 +94,4 @@ FORMS += \
consumptiondialog.ui \
couponkeypad.ui \
errcodedialog.ui \
scanningdialog.ui
\ No newline at end of file
scanningdialog.ui
<RCC>
<qresource prefix="/fmp.redeem/META-INF">
<file>MANIFEST.MF</file>
</qresource>
</RCC>
......@@ -3,7 +3,9 @@
#include "couponkeypad.h"
#include "fmp_logger_i.h"
#include <QDebug>
#ifdef WIN32
#include <Windows.h>
#endif
#include <QTimer>
ScanningDialog::ScanningDialog(QWidget * parent, Qt::WindowFlags f) :
......@@ -81,6 +83,7 @@ void ScanningDialog::timeOut()
{
qDebug() << "activateWindow";
FMP_DEBUG() << "activateWindow";
#ifdef WIN32
HWND hForeWnd = ::GetForegroundWindow();
DWORD dwForeID = ::GetWindowThreadProcessId(hForeWnd,NULL);
DWORD dwCurID = ::GetCurrentThreadId();
......@@ -93,7 +96,8 @@ void ScanningDialog::timeOut()
::SetForegroundWindow((HWND)this->effectiveWinId());
::AttachThreadInput(dwCurID,dwForeID,FALSE);
#else
#endif
this->setFocus();
ui->labScaningBar->setFocus();
}
......@@ -101,4 +105,4 @@ void ScanningDialog::timeOut()
ScanningDialog::~ScanningDialog()
{
delete ui;
}
\ No newline at end of file
}
#ifndef _VERSION_H_
#define _VERSION_H_
#define VER_MAJOR 0
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 74
//! Convert version numbers to string
#define _STR(S) #S
#define STR(S) _STR(S)
#define _MAK_VER(maj, min, rev, build) STR(maj.min.rev.build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
#define RES_FILE_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_PRODUCT_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_STR_FILE_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_STR_PRODUCT_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_COMPANY_NAME "上海非码网络科技有限公司\0"
#define RES_COPYRIGHT "Freemud Ltd. Copyright (C) 2014-2017\0"
#define RES_FILE_DESC "fmp.redeem\0"
#define RES_INTER_NAME "fmp.redeem\0"
#define RES_FILE_NAME "fmp.redeem\0"
#define RES_PRODUCT_NAME "fmp.redeem\0"
#define RES_FILE_EXT "*\0"
#endif //!_VERSION_H_
......@@ -25,7 +25,7 @@ FMPSyncer::~FMPSyncer()
if (d_ptr) {
delete d_ptr;
d_ptr = nullptr;
d_ptr = 0;
}
}
......@@ -37,9 +37,11 @@ void FMPSyncer::InitService()
void FMPSyncer::UninitService()
{
if (d_ptr) {
d_ptr->terminate();
d_ptr->Uninit();
// d_ptr->terminate();
// d_ptr->wait();
delete d_ptr;
d_ptr = nullptr;
d_ptr = 0;
}
}
......
......@@ -31,7 +31,12 @@ unix {
#Target name
VER = $$system($$PWD/../fmprc.bat $$TARGET)
ORIGIN_TARGET = $$TARGET
TARGET = $${TARGET}_$${VER}
win32{
TARGET = $${TARGET}_$${VER}
}
else{
TARGET = $${TARGET}
}
#Header path
INCLUDEPATH += $$PWD/../include/ctk \
......@@ -44,11 +49,20 @@ LIBS += -L$$PWD/../lib
CONFIG(debug, debug|release) {
#Linking library
win32 {
LIBS += -lCTKCored -lCTKPluginFrameworkd -lquazipd -lzlibstaticd
}else{
LIBS += -lCTKCore -lCTKPluginFramework -lquazip -lz
}
#Destination path
DESTDIR = $$PWD/../debug/plugins
} else {
LIBS += -lCTKCore -lCTKPluginFramework -lquazip -lzlibstatic
win32 {
LIBS += -lCTKCore -lCTKPluginFramework -lquazip -lzlibstatic
}else{
LIBS += -lCTKCore -lCTKPluginFramework -lquazip -lz
}
DESTDIR = $$PWD/../release/plugins
}
......
......@@ -24,7 +24,8 @@ FMPSyncerPrivate::FMPSyncerPrivate(FMPSyncer *q)
: _inited(false),
sets(0),
nw(0),
q_ptr(q)
q_ptr(q),
bQuit(false)
{
}
......@@ -50,11 +51,10 @@ int FMPSyncerPrivate::Init()
int FMPSyncerPrivate::Uninit()
{
if (!_inited) return FMP_SUCCESS;
bQuit = true;
quit();
wait();
_inited = false;
return FMP_SUCCESS;
}
......@@ -191,11 +191,21 @@ void FMPSyncerPrivate::run()
QString task_id;
while(1) {
FMP_INFO() << QString("check update after %1 ms").arg(sync_interval);
static int nTimes = 0;
QEventLoop eventLoop;
QTimer::singleShot(sync_interval, &eventLoop, &QEventLoop::quit);
QTimer::singleShot(1, &eventLoop, &QEventLoop::quit);
eventLoop.exec();
nTimes++;
if(bQuit)
break; //quit
if(nTimes == sync_interval)
{
FMP_INFO() << QString("check update after %1 ms").arg(sync_interval);
nTimes = 0;
}
else
continue;
//! 如果有更新结果向服务器汇报结果
ReportTask();
......
......@@ -57,6 +57,7 @@ public:
//! QThread
void run();
bool bQuit;
/**
* @brief ReportTask
* 汇报升级任务
......
......@@ -5,13 +5,13 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 65
#define VER_BUILD 74
//! Convert version numbers to string
#define _STR(S) #S
#define STR(S) _STR(S)
#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)
#define _MAK_VER(maj, min, rev, build) STR(maj.min.rev.build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
......
......@@ -67,7 +67,7 @@ echo.//! Convert version numbers to string>> "%version_file%"
echo.#define _STR(S) #S>> "%version_file%"
echo.#define STR(S) _STR(S)>> "%version_file%"
echo.>> "%version_file%"
echo.#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)>> "%version_file%"
echo.#define _MAK_VER(maj, min, rev, build) STR(maj.min.rev.build\0)>> "%version_file%"
echo.#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)>> "%version_file%"
echo.>> "%version_file%"
echo.//! Resource version infomation>> "%version_file%"
......
......@@ -60,7 +60,11 @@ typedef unsigned int log4cxx_uint32_t;
#define LOG4CXX_EXPORT __declspec(dllexport)
#else
// definitions used when using DLL
#ifdef WIN32
#define LOG4CXX_EXPORT __declspec(dllimport)
#else
#define LOG4CXX_EXPORT
#endif
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment