configure.ac                                  |    2 -
 vcl/qa/cppunit/app/test_IconThemeSelector.cxx |   25 ++++++++++++++-------
 vcl/source/app/IconThemeSelector.cxx          |   30 ++++++++++++++++++--------
 3 files changed, 39 insertions(+), 18 deletions(-)

New commits:
commit 0550189c28cd759c41b8a048a3f667ae12560c5e
Author: heiko tietze <tietze.he...@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
    tdf#117615 reverting elementary on gnome
    
    Change-Id: Ibea9e9429a79911d632b54fa4aa9649003830aa3
    Reviewed-on: https://gerrit.libreoffice.org/55295
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Heiko Tietze <tietze.he...@gmail.com>

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..45359af06535 100644
--- a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
+++ b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
@@ -19,11 +19,12 @@
 
 class IconThemeSelectorTest : public CppUnit::TestFixture
 {
+#ifndef _WIN32 //default theme on Windows is Colibre independently from any 
desktop environment
     void
     BreezeIsReturnedForKde5Desktop();
 
     void
-    ElementaryIsReturnedForGnomeDesktop();
+    TangoIsReturnedForGnomeDesktop();
 
     void
     ThemeIsOverriddenByPreferredTheme();
@@ -51,12 +52,15 @@ 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(TangoIsReturnedForGnomeDesktop);
     CPPUNIT_TEST(ThemeIsOverriddenByPreferredTheme);
     CPPUNIT_TEST(ThemeIsOverriddenByHighContrastMode);
     CPPUNIT_TEST(NotInstalledThemeDoesNotOverride);
@@ -65,22 +69,25 @@ 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";
+    a.mThemeId = "tango";
+    r.push_back(a);
+    a.mThemeId = "colibre";
     r.push_back(a);
     a.mThemeId = "sifr";
     r.push_back(a);
@@ -97,12 +104,12 @@ IconThemeSelectorTest::BreezeIsReturnedForKde5Desktop()
 }
 
 void
-IconThemeSelectorTest::ElementaryIsReturnedForGnomeDesktop()
+IconThemeSelectorTest::TangoIsReturnedForGnomeDesktop()
 {
     std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
     vcl::IconThemeSelector s;
     OUString r = s.SelectIconThemeForDesktopEnvironment(themes, "gnome");
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("'elementary' theme is returned for gnome 
desktop", OUString("elementary"), r);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("'tango' theme is returned for gnome 
desktop", OUString("tango"), r);
 }
 
 void
@@ -113,7 +120,7 @@ IconThemeSelectorTest::ThemeIsOverriddenByPreferredTheme()
     s.SetPreferredIconTheme(preferred, false);
     std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
     OUString selected = s.SelectIconThemeForDesktopEnvironment(themes, 
"gnome");
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("'elementary' theme is overridden by breeze", 
preferred, selected);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("'tango' theme is overridden by breeze", 
preferred, selected);
 }
 
 void
@@ -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..175fead1cc09 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; //effective also on Windows
+        r = "tango";
+    } else
+    {
+        r = FALLBACK_ICON_THEME_ID;
     }
+#endif
+
     return r;
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to