Kaydet (Commit) 90088d43 authored tarafından heiko tietze's avatar heiko tietze Kaydeden (comit) Heiko Tietze

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: Ibea9e9429a79911d632b54fa4aa9649003830aa3
Reviewed-on: https://gerrit.libreoffice.org/55295Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/54794
üst 251cb2a7
......@@ -12542,7 +12542,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
......
......@@ -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);
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment