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() void AboutWidget::openHelpFile()
{ {
QString userManulFile = QCoreApplication::applicationDirPath() + "/userManual.pdf"; qApp->exit();
// QString userManulFile = QCoreApplication::applicationDirPath() + "/userManual.pdf";
QFileInfo file(userManulFile); //
if (file.exists()) // QFileInfo file(userManulFile);
{ // if (file.exists())
QDesktopServices::openUrl(QUrl::fromLocalFile(userManulFile)); // {
} // QDesktopServices::openUrl(QUrl::fromLocalFile(userManulFile));
// }
//else //else
//{ //{
// EQ9MessageBox box; // EQ9MessageBox box;

View File

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