10 volunteer study prepare fix.

This commit is contained in:
Krad
2022-06-10 15:37:28 +08:00
parent 2a891ac1de
commit 74064d1fdf
2 changed files with 22 additions and 12 deletions

View File

@@ -167,13 +167,14 @@ void AboutWidget::initUi()
void AboutWidget::openHelpFile()
{
QString userManulFile = QCoreApplication::applicationDirPath() + "/userManual.pdf";
QFileInfo file(userManulFile);
if (file.exists())
{
QDesktopServices::openUrl(QUrl::fromLocalFile(userManulFile));
}
qApp->exit();
// QString userManulFile = QCoreApplication::applicationDirPath() + "/userManual.pdf";
//
// QFileInfo file(userManulFile);
// if (file.exists())
// {
// QDesktopServices::openUrl(QUrl::fromLocalFile(userManulFile));
// }
//else
//{
// EQ9MessageBox box;

View File

@@ -7,6 +7,7 @@
#include <QTranslator>
#include <QDebug>
#include <QApplication>
#include <iostream>
#include "json/cJSON.h"
const char* strProductFileName = "./cfgs/usct-product.json";
const char* strProductFileNameDefault = "./cfgs/usct-product";
@@ -338,11 +339,19 @@ bool JsonObject::savecfg()
}
char* strJsonData = cJSON_Print((cJSON*)json_root);
if (strlen(strJsonData)>1){
std::stringstream ss;
ss << strJsonData;
outFile << ss.rdbuf();
outFile.flush();
outFile.close();
m_bLoaded = false;
}
else{
std::cout<<"===========================================app want write empty content to cfg json============================================="<<std::endl;
}
delete strJsonData;
return true;
}