Hello community, here is the log from the commit of package ki18n for openSUSE:Factory checked in at 2014-04-02 17:22:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ki18n (Old) and /work/SRC/openSUSE:Factory/.ki18n.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ki18n" Changes: -------- --- /work/SRC/openSUSE:Factory/ki18n/ki18n.changes 2014-03-10 12:17:40.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ki18n.new/ki18n.changes 2014-04-02 17:22:15.000000000 +0200 @@ -1,0 +2,9 @@ +Sat Mar 29 19:47:39 UTC 2014 - hrvoje.senjan@gmail.com + +- Update to 4.98.0 + * API improvements and cleanups + * Buildsystem fixes + * For more details please see: + http://www.kde.org/announcements/announce-frameworks5-beta1.php + +------------------------------------------------------------------- Old: ---- ki18n-4.97.0.tar.xz New: ---- ki18n-4.98.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ki18n.spec ++++++ --- /var/tmp/diff_new_pack.vN6lEJ/_old 2014-04-02 17:22:15.000000000 +0200 +++ /var/tmp/diff_new_pack.vN6lEJ/_new 2014-04-02 17:22:15.000000000 +0200 @@ -18,10 +18,10 @@ %define lname libKF5I18n5 Name: ki18n -Version: 4.97.0 +Version: 4.98.0 Release: 0 BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 0.0.11 +BuildRequires: extra-cmake-modules >= 0.0.12 BuildRequires: fdupes BuildRequires: kf5-filesystem BuildRequires: pkgconfig(Qt5Concurrent) >= 5.2.0 ++++++ ki18n-4.97.0.tar.xz -> ki18n-4.98.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/CMakeLists.txt new/ki18n-4.98.0/CMakeLists.txt --- old/ki18n-4.97.0/CMakeLists.txt 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/CMakeLists.txt 2014-03-28 19:16:55.000000000 +0100 @@ -3,7 +3,7 @@ project(KI18n) # ECM setup -find_package(ECM 0.0.11 REQUIRED NO_MODULE) +find_package(ECM 0.0.12 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include(FeatureSummary) @@ -12,7 +12,7 @@ include(ECMSetupVersion) include(ECMGenerateHeaders) -set(KF5_VERSION "4.97.0") +set(KF5_VERSION "4.98.0") ecm_setup_version( ${KF5_VERSION} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/autotests/CMakeLists.txt new/ki18n-4.98.0/autotests/CMakeLists.txt --- old/ki18n-4.97.0/autotests/CMakeLists.txt 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/autotests/CMakeLists.txt 2014-03-28 19:16:55.000000000 +0100 @@ -6,7 +6,7 @@ macro(KI18N_UNIT_TESTS) foreach(_testname ${ARGN}) - add_executable(${_testname} ${_testname}.cpp) + add_executable(${_testname} ${_testname}.cpp testhelpers.cpp) target_link_libraries(${_testname} Qt5::Test Qt5::Concurrent KF5::I18n) add_test(ki18n-${_testname} ${_testname}) ecm_mark_as_test(${_testname}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/autotests/ktranscript-test.ini new/ki18n-4.98.0/autotests/ktranscript-test.ini --- old/ki18n-4.97.0/autotests/ktranscript-test.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/ki18n-4.98.0/autotests/ktranscript-test.ini 2014-03-28 19:16:55.000000000 +0100 @@ -0,0 +1,4 @@ +[fr] +StringKey=StringValue +BoolKey=true +NumberKey=12345 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/autotests/ktranscripttest.cpp new/ki18n-4.98.0/autotests/ktranscripttest.cpp --- old/ki18n-4.97.0/autotests/ktranscripttest.cpp 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/autotests/ktranscripttest.cpp 2014-03-28 19:16:55.000000000 +0100 @@ -1,5 +1,7 @@ /* Copyright 2013 Aurélien Gâteau <agateau@kde.org> +Copyright (C) 2014 Chusslove Illich <caslav.ilic@gmx.net> +Copyright (C) 2014 Kevin Krammer <krammer@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,6 +21,8 @@ */ #include "ktranscripttest.h" +#include "testhelpers.h" + #include <QtTest/QtTest> #include <QDebug> @@ -39,6 +43,8 @@ void KTranscriptTest::initTestCase() { + QVERIFY2(deployTestConfig(), "Could not deploy test ktranscript.ini"); + QString pluginPath = QStringLiteral(KTRANSCRIPT_PATH); QVERIFY2(QFile::exists(pluginPath), "Could not find ktranscript plugin"); @@ -49,6 +55,12 @@ QVERIFY(initf); m_transcript = initf(); QVERIFY(m_transcript); + +} + +void KTranscriptTest::cleanupTestCase() +{ + QVERIFY2(removeTestConfig(), "Could not remove test ktranscript.ini"); } void KTranscriptTest::test_data() @@ -153,8 +165,30 @@ << (QVariantList() << "test_normKey" << "Some &Thing") << false << "something"; - // TODO: How to test getConf* functions? - // Enable setting user configuration path from environment variable? + QTest::newRow("test_getConfString") + << (QVariantList() << "test_getConfString" << "StringKey") + << false + << "StringValue"; + QTest::newRow("test_getConfStringWithDefault") + << (QVariantList() << "test_getConfStringWithDefault" << "NoSuchKey" << "DefaultValue") + << false + << "DefaultValue"; + QTest::newRow("test_getConfBool") + << (QVariantList() << "test_getConfBool" << "BoolKey") + << false + << "true"; + QTest::newRow("test_getConfBoolWithDefault") + << (QVariantList() << "test_getConfBoolWithDefault" << "NoSuchKey" << true) + << false + << "true"; + QTest::newRow("test_getConfNumber") + << (QVariantList() << "test_getConfNumber" << "NumberKey") + << false + << "12345"; + QTest::newRow("test_getConfNumberWithDefault") + << (QVariantList() << "test_getConfNumberWithDefault" << "NoSuchKey" << 54321) + << false + << "54321"; } void KTranscriptTest::test() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/autotests/ktranscripttest.h new/ki18n-4.98.0/autotests/ktranscripttest.h --- old/ki18n-4.97.0/autotests/ktranscripttest.h 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/autotests/ktranscripttest.h 2014-03-28 19:16:55.000000000 +0100 @@ -45,6 +45,7 @@ private Q_SLOTS: void initTestCase(); + void cleanupTestCase(); void test_data(); void test(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/autotests/test.js new/ki18n-4.98.0/autotests/test.js --- old/ki18n-4.97.0/autotests/test.js 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/autotests/test.js 2014-03-28 19:16:55.000000000 +0100 @@ -100,3 +100,26 @@ return Ts.normKey(phrase); }); +Ts.setcall("test_getConfString", function(key) { + return Ts.getConfString(key); +}); + +Ts.setcall("test_getConfStringWithDefault", function(key, defValue) { + return Ts.getConfString(key, defValue); +}); + +Ts.setcall("test_getConfBool", function(key) { + return "" + Ts.getConfBool(key); +}); + +Ts.setcall("test_getConfBoolWithDefault", function(key, defValue) { + return "" + Ts.getConfBool(key, defValue); +}); + +Ts.setcall("test_getConfNumber", function(key) { + return "" + Ts.getConfNumber(key); +}); + +Ts.setcall("test_getConfNumberWithDefault", function(key, defValue) { + return "" + Ts.getConfNumber(key, defValue); +}); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/autotests/testhelpers.cpp new/ki18n-4.98.0/autotests/testhelpers.cpp --- old/ki18n-4.97.0/autotests/testhelpers.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/ki18n-4.98.0/autotests/testhelpers.cpp 2014-03-28 19:16:55.000000000 +0100 @@ -0,0 +1,75 @@ +/* This file is part of the KI18N Framework + Copyright (C) 2014 Kevin Krammer <krammer@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library 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 "testhelpers.h" + +#include <QDebug> +#include <QDir> +#include <QFile> +#include <QFileInfo> +#include <QStandardPaths> +#include <QtTest/QtTest> + +static const QString targetFileName = QStringLiteral("ktranscript.ini"); + +bool deployTestConfig() +{ + QStandardPaths::setTestModeEnabled(true); + + QDir configDir = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); + const QFileInfo targetFile = QFileInfo(configDir, targetFileName); + + if (!configDir.exists()) { + if (!QDir::current().mkpath(configDir.absolutePath())) { + qWarning() << "Failed to create config dir" << configDir.absolutePath(); + return false; + } + } else if (targetFile.exists()) { + if (!configDir.remove(targetFileName)) { + qWarning() << "Failed to remove existing test config file" << targetFile.absoluteFilePath(); + return false; + } + } + + QFile sourceFile(QFINDTESTDATA("ktranscript-test.ini")); + if (!sourceFile.exists()) { + qWarning() << "Could not locate test data file" << sourceFile.fileName(); + return false; + } + + if (!sourceFile.copy(targetFile.absoluteFilePath())) { + qWarning() << "Failed to copy test config file" << sourceFile.fileName() + << "to target location" << targetFile.absoluteFilePath(); + return false; + } + + return true; +} + +bool removeTestConfig() +{ + Q_ASSERT(QStandardPaths::isTestModeEnabled()); + + QDir configDir = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); + if (!configDir.exists()) { + return true; + } + + return configDir.remove(targetFileName); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/autotests/testhelpers.h new/ki18n-4.98.0/autotests/testhelpers.h --- old/ki18n-4.97.0/autotests/testhelpers.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ki18n-4.98.0/autotests/testhelpers.h 2014-03-28 19:16:55.000000000 +0100 @@ -0,0 +1,28 @@ +/* This file is part of the KI18N Framework + Copyright (C) 2014 Kevin Krammer <krammer@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library 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 TESTHELPERS_H +#define TESTHELPERS_H + +#include <QHash> + +bool deployTestConfig(); +bool removeTestConfig(); + +#endif // TESTHELPERS_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/cmake/KF5I18NMacros.cmake new/ki18n-4.98.0/cmake/KF5I18NMacros.cmake --- old/ki18n-4.97.0/cmake/KF5I18NMacros.cmake 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/cmake/KF5I18NMacros.cmake 2014-03-28 19:16:55.000000000 +0100 @@ -19,7 +19,6 @@ add_custom_command(OUTPUT ${_header} COMMAND ${CMAKE_COMMAND} ARGS - -DKDE4_HEADER:BOOL=ON -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC_EXECUTABLE} -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE} -DKDE_UIC_H_FILE:FILEPATH=${_header} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/cmake/kf5i18nuic.cmake new/ki18n-4.98.0/cmake/kf5i18nuic.cmake --- old/ki18n-4.97.0/cmake/kf5i18nuic.cmake 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/cmake/kf5i18nuic.cmake 2014-03-28 19:16:55.000000000 +0100 @@ -4,17 +4,13 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# the kde4 branch -if (KDE4_HEADER) +EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE} + -tr tr2i18n + ${KDE_UIC_FILE} + OUTPUT_VARIABLE _uic_CONTENTS +) - EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE} - -tr tr2i18n - ${KDE_UIC_FILE} - OUTPUT_VARIABLE _uic_CONTENTS - ) - - set(KDE_UIC_CPP_FILE ${KDE_UIC_H_FILE}) -endif (KDE4_HEADER) +set(KDE_UIC_CPP_FILE ${KDE_UIC_H_FILE}) IF (_uic_CONTENTS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/src/Messages.sh new/ki18n-4.98.0/src/Messages.sh --- old/ki18n-4.97.0/src/Messages.sh 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/src/Messages.sh 2014-03-28 19:16:55.000000000 +0100 @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT *.cpp *.h -o $podir/ki18n.pot +$XGETTEXT *.cpp *.h -o $podir/ki18n5.pot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ki18n-4.97.0/src/ktranscript.cpp new/ki18n-4.98.0/src/ktranscript.cpp --- old/ki18n-4.97.0/src/ktranscript.cpp 2014-03-01 12:50:54.000000000 +0100 +++ new/ki18n-4.98.0/src/ktranscript.cpp 2014-03-28 19:16:55.000000000 +0100 @@ -40,6 +40,7 @@ #include <QIODevice> #include <QTextStream> #include <QRegExp> +#include <QStandardPaths> #include <qendian.h> class KTranscriptImp; @@ -324,6 +325,8 @@ QVariant::Type vtype = val.type(); if (vtype == QVariant::String) { return QScriptValue(val.toString()); + } else if (vtype == QVariant::Bool) { + return QScriptValue(val.toBool()); } else if (vtype == QVariant::Double || vtype == QVariant::Int || vtype == QVariant::UInt || vtype == QVariant::LongLong || vtype == QVariant::ULongLong) { @@ -468,7 +471,11 @@ KTranscriptImp::KTranscriptImp() { // Load user configuration. - const QString tsConfigPath = QDir::homePath() + QLatin1Char('/') + QLatin1String(".transcriptrc"); + + QString tsConfigPath = QStandardPaths::locate(QStandardPaths::ConfigLocation, QStringLiteral("ktranscript.ini")); + if (tsConfigPath.isEmpty()) { + tsConfigPath = QDir::homePath() + QLatin1Char('/') + QLatin1String(".transcriptrc"); + } config = readConfig(tsConfigPath); } -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org