diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3dbf578..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build -nbproject -translations/lxqt-runner diff --git a/CHANGELOG b/CHANGELOG index 364742a..e622723 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,17 @@ -lxqt-runner-0.11.0 / 2016-09-24 +lxqt-runner-0.11.1 / 2017-01-01 =============================== + * MathItem: Honor system locale (#52) + * Use the new MenuCache configuration CMake module + * Fixes FTBFS when libmenu-cache was installed to non-standard location + * Remove cpack (#49) + * - Fix endif placement when test for MATH library. + +0.11.0 / 2016-09-24 +=================== + + * Release 0.11.0: Add changelog * Add README.md * Math: Enhance evaluation logic * Math: Use libmuparser for math evaluation diff --git a/CMakeLists.txt b/CMakeLists.txt index b569dfd..ee9ce26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,8 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) +set(REQUIRED_MENUCACHE_VERSION "0.3.3") + include(CMakeDependentOption) include(GNUInstallDirs) @@ -39,9 +41,7 @@ endif () if (USE_MENU_CACHE) # optionally use libmenu-cache from lxde to generate the application menu - pkg_check_modules(MENU_CACHE REQUIRED QUIET - libmenu-cache>=0.3.3 - ) + find_package(MenuCache "${REQUIRED_MENUCACHE_VERSION}" REQUIRED) endif() if (RUNNER_MATH) @@ -80,7 +80,7 @@ set(lxqt-runner_LIBRARIES lxqt lxqt-globalkeys lxqt-globalkeys-ui - ${MENU_CACHE_LIBRARIES} + ${MENUCACHE_LIBRARIES} ${QTX_LIBRARIES} ${MUPARSER_LDFLAGS} ) @@ -127,7 +127,7 @@ if (RUNNER_MATH) endif () target_include_directories(${PROJECT_NAME} - PRIVATE "$<$:${MENU_CACHE_INCLUDE_DIRS}>" + PRIVATE "$<$:${MENUCACHE_INCLUDE_DIRS}>" PRIVATE "$<$:${MUPARSER_INCLUDE_DIRS}>" ) @@ -135,7 +135,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE "$<$:MATH_ENABLED>" PRIVATE "$<$:VBOX_ENABLED>" PRIVATE "$<$:VBOX_HEADLESS_ENABLED>" - PRIVATE "$<$:HAVE_MENU_CACHE=1>" + PRIVATE "$<$:HAVE_MENU_CACHE=1>" ) target_link_libraries(${PROJECT_NAME} @@ -148,13 +148,3 @@ install(TARGETS RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT Runtime ) - -# building tarball with CPack ------------------------------------------------- -include(InstallRequiredSystemLibraries) -set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION}) -set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION}) -set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION}) -set(CPACK_GENERATOR TBZ2) -set(CPACK_SOURCE_GENERATOR TBZ2) -set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp) -include(CPack) diff --git a/providers.cpp b/providers.cpp index 2e975a2..3daad5b 100644 --- a/providers.cpp +++ b/providers.cpp @@ -791,12 +791,33 @@ bool VirtualBoxProvider::isOutDated() const #ifdef MATH_ENABLED #include +class MathItem::Parser : public mu::Parser +{ +public: + static void initLocale() + { + try + { + // use the system's locale instead of the "C" + s_locale = std::locale{""}; + } catch (const std::runtime_error & e) + { + qWarning().noquote() << "Unable to set locale for Math, " << e.what(); + } + } +}; +static void muParserInitLocale() +{ + MathItem::Parser::initLocale(); +} +Q_COREAPP_STARTUP_FUNCTION(muParserInitLocale); + /************************************************ ************************************************/ MathItem::MathItem(): CommandProviderItem(), - mParser{new mu::Parser} + mParser{new Parser} { mToolTip =QObject::tr("Mathematics"); mIcon = XdgIcon::fromTheme("accessories-calculator"); @@ -885,6 +906,8 @@ MathProvider::MathProvider() append(new MathItem()); } +#endif + ExternalProviderItem::ExternalProviderItem() { } @@ -974,4 +997,3 @@ void ExternalProvider::readFromProcess() } } -#endif diff --git a/providers.h b/providers.h index d693c0e..d62f47b 100644 --- a/providers.h +++ b/providers.h @@ -37,7 +37,7 @@ #include #ifdef HAVE_MENU_CACHE -#include +#include #endif #define MAX_RANK 0xFFFF @@ -246,15 +246,13 @@ private: #ifdef MATH_ENABLED -namespace mu -{ - class Parser; -} /************************************************ * Mathematics ************************************************/ class MathItem: public CommandProviderItem { +public: + class Parser; public: MathItem(); ~MathItem(); @@ -263,7 +261,7 @@ public: bool compare(const QRegExp ®Exp) const; virtual unsigned int rank(const QString &pattern) const; private: - QScopedPointer mParser; + QScopedPointer mParser; mutable QString mCachedInput; };