diff -Nru chewing-editor-0.1.1/debian/changelog chewing-editor-0.1.1/debian/changelog --- chewing-editor-0.1.1/debian/changelog 2018-05-29 15:04:28.000000000 +0000 +++ chewing-editor-0.1.1/debian/changelog 2018-09-04 19:20:29.000000000 +0000 @@ -1,3 +1,16 @@ +chewing-editor (0.1.1-3) unstable; urgency=medium + + * Team upload. + * debian/patches: Backport upstream trunk code till 2017-05-30. + * debian/control: + + Bump debhelper compat to v11. + + Bump Standards-Version to 4.2.1. + + Update Vcs fields and use the repo under debian input-method-team. + * debian/rules: Use "dh_missing --fail-missing". + * debian/copyright: Use secure uri. + + -- Boyuan Yang Tue, 04 Sep 2018 15:20:29 -0400 + chewing-editor (0.1.1-2) unstable; urgency=medium * Bump Standards-Version to 4.1.4. diff -Nru chewing-editor-0.1.1/debian/control chewing-editor-0.1.1/debian/control --- chewing-editor-0.1.1/debian/control 2018-05-29 15:03:47.000000000 +0000 +++ chewing-editor-0.1.1/debian/control 2018-09-04 19:19:40.000000000 +0000 @@ -2,25 +2,28 @@ Section: x11 Priority: optional Maintainer: Debian Input Method Team -Uploaders: ChangZhuo Chen (陳昌倬) -Build-Depends: debhelper (>= 11), - cmake (>= 3.0.0), - help2man, - libchewing3-dev (>= 0.4.0), - pkg-config, - qtchooser, - qttools5-dev, - qttools5-dev-tools, -Standards-Version: 4.1.4 +Uploaders: + ChangZhuo Chen (陳昌倬) , +Build-Depends: + cmake (>= 3.0.0), + debhelper (>= 11), + help2man, + libchewing3-dev (>= 0.4.0), + pkg-config, + qtchooser, + qttools5-dev, + qttools5-dev-tools, +Standards-Version: 4.2.1 Homepage: https://github.com/chewing/chewing-editor -Vcs-Git: https://salsa.debian.org/debian/chewing-editor.git -Vcs-Browser: https://salsa.debian.org/debian/chewing-editor +Vcs-Git: https://salsa.debian.org/input-method-team/chewing-editor.git +Vcs-Browser: https://salsa.debian.org/input-method-team/chewing-editor Package: chewing-editor Architecture: any Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends} +Depends: + ${misc:Depends}, + ${shlibs:Depends}, Description: user dictionary editor for the chewing input method chewing-editor is a cross platform user dictionary editor for the chewing input method. It provides an easy way to customize user dictionary so that diff -Nru chewing-editor-0.1.1/debian/patches/0001-Cherry-pick-upstream-trunk-code-till-2017-05-30.patch chewing-editor-0.1.1/debian/patches/0001-Cherry-pick-upstream-trunk-code-till-2017-05-30.patch --- chewing-editor-0.1.1/debian/patches/0001-Cherry-pick-upstream-trunk-code-till-2017-05-30.patch 1970-01-01 00:00:00.000000000 +0000 +++ chewing-editor-0.1.1/debian/patches/0001-Cherry-pick-upstream-trunk-code-till-2017-05-30.patch 2018-09-04 19:19:25.000000000 +0000 @@ -0,0 +1,371 @@ +From: Boyuan Yang +Date: Tue, 4 Sep 2018 14:51:45 -0400 +Subject: Cherry-pick upstream trunk code till 2017-05-30. +Forwarded: not-needed + +--- + .gitignore | 2 ++ + .travis.yml | 72 +++++++++++++++++++++++++++++++------------ + CMakeLists.txt | 26 +++++----------- + README.md | 10 +++++- + chewing-editor.desktop | 12 ++++++++ + chewing-editor.desktop.in | 12 -------- + scripts/lcov.sh | 20 ++++++------ + src/model/UserphraseModel.cpp | 4 +-- + src/view/ChewingEditor.cpp | 10 ++++-- + ts/chewing-editor_zh_TW.ts | 10 ++++++ + 10 files changed, 111 insertions(+), 67 deletions(-) + create mode 100644 chewing-editor.desktop + delete mode 100644 chewing-editor.desktop.in + +diff --git a/.gitignore b/.gitignore +index c57fb54..18a6650 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -28,3 +28,5 @@ coverage* + + chewing-editor.dSYM/ + chewing-editor.app/ ++ ++Testing/ +diff --git a/.travis.yml b/.travis.yml +index 8c67ff5..fe86184 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -1,34 +1,68 @@ + language: cpp + ++os: ++ - linux ++ - osx ++ ++env: ++ matrix: ++ - CTEST_OUTPUT_ON_FAILURE=1 ++ - CTEST_OUTPUT_ON_FAILURE=1 CFLAGS='-fsanitize=address' ++ - CTEST_OUTPUT_ON_FAILURE=1 OPTION='-DCMAKE_CXX_FLAGS=-O0 -DENABLE_GCOV=yes' COVERALLS=yes ++ + matrix: +- include: +- - env: CTEST_OUTPUT_ON_FAILURE=1 +- - env: CTEST_OUTPUT_ON_FAILURE=1 CFLAGS='-fsanitize=address' +- - env: CTEST_OUTPUT_ON_FAILURE=1 OPTION='-DCMAKE_CXX_FLAGS=-O0 -DENABLE_GCOV=yes' COVERALLS=yes ++ exclude: ++ - os: osx ++ env: CTEST_OUTPUT_ON_FAILURE=1 CFLAGS='-fsanitize=address' ++ - os: osx ++ env: CTEST_OUTPUT_ON_FAILURE=1 OPTION='-DCMAKE_CXX_FLAGS=-O0 -DENABLE_GCOV=yes' COVERALLS=yes + + git: + depth: 1 + +-before_install: +- - sudo pip install cpp-coveralls +- - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test +- - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa +- - sudo add-apt-repository --yes ppa:chewing/chewing +- - sudo add-apt-repository --yes ppa:chewing/travis-ci +- - sudo apt-get update +- # FIXME: We need to instal cmake-data manually to prevent cmake upgrade fails. +- - sudo apt-get install --yes cmake-data cmake gcc-4.8 g++-4.8 help2man libchewing3-dev pkg-config qt5-default qttools5-dev-tools +- - sudo ln -fs /usr/bin/gcc-4.8 /usr/bin/gcc +- - gcc --version +- - sudo ln -fs /usr/bin/g++-4.8 /usr/bin/g++ +- - g++ --version +- - sudo ln -fs /usr/bin/gcov-4.8 /usr/bin/gcov +- - gcov --version ++# opt-in Ubuntu Trusty ++sudo: required ++dist: trusty ++cache: ccache ++ ++install: ++ - | ++ if [ "$TRAVIS_OS_NAME" = "linux" ]; then ++ pip install --user cpp-coveralls ++ sudo add-apt-repository --yes ppa:chewing/chewing ++ sudo apt-get update ++ sudo apt-get install --yes cmake help2man qt5-default qttools5-dev qttools5-dev-tools libchewing3-dev ++ gcc --version ++ g++ --version ++ gcov --version ++ fi ++ - | ++ if [ "$TRAVIS_OS_NAME" = "osx" ]; then ++ export CC=gcc-4.8 CXX=g++-4.8 ++ ++ # dependencies ++ brew update > /dev/null && brew install ccache libchewing cmake qt5 gcc@4.8 ++ ++ # ccache ++ export PATH="/usr/local/opt/ccache/libexec:$PATH" ++ ++ # Qt ++ brew link --force qt5 ++ brew linkapps qt5 ++ export HOMEBREW_QT5_VERSION=$(brew list --versions qt5 | rev | cut -d' ' -f1 | rev) ++ ln -s /usr/local/Cellar/qt5/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs && ln -s /usr/local/Cellar/qt5/$HOMEBREW_QT5_VERSION/plugins /usr/local/plugins ++ fi ++ - ccache -V && ccache --show-stats && ccache --zero-stats && export use_ccache=true + + script: ++ - cd "$TRAVIS_BUILD_DIR" ++ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export CMAKE_PREFIX_PATH=$(brew --prefix qt5)/lib/cmake; fi + - cmake $OPTION . + - make -j2 + - make -j2 check + + after_success: + - if [ x$COVERALLS == xyes ]; then coveralls --exclude gmock --exclude test --exclude-pattern '.*CMake[^/]+\.c(?:pp)?' --exclude-pattern '.*_automoc.cpp'; fi ++ ++after_script: ++ - if [ "$use_ccache" = true ]; then ccache --show-stats ; fi +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a829874..876da06 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,7 +31,7 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Cla + + option(ENABLE_GCOV "Coverage support" false) + if(ENABLE_GCOV) +- set(CMAKE_CXX_FLAGS "-coverage ${CMAKE_CXX_FLAGS}") ++ set(CMAKE_CXX_FLAGS "--coverage ${CMAKE_CXX_FLAGS}") + endif() + + find_program(VALGRIND valgrind) +@@ -47,15 +47,7 @@ add_definitions(-DTESTDATA="${PROJECT_SOURCE_DIR}/test/data") + + find_package(PkgConfig) + find_package(Qt5Widgets REQUIRED) +- +-find_program(LUPDATE lupdate) +-if (NOT LUPDATE) +- message(SEND_ERROR "Cannot find lupdate") +-endif() +-find_program(LRELEASE lrelease) +-if (NOT LRELEASE) +- message(SEND_ERROR "Cannot find lrelease") +-endif() ++find_package(Qt5LinguistTools) + + # libchewing + # MODIFY IF NEEDED, e.g. ${CMAKE_CURRENT_SOURCE_DIR}/libchewing/lib/*.lib +@@ -74,6 +66,7 @@ endif() + # Qt library + set(CMAKE_AUTOMOC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) ++set(QT_VERSION 5) + + # Git describe + find_package(Git) +@@ -99,13 +92,8 @@ configure_file( + ${PROJECT_BINARY_DIR}/include/config.h + ) + +-configure_file( +- ${PROJECT_SOURCE_DIR}/chewing-editor.desktop.in +- ${PROJECT_BINARY_DIR}/chewing-editor.desktop +-) +- + install( +- FILES ${PROJECT_BINARY_DIR}/chewing-editor.desktop ++ FILES ${PROJECT_SOURCE_DIR}/chewing-editor.desktop + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications + ) + +@@ -147,7 +135,7 @@ foreach(TRANSLATION ${TRANSLATION_LIST}) + set(QM_FILE "${QM_DIR}/${CMAKE_PROJECT_NAME}_${TRANSLATION}.qm") + + add_custom_target("${TRANSLATION}-ts" +- COMMAND ${LUPDATE} ${PROJECT_SOURCE_DIR}/src -ts ${TS_FILE} ++ COMMAND ${Qt5_LUPDATE_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src -ts ${TS_FILE} + DEPENDS prepare_lupdate + ) + add_dependencies(lupdate "${TRANSLATION}-ts") +@@ -155,7 +143,7 @@ foreach(TRANSLATION ${TRANSLATION_LIST}) + add_custom_command( + OUTPUT + ${QM_FILE} +- COMMAND ${LRELEASE} ${TS_FILE} -qm ${QM_FILE} ++ COMMAND ${Qt5_LRELEASE_EXECUTABLE} ${TS_FILE} -qm ${QM_FILE} + DEPENDS + prepare_lrelease + ${TS_FILE} +@@ -219,7 +207,7 @@ install(PROGRAMS ${CMAKE_BINARY_DIR}/chewing-editor DESTINATION ${CMAKE_INSTALL_ + + # icon + install(FILES ${CMAKE_SOURCE_DIR}/share/icons/chewing-editor.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) +-install(FILES ${CMAKE_SOURCE_DIR}/rc/chewing-editor.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/256/apps) ++install(FILES ${CMAKE_SOURCE_DIR}/rc/chewing-editor.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/256x256/apps) + + # manpage + find_program(HELP2MAN help2man) +diff --git a/README.md b/README.md +index 8b5c335..b530d09 100644 +--- a/README.md ++++ b/README.md +@@ -1,7 +1,7 @@ + # Chewing Editor + + [![TravisCI Status](https://travis-ci.org/chewing/chewing-editor.svg?branch=master)](https://travis-ci.org/chewing/chewing-editor) +-[![Coveralls Status](https://img.shields.io/coveralls/chewing/chewing-editor.svg)](https://coveralls.io/r/chewing/chewing-editor) ++[![Coveralls Status](https://img.shields.io/coveralls/chewing/chewing-editor.svg)](https://coveralls.io/github/chewing/chewing-editor) + + chewing-editor is a cross platform chewing user phrase editor. It provides a + easy way to manage user phrase. With it, user can customize their user phrase to +@@ -9,6 +9,14 @@ increase input performance. + + # Install + * Arch Linux: install from AUR: [Stable release](https://aur.archlinux.org/packages/chewing-editor/), [Development](https://aur.archlinux.org/packages/chewing-editor-git/) ++* Mageia: install via `urpmi chewing-editor` - available in cauldron, Mageia 6 and later. ++* Ubuntu Linux: ++ * install from Ubuntu [APT repository](http://packages.ubuntu.com/search?keywords=chewing-editor) since Ubuntu 16.04 LTS (Xenial Xerus) ++ * `# apt-get install chewing-editor` ++ * install from PPA [ppa:chewing/chewing](https://launchpad.net/~chewing/+archive/ubuntu/chewing) as development build, which currently supports Ubuntu 13.10 ~ 14.04 ++ * `# add-apt-repository ppa:chewing/chewing` ++ * `# apt-get update` ++ * `# apt-get install chewing-editor` + + # Development + +diff --git a/chewing-editor.desktop b/chewing-editor.desktop +new file mode 100644 +index 0000000..0a92555 +--- /dev/null ++++ b/chewing-editor.desktop +@@ -0,0 +1,12 @@ ++[Desktop Entry] ++Version=1.0 ++Type=Application ++Name=Chewing Editor ++Comment=Chewing Userphrase Editor ++Exec=chewing-editor ++Icon=chewing-editor ++Categories=Utility;TextTools;Qt; ++ ++# Translation ++Name[zh_TW]=Chewing Editor ++Comment[zh_TW]=新酷音詞庫編輯器 +diff --git a/chewing-editor.desktop.in b/chewing-editor.desktop.in +deleted file mode 100644 +index 0a92555..0000000 +--- a/chewing-editor.desktop.in ++++ /dev/null +@@ -1,12 +0,0 @@ +-[Desktop Entry] +-Version=1.0 +-Type=Application +-Name=Chewing Editor +-Comment=Chewing Userphrase Editor +-Exec=chewing-editor +-Icon=chewing-editor +-Categories=Utility;TextTools;Qt; +- +-# Translation +-Name[zh_TW]=Chewing Editor +-Comment[zh_TW]=新酷音詞庫編輯器 +diff --git a/scripts/lcov.sh b/scripts/lcov.sh +index aea0f4c..ffa55bc 100755 +--- a/scripts/lcov.sh ++++ b/scripts/lcov.sh +@@ -20,17 +20,15 @@ + # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-echo -n "Find lcov.........." +-if ! which lcov; then +- echo "not found"; +- exit 1; +-fi +- +-echo -n "Find genhtml......." +-if ! which genhtml; then +- echo "not found"; +- exit 1; +-fi ++DEPENDENCIES="lcov genhtml" ++for dep in $DEPENDENCIES ++do ++ echo -n "Find $dep.........." ++ if ! which $dep; then ++ echo "not found"; ++ exit 1; ++ fi ++done + + #echo -n "Check directory...." + #if [ ! -e "src" ]; then +diff --git a/src/model/UserphraseModel.cpp b/src/model/UserphraseModel.cpp +index a9f84b5..995abeb 100644 +--- a/src/model/UserphraseModel.cpp ++++ b/src/model/UserphraseModel.cpp +@@ -194,8 +194,8 @@ void UserphraseModel::exportUserphrase(std::shared_ptr expor + QString UserphraseModel::checkBopomofo(const QString &bopomofo) const + { + QString replaceBopomofo = bopomofo; +- replaceBopomofo.replace(QString::fromUtf8("ㄧ"),QString::fromUtf8("ㄧ")); +- replaceBopomofo.replace(QString::fromUtf8("Y"),QString::fromUtf8("ㄚ")); ++ replaceBopomofo.replace(QString::fromUtf8("一"),QString::fromUtf8("ㄧ")); ++ replaceBopomofo.replace(QString::fromUtf8("丫"),QString::fromUtf8("ㄚ")); + + return replaceBopomofo; + } +diff --git a/src/view/ChewingEditor.cpp b/src/view/ChewingEditor.cpp +index b1c1961..be56c05 100644 +--- a/src/view/ChewingEditor.cpp ++++ b/src/view/ChewingEditor.cpp +@@ -77,10 +77,10 @@ ChewingEditor::~ChewingEditor() + + void ChewingEditor::execFileDialog(DialogType type) + { +- qDebug() << "dialogType_ = " << dialogType_; +- + dialogType_ = type; + ++ qDebug() << "dialogType_ = " << dialogType_; ++ + switch (dialogType_) { + case DIALOG_IMPORT: + fileDialog_->setWindowTitle(tr("Import")); +@@ -125,8 +125,10 @@ void ChewingEditor::finishFileSelection(const QString& file) + switch (dialogType_) { + case DIALOG_IMPORT: + // Do nothing after the first trigger +- if(import_count++ == 1) ++ if (import_count == 0) { + importUserphrase(file); ++ import_count++; ++ } + + qDebug() << "import_count = " << import_count; + +@@ -191,6 +193,8 @@ void ChewingEditor::showAbout() + + void ChewingEditor::showDeleteConfirmWindow() + { ++ if(ui_.get()->userphraseView->selectionModel()->selectedIndexes().size() == 0) return; ++ + QString text = tr("Do you want to delete this phrase?"); + + QMessageBox deleteBox(this); +diff --git a/ts/chewing-editor_zh_TW.ts b/ts/chewing-editor_zh_TW.ts +index fd52f41..946d212 100644 +--- a/ts/chewing-editor_zh_TW.ts ++++ b/ts/chewing-editor_zh_TW.ts +@@ -94,6 +94,16 @@ + Export + 匯出 + ++ ++ ++ Do you want to delete this phrase? ++ 你想要刪除這個詞彙嗎? ++ ++ ++ ++ Delete phrase ++ 刪除詞彙 ++ + + + Notification diff -Nru chewing-editor-0.1.1/debian/patches/series chewing-editor-0.1.1/debian/patches/series --- chewing-editor-0.1.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ chewing-editor-0.1.1/debian/patches/series 2018-09-04 19:19:25.000000000 +0000 @@ -0,0 +1 @@ +0001-Cherry-pick-upstream-trunk-code-till-2017-05-30.patch diff -Nru chewing-editor-0.1.1/debian/rules chewing-editor-0.1.1/debian/rules --- chewing-editor-0.1.1/debian/rules 2018-05-29 14:15:00.000000000 +0000 +++ chewing-editor-0.1.1/debian/rules 2018-09-04 19:19:25.000000000 +0000 @@ -1,11 +1,14 @@ #!/usr/bin/make -f -# You must remove unused comment lines for the released package. -#export DH_VERBOSE = 1 +# -*- makefile -*- +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +# see FEATURE AREAS in dpkg-buildflags(1) export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -export QT_SELECT=qt5 +export QT_SELECT := 5 %: dh $@ @@ -13,3 +16,6 @@ override_dh_auto_install: dh_auto_install rm -r debian/chewing-editor/usr/share/man + +override_dh_missing: + dh_missing --fail-missing