Skip to content
Snippets Groups Projects
Commit 2b2995f3 authored by Janis Born's avatar Janis Born
Browse files

get rid of some debug couts

parent 192c1545
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -72,15 +72,12 @@ void DidYouKnowWidget::updateTips()
QFileInfo libraryFileInfo(libraryFileName());
bool downloadNewLibrary = false;
if (!libraryFileInfo.exists()) {
std::cout << "No local tips library file found." << std::endl;
downloadNewLibrary = true;
}
else if (libraryFileInfo.lastModified().secsTo(QDateTime::currentDateTime()) > outdatedSeconds) {
std::cout << "Local tips library file is outdated." << std::endl;
downloadNewLibrary = true;
}
if (downloadNewLibrary) {
std::cout << "Downloading tips library from " << libraryURL.toString().toStdString() << " ..." << std::endl;
QNetworkAccessManager manager;
QNetworkRequest request(libraryURL);
QNetworkReply* reply = manager.get(request);
......@@ -103,7 +100,6 @@ void DidYouKnowWidget::updateTips()
QFile libraryFile(libraryFileName());
if (!libraryFile.open(QIODevice::ReadOnly)) {
// Try library file from local repository as fallback
std::cout << "Could not open " << libraryFile.fileName().toStdString() << ". Falling back to local library." << std::endl;
libraryFile.setFileName(":Plugin-DidYouKnow/Library/tips.json");
if (!libraryFile.open(QIODevice::ReadOnly)) {
throw ConfigError("Could not open " + libraryFile.fileName().toStdString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment