FIX: use shellex to open file, avoid cmd window

Change-Id: I6ae868381003c85a319e9c3bad37b0bffc3dbdd7
This commit is contained in:
chunmao.guo 2022-10-19 09:02:19 +08:00 committed by Lane.Wei
parent 946ba89cd7
commit 48083f7c0c
4 changed files with 36 additions and 1 deletions

View file

@ -111,6 +111,7 @@ void PrinterFileSystem::ListAllFiles()
iter1->thumbnail = iter2->thumbnail;
iter1->flags = iter2->flags;
iter1->progress = iter2->progress;
iter1->path = iter2->path;
++iter1; ++iter2;
} else if (*iter1 < *iter2) {
++iter1;
@ -196,6 +197,21 @@ void PrinterFileSystem::DownloadCheckFiles(std::string const &path)
}
}
bool PrinterFileSystem::DownloadCheckFile(size_t index)
{
if (index >= m_file_list.size()) return false;
auto &file = m_file_list[index];
if ((file.flags & FF_DOWNLOAD) == 0) return false;
if (!boost::filesystem::exists(file.path)) {
file.flags &= ~FF_DOWNLOAD;
file.progress = 0;
file.path.clear();
SendChangedEvent(EVT_DOWNLOAD, index, file.path);
return false;
}
return true;
}
void PrinterFileSystem::DownloadCancel(size_t index)
{
if (index == (size_t) -1) return;