...
 
Commits (33)
......@@ -28,3 +28,5 @@ GSYMS
BROWSE
*.kate-swp
/po/
build_dir
.flatpak-builder
......@@ -12,14 +12,15 @@ SET(EXTPREFIX_frameworks "${EXTPREFIX}" )
# ItemModels
# ItemViews
# WindowSystem
# kimageformats
# On Linux:
# KCrash
ExternalProject_Add(
ext_extra_cmake_modules
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/extra-cmake-modules-5.44.0.zip
URL_MD5 74aa8fc501e27024390b01c81f2925eb
URL http://download.kde.org/stable/frameworks/5.60/extra-cmake-modules-5.60.0.zip
URL_MD5 c205e17d89028ab0b034e68081d5ebfb
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/ecm_install_to_share.diff
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
......@@ -34,8 +35,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_karchive
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/karchive-5.44.0.zip
URL_MD5 c60a8e22b88cc7328610041638459689
URL http://download.kde.org/stable/frameworks/5.60/karchive-5.60.0.zip
URL_MD5 50ae1495ef5b19898a06e43160d9b84d
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/karchive.diff
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
......@@ -51,15 +52,16 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kconfig
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kconfig-5.44.0.zip
URL_MD5 d0223ea471bbf463ec42c2a2355a5183
URL http://download.kde.org/stable/frameworks/5.60/kconfig-5.60.0.zip
URL_MD5 db96fdd78a574d07b09abb720dae1a06
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/kconfig.diff
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
${GLOBAL_PROFILE}
-DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX}
-DBUILD_TESTING=false
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
${GLOBAL_PROFILE}
-DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX}
-DBUILD_TESTING=false
-DKCONFIG_USE_DBUS=off
UPDATE_COMMAND ""
DEPENDS ext_karchive
)
......@@ -68,10 +70,10 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kwidgetsaddons
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kwidgetsaddons-5.44.0.zip
URL_MD5 a9911d8d0f8aaf7a7afd84c41c8f80a1
URL http://download.kde.org/stable/frameworks/5.60/kwidgetsaddons-5.60.0.zip
URL_MD5 1b09306fe482dd5665b16a243eb2be94
INSTALL_DIR ${EXTPREFIX_frameworks}
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/kwidgetsaddons.diff
# PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/kwidgetsaddons.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
${GLOBAL_PROFILE}
......@@ -85,8 +87,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kcompletion
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kcompletion-5.44.0.zip
URL_MD5 0647885a702c338a1b656eb4f311ad16
URL http://download.kde.org/stable/frameworks/5.60/kcompletion-5.60.0.zip
URL_MD5 a9848cb26ff96246769c56244f0db25f
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
......@@ -101,8 +103,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kcoreaddons
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kcoreaddons-5.44.0.zip
URL_MD5 16a7379f3e2941d1c19d6f80939f15e8
URL http://download.kde.org/stable/frameworks/5.60/kcoreaddons-5.60.0.zip
URL_MD5 da21c1532042c2c8a7e56f444c581196
INSTALL_DIR ${EXTPREFIX_frameworks}
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/desktoptojson.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
......@@ -118,8 +120,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kguiaddons
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kguiaddons-5.44.0.zip
URL_MD5 440eefbf5abcafc492dcf857f7e4eaf5
URL http://download.kde.org/stable/frameworks/5.60/kguiaddons-5.60.0.zip
URL_MD5 f8aeea516e264c80df470efafab6ded0
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
......@@ -134,8 +136,8 @@ if(APPLE)
ExternalProject_Add(
ext_ki18n
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/ki18n-5.44.0.zip
URL_MD5 333ab0a3f65a298e928d746144d4dc8e
URL http://download.kde.org/stable/frameworks/5.60/ki18n-5.60.0.zip
URL_MD5 e53f479f22ea17629319fec710dda036
INSTALL_DIR ${EXTPREFIX_frameworks}
PATCH_COMMAND COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/ki18n-appdatalocation.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
......@@ -150,8 +152,8 @@ else()
ExternalProject_Add(
ext_ki18n
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/ki18n-5.44.0.zip
URL_MD5 333ab0a3f65a298e928d746144d4dc8e
URL http://download.kde.org/stable/frameworks/5.60/ki18n-5.60.0.zip
URL_MD5 e53f479f22ea17629319fec710dda036
INSTALL_DIR ${EXTPREFIX_frameworks}
PATCH_COMMAND COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/ki18n-appdatalocation.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
......@@ -167,8 +169,8 @@ endif()
ExternalProject_Add(
ext_kitemmodels
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kitemmodels-5.44.0.zip
URL_MD5 ea43a5e2cc7033eb672796b108d7403b
URL http://download.kde.org/stable/frameworks/5.60/kitemmodels-5.60.0.zip
URL_MD5 c8f02881a65d496d6114bb2155cdfc36
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
......@@ -182,8 +184,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kitemviews
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kitemviews-5.44.0.zip
URL_MD5 8b15c703313c7a790c7db897ef17de7d
URL http://download.kde.org/stable/frameworks/5.60/kitemviews-5.60.0.zip
URL_MD5 9d94b8da72f43fac39aa782f7efd941e
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
......@@ -197,8 +199,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kimageformats
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kimageformats-5.44.0.zip
URL_MD5 02a98b682f9cb655592148d7ebcc05e7
URL http://download.kde.org/stable/frameworks/5.60/kimageformats-5.60.0.zip
URL_MD5 a8b413560d12cd956d689784a056d6e0
INSTALL_DIR ${EXTPREFIX_frameworks}
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/kimageformats.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
......@@ -213,8 +215,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kwindowsystem
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kwindowsystem-5.44.0.zip
URL_MD5 75329f47cf8cd413fa1d15a57c298563
URL http://download.kde.org/stable/frameworks/5.60/kwindowsystem-5.60.0.zip
URL_MD5 c15c29141b5edca67143b735a94d3f43
INSTALL_DIR ${EXTPREFIX_frameworks}
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/kwindowsystem-x11.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
......@@ -229,8 +231,8 @@ ExternalProject_Add(
ExternalProject_Add(
ext_kcrash
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://download.kde.org/stable/frameworks/5.44/kcrash-5.44.0.zip
URL_MD5 61adc0e125c65288968d958acf25f4aa
URL http://download.kde.org/stable/frameworks/5.60/kcrash-5.60.0.zip
URL_MD5 7449a6f2b314b944ab2bed00124fe69b
INSTALL_DIR ${EXTPREFIX_frameworks}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
......
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2441977..2a20a13 100644
index 45b3bf0..6afd3cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,20 +29,20 @@ set_package_properties(ZLIB PROPERTIES
PURPOSE "Required by the core KDE libraries and some critical kioslaves"
@@ -33,7 +33,7 @@ find_package(BZip2)
set_package_properties(BZip2 PROPERTIES
URL "https://sourceware.org/bzip2/"
DESCRIPTION "Support for BZip2 compressed files and data streams"
- TYPE RECOMMENDED
+ TYPE OPTIONAL
PURPOSE "Support for BZip2 compressed files and data streams"
)
-find_package(BZip2)
-set_package_properties(BZip2 PROPERTIES
- URL "http://www.bzip.org"
- DESCRIPTION "Support for BZip2 compressed files and data streams"
- TYPE RECOMMENDED
- PURPOSE "Support for BZip2 compressed files and data streams"
-)
-
-find_package(LibLZMA)
-set_package_properties(LibLZMA PROPERTIES
- URL "http://tukaani.org/xz/"
- DESCRIPTION "Support for xz compressed files and data streams"
- PURPOSE "Support for xz compressed files and data streams"
-)
+#find_package(BZip2)
+#set_package_properties(BZip2 PROPERTIES
+# URL "http://www.bzip.org"
+# DESCRIPTION "Support for BZip2 compressed files and data streams"
+# TYPE RECOMMENDED
+# PURPOSE "Support for BZip2 compressed files and data streams"
+#)
+
+#find_package(LibLZMA)
+#set_package_properties(LibLZMA PROPERTIES
+# URL "http://tukaani.org/xz/"
+# DESCRIPTION "Support for xz compressed files and data streams"
+# PURPOSE "Support for xz compressed files and data streams"
+#)
include_directories(
${ZLIB_INCLUDE_DIR}
@@ -41,6 +41,7 @@ find_package(LibLZMA)
set_package_properties(LibLZMA PROPERTIES
URL "http://tukaani.org/xz/"
DESCRIPTION "Support for xz compressed files and data streams"
+ TYPE OPTIONAL
PURPOSE "Support for xz compressed files and data streams"
)
include_directories(
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp
index 3e0578f..6c4408d 100644
--- a/autotests/kconfigtest.cpp
+++ b/autotests/kconfigtest.cpp
@@ -587,7 +587,7 @@ void KConfigTest::testPathQtHome()
qunsetenv("QT_CACHE_HOME");
qunsetenv("QT_CONFIG_HOME");
QVERIFY(group.hasKey("dataDir"));
- QCOMPARE(group.readEntry("dataDir", QString()), QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation).append(QStringLiteral("/kconfigtest")));
+ QCOMPARE(group.readEntry("dataDir", QString()), QStandardPaths::writableLocation(QStandardPaths::AppDataLocation).append(QStringLiteral("/kconfigtest")));
QVERIFY(group.hasKey("cacheDir"));
QCOMPARE(group.readEntry("cacheDir", QString()), QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation).append(QStringLiteral("/kconfigtest")));
QVERIFY(group.hasKey("configDir"));
diff --git a/autotests/kdesktopfiletest.cpp b/autotests/kdesktopfiletest.cpp
index fd4a5c9..db08f22 100644
--- a/autotests/kdesktopfiletest.cpp
+++ b/autotests/kdesktopfiletest.cpp
@@ -222,7 +222,7 @@ void KDesktopFileTest::testIsAuthorizedDesktopFile()
QVERIFY(QFile::exists(fileName));
QVERIFY(!KDesktopFile::isAuthorizedDesktopFile(fileName));
- const QString installedFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("/kservices5/http_cache_cleaner.desktop"));
+ const QString installedFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("/kservices5/http_cache_cleaner.desktop"));
if (!installedFile.isEmpty()) {
QVERIFY(KDesktopFile::isAuthorizedDesktopFile(installedFile));
} else {
@@ -281,8 +281,8 @@ void KDesktopFileTest::testLocateLocal_data()
{
QString systemConfigLocation = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation).last();
QString writableConfigLocation = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
- QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).last();
- QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
+ QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).last();
+ QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
QTest::addColumn<QString>("path");
QTest::addColumn<QString>("result");
diff --git a/autotests/test_kconf_update.cpp b/autotests/test_kconf_update.cpp
index 3353061..a80ae1e 100644
--- a/autotests/test_kconf_update.cpp
+++ b/autotests/test_kconf_update.cpp
@@ -625,7 +625,7 @@ void TestKConfUpdate::testScript()
QSharedPointer<QTemporaryFile> updFile(writeUpdFile(updContent));
- const QString scriptDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kconf_update";
+ const QString scriptDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/kconf_update";
QVERIFY(QDir().mkpath(scriptDir));
QString scriptPath = scriptDir + "/test.sh";
writeFile(scriptPath, updScript);
diff --git a/docs/options.md b/docs/options.md
index fab22e1..8823818 100644
index c634c00..5e59219 100644
--- a/docs/options.md
+++ b/docs/options.md
@@ -96,4 +96,4 @@ They are:
......@@ -59,10 +9,10 @@ index fab22e1..8823818 100644
-* `$QT_DATA_HOME` - QStandardPaths::GenericDataLocation
+* `$QT_DATA_HOME` - QStandardPaths::AppDataLocation
diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp
index c8eb90a..18d1b69 100644
index e1b11ed..e3511cf 100644
--- a/src/core/kconfig.cpp
+++ b/src/core/kconfig.cpp
@@ -229,7 +229,7 @@ QString KConfigPrivate::expandString(const QString &value)
@@ -237,7 +237,7 @@ QString KConfigPrivate::expandString(const QString &value)
env = QString::fromLocal8Bit(pEnv.constData());
} else {
if (aVarName == QStringLiteral("QT_DATA_HOME")) {
......@@ -72,19 +22,21 @@ index c8eb90a..18d1b69 100644
env = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
} else if (aVarName == QStringLiteral("QT_CACHE_HOME")) {
diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp
index b0b6a87..daddd54 100644
index d9283ce..f869fb0 100644
--- a/src/core/kdesktopfile.cpp
+++ b/src/core/kdesktopfile.cpp
@@ -88,7 +88,7 @@ QString KDesktopFile::locateLocal(const QString &path)
@@ -89,8 +89,8 @@ QString KDesktopFile::locateLocal(const QString &path)
}
}
// Relative to xdg data dir? (much more common)
- Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) {
+ Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) {
- const QStringList lstGenericDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
- for (const QString &dir : lstGenericDataLocation) {
+ const QStringList lstAppDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
+ for (const QString &dir : lstAppDataLocation) {
if (path.startsWith(dir + plus)) {
relativePath = path.mid(dir.length() + 1);
}
@@ -97,7 +97,7 @@ QString KDesktopFile::locateLocal(const QString &path)
@@ -99,7 +99,7 @@ QString KDesktopFile::locateLocal(const QString &path)
// What now? The desktop file doesn't come from XDG_DATA_DIRS. Use filename only and hope for the best.
relativePath = path.mid(path.lastIndexOf(QLatin1Char('/')) + 1);
}
......@@ -93,20 +45,22 @@ index b0b6a87..daddd54 100644
}
bool KDesktopFile::isDesktopFile(const QString &path)
@@ -134,7 +134,7 @@ bool KDesktopFile::isAuthorizedDesktopFile(const QString &path)
@@ -136,8 +136,8 @@ bool KDesktopFile::isAuthorizedDesktopFile(const QString &path)
}
}
const QString servicesDir = QStringLiteral("kservices5/"); // KGlobal::dirs()->xdgDataRelativePath("services")
- Q_FOREACH (const QString &xdgDataPrefix, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) {
+ Q_FOREACH (const QString &xdgDataPrefix, QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) {
- const QStringList lstGenericDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
- for (const QString &xdgDataPrefix : lstGenericDataLocation) {
+ const QStringList lstAppDataLocation = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
+ for (const QString &xdgDataPrefix : lstAppDataLocation) {
if (QDir(xdgDataPrefix).exists()) {
const QString prefix = QFileInfo(xdgDataPrefix).canonicalFilePath();
if (realPath.startsWith(prefix + QLatin1Char('/') + servicesDir, sensitivity)) {
diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp
index ab7d946..eeaf6ca 100644
index f6c7653..f9b83ac 100644
--- a/src/kconf_update/kconf_update.cpp
+++ b/src/kconf_update/kconf_update.cpp
@@ -125,7 +125,7 @@ KonfUpdate::KonfUpdate(QCommandLineParser *parser)
@@ -145,7 +145,7 @@ KonfUpdate::KonfUpdate(QCommandLineParser *parser)
m_bUseConfigInfo = false;
if (parser->isSet(QStringLiteral("check"))) {
m_bUseConfigInfo = true;
......@@ -114,26 +68,17 @@ index ab7d946..eeaf6ca 100644
+ const QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, "kconf_update/" + parser->value(QStringLiteral("check")));
if (file.isEmpty()) {
qWarning("File '%s' not found.", parser->value(QStringLiteral("check")).toLocal8Bit().data());
log() << "File '" << parser->value(QStringLiteral("check")) << "' passed on command line not found" << endl;
@@ -177,7 +177,7 @@ KonfUpdate::log()
{
if (!m_textStream) {
#if 0
- QString dir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + "kconf_update/log";
+ QString dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + "kconf_update/log";
QDir().mkpath(dir);
QString file = dir + "/update.log";
m_file = new QFile(file);
@@ -206,7 +206,7 @@ QStringList KonfUpdate::findUpdateFiles(bool dirtyOnly)
qCDebug(KCONF_UPDATE_LOG) << "File" << parser->value(QStringLiteral("check")) << "passed on command line not found";
@@ -190,7 +190,7 @@ QStringList KonfUpdate::findUpdateFiles(bool dirtyOnly)
{
QStringList result;
- const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory);
+ const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("kconf_update"), QStandardPaths::LocateDirectory);
Q_FOREACH (const QString &d, dirs) {
for (const QString &d : dirs) {
const QDir dir(d);
@@ -760,7 +760,7 @@ void KonfUpdate::gotScript(const QString &_script)
@@ -751,7 +751,7 @@ void KonfUpdate::gotScript(const QString &_script)
return;
}
......
diff --git a/docs/programmers-guide.md b/docs/programmers-guide.md
index 9505366..65fc9a5 100644
--- a/docs/programmers-guide.md
+++ b/docs/programmers-guide.md
@@ -2246,7 +2246,7 @@ then a call to
~~~
QString splashPath = QStandardPaths::locate(
- QStandardPaths::GenericDataLocation, "splash.png");
+ QStandardPaths::AppDataLocation, "splash.png");
splashPath = KLocalizedString::localizedFilePath(splashPath);
~~~
diff --git a/src/kcatalog.cpp b/src/kcatalog.cpp
index c18d40f..b0ed09d 100644
index c47ffac..e24eb84 100644
--- a/src/kcatalog.cpp
+++ b/src/kcatalog.cpp
@@ -128,7 +128,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain,
}
@@ -144,7 +144,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain,
}
return file;
#else
- const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("locale/") + relpath);
+ const QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("locale/") + relpath);
- QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
+ QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation,
QStringLiteral("locale/") + relpath);
QString localeDir;
if (file.isEmpty()) {
@@ -143,7 +143,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain,
if (!file.isEmpty()) {
@@ -158,7 +158,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain,
QSet<QString> KCatalog::availableCatalogLanguages(const QByteArray &domain_)
{
QString domain = QFile::decodeName(domain_);
......@@ -20,3 +33,16 @@ index c18d40f..b0ed09d 100644
QStringLiteral("locale"),
QStandardPaths::LocateDirectory);
diff --git a/src/klocalizedstring.cpp b/src/klocalizedstring.cpp
index eb42c81..219bb51 100644
--- a/src/klocalizedstring.cpp
+++ b/src/klocalizedstring.cpp
@@ -1363,7 +1363,7 @@ void KLocalizedStringPrivate::locateScriptingModule(const QByteArray &domain,
// Try to find this module.
QString modapath = QStandardPaths::locate(
- QStandardPaths::GenericDataLocation,
+ QStandardPaths::AppDataLocation,
QLatin1String("locale") + QLatin1Char('/') + modrpath);
// If the module exists and hasn't been already included.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 178117e..497395d 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,11 +54,11 @@ if(MSVC)
endif()
add_definitions(-DTRANSLATION_DOMAIN=\"ki18n5\")
-if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
- ki18n_install(po)
-endif()
+#if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
+# ki18n_install(po)
+#endif()
add_subdirectory(src)
-add_subdirectory(autotests)
+#add_subdirectory(autotests)
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5I18n")
diff --git a/cmake/KF5I18NMacros.cmake b/cmake/KF5I18NMacros.cmake
index 53ba812..db8ea98 100755
--- a/cmake/KF5I18NMacros.cmake
+++ b/cmake/KF5I18NMacros.cmake
@@ -25,14 +25,9 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
-find_package(Gettext REQUIRED)
-find_package(PythonInterp REQUIRED)
-
-set(_ki18n_pmap_compile_script ${CMAKE_CURRENT_LIST_DIR}/ts-pmap-compile.py)
-set(_ki18n_uic_script ${CMAKE_CURRENT_LIST_DIR}/kf5i18nuic.cmake)
-
#create the implementation files from the ui files and add them to the list of sources
#usage: KI18N_WRAP_UI(foo_SRCS ${ui_files})
+set(_ki18n_uic_script ${CMAKE_CURRENT_LIST_DIR}/kf5i18nuic.cmake)
macro (KI18N_WRAP_UI _sources )
foreach (_current_FILE ${ARGN})
@@ -57,6 +52,13 @@ macro (KI18N_WRAP_UI _sources )
endforeach (_current_FILE)
endmacro (KI18N_WRAP_UI)
+find_package(Gettext)
+find_package(PythonInterp)
+
+if (Gettext_FOUND AND PythonInterp_FOUND)
+
+set(_ki18n_pmap_compile_script ${CMAKE_CURRENT_LIST_DIR}/ts-pmap-compile.py)
+
#install the scripts for a given language in the target folder
#usage: KI18N_INSTALL_TS_FILES("ja" ${scripts_dir})
function(KI18N_INSTALL_TS_FILES lang scripts_dir)
@@ -225,3 +227,7 @@ function(_KI18N_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
endfunction()
# End of CMake copied code ####################################################
+
+else()
+ message("Warning: Python and Gettext are needed for some functionality.")
+endif() # Python and gettext found
diff --git a/src/kstartupinfo.cpp b/src/kstartupinfo.cpp
index a97b8b5..0ae7e5b 100644
index 76ab3be..014ab36 100644
--- a/src/kstartupinfo.cpp
+++ b/src/kstartupinfo.cpp
@@ -493,7 +493,7 @@ bool KStartupInfo::sendStartupX(Display *disp_P, const KStartupInfoId &id_P,
@@ -490,7 +490,7 @@ bool KStartupInfo::sendStartupX(Display *disp_P, const KStartupInfoId &id_P,
#ifdef KSTARTUPINFO_ALL_DEBUG
qCDebug(LOG_KWINDOWSYSTEM) << "sending " << msg;
#endif
......@@ -11,7 +11,7 @@ index a97b8b5..0ae7e5b 100644
#else
Q_UNUSED(disp_P)
Q_UNUSED(data_P)
@@ -548,7 +548,7 @@ bool KStartupInfo::sendChangeX(Display *disp_P, const KStartupInfoId &id_P,
@@ -565,7 +565,7 @@ bool KStartupInfo::sendChangeX(Display *disp_P, const KStartupInfoId &id_P,
#ifdef KSTARTUPINFO_ALL_DEBUG
qCDebug(LOG_KWINDOWSYSTEM) << "sending " << msg;
#endif
......@@ -20,7 +20,7 @@ index a97b8b5..0ae7e5b 100644
#else
Q_UNUSED(disp_P)
Q_UNUSED(data_P)
@@ -580,7 +580,7 @@ bool KStartupInfo::sendFinishX(Display *disp_P, const KStartupInfoId &id_P)
@@ -617,7 +617,7 @@ bool KStartupInfo::sendFinishX(Display *disp_P, const KStartupInfoId &id_P)
#ifdef KSTARTUPINFO_ALL_DEBUG
qCDebug(LOG_KWINDOWSYSTEM) << "sending " << msg;
#endif
......@@ -29,7 +29,7 @@ index a97b8b5..0ae7e5b 100644
#else
Q_UNUSED(disp_P)
return true;
@@ -615,7 +615,7 @@ bool KStartupInfo::sendFinishX(Display *disp_P, const KStartupInfoId &id_P,
@@ -668,7 +668,7 @@ bool KStartupInfo::sendFinishX(Display *disp_P, const KStartupInfoId &id_P,
#ifdef KSTARTUPINFO_ALL_DEBUG
qCDebug(LOG_KWINDOWSYSTEM) << "sending " << msg;
#endif
......@@ -39,10 +39,10 @@ index a97b8b5..0ae7e5b 100644
Q_UNUSED(disp_P)
Q_UNUSED(id_P)
diff --git a/src/platforms/xcb/kwindowsystem.cpp b/src/platforms/xcb/kwindowsystem.cpp
index 9d28704..603d9b2 100644
index 6789b7c..84b6d4c 100644
--- a/src/platforms/xcb/kwindowsystem.cpp
+++ b/src/platforms/xcb/kwindowsystem.cpp
@@ -196,7 +196,7 @@ bool NETEventFilter::nativeEventFilter(xcb_generic_event_t *ev)
@@ -234,7 +234,7 @@ bool NETEventFilter::nativeEventFilter(xcb_generic_event_t *ev)
int old_number_of_desktops = numberOfDesktops();
bool old_showing_desktop = showingDesktop();
unsigned long m[ 5 ];
......
......@@ -443,6 +443,8 @@ add_definitions(
-DQT_STRICT_ITERATORS
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_NO_URL_CAST_FROM_STRING
-DQT_USE_FAST_CONCATENATION
-DQT_USE_FAST_OPERATOR_PLUS
)
if (${Qt5_VERSION} VERSION_GREATER "5.8.0" )
......
......@@ -16,6 +16,7 @@ add_subdirectory( image )
add_subdirectory( ui )
add_subdirectory( impex )
add_subdirectory( libkis )
add_subdirectory( stroke )
if (NOT APPLE AND HAVE_QT_QUICK)
add_subdirectory( libqml )
endif()
......
......@@ -501,7 +501,7 @@ bool KoCreatePathTool::addPathShapeImpl(KoPathShape *pathShape, bool tryMergeOnl
return false;
}
KUndo2Command *cmd = canvas()->shapeController()->addShape(pathShape, 0);
KUndo2Command *cmd = canvas()->shapeController()->addShape(pathShape, 0, 0);
KIS_SAFE_ASSERT_RECOVER(cmd) {
canvas()->updateCanvas(pathShape->boundingRect());
delete pathShape;
......
......@@ -402,7 +402,7 @@ void KoPencilTool::addPathShape(KoPathShape* path, bool closePath)
}
}
KUndo2Command * cmd = canvas()->shapeController()->addShape(path, 0);
KUndo2Command * cmd = canvas()->shapeController()->addShape(path, 0, 0);
if (cmd) {
KoSelection *selection = canvas()->shapeManager()->selection();
selection->deselectAll();
......
......@@ -242,7 +242,7 @@ target_include_directories(kritaflake
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/text>
)
target_link_libraries(kritaflake kritapigment kritawidgetutils kritaodf kritacommand KF5::WidgetsAddons Qt5::Svg)
target_link_libraries(kritaflake kritapigment kritawidgetutils kritaodf kritacommand kritastroke KF5::WidgetsAddons Qt5::Svg)
set_target_properties(kritaflake PROPERTIES
VERSION ${GENERIC_KRITA_LIB_VERSION} SOVERSION ${GENERIC_KRITA_LIB_SOVERSION}
......
......@@ -220,7 +220,7 @@ void Viewport::handleDropEvent(QDropEvent *event)
m_draggedShape->setAbsolutePosition(newPos);
KUndo2Command * cmd = m_parent->canvas()->shapeController()->addShape(m_draggedShape, 0);
KUndo2Command * cmd = m_parent->canvas()->shapeController()->addShape(m_draggedShape, 0, 0);
if (cmd) {
m_parent->canvas()->addCommand(cmd);
......
......@@ -468,10 +468,10 @@ QRectF KoPathShape::outlineRect() const
QPainterPath KoPathShape::outline() const
{
QPainterPath path;
Q_FOREACH (KoSubpath * subpath, d->subpaths) {
KoPathPoint * lastPoint = subpath->first();
Q_FOREACH (const KoSubpath * subpath, d->subpaths) {
const KoPathPoint * lastPoint = subpath->first();
bool activeCP = false;
Q_FOREACH (KoPathPoint * currPoint, *subpath) {
Q_FOREACH (const KoPathPoint * currPoint, *subpath) {
KoPathPoint::PointProperties currProperties = currPoint->properties();
if (currPoint == subpath->first()) {
if (currProperties & KoPathPoint::StartSubpath) {
......@@ -498,7 +498,7 @@ QPainterPath KoPathShape::outline() const
}
if (currProperties & KoPathPoint::CloseSubpath && currProperties & KoPathPoint::StopSubpath) {
// add curve when there is a curve on the way to the first point
KoPathPoint * firstPoint = subpath->first();
const KoPathPoint * firstPoint = subpath->first();
Q_ASSERT(!qIsNaNPoint(firstPoint->point()));
if (currPoint->activeControlPoint2() && firstPoint->activeControlPoint1()) {
path.cubicTo(
......
......@@ -54,22 +54,25 @@ void KoResourceManager::setResource(int key, const QVariant &value)
m_resources[sourceKey] = newSourceValue;
notifyResourceChanged(sourceKey, newSourceValue);
}
} else if (m_resources.contains(key)) {
} else if (m_resources.contains(key)) {
const QVariant oldValue = m_resources.value(key, QVariant());
m_resources[key] = value;
if (m_updateMediators.contains(key)) {
m_updateMediators[key]->connectResource(value);
}
if (oldValue != value) {
notifyResourceChanged(key, value);
}
}
else {
} else {
m_resources[key] = value;
if (m_updateMediators.contains(key)) {
m_updateMediators[key]->connectResource(value);
}
notifyResourceChanged(key, value);
}
}
void KoResourceManager::notifyResourceChanged(int key, const QVariant &value)
......
......@@ -3,6 +3,7 @@
* Copyright (C) 2006-2007, 2010 Thomas Zander <zander@kde.org>
* Copyright (C) 2006-2008 Thorsten Zachmann <zachmann@kde.org>
* Copyright (C) 2011 Jan Hambrecht <jaham@gmx.net>
* Copyright (C) 2019 Tusooa Zhu <tusooa@vista.aero>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -30,6 +31,7 @@
#include "commands/KoShapeCreateCommand.h"
#include "commands/KoShapeDeleteCommand.h"
#include "commands/KoShapeConnectionChangeCommand.h"
#include "commands/KoShapeReorderCommand.h"
#include "KoCanvasBase.h"
#include "KoShapeConfigWidgetBase.h"
#include "KoShapeFactoryBase.h"
......@@ -102,11 +104,85 @@ public:
return addShapesDirect({shape}, parentShape, parent);
}
void addShape(KoShape *shape, bool showDialog, KoShapeContainer *parentShape) {
if (canvas) {
if (showDialog && !shape->shapeId().isEmpty()) {
KoShapeFactoryBase *factory = KoShapeRegistry::instance()->value(shape->shapeId());
Q_ASSERT(factory);
qint16 z = 0;
Q_FOREACH (KoShape *sh, canvas->shapeManager()->shapes()) {
z = qMax(z, sh->zIndex());
}
shape->setZIndex(z + 1);
// show config dialog.
KPageDialog *dialog = new KPageDialog(canvas->canvasWidget());
dialog->setWindowTitle(i18n("%1 Options", factory->name()));
int pageCount = 0;
QList<KoShapeConfigWidgetBase*> widgets;
Q_FOREACH (KoShapeConfigWidgetBase* panel, factory->createShapeOptionPanels()) {
if (! panel->showOnShapeCreate())
continue;
panel->open(shape);
panel->connect(panel, SIGNAL(accept()), dialog, SLOT(accept()));
widgets.append(panel);
panel->setResourceManager(canvas->resourceManager());
panel->setUnit(canvas->unit());
QString title = panel->windowTitle().isEmpty() ? panel->objectName() : panel->windowTitle();
dialog->addPage(panel, title);
pageCount ++;
}
if (pageCount > 0) {
if (pageCount > 1)
dialog->setFaceType(KPageDialog::Tabbed);
if (dialog->exec() != KPageDialog::Accepted) {
delete dialog;
return; /// FIXME how to indicate failure?
}
Q_FOREACH (KoShapeConfigWidgetBase *widget, widgets)
widget->save();
}
delete dialog;
}
}
addShapesDirect({shape}, parentShape);
}
KUndo2Command* addShapesDirect(const QList<KoShape*> shapes, KoShapeContainer *parentShape, KUndo2Command *parent)
{
return new KoShapeCreateCommand(shapeController, shapes, parentShape, parent);
}
void addShapesDirect(const QList<KoShape*> shapes, KoShapeContainer *parentShape)
{
// from KoShapeCreateCommand::redo()
Q_FOREACH (KoShape *shape, shapes) {
if (parentShape) {
shape->setParent(parentShape);
}
shapeController->addShape(shape);
KoShapeContainer *shapeParent = shape->parent();
KIS_SAFE_ASSERT_RECOVER_NOOP(shape->parent() ||
dynamic_cast<KoShapeLayer*>(shape));
if (shapeParent) {
// TODO get rid of undo commands here
QScopedPointer<KUndo2Command> cmd(KoShapeReorderCommand::mergeInShape(shapeParent->shapes(), shape));
if (cmd) {
cmd->redo();
}
}
}
}
void handleAttachedConnections(KoShape *shape, KUndo2Command *parentCmd) {
foreach (KoShape *dependee, shape->dependees()) {
KoConnectionShape *connection = dynamic_cast<KoConnectionShape*>(dependee);
......@@ -121,6 +197,19 @@ public:
}
}
}
void handleAttachedConnections(KoShape *shape) {
foreach (KoShape *dependee, shape->dependees()) {
KoConnectionShape *connection = dynamic_cast<KoConnectionShape*>(dependee);
if (connection) {
if (shape == connection->firstShape()) {
connection->connectFirst(/* shape = */ 0, /* connectionPointId = */ -1);
} else if (shape == connection->secondShape()) {
connection->connectSecond(/* shape = */ 0, /* connectionPointId = */ -1);
}
}
}
}
};
KoShapeController::KoShapeController(KoCanvasBase *canvas, KoShapeControllerBase *shapeController)
......@@ -146,25 +235,52 @@ KUndo2Command* KoShapeController::addShape(KoShape *shape, KoShapeContainer *par
return d->addShape(shape, true, parentShape, parent);
}
void KoShapeController::addShape(KoShape *shape, KoShapeContainer *parentShape)
{
d->addShape(shape, true, parentShape);
}
KUndo2Command* KoShapeController::addShapeDirect(KoShape *shape, KoShapeContainer *parentShape, KUndo2Command *parent)
{
return d->addShapesDirect({shape}, parentShape, parent);
}
void KoShapeController::addShapeDirect(KoShape *shape, KoShapeContainer *parentShape)
{
d->addShapesDirect({shape}, parentShape);
}
KUndo2Command *KoShapeController::addShapesDirect(const QList<KoShape *> shapes, KoShapeContainer *parentShape, KUndo2Command *parent)
{
return d->addShapesDirect(shapes, parentShape, parent);
}
KUndo2Command* KoShapeController::removeShape(KoShape *shape, KUndo2Command *parent)
void KoShapeController::addShapesDirect(const QList<KoShape *> shapes, KoShapeContainer *parentShape)
{
KUndo2Command *cmd = new KoShapeDeleteCommand(d->shapeController, shape, parent);
QList<KoShape*> shapes;
shapes.append(shape);
d->shapeController->shapesRemoved(shapes, cmd);
// detach shape from any attached connection shapes
d->handleAttachedConnections(shape, cmd);
return cmd;
d->addShapesDirect(shapes, parentShape);
}
void KoShapeController::removeShape(KoShape *shape)
{
removeShapes({shape});
}
void KoShapeController::removeShapes(const QList<KoShape*> &shapes)
{
d->shapeController->shapesRemoved(shapes, 0);
Q_FOREACH (KoShape *shape, shapes) {
KoShapeContainer *parent = shape->parent();
d->shapeController->removeShape(shape);
if (parent) {
parent->removeShape(shape);
}
d->handleAttachedConnections(shape);
}
}
KUndo2Command *KoShapeController::removeShape(KoShape *shape, KUndo2Command *parent)
{
return removeShapes({shape}, parent);
}
KUndo2Command* KoShapeController::removeShapes(const QList<KoShape*> &shapes, KUndo2Command *parent)
......@@ -177,6 +293,7 @@ KUndo2Command* KoShapeController::removeShapes(const QList<KoShape*> &shapes, KU
return cmd;
}
void KoShapeController::setShapeControllerBase(KoShapeControllerBase *shapeController)
{
d->shapeController = shapeController;
......
......@@ -75,7 +75,8 @@ public:
* @return command which will insert the shape into the document or 0 if the
* insertion was cancelled. The command is not yet executed.
*/
KUndo2Command* addShape(KoShape *shape, KoShapeContainer *parentShape, KUndo2Command *parent = 0);
KUndo2Command* addShape(KoShape *shape, KoShapeContainer *parentShape, KUndo2Command *parent);
void addShape(KoShape *shape, KoShapeContainer *parentShape);
/**
* @brief Add a shape to the document, skipping any dialogs or other user interaction.
......@@ -86,7 +87,8 @@ public:
*
* @return command which will insert the shape into the document. The command is not yet executed.
*/
KUndo2Command* addShapeDirect(KoShape *shape, KoShapeContainer *parentShape, KUndo2Command *parent = 0);
KUndo2Command* addShapeDirect(KoShape *shape, KoShapeContainer *parentShape, KUndo2Command *parent);
void addShapeDirect(KoShape *shape, KoShapeContainer *parentShape);
/**
* @brief Add shapes to the document, skipping any dialogs or other user interaction.
......@@ -97,7 +99,8 @@ public:
*
* @return command which will insert the shapes into the document. The command is not yet executed.
*/
KUndo2Command* addShapesDirect(const QList<KoShape*> shape, KoShapeContainer *parentShape, KUndo2Command *parent = 0);
KUndo2Command* addShapesDirect(const QList<KoShape*> shape, KoShapeContainer *parentShape, KUndo2Command *parent);
void addShapesDirect(const QList<KoShape *> shape, KoShapeContainer *parentShape);
/**
* @brief Remove a shape from the document.
......@@ -108,7 +111,8 @@ public:
* @return command which will remove the shape from the document.
* The command is not yet executed.
*/
KUndo2Command* removeShape(KoShape *shape, KUndo2Command *parent = 0);
KUndo2Command* removeShape(KoShape *shape, KUndo2Command *parent);
void removeShape(KoShape *shape);
/**
* Remove a shape from the document.
......@@ -119,7 +123,8 @@ public:
* @return command which will remove the shape from the document.
* The command is not yet executed.
*/
KUndo2Command* removeShapes(const QList<KoShape*> &shapes, KUndo2Command *parent = 0);
KUndo2Command* removeShapes(const QList<KoShape*> &shapes, KUndo2Command *parent);
void removeShapes(const QList<KoShape *> &shapes);
/**
* @brief Set the KoShapeControllerBase used to add/remove shapes.
......
......@@ -65,6 +65,7 @@ bool KoShapeManager::Private::shapeUsedInRenderingTree(KoShape *shape)
void KoShapeManager::Private::updateTree()
{
qDebug() << "start updateTree()";
// for detecting collisions between shapes.
DetectCollision detector;
bool selectionModified = false;
......@@ -98,6 +99,7 @@ void KoShapeManager::Private::updateTree()
if (anyModified) {
emit q->contentChanged();
}
qDebug() << "end updateTree()";
}
void KoShapeManager::Private::paintGroup(KoShapeGroup *group, QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &paintContext)
......
......@@ -80,7 +80,7 @@ KUndo2Command* KoCreateShapeStrategy::createCommand()
if (newSize.width() > 1.0 && newSize.height() > 1.0)
shape->setSize(newSize);
KUndo2Command * cmd = parent->canvas()->shapeController()->addShape(shape, 0);
KUndo2Command * cmd = parent->canvas()->shapeController()->addShape(shape, 0, 0);
if (cmd) {
KoSelection *selection = parent->canvas()->shapeManager()->selection();
selection->deselectAll();
......
......@@ -27,7 +27,6 @@
#include "kis_global.h"
#include "kis_assert.h"
KoInteractionTool::KoInteractionTool(KoCanvasBase *canvas)
: KoToolBase(*(new KoInteractionToolPrivate(this, canvas)))
{
......
......@@ -261,5 +261,6 @@ private:
T *m_lock;
};
#endif // KISGLOBAL_H_
......@@ -175,17 +175,8 @@ set(kritaimage_LIB_SRCS
kis_updater_context.cpp
kis_update_job_item.cpp
kis_stroke_strategy_undo_command_based.cpp
kis_simple_stroke_strategy.cpp
KisRunnableBasedStrokeStrategy.cpp
KisRunnableStrokeJobDataBase.cpp
KisRunnableStrokeJobData.cpp
KisRunnableStrokeJobsInterface.cpp
KisFakeRunnableStrokeJobsExecutor.cpp
kis_stroke_job_strategy.cpp
kis_stroke_strategy.cpp
kis_stroke.cpp
kis_strokes_queue.cpp
KisStrokesQueueMutatedJobInterface.cpp
kis_simple_update_queue.cpp
kis_update_scheduler.cpp
kis_queues_progress_updater.cpp
......@@ -333,6 +324,7 @@ target_link_libraries(kritaimage
kritacommand
kritawidgetutils
kritametadata
kritastroke
Qt5::Concurrent
)
......
......@@ -20,6 +20,7 @@
#define KISFAKERUNNABLESTROKEJOBSEXECUTOR_H
#include "KisRunnableStrokeJobsInterface.h"
#include <kritaimage_export.h>
class KRITAIMAGE_EXPORT KisFakeRunnableStrokeJobsExecutor : public KisRunnableStrokeJobsInterface
......
......@@ -18,10 +18,6 @@
#include "kis_image_interfaces.h"
KisStrokesFacade::~KisStrokesFacade()
{
}
KisUpdatesFacade::~KisUpdatesFacade()
{
}
......
......@@ -22,22 +22,15 @@
#include "kis_types.h"
#include <kritaimage_export.h>
#include <KisStrokesFacade.h>
class QRect;
class KisStrokeStrategy;
class KisStrokeJobData;
class KisPostExecutionUndoAdapter;
class KRITAIMAGE_EXPORT KisStrokesFacade
{
public:
virtual ~KisStrokesFacade();
virtual KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy) = 0;
virtual void addJob(KisStrokeId id, KisStrokeJobData *data) = 0;
virtual void endStroke(KisStrokeId id) = 0;
virtual bool cancelStroke(KisStrokeId id) = 0;
};
class KRITAIMAGE_EXPORT KisUpdatesFacade
{
public:
......
......@@ -492,6 +492,12 @@ KisNodeSP KisNode::findChildByName(const QString &name)
return 0;
}
bool KisNode::copyFromNode(const KisNode *node)
{
Q_UNUSED(node);
return false;
}
bool KisNode::add(KisNodeSP newNode, KisNodeSP aboveThis)
{
KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(newNode, false);
......
......@@ -352,6 +352,12 @@ public: // Graph methods
*/
KisNodeSP findChildByName(const QString &name);
/**
* Replace the data in the current node by that in node
* @return whether the operation succeeded
*/
virtual bool copyFromNode(const KisNode *node);
Q_SIGNALS:
/**
* Don't use this signal anywhere other than KisNodeShape. It's a hack.
......
......@@ -20,6 +20,7 @@
#define __KIS_REGENERATE_FRAME_STROKE_STRATEGY_H
#include <kis_simple_stroke_strategy.h>
#include <kis_types.h>
#include <QScopedPointer>
......
......@@ -20,6 +20,7 @@
#define __KIS_SPONTANEOUS_JOB_H
#include "kis_runnable.h"
#include <kritaimage_export.h>
/**
* This class represents a simple update just that should be
......
......@@ -20,6 +20,7 @@
#define __KIS_SUSPEND_PROJECTION_UPDATES_STROKE_STRATEGY_H
#include <KisRunnableBasedStrokeStrategy.h>
#include <kis_types.h>
#include <QScopedPointer>
......
......@@ -20,6 +20,7 @@
#define __KIS_SYNC_LOD_CACHE_STROKE_STRATEGY_H
#include <kis_simple_stroke_strategy.h>
#include <kis_types.h>
#include <QScopedPointer>
......
......@@ -24,6 +24,8 @@
#include "kritaimage_export.h"
#include <KisStrokeTypes.h>
template<class T>
class KisWeakSharedPtr;
template<class T>
......@@ -258,11 +260,6 @@ typedef QSharedPointer<KisNodeList> KisNodeListSP;
typedef QList<KisPaintDeviceSP> KisPaintDeviceList;
class KisStroke;
typedef QSharedPointer<KisStroke> KisStrokeSP;
typedef QWeakPointer<KisStroke> KisStrokeWSP;
typedef KisStrokeWSP KisStrokeId;
class KisFilterConfiguration;
typedef KisPinnedSharedPtr<KisFilterConfiguration> KisFilterConfigurationSP;
......
......@@ -80,8 +80,10 @@ ecm_add_tests(
kis_iterator_benchmark.cpp
kis_updater_context_test.cpp
kis_simple_update_queue_test.cpp
kis_stroke_test.cpp
kis_simple_stroke_strategy_test.cpp
kis_stroke_strategy_undo_command_based_test.cpp
kis_strokes_queue_test.cpp
kis_mask_test.cpp
......
add_subdirectory(tests)
set(kritastroke_LIB_SRCS
KisRunnableBasedStrokeStrategy.cpp
KisRunnableStrokeJobDataBase.cpp
KisRunnableStrokeJobData.cpp
KisRunnableStrokeJobsInterface.cpp
kis_simple_stroke_strategy.cpp
kis_stroke.cpp
kis_stroke_job_strategy.cpp
kis_stroke_strategy.cpp
KisStrokesQueueMutatedJobInterface.cpp
KisStrokesFacade.cpp
)
add_library(kritastroke SHARED ${kritastroke_LIB_SRCS})
generate_export_header(kritastroke BASE_NAME kritastroke)
target_link_libraries(kritastroke
PUBLIC
kritacommand
kritaglobal
kritapigment
)
set_target_properties(kritastroke PROPERTIES
VERSION ${GENERIC_KRITA_LIB_VERSION} SOVERSION ${GENERIC_KRITA_LIB_SOVERSION}
)
install(TARGETS kritastroke ${INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -23,7 +23,7 @@
class KisRunnableStrokeJobsInterface;
class KRITAIMAGE_EXPORT KisRunnableBasedStrokeStrategy : public KisSimpleStrokeStrategy
class KRITASTROKE_EXPORT KisRunnableBasedStrokeStrategy : public KisSimpleStrokeStrategy
{
private:
struct JobsInterface;
......
......@@ -19,13 +19,13 @@
#ifndef KISRUNNABLESTROKEJOBDATA_H
#define KISRUNNABLESTROKEJOBDATA_H
#include "kritaimage_export.h"
#include "kritastroke_export.h"
#include "KisRunnableStrokeJobDataBase.h"
#include <functional>
class QRunnable;
class KRITAIMAGE_EXPORT KisRunnableStrokeJobData : public KisRunnableStrokeJobDataBase {
class KRITASTROKE_EXPORT KisRunnableStrokeJobData : public KisRunnableStrokeJobDataBase {
public:
KisRunnableStrokeJobData(QRunnable *runnable, KisStrokeJobData::Sequentiality sequentiality = KisStrokeJobData::SEQUENTIAL,
KisStrokeJobData::Exclusivity exclusivity = KisStrokeJobData::NORMAL);
......
......@@ -20,11 +20,11 @@
#define KISRUNNABLESTROKEJOBDATABASE_H
#include "kritaimage_export.h"
#include "kritastroke_export.h"
#include "kis_stroke_job_strategy.h"
#include "kis_runnable.h"
class KRITAIMAGE_EXPORT KisRunnableStrokeJobDataBase : public KisStrokeJobData, public KisRunnable
class KRITASTROKE_EXPORT KisRunnableStrokeJobDataBase : public KisStrokeJobData, public KisRunnable
{
public:
KisRunnableStrokeJobDataBase(KisStrokeJobData::Sequentiality sequentiality = KisStrokeJobData::SEQUENTIAL,
......
......@@ -19,14 +19,14 @@
#ifndef KISRUNNABLESTROKEJOBSINTERFACE_H
#define KISRUNNABLESTROKEJOBSINTERFACE_H
#include "kritaimage_export.h"
#include "kritastroke_export.h"
#include <QtGlobal>
#include "kis_pointer_utils.h"
class KisRunnableStrokeJobDataBase;
class KRITAIMAGE_EXPORT KisRunnableStrokeJobsInterface
class KRITASTROKE_EXPORT KisRunnableStrokeJobsInterface
{
public:
virtual ~KisRunnableStrokeJobsInterface();
......
/*
* Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_STROKE_TYPES_H_
#define KIS_STROKE_TYPES_H_
#include <QSharedPointer>
#include <QWeakPointer>
class KisStroke;
typedef QSharedPointer<KisStroke> KisStrokeSP;
typedef QWeakPointer<KisStroke> KisStrokeWSP;
typedef KisStrokeWSP KisStrokeId;
#endif
/*
* Copyright (c) 2011 Dmitry Kazakov <dimula73@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <KisStrokesFacade.h>
KisStrokesFacade::~KisStrokesFacade()
{
}
/*
* Copyright (c) 2011 Dmitry Kazakov <dimula73@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_STROKES_FACADE_H_
#define KIS_STROKES_FACADE_H_
#include <KisStrokeTypes.h>
#include <kritastroke_export.h>
class KisStrokeStrategy;
class KisStrokeJobData;
class KRITASTROKE_EXPORT KisStrokesFacade
{
public:
virtual ~KisStrokesFacade();
virtual KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy) = 0;
virtual void addJob(KisStrokeId id, KisStrokeJobData *data) = 0;
virtual void endStroke(KisStrokeId id) = 0;
virtual bool cancelStroke(KisStrokeId id) = 0;
};
#endif
......@@ -19,11 +19,12 @@
#ifndef KISSTROKESQUEUEMUTATEDJOBINTERFACE_H
#define KISSTROKESQUEUEMUTATEDJOBINTERFACE_H
#include "kis_types.h"
#include "KisStrokeTypes.h"
#include <kritastroke_export.h>
class KisStrokeJobData;
class KisStrokesQueueMutatedJobInterface
class KRITASTROKE_EXPORT KisStrokesQueueMutatedJobInterface
{
public:
virtual ~KisStrokesQueueMutatedJobInterface();
......
......@@ -19,9 +19,9 @@
#ifndef __KIS_RUNNABLE_H
#define __KIS_RUNNABLE_H
#include "kritaimage_export.h"
#include "kritastroke_export.h"
class KRITAIMAGE_EXPORT KisRunnable
class KRITASTROKE_EXPORT KisRunnable
{
public:
virtual ~KisRunnable() {};
......
......@@ -24,7 +24,7 @@
#include "kis_stroke_job_strategy.h"
class KRITAIMAGE_EXPORT KisSimpleStrokeStrategy : public KisStrokeStrategy
class KRITASTROKE_EXPORT KisSimpleStrokeStrategy : public KisStrokeStrategy
{
public:
enum JobType {
......
......@@ -20,6 +20,7 @@
#include "kis_stroke_strategy.h"
#include <kis_assert.h>
KisStroke::KisStroke(KisStrokeStrategy *strokeStrategy, Type type, int levelOfDetail)
: m_strokeStrategy(strokeStrategy),
......
......@@ -22,15 +22,15 @@
#include <QQueue>
#include <QScopedPointer>