From 88fc6685ba1037664c429b34421d28be3850c5d3 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 4 Sep 2019 09:19:00 -0400 Subject: [PATCH 1/4] [libcalamares] Apply coding style to geoip/ --- src/libcalamares/geoip/GeoIPTests.cpp | 6 ++++-- src/libcalamares/geoip/GeoIPXML.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcalamares/geoip/GeoIPTests.cpp b/src/libcalamares/geoip/GeoIPTests.cpp index 3400bb24f..4b1f8f8e1 100644 --- a/src/libcalamares/geoip/GeoIPTests.cpp +++ b/src/libcalamares/geoip/GeoIPTests.cpp @@ -197,7 +197,8 @@ GeoIPTests::testSplitTZ() #define CHECK_GET( t, selector, url ) \ { \ - auto tz = GeoIP##t( selector ).processReply( CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( url ) ) ); \ + auto tz = GeoIP##t( selector ) \ + .processReply( CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( url ) ) ); \ qDebug() << tz; \ QCOMPARE( default_tz, tz ); \ auto tz2 = CalamaresUtils::GeoIP::Handler( "" #t, url, selector ).get(); \ @@ -216,7 +217,8 @@ GeoIPTests::testGet() GeoIPJSON default_handler; // Call the KDE service the definitive source. - auto default_tz = default_handler.processReply( CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( "https://geoip.kde.org/v1/calamares" ) ) ); + auto default_tz = default_handler.processReply( + CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( "https://geoip.kde.org/v1/calamares" ) ) ); // This is bogus, because the test isn't always run by me // QCOMPARE( default_tz.first, QStringLiteral("Europe") ); diff --git a/src/libcalamares/geoip/GeoIPXML.cpp b/src/libcalamares/geoip/GeoIPXML.cpp index 256e774cf..2a97c5546 100644 --- a/src/libcalamares/geoip/GeoIPXML.cpp +++ b/src/libcalamares/geoip/GeoIPXML.cpp @@ -73,10 +73,12 @@ QString GeoIPXML::rawReply( const QByteArray& data ) { for ( const auto& e : getElementTexts( data, m_element ) ) + { if ( !e.isEmpty() ) { return e; } + } return QString(); } From 52e72f4fb1df2790fa4c829dd4fc0ec6a458315d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 4 Sep 2019 09:20:02 -0400 Subject: [PATCH 2/4] [welcome] Apply coding style --- src/modules/welcome/WelcomeViewStep.cpp | 3 ++- src/modules/welcome/WelcomeViewStep.h | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/modules/welcome/WelcomeViewStep.cpp b/src/modules/welcome/WelcomeViewStep.cpp index 17a10f754..b34900e7f 100644 --- a/src/modules/welcome/WelcomeViewStep.cpp +++ b/src/modules/welcome/WelcomeViewStep.cpp @@ -148,7 +148,8 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap ) jobOrBrandingSetting( Branding::KnownIssuesUrl, configurationMap, "showKnownIssuesUrl" ) ); m_widget->setupButton( WelcomePage::Button::ReleaseNotes, jobOrBrandingSetting( Branding::ReleaseNotesUrl, configurationMap, "showReleaseNotesUrl" ) ); - m_widget->setupButton( WelcomePage::Button::Donate, CalamaresUtils::getString( configurationMap, "showDonateUrl" ) ); + m_widget->setupButton( WelcomePage::Button::Donate, + CalamaresUtils::getString( configurationMap, "showDonateUrl" ) ); if ( configurationMap.contains( "requirements" ) && configurationMap.value( "requirements" ).type() == QVariant::Map ) diff --git a/src/modules/welcome/WelcomeViewStep.h b/src/modules/welcome/WelcomeViewStep.h index 5d27d7aad..4d8fa160f 100644 --- a/src/modules/welcome/WelcomeViewStep.h +++ b/src/modules/welcome/WelcomeViewStep.h @@ -34,11 +34,11 @@ class GeneralRequirements; namespace CalamaresUtils { - namespace GeoIP - { - class Handler; - } -} // namespace +namespace GeoIP +{ +class Handler; +} +} // namespace CalamaresUtils class PLUGINDLLEXPORT WelcomeViewStep : public Calamares::ViewStep { @@ -79,4 +79,4 @@ private: CALAMARES_PLUGIN_FACTORY_DECLARATION( WelcomeViewStepFactory ) -#endif // WELCOMEPAGEPLUGIN_H +#endif // WELCOMEPAGEPLUGIN_H From 4259bc9d5d9ef3c6386490fbfa5fd44607427409 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 5 Sep 2019 03:23:50 -0400 Subject: [PATCH 3/4] [packagechooser] Also use screenshot from no-package-selected --- src/modules/packagechooser/PackageChooserPage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/packagechooser/PackageChooserPage.cpp b/src/modules/packagechooser/PackageChooserPage.cpp index 1ca7b2c30..2c66d4724 100644 --- a/src/modules/packagechooser/PackageChooserPage.cpp +++ b/src/modules/packagechooser/PackageChooserPage.cpp @@ -168,4 +168,5 @@ PackageChooserPage::setIntroduction( const PackageItem& item ) { m_introduction.name = item.name; m_introduction.description = item.description; + m_introduction.screenshot = item.screenshot; } From a57a030ee2eb0a68866796af316b09b9fde2b95c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 5 Sep 2019 06:33:39 -0400 Subject: [PATCH 4/4] [packagechooser] Massage the list view to be narrower --- src/modules/packagechooser/PackageChooserPage.cpp | 4 ++++ src/modules/packagechooser/page_package.ui | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/packagechooser/PackageChooserPage.cpp b/src/modules/packagechooser/PackageChooserPage.cpp index 2c66d4724..b4d9f99af 100644 --- a/src/modules/packagechooser/PackageChooserPage.cpp +++ b/src/modules/packagechooser/PackageChooserPage.cpp @@ -20,6 +20,7 @@ #include "ui_page_package.h" +#include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" #include "utils/Retranslator.h" @@ -50,6 +51,9 @@ PackageChooserPage::PackageChooserPage( PackageChooserMode mode, QWidget* parent case PackageChooserMode::RequiredMultiple: ui->products->setSelectionMode( QAbstractItemView::ExtendedSelection ); } + + ui->products->setMinimumWidth( 10 * CalamaresUtils::defaultFontHeight() ); + } /** @brief size the given @p pixmap to @p size diff --git a/src/modules/packagechooser/page_package.ui b/src/modules/packagechooser/page_package.ui index 496c478a1..8349f2b52 100644 --- a/src/modules/packagechooser/page_package.ui +++ b/src/modules/packagechooser/page_package.ui @@ -21,11 +21,11 @@ - + - + 0 1