diff options
| author | erri120 <erri120@protonmail.com> | 2020-08-20 17:56:57 +0200 |
|---|---|---|
| committer | erri120 <erri120@protonmail.com> | 2020-08-20 17:56:57 +0200 |
| commit | 5a857be1e4388eb2500fe476a283f3794ee86761 (patch) | |
| tree | 9bdc3982f5e261d9304c3014e7d1b0a5b480c5b8 /src | |
| parent | 586b3cd04e0f2048e085b9a997f76b93ed953f7a (diff) | |
Create meta file if it does not exist when trying to open it
Diffstat (limited to 'src')
| -rw-r--r-- | src/downloadmanager.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index ce60c8e1..9e1b682b 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -1097,21 +1097,25 @@ void DownloadManager::openMetaFile(int index) { return; } - auto path = QDir(m_OutputDirectory); - auto metaPath = getFilePath(index) + ".meta"; + const auto path = QDir(m_OutputDirectory); + const auto filePath = getFilePath(index); + const auto metaPath = filePath + ".meta"; + if (path.exists(metaPath)) { shell::Open(metaPath); return; } - - auto info = m_ActiveDownloads[index]; - info->m_FileInfo->repository = "Nexus"; + else { + QSettings metaFile(metaPath, QSettings::IniFormat); + metaFile.setValue("removed", false); + } if (path.exists(metaPath)) { shell::Open(metaPath); - } else { - shell::Explore(m_OutputDirectory); + return; } + + shell::Explore(filePath); } void DownloadManager::openInDownloadsFolder(int index) |
