Request 768 (accepted)
Update to KDE Frameworks 5.6.0
Submit package home:sebas:bra...el:frameworks / kemoticons to package home:plfiorini...el:frameworks / kemoticons
[-] [+] | Changed | kemoticons.spec |
[-] [+] | Changed | kemoticons-5.6.0.tar.xz/CMakeLists.txt ^ |
@@ -2,7 +2,7 @@ project(KEmoticons) -find_package(ECM 1.3.0 REQUIRED NO_MODULE) +find_package(ECM 1.6.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) @@ -19,8 +19,8 @@ include(ECMGenerateHeaders) include(ECMPackageConfigHelpers) -set(KF5_VERSION "5.3.0") # handled by release scripts -set(KF5_DEP_VERSION "5.3.0") # handled by release scripts +set(KF5_VERSION "5.6.0") # handled by release scripts +set(KF5_DEP_VERSION "5.6.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KEMOTICONS VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kemoticons_version.h" @@ -30,6 +30,7 @@ find_package(KF5Archive ${KF5_DEP_VERSION} REQUIRED) find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) find_package(KF5Service ${KF5_DEP_VERSION} REQUIRED) +find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kemoticons_version.h DESTINATION ${KF5_INCLUDE_INSTALL_DIR} COMPONENT Devel ) | ||
[-] [+] | Changed | kemoticons-5.6.0.tar.xz/autotests/CMakeLists.txt ^ |
@@ -1,13 +1,13 @@ include(ECMAddTests) find_package(Qt5Test REQUIRED) -macro(kemoticons_unit_tests) - foreach(_testname ${ARGN}) - ecm_add_test(${_testname}.cpp TEST_NAME kemoticons-${_testname} LINK_LIBRARIES Qt5::Test KF5::Emoticons) - endforeach() +macro(kemoticons_unit_test) + set(_testname ${ARGV0}) + ecm_add_test(${_testname}.cpp ${ARGV1} TEST_NAME kemoticons-${_testname} LINK_LIBRARIES Qt5::Test KF5::Emoticons) endmacro() -kemoticons_unit_tests(kemoticontest) +kemoticons_unit_test(kemoticontest) +kemoticons_unit_test(ktexttohtmlplugintest ../src/integrationplugin/ktexttohtml.cpp) target_compile_definitions(kemoticons-kemoticontest PRIVATE LOCAL_THEMES_DIR="${KEmoticons_SOURCE_DIR}/themes") | ||
[-] [+] | Added | kemoticons-5.6.0.tar.xz/autotests/ktexttohtmlplugintest.cpp ^ |
@@ -0,0 +1,118 @@ +/* + * Copyright (C) 2014 Daniel Vrátil <dvratil@redhat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include <QObject> +#include <QTest> +#include <QStandardPaths> + +#include "../src/integrationplugin/ktexttohtml.h" +#include <kemoticons.h> + +class KTextToHTMLPluginTest : public QObject +{ + Q_OBJECT + +private: + QString htmlForSmiley(const QString &emoticon, const QString &name) const; + +private Q_SLOTS: + void initTestCase(); + void parseEmoticonsTest_data(); + void parseEmoticonsTest(); + +private: + QString mEmoticonsThemePath; +}; + +QTEST_MAIN(KTextToHTMLPluginTest) + +void KTextToHTMLPluginTest::initTestCase() +{ + mEmoticonsThemePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "emoticons/Glass", QStandardPaths::LocateDirectory); + QVERIFY(!mEmoticonsThemePath.isEmpty()); +} + +QString KTextToHTMLPluginTest::htmlForSmiley(const QString &emoticon, const QString &name) const +{ + return QString("<img align=\"center\" title=\"%1\" alt=\"%1\" src=\"%2/%3.png\" width=\"22\" height=\"22\" />") + .arg(emoticon) + .arg(mEmoticonsThemePath) + .arg(name); +} + + +void KTextToHTMLPluginTest::parseEmoticonsTest_data() +{ + + QTest::addColumn<QString>("input"); + QTest::addColumn<bool>("strict"); + QTest::addColumn<QStringList>("exclude"); + QTest::addColumn<QString>("expected"); + + QTest::newRow("simple") + << "Hello :-)" + << false << QStringList() + << QString("Hello %1").arg(htmlForSmiley(":-)", "smile")); + + QTest::newRow("between strings") + << "Hello :-) How are you?" + << false << QStringList() + << QString("Hello %1 How are you?").arg(htmlForSmiley(":-)", "smile")); + + QTest::newRow("excluded") + << "Bye :-(" + << false << (QStringList() << ":-(") + << "Bye :-("; + + QTest::newRow("don't mix in HTML") + << "<b>:(</b>" + << false << QStringList() + << QString("<b>%1</b>").arg(htmlForSmiley(":(", "sad")); + + QTest::newRow("strict parsing of smileys without space") + << "Very happy! :-):-)" + << true << QStringList() + << "Very happy! :-):-)"; + + QTest::newRow("nonstrict parsing of smileys without space") + << "Very happy! :-):-)" + << false << QStringList() + << QString("Very happy! %1%1").arg(htmlForSmiley(":-)", "smile")); + + QTest::newRow("smiley in HTML") + << "<img src=\"...\" title=\":-)\" />" + << false << QStringList() + << "<img src=\"...\" title=\":-)\" />"; +} + + +void KTextToHTMLPluginTest::parseEmoticonsTest() +{ + QFETCH(QString, input); + QFETCH(bool, strict); + QFETCH(QStringList, exclude); + QFETCH(QString, expected); + + KTextToHTMLEmoticons emoticons; + const QString actual = emoticons.parseEmoticons(input, strict, exclude); + + QCOMPARE(actual, expected); +} + +#include "ktexttohtmlplugintest.moc" | ||
[-] [+] | Changed | kemoticons-5.6.0.tar.xz/src/CMakeLists.txt ^ |
@@ -1,3 +1,4 @@ add_subdirectory(core) add_subdirectory(providers) +add_subdirectory(integrationplugin) \ No newline at end of file | ||
[-] [+] | Added | kemoticons-5.6.0.tar.xz/src/integrationplugin ^ |
+(directory) | ||
[-] [+] | Added | kemoticons-5.6.0.tar.xz/src/integrationplugin/CMakeLists.txt ^ |
@@ -0,0 +1,15 @@ +set(KEmoticonsIntegrationPlugin_SRCS + kemoticonsintegrationplugin.cpp + ktexttohtml.cpp +) + +add_library(KEmoticonsIntegrationPlugin MODULE ${KEmoticonsIntegrationPlugin_SRCS}) + +target_link_libraries(KEmoticonsIntegrationPlugin + PRIVATE + KF5::CoreAddons + KF5::Emoticons +) + +install(TARGETS KEmoticonsIntegrationPlugin + DESTINATION ${PLUGIN_INSTALL_DIR}/kf5) | ||
[-] [+] | Added | kemoticons-5.6.0.tar.xz/src/integrationplugin/kemoticonsintegrationplugin.cpp ^ |
@@ -0,0 +1,29 @@ +/* + * Copyright (C) 2014 Daniel Vrátil <dvratil@redhat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "kemoticonsintegrationplugin.h" + +#include <QVariant> + +KEmoticonsIntegrationPlugin::KEmoticonsIntegrationPlugin() + : QObject() +{ + setProperty(KTEXTTOHTMLEMOTICONS_PROPERTY, QVariant::fromValue<KTextToHTMLEmoticonsInterface *>(&mTextToHTMLEmoticons)); +} + | ||
[-] [+] | Added | kemoticons-5.6.0.tar.xz/src/integrationplugin/kemoticonsintegrationplugin.h ^ |
@@ -0,0 +1,39 @@ +/* + * Copyright (C) 2014 Daniel Vrátil <dvratil@redhat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef KEMOTICONSINTEGRATIONPLUGIN_H +#define KEMOTICONSINTEGRATIONPLUGIN_H + +#include <QObject> + +#include "ktexttohtml.h" + +class KEmoticonsIntegrationPlugin : public QObject +{ + Q_PLUGIN_METADATA(IID "org.kde.KEmoticonsIntegrationPlugin") + Q_OBJECT + +public: + KEmoticonsIntegrationPlugin(); + +private: + KTextToHTMLEmoticons mTextToHTMLEmoticons; +}; + +#endif // KEMOTICONSINTEGRATIONPLUGIN_H | ||
[-] [+] | Added | kemoticons-5.6.0.tar.xz/src/integrationplugin/ktexttohtml.cpp ^ |
@@ -0,0 +1,40 @@ +/* This file is part of the KDE libraries + * Copyright 2014 Daniel Vrátil <dvratil@redhat.com> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License or ( at + * your option ) version 3 or, at the discretion of KDE e.V. ( which shall + * act as a proxy as in section 14 of the GPLv3 ), any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "ktexttohtml.h" + +#include <kemoticons.h> +#include <kemoticonstheme.h> + +KTextToHTMLEmoticons::KTextToHTMLEmoticons() +{ +} + +QString KTextToHTMLEmoticons::parseEmoticons(const QString &text, + bool strictParse, + const QStringList &exclude) +{ + KEmoticonsTheme theme = KEmoticons().theme(); + KEmoticonsTheme::ParseMode mode = KEmoticonsTheme::DefaultParse; + if (strictParse) { + mode = KEmoticonsTheme::StrictParse; + } + return theme.parseEmoticons(text, mode, exclude); +} | ||
[-] [+] | Added | kemoticons-5.6.0.tar.xz/src/integrationplugin/ktexttohtml.h ^ |
@@ -0,0 +1,38 @@ +/* This file is part of the KDE libraries + * Copyright 2014 Daniel Vrátil <dvratil@redhat.com> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License or ( at + * your option ) version 3 or, at the discretion of KDE e.V. ( which shall + * act as a proxy as in section 14 of the GPLv3 ), any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifndef KTEXTTOHTML_INTEGRATION_H +#define KTEXTTOHTML_INTEGRATION_H + +#include <QObject> + +#include <ktexttohtmlemoticonsinterface.h> + +class KTextToHTMLEmoticons : public KTextToHTMLEmoticonsInterface +{ +public: + KTextToHTMLEmoticons(); + ~KTextToHTMLEmoticons() {} + + virtual QString parseEmoticons(const QString &text, + bool strictParse = false, + const QStringList &exclude = QStringList()) Q_DECL_OVERRIDE; +}; + +#endif | ||
[-] [+] | Changed | kemoticons-5.6.0.tar.xz/src/providers/adium/emoticonstheme_adium.desktop ^ |
@@ -25,6 +25,7 @@ Name[fr]=Thèmes d'émoticônes « Adium » Name[fy]=Adium Emoticons tema Name[ga]=Téama Straoiseog Adium +Name[gd]=Ùrlar shamhlaidhean-gnùis Adium Name[gl]=Tema de emoticonas Adium Name[gu]=એડિયમ ઇમોકેશન થીમ Name[he]=ערכת פרצופונים של Adium @@ -104,6 +105,7 @@ Comment[fr]=Bibliothèque permettant d'utiliser les thèmes d'émoticônes « Adium » Comment[fy]=Biblioteek om Adium emoticons tema te brûken Comment[ga]=Leabharlann le húsáid téama straoiseog Adium +Comment[gd]=Leabharlann gus ùrlar nan samhlaidhean-gnùis Adium a chleachdadh Comment[gl]=Unha biblioteca para empregar o tema de emoticonas Adium Comment[gu]=એડિયમ ઇમોકેશન થીમ ઉપયોગ કરવા માટેની લાઇબ્રેરી Comment[he]=ספריה לשימוש בערכת הפרצופונים של Adium | ||
[-] [+] | Changed | kemoticons-5.6.0.tar.xz/src/providers/kde/emoticonstheme_kde.desktop ^ |
@@ -18,6 +18,7 @@ Name[fi]=KDE-hymiöteemat Name[fr]=Thèmes d'émoticônes de KDE Name[ga]=Téama Straoiseog KDE +Name[gd]=Ùrlar shamhlaidhean-gnùis KDE Name[gl]=Tema de emoticonas de KDE Name[gu]=KDE ઇમોકેશન થીમ Name[he]=ערכת פרצופונים של KDE @@ -91,6 +92,7 @@ Comment[fr]=Bibliothèque permettant d'utiliser les thèmes d'émoticônes de KDE Comment[fy]=Biblioteek om KDE emoticons tema te brûken Comment[ga]=Leabharlann le húsáid téama straoiseog KDE +Comment[gd]=Leabharlann gus ùrlar nan samhlaidhean-gnùis KDE a chleachdadh Comment[gl]=Unha biblioteca para empregar temas de emoticonas de KDE Comment[gu]=KDE ઇમોકેશન થીમ ઉપયોગ કરવા માટેની લાઇબ્રેરી Comment[he]=ספרייה לשימוש בערכת הפרצופונים של KDE | ||
[-] [+] | Changed | kemoticons-5.6.0.tar.xz/src/providers/pidgin/emoticonstheme_pidgin.desktop ^ |
@@ -25,6 +25,7 @@ Name[fr]=Thème d'émoticônes pour Pidgin Name[fy]=Pidgin emoticons tema Name[ga]=Téama Straoiseog Pidgin +Name[gd]=Ùrlar shamhlaidhean-gnùis Pidgin Name[gl]=Tema de emoticonas de Pidgin Name[gu]=પીડગીન ઇમોકેશન થીમ ઉપયોગ કરવા માટેની લાઇબ્રેરી Name[he]=ערכת פרצופונים של Pidgin @@ -106,6 +107,7 @@ Comment[fr]=Bibliothèque permettant d'utiliser les thèmes d'émoticônes de Pidgin Comment[fy]=Biblioteek om Pidgin emoticons tema te brûken Comment[ga]=Leabharlann le húsáid téama straoiseog Pidgin +Comment[gd]=Leabharlann gus ùrlar nan samhlaidhean-gnùis Pidgin a chleachdadh Comment[gl]=Unha biblioteca para empregar temas de emoticonas de Pidgin Comment[gu]=પીડગીન ઇમોકેશન થીમ ઉપયોગ કરવા માટેની લાઇબ્રેરી Comment[he]=ספרייה לשימוש בערכת הפרצופונים של Pidgin | ||
[-] [+] | Changed | kemoticons-5.6.0.tar.xz/src/providers/xmpp/emoticonstheme_xmpp.desktop ^ |
@@ -25,6 +25,7 @@ Name[fr]=Thèmes d'émoticônes « XMPP » Name[fy]=XMPP emoticons theme Name[ga]=Téama Straoiseog XMPP +Name[gd]=Ùrlar shamhlaidhean-gnùis XMPP Name[gl]=Tema de emoticonas de XMPP Name[gu]=XMPP ઇમોકેશન થીમ Name[he]=ערכת פרצופונים של XMPP @@ -105,6 +106,7 @@ Comment[fr]=Bibliothèque permettant d'utiliser les thèmes d'émoticônes « XMPP » Comment[fy]=Biblioteek om XMPP emoticons tema te brûken Comment[ga]=Leabharlann le húsáid téama straoiseog XMPP +Comment[gd]=Leabharlann gus ùrlar nan samhlaidhean-gnùis XMPP a chleachdadh Comment[gl]=Unha biblioteca para empregar temas de emoticonas de XMPP Comment[gu]=XMPP ઇમોકેશન થીમ ઉપયોગ કરવા માટેની લાઇબ્રેરી Comment[he]=ספרייה לשימוש בערכת הפרצופונים של XMMP | ||
[-] [+] | Changed | kemoticons.yaml ^ |
@@ -1,5 +1,5 @@ Name : kemoticons -Version : 5.3.0 +Version : 5.6.0 Release : 1 Group : System/Base License : GPLv2+ |