From 06739955bb7e9a8beeb27985febcf97f48d21f48 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 4 Jun 2017 17:47:19 -0400 Subject: [PATCH] Logging: format the multi-line warning about no-supported-languages --- src/modules/locale/LocalePage.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index a54a96b2e..027c80fa5 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014-2016, Teo Mrnjavac + * Copyright 2017, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -348,14 +349,16 @@ LocalePage::init( const QString& initialRegion, if ( m_localeGenLines.isEmpty() ) { cDebug() << "WARNING: cannot acquire a list of available locales." - << "The locale and localecfg modules will be broken as long as this " + << "The locale and localecfg modules will be broken as long as this " "system does not provide" - << " * a /usr/share/i18n/SUPPORTED file" - << "\tOR" - << " * a well-formed /etc/locale.gen" - << "\tOR" - << " * a complete pre-compiled locale-gen database which allows complete locale -a output."; - + << "\n\t " + << "* a well-formed" + << supported.fileName() + << "\n\tOR" + << "* a well-formed" + << (localeGenPath.isEmpty() ? QLatin1Literal("/etc/locale.gen") : localeGenPath) + << "\n\tOR" + << "* a complete pre-compiled locale-gen database which allows complete locale -a output."; return; // something went wrong and there's nothing we can do about it. } @@ -437,14 +440,7 @@ LocalePage::guessLocaleConfiguration() // If we cannot say anything about available locales if ( m_localeGenLines.isEmpty() ) { - cDebug() << "WARNING: cannot acquire a list of available locales." - << "The locale and localecfg modules will be broken as long as this " - "system does not provide" - << " * a /usr/share/i18n/SUPPORTED file" - << "\tOR" - << " * a well-formed /etc/locale.gen" - << "\tOR" - << " * a complete pre-compiled locale-gen database which allows complete locale -a output."; + cDebug() << "WARNING: guessLocaleConfiguration can't guess from an empty list."; return LocaleConfiguration::createDefault(); }