Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Panel Worldclock plugin: proper version dependancy (issue #500)

  • Loading branch information...
commit ea8b41fc54a7ca3e0b839d3dcd93fb5af5f5fd2b 1 parent 36bcfef
@kuzmas kuzmas authored
View
4 razorqt-panel/CMakeLists.txt
@@ -207,9 +207,11 @@ if (SYSSTAT_PLUGIN)
endif (SYSSTAT_PLUGIN)
if (WORLDCLOCK_PLUGIN)
- FIND_PACKAGE(ICU 2.8 COMPONENTS i18n data)
+ FIND_PACKAGE(ICU 4.2 COMPONENTS i18n data)
if(ICU_I18N_FOUND)
+ message(STATUS "ICU version is ${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
+ add_definitions(-DICU_VERSION=${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION})
set(ENABLED_PLUGINS ${ENABLED_PLUGINS} "WorldClock")
add_subdirectory(plugin-worldclock)
else ()
View
3  razorqt-panel/plugin-worldclock/razorworldclock.cpp
@@ -183,6 +183,8 @@ void RazorWorldClock::updateTimezone(void)
delete mCalendar;
UErrorCode status = U_ZERO_ERROR;
+
+#if ICU_VERSION >= 48
char region[3];
icu::TimeZone::getRegion(mActiveTimeZone.toAscii().data(), region, sizeof(region) / sizeof(char), status);
if (U_FAILURE(status))
@@ -191,6 +193,7 @@ void RazorWorldClock::updateTimezone(void)
if (mLocale)
delete mLocale;
mLocale = new icu::Locale(mDefaultLanguage.toAscii().data(), region);
+#endif
icu::UnicodeString timeZoneName = Qt_to_ICU(mActiveTimeZone);
icu::TimeZone* timeZone = icu::TimeZone::createTimeZone(timeZoneName);
Please sign in to comment.
Something went wrong with that request. Please try again.