diff --git a/app/HGProductionTool/dialog_login.cpp b/app/HGProductionTool/dialog_login.cpp index 68bc211..4546fd3 100644 --- a/app/HGProductionTool/dialog_login.cpp +++ b/app/HGProductionTool/dialog_login.cpp @@ -126,21 +126,23 @@ QString Dialog_logIn::GetProfileName() return m_profileName; } -QString Dialog_logIn::getCurrentExePath() +QString Dialog_logIn::getConfigFilePath() { - HGChar currentPath[256] = { 0 }; - HGBase_GetCurrentDir(currentPath, 256); - strcat(currentPath, "production-tool"); - strcat(currentPath, "/"); - return getStdFileName(StdStringToUtf8(currentPath).c_str()); + HGChar configPath[512]; + HGBase_GetDocumentsPath(configPath, 512); + HGChar procName[512]; + HGBase_GetProcessName(procName, 512); + strcat(configPath, procName); + strcat(configPath, "/Profile/"); + return getStdFileName(StdStringToUtf8(configPath).c_str()); } void Dialog_logIn::updateProfileFileList() { ui->comboBox_filenameList->clear(); - QString currentExePath = getCurrentExePath(); - QDir dir(currentExePath); + QString configFilePath = getConfigFilePath(); + QDir dir(configFilePath); if (dir.exists()) { QFileInfoList fileList = dir.entryInfoList(QDir::Files); @@ -203,7 +205,7 @@ void Dialog_logIn::on_pbtn_login_clicked() saveCfgValue("login", "rememberPassword", ui->checkBox_rememberPswd->isChecked()); saveCfgValue("login", "showPassword", ui->checkBox_showPswd->isChecked()); - m_profileName = getCurrentExePath() + ui->comboBox_filenameList->currentText() + ".json"; + m_profileName = getConfigFilePath() + ui->comboBox_filenameList->currentText() + ".json"; saveCfgValue("login", "profile", m_profileName); m_accountName = account; @@ -254,9 +256,23 @@ void Dialog_logIn::on_pushButton_updateFilename_clicked() void Dialog_logIn::on_pushButton_viewDirectory_clicked() { - QString fileName = getCurrentExePath() + ui->comboBox_filenameList->currentText().toLocal8Bit() + ".json"; + QString configName = ui->comboBox_filenameList->currentText(); + + QString fileName = getConfigFilePath(); + if (!configName.isEmpty()) + { + fileName = getConfigFilePath() + configName.toLocal8Bit() + ".json"; + } + else + { + fileName.chop(1); + HGBase_CreateDir(fileName.toStdString().c_str()); + } + QFileInfo fileInfo(fileName); auto pathDir = fileInfo.path(); QString strFilePath = "file:///" + pathDir; - QDesktopServices::openUrl(QUrl(strFilePath)); + bool ret = QDesktopServices::openUrl(QUrl(strFilePath)); + if (!ret) + QMessageBox::information(this, tr("Prompt"), tr("Profile is not exsits")); } diff --git a/app/HGProductionTool/dialog_login.h b/app/HGProductionTool/dialog_login.h index b56326a..8217432 100644 --- a/app/HGProductionTool/dialog_login.h +++ b/app/HGProductionTool/dialog_login.h @@ -32,7 +32,7 @@ public: QString GetProfileName(); private: - QString getCurrentExePath(); + QString getConfigFilePath(); void updateProfileFileList(); private slots: diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index a8aaa2b..fb3c28f 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -1100,7 +1100,7 @@ public: ret = helper_->io_control(IO_CTRL_CODE_GET_PC_DISTORTION_CHECK_VAL, &dis, &llen); break; } - else if (cnt == 10) + else if (cnt == 20) break; if (is_distortion_get_image_abnormal)