[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - configure.ac vcl/qa vcl/source

heiko tietze tietze.heiko at gmail.com
Thu Jun 7 13:56:44 UTC 2018


 configure.ac                                  |    2 -
 vcl/qa/cppunit/app/test_IconThemeSelector.cxx |   13 ++++++++++--
 vcl/source/app/IconThemeSelector.cxx          |   28 ++++++++++++++++++--------
 3 files changed, 32 insertions(+), 11 deletions(-)

New commits:
commit 1e3ae648ca32806bd6dcdd6e161630ec111bc6d3
Author: heiko tietze <tietze.heiko at gmail.com>
Date:   Fri May 25 11:45:29 2018 +0200

    tdf#116916 - Icon themes missing on LibreOffice Vanilla from macOS appstore
    
    Update of blacklist for $WITH_THEMES
    Fallback to Tango for ancient/unknown DE, Colibre only on Windows
    MPL vs. non-MPL on macOS
    
    Change-Id: Ibeefbaefae5a8e62e973bcb8cddd53845f96b67d
    Reviewed-on: https://gerrit.libreoffice.org/55295
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/54794
    Reviewed-on: https://gerrit.libreoffice.org/55396

diff --git a/configure.ac b/configure.ac
index a3b9107477b5..34f13e2e5f45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12520,7 +12520,7 @@ if test "$enable_mpl_subset" = "yes"; then
     fi
     for theme in $WITH_THEMES; do
         case $theme in
-        breeze|default|sifr)
+        breeze|breeze_dark|sifr|sifr_dark|elementary|karasa_jaga) #blacklist of icon themes under GPL or LGPL
             AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
         *) : ;;
         esac
diff --git a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
index 3b6c53d3278f..06cfe9466f63 100644
--- a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
+++ b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
@@ -19,6 +19,7 @@
 
 class IconThemeSelectorTest : public CppUnit::TestFixture
 {
+#ifndef _WIN32 //default theme on Windows is Colibre independently from any desktop environment
     void
     BreezeIsReturnedForKde5Desktop();
 
@@ -51,10 +52,13 @@ class IconThemeSelectorTest : public CppUnit::TestFixture
 
     static std::vector<vcl::IconThemeInfo>
     GetFakeInstalledThemes();
+#endif
 
     // Adds code needed to register the test suite
+
     CPPUNIT_TEST_SUITE(IconThemeSelectorTest);
 
+#ifndef _WIN32
     CPPUNIT_TEST(BreezeIsReturnedForKde5Desktop);
     CPPUNIT_TEST(ElementaryIsReturnedForGnomeDesktop);
     CPPUNIT_TEST(ThemeIsOverriddenByPreferredTheme);
@@ -65,23 +69,26 @@ class IconThemeSelectorTest : public CppUnit::TestFixture
     CPPUNIT_TEST(FallbackThemeIsReturnedForEmptyInput);
     CPPUNIT_TEST(DifferentPreferredThemesAreInequal);
     CPPUNIT_TEST(DifferentHighContrastModesAreInequal);
+#endif
 
     // End of test suite definition
 
     CPPUNIT_TEST_SUITE_END();
 };
 
+#ifndef _WIN32
+
 /*static*/ std::vector<vcl::IconThemeInfo>
 IconThemeSelectorTest::GetFakeInstalledThemes()
 {
     std::vector<vcl::IconThemeInfo> r;
     vcl::IconThemeInfo a;
-    a.mThemeId = "colibre";
-    r.push_back(a);
     a.mThemeId = "breeze";
     r.push_back(a);
     a.mThemeId = "elementary";
     r.push_back(a);
+    a.mThemeId = "colibre";
+    r.push_back(a);
     a.mThemeId = "sifr";
     r.push_back(a);
     return r;
@@ -190,6 +197,8 @@ IconThemeSelectorTest::DifferentPreferredThemesAreInequal()
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Different preferred themes are detected as inequal", false, equal);
 }
 
+#endif
+
 // Put the test suite in the registry
 CPPUNIT_TEST_SUITE_REGISTRATION(IconThemeSelectorTest);
 
diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx
index 20b64f4da6ac..c9da2d6895c3 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -11,12 +11,13 @@
 
 #include <vcl/IconThemeScanner.hxx>
 #include <vcl/IconThemeInfo.hxx>
+#include <config_mpl.h>
 
 #include <algorithm>
 
 namespace vcl {
 
-/*static*/ const OUStringLiteral IconThemeSelector::FALLBACK_ICON_THEME_ID("colibre");
+/*static*/ const OUStringLiteral IconThemeSelector::FALLBACK_ICON_THEME_ID("tango");
 
 namespace {
 
@@ -51,20 +52,31 @@ IconThemeSelector::IconThemeSelector()
 IconThemeSelector::GetIconThemeForDesktopEnvironment(const OUString& desktopEnvironment)
 {
     OUString r;
+#ifdef _WIN32
+    r = "colibre";
+    (void)desktopEnvironment;
+#else
     if ( desktopEnvironment.equalsIgnoreAsciiCase("kde4") ||
-         desktopEnvironment.equalsIgnoreAsciiCase("kde5") ||
-         desktopEnvironment.equalsIgnoreAsciiCase("macosx") ) {
+         desktopEnvironment.equalsIgnoreAsciiCase("kde5") ) {
         r = "breeze";
-    }
-    else
+    } else
+    if ( desktopEnvironment.equalsIgnoreAsciiCase("macosx") ) {
+#if MPL_HAVE_SUBSET
+        r = "tango";
+#else
+        r = "breeze";
+#endif
+    } else
     if ( desktopEnvironment.equalsIgnoreAsciiCase("gnome") ||
          desktopEnvironment.equalsIgnoreAsciiCase("mate") ||
          desktopEnvironment.equalsIgnoreAsciiCase("unity") ) {
         r = "elementary";
+    } else
+    {
+        r = FALLBACK_ICON_THEME_ID;
     }
-    else {
-        r = FALLBACK_ICON_THEME_ID; //effective also on Windows
-    }
+#endif
+
     return r;
 }
 


More information about the Libreoffice-commits mailing list