MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / download_github_file

Method download_github_file

src/ui/DownloadDictionariesDialog.cpp:354–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354bool DownloadDictionariesDialog::download_github_file(const std::wstring &title, const std::wstring &path, std::shared_ptr<ProgressData> progress_data) {
355 auto local_path = std::wstring(m_settings.get_dictionary_download_path());
356 auto local_name = local_path + L"\\" + path.substr(path.rfind(L'/'));
357 if (PathFileExists(local_name.c_str())) {
358 if (ask_replacement_message(title.c_str()) == IDNO) {
359 --m_supposed_downloaded_count;
360 return false;
361 }
362 m_speller_container.get_hunspell_speller().dictionary_removed(local_name);
363 }
364
365 m_github_provider->download_dictionary(path, local_path, progress_data);
366 return true;
367}
368
369bool DownloadDictionariesDialog::download_file() {
370 const auto ftp_path = *current_address() + m_cur->path;

Callers

nothing calls this directly

Calls 5

substrMethod · 0.80
c_strMethod · 0.80
dictionary_removedMethod · 0.80
download_dictionaryMethod · 0.80

Tested by

no test coverage detected