From a1098b29e8ae6254dfb75e0be64c019d04fffe03 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 16 Dec 2019 17:41:07 +0100 Subject: [PATCH] v3.7.6: at debug mode, put warn message when hosters wern't found for the first lanuguage... --- src/pageManager.cpp | 15 ++++++++++++--- src/pageManager.h | 2 +- src/parameterManager.h | 2 +- src/programManager.cpp | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/pageManager.cpp b/src/pageManager.cpp index bd6cf8f..92069f3 100644 --- a/src/pageManager.cpp +++ b/src/pageManager.cpp @@ -461,7 +461,7 @@ int PageManager::writeToFile(std::string path, std::string text) return 0; } -std::string PageManager::chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first) +std::string PageManager::chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first, bool withWarnMsg) { std::istringstream SListLang ( replace( languages_with_highst_priority_at_first, ",", "\n") + "\n" ); @@ -493,14 +493,18 @@ std::string PageManager::chooseHosterLink(std::string HosterList, std::string Ho //std::cout << "Alle Folgen mi der Sprache " << langId << ":\n'" << LanguageSortedHoster << "'" << std::endl; //Wenn keine Links zu der Sprache gefunden worden sind - if(LanguageSortedHoster == "") + if(LanguageSortedHoster == "") { + if(withWarnMsg) + std::cout << "Warnung: Es wurden keine Links für die Sprache '" <setState(10); } std::string allLinks = myThreadData->pageManager->getLinks(tmp_reply.html); - std::string Link = myThreadData->pageManager->chooseHosterLink(allLinks, myThreadData->settings->genaueHoster, myThreadData->settings->languages); + std::string Link = myThreadData->pageManager->chooseHosterLink(allLinks, myThreadData->settings->genaueHoster, myThreadData->settings->languages, myThreadData->settings->debugMode); if(myThreadData->settings->debugMode) std::cout << " > Thread " << myThreadData->id << allLinks << std::endl << ( (Link == "") ? "" : " -> Link: 'https://s.to") << Link << ( (Link == "") ? "" : "'\n" ); @@ -565,7 +565,7 @@ int ProgramManager::defaultModus(Settings *settings) return 0; } else { - std::string Link = pageManager.chooseHosterLink(allLinks, settings->genaueHoster, settings->languages); + std::string Link = pageManager.chooseHosterLink(allLinks, settings->genaueHoster, settings->languages, settings->debugMode); if(settings->debugMode) std::cout << allLinks << std::endl << ( (Link == "") ? "" : " -> Link: 'https://s.to") << Link << ( (Link == "") ? "" : "'\n" );