Skip to content

Commit

Permalink
fix case with duplicated ip v files when currentfileset is not initia…
Browse files Browse the repository at this point in the history
…lized(right after aurora startup)
  • Loading branch information
w0lek committed Nov 19, 2024
1 parent 98d1b88 commit 36f7c3a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/MainWindow/main_window_ql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ MainWindow::MainWindow(Session* session)
m_ipConfiguratorProcess = std::make_shared<QLIpConfiguratorProcess>();
connect(m_ipConfiguratorProcess.get(), &QLIpConfiguratorProcess::resultReady, this, [this](std::filesystem::path buildPath, std::vector<std::string> filePathes){
auto existedDesignFiles = m_projectManager->getDesignFiles();
// before we add new design file, the current fileset could be empty, so init it with default
QString currentFileSet = m_projectManager->currentFileSet();
if (currentFileSet.isEmpty()) {
currentFileSet = DEFAULT_FOLDER_SOURCE;
}
//

QList<QString> acceptedFiles;
QList<QString> rejectedFiles;
Expand All @@ -260,7 +266,7 @@ MainWindow::MainWindow(Session* session)
}

QString localFilePath = m_projectManager->ProjectFilesPath("", m_projectManager->getProjectName(),
m_projectManager->currentFileSet(), fileInfo.fileName());
currentFileSet, fileInfo.fileName());

if (!localFilePath.startsWith(PROJECT_OSRCDIR)) {
localFilePath.prepend(QString(PROJECT_OSRCDIR) + "/");
Expand Down Expand Up @@ -288,7 +294,7 @@ MainWindow::MainWindow(Session* session)
for (const auto& origFilePath: rejectedFiles) {
QFileInfo fileInfo{origFilePath};
QString destFilePath = m_projectManager->ProjectFilesPath(m_projectManager->getProjectPath(), m_projectManager->getProjectName(),
m_projectManager->currentFileSet(), fileInfo.fileName());
currentFileSet, fileInfo.fileName());

FileUtils::overwriteFile(std::filesystem::path(origFilePath.toStdString()), std::filesystem::path(destFilePath.toStdString()));
}
Expand Down

0 comments on commit 36f7c3a

Please sign in to comment.