[-]
[+]
|
Changed |
kcoreaddons.spec
|
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/CMakeLists.txt
^
|
@@ -2,7 +2,7 @@
project(KCoreAddons)
-find_package(ECM 5.9.0 REQUIRED NO_MODULE)
+find_package(ECM 5.10.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@@ -37,7 +37,7 @@
include(ECMPoQmTools)
-set(KF5_VERSION "5.9.0") # handled by release scripts
+set(KF5_VERSION "5.10.0") # handled by release scripts
ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KCOREADDONS
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h"
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/KF5CoreAddonsMacros.cmake
^
|
@@ -78,3 +78,50 @@
message(FATAL_ERROR "Generating ${json} failed")
endif()
endfunction()
+
+#
+# kcoreaddons_add_plugin(plugin_name SOURCES... [JSON "pluginname.json"] [INSTALL_NAMESPACE "servicename"])
+#
+# This macro helps simplifying the creation of plugins for KPluginFactory
+# based systems.
+# It will create a plugin given the SOURCES list, the name of the JSON file
+# that will define the plugin's metadata and the INSTALL_NAMESPACE so that
+# the plugin is installed with the rest of the plugins from the same sub-system,
+# within ${PLUGIN_INSTALL_DIR}.
+#
+# Example:
+# kcoreaddons_add_plugin(kdeconnect_share JSON kdeconnect_share.json SOURCES ${kdeconnect_share_SRCS})
+
+function(kcoreaddons_add_plugin plugin)
+ set(options)
+ set(oneValueArgs JSON INSTALL_NAMESPACE)
+ set(multiValueArgs SOURCES)
+ cmake_parse_arguments(KCA_ADD_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ get_filename_component(json "${KCA_ADD_PLUGIN_JSON}" REALPATH)
+
+ # ensure we recompile the corresponding object files when the json file changes
+ set(dependent_sources )
+ foreach(source ${KCA_ADD_PLUGIN_SOURCES})
+ get_filename_component(source "${source}" REALPATH)
+ if(EXISTS "${source}")
+ file(STRINGS "${source}" match REGEX "K_PLUGIN_FACTORY_WITH_JSON")
+ if(match)
+ list(APPEND dependent_sources "${source}")
+ endif()
+ endif()
+ endforeach()
+ if(NOT dependent_sources)
+ # fallback to all sources - better safe than sorry...
+ set(dependent_sources ${KCA_ADD_PLUGIN_SOURCES})
+ endif()
+ set_property(SOURCE ${dependent_sources} APPEND PROPERTY OBJECT_DEPENDS ${json})
+
+ add_library(${plugin} MODULE ${KCA_ADD_PLUGIN_SOURCES})
+ set_property(TARGET ${plugin} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${json})
+
+ if (NOT KCA_ADD_PLUGIN_INSTALL_NAMESPACE)
+ message(FATAL_ERROR "Must specify INSTALL_NAMESPACE for ${plugin}")
+ endif()
+ install(TARGETS ${plugin} DESTINATION ${PLUGIN_INSTALL_DIR}/${KCA_ADD_PLUGIN_INSTALL_NAMESPACE})
+endfunction()
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/autotests/data/fakeplugin.desktop
^
|
@@ -12,6 +12,7 @@
Name[hu]=NSA bővítmény
Name[it]=Estensione NSA
Name[ko]=NSA 플러그인
+Name[nb]=NSA programtillegg
Name[nl]=NSA-plug-in
Name[pl]=Wtyczka NSA
Name[pt]='Plugin' da NSA
@@ -42,6 +43,7 @@
Comment[hu]=Kémbővítmény tesztelése
Comment[it]=Estensione di prova Spy
Comment[ko]=테스트 플러그인 첩자
+Comment[nb]=Test tilleggsspion
Comment[nl]=Plug-in Spy testen
Comment[pl]=Wypróbuj szpiega wtyczki
Comment[pt]=Espião dos 'Plugins' de Testes
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/autotests/data/hiddenplugin.desktop
^
|
@@ -12,6 +12,7 @@
Name[hu]=NSA bővítmény
Name[it]=Estensione NSA
Name[ko]=NSA 플러그인
+Name[nb]=NSA programtillegg
Name[nl]=NSA-plug-in
Name[pl]=Wtyczka NSA
Name[pt]='Plugin' da NSA
@@ -42,6 +43,7 @@
Comment[hu]=Kémbővítmény tesztelése
Comment[it]=Estensione di prova Spy
Comment[ko]=테스트 플러그인 첩자
+Comment[nb]=Test tilleggsspion
Comment[nl]=Plug-in Spy testen
Comment[pl]=Wypróbuj szpiega wtyczki
Comment[pt]=Espião dos 'Plugins' de Testes
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/autotests/kdelibs4configmigratortest.cpp
^
|
@@ -24,18 +24,29 @@
#include <QTemporaryDir>
#include <QTest>
#include <QDebug>
+#include <QStandardPaths>
class Kdelibs4ConfigMigratorTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
+ void initTestCase();
void shouldNotMigrateIfKde4HomeDirDoesntExist();
void shouldMigrateIfKde4HomeDirExist();
void shouldMigrateConfigFiles();
void shouldMigrateUiFiles();
};
+void Kdelibs4ConfigMigratorTest::initTestCase()
+{
+ QStandardPaths::setTestModeEnabled(true);
+ const QString configHome = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
+ QDir(configHome).removeRecursively();
+ const QString dataHome = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
+ QDir(dataHome).removeRecursively();
+}
+
void Kdelibs4ConfigMigratorTest::shouldNotMigrateIfKde4HomeDirDoesntExist()
{
qputenv("KDEHOME", "");
@@ -71,20 +82,18 @@
QVERIFY(fooConfigFile.exists());
const QString storedConfigFilePath = configPath + QLatin1Char('/') + config;
QVERIFY(QFile::copy(fooConfigFile.fileName(), storedConfigFilePath));
+ QCOMPARE(QStandardPaths::locate(QStandardPaths::ConfigLocation, config), QString());
}
- QTemporaryDir xdgConfigDir;
- const QString xdgConfighome = xdgConfigDir.path();
- QVERIFY(xdgConfigDir.isValid());
- qputenv("XDG_CONFIG_HOME", QFile::encodeName(xdgConfighome));
-
Kdelibs4ConfigMigrator migration(QLatin1String("foo"));
migration.setConfigFiles(QStringList() << listConfig);
QVERIFY(migration.migrate());
Q_FOREACH (const QString &config, listConfig) {
- const QString xdgConfigFile = xdgConfighome + QLatin1Char('/') + config;
- QVERIFY(QFile(xdgConfigFile).exists());
+ const QString migratedConfigFile = QStandardPaths::locate(QStandardPaths::ConfigLocation, config);
+ QVERIFY(!migratedConfigFile.isEmpty());
+ QVERIFY(QFile(migratedConfigFile).exists());
+ QFile::remove(migratedConfigFile);
}
}
@@ -101,20 +110,20 @@
QDir().mkpath(dataPath);
QVERIFY(QDir(dataPath).exists());
+ const QString xdgDatahome = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
+
QStringList listUi;
listUi << QLatin1String("appuirc") << QLatin1String("appui1rc");
- Q_FOREACH (const QString &config, listUi) {
- QFile fooConfigFile(QLatin1String(KDELIBS4CONFIGMIGRATOR_DATA_DIR) + QLatin1Char('/') + config);
+ Q_FOREACH (const QString &uifile, listUi) {
+ QFile fooConfigFile(QLatin1String(KDELIBS4CONFIGMIGRATOR_DATA_DIR) + QLatin1Char('/') + uifile);
QVERIFY(fooConfigFile.exists());
QDir().mkpath(dataPath + QLatin1Char('/') + appName);
- const QString storedConfigFilePath = dataPath + QLatin1Char('/') + appName + QLatin1Char('/') + config;
+ const QString storedConfigFilePath = dataPath + QLatin1Char('/') + appName + QLatin1Char('/') + uifile;
QVERIFY(QFile::copy(fooConfigFile.fileName(), storedConfigFilePath));
- }
- QTemporaryDir xdgDataDir;
- const QString xdgDatahome = xdgDataDir.path();
- QVERIFY(xdgDataDir.isValid());
- qputenv("XDG_DATA_HOME", QFile::encodeName(xdgDatahome));
+ const QString xdgUiFile = xdgDatahome + QLatin1String("/kxmlgui5/") + appName + QLatin1Char('/') + uifile;
+ QVERIFY(!QFile::exists(xdgUiFile));
+ }
Kdelibs4ConfigMigrator migration(appName);
migration.setUiFiles(QStringList() << listUi);
@@ -123,8 +132,8 @@
Q_FOREACH (const QString &uifile, listUi) {
const QString xdgUiFile = xdgDatahome + QLatin1String("/kxmlgui5/") + appName + QLatin1Char('/') + uifile;
QVERIFY(QFile(xdgUiFile).exists());
+ QFile::remove(xdgUiFile);
}
-
}
QTEST_MAIN(Kdelibs4ConfigMigratorTest)
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/autotests/kdirwatch_unittest.cpp
^
|
@@ -564,12 +564,16 @@
qDebug() << "Overwrite file1 with tempfile";
QSignalSpy spyCreated(&watch, SIGNAL(created(QString)));
+ QSignalSpy spyDirty(&watch, SIGNAL(dirty(QString)));
QVERIFY(waitForOneSignal(watch, SIGNAL(dirty(QString)), m_path));
// Getting created() on an unwatched file is an inotify bonus, it's not part of the requirements.
if (watch.internalMethod() == KDirWatch::INotify) {
QCOMPARE(spyCreated.count(), 1);
QCOMPARE(spyCreated[0][0].toString(), file1);
+
+ QCOMPARE(spyDirty.size(), 2);
+ QCOMPARE(spyDirty[1][0].toString(), filetemp);
}
// make sure we're still watching it
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/cmake/FindFAM.cmake
^
|
@@ -7,8 +7,29 @@
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
FIND_PATH(FAM_INCLUDE_DIR fam.h)
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/src/lib/io/kdirwatch.cpp
^
|
@@ -298,8 +298,14 @@
offsetCurrent += eventSize;
QString path;
- QByteArray cpath(event->name, event->len);
- if (event->len) {
+ // strip trailing null chars, see inotify_event documentation
+ // these must not end up in the final QString version of path
+ int len = event->len;
+ while (len > 1 && !event->name[len - 1]) {
+ --len;
+ }
+ QByteArray cpath(event->name, len);
+ if (len) {
path = QFile::decodeName(cpath);
}
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/src/lib/jobs/kjob.h
^
|
@@ -90,6 +90,7 @@
Q_PROPERTY(QString errorText READ errorText NOTIFY result)
Q_PROPERTY(QString errorString READ errorString NOTIFY result)
Q_PROPERTY(unsigned long percent READ percent NOTIFY percent)
+ Q_PROPERTY(Capabilities capabilities READ capabilities CONSTANT)
public:
enum Unit { Bytes, Files, Directories };
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/src/lib/util/kdelibs4migration.cpp
^
|
@@ -52,7 +52,7 @@
d->m_kdeHome = homeDir.filePath(QStringLiteral(KDE4_DEFAULT_HOME));
}
}
-
+
if (!d->m_kdeHome.isEmpty() && !d->m_kdeHome.endsWith(QLatin1Char('/'))) {
d->m_kdeHome.append(QLatin1Char('/'));
}
@@ -65,8 +65,7 @@
bool Kdelibs4Migration::kdeHomeFound() const
{
- QDir homeDir = QDir::home();
- return homeDir.exists(d->m_kdeHome);
+ return !d->m_kdeHome.isEmpty() && QDir(d->m_kdeHome).exists();
}
QString Kdelibs4Migration::locateLocal(const char *type, const QString &filename) const
|
[-]
[+]
|
Changed |
kcoreaddons-5.10.0.tar.xz/src/mimetypes/kde5.xml
^
|
@@ -3592,8 +3592,8 @@
<match type="string" offset="60" value="BOOKMOBI" />
</magic>
</mime-type>
- <!-- Will be in s-m-i 1.3, remove when we can depend on it -->
- <mime-type type="image/x-webp">
+ <!-- Released since s-m-i 1.3, remove when we can depend on it -->
+ <mime-type type="image/webp">
<comment>WebP image</comment>
<comment xml:lang="ca">imatge WebP</comment>
<comment xml:lang="ca@valencia">imatge WebP</comment>
@@ -3637,7 +3637,6 @@
<match type="string" value="WEBP" offset="8"/>
</match>
</magic>
- <alias type="image/webp"/>
<glob pattern="*.webp"/>
</mime-type>
</mime-info>
|
[-]
[+]
|
Changed |
kcoreaddons.yaml
^
|
@@ -1,5 +1,5 @@
Name : kcoreaddons
-Version : 5.9.0
+Version : 5.10.0
Release : 2
Group : System/Base
License : GPLv2+
|