summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheiko tietze <tietze.heiko@gmail.com>2018-03-29 17:39:35 +0200
committerHeiko Tietze <tietze.heiko@gmail.com>2018-04-04 20:49:30 +0200
commit803a3539975059d2fde5b0eab3e0850ba155368a (patch)
treef4d20bc294be12d46d3fdde2f444e9921a5e7cc3
parent599ff05300599d4e4ce818092f18e76e738b921e (diff)
tdf#116695 Make Elementary the default on Gnome
IconThemeSelector updated; tde and kde(3) removed Change-Id: I724fb1fd7e4e2b2c60189bb97253b0a04917edf2 Reviewed-on: https://gerrit.libreoffice.org/52117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: andreas_kainz <kainz.a@gmail.com>
-rw-r--r--vcl/qa/cppunit/app/test_IconThemeSelector.cxx60
-rw-r--r--vcl/source/app/IconThemeSelector.cxx20
2 files changed, 37 insertions, 43 deletions
diff --git a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
index e8b4afff196f..f2f8ca5d3369 100644
--- a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
+++ b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx
@@ -20,10 +20,10 @@
class IconThemeSelectorTest : public CppUnit::TestFixture
{
void
- OxygenThemeIsReturnedForKde4Desktop();
+ BreezeIsReturnedForKde5Desktop();
void
- TangoThemeIsReturnedForGtkDesktop();
+ ElementaryIsReturnedForGnomeDesktop();
void
ThemeIsOverriddenByPreferredTheme();
@@ -55,8 +55,8 @@ class IconThemeSelectorTest : public CppUnit::TestFixture
// Adds code needed to register the test suite
CPPUNIT_TEST_SUITE(IconThemeSelectorTest);
- CPPUNIT_TEST(OxygenThemeIsReturnedForKde4Desktop);
- CPPUNIT_TEST(TangoThemeIsReturnedForGtkDesktop);
+ CPPUNIT_TEST(BreezeIsReturnedForKde5Desktop);
+ CPPUNIT_TEST(ElementaryIsReturnedForGnomeDesktop);
CPPUNIT_TEST(ThemeIsOverriddenByPreferredTheme);
CPPUNIT_TEST(ThemeIsOverriddenByHighContrastMode);
CPPUNIT_TEST(NotInstalledThemeDoesNotOverride);
@@ -76,9 +76,11 @@ IconThemeSelectorTest::GetFakeInstalledThemes()
{
std::vector<vcl::IconThemeInfo> r;
vcl::IconThemeInfo a;
- a.mThemeId = "tango";
+ a.mThemeId = "colibre";
r.push_back(a);
- a.mThemeId = "oxygen";
+ a.mThemeId = "breeze";
+ r.push_back(a);
+ a.mThemeId = "elementary";
r.push_back(a);
a.mThemeId = "hicontrast";
r.push_back(a);
@@ -86,32 +88,32 @@ IconThemeSelectorTest::GetFakeInstalledThemes()
}
void
-IconThemeSelectorTest::OxygenThemeIsReturnedForKde4Desktop()
+IconThemeSelectorTest::BreezeIsReturnedForKde5Desktop()
{
std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
vcl::IconThemeSelector s;
- OUString r = s.SelectIconThemeForDesktopEnvironment(themes, "kde4");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'oxygen' theme is returned for kde4 desktop", OUString("oxygen"), r);
+ OUString r = s.SelectIconThemeForDesktopEnvironment(themes, "kde5");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'breeze' theme is returned for kde5 desktop", OUString("breeze"), r);
}
void
-IconThemeSelectorTest::TangoThemeIsReturnedForGtkDesktop()
+IconThemeSelectorTest::ElementaryIsReturnedForGnomeDesktop()
{
std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
vcl::IconThemeSelector s;
- OUString r = s.SelectIconThemeForDesktopEnvironment(themes, "gtk");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'tango' theme is returned for kde4 desktop", OUString("tango"), r);
+ OUString r = s.SelectIconThemeForDesktopEnvironment(themes, "gnome");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'elementary' theme is returned for gnome desktop", OUString("elementary"), r);
}
void
IconThemeSelectorTest::ThemeIsOverriddenByPreferredTheme()
{
vcl::IconThemeSelector s;
- OUString preferred("oxygen");
+ OUString preferred("breeze");
s.SetPreferredIconTheme(preferred, false);
std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
- OUString selected = s.SelectIconThemeForDesktopEnvironment(themes, "gtk");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'tango' theme is overridden by oxygen", preferred, selected);
+ OUString selected = s.SelectIconThemeForDesktopEnvironment(themes, "gnome");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'elementary' theme is overridden by breeze", preferred, selected);
}
void
@@ -120,23 +122,23 @@ IconThemeSelectorTest::ThemeIsOverriddenByHighContrastMode()
vcl::IconThemeSelector s;
s.SetUseHighContrastTheme(true);
std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
- OUString selected = s.SelectIconTheme(themes, "tango");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'tango' theme is overridden by high contrast mode",
+ OUString selected = s.SelectIconTheme(themes, "breeze");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'breeze' theme is overridden by high contrast mode",
OUString("hicontrast"), selected);
s.SetUseHighContrastTheme(false);
- selected = s.SelectIconTheme(themes, "tango");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'tango' theme is no longer overridden by high contrast mode",
- OUString("tango"), selected);
+ selected = s.SelectIconTheme(themes, "breeze");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'breeze' theme is no longer overridden by high contrast mode",
+ OUString("breeze"), selected);
}
void
IconThemeSelectorTest::NotInstalledThemeDoesNotOverride()
{
vcl::IconThemeSelector s;
- s.SetPreferredIconTheme("oxygen_katze", false);
+ s.SetPreferredIconTheme("breeze_foo", false);
std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
- OUString selected = s.SelectIconTheme(themes, "oxygen");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'oxygen' theme is not overridden by 'oxygen_katze'", OUString("oxygen"), selected);
+ OUString selected = s.SelectIconTheme(themes, "colibre");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'colibre' theme is not overridden by 'breeze_foo'", OUString("colibre"), selected);
}
void
@@ -144,8 +146,8 @@ IconThemeSelectorTest::InstalledThemeIsFound()
{
vcl::IconThemeSelector s;
std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
- OUString selected = s.SelectIconTheme(themes, "oxygen");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'oxygen' theme is found", OUString("oxygen"), selected);
+ OUString selected = s.SelectIconTheme(themes, "colibre");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'colibre' theme is found", OUString("colibre"), selected);
}
void
@@ -153,15 +155,15 @@ IconThemeSelectorTest::FirstThemeIsReturnedIfRequestedThemeIsNotFound()
{
vcl::IconThemeSelector s;
std::vector<vcl::IconThemeInfo> themes = GetFakeInstalledThemes();
- OUString selected = s.SelectIconTheme(themes, "oxygen_katze");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("'oxygen' theme is found", themes.front().GetThemeId(), selected);
+ OUString selected = s.SelectIconTheme(themes, "breeze_foo");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'breeze' theme is found", themes.front().GetThemeId(), selected);
}
void
IconThemeSelectorTest::FallbackThemeIsReturnedForEmptyInput()
{
vcl::IconThemeSelector s;
- OUString selected = s.SelectIconTheme(std::vector<vcl::IconThemeInfo>(), "oxygen");
+ OUString selected = s.SelectIconTheme(std::vector<vcl::IconThemeInfo>(), "colibre");
CPPUNIT_ASSERT_EQUAL_MESSAGE("fallback is returned for empty input",
OUString(vcl::IconThemeSelector::FALLBACK_ICON_THEME_ID), selected);
}
@@ -182,7 +184,7 @@ IconThemeSelectorTest::DifferentPreferredThemesAreInequal()
{
vcl::IconThemeSelector s1;
vcl::IconThemeSelector s2;
- s1.SetPreferredIconTheme("oxygen", false);
+ s1.SetPreferredIconTheme("breeze", false);
s2.SetUseHighContrastTheme(true);
bool equal = (s1 == s2);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Different preferred themes are detected as inequal", false, equal);
diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx
index 804df13b5d62..092b6a5bcbca 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -51,24 +51,16 @@ IconThemeSelector::IconThemeSelector()
IconThemeSelector::GetIconThemeForDesktopEnvironment(const OUString& desktopEnvironment)
{
OUString r;
- if ( desktopEnvironment.equalsIgnoreAsciiCase("tde") ||
- desktopEnvironment.equalsIgnoreAsciiCase("kde") ) {
- r = "crystal";
- }
- else if ( desktopEnvironment.equalsIgnoreAsciiCase("kde4") ) {
- r = "oxygen";
- }
- else if ( desktopEnvironment.equalsIgnoreAsciiCase("kde5") ) {
+ if ( desktopEnvironment.equalsIgnoreAsciiCase("kde4") ||
+ desktopEnvironment.equalsIgnoreAsciiCase("kde5") ||
+ desktopEnvironment.equalsIgnoreAsciiCase("macosx") ) {
r = "breeze";
}
- else if ( desktopEnvironment.equalsIgnoreAsciiCase("MacOSX") ) {
- r = "breeze";
- }
- else if ( desktopEnvironment.equalsIgnoreAsciiCase("unity") ) {
- r = "breeze";
+ else if ( desktopEnvironment.equalsIgnoreAsciiCase("gnome") ) {
+ r = "elementary";
}
else {
- r = FALLBACK_ICON_THEME_ID;
+ r = FALLBACK_ICON_THEME_ID; //effective also on Windows
}
return r;
}