From 52b1f1cb9f8d4e1fb1fcbde59930a105a819b0b4 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Thu, 30 Jul 2020 19:45:19 +0200 Subject: Cleanup unused KDE patches Thanks to Patrick Volkerding for the effort. --- kde/patch/akonadi.patch | 12 - kde/patch/akonadi/akonadi_mariadb_qtsql.patch | 91 - kde/patch/akonadi/akonadi_rename-header.patch | 77 - kde/patch/akonadi/akonadi_revert-abs-path.patch | 70 - kde/patch/akonadi4.patch | 1 - kde/patch/amarok.patch | 1 - kde/patch/ark/ark_kdebug357057.patch | 37 - kde/patch/baloo5/baloo-4.96.0_kaboutdata.diff | 69 - kde/patch/calligra.patch | 15 - kde/patch/calligra/calligra3_poppler-0.71.patch | 131 - kde/patch/calligra/calligra3_poppler-0.72.patch | 29 - kde/patch/calligra/calligra3_poppler-0.73.patch | 32 - kde/patch/calligra/calligra3_qt511.patch | 135 - kde/patch/calligra/calligra3_qt513.patch | 22 - .../calligraplan/calligraplan.kcalcore.1.patch | 47 - .../calligraplan/calligraplan.kcalcore.2.patch | 85 - .../calligraplan/calligraplan.kcalendarcore.patch | 34 - .../calligraplan/calligraplan.missingheader.patch | 25 - kde/patch/calligraplan/calligraplan.qt-511.patch | 125 - kde/patch/cantor.patch | 4 - kde/patch/cantor/cantor_julia.patch | 193 - kde/patch/cantor/cantor_python.patch | 31 - kde/patch/digikam.patch | 12 - kde/patch/digikam/digikam_clang_fix.patch | 38 - kde/patch/digikam/digikam_databasemodel.patch | 13337 ------------------- kde/patch/digikam/digikam_imagemagick7.patch | 40 - kde/patch/dolphin.patch | 1 - kde/patch/gwenview.patch | 4 - kde/patch/gwenview/gwenview-17.04.1_dataloss.patch | 131 - kde/patch/kaccounts-integration.patch | 4 - .../kaccounts-integration-15.08.3_service.patch | 28 - kde/patch/kalgebra.patch | 1 - kde/patch/kalzium.patch | 3 - kde/patch/kalzium/kalzium_kf_5.31.patch | 156 - kde/patch/kate.patch | 5 - kde/patch/kate/kate-15.12.0.patch | 31 - kde/patch/kcalc.patch | 5 - kde/patch/kcalc/kcalc-kdebug_360105.patch | 15 - kde/patch/kcalcore.patch | 4 - kde/patch/kcalcore/kcalcore_libical3.patch | 109 - kde/patch/kcoreaddons.patch | 5 - .../kcoreaddons/kcoreaddons.kdebug_362161.patch | 27 - kde/patch/kde-baseapps.patch | 5 - kde/patch/kde-baseapps/dolphin_kdebug_327224.patch | 57 - kde/patch/kde-cli-tools.patch | 6 - kde/patch/kde-cli-tools/kde-cli-tools_ecm.patch | 11 - .../kde-cli-tools/kde-cli-tools_kaboutdata.diff | 59 - kde/patch/kde-dev-utils.patch | 3 - kde/patch/kde-dev-utils/build_with_kf548.patch | 156 - kde/patch/kde-gtk-config.patch | 4 - .../kde-gtk-config_loadcurrentsettings.patch | 622 - kde/patch/kde-runtime.patch | 8 - .../kde-runtime/kde-runtime.kdebug324470.diff | 49 - kde/patch/kde-runtime/kde-runtime_gpgme.patch | 133 - kde/patch/kde-workspace.patch | 4 - .../kde-workspace/kde-workspace.desktopnames.diff | 34 - kde/patch/kdeconnect-kde.patch | 1 - kde/patch/kdelibs4support.patch | 4 - kde/patch/kdelibs4support/update-FindGettext.patch | 36 - kde/patch/kdenlive.patch | 4 - kde/patch/kdenlive/kdenlive_gcc7.patch | 32 - kde/patch/kdepim.patch | 4 - .../kdepim/kdepim-install_kleopatra_headers.patch | 129 - kde/patch/kdepimlibs.patch | 3 - kde/patch/kdepimlibs/kdepimlibs_kmail_crash.patch | 59 - kde/patch/kdepimlibs4.patch | 3 - kde/patch/kdepimlibs4/kdepimlibs.libical3.diff | 184 - kde/patch/kdeplasma-addons.patch | 4 - .../random_generator_cve-2013-2120.patch | 76 - kde/patch/kdesdk-kioslaves.patch | 3 - kde/patch/kdesdk-kioslaves/svn19.patch | 87 - kde/patch/kdev-python.patch | 4 - .../kdev-python/kdev-python-5.4.4_python38.patch | 560 - kde/patch/kdewebdev.patch | 6 - kde/patch/kdewebdev/include-tidy.patch | 13 - kde/patch/kholidays.patch | 8 - .../kholidays/kholidays_depfreeze_revert.patch | 61 - kde/patch/kholidays/kholidays_isnan.patch | 30 - kde/patch/kinfocenter.patch | 1 - kde/patch/kio.patch | 18 - kde/patch/kio/kio_KDEBUG_399709.patch | 44 - kde/patch/kio/kio_dolphin_servicemenus.patch | 126 - kde/patch/kio/kio_fix_url_setpath.patch | 65 - kde/patch/kio/kio_kdelibs4_docpatch.patch | 22 - kde/patch/kirigami2.patch | 8 - kde/patch/kirigami2/kirigami_iconview_crash.patch | 143 - kde/patch/kirigami2/kirigami_scrollbar.patch | 25 - kde/patch/kmail.patch | 4 - kde/patch/kmail/kmail_kontact_kdebug_404881.patch | 75 - kde/patch/kmplot.patch | 3 - kde/patch/kmplot/kmplot_isnan.patch | 42 - kde/patch/konsole.patch | 16 - kde/patch/konsole/konsole.cursor.antialias.patch | 83 - ...lepart.segfault.closing.after.contextmenu.patch | 43 - ...olepart.segfault.closing.session.via.menu.patch | 58 - kde/patch/konsole/konsole.term.is.konsole.patch | 24 - kde/patch/kopete.patch | 9 - kde/patch/kopete/kopete_kdebug376348.patch | 127 - kde/patch/kopete/kopete_kdebug393372.patch | 30 - kde/patch/korundum.patch | 5 - kde/patch/korundum/korundum_ruby19.patch | 31 - kde/patch/kpat.patch | 6 - kde/patch/kpat/kpat_no_freecell_solver_dep.patch | 1475 -- kde/patch/krita.patch | 7 - kde/patch/krita/krita_qt512.patch | 117 - kde/patch/krita/krita_qt59.patch | 26 - kde/patch/krita/krita_qtabletevents.patch | 67 - kde/patch/kscreenlocker.patch | 13 - .../kscreenlocker_CVE-2016-2312.patch | 36 - .../kscreenlocker_crash_force_softrender.patch | 112 - .../kscreenlocker_rendersettings.patch | 49 - kde/patch/kstars.patch | 3 - kde/patch/kstars/kstars_isnan.patch | 46 - kde/patch/ksudoku.patch | 4 - kde/patch/ksudoku/ksudoku_qwindowtitle.patch | 15 - kde/patch/ktexteditor.patch | 3 - .../ktexteditor/ktexteditor_fix_indentation.patch | 32 - kde/patch/ktp-accounts-kcm.patch | 4 - .../ktp-accounts-kcm_kdebug_351785.patch | 32 - kde/patch/kwin.patch | 11 - kde/patch/kwin/kwin_cmake310.patch | 52 - kde/patch/kwin/kwin_qt59_rootwindow_events.patch | 63 - kde/patch/kwin/kwin_replace_logind_with_ck2.patch | 85 - kde/patch/libkdcraw.patch | 3 - kde/patch/libkdcraw/libkdcraw_cmake_minver.patch | 7 - kde/patch/libkexiv2.patch | 3 - kde/patch/libkexiv2/libkexiv2_cmake_minver.patch | 7 - kde/patch/libkface.patch | 1 - kde/patch/libkleo.patch | 4 - kde/patch/libkleo/libkleo_gcc7.patch | 27 - kde/patch/libksysguard.patch | 4 - kde/patch/libksysguard/libksysguard_isnan.patch | 176 - kde/patch/marble.patch | 4 - kde/patch/marble/marble_qt4.patch | 47 - kde/patch/messagelib.patch | 4 - .../messagelib/messagelib_CVE-2018-19516.patch | 20 - kde/patch/okular.patch | 3 - kde/patch/okular/cve-2020-9359.patch | 32 - kde/patch/oxygen-gtk2.patch | 1 - kde/patch/oxygen-gtk3.patch | 3 - .../oxygen-gtk3/oxygen-gtk3-1.3.1_gtk3.8.patch | 29 - kde/patch/perlqt.patch | 1 - kde/patch/plasma-browser-integration.patch | 1 - kde/patch/plasma-desktop.patch | 20 - .../plasma-desktop-4.99.0_kfontinst_po.diff | 60 - .../plasma-desktop_kdebug_401508.patch | 39 - .../plasma-desktop_kdebug_416358.patch | 16 - .../plasma-desktop_kdebug_417424.patch | 25 - .../plasma-desktop_kdelibs4support.diff | 88 - .../plasma-desktop_kickoff_kdebug_356398.patch | 24 - kde/patch/plasma-framework.patch | 11 +- .../plasma-framework_KDEBUG_357895.patch | 24 - .../plasma-framework_KDEBUG_359388.patch | 31 - kde/patch/plasma-pa.patch | 5 - .../plasma-pa/plasma-pa_enable_gsettings.patch | 583 - kde/patch/plasma-workspace.patch | 17 - .../plasma-workspace.systray_cpubug.patch | 152 - .../plasma-workspace_apply_767aa57.patch | 23 - .../plasma-workspace_consolekit2.patch | 189 - .../plasma-workspace_kdebug389815.patch | 32 - kde/patch/plasma5-nm.patch | 14 - kde/patch/plasma5-nm/plasma-nm-fixes.patch | 322 - .../plasma5-nm/plasma-nm_modemmanager-qt_api.patch | 73 - .../plasma5-nm/plasma-nm_networkmanager.patch | 17 - .../plasma5-nm/plasma5-nm_KDEBUG_423093.patch | 31 - kde/patch/powerdevil.patch | 4 - .../powerdevil/powerdevil-5.12.4_firstrun.patch | 42 - kde/patch/pykde4.patch | 1 - kde/patch/qqc2-desktop-style.patch | 5 - .../qqc2-desktop-style_scrollbar.patch | 51 - kde/patch/sddm-theme-breeze.patch | 2 - .../sddm-theme-breeze/sddm-theme-breeze_path.diff | 10 - kde/patch/spectacle.patch | 7 - kde/patch/spectacle/spectacle_hidpi.patch | 28 - kde/patch/spectacle/spectacle_rect_capture.patch | 52 - kde/patch/strigi-multimedia.patch | 1 - kde/patch/umbrello.patch | 10 - kde/patch/umbrello/umbrello-4.11.4_listitem.patch | 13 - .../umbrello/umbrello_qt510_kaboutdata_h.patch | 33 - 179 files changed, 1 insertion(+), 23375 deletions(-) delete mode 100644 kde/patch/akonadi.patch delete mode 100644 kde/patch/akonadi/akonadi_mariadb_qtsql.patch delete mode 100644 kde/patch/akonadi/akonadi_rename-header.patch delete mode 100644 kde/patch/akonadi/akonadi_revert-abs-path.patch delete mode 100644 kde/patch/ark/ark_kdebug357057.patch delete mode 100644 kde/patch/baloo5/baloo-4.96.0_kaboutdata.diff delete mode 100644 kde/patch/calligra.patch delete mode 100644 kde/patch/calligra/calligra3_poppler-0.71.patch delete mode 100644 kde/patch/calligra/calligra3_poppler-0.72.patch delete mode 100644 kde/patch/calligra/calligra3_poppler-0.73.patch delete mode 100644 kde/patch/calligra/calligra3_qt511.patch delete mode 100644 kde/patch/calligra/calligra3_qt513.patch delete mode 100644 kde/patch/calligraplan/calligraplan.kcalcore.1.patch delete mode 100644 kde/patch/calligraplan/calligraplan.kcalcore.2.patch delete mode 100644 kde/patch/calligraplan/calligraplan.kcalendarcore.patch delete mode 100644 kde/patch/calligraplan/calligraplan.missingheader.patch delete mode 100644 kde/patch/calligraplan/calligraplan.qt-511.patch delete mode 100644 kde/patch/cantor.patch delete mode 100644 kde/patch/cantor/cantor_julia.patch delete mode 100644 kde/patch/cantor/cantor_python.patch delete mode 100644 kde/patch/digikam.patch delete mode 100644 kde/patch/digikam/digikam_clang_fix.patch delete mode 100644 kde/patch/digikam/digikam_databasemodel.patch delete mode 100644 kde/patch/digikam/digikam_imagemagick7.patch delete mode 100644 kde/patch/gwenview.patch delete mode 100644 kde/patch/gwenview/gwenview-17.04.1_dataloss.patch delete mode 100644 kde/patch/kaccounts-integration.patch delete mode 100644 kde/patch/kaccounts-integration/kaccounts-integration-15.08.3_service.patch delete mode 100644 kde/patch/kalzium.patch delete mode 100644 kde/patch/kalzium/kalzium_kf_5.31.patch delete mode 100644 kde/patch/kate/kate-15.12.0.patch delete mode 100644 kde/patch/kcalc.patch delete mode 100644 kde/patch/kcalc/kcalc-kdebug_360105.patch delete mode 100644 kde/patch/kcalcore.patch delete mode 100644 kde/patch/kcalcore/kcalcore_libical3.patch delete mode 100644 kde/patch/kcoreaddons.patch delete mode 100644 kde/patch/kcoreaddons/kcoreaddons.kdebug_362161.patch delete mode 100644 kde/patch/kde-baseapps.patch delete mode 100644 kde/patch/kde-baseapps/dolphin_kdebug_327224.patch delete mode 100644 kde/patch/kde-cli-tools.patch delete mode 100644 kde/patch/kde-cli-tools/kde-cli-tools_ecm.patch delete mode 100644 kde/patch/kde-cli-tools/kde-cli-tools_kaboutdata.diff delete mode 100644 kde/patch/kde-dev-utils.patch delete mode 100644 kde/patch/kde-dev-utils/build_with_kf548.patch delete mode 100644 kde/patch/kde-gtk-config.patch delete mode 100644 kde/patch/kde-gtk-config/kde-gtk-config_loadcurrentsettings.patch delete mode 100644 kde/patch/kde-runtime/kde-runtime.kdebug324470.diff delete mode 100644 kde/patch/kde-runtime/kde-runtime_gpgme.patch delete mode 100644 kde/patch/kde-workspace/kde-workspace.desktopnames.diff delete mode 100644 kde/patch/kdelibs4support/update-FindGettext.patch delete mode 100644 kde/patch/kdenlive.patch delete mode 100644 kde/patch/kdenlive/kdenlive_gcc7.patch delete mode 100644 kde/patch/kdepim.patch delete mode 100644 kde/patch/kdepim/kdepim-install_kleopatra_headers.patch delete mode 100644 kde/patch/kdepimlibs.patch delete mode 100644 kde/patch/kdepimlibs/kdepimlibs_kmail_crash.patch delete mode 100644 kde/patch/kdepimlibs4.patch delete mode 100644 kde/patch/kdepimlibs4/kdepimlibs.libical3.diff delete mode 100644 kde/patch/kdeplasma-addons.patch delete mode 100644 kde/patch/kdeplasma-addons/random_generator_cve-2013-2120.patch delete mode 100644 kde/patch/kdesdk-kioslaves.patch delete mode 100644 kde/patch/kdesdk-kioslaves/svn19.patch delete mode 100644 kde/patch/kdev-python.patch delete mode 100644 kde/patch/kdev-python/kdev-python-5.4.4_python38.patch delete mode 100644 kde/patch/kdewebdev.patch delete mode 100644 kde/patch/kdewebdev/include-tidy.patch delete mode 100644 kde/patch/kholidays.patch delete mode 100644 kde/patch/kholidays/kholidays_depfreeze_revert.patch delete mode 100644 kde/patch/kholidays/kholidays_isnan.patch delete mode 100644 kde/patch/kio.patch delete mode 100644 kde/patch/kio/kio_KDEBUG_399709.patch delete mode 100644 kde/patch/kio/kio_dolphin_servicemenus.patch delete mode 100644 kde/patch/kio/kio_fix_url_setpath.patch delete mode 100644 kde/patch/kio/kio_kdelibs4_docpatch.patch delete mode 100644 kde/patch/kirigami2.patch delete mode 100644 kde/patch/kirigami2/kirigami_iconview_crash.patch delete mode 100644 kde/patch/kirigami2/kirigami_scrollbar.patch delete mode 100644 kde/patch/kmail.patch delete mode 100644 kde/patch/kmail/kmail_kontact_kdebug_404881.patch delete mode 100644 kde/patch/kmplot.patch delete mode 100644 kde/patch/kmplot/kmplot_isnan.patch delete mode 100644 kde/patch/konsole.patch delete mode 100644 kde/patch/konsole/konsole.cursor.antialias.patch delete mode 100644 kde/patch/konsole/konsole.konsolepart.segfault.closing.after.contextmenu.patch delete mode 100644 kde/patch/konsole/konsole.konsolepart.segfault.closing.session.via.menu.patch delete mode 100644 kde/patch/konsole/konsole.term.is.konsole.patch delete mode 100644 kde/patch/kopete.patch delete mode 100644 kde/patch/kopete/kopete_kdebug376348.patch delete mode 100644 kde/patch/kopete/kopete_kdebug393372.patch delete mode 100644 kde/patch/korundum.patch delete mode 100644 kde/patch/korundum/korundum_ruby19.patch delete mode 100644 kde/patch/kpat.patch delete mode 100644 kde/patch/kpat/kpat_no_freecell_solver_dep.patch delete mode 100644 kde/patch/krita.patch delete mode 100644 kde/patch/krita/krita_qt512.patch delete mode 100644 kde/patch/krita/krita_qt59.patch delete mode 100644 kde/patch/krita/krita_qtabletevents.patch delete mode 100644 kde/patch/kscreenlocker.patch delete mode 100644 kde/patch/kscreenlocker/kscreenlocker_CVE-2016-2312.patch delete mode 100644 kde/patch/kscreenlocker/kscreenlocker_crash_force_softrender.patch delete mode 100644 kde/patch/kscreenlocker/kscreenlocker_rendersettings.patch delete mode 100644 kde/patch/kstars.patch delete mode 100644 kde/patch/kstars/kstars_isnan.patch delete mode 100644 kde/patch/ksudoku.patch delete mode 100644 kde/patch/ksudoku/ksudoku_qwindowtitle.patch delete mode 100644 kde/patch/ktexteditor.patch delete mode 100644 kde/patch/ktexteditor/ktexteditor_fix_indentation.patch delete mode 100644 kde/patch/ktp-accounts-kcm.patch delete mode 100644 kde/patch/ktp-accounts-kcm/ktp-accounts-kcm_kdebug_351785.patch delete mode 100644 kde/patch/kwin.patch delete mode 100644 kde/patch/kwin/kwin_cmake310.patch delete mode 100644 kde/patch/kwin/kwin_qt59_rootwindow_events.patch delete mode 100644 kde/patch/kwin/kwin_replace_logind_with_ck2.patch delete mode 100644 kde/patch/libkdcraw.patch delete mode 100644 kde/patch/libkdcraw/libkdcraw_cmake_minver.patch delete mode 100644 kde/patch/libkexiv2.patch delete mode 100644 kde/patch/libkexiv2/libkexiv2_cmake_minver.patch delete mode 100644 kde/patch/libkleo.patch delete mode 100644 kde/patch/libkleo/libkleo_gcc7.patch delete mode 100644 kde/patch/libksysguard.patch delete mode 100644 kde/patch/libksysguard/libksysguard_isnan.patch delete mode 100644 kde/patch/marble.patch delete mode 100644 kde/patch/marble/marble_qt4.patch delete mode 100644 kde/patch/messagelib.patch delete mode 100644 kde/patch/messagelib/messagelib_CVE-2018-19516.patch delete mode 100644 kde/patch/okular.patch delete mode 100644 kde/patch/okular/cve-2020-9359.patch delete mode 100644 kde/patch/oxygen-gtk3.patch delete mode 100644 kde/patch/oxygen-gtk3/oxygen-gtk3-1.3.1_gtk3.8.patch delete mode 100644 kde/patch/plasma-desktop.patch delete mode 100755 kde/patch/plasma-desktop/plasma-desktop-4.99.0_kfontinst_po.diff delete mode 100644 kde/patch/plasma-desktop/plasma-desktop_kdebug_401508.patch delete mode 100644 kde/patch/plasma-desktop/plasma-desktop_kdebug_416358.patch delete mode 100644 kde/patch/plasma-desktop/plasma-desktop_kdebug_417424.patch delete mode 100644 kde/patch/plasma-desktop/plasma-desktop_kdelibs4support.diff delete mode 100644 kde/patch/plasma-desktop/plasma-desktop_kickoff_kdebug_356398.patch delete mode 100644 kde/patch/plasma-framework/plasma-framework_KDEBUG_357895.patch delete mode 100644 kde/patch/plasma-framework/plasma-framework_KDEBUG_359388.patch delete mode 100644 kde/patch/plasma-pa.patch delete mode 100644 kde/patch/plasma-pa/plasma-pa_enable_gsettings.patch delete mode 100644 kde/patch/plasma-workspace.patch delete mode 100644 kde/patch/plasma-workspace/plasma-workspace.systray_cpubug.patch delete mode 100644 kde/patch/plasma-workspace/plasma-workspace_apply_767aa57.patch delete mode 100644 kde/patch/plasma-workspace/plasma-workspace_consolekit2.patch delete mode 100644 kde/patch/plasma-workspace/plasma-workspace_kdebug389815.patch delete mode 100644 kde/patch/plasma5-nm.patch delete mode 100644 kde/patch/plasma5-nm/plasma-nm-fixes.patch delete mode 100644 kde/patch/plasma5-nm/plasma-nm_modemmanager-qt_api.patch delete mode 100644 kde/patch/plasma5-nm/plasma-nm_networkmanager.patch delete mode 100644 kde/patch/plasma5-nm/plasma5-nm_KDEBUG_423093.patch delete mode 100644 kde/patch/powerdevil.patch delete mode 100644 kde/patch/powerdevil/powerdevil-5.12.4_firstrun.patch delete mode 100644 kde/patch/qqc2-desktop-style.patch delete mode 100644 kde/patch/qqc2-desktop-style/qqc2-desktop-style_scrollbar.patch delete mode 100644 kde/patch/sddm-theme-breeze.patch delete mode 100644 kde/patch/sddm-theme-breeze/sddm-theme-breeze_path.diff delete mode 100644 kde/patch/spectacle.patch delete mode 100644 kde/patch/spectacle/spectacle_hidpi.patch delete mode 100644 kde/patch/spectacle/spectacle_rect_capture.patch delete mode 100644 kde/patch/umbrello.patch delete mode 100644 kde/patch/umbrello/umbrello-4.11.4_listitem.patch delete mode 100644 kde/patch/umbrello/umbrello_qt510_kaboutdata_h.patch (limited to 'kde/patch') diff --git a/kde/patch/akonadi.patch b/kde/patch/akonadi.patch deleted file mode 100644 index ddab2a8..0000000 --- a/kde/patch/akonadi.patch +++ /dev/null @@ -1,12 +0,0 @@ -# Remove hardcoded absolute path to stdlib header. -# This is Windows-centric and breaks on any linux GCC upgrade. -# Thanks to Gentoo where I found the following two patches at -# https://packages.gentoo.org/packages/kde-apps/akonadi -# No longer needed since 17.04.0. -#cat $CWD/patch/akonadi/akonadi_revert-abs-path.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } -#cat $CWD/patch/akonadi/akonadi_rename-header.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Temporary fix for non-working Akonadi in combination with mariadb 10.2.8 -# (actually this is a bug in qtsql, not in akonadi or mariadb): -#cat $CWD/patch/akonadi/akonadi_mariadb_qtsql.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/akonadi/akonadi_mariadb_qtsql.patch b/kde/patch/akonadi/akonadi_mariadb_qtsql.patch deleted file mode 100644 index 7ec6d7c..0000000 --- a/kde/patch/akonadi/akonadi_mariadb_qtsql.patch +++ /dev/null @@ -1,91 +0,0 @@ -Patch taken from https://cgit.kde.org/akonadi.git/patch/?id=b145f47f000978b9d39edc1882849ec7f6b3ef79 - -Upstream bug reports: -https://bugs.kde.org/show_bug.cgi?id=383991 -https://bugreports.qt.io/browse/QTBUG-63108 - -From b145f47f000978b9d39edc1882849ec7f6b3ef79 Mon Sep 17 00:00:00 2001 -From: Heinz Wiesinger -Date: Sun, 17 Sep 2017 10:56:44 +0200 -Subject: Only remove init connections to the database on server shutdown. - -Summary: -With MariaDB 10.2 libmysqlclient was replaced with libmariadb that -changed how establishing database connections behaves. The MySQL -QSQL driver calls mysql_server_end() on QSqlDatabase::removeDatabase() -if the overall connection count dropped to 0 (which it does when -the init connection is removed). -A future QSqlDatabase:addDatabase() would call mysql_server_init() -again, but this no longer works with libmariadb as that one only -allows calling mysql_server_init() once. Future calls are simply -ignored. - -In order to prevent this from happening we have to keep the -init connection open until the server shuts down, so the connection -count only drops to 0 at shutdown and mysql_server_end() isn't -called before. - -This is a workaround for QTBUG-63108 - -CCBUG: 383991 - -Reviewers: dvratil, mlaurent - -Reviewed By: dvratil - -Subscribers: #kde_pim - -Tags: #kde_pim - -Differential Revision: https://phabricator.kde.org/D7858 ---- - src/server/akonadi.cpp | 3 ++- - src/server/storage/dbconfigmysql.cpp | 4 +++- - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/src/server/akonadi.cpp b/src/server/akonadi.cpp -index 4364e63..bcb7e88 100644 ---- a/src/server/akonadi.cpp -+++ b/src/server/akonadi.cpp -@@ -423,13 +423,14 @@ bool AkonadiServer::createDatabase() - success = false; - } - } -- QSqlDatabase::removeDatabase(initCon); - return success; - } - - void AkonadiServer::stopDatabaseProcess() - { - if (!DbConfig::configuredDatabase()->useInternalServer()) { -+ // closing initConnection this late to work around QTBUG-63108 -+ QSqlDatabase::removeDatabase(QStringLiteral("initConnection")); - return; - } - -diff --git a/src/server/storage/dbconfigmysql.cpp b/src/server/storage/dbconfigmysql.cpp -index 2bd231d..d565706 100644 ---- a/src/server/storage/dbconfigmysql.cpp -+++ b/src/server/storage/dbconfigmysql.cpp -@@ -492,7 +492,6 @@ bool DbConfigMysql::startInternalServer() - } - } - -- QSqlDatabase::removeDatabase(initCon); - return success; - } - -@@ -520,6 +519,9 @@ void DbConfigMysql::stopInternalServer() - return; - } - -+ // closing initConnection this late to work around QTBUG-63108 -+ QSqlDatabase::removeDatabase(QStringLiteral("initConnection")); -+ - disconnect(mDatabaseProcess, static_cast(&QProcess::finished), - this, &DbConfigMysql::processFinished); - --- -cgit v0.11.2 - - diff --git a/kde/patch/akonadi/akonadi_rename-header.patch b/kde/patch/akonadi/akonadi_rename-header.patch deleted file mode 100644 index 73347f0..0000000 --- a/kde/patch/akonadi/akonadi_rename-header.patch +++ /dev/null @@ -1,77 +0,0 @@ -commit 248671e8200ff0883877b6d0e56700ef99ff3b51 -Author: Andreas Sturmlechner -Date: Sat Jan 7 14:38:17 2017 +0100 - - Rename exception.h to exceptionbase.h - - REVIEW: 129788 - -diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt -index 6ac851e..fa996b9 100644 ---- a/src/core/CMakeLists.txt -+++ b/src/core/CMakeLists.txt -@@ -95,7 +95,7 @@ ecm_generate_headers(AkonadiCore_base_HEADERS - EntityDeletedAttribute - EntityDisplayAttribute - EntityHiddenAttribute -- Exception -+ ExceptionBase - GidExtractorInterface - IndexPolicyAttribute - Item -diff --git a/src/core/exception.cpp b/src/core/exception.cpp -index f229c1a..14f7330 100644 ---- a/src/core/exception.cpp -+++ b/src/core/exception.cpp -@@ -17,7 +17,7 @@ - 02110-1301, USA. - */ - --#include "exception.h" -+#include "exceptionbase.h" - - #include - -diff --git a/src/core/exception.h b/src/core/exceptionbase.h -similarity index 100% -rename from src/core/exception.h -rename to src/core/exceptionbase.h -diff --git a/src/core/item.h b/src/core/item.h -index de71cad..5ec62c8 100644 ---- a/src/core/item.h -+++ b/src/core/item.h -@@ -23,7 +23,7 @@ - - #include "akonadicore_export.h" - #include "attribute.h" --#include "exception.h" -+#include "exceptionbase.h" - #include "tag.h" - #include "collection.h" - #include "relation.h" -diff --git a/src/core/itempayloadinternals_p.h b/src/core/itempayloadinternals_p.h -index 0a4de3c..1626f10 100644 ---- a/src/core/itempayloadinternals_p.h -+++ b/src/core/itempayloadinternals_p.h -@@ -32,7 +32,7 @@ - - #include - --#include "exception.h" -+#include "exceptionbase.h" - - //@cond PRIVATE Doxygen 1.7.1 hangs processing this file. so skip it. - //for more info, see https://bugzilla.gnome.org/show_bug.cgi?id=531637 -diff --git a/src/core/protocolhelper.cpp b/src/core/protocolhelper.cpp -index f740e9d..c218f0c 100644 ---- a/src/core/protocolhelper.cpp -+++ b/src/core/protocolhelper.cpp -@@ -23,7 +23,7 @@ - #include "collectionstatistics.h" - #include "item_p.h" - #include "collection_p.h" --#include "exception.h" -+#include "exceptionbase.h" - #include "itemserializer_p.h" - #include "itemserializerplugin.h" - #include "servermanager.h" diff --git a/kde/patch/akonadi/akonadi_revert-abs-path.patch b/kde/patch/akonadi/akonadi_revert-abs-path.patch deleted file mode 100644 index 3b48253..0000000 --- a/kde/patch/akonadi/akonadi_revert-abs-path.patch +++ /dev/null @@ -1,70 +0,0 @@ -commit d98e29a07f4acc3bf01f06f25b3eef5522397e2e -Author: Andreas Sturmlechner -Date: Thu Jan 5 22:41:02 2017 +0100 - - Revert "Workaround an include loop on case-insensitive systems" - - Do not hardcode absolute patchs to GCC headers. - - This reverts commit 59b9d6b79425c9ec1e5df059a2593580048c4adf. - - REVIEW: 129788 - -diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt -index 72589cd..6ac851e 100644 ---- a/src/core/CMakeLists.txt -+++ b/src/core/CMakeLists.txt -@@ -257,21 +257,6 @@ ecm_generate_headers(AkonadiCore_jobs_HEADERS - RELATIVE jobs - ) - --# This is a workaround for conflict between our "Exception" fancy header and --# C++ stdlib's "exception" header which occurs in case-insensitive systems. --# For that reason we generate std_exception.h file, which contains an absolute --# path to the stdlib's exception header file, which resolves the ambiguity --# when including from within Akonadi. --include(FindStdlibInclude) --findStdlibInclude("exception" std_exception_file) --if (NOT "${std_exception_file}" STREQUAL "") -- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/std_exception.h.in -- ${CMAKE_CURRENT_BINARY_DIR}/std_exception.h -- ) --else() -- message(FATAL_ERROR "stdlib include absolute path not found") --endif() -- - set(akonadicore_dbus_xml ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.NotificationManager.xml) - qt5_add_dbus_interface(akonadicore_dbus_SRCS ${akonadicore_dbus_xml} notificationmanagerinterface) - -@@ -338,7 +323,6 @@ install(TARGETS - - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/akonadicore_export.h -- ${CMAKE_CURRENT_BINARY_DIR}/std_exception.h - ${AkonadiCore_base_HEADERS} - ${AkonadiCore_models_HEADERS} - ${AkonadiCore_jobs_HEADERS} -diff --git a/src/core/exception.h b/src/core/exception.h -index d07ca71..2a376df 100644 ---- a/src/core/exception.h -+++ b/src/core/exception.h -@@ -20,16 +20,11 @@ - #ifndef AKONADI_EXCEPTION_H - #define AKONADI_EXCEPTION_H - --// The std_exception.h file is generated at build-time and #includes C++ stdlib --// header "exception" by aboslute path. This is to workaround an include loop on --// case-insensitive systems, where #include includes our "Exception" --// fancy header instead of stdlib's exception, causing an endless loop of --// includes between "Exception" and "exception.h". --#include "std_exception.h" -- - #include "akonadicore_export.h" -+#include -+#include -+#include - --class QByteArray; - class QString; - - namespace Akonadi diff --git a/kde/patch/akonadi4.patch b/kde/patch/akonadi4.patch index 388c3ea..8ff0118 100644 --- a/kde/patch/akonadi4.patch +++ b/kde/patch/akonadi4.patch @@ -1,4 +1,3 @@ # Backport a patch from git master since there will not be another # official akonadi release after the current 1.13: cat $CWD/patch/akonadi4/akonadi_dont-leak-old-external-payload-files.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/amarok.patch b/kde/patch/amarok.patch index 9fc3963..7ede8ad 100644 --- a/kde/patch/amarok.patch +++ b/kde/patch/amarok.patch @@ -1,4 +1,3 @@ # Fix a crash in KDE 4.11: # See also https://bugs.kde.org/show_bug.cgi?id=320855 cat $CWD/patch/amarok/amarok_kdebug_320855.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/ark/ark_kdebug357057.patch b/kde/patch/ark/ark_kdebug357057.patch deleted file mode 100644 index 76c0bab..0000000 --- a/kde/patch/ark/ark_kdebug357057.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Elvis Angelaccio -Date: Wed, 23 Dec 2015 16:19:29 +0000 -Subject: Fallback to read-only mode if there are no read-write executables -X-Git-Url: http://quickgit.kde.org/?p=ark.git&a=commitdiff&h=087e5aab49c60ac5930742fe892fa930048e2f43 ---- -Fallback to read-only mode if there are no read-write executables - -Commit 2d000a0 introduced executables check when loading a plugin. However the -current behavior is too restrictive: if one wants only to open a rar or a -zip archive, there is no need to require also the rar or zip program to be -installed. Plus, some distributions (e.g. Archlinux) ship only unrar in their -official repositories. - -With this commit, Ark is able to understand that e.g. unrar is installed but -rar is not. In this case, Ark can and should fallback to read-only mode, -to disable the Add/Delete actions in the toolbar. - -BUG: 357057 -FIXED-IN: 15.12.1 - -CC: rthomsen6@gmail.com ---- - - ---- a/kerfuffle/archive_kerfuffle.cpp -+++ b/kerfuffle/archive_kerfuffle.cpp -@@ -173,6 +173,9 @@ - - if (iface->findExecutables(!isReadOnly)) { - return new Archive(iface, isReadOnly, parent); -+ } else if (!isReadOnly && iface->findExecutables(false)) { -+ qCWarning(ARK) << "Failed to find read-write executables: falling back to read-only mode for read-write plugin" << pluginName; -+ return new Archive(iface, true, parent); - } else { - qCWarning(ARK) << "Failed to find needed executables for plugin" << pluginName; - } - diff --git a/kde/patch/baloo5/baloo-4.96.0_kaboutdata.diff b/kde/patch/baloo5/baloo-4.96.0_kaboutdata.diff deleted file mode 100644 index 36ec0d1..0000000 --- a/kde/patch/baloo5/baloo-4.96.0_kaboutdata.diff +++ /dev/null @@ -1,69 +0,0 @@ -From: Andreas Hartmetz -Date: Wed, 14 May 2014 02:36:57 +0000 -Subject: Adapt to changes in KAboutData. -X-Git-Url: http://quickgit.kde.org/?p=baloo.git&a=commitdiff&h=46e3ea7828c8066e75bec87ba0a19d5ef3bd700a ---- -Adapt to changes in KAboutData. ---- - - ---- a/src/file/kcm/kcm.cpp -+++ b/src/file/kcm/kcm.cpp -@@ -58,8 +58,8 @@ - : KCModule(parent, args) - { - KAboutData* about = new KAboutData( -- "kcm_baloofile", "kcm_baloofile", i18n("Configure Desktop Search"), -- "0.1", QString(), KAboutData::License_GPL, -+ "kcm_baloofile", i18n("Configure Desktop Search"), -+ "0.1", QString(), KAboutLicense::GPL, - i18n("Copyright 2007-2010 Sebastian Trüg")); - about->addAuthor(i18n("Sebastian Trüg"), QString(), "trueg@kde.org"); - about->addAuthor(i18n("Vishesh Handa"), QString(), "vhanda@kde.org"); - ---- a/src/file/main.cpp -+++ b/src/file/main.cpp -@@ -44,9 +44,9 @@ - lowerSchedulingPriority(); - lowerPriority(); - -- KAboutData aboutData("baloo_file", "baloo_file", i18n("Baloo File"), "0.1", -+ KAboutData aboutData("baloo_file", i18n("Baloo File"), "0.1", - i18n("An application to handle file metadata"), -- KAboutData::License_LGPL_V2); -+ KAboutLicense::LGPL_V2); - aboutData.addAuthor(i18n("Vishesh Handa"), i18n("Maintainer"), "me@vhanda.in", "http://vhanda.in"); - - KAboutData::setApplicationData(aboutData); - ---- a/src/tools/baloosearch/main.cpp -+++ b/src/tools/baloosearch/main.cpp -@@ -55,11 +55,10 @@ - int main(int argc, char* argv[]) - { - KAboutData aboutData("baloosearch", -- "baloosearch", - i18n("Baloo Search"), - "0.1", - i18n("Baloo Search - A debugging tool"), -- KAboutData::License_GPL, -+ KAboutLicense::GPL, - i18n("(c) 2013, Vishesh Handa")); - aboutData.addAuthor(i18n("Vishesh Handa"), i18n("Maintainer"), "me@vhanda.in"); - - ---- a/src/tools/balooshow/main.cpp -+++ b/src/tools/balooshow/main.cpp -@@ -46,11 +46,10 @@ - int main(int argc, char* argv[]) - { - KAboutData aboutData("balooshow", -- "balooshow", - i18n("Baloo Show"), - "0.1", - i18n("The Baloo data Viewer - A debugging tool"), -- KAboutData::License_GPL, -+ KAboutLicense::GPL, - i18n("(c) 2012, Vishesh Handa")); - aboutData.addAuthor(i18n("Vishesh Handa"), i18n("Maintainer"), "me@vhanda.in"); - diff --git a/kde/patch/calligra.patch b/kde/patch/calligra.patch deleted file mode 100644 index a0a45af..0000000 --- a/kde/patch/calligra.patch +++ /dev/null @@ -1,15 +0,0 @@ -# Fix build against Qt 5.11: -#cat $CWD/patch/calligra/calligra3_qt511.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix build against Qt 5.13: -#cat $CWD/patch/calligra/calligra3_qt513.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix build against poppler 0.71: -#cat $CWD/patch/calligra/calligra3_poppler-0.71.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix build against poppler 0.72: -#cat $CWD/patch/calligra/calligra3_poppler-0.72.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix build against poppler 0.73: -#cat $CWD/patch/calligra/calligra3_poppler-0.73.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/calligra/calligra3_poppler-0.71.patch b/kde/patch/calligra/calligra3_poppler-0.71.patch deleted file mode 100644 index 65284a3..0000000 --- a/kde/patch/calligra/calligra3_poppler-0.71.patch +++ /dev/null @@ -1,131 +0,0 @@ -diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp -index 48b08dfa32d..e910dae0756 100644 ---- a/filters/karbon/pdf/PdfImport.cpp -+++ b/filters/karbon/pdf/PdfImport.cpp -@@ -88,9 +88,9 @@ KoFilter::ConversionStatus PdfImport::convert(const QByteArray& from, const QByt - SvgOutputDev * dev = new SvgOutputDev(m_chain->outputFile()); - if (dev->isOk()) { - int rotate = 0; -- GBool useMediaBox = gTrue; -- GBool crop = gFalse; -- GBool printing = gFalse; -+ bool useMediaBox = true; -+ bool crop = false; -+ bool printing = false; - pdfDoc->displayPages(dev, firstPage, lastPage, hDPI, vDPI, rotate, useMediaBox, crop, printing); - dev->dumpContent(); - } -diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp -index 5692824bc45..43205170991 100644 ---- a/filters/karbon/pdf/SvgOutputDev.cpp -+++ b/filters/karbon/pdf/SvgOutputDev.cpp -@@ -39,7 +39,7 @@ class SvgOutputDev::Private - { - public: - Private(const QString &fname) -- : svgFile(fname), defs(0), body(0), state(gTrue) -+ : svgFile(fname), defs(0), body(0), state(true) - , brush(Qt::SolidPattern) {} - - ~Private() { -@@ -52,7 +52,7 @@ public: - QString defsData; - QTextStream * defs; - QTextStream * body; -- GBool state; -+ bool state; - QSizeF pageSize; - QPen pen; - QBrush brush; -@@ -62,7 +62,7 @@ SvgOutputDev::SvgOutputDev(const QString &fileName) - : d(new Private(fileName)) - { - if (! d->svgFile.open(QIODevice::WriteOnly)) { -- d->state = gFalse; -+ d->state = false; - return; - } - -@@ -75,24 +75,24 @@ SvgOutputDev::~SvgOutputDev() - delete d; - } - --GBool SvgOutputDev::isOk() -+bool SvgOutputDev::isOk() - { - return d->state; - } - --GBool SvgOutputDev::upsideDown() -+bool SvgOutputDev::upsideDown() - { -- return gTrue; -+ return true; - } - --GBool SvgOutputDev::useDrawChar() -+bool SvgOutputDev::useDrawChar() - { -- return gFalse; -+ return false; - } - --GBool SvgOutputDev::interpretType3Chars() -+bool SvgOutputDev::interpretType3Chars() - { -- return gFalse; -+ return false; - } - - void SvgOutputDev::startPage(int pageNum, GfxState *state, XRef */*xref*/) -@@ -480,7 +480,7 @@ void SvgOutputDev::drawString(GfxState * state, GooString * s) - - void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, - int width, int height, GfxImageColorMap *colorMap, -- int *maskColors, GBool /*inlineImg*/) -+ int *maskColors, bool /*inlineImg*/) - { - ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()); - imgStr->reset(); -@@ -549,7 +549,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, - - void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap *colorMap, -- GBool /*interpolate*/, int *maskColors, GBool inlineImg) -+ bool /*interpolate*/, int *maskColors, bool inlineImg) - { - drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg); - } -diff --git a/filters/karbon/pdf/SvgOutputDev.h b/filters/karbon/pdf/SvgOutputDev.h -index 2a4490848bf..cdb1d4e43b1 100644 ---- a/filters/karbon/pdf/SvgOutputDev.h -+++ b/filters/karbon/pdf/SvgOutputDev.h -@@ -44,11 +44,11 @@ public: - explicit SvgOutputDev(const QString &fileName); - virtual ~SvgOutputDev(); - -- GBool isOk(); -+ bool isOk(); - -- virtual GBool upsideDown(); -- virtual GBool useDrawChar(); -- virtual GBool interpretType3Chars(); -+ virtual bool upsideDown(); -+ virtual bool useDrawChar(); -+ virtual bool interpretType3Chars(); - virtual void startPage(int pageNum, GfxState *state, XRef *xref); - virtual void endPage(); - -@@ -63,10 +63,10 @@ public: - // images - virtual void drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap *colorMap, -- int *maskColors, GBool inlineImg); -+ int *maskColors, bool inlineImg); - virtual void drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap *colorMap, -- GBool interpolate, int *maskColors, GBool inlineImg); -+ bool interpolate, int *maskColors, bool inlineImg); - - // styles - virtual void updateAll(GfxState *state); diff --git a/kde/patch/calligra/calligra3_poppler-0.72.patch b/kde/patch/calligra/calligra3_poppler-0.72.patch deleted file mode 100644 index 2cab98f..0000000 --- a/kde/patch/calligra/calligra3_poppler-0.72.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp -index 80f01a5f76f..ea69228dbc1 100644 ---- a/filters/karbon/pdf/SvgOutputDev.cpp -+++ b/filters/karbon/pdf/SvgOutputDev.cpp -@@ -407,7 +407,7 @@ void SvgOutputDev::drawString(GfxState * state, const GooString * s) - - QString str; - -- const char * p = s->getCString(); -+ const char * p = s->c_str(); - int len = s->getLength(); - CharCode code; - Unicode *u = nullptr; -@@ -459,11 +459,11 @@ void SvgOutputDev::drawString(GfxState * state, const GooString * s) - *d->body << " y=\"" << y << "px\""; - - if (font && font->getFamily()) { -- *d->body << " font-family=\"" << QString::fromLatin1(font->getFamily()->getCString()) << "\""; -- //debugPdf << "font family:" << QString::fromLatin1( font->getFamily()->getCString() ); -+ *d->body << " font-family=\"" << QString::fromLatin1(font->getFamily()->c_str()) << "\""; -+ //debugPdf << "font family:" << QString::fromLatin1( font->getFamily()->c_str() ); - } else if (font && font->getName()) { -- *d->body << " font-family=\"" << QString::fromLatin1(font->getName()->getCString()) << "\""; -- //debugPdf << "font name:" << QString::fromLatin1( font->getName()->getCString() ); -+ *d->body << " font-family=\"" << QString::fromLatin1(font->getName()->c_str()) << "\""; -+ //debugPdf << "font name:" << QString::fromLatin1( font->getName()->c_str() ); - } - *d->body << " font-size=\"" << qMax(state->getFontSize(), state->getTransformedFontSize()) << "px\""; - diff --git a/kde/patch/calligra/calligra3_poppler-0.73.patch b/kde/patch/calligra/calligra3_poppler-0.73.patch deleted file mode 100644 index 86738de..0000000 --- a/kde/patch/calligra/calligra3_poppler-0.73.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a1ddd91e6c354e8f0dda40f8a522053c3fa19c39 Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Tue, 15 Jan 2019 22:24:08 +0100 -Subject: [PATCH] Guchar -> unsigned char - -It was just a typdef and it's now gone ---- - filters/karbon/pdf/SvgOutputDev.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp -index 80f01a5f76f..1a5aa30bc40 100644 ---- a/filters/karbon/pdf/SvgOutputDev.cpp -+++ b/filters/karbon/pdf/SvgOutputDev.cpp -@@ -496,7 +496,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, - if (maskColors) { - for (int y = 0; y < height; y++) { - dest = (unsigned int *)(buffer + y * 4 * width); -- Guchar * pix = imgStr->getLine(); -+ unsigned char * pix = imgStr->getLine(); - colorMap->getRGBLine(pix, dest, width); - - for (int x = 0; x < width; x++) { -@@ -515,7 +515,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, - } else { - for (int y = 0; y < height; y++) { - dest = (unsigned int *)(buffer + y * 4 * width); -- Guchar * pix = imgStr->getLine(); -+ unsigned char * pix = imgStr->getLine(); - colorMap->getRGBLine(pix, dest, width); - } - diff --git a/kde/patch/calligra/calligra3_qt511.patch b/kde/patch/calligra/calligra3_qt511.patch deleted file mode 100644 index 0ddf0f2..0000000 --- a/kde/patch/calligra/calligra3_qt511.patch +++ /dev/null @@ -1,135 +0,0 @@ -From ee83e0f2c251072e47a2799619cdc79efe67e651 Mon Sep 17 00:00:00 2001 -From: David Faure -Date: Tue, 3 Apr 2018 00:31:19 +0200 -Subject: Fix compilation with Qt 5.11 (missing include) - ---- - stage/part/KPrPresentationTool.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/stage/part/KPrPresentationTool.cpp b/stage/part/KPrPresentationTool.cpp -index ae743da..3007f91 100644 ---- a/stage/part/KPrPresentationTool.cpp -+++ b/stage/part/KPrPresentationTool.cpp -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - - #include - #include ---- -From a7ebecb9fbee2190e649c44ed53f1299013baa30 Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Sun, 18 Mar 2018 11:56:57 +0100 -Subject: Fix build with Qt 5.11 (missing headers) - -Reviewers: #calligra:_3.0, anthonyfieroni, danders - -Reviewed By: #calligra:_3.0, anthonyfieroni, danders - -Subscribers: anthonyfieroni, danders - -Tags: #calligra:_3.0 - -Differential Revision: https://phabricator.kde.org/D11454 ---- - libs/widgets/KoCsvImportDialog.cpp | 1 + - libs/widgets/KoPageLayoutWidget.cpp | 2 ++ - plugins/chartshape/dialogs/TableEditorDialog.cpp | 1 + - plugins/formulashape/FormulaToolWidget.cpp | 1 + - sheets/dialogs/LayoutDialog.cpp | 1 + - words/part/dialogs/KWAnchoringProperties.cpp | 1 + - words/part/dialogs/KWRunAroundProperties.cpp | 2 ++ - 15 files changed, 18 insertions(+), 1 deletion(-) - -diff --git a/libs/widgets/KoCsvImportDialog.cpp b/libs/widgets/KoCsvImportDialog.cpp -index 0ffdcf6..cdca006 100644 ---- a/libs/widgets/KoCsvImportDialog.cpp -+++ b/libs/widgets/KoCsvImportDialog.cpp -@@ -21,6 +21,7 @@ - #include "KoCsvImportDialog.h" - - // Qt -+#include - #include - #include - -diff --git a/libs/widgets/KoPageLayoutWidget.cpp b/libs/widgets/KoPageLayoutWidget.cpp -index f91555c..a3816f9 100644 ---- a/libs/widgets/KoPageLayoutWidget.cpp -+++ b/libs/widgets/KoPageLayoutWidget.cpp -@@ -23,6 +23,8 @@ - - #include - -+#include -+ - class Q_DECL_HIDDEN KoPageLayoutWidget::Private - { - public: -diff --git a/plugins/chartshape/dialogs/TableEditorDialog.cpp b/plugins/chartshape/dialogs/TableEditorDialog.cpp -index c0d5136..d2a772e 100644 ---- a/plugins/chartshape/dialogs/TableEditorDialog.cpp -+++ b/plugins/chartshape/dialogs/TableEditorDialog.cpp -@@ -24,6 +24,7 @@ - - // Qt - #include -+#include - - // Calligra - #include -diff --git a/plugins/formulashape/FormulaToolWidget.cpp b/plugins/formulashape/FormulaToolWidget.cpp -index ed10919..8f52177 100644 ---- a/plugins/formulashape/FormulaToolWidget.cpp -+++ b/plugins/formulashape/FormulaToolWidget.cpp -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - - FormulaToolWidget::FormulaToolWidget( KoFormulaTool* tool, QWidget* parent ) -diff --git a/sheets/dialogs/LayoutDialog.cpp b/sheets/dialogs/LayoutDialog.cpp -index a0a9832..7d7db53 100644 ---- a/sheets/dialogs/LayoutDialog.cpp -+++ b/sheets/dialogs/LayoutDialog.cpp -@@ -36,6 +36,7 @@ - #include - - #include -+#include - #include - #include - #include -diff --git a/words/part/dialogs/KWAnchoringProperties.cpp b/words/part/dialogs/KWAnchoringProperties.cpp -index d64208c..bfddb3a 100644 ---- a/words/part/dialogs/KWAnchoringProperties.cpp -+++ b/words/part/dialogs/KWAnchoringProperties.cpp -@@ -35,6 +35,7 @@ - - #include - -+#include - #include - - const int KWAnchoringProperties::vertRels[4][20] = { -diff --git a/words/part/dialogs/KWRunAroundProperties.cpp b/words/part/dialogs/KWRunAroundProperties.cpp -index e38599a..7e8b2d5 100644 ---- a/words/part/dialogs/KWRunAroundProperties.cpp -+++ b/words/part/dialogs/KWRunAroundProperties.cpp -@@ -28,6 +28,8 @@ - - #include - -+#include -+ - KWRunAroundProperties::KWRunAroundProperties(FrameConfigSharedState *state) - : m_state(state) - { --- -cgit v0.11.2 - diff --git a/kde/patch/calligra/calligra3_qt513.patch b/kde/patch/calligra/calligra3_qt513.patch deleted file mode 100644 index 987b353..0000000 --- a/kde/patch/calligra/calligra3_qt513.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0c5430697bdcf41a45046107b28014e40c49a11a Mon Sep 17 00:00:00 2001 -From: David Faure -Date: Tue, 23 Jul 2019 13:02:34 +0200 -Subject: [PATCH] Fix compilation with Qt 5.13 (missing include) - ---- - sheets/plugins/calendar/CalendarToolWidget.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/sheets/plugins/calendar/CalendarToolWidget.cpp b/sheets/plugins/calendar/CalendarToolWidget.cpp -index b10b23022a2..0c5eeb68cf3 100644 ---- a/sheets/plugins/calendar/CalendarToolWidget.cpp -+++ b/sheets/plugins/calendar/CalendarToolWidget.cpp -@@ -30,6 +30,7 @@ - #include - - #include -+#include - - namespace Calligra - { - diff --git a/kde/patch/calligraplan/calligraplan.kcalcore.1.patch b/kde/patch/calligraplan/calligraplan.kcalcore.1.patch deleted file mode 100644 index dcbe903..0000000 --- a/kde/patch/calligraplan/calligraplan.kcalcore.1.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3a01affd66f8dfdcc124e23595217f3ae5a09723 Mon Sep 17 00:00:00 2001 -From: Dag Andersen -Date: Thu, 20 Jun 2019 10:52:00 +0200 -Subject: ICal: Adapt to api changes in KCalCore - ---- - CMakeLists.txt | 37 +++++++++++----------- - src/CMakeLists.txt | 4 +++ - .../filters/icalendar/export/icalendarexport.cpp | 5 +++ - 3 files changed, 27 insertions(+), 19 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 0dabbaf..49fa642 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -75,6 +75,10 @@ if ("${KF5CalendarCore_VERSION}" VERSION_GREATER 5.6.40) - set(HAVE_QDATETIME_KCALCORE TRUE) - endif() - -+if ("${KF5CalendarCore_VERSION}" VERSION_GREATER 5.11.42) -+ set(KCALCORE_HAVE_NO_PERSION_PTR TRUE) -+endif() -+ - if (PLANCHARTDEBUG) - add_definitions(-DPLAN_CHART_DEBUG) - endif () -diff --git a/src/plugins/filters/icalendar/export/icalendarexport.cpp b/src/plugins/filters/icalendar/export/icalendarexport.cpp -index cd75598..ce29bfe 100644 ---- a/src/plugins/filters/icalendar/export/icalendarexport.cpp -+++ b/src/plugins/filters/icalendar/export/icalendarexport.cpp -@@ -141,8 +141,13 @@ void ICalendarExport::createTodos(KCalCore::Calendar::Ptr cal, const Node *node, - todo->setOrganizer(node->projectNode()->leader()); - } - if ( node->type() != Node::Type_Project && ! node->leader().isEmpty()) { -+#if KCALCORE_HAVE_NO_PERSION_PTR -+ KCalCore::Person p = KCalCore::Person::fromFullName(node->leader()); -+ KCalCore::Attendee::Ptr a(new KCalCore::Attendee(p.name(), p.email())); -+#else - KCalCore::Person::Ptr p = KCalCore::Person::fromFullName(node->leader()); - KCalCore::Attendee::Ptr a(new KCalCore::Attendee(p->name(), p->email())); -+#endif - a->setRole(KCalCore::Attendee::NonParticipant); - todo->addAttendee(a); - } --- -cgit v1.1 - diff --git a/kde/patch/calligraplan/calligraplan.kcalcore.2.patch b/kde/patch/calligraplan/calligraplan.kcalcore.2.patch deleted file mode 100644 index 5c118e1..0000000 --- a/kde/patch/calligraplan/calligraplan.kcalcore.2.patch +++ /dev/null @@ -1,85 +0,0 @@ -From a9eaf1c98ed408fd6e8897fa9e2f99ed17db1ebc Mon Sep 17 00:00:00 2001 -From: David Faure -Date: Tue, 23 Jul 2019 12:26:17 +0200 -Subject: Port to KCalCore API changes - -The code is in #if 0, but I tested compilation of this in the calligra -stable branch: -https://commits.kde.org/calligra/2d484fda1b31a72659088a4bfce5c3708e923cb0 - -So you can use KCalCore again if you want :-) -It's turning into a KF5 framework so the API will be stable from now on. - -CCMAIL: danders@get2net.dk ---- - .../filters/icalendar/export/icalendarexport.cpp | 20 +++++++++++++++++--- - 1 file changed, 17 insertions(+), 3 deletions(-) - -diff --git a/src/plugins/filters/icalendar/export/icalendarexport.cpp b/src/plugins/filters/icalendar/export/icalendarexport.cpp -index b21320f..828b641 100644 ---- a/src/plugins/filters/icalendar/export/icalendarexport.cpp -+++ b/src/plugins/filters/icalendar/export/icalendarexport.cpp -@@ -35,6 +35,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -355,14 +356,15 @@ void ICalendarExport::createTodos(KCalCore::Calendar::Ptr cal, const Node *node, - todo->setOrganizer(node->projectNode()->leader()); - } - if ( node->type() != Node::Type_Project && ! node->leader().isEmpty()) { --#if KCALCORE_HAVE_NO_PERSION_PTR -+#if KCALCORE_VERSION >= QT_VERSION_CHECK(5, 11, 80) - KCalCore::Person p = KCalCore::Person::fromFullName(node->leader()); -- KCalCore::Attendee::Ptr a(new KCalCore::Attendee(p.name(), p.email())); -+ KCalCore::Attendee a(p.name(), p.email()); -+ a.setRole(KCalCore::Attendee::NonParticipant); - #else - KCalCore::Person::Ptr p = KCalCore::Person::fromFullName(node->leader()); - KCalCore::Attendee::Ptr a(new KCalCore::Attendee(p->name(), p->email())); --#endif - a->setRole(KCalCore::Attendee::NonParticipant); -+#endif - todo->addAttendee(a); - } - DateTime st = node->startTime(id); -@@ -381,13 +383,21 @@ void ICalendarExport::createTodos(KCalCore::Calendar::Ptr cal, const Node *node, - const QList lst = task->requestedResources(); - foreach(const Resource *r, lst) { - if (r->type() == Resource::Type_Work) { -+#if KCALCORE_VERSION >= QT_VERSION_CHECK(5, 11, 80) -+ todo->addAttendee(KCalCore::Attendee(r->name(), r->email())); -+#else - todo->addAttendee(KCalCore::Attendee::Ptr(new KCalCore::Attendee(r->name(), r->email()))); -+#endif - } - } - } else { - foreach(const Resource *r, s->resources()) { - if (r->type() == Resource::Type_Work) { -+#if KCALCORE_VERSION >= QT_VERSION_CHECK(5, 11, 80) -+ todo->addAttendee(KCalCore::Attendee(r->name(), r->email())); -+#else - todo->addAttendee(KCalCore::Attendee::Ptr(new KCalCore::Attendee(r->name(), r->email()))); -+#endif - } - } - -@@ -398,7 +408,11 @@ void ICalendarExport::createTodos(KCalCore::Calendar::Ptr cal, const Node *node, - todo->setPercentComplete(task->completion().percentFinished()); - } - foreach(const Document *doc, node->documents().documents()) { -+#if KCALCORE_VERSION >= QT_VERSION_CHECK(5, 11, 80) -+ todo->addAttachment(KCalCore::Attachment(doc->url().url())); -+#else - todo->addAttachment(KCalCore::Attachment::Ptr(new KCalCore::Attachment(doc->url().url()))); -+#endif - } - if (! parent.isNull()) { - todo->setRelatedTo(parent->uid(), KCalCore::Incidence::RelTypeParent); --- -cgit v1.1 - diff --git a/kde/patch/calligraplan/calligraplan.kcalendarcore.patch b/kde/patch/calligraplan/calligraplan.kcalendarcore.patch deleted file mode 100644 index 42aa135..0000000 --- a/kde/patch/calligraplan/calligraplan.kcalendarcore.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 2f5505cf03ff865349d06e1d5c39007c52e7cd10 Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Fri, 16 Aug 2019 15:49:09 +0200 -Subject: [PATCH] Fix headers after kcalcore->kcalendercore rename happened - ---- - .../filters/icalendar/export/icalendarexport.cpp | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/plugins/filters/icalendar/export/icalendarexport.cpp b/src/plugins/filters/icalendar/export/icalendarexport.cpp -index bb6b097d..729d6e50 100644 ---- a/src/plugins/filters/icalendar/export/icalendarexport.cpp -+++ b/src/plugins/filters/icalendar/export/icalendarexport.cpp -@@ -31,11 +31,11 @@ - #include - #include "kptdebug.h" - --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include - - #include - #include --- -2.22.1 - - diff --git a/kde/patch/calligraplan/calligraplan.missingheader.patch b/kde/patch/calligraplan/calligraplan.missingheader.patch deleted file mode 100644 index b5941c5..0000000 --- a/kde/patch/calligraplan/calligraplan.missingheader.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fe36bf6f0dc1f0c1e927850dd78093cfe3b7aae2 Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Sun, 28 Jul 2019 00:07:33 +0200 -Subject: Fix compile on CI - -src/workpackage/view.h:148:31: error: field m_scheduleActions has incomplete type QMap ---- - src/workpackage/view.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/workpackage/view.h b/src/workpackage/view.h -index 6cae32b..cd2fc4e 100644 ---- a/src/workpackage/view.h -+++ b/src/workpackage/view.h -@@ -24,6 +24,7 @@ - - #include - -+#include - #include - - class QPrinter; --- -cgit v1.1 - diff --git a/kde/patch/calligraplan/calligraplan.qt-511.patch b/kde/patch/calligraplan/calligraplan.qt-511.patch deleted file mode 100644 index c0776fa..0000000 --- a/kde/patch/calligraplan/calligraplan.qt-511.patch +++ /dev/null @@ -1,125 +0,0 @@ -From f53805bdc108b608e40f217e6a78e7e4df4284f2 Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Sun, 18 Mar 2018 11:56:57 +0100 -Subject: [PATCH] Fix build with Qt 5.11 (missing headers) - -Reviewers: #calligra:_3.0 - -Tags: #calligra:_3.0 - -Differential Revision: https://phabricator.kde.org/D11454 ---- - plan/src/kptview.h | 1 + - plan/src/kptviewlist.cpp | 1 + - plan/src/libs/ui/kptaccountseditor.cpp | 1 + - plan/src/libs/ui/kptdocumentspanel.h | 1 + - plan/src/libs/ui/kptitemviewsettup.cpp | 2 +- - plan/src/libs/ui/kpttaskeditor.cpp | 1 + - plan/src/libs/ui/reportsgenerator/ReportsGeneratorView.cpp | 1 + - plan/src/libs/widgets/KoPageLayoutWidget.cpp | 2 ++ - 15 files changed, 18 insertions(+), 1 deletion(-) - -diff --git a/plan/src/kptview.h b/plan/src/kptview.h -index 44d11935e71..a98e55342db 100644 ---- a/plan/src/kptview.h -+++ b/plan/src/kptview.h -@@ -28,6 +28,7 @@ - #include "kptcontext.h" - #include "kptviewbase.h" - -+#include - #include - #include - -diff --git a/plan/src/kptviewlist.cpp b/plan/src/kptviewlist.cpp -index f34e702e055..0e6db7b2ffe 100644 ---- a/plan/src/kptviewlist.cpp -+++ b/plan/src/kptviewlist.cpp -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - #include - - #include -diff --git a/plan/src/libs/ui/kptaccountseditor.cpp b/plan/src/libs/ui/kptaccountseditor.cpp -index 7991fafd779..54e3a87c94f 100644 ---- a/plan/src/libs/ui/kptaccountseditor.cpp -+++ b/plan/src/libs/ui/kptaccountseditor.cpp -@@ -40,6 +40,7 @@ - #include - #include - #include -+#include - - #include - #include -diff --git a/plan/src/libs/ui/kptdocumentspanel.h b/plan/src/libs/ui/kptdocumentspanel.h -index 00ea3af80b2..491cb1ebb86 100644 ---- a/plan/src/libs/ui/kptdocumentspanel.h -+++ b/plan/src/libs/ui/kptdocumentspanel.h -@@ -26,6 +26,7 @@ - - #include "kptdocuments.h" - -+#include - #include - #include - -diff --git a/plan/src/libs/ui/kptitemviewsettup.cpp b/plan/src/libs/ui/kptitemviewsettup.cpp -index d1c3b1fc157..7c97a070b9a 100644 ---- a/plan/src/libs/ui/kptitemviewsettup.cpp -+++ b/plan/src/libs/ui/kptitemviewsettup.cpp -@@ -25,9 +25,9 @@ - - #include "KoPageLayoutWidget.h" - -+#include - #include - -- - namespace KPlato - { - -diff --git a/plan/src/libs/ui/kpttaskeditor.cpp b/plan/src/libs/ui/kpttaskeditor.cpp -index 21546118d33..91db5acbb18 100644 ---- a/plan/src/libs/ui/kpttaskeditor.cpp -+++ b/plan/src/libs/ui/kpttaskeditor.cpp -@@ -45,6 +45,7 @@ - #include - #include - #include -+#include - #include - - #include -diff --git a/plan/src/libs/ui/reportsgenerator/ReportsGeneratorView.cpp b/plan/src/libs/ui/reportsgenerator/ReportsGeneratorView.cpp -index 344ebc2b599..9146f06ab8c 100644 ---- a/plan/src/libs/ui/reportsgenerator/ReportsGeneratorView.cpp -+++ b/plan/src/libs/ui/reportsgenerator/ReportsGeneratorView.cpp -@@ -31,6 +31,7 @@ - #include - - #include -+#include - #include - #include - #include -diff --git a/plan/src/libs/widgets/KoPageLayoutWidget.cpp b/plan/src/libs/widgets/KoPageLayoutWidget.cpp -index c9e17b748a9..b67e9848807 100644 ---- a/plan/src/libs/widgets/KoPageLayoutWidget.cpp -+++ b/plan/src/libs/widgets/KoPageLayoutWidget.cpp -@@ -23,6 +23,8 @@ - - #include - -+#include -+ - class Q_DECL_HIDDEN KoPageLayoutWidget::Private - { - public: --- -2.16.2 - - diff --git a/kde/patch/cantor.patch b/kde/patch/cantor.patch deleted file mode 100644 index 54f2b47..0000000 --- a/kde/patch/cantor.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Fix build against KF 5.31.0 (repaired in 16.12.3): -#cat $CWD/patch/cantor/cantor_python.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } -#cat $CWD/patch/cantor/cantor_julia.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/cantor/cantor_julia.patch b/kde/patch/cantor/cantor_julia.patch deleted file mode 100644 index 5c381ca..0000000 --- a/kde/patch/cantor/cantor_julia.patch +++ /dev/null @@ -1,193 +0,0 @@ -Patch taken from: -https://gitweb.gentoo.org/repo/gentoo.git/plain/kde-apps/cantor/files/cantor-16.12.2-julia-kf-5.31.patch - -From 45322d9f58f50df3d4d5755d4199e579f6fd8646 Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Sat, 11 Feb 2017 22:46:35 +0100 -Subject: [PATCH] [julia] Fix build with -fno-operator-names - -REVIEW: 129942 ---- - src/backends/julia/juliaexpression.cpp | 6 +++--- - src/backends/julia/juliaextensions.cpp | 4 ++-- - src/backends/julia/juliahighlighter.cpp | 4 ++-- - src/backends/julia/juliakeywords.cpp | 10 +++++----- - src/backends/julia/juliaserver/juliaserver.cpp | 4 ++-- - src/backends/julia/juliaserver/main.cpp | 4 ++-- - src/backends/julia/juliasession.cpp | 4 ++-- - 7 files changed, 18 insertions(+), 18 deletions(-) - -diff --git a/src/backends/julia/juliaexpression.cpp b/src/backends/julia/juliaexpression.cpp -index 27cdd85..618200d 100644 ---- a/src/backends/julia/juliaexpression.cpp -+++ b/src/backends/julia/juliaexpression.cpp -@@ -40,7 +40,7 @@ void JuliaExpression::evaluate() - - // Plots integration - m_plot_filename.clear(); -- if (juliaSession->integratePlots() and checkPlotShowingCommands()) { -+ if (juliaSession->integratePlots() && checkPlotShowingCommands()) { - // Simply add plot saving command to the end of execution - QStringList inlinePlotFormats; - inlinePlotFormats << QLatin1String("svg"); -@@ -73,8 +73,8 @@ void JuliaExpression::finalize() - setResult(new Cantor::TextResult(juliaSession->getOutput())); - setStatus(Cantor::Expression::Error); - } else { -- if (not m_plot_filename.isEmpty() -- and QFileInfo(m_plot_filename).exists()) { -+ if (!m_plot_filename.isEmpty() -+ && QFileInfo(m_plot_filename).exists()) { - // If we have plot in result, show it - setResult( - new Cantor::ImageResult(QUrl::fromLocalFile(m_plot_filename))); -diff --git a/src/backends/julia/juliaextensions.cpp b/src/backends/julia/juliaextensions.cpp -index 4585c6f..ad5e3a9 100644 ---- a/src/backends/julia/juliaextensions.cpp -+++ b/src/backends/julia/juliaextensions.cpp -@@ -138,7 +138,7 @@ QString JuliaPlotExtension::plotFunction2d( - { - auto new_left = left; - auto new_right = right; -- if (new_left.isEmpty() and new_right.isEmpty()) { -+ if (new_left.isEmpty() && new_right.isEmpty()) { - new_left = QLatin1String("-1"); - new_right = QLatin1String("1"); - } else if (new_left.isEmpty()) { -@@ -165,7 +165,7 @@ QString JuliaPlotExtension::plotFunction3d( - { - - auto update_interval = [](Interval &interval) { -- if (interval.first.isEmpty() and interval.second.isEmpty()) { -+ if (interval.first.isEmpty() && interval.second.isEmpty()) { - interval.first = QLatin1String("-1"); - interval.second = QLatin1String("1"); - } else if (interval.first.isEmpty()) { -diff --git a/src/backends/julia/juliahighlighter.cpp b/src/backends/julia/juliahighlighter.cpp -index 4795361..f7d3622 100644 ---- a/src/backends/julia/juliahighlighter.cpp -+++ b/src/backends/julia/juliahighlighter.cpp -@@ -98,7 +98,7 @@ void JuliaHighlighter::highlightBlock(const QString &text) - while (pos < text.length()) { - // Trying to close current environments - bool triggered = false; -- for (int i = 0; i < flags.size() and not triggered; i++) { -+ for (int i = 0; i < flags.size() && !triggered; i++) { - int flag = flags[i]; - QRegExp ®exp = regexps_ends[i]; - QTextCharFormat &format = formats[i]; -@@ -144,7 +144,7 @@ void JuliaHighlighter::highlightBlock(const QString &text) - singleLineCommentStart.indexIn(text, pos); - - if (singleLineCommentStartPos != -1 -- and singleLineCommentStartPos < minPos) { -+ && singleLineCommentStartPos < minPos) { - // single line comment starts earlier - setFormat(pos, text.length() - pos, commentFormat()); - break; -diff --git a/src/backends/julia/juliakeywords.cpp b/src/backends/julia/juliakeywords.cpp -index f0a5846..8a0efec 100644 ---- a/src/backends/julia/juliakeywords.cpp -+++ b/src/backends/julia/juliakeywords.cpp -@@ -62,11 +62,11 @@ void JuliaKeywords::loadFromFile() - const QStringRef name = xml.name(); - - if (name == QLatin1String("keywords") -- or name == QLatin1String("variables") -- or name == QLatin1String("plot_showing_commands")) { -+ || name == QLatin1String("variables") -+ || name == QLatin1String("plot_showing_commands")) { - while (xml.readNextStartElement()) { - Q_ASSERT( -- xml.isStartElement() and xml.name() == QLatin1String("word") -+ xml.isStartElement() && xml.name() == QLatin1String("word") - ); - - const QString text = xml.readElementText(); -@@ -91,7 +91,7 @@ void JuliaKeywords::loadFromFile() - - void JuliaKeywords::addVariable(const QString &variable) - { -- if (not m_variables.contains(variable)) { -+ if (!m_variables.contains(variable)) { - m_variables << variable; - } - } -@@ -104,7 +104,7 @@ void JuliaKeywords::clearVariables() - - void JuliaKeywords::addFunction(const QString &function) - { -- if (not m_functions.contains(function)) { -+ if (!m_functions.contains(function)) { - m_functions << function; - } - } -diff --git a/src/backends/julia/juliaserver/juliaserver.cpp b/src/backends/julia/juliaserver/juliaserver.cpp -index c9beb4c..91585cf 100644 ---- a/src/backends/julia/juliaserver/juliaserver.cpp -+++ b/src/backends/julia/juliaserver/juliaserver.cpp -@@ -47,7 +47,7 @@ void JuliaServer::runJuliaCommand(const QString &command) - { - // Redirect stdout, stderr to temprorary files - QTemporaryFile output, error; -- if (not output.open() or not error.open()) { -+ if (!output.open() || !error.open()) { - qFatal("Unable to create temprorary files for stdout/stderr"); - return; - } -@@ -90,7 +90,7 @@ void JuliaServer::runJuliaCommand(const QString &command) - bool is_nothing = jl_unbox_bool( - static_cast(jl_call2(equality, nothing, val)) - ); -- if (not is_nothing) { -+ if (!is_nothing) { - jl_static_show(JL_STDOUT, val); - } - m_was_exception = false; -diff --git a/src/backends/julia/juliaserver/main.cpp b/src/backends/julia/juliaserver/main.cpp -index ad7e4d9..11687ec 100644 ---- a/src/backends/julia/juliaserver/main.cpp -+++ b/src/backends/julia/juliaserver/main.cpp -@@ -30,7 +30,7 @@ int main(int argc, char *argv[]) - { - QCoreApplication app(argc, argv); - -- if (not QDBusConnection::sessionBus().isConnected()) { -+ if (!QDBusConnection::sessionBus().isConnected()) { - qWarning() << "Can't connect to the D-Bus session bus.\n" - "To start it, run: eval `dbus-launch --auto-syntax`"; - return 1; -@@ -39,7 +39,7 @@ int main(int argc, char *argv[]) - const QString &serviceName = - QString::fromLatin1("org.kde.Cantor.Julia-%1").arg(app.applicationPid()); - -- if (not QDBusConnection::sessionBus().registerService(serviceName)) { -+ if (!QDBusConnection::sessionBus().registerService(serviceName)) { - qWarning() << QDBusConnection::sessionBus().lastError().message(); - return 2; - } -diff --git a/src/backends/julia/juliasession.cpp b/src/backends/julia/juliasession.cpp -index 425e6cb..9183e11 100644 ---- a/src/backends/julia/juliasession.cpp -+++ b/src/backends/julia/juliasession.cpp -@@ -86,7 +86,7 @@ void JuliaSession::login() - QDBusConnection::sessionBus() - ); - -- if (not m_interface->isValid()) { -+ if (!m_interface->isValid()) { - qWarning() << QDBusConnection::sessionBus().lastError().message(); - return; - } -@@ -213,7 +213,7 @@ bool JuliaSession::getWasException() - { - const QDBusReply &reply = - m_interface->call(QLatin1String("getWasException")); -- return reply.isValid() and reply.value(); -+ return reply.isValid() && reply.value(); - } - - void JuliaSession::listVariables() --- -2.10.2 - diff --git a/kde/patch/cantor/cantor_python.patch b/kde/patch/cantor/cantor_python.patch deleted file mode 100644 index aa2b398..0000000 --- a/kde/patch/cantor/cantor_python.patch +++ /dev/null @@ -1,31 +0,0 @@ -Patch taken from: -https://gitweb.gentoo.org/repo/gentoo.git/plain/kde-apps/cantor/files/cantor-16.12.2-python-kf-5.31.patch - -commit 4b8ef6bed62daced90c7826985650c2a813d2996 -Author: Jonathan Riddell -Date: Wed Feb 8 14:56:48 2017 +0000 - - remove modern C++ use to fix compile with current KDE policy - -diff --git a/src/backends/python/pythonhighlighter.cpp b/src/backends/python/pythonhighlighter.cpp -index 4064524..87b10dd 100644 ---- a/src/backends/python/pythonhighlighter.cpp -+++ b/src/backends/python/pythonhighlighter.cpp -@@ -87,7 +87,7 @@ void PythonHighlighter::highlightBlock(const QString &text) - while (pos < text.length()) { - // Trying to close current environments - bool triggered = false; -- for (int i = 0; i < flags.size() and not triggered; i++) { -+ for (int i = 0; i < flags.size() && !triggered; i++) { - int flag = flags[i]; - QRegExp ®exp = regexps[i]; - QTextCharFormat &format = formats[i]; -@@ -126,7 +126,7 @@ void PythonHighlighter::highlightBlock(const QString &text) - singleLineCommentStart.indexIn(text, pos); - - if (singleLineCommentStartPos != -1 -- and singleLineCommentStartPos < minPos) { -+ && singleLineCommentStartPos < minPos) { - setFormat(pos, text.length() - pos, commentFormat()); - break; - } else if (minRegexp) { diff --git a/kde/patch/digikam.patch b/kde/patch/digikam.patch deleted file mode 100644 index 8f50ec2..0000000 --- a/kde/patch/digikam.patch +++ /dev/null @@ -1,12 +0,0 @@ -# Fix compilation with clang. -# Fixed in digikam 5.5.0. -#cat $CWD/patch/digikam/digikam_clang_fix.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix linking issue, backport from git master: -#cd core -# cat $CWD/patch/digikam/digikam_databasemodel.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } -#cd - - -# Fix crashes with imagemagick 7 (fixed post digikam 6.4.0): -cat $CWD/patch/digikam/digikam_imagemagick7.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/digikam/digikam_clang_fix.patch b/kde/patch/digikam/digikam_clang_fix.patch deleted file mode 100644 index a4d77b0..0000000 --- a/kde/patch/digikam/digikam_clang_fix.patch +++ /dev/null @@ -1,38 +0,0 @@ -Taken from: -http://pkgs.fedoraproject.org/cgit/rpms/digikam.git/ -And added and extra '/core/' path componenent. - -From 86cd0d1d89c8b4d13f06dc8a353bdd99f13c4758 Mon Sep 17 00:00:00 2001 -From: Gilles Caulier -Date: Wed, 18 Jan 2017 10:13:20 +0100 -Subject: [PATCH 2/2] Fix compilation with clang - ---- - libs/dmetadata/metaengine_p.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/core/libs/dmetadata/metaengine_p.cpp b/core/libs/dmetadata/metaengine_p.cpp -index 2c83b58..2b44e06 100644 ---- a/core/libs/dmetadata/metaengine_p.cpp -+++ b/core/libs/dmetadata/metaengine_p.cpp -@@ -49,7 +49,7 @@ extern "C" - #include "digikam_debug.h" - - // Pragma directives to reduce warnings from Exiv2. --#if not defined(__APPLE__) && defined(__GNUC__) -+#if !defined(__APPLE__) && defined(__GNUC__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif -@@ -723,7 +723,7 @@ void MetaEngine::Private::loadSidecarData(Exiv2::Image::AutoPtr xmpsidecar) - } // namespace Digikam - - // Restore warnings --#if not defined(__APPLE__) && defined(__GNUC__) -+#if !defined(__APPLE__) && defined(__GNUC__) - #pragma GCC diagnostic pop - #endif - --- -2.9.3 - diff --git a/kde/patch/digikam/digikam_databasemodel.patch b/kde/patch/digikam/digikam_databasemodel.patch deleted file mode 100644 index 8b2fff7..0000000 --- a/kde/patch/digikam/digikam_databasemodel.patch +++ /dev/null @@ -1,13337 +0,0 @@ -From 7e00441c257e7e9e5dc5ab983fc06046fb72b0c5 Mon Sep 17 00:00:00 2001 -From: Gilles Caulier -Date: Sat, 22 Jul 2017 15:46:08 +0200 -Subject: fix broken linking stage under MacOS with macports. move database - models into libdigikamdatabase. Let's others model in place to be included - into libdigikamcore - ---- - libs/database/CMakeLists.txt | 16 +- - libs/database/models/imagefiltermodel.cpp | 1116 ++++++++++++++++++ - libs/database/models/imagefiltermodel.h | 299 +++++ - libs/database/models/imagefiltermodelpriv.cpp | 258 ++++ - libs/database/models/imagefiltermodelpriv.h | 159 +++ - libs/database/models/imagefiltermodelthreads.cpp | 40 + - libs/database/models/imagefiltermodelthreads.h | 100 ++ - libs/database/models/imagefiltersettings.cpp | 952 +++++++++++++++ - libs/database/models/imagefiltersettings.h | 349 ++++++ - libs/database/models/imagelistmodel.cpp | 70 ++ - libs/database/models/imagelistmodel.h | 63 + - libs/database/models/imagemodel.cpp | 1368 ++++++++++++++++++++++ - libs/database/models/imagemodel.h | 364 ++++++ - libs/database/models/imagesortsettings.cpp | 400 +++++++ - libs/database/models/imagesortsettings.h | 225 ++++ - libs/database/models/imagethumbnailmodel.cpp | 323 +++++ - libs/database/models/imagethumbnailmodel.h | 140 +++ - libs/database/models/imageversionsmodel.cpp | 183 +++ - libs/database/models/imageversionsmodel.h | 75 ++ - libs/models/CMakeLists.txt | 15 +- - libs/models/imagefiltermodel.cpp | 1116 ------------------ - libs/models/imagefiltermodel.h | 299 ----- - libs/models/imagefiltermodelpriv.cpp | 258 ---- - libs/models/imagefiltermodelpriv.h | 159 --- - libs/models/imagefiltermodelthreads.cpp | 40 - - libs/models/imagefiltermodelthreads.h | 100 -- - libs/models/imagefiltersettings.cpp | 952 --------------- - libs/models/imagefiltersettings.h | 349 ------ - libs/models/imagelistmodel.cpp | 70 -- - libs/models/imagelistmodel.h | 63 - - libs/models/imagemodel.cpp | 1368 ---------------------- - libs/models/imagemodel.h | 364 ------ - libs/models/imagesortsettings.cpp | 400 ------- - libs/models/imagesortsettings.h | 225 ---- - libs/models/imagethumbnailmodel.cpp | 323 ----- - libs/models/imagethumbnailmodel.h | 140 --- - libs/models/imageversionsmodel.cpp | 183 --- - libs/models/imageversionsmodel.h | 75 -- - 38 files changed, 6499 insertions(+), 6500 deletions(-) - create mode 100644 libs/database/models/imagefiltermodel.cpp - create mode 100644 libs/database/models/imagefiltermodel.h - create mode 100644 libs/database/models/imagefiltermodelpriv.cpp - create mode 100644 libs/database/models/imagefiltermodelpriv.h - create mode 100644 libs/database/models/imagefiltermodelthreads.cpp - create mode 100644 libs/database/models/imagefiltermodelthreads.h - create mode 100644 libs/database/models/imagefiltersettings.cpp - create mode 100644 libs/database/models/imagefiltersettings.h - create mode 100644 libs/database/models/imagelistmodel.cpp - create mode 100644 libs/database/models/imagelistmodel.h - create mode 100644 libs/database/models/imagemodel.cpp - create mode 100644 libs/database/models/imagemodel.h - create mode 100644 libs/database/models/imagesortsettings.cpp - create mode 100644 libs/database/models/imagesortsettings.h - create mode 100644 libs/database/models/imagethumbnailmodel.cpp - create mode 100644 libs/database/models/imagethumbnailmodel.h - create mode 100644 libs/database/models/imageversionsmodel.cpp - create mode 100644 libs/database/models/imageversionsmodel.h - delete mode 100644 libs/models/imagefiltermodel.cpp - delete mode 100644 libs/models/imagefiltermodel.h - delete mode 100644 libs/models/imagefiltermodelpriv.cpp - delete mode 100644 libs/models/imagefiltermodelpriv.h - delete mode 100644 libs/models/imagefiltermodelthreads.cpp - delete mode 100644 libs/models/imagefiltermodelthreads.h - delete mode 100644 libs/models/imagefiltersettings.cpp - delete mode 100644 libs/models/imagefiltersettings.h - delete mode 100644 libs/models/imagelistmodel.cpp - delete mode 100644 libs/models/imagelistmodel.h - delete mode 100644 libs/models/imagemodel.cpp - delete mode 100644 libs/models/imagemodel.h - delete mode 100644 libs/models/imagesortsettings.cpp - delete mode 100644 libs/models/imagesortsettings.h - delete mode 100644 libs/models/imagethumbnailmodel.cpp - delete mode 100644 libs/models/imagethumbnailmodel.h - delete mode 100644 libs/models/imageversionsmodel.cpp - delete mode 100644 libs/models/imageversionsmodel.h - -diff --git a/libs/database/CMakeLists.txt b/libs/database/CMakeLists.txt -index 7d05536..a431a36 100644 ---- a/libs/database/CMakeLists.txt -+++ b/libs/database/CMakeLists.txt -@@ -13,6 +13,18 @@ endif (POLICY CMP0063) - # Boost uses operator names (and, not, ...) - string(REPLACE "-fno-operator-names" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -+set(libdatabasemodels_SRCS -+ models/imagemodel.cpp -+ models/imagefiltermodel.cpp -+ models/imagefiltermodelpriv.cpp -+ models/imagefiltermodelthreads.cpp -+ models/imagefiltersettings.cpp -+ models/imagelistmodel.cpp -+ models/imagesortsettings.cpp -+ models/imagethumbnailmodel.cpp -+ models/imageversionsmodel.cpp -+) -+ - set(libdatabasecore_SRCS - server/databaseserverstarter.cpp - server/databaseservererror.cpp -@@ -152,10 +164,10 @@ if(ENABLE_DBUS) - include_directories($) - endif() - --add_library(digikamdatabase_src OBJECT ${digikamdatabase_LIB_SRCS}) -+add_library(digikamdatabase_src OBJECT ${digikamdatabase_LIB_SRCS} ${libdatabasemodels_SRCS}) - add_library(digikamdatabasemain_src OBJECT ${libdatabaseutils_SRCS} ${libimgqsort_SRCS}) - add_library(digikamdatabasecore_src OBJECT ${libdatabasecore_SRCS}) --add_library(digikamdatabase SHARED $ $) -+add_library(digikamdatabase $) - - generate_export_header(digikamdatabase - BASE_NAME digikam_database -diff --git a/libs/database/models/imagefiltermodel.cpp b/libs/database/models/imagefiltermodel.cpp -new file mode 100644 -index 0000000..3d57e05 ---- /dev/null -+++ b/libs/database/models/imagefiltermodel.cpp -@@ -0,0 +1,1116 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011-2017 by Gilles Caulier -+ * Copyright (C) 2010 by Andi Clemens -+ * Copyright (C) 2011 by Michael G. Hansen -+ * Copyright (C) 2014 by Mohamed Anwer -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagefiltermodel.h" -+#include "imagefiltermodelpriv.h" -+#include "imagefiltermodelthreads.h" -+ -+// Local includes -+ -+#include "digikam_debug.h" -+#include "coredbaccess.h" -+#include "coredbchangesets.h" -+#include "coredbwatch.h" -+#include "imageinfolist.h" -+#include "imagemodel.h" -+ -+namespace Digikam -+{ -+ -+ImageSortFilterModel::ImageSortFilterModel(QObject* parent) -+ : DCategorizedSortFilterProxyModel(parent), m_chainedModel(0) -+{ -+} -+ -+void ImageSortFilterModel::setSourceImageModel(ImageModel* source) -+{ -+ if (m_chainedModel) -+ { -+ m_chainedModel->setSourceImageModel(source); -+ } -+ else -+ { -+ setDirectSourceImageModel(source); -+ } -+} -+ -+void ImageSortFilterModel::setSourceFilterModel(ImageSortFilterModel* source) -+{ -+ if (source) -+ { -+ ImageModel* const model = sourceImageModel(); -+ -+ if (model) -+ { -+ source->setSourceImageModel(model); -+ } -+ } -+ -+ m_chainedModel = source; -+ setSourceModel(source); -+} -+ -+void ImageSortFilterModel::setDirectSourceImageModel(ImageModel* model) -+{ -+ setSourceModel(model); -+} -+ -+void ImageSortFilterModel::setSourceModel(QAbstractItemModel* model) -+{ -+ // made it protected, only setSourceImageModel is public -+ DCategorizedSortFilterProxyModel::setSourceModel(model); -+} -+ -+ImageModel* ImageSortFilterModel::sourceImageModel() const -+{ -+ if (m_chainedModel) -+ { -+ return m_chainedModel->sourceImageModel(); -+ } -+ -+ return static_cast(sourceModel()); -+} -+ -+ImageSortFilterModel* ImageSortFilterModel::sourceFilterModel() const -+{ -+ return m_chainedModel; -+} -+ -+ImageFilterModel* ImageSortFilterModel::imageFilterModel() const -+{ -+ // reimplemented in ImageFilterModel -+ if (m_chainedModel) -+ { -+ return m_chainedModel->imageFilterModel(); -+ } -+ -+ return 0; -+} -+ -+QModelIndex ImageSortFilterModel::mapToSourceImageModel(const QModelIndex& index) const -+{ -+ if (m_chainedModel) -+ { -+ return m_chainedModel->mapToSourceImageModel(mapToSource(index)); -+ } -+ -+ return mapToSource(index); -+} -+ -+QModelIndex ImageSortFilterModel::mapFromSourceImageModel(const QModelIndex& albummodel_index) const -+{ -+ if (m_chainedModel) -+ { -+ return mapFromSource(m_chainedModel->mapFromSourceImageModel(albummodel_index)); -+ } -+ -+ return mapFromSource(albummodel_index); -+} -+ -+ -+QModelIndex ImageSortFilterModel::mapFromDirectSourceToSourceImageModel(const QModelIndex& sourceModel_index) const -+{ -+ if (m_chainedModel) -+ { -+ return m_chainedModel->mapToSourceImageModel(sourceModel_index); -+ } -+ return sourceModel_index; -+} -+ -+// -------------- Convenience mappers ------------------------------------------------------------------- -+ -+QList ImageSortFilterModel::mapListToSource(const QList& indexes) const -+{ -+ QList sourceIndexes; -+ foreach(const QModelIndex& index, indexes) -+ { -+ sourceIndexes << mapToSourceImageModel(index); -+ } -+ return sourceIndexes; -+} -+ -+QList ImageSortFilterModel::mapListFromSource(const QList& sourceIndexes) const -+{ -+ QList indexes; -+ foreach(const QModelIndex& index, sourceIndexes) -+ { -+ indexes << mapFromSourceImageModel(index); -+ } -+ return indexes; -+} -+ -+ImageInfo ImageSortFilterModel::imageInfo(const QModelIndex& index) const -+{ -+ return sourceImageModel()->imageInfo(mapToSourceImageModel(index)); -+} -+ -+qlonglong ImageSortFilterModel::imageId(const QModelIndex& index) const -+{ -+ return sourceImageModel()->imageId(mapToSourceImageModel(index)); -+} -+ -+QList ImageSortFilterModel::imageInfos(const QList& indexes) const -+{ -+ QList infos; -+ ImageModel* const model = sourceImageModel(); -+ -+ foreach(const QModelIndex& index, indexes) -+ { -+ infos << model->imageInfo(mapToSourceImageModel(index)); -+ } -+ -+ return infos; -+} -+ -+QList ImageSortFilterModel::imageIds(const QList& indexes) const -+{ -+ QList ids; -+ ImageModel* const model = sourceImageModel(); -+ -+ foreach(const QModelIndex& index, indexes) -+ { -+ ids << model->imageId(mapToSourceImageModel(index)); -+ } -+ -+ return ids; -+} -+ -+QModelIndex ImageSortFilterModel::indexForPath(const QString& filePath) const -+{ -+ return mapFromSourceImageModel(sourceImageModel()->indexForPath(filePath)); -+} -+ -+QModelIndex ImageSortFilterModel::indexForImageInfo(const ImageInfo& info) const -+{ -+ return mapFromSourceImageModel(sourceImageModel()->indexForImageInfo(info)); -+} -+ -+QModelIndex ImageSortFilterModel::indexForImageId(qlonglong id) const -+{ -+ return mapFromSourceImageModel(sourceImageModel()->indexForImageId(id)); -+} -+ -+QList ImageSortFilterModel::imageInfosSorted() const -+{ -+ QList infos; -+ const int size = rowCount(); -+ ImageModel* const model = sourceImageModel(); -+ -+ for (int i=0; iimageInfo(mapToSourceImageModel(index(i, 0))); -+ } -+ -+ return infos; -+} -+ -+// -------------------------------------------------------------------------------------------- -+ -+ImageFilterModel::ImageFilterModel(QObject* parent) -+ : ImageSortFilterModel(parent), -+ d_ptr(new ImageFilterModelPrivate) -+{ -+ d_ptr->init(this); -+} -+ -+ImageFilterModel::ImageFilterModel(ImageFilterModelPrivate& dd, QObject* parent) -+ : ImageSortFilterModel(parent), -+ d_ptr(&dd) -+{ -+ d_ptr->init(this); -+} -+ -+ImageFilterModel::~ImageFilterModel() -+{ -+ Q_D(ImageFilterModel); -+ delete d; -+} -+ -+void ImageFilterModel::setDirectSourceImageModel(ImageModel* sourceModel) -+{ -+ Q_D(ImageFilterModel); -+ -+ if (d->imageModel) -+ { -+ d->imageModel->unsetPreprocessor(d); -+ disconnect(d->imageModel, SIGNAL(modelReset()), -+ this, SLOT(slotModelReset())); -+ slotModelReset(); -+ } -+ -+ d->imageModel = sourceModel; -+ -+ if (d->imageModel) -+ { -+ d->imageModel->setPreprocessor(d); -+ -+ connect(d->imageModel, SIGNAL(preprocess(QList,QList)), -+ d, SLOT(preprocessInfos(QList,QList))); -+ -+ connect(d->imageModel, SIGNAL(processAdded(QList,QList)), -+ d, SLOT(processAddedInfos(QList,QList))); -+ -+ connect(d, SIGNAL(reAddImageInfos(QList,QList)), -+ d->imageModel, SLOT(reAddImageInfos(QList,QList))); -+ -+ connect(d, SIGNAL(reAddingFinished()), -+ d->imageModel, SLOT(reAddingFinished())); -+ -+ connect(d->imageModel, SIGNAL(modelReset()), -+ this, SLOT(slotModelReset())); -+ -+ connect(d->imageModel, SIGNAL(imageChange(ImageChangeset,QItemSelection)), -+ this, SLOT(slotImageChange(ImageChangeset))); -+ -+ connect(d->imageModel, SIGNAL(imageTagChange(ImageTagChangeset,QItemSelection)), -+ this, SLOT(slotImageTagChange(ImageTagChangeset))); -+ } -+ -+ setSourceModel(d->imageModel); -+} -+ -+QVariant ImageFilterModel::data(const QModelIndex& index, int role) const -+{ -+ Q_D(const ImageFilterModel); -+ -+ if (!index.isValid()) -+ { -+ return QVariant(); -+ } -+ -+ switch (role) -+ { -+ // Attention: This breaks should there ever be another filter model between this and the ImageModel -+ -+ case DCategorizedSortFilterProxyModel::CategoryDisplayRole: -+ return categoryIdentifier(d->imageModel->imageInfoRef(mapToSource(index))); -+ case CategorizationModeRole: -+ return d->sorter.categorizationMode; -+ case SortOrderRole: -+ return d->sorter.sortRole; -+ //case CategoryCountRole: -+ // return categoryCount(d->imageModel->imageInfoRef(mapToSource(index))); -+ case CategoryAlbumIdRole: -+ return d->imageModel->imageInfoRef(mapToSource(index)).albumId(); -+ case CategoryFormatRole: -+ return d->imageModel->imageInfoRef(mapToSource(index)).format(); -+ case GroupIsOpenRole: -+ return d->groupFilter.isAllOpen() || -+ d->groupFilter.isOpen(d->imageModel->imageInfoRef(mapToSource(index)).id()); -+ case ImageFilterModelPointerRole: -+ return QVariant::fromValue(const_cast(this)); -+ } -+ -+ return DCategorizedSortFilterProxyModel::data(index, role); -+} -+ -+ImageFilterModel* ImageFilterModel::imageFilterModel() const -+{ -+ return const_cast(this); -+} -+ -+DatabaseFields::Set ImageFilterModel::suggestedWatchFlags() const -+{ -+ DatabaseFields::Set watchFlags; -+ watchFlags |= DatabaseFields::Name | DatabaseFields::FileSize | DatabaseFields::ModificationDate; -+ watchFlags |= DatabaseFields::Rating | DatabaseFields::CreationDate | DatabaseFields::Orientation | -+ DatabaseFields::Width | DatabaseFields::Height; -+ watchFlags |= DatabaseFields::Comment; -+ watchFlags |= DatabaseFields::ImageRelations; -+ return watchFlags; -+} -+ -+// -------------- Filter settings -------------- -+ -+void ImageFilterModel::setDayFilter(const QList& days) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setDayFilter(days); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setTagFilter(const QList& includedTags, const QList& excludedTags, -+ ImageFilterSettings::MatchingCondition matchingCond, -+ bool showUnTagged, const QList& clTagIds, const QList& plTagIds) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setTagFilter(includedTags, excludedTags, matchingCond, showUnTagged, clTagIds, plTagIds); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setRatingFilter(int rating, ImageFilterSettings::RatingCondition ratingCond, bool isUnratedExcluded) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setRatingFilter(rating, ratingCond, isUnratedExcluded); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setUrlWhitelist(const QList urlList, const QString& id) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setUrlWhitelist(urlList, id); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setIdWhitelist(const QList& idList, const QString& id) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setIdWhitelist(idList, id); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setMimeTypeFilter(int mimeTypeFilter) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setMimeTypeFilter(mimeTypeFilter); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setGeolocationFilter(const ImageFilterSettings::GeolocationCondition& condition) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setGeolocationFilter(condition); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setTextFilter(const SearchTextFilterSettings& settings) -+{ -+ Q_D(ImageFilterModel); -+ d->filter.setTextFilter(settings); -+ setImageFilterSettings(d->filter); -+} -+ -+void ImageFilterModel::setImageFilterSettings(const ImageFilterSettings& settings) -+{ -+ Q_D(ImageFilterModel); -+ -+ { -+ QMutexLocker lock(&d->mutex); -+ d->version++; -+ d->filter = settings; -+ d->filterCopy = settings; -+ d->versionFilterCopy = d->versionFilter; -+ d->groupFilterCopy = d->groupFilter; -+ -+ d->needPrepareComments = settings.isFilteringByText(); -+ d->needPrepareTags = settings.isFilteringByTags(); -+ d->needPrepareGroups = true; -+ d->needPrepare = d->needPrepareComments || d->needPrepareTags || d->needPrepareGroups; -+ -+ d->hasOneMatch = false; -+ d->hasOneMatchForText = false; -+ } -+ -+ d->filterResults.clear(); -+ -+ //d->categoryCountHashInt.clear(); -+ //d->categoryCountHashString.clear(); -+ if (d->imageModel) -+ { -+ d->infosToProcess(d->imageModel->imageInfos()); -+ } -+ -+ emit filterSettingsChanged(settings); -+} -+ -+void ImageFilterModel::setVersionManagerSettings(const VersionManagerSettings& settings) -+{ -+ Q_D(ImageFilterModel); -+ d->versionFilter.setVersionManagerSettings(settings); -+ setVersionImageFilterSettings(d->versionFilter); -+} -+ -+void ImageFilterModel::setExceptionList(const QList& idList, const QString& id) -+{ -+ Q_D(ImageFilterModel); -+ d->versionFilter.setExceptionList(idList, id); -+ setVersionImageFilterSettings(d->versionFilter); -+} -+ -+void ImageFilterModel::setVersionImageFilterSettings(const VersionImageFilterSettings& settings) -+{ -+ Q_D(ImageFilterModel); -+ d->versionFilter = settings; -+ slotUpdateFilter(); -+} -+ -+bool ImageFilterModel::isGroupOpen(qlonglong group) const -+{ -+ Q_D(const ImageFilterModel); -+ return d->groupFilter.isOpen(group); -+} -+ -+bool ImageFilterModel::isAllGroupsOpen() const -+{ -+ Q_D(const ImageFilterModel); -+ return d->groupFilter.isAllOpen(); -+} -+ -+void ImageFilterModel::setGroupOpen(qlonglong group, bool open) -+{ -+ Q_D(ImageFilterModel); -+ d->groupFilter.setOpen(group, open); -+ setGroupImageFilterSettings(d->groupFilter); -+} -+ -+void ImageFilterModel::toggleGroupOpen(qlonglong group) -+{ -+ setGroupOpen(group, !isGroupOpen(group)); -+} -+ -+void ImageFilterModel::setAllGroupsOpen(bool open) -+{ -+ Q_D(ImageFilterModel); -+ d->groupFilter.setAllOpen(open); -+ setGroupImageFilterSettings(d->groupFilter); -+} -+ -+void ImageFilterModel::setGroupImageFilterSettings(const GroupImageFilterSettings& settings) -+{ -+ Q_D(ImageFilterModel); -+ d->groupFilter = settings; -+ slotUpdateFilter(); -+} -+ -+void ImageFilterModel::slotUpdateFilter() -+{ -+ Q_D(ImageFilterModel); -+ setImageFilterSettings(d->filter); -+} -+ -+ImageFilterSettings ImageFilterModel::imageFilterSettings() const -+{ -+ Q_D(const ImageFilterModel); -+ return d->filter; -+} -+ -+ImageSortSettings ImageFilterModel::imageSortSettings() const -+{ -+ Q_D(const ImageFilterModel); -+ return d->sorter; -+} -+ -+VersionImageFilterSettings ImageFilterModel::versionImageFilterSettings() const -+{ -+ Q_D(const ImageFilterModel); -+ return d->versionFilter; -+} -+ -+GroupImageFilterSettings ImageFilterModel::groupImageFilterSettings() const -+{ -+ Q_D(const ImageFilterModel); -+ return d->groupFilter; -+} -+ -+void ImageFilterModel::slotModelReset() -+{ -+ Q_D(ImageFilterModel); -+ { -+ QMutexLocker lock(&d->mutex); -+ // discard all packages on the way that are marked as send out for re-add -+ d->lastDiscardVersion = d->version; -+ d->sentOutForReAdd = 0; -+ // discard all packages on the way -+ d->version++; -+ d->sentOut = 0; -+ -+ d->hasOneMatch = false; -+ d->hasOneMatchForText = false; -+ } -+ d->filterResults.clear(); -+} -+ -+bool ImageFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const -+{ -+ Q_D(const ImageFilterModel); -+ -+ if (source_parent.isValid()) -+ { -+ return false; -+ } -+ -+ qlonglong id = d->imageModel->imageId(source_row); -+ QHash::const_iterator it = d->filterResults.constFind(id); -+ -+ if (it != d->filterResults.constEnd()) -+ { -+ return it.value(); -+ } -+ -+ // usually done in thread and cache, unless source model changed -+ ImageInfo info = d->imageModel->imageInfo(source_row); -+ bool match = d->filter.matches(info); -+ match = match ? d->versionFilter.matches(info) : false; -+ -+ return match ? d->groupFilter.matches(info) : false; -+} -+ -+void ImageFilterModel::setSendImageInfoSignals(bool sendSignals) -+{ -+ if (sendSignals) -+ { -+ connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), -+ this, SLOT(slotRowsInserted(QModelIndex,int,int))); -+ -+ connect(this, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), -+ this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); -+ } -+ else -+ { -+ disconnect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), -+ this, SLOT(slotRowsInserted(QModelIndex,int,int))); -+ -+ disconnect(this, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), -+ this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); -+ } -+} -+ -+void ImageFilterModel::slotRowsInserted(const QModelIndex& /*parent*/, int start, int end) -+{ -+ QList infos; -+ -+ for (int i=start; i<=end; ++i) -+ { -+ infos << imageInfo(index(i, 0)); -+ } -+ -+ emit imageInfosAdded(infos); -+} -+ -+void ImageFilterModel::slotRowsAboutToBeRemoved(const QModelIndex& /*parent*/, int start, int end) -+{ -+ QList infos; -+ -+ for (int i=start; i<=end; ++i) -+ { -+ infos << imageInfo(index(i, 0)); -+ } -+ -+ emit imageInfosAboutToBeRemoved(infos); -+} -+ -+// -------------- Threaded preparation & filtering -------------- -+ -+void ImageFilterModel::addPrepareHook(ImageFilterModelPrepareHook* hook) -+{ -+ Q_D(ImageFilterModel); -+ QMutexLocker lock(&d->mutex); -+ d->prepareHooks << hook; -+} -+ -+void ImageFilterModel::removePrepareHook(ImageFilterModelPrepareHook* hook) -+{ -+ Q_D(ImageFilterModel); -+ QMutexLocker lock(&d->mutex); -+ d->prepareHooks.removeAll(hook); -+} -+ -+void ImageFilterModelPreparer::process(ImageFilterModelTodoPackage package) -+{ -+ if (!checkVersion(package)) -+ { -+ emit discarded(package); -+ return; -+ } -+ -+ // get thread-local copy -+ bool needPrepareTags, needPrepareComments, needPrepareGroups; -+ QList prepareHooks; -+ { -+ QMutexLocker lock(&d->mutex); -+ needPrepareTags = d->needPrepareTags; -+ needPrepareComments = d->needPrepareComments; -+ needPrepareGroups = d->needPrepareGroups; -+ prepareHooks = d->prepareHooks; -+ } -+ -+ //TODO: Make efficient!! -+ if (needPrepareComments) -+ { -+ foreach(const ImageInfo& info, package.infos) -+ { -+ info.comment(); -+ } -+ } -+ -+ if (!checkVersion(package)) -+ { -+ emit discarded(package); -+ return; -+ } -+ -+ // The downside of QVector: At some point, we may need a QList for an API. -+ // Nonetheless, QList and ImageInfo is fast. We could as well -+ // reimplement ImageInfoList to ImageInfoVector (internally with templates?) -+ ImageInfoList infoList; -+ -+ if (needPrepareTags || needPrepareGroups) -+ { -+ infoList = package.infos.toList(); -+ } -+ -+ if (needPrepareTags) -+ { -+ infoList.loadTagIds(); -+ } -+ -+ if (needPrepareGroups) -+ { -+ infoList.loadGroupImageIds(); -+ } -+ -+ foreach(ImageFilterModelPrepareHook* hook, prepareHooks) -+ { -+ hook->prepare(package.infos); -+ } -+ -+ emit processed(package); -+} -+ -+void ImageFilterModelFilterer::process(ImageFilterModelTodoPackage package) -+{ -+ if (!checkVersion(package)) -+ { -+ emit discarded(package); -+ return; -+ } -+ -+ // get thread-local copy -+ ImageFilterSettings localFilter; -+ VersionImageFilterSettings localVersionFilter; -+ GroupImageFilterSettings localGroupFilter; -+ bool hasOneMatch; -+ bool hasOneMatchForText; -+ { -+ QMutexLocker lock(&d->mutex); -+ localFilter = d->filterCopy; -+ localVersionFilter = d->versionFilterCopy; -+ localGroupFilter = d->groupFilterCopy; -+ hasOneMatch = d->hasOneMatch; -+ hasOneMatchForText = d->hasOneMatchForText; -+ } -+ -+ // Actual filtering. The variants to spare checking hasOneMatch over and over again. -+ if (hasOneMatch && hasOneMatchForText) -+ { -+ foreach(const ImageInfo& info, package.infos) -+ { -+ package.filterResults[info.id()] = localFilter.matches(info) && -+ localVersionFilter.matches(info) && -+ localGroupFilter.matches(info); -+ } -+ } -+ else if (hasOneMatch) -+ { -+ bool matchForText; -+ -+ foreach(const ImageInfo& info, package.infos) -+ { -+ package.filterResults[info.id()] = localFilter.matches(info, &matchForText) && -+ localVersionFilter.matches(info) && -+ localGroupFilter.matches(info); -+ -+ if (matchForText) -+ { -+ hasOneMatchForText = true; -+ } -+ } -+ } -+ else -+ { -+ bool result, matchForText; -+ -+ foreach(const ImageInfo& info, package.infos) -+ { -+ result = localFilter.matches(info, &matchForText) && -+ localVersionFilter.matches(info) && -+ localGroupFilter.matches(info); -+ package.filterResults[info.id()] = result; -+ -+ if (result) -+ { -+ hasOneMatch = true; -+ } -+ -+ if (matchForText) -+ { -+ hasOneMatchForText = true; -+ } -+ } -+ } -+ -+ if (checkVersion(package)) -+ { -+ QMutexLocker lock(&d->mutex); -+ d->hasOneMatch = hasOneMatch; -+ d->hasOneMatchForText = hasOneMatchForText; -+ } -+ -+ emit processed(package); -+} -+ -+// -------------- Sorting and Categorization ------------------------------------------------------- -+ -+void ImageFilterModel::setImageSortSettings(const ImageSortSettings& sorter) -+{ -+ Q_D(ImageFilterModel); -+ d->sorter = sorter; -+ setCategorizedModel(d->sorter.categorizationMode != ImageSortSettings::NoCategories); -+ invalidate(); -+} -+ -+void ImageFilterModel::setCategorizationMode(ImageSortSettings::CategorizationMode mode) -+{ -+ Q_D(ImageFilterModel); -+ d->sorter.setCategorizationMode(mode); -+ setImageSortSettings(d->sorter); -+} -+ -+void ImageFilterModel::setCategorizationSortOrder(ImageSortSettings::SortOrder order) -+{ -+ Q_D(ImageFilterModel); -+ d->sorter.setCategorizationSortOrder(order); -+ setImageSortSettings(d->sorter); -+} -+ -+void ImageFilterModel::setSortRole(ImageSortSettings::SortRole role) -+{ -+ Q_D(ImageFilterModel); -+ d->sorter.setSortRole(role); -+ setImageSortSettings(d->sorter); -+} -+ -+void ImageFilterModel::setSortOrder(ImageSortSettings::SortOrder order) -+{ -+ Q_D(ImageFilterModel); -+ d->sorter.setSortOrder(order); -+ setImageSortSettings(d->sorter); -+} -+ -+void ImageFilterModel::setStringTypeNatural(bool natural) -+{ -+ Q_D(ImageFilterModel); -+ d->sorter.setStringTypeNatural(natural); -+ setImageSortSettings(d->sorter); -+} -+ -+int ImageFilterModel::compareCategories(const QModelIndex& left, const QModelIndex& right) const -+{ -+ // source indexes -+ Q_D(const ImageFilterModel); -+ -+ if (!d->sorter.isCategorized()) -+ { -+ return 0; -+ } -+ -+ if (!left.isValid() || !right.isValid()) -+ { -+ return -1; -+ } -+ -+ const ImageInfo& leftInfo = d->imageModel->imageInfoRef(left); -+ const ImageInfo& rightInfo = d->imageModel->imageInfoRef(right); -+ -+ // Check grouping -+ qlonglong leftGroupImageId = leftInfo.groupImageId(); -+ qlonglong rightGroupImageId = rightInfo.groupImageId(); -+ -+ return compareInfosCategories(leftGroupImageId == -1 ? leftInfo : ImageInfo(leftGroupImageId), -+ rightGroupImageId == -1 ? rightInfo : ImageInfo(rightGroupImageId)); -+} -+ -+bool ImageFilterModel::subSortLessThan(const QModelIndex& left, const QModelIndex& right) const -+{ -+ // source indexes -+ Q_D(const ImageFilterModel); -+ -+ if (!left.isValid() || !right.isValid()) -+ { -+ return true; -+ } -+ -+ if (left == right) -+ { -+ return false; -+ } -+ -+ const ImageInfo& leftInfo = d->imageModel->imageInfoRef(left); -+ const ImageInfo& rightInfo = d->imageModel->imageInfoRef(right); -+ -+ if (leftInfo == rightInfo) -+ { -+ return d->sorter.lessThan(left.data(ImageModel::ExtraDataRole), right.data(ImageModel::ExtraDataRole)); -+ } -+ -+ // Check grouping -+ qlonglong leftGroupImageId = leftInfo.groupImageId(); -+ qlonglong rightGroupImageId = rightInfo.groupImageId(); -+ -+ // Either no grouping (-1), or same group image, or same image -+ if (leftGroupImageId == rightGroupImageId) -+ { -+ return infosLessThan(leftInfo, rightInfo); -+ } -+ -+ // We have grouping to handle -+ -+ // Is one grouped on the other? Sort behind leader. -+ if (leftGroupImageId == rightInfo.id()) -+ { -+ return false; -+ } -+ if (rightGroupImageId == leftInfo.id()) -+ { -+ return true; -+ } -+ -+ // Use the group leader for sorting -+ return infosLessThan(leftGroupImageId == -1 ? leftInfo : ImageInfo(leftGroupImageId), -+ rightGroupImageId == -1 ? rightInfo : ImageInfo(rightGroupImageId)); -+} -+ -+int ImageFilterModel::compareInfosCategories(const ImageInfo& left, const ImageInfo& right) const -+{ -+ // Note: reimplemented in ImageAlbumFilterModel -+ Q_D(const ImageFilterModel); -+ return d->sorter.compareCategories(left, right); -+} -+ -+// Feel free to optimize. QString::number is 3x slower. -+static inline QString fastNumberToString(int id) -+{ -+ const int size = sizeof(int) * 2; -+ char c[size+1]; -+ c[size] = '\0'; -+ char* p = c; -+ int number = id; -+ -+ for (int i=0; i>= 4; -+ ++p; -+ } -+ -+ return QString::fromLatin1(c); -+} -+ -+QString ImageFilterModel::categoryIdentifier(const ImageInfo& i) const -+{ -+ Q_D(const ImageFilterModel); -+ -+ if (!d->sorter.isCategorized()) -+ { -+ return QString(); -+ } -+ -+ qlonglong groupedImageId = i.groupImageId(); -+ ImageInfo info = groupedImageId == -1 ? i : ImageInfo(groupedImageId); -+ -+ switch (d->sorter.categorizationMode) -+ { -+ case ImageSortSettings::NoCategories: -+ return QString(); -+ case ImageSortSettings::OneCategory: -+ return QString(); -+ case ImageSortSettings::CategoryByAlbum: -+ return fastNumberToString(info.albumId()); -+ case ImageSortSettings::CategoryByFormat: -+ return info.format(); -+ default: -+ return QString(); -+ } -+} -+ -+bool ImageFilterModel::infosLessThan(const ImageInfo& left, const ImageInfo& right) const -+{ -+ Q_D(const ImageFilterModel); -+ return d->sorter.lessThan(left, right); -+} -+ -+// -------------- Watching changes ----------------------------------------------------------------- -+ -+void ImageFilterModel::slotImageTagChange(const ImageTagChangeset& changeset) -+{ -+ Q_D(ImageFilterModel); -+ -+ if (!d->imageModel || d->imageModel->isEmpty()) -+ { -+ return; -+ } -+ -+ // already scheduled to re-filter? -+ if (d->updateFilterTimer->isActive()) -+ { -+ return; -+ } -+ -+ // do we filter at all? -+ if (!d->versionFilter.isFilteringByTags() && -+ !d->filter.isFilteringByTags() && -+ !d->filter.isFilteringByText()) -+ { -+ return; -+ } -+ -+ // is one of our images affected? -+ foreach(const qlonglong& id, changeset.ids()) -+ { -+ // if one matching image id is found, trigger a refresh -+ if (d->imageModel->hasImage(id)) -+ { -+ d->updateFilterTimer->start(); -+ return; -+ } -+ } -+} -+ -+void ImageFilterModel::slotImageChange(const ImageChangeset& changeset) -+{ -+ Q_D(ImageFilterModel); -+ -+ if (!d->imageModel || d->imageModel->isEmpty()) -+ { -+ return; -+ } -+ -+ // already scheduled to re-filter? -+ if (d->updateFilterTimer->isActive()) -+ { -+ return; -+ } -+ -+ // is one of the values affected that we filter or sort by? -+ DatabaseFields::Set set = changeset.changes(); -+ bool sortAffected = (set & d->sorter.watchFlags()); -+ bool filterAffected = (set & d->filter.watchFlags()) || (set & d->groupFilter.watchFlags()); -+ -+ if (!sortAffected && !filterAffected) -+ { -+ return; -+ } -+ -+ // is one of our images affected? -+ bool imageAffected = false; -+ -+ foreach(const qlonglong& id, changeset.ids()) -+ { -+ // if one matching image id is found, trigger a refresh -+ if (d->imageModel->hasImage(id)) -+ { -+ imageAffected = true; -+ break; -+ } -+ } -+ -+ if (!imageAffected) -+ { -+ return; -+ } -+ -+ if (filterAffected) -+ { -+ d->updateFilterTimer->start(); -+ } -+ else -+ { -+ invalidate(); // just resort, reuse filter results -+ } -+} -+ -+// ------------------------------------------------------------------------------------------------------- -+ -+NoDuplicatesImageFilterModel::NoDuplicatesImageFilterModel(QObject* parent) -+ : ImageSortFilterModel(parent) -+{ -+} -+ -+bool NoDuplicatesImageFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const -+{ -+ QModelIndex index = sourceModel()->index(source_row, 0, source_parent); -+ -+ if (index.data(ImageModel::ExtraDataDuplicateCount).toInt() <= 1) -+ { -+ return true; -+ } -+ -+ QModelIndex previousIndex = sourceModel()->index(source_row - 1, 0, source_parent); -+ -+ if (!previousIndex.isValid()) -+ { -+ return true; -+ } -+ -+ if (sourceImageModel()->imageId(mapFromDirectSourceToSourceImageModel(index)) == sourceImageModel()->imageId(mapFromDirectSourceToSourceImageModel(previousIndex))) -+ { -+ return false; -+ } -+ return true; -+} -+ -+/* -+void NoDuplicatesImageFilterModel::setSourceModel(QAbstractItemModel* model) -+{ -+ if (sourceModel()) -+ { -+ } -+ -+ ImageSortFilterModel::setSourceModel(model); -+ -+ if (sourceModel()) -+ { -+ connect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), -+ this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); -+ } -+} -+ -+void NoDuplicatesImageFilterModel::slotRowsAboutToBeRemoved(const QModelIndex& parent, int begin, int end) -+{ -+ bool needInvalidate = false; -+ -+ for (int i = begin; i<=end; ++i) -+ { -+ QModelIndex index = sourceModel()->index(i, 0, parent); -+ -+ // filtered out by us? -+ if (!mapFromSource(index).isValid()) -+ { -+ continue; -+ } -+ -+ QModelIndex sourceIndex = mapFromDirectSourceToSourceImageModel(index); -+ qlonglong id = sourceImageModel()->imageId(sourceIndex); -+ -+ if (sourceImageModel()->numberOfIndexesForImageId(id) > 1) -+ { -+ needInvalidate = true; -+ } -+ } -+}*/ -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagefiltermodel.h b/libs/database/models/imagefiltermodel.h -new file mode 100644 -index 0000000..d131b3e ---- /dev/null -+++ b/libs/database/models/imagefiltermodel.h -@@ -0,0 +1,299 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011 by Gilles Caulier -+ * Copyright (C) 2010 by Andi Clemens -+ * Copyright (C) 2011 by Michael G. Hansen -+ * Copyright (C) 2014 by Mohamed Anwer -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGEFILTERMODEL_H -+#define IMAGEFILTERMODEL_H -+ -+// Local includes -+ -+#include "dcategorizedsortfilterproxymodel.h" -+#include "textfilter.h" -+#include "imagefiltersettings.h" -+#include "imagemodel.h" -+#include "imagesortsettings.h" -+#include "digikam_export.h" -+ -+namespace Digikam -+{ -+ -+class ImageChangeset; -+class ImageFilterModel; -+class ImageTagChangeset; -+ -+class DIGIKAM_DATABASE_EXPORT ImageFilterModelPrepareHook -+{ -+public: -+ -+ virtual ~ImageFilterModelPrepareHook() {}; -+ virtual void prepare(const QVector& infos) = 0; -+}; -+ -+// ----------------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT ImageSortFilterModel : public DCategorizedSortFilterProxyModel -+{ -+ Q_OBJECT -+ -+public: -+ -+ explicit ImageSortFilterModel(QObject* parent = 0); -+ -+ void setSourceImageModel(ImageModel* model); -+ ImageModel* sourceImageModel() const; -+ -+ void setSourceFilterModel(ImageSortFilterModel* model); -+ ImageSortFilterModel* sourceFilterModel() const; -+ -+ QModelIndex mapToSourceImageModel(const QModelIndex& index) const; -+ QModelIndex mapFromSourceImageModel(const QModelIndex& imagemodel_index) const; -+ QModelIndex mapFromDirectSourceToSourceImageModel(const QModelIndex& sourceModel_index) const; -+ -+ /// Convenience methods mapped to ImageModel. -+ /// Mentioned indexes returned come from the source image model. -+ QList mapListToSource(const QList& indexes) const; -+ QList mapListFromSource(const QList& sourceIndexes) const; -+ -+ ImageInfo imageInfo(const QModelIndex& index) const; -+ qlonglong imageId(const QModelIndex& index) const; -+ QList imageInfos(const QList& indexes) const; -+ QList imageIds(const QList& indexes) const; -+ -+ QModelIndex indexForPath(const QString& filePath) const; -+ QModelIndex indexForImageInfo(const ImageInfo& info) const; -+ QModelIndex indexForImageId(qlonglong id) const; -+ -+ /** Returns a list of all image infos, sorted according to this model. -+ * If you do not need a sorted list, use ImageModel's imageInfos() method. -+ */ -+ QList imageInfosSorted() const; -+ -+ /// Returns this, any chained ImageFilterModel, or 0. -+ virtual ImageFilterModel* imageFilterModel() const; -+ -+protected: -+ -+ /// Reimplement if needed. Called only when model shall be set as (direct) sourceModel. -+ virtual void setDirectSourceImageModel(ImageModel* model); -+ -+ // made protected -+ virtual void setSourceModel(QAbstractItemModel* model); -+ -+protected: -+ -+ ImageSortFilterModel* m_chainedModel; -+}; -+ -+// ----------------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT ImageFilterModel : public ImageSortFilterModel -+{ -+ Q_OBJECT -+ -+public: -+ -+ enum ImageFilterModelRoles -+ { -+ /// Returns the current categorization mode -+ CategorizationModeRole = ImageModel::FilterModelRoles + 1, -+ /// Returns the current sort order -+ SortOrderRole = ImageModel::FilterModelRoles + 2, -+ // / Returns the number of items in the index' category -+ //CategoryCountRole = ImageModel::FilterModelRoles + 3, -+ /// Returns the id of the PAlbum of the index which is used for category -+ CategoryAlbumIdRole = ImageModel::FilterModelRoles + 3, -+ /// Returns the format of the index which is used for category -+ CategoryFormatRole = ImageModel::FilterModelRoles + 4, -+ /// Returns true if the given image is a group leader, and the group is opened -+ GroupIsOpenRole = ImageModel::FilterModelRoles + 5, -+ ImageFilterModelPointerRole = ImageModel::FilterModelRoles + 50 -+ }; -+ -+public: -+ -+ explicit ImageFilterModel(QObject* parent = 0); -+ ~ImageFilterModel(); -+ -+ /** Add a hook to get added images for preparation tasks before they are added in the model */ -+ void addPrepareHook(ImageFilterModelPrepareHook* hook); -+ void removePrepareHook(ImageFilterModelPrepareHook* hook); -+ -+ /** Returns a set of DatabaseFields suggested to set as watch flags on the source ImageModel. -+ * The contained flags will be those that this model can sort or filter by. */ -+ DatabaseFields::Set suggestedWatchFlags() const; -+ -+ ImageFilterSettings imageFilterSettings() const; -+ VersionImageFilterSettings versionImageFilterSettings() const; -+ GroupImageFilterSettings groupImageFilterSettings() const; -+ ImageSortSettings imageSortSettings() const; -+ -+ // group is identified by the id of its group leader -+ bool isGroupOpen(qlonglong group) const; -+ bool isAllGroupsOpen() const; -+ -+ /// Enables sending imageInfosAdded and imageInfosAboutToBeRemoved -+ void setSendImageInfoSignals(bool sendSignals); -+ -+ virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -+ virtual ImageFilterModel* imageFilterModel() const; -+ -+public Q_SLOTS: -+ -+ /** Changes the current version image filter settings and refilters. */ -+ void setVersionImageFilterSettings(const VersionImageFilterSettings& settings); -+ -+ /** Changes the current version image filter settings and refilters. */ -+ void setGroupImageFilterSettings(const GroupImageFilterSettings& settings); -+ -+ /** Adjust the current ImageFilterSettings. -+ * Equivalent to retrieving the current filter settings, adjusting the parameter -+ * and calling setImageFilterSettings. -+ * Provided for convenience. -+ * It is encouraged to use setImageFilterSettings if you change more than one -+ * parameter at a time. -+ */ -+ void setDayFilter(const QList& days); -+ void setTagFilter(const QList& includedTags, const QList& excludedTags, -+ ImageFilterSettings::MatchingCondition matchingCond, bool showUnTagged, -+ const QList& clTagIds, const QList& plTagIds); -+ void setRatingFilter(int rating, ImageFilterSettings::RatingCondition ratingCond, bool isUnratedExcluded); -+ void setMimeTypeFilter(int mimeTypeFilter); -+ void setGeolocationFilter(const ImageFilterSettings::GeolocationCondition& condition); -+ void setTextFilter(const SearchTextFilterSettings& settings); -+ -+ void setCategorizationMode(ImageSortSettings::CategorizationMode mode); -+ void setCategorizationSortOrder(ImageSortSettings::SortOrder order); -+ void setSortRole(ImageSortSettings::SortRole role); -+ void setSortOrder(ImageSortSettings::SortOrder order); -+ void setStringTypeNatural(bool natural); -+ void setUrlWhitelist(const QList urlList, const QString& id); -+ void setIdWhitelist(const QList& idList, const QString& id); -+ -+ void setVersionManagerSettings(const VersionManagerSettings& settings); -+ void setExceptionList(const QList& idlist, const QString& id); -+ -+ void setGroupOpen(qlonglong group, bool open); -+ void toggleGroupOpen(qlonglong group); -+ void setAllGroupsOpen(bool open); -+ -+ /** Changes the current image filter settings and refilters. */ -+ virtual void setImageFilterSettings(const ImageFilterSettings& settings); -+ -+ /** Changes the current image sort settings and resorts. */ -+ virtual void setImageSortSettings(const ImageSortSettings& settings); -+ -+Q_SIGNALS: -+ -+ /// Signals that the set filter matches at least one index -+ void filterMatches(bool matches); -+ -+ /** Signals that the set text filter matches at least one entry. -+ If no text filter is set, this signal is emitted -+ with 'false' when filterMatches() is emitted. -+ */ -+ void filterMatchesForText(bool matchesByText); -+ -+ /** Emitted when the filter settings have been changed -+ (the model may not yet have been updated) -+ */ -+ void filterSettingsChanged(const ImageFilterSettings& settings); -+ -+ /** These signals need to be explicitly enabled with setSendImageInfoSignals() -+ */ -+ void imageInfosAdded(const QList& infos); -+ void imageInfosAboutToBeRemoved(const QList& infos); -+ -+public: -+ -+ // Declared as public because of use in sub-classes. -+ class ImageFilterModelPrivate; -+ -+protected: -+ -+ ImageFilterModelPrivate* const d_ptr; -+ -+protected: -+ -+ ImageFilterModel(ImageFilterModelPrivate& dd, QObject* parent); -+ -+ virtual void setDirectSourceImageModel(ImageModel* model); -+ -+ virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; -+ -+ virtual int compareCategories(const QModelIndex& left, const QModelIndex& right) const; -+ virtual bool subSortLessThan(const QModelIndex& left, const QModelIndex& right) const; -+ //virtual int categoryCount(const ImageInfo& info) const; -+ -+ /** Reimplement to customize category sorting, -+ * Return negative if category of left < category right, -+ * Return 0 if left and right are in the same category, else return positive. -+ */ -+ virtual int compareInfosCategories(const ImageInfo& left, const ImageInfo& right) const; -+ -+ /** Reimplement to customize sorting. Do not take categories into account here. -+ */ -+ virtual bool infosLessThan(const ImageInfo& left, const ImageInfo& right) const; -+ -+ /** Returns a unique identifier for the category if info. The string need not be for user display. -+ */ -+ virtual QString categoryIdentifier(const ImageInfo& info) const; -+ -+protected Q_SLOTS: -+ -+ void slotModelReset(); -+ void slotUpdateFilter(); -+ -+ void slotImageTagChange(const ImageTagChangeset& changeset); -+ void slotImageChange(const ImageChangeset& changeset); -+ -+ void slotRowsInserted(const QModelIndex& parent, int start, int end); -+ void slotRowsAboutToBeRemoved(const QModelIndex& parent, int start, int end); -+ -+private: -+ -+ Q_DECLARE_PRIVATE(ImageFilterModel) -+}; -+ -+// ----------------------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT NoDuplicatesImageFilterModel : public ImageSortFilterModel -+{ -+ Q_OBJECT -+ -+public: -+ -+ explicit NoDuplicatesImageFilterModel(QObject* parent = 0); -+ -+protected: -+ -+ virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; -+}; -+ -+} // namespace Digikam -+ -+Q_DECLARE_METATYPE(Digikam::ImageFilterModel*) -+ -+#endif // IMAGEMODEL_H -diff --git a/libs/database/models/imagefiltermodelpriv.cpp b/libs/database/models/imagefiltermodelpriv.cpp -new file mode 100644 -index 0000000..07d9e79 ---- /dev/null -+++ b/libs/database/models/imagefiltermodelpriv.cpp -@@ -0,0 +1,258 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011-2017 by Gilles Caulier -+ * Copyright (C) 2010 by Andi Clemens -+ * Copyright (C) 2011 by Michael G. Hansen -+ * Copyright (C) 2014 by Mohamed Anwer -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagefiltermodelpriv.h" -+ -+// Local includes -+ -+#include "digikam_debug.h" -+#include "imagefiltermodelthreads.h" -+ -+namespace Digikam -+{ -+ -+ImageFilterModel::ImageFilterModelPrivate::ImageFilterModelPrivate() -+{ -+ imageModel = 0; -+ version = 0; -+ lastDiscardVersion = 0; -+ sentOut = 0; -+ sentOutForReAdd = 0; -+ updateFilterTimer = 0; -+ needPrepare = false; -+ needPrepareComments = false; -+ needPrepareTags = false; -+ needPrepareGroups = false; -+ preparer = 0; -+ filterer = 0; -+ hasOneMatch = false; -+ hasOneMatchForText = false; -+ -+ setupWorkers(); -+} -+ -+ImageFilterModel::ImageFilterModelPrivate::~ImageFilterModelPrivate() -+{ -+ // facilitate thread stopping -+ ++version; -+ preparer->deactivate(); -+ filterer->deactivate(); -+ delete preparer; -+ delete filterer; -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::init(ImageFilterModel* _q) -+{ -+ q = _q; -+ -+ updateFilterTimer = new QTimer(this); -+ updateFilterTimer->setSingleShot(true); -+ updateFilterTimer->setInterval(250); -+ -+ connect(updateFilterTimer, SIGNAL(timeout()), -+ q, SLOT(slotUpdateFilter())); -+ -+ // inter-thread redirection -+ qRegisterMetaType("ImageFilterModelTodoPackage"); -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::preprocessInfos(const QList& infos, const QList& extraValues) -+{ -+ infosToProcess(infos, extraValues, true); -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::processAddedInfos(const QList& infos, const QList& extraValues) -+{ -+ // These have already been added, we just process them afterwards -+ infosToProcess(infos, extraValues, false); -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::setupWorkers() -+{ -+ preparer = new ImageFilterModelPreparer(this); -+ filterer = new ImageFilterModelFilterer(this); -+ -+ // A package in constructed in infosToProcess. -+ // Normal flow is infosToProcess -> preparer::process -> filterer::process -> packageFinished. -+ // If no preparation is needed, the first step is skipped. -+ // If filter version changes, both will discard old package and send them to packageDiscarded. -+ -+ connect(this, SIGNAL(packageToPrepare(ImageFilterModelTodoPackage)), -+ preparer, SLOT(process(ImageFilterModelTodoPackage))); -+ -+ connect(this, SIGNAL(packageToFilter(ImageFilterModelTodoPackage)), -+ filterer, SLOT(process(ImageFilterModelTodoPackage))); -+ -+ connect(preparer, SIGNAL(processed(ImageFilterModelTodoPackage)), -+ filterer, SLOT(process(ImageFilterModelTodoPackage))); -+ -+ connect(filterer, SIGNAL(processed(ImageFilterModelTodoPackage)), -+ this, SLOT(packageFinished(ImageFilterModelTodoPackage))); -+ -+ connect(preparer, SIGNAL(discarded(ImageFilterModelTodoPackage)), -+ this, SLOT(packageDiscarded(ImageFilterModelTodoPackage))); -+ -+ connect(filterer, SIGNAL(discarded(ImageFilterModelTodoPackage)), -+ this, SLOT(packageDiscarded(ImageFilterModelTodoPackage))); -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::infosToProcess(const QList& infos) -+{ -+ infosToProcess(infos, QList(), false); -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::infosToProcess(const QList& infos, const QList& extraValues, bool forReAdd) -+{ -+ if (infos.isEmpty()) -+ { -+ return; -+ } -+ -+ filterer->schedule(); -+ -+ if (needPrepare) -+ { -+ preparer->schedule(); -+ } -+ -+ Q_ASSERT(extraValues.isEmpty() || infos.size() == extraValues.size()); -+ -+ // prepare and filter in chunks -+ const int size = infos.size(); -+ const int maxChunkSize = needPrepare ? PrepareChunkSize : FilterChunkSize; -+ const bool hasExtraValues = !extraValues.isEmpty(); -+ QList::const_iterator it = infos.constBegin(), end; -+ QList::const_iterator xit = extraValues.constBegin(), xend; -+ int index = 0; -+ QVector infoVector; -+ QVector extraValueVector; -+ -+ while (it != infos.constEnd()) -+ { -+ const int chunkSize = qMin(maxChunkSize, size - index); -+ infoVector.resize(chunkSize); -+ end = it + chunkSize; -+ qCopy(it, end, infoVector.begin()); -+ -+ if (hasExtraValues) -+ { -+ extraValueVector.resize(chunkSize); -+ xend = xit + chunkSize; -+ qCopy(xit, xend, extraValueVector.begin()); -+ xit = xend; -+ } -+ -+ it = end; -+ index += chunkSize; -+ -+ ++sentOut; -+ -+ if (forReAdd) -+ { -+ ++sentOutForReAdd; -+ } -+ -+ if (needPrepare) -+ { -+ emit packageToPrepare(ImageFilterModelTodoPackage(infoVector, extraValueVector, version, forReAdd)); -+ } -+ else -+ { -+ emit packageToFilter(ImageFilterModelTodoPackage(infoVector, extraValueVector, version, forReAdd)); -+ } -+ } -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::packageFinished(const ImageFilterModelTodoPackage& package) -+{ -+ // check if it got discarded on the journey -+ if (package.version != version) -+ { -+ packageDiscarded(package); -+ return; -+ } -+ -+ // incorporate result -+ QHash::const_iterator it = package.filterResults.constBegin(); -+ -+ for (; it != package.filterResults.constEnd(); ++it) -+ { -+ filterResults.insert(it.key(), it.value()); -+ } -+ -+ // re-add if necessary -+ if (package.isForReAdd) -+ { -+ emit reAddImageInfos(package.infos.toList(), package.extraValues.toList()); -+ -+ if (sentOutForReAdd == 1) // last package -+ { -+ emit reAddingFinished(); -+ } -+ } -+ -+ // decrement counters -+ --sentOut; -+ -+ if (package.isForReAdd) -+ { -+ --sentOutForReAdd; -+ } -+ -+ // If all packages have returned, filtered and readded, and no more are expected, -+ // and there is need to tell the filter result to the view, do that -+ if (sentOut == 0 && sentOutForReAdd == 0 && !imageModel->isRefreshing()) -+ { -+ q->invalidate(); // use invalidate, not invalidateFilter only. Sorting may have changed as well. -+ emit (q->filterMatches(hasOneMatch)); -+ emit (q->filterMatchesForText(hasOneMatchForText)); -+ filterer->deactivate(); -+ preparer->deactivate(); -+ } -+} -+ -+void ImageFilterModel::ImageFilterModelPrivate::packageDiscarded(const ImageFilterModelTodoPackage& package) -+{ -+ // Either, the model was reset, or the filter changed -+ // In the former case throw all away, in the latter case, recycle -+ if (package.version > lastDiscardVersion) -+ { -+ // Recycle packages: Send again with current version -+ // Do not increment sentOut or sentOutForReAdd here: it was not decremented! -+ -+ if (needPrepare) -+ { -+ emit packageToPrepare(ImageFilterModelTodoPackage(package.infos, package.extraValues, version, package.isForReAdd)); -+ } -+ else -+ { -+ emit packageToFilter(ImageFilterModelTodoPackage(package.infos, package.extraValues, version, package.isForReAdd)); -+ } -+ } -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagefiltermodelpriv.h b/libs/database/models/imagefiltermodelpriv.h -new file mode 100644 -index 0000000..a9e3f22 ---- /dev/null -+++ b/libs/database/models/imagefiltermodelpriv.h -@@ -0,0 +1,159 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-11 -+ * Description : Qt item model for database entries - private shared header -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGEFILTERMODELPRIV_H -+#define IMAGEFILTERMODELPRIV_H -+ -+// Qt includes -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+// Local includes -+ -+#include "imageinfo.h" -+#include "imagefiltermodel.h" -+ -+#include "digikam_export.h" -+// Yes, we need the EXPORT macro in a private header because -+// this private header is shared across binary objects. -+// This does NOT make this classes here any more public! -+ -+namespace Digikam -+{ -+ -+const int PrepareChunkSize = 101; -+const int FilterChunkSize = 2001; -+ -+class ImageFilterModelTodoPackage -+{ -+public: -+ -+ ImageFilterModelTodoPackage() -+ : version(0), isForReAdd(false) -+ { -+ } -+ -+ ImageFilterModelTodoPackage(const QVector& infos, const QVector& extraValues, int version, bool isForReAdd) -+ : infos(infos), extraValues(extraValues), version(version), isForReAdd(isForReAdd) -+ { -+ } -+ -+ QVector infos; -+ QVector extraValues; -+ unsigned int version; -+ bool isForReAdd; -+ QHash filterResults; -+}; -+ -+// ------------------------------------------------------------------------------------------------ -+ -+class ImageFilterModelPreparer; -+class ImageFilterModelFilterer; -+ -+class DIGIKAM_DATABASE_EXPORT ImageFilterModel::ImageFilterModelPrivate : public QObject -+{ -+ Q_OBJECT -+ -+public: -+ -+ ImageFilterModelPrivate(); -+ ~ImageFilterModelPrivate(); -+ -+ void init(ImageFilterModel* q); -+ void setupWorkers(); -+ void infosToProcess(const QList& infos); -+ void infosToProcess(const QList& infos, const QList& extraValues, bool forReAdd = true); -+ -+public: -+ -+ ImageFilterModel* q; -+ -+ ImageModel* imageModel; -+ -+ ImageFilterSettings filter; -+ ImageSortSettings sorter; -+ VersionImageFilterSettings versionFilter; -+ GroupImageFilterSettings groupFilter; -+ -+ volatile unsigned int version; -+ unsigned int lastDiscardVersion; -+ unsigned int lastFilteredVersion; -+ int sentOut; -+ int sentOutForReAdd; -+ -+ QTimer* updateFilterTimer; -+ -+ bool needPrepare; -+ bool needPrepareComments; -+ bool needPrepareTags; -+ bool needPrepareGroups; -+ -+ QMutex mutex; -+ ImageFilterSettings filterCopy; -+ VersionImageFilterSettings versionFilterCopy; -+ GroupImageFilterSettings groupFilterCopy; -+ ImageFilterModelPreparer* preparer; -+ ImageFilterModelFilterer* filterer; -+ -+ QHash filterResults; -+ bool hasOneMatch; -+ bool hasOneMatchForText; -+ -+ QList prepareHooks; -+ -+/* -+ QHash > categoryCountHashInt; -+ QHash > categoryCountHashString; -+ -+public: -+ -+ void cacheCategoryCount(int id, qlonglong imageid) const -+ { const_cast(this)->categoryCountHashInt[id].insert(imageid); } -+ void cacheCategoryCount(const QString& id, qlonglong imageid) const -+ { const_cast(this)->categoryCountHashString[id].insert(imageid); } -+*/ -+ -+public Q_SLOTS: -+ -+ void preprocessInfos(const QList& infos, const QList& extraValues); -+ void processAddedInfos(const QList& infos, const QList& extraValues); -+ void packageFinished(const ImageFilterModelTodoPackage& package); -+ void packageDiscarded(const ImageFilterModelTodoPackage& package); -+ -+Q_SIGNALS: -+ -+ void packageToPrepare(const ImageFilterModelTodoPackage& package); -+ void packageToFilter(const ImageFilterModelTodoPackage& package); -+ void reAddImageInfos(const QList& infos, const QList& extraValues); -+ void reAddingFinished(); -+}; -+ -+} // namespace Digikam -+ -+#endif // IMAGEFILTERMODELPRIV_H -diff --git a/libs/database/models/imagefiltermodelthreads.cpp b/libs/database/models/imagefiltermodelthreads.cpp -new file mode 100644 -index 0000000..aa5c462 ---- /dev/null -+++ b/libs/database/models/imagefiltermodelthreads.cpp -@@ -0,0 +1,40 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011-2017 by Gilles Caulier -+ * Copyright (C) 2010 by Andi Clemens -+ * Copyright (C) 2011 by Michael G. Hansen -+ * Copyright (C) 2014 by Mohamed Anwer -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagefiltermodel.h" -+#include "imagefiltermodelpriv.h" -+#include "imagefiltermodelthreads.h" -+ -+namespace Digikam -+{ -+ -+ImageFilterModelWorker::ImageFilterModelWorker(ImageFilterModel::ImageFilterModelPrivate* const d) -+ : d(d) -+{ -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagefiltermodelthreads.h b/libs/database/models/imagefiltermodelthreads.h -new file mode 100644 -index 0000000..83fa987 ---- /dev/null -+++ b/libs/database/models/imagefiltermodelthreads.h -@@ -0,0 +1,100 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-11 -+ * Description : Qt item model for database entries - private header -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGEFILTERMODELTHREADS_H -+#define IMAGEFILTERMODELTHREADS_H -+ -+// Qt includes -+ -+#include -+ -+// Local includes -+ -+#include "digikam_export.h" -+#include "workerobject.h" -+ -+namespace Digikam -+{ -+ -+class DIGIKAM_DATABASE_EXPORT ImageFilterModelWorker : public WorkerObject -+{ -+ Q_OBJECT -+ -+public: -+ -+ explicit ImageFilterModelWorker(ImageFilterModel::ImageFilterModelPrivate* const d); -+ -+ bool checkVersion(const ImageFilterModelTodoPackage& package) -+ { -+ return d->version == package.version; -+ } -+ -+public Q_SLOTS: -+ -+ virtual void process(ImageFilterModelTodoPackage package) = 0; -+ -+Q_SIGNALS: -+ -+ void processed(const ImageFilterModelTodoPackage& package); -+ void discarded(const ImageFilterModelTodoPackage& package); -+ -+protected: -+ -+ ImageFilterModel::ImageFilterModelPrivate* d; -+}; -+ -+// ----------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT ImageFilterModelPreparer : public ImageFilterModelWorker -+{ -+ Q_OBJECT -+ -+public: -+ -+ explicit ImageFilterModelPreparer(ImageFilterModel::ImageFilterModelPrivate* const d) -+ : ImageFilterModelWorker(d) -+ { -+ } -+ -+ void process(ImageFilterModelTodoPackage package); -+}; -+ -+// ---------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT ImageFilterModelFilterer : public ImageFilterModelWorker -+{ -+ Q_OBJECT -+ -+public: -+ -+ explicit ImageFilterModelFilterer(ImageFilterModel::ImageFilterModelPrivate* const d) -+ : ImageFilterModelWorker(d) -+ { -+ } -+ -+ void process(ImageFilterModelTodoPackage package); -+}; -+ -+} // namespace Digikam -+ -+#endif // IMAGEFILTERMODELTHREADS_H -diff --git a/libs/database/models/imagefiltersettings.cpp b/libs/database/models/imagefiltersettings.cpp -new file mode 100644 -index 0000000..b61e7f9 ---- /dev/null -+++ b/libs/database/models/imagefiltersettings.cpp -@@ -0,0 +1,952 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Filter values for use with ImageFilterModel -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011-2017 by Gilles Caulier -+ * Copyright (C) 2010 by Andi Clemens -+ * Copyright (C) 2011 by Michael G. Hansen -+ * Copyright (C) 2014 by Mohamed Anwer -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagefiltersettings.h" -+ -+// C++ includes -+ -+#include -+ -+// Qt includes -+ -+#include -+ -+// Local includes -+ -+#include "digikam_debug.h" -+#include "coredbfields.h" -+#include "digikam_globals.h" -+#include "imageinfo.h" -+#include "tagscache.h" -+#include "versionmanagersettings.h" -+ -+namespace Digikam -+{ -+ -+ImageFilterSettings::ImageFilterSettings() -+{ -+ m_untaggedFilter = false; -+ m_isUnratedExcluded = false; -+ m_ratingFilter = 0; -+ m_mimeTypeFilter = MimeFilter::AllFiles; -+ m_ratingCond = GreaterEqualCondition; -+ m_matchingCond = OrCondition; -+ m_geolocationCondition = GeolocationNoFilter; -+} -+ -+DatabaseFields::Set ImageFilterSettings::watchFlags() const -+{ -+ DatabaseFields::Set set; -+ -+ if (isFilteringByDay()) -+ { -+ set |= DatabaseFields::CreationDate; -+ } -+ -+ if (isFilteringByText()) -+ { -+ set |= DatabaseFields::Name; -+ set |= DatabaseFields::Comment; -+ } -+ -+ if (isFilteringByRating()) -+ { -+ set |= DatabaseFields::Rating; -+ } -+ -+ if (isFilteringByTypeMime()) -+ { -+ set |= DatabaseFields::Category; -+ set |= DatabaseFields::Format; -+ } -+ -+ if (isFilteringByGeolocation()) -+ { -+ set |= DatabaseFields::ImagePositionsAll; -+ } -+ -+ if (isFilteringByColorLabels()) -+ { -+ set |= DatabaseFields::ColorLabel; -+ } -+ -+ if (isFilteringByPickLabels()) -+ { -+ set |= DatabaseFields::PickLabel; -+ } -+ -+ return set; -+} -+ -+bool ImageFilterSettings::isFilteringByDay() const -+{ -+ if (!m_dayFilter.isEmpty()) -+ { -+ return true; -+ } -+ -+ return false; -+} -+ -+bool ImageFilterSettings::isFilteringByTags() const -+{ -+ if (!m_includeTagFilter.isEmpty() || !m_excludeTagFilter.isEmpty() || m_untaggedFilter) -+ { -+ return true; -+ } -+ -+ return false; -+} -+ -+bool ImageFilterSettings::isFilteringByColorLabels() const -+{ -+ if (!m_colorLabelTagFilter.isEmpty()) -+ { -+ return true; -+ } -+ -+ return false; -+} -+ -+bool ImageFilterSettings::isFilteringByPickLabels() const -+{ -+ if (!m_pickLabelTagFilter.isEmpty()) -+ { -+ return true; -+ } -+ -+ return false; -+} -+ -+bool ImageFilterSettings::isFilteringByText() const -+{ -+ if (!m_textFilterSettings.text.isEmpty()) -+ { -+ return true; -+ } -+ -+ return false; -+} -+ -+bool ImageFilterSettings::isFilteringByTypeMime() const -+{ -+ if (m_mimeTypeFilter != MimeFilter::AllFiles) -+ { -+ return true; -+ } -+ -+ return false; -+} -+ -+bool ImageFilterSettings::isFilteringByGeolocation() const -+{ -+ return (m_geolocationCondition != GeolocationNoFilter); -+} -+ -+bool ImageFilterSettings::isFilteringByRating() const -+{ -+ if (m_ratingFilter != 0 || m_ratingCond != GreaterEqualCondition || m_isUnratedExcluded) -+ { -+ return true; -+ } -+ -+ return false; -+} -+ -+bool ImageFilterSettings::isFilteringInternally() const -+{ -+ return (isFiltering() || !m_urlWhitelists.isEmpty() || !m_idWhitelists.isEmpty()); -+} -+ -+bool ImageFilterSettings::isFiltering() const -+{ -+ return isFilteringByDay() || -+ isFilteringByTags() || -+ isFilteringByText() || -+ isFilteringByRating() || -+ isFilteringByTypeMime() || -+ isFilteringByColorLabels() || -+ isFilteringByPickLabels() || -+ isFilteringByGeolocation(); -+} -+ -+void ImageFilterSettings::setDayFilter(const QList& days) -+{ -+ m_dayFilter.clear(); -+ -+ for (QList::const_iterator it = days.constBegin(); it != days.constEnd(); ++it) -+ { -+ m_dayFilter.insert(*it, true); -+ } -+} -+ -+void ImageFilterSettings::setTagFilter(const QList& includedTags, -+ const QList& excludedTags, -+ MatchingCondition matchingCondition, -+ bool showUnTagged, -+ const QList& clTagIds, -+ const QList& plTagIds) -+{ -+ m_includeTagFilter = includedTags; -+ m_excludeTagFilter = excludedTags; -+ m_matchingCond = matchingCondition; -+ m_untaggedFilter = showUnTagged; -+ m_colorLabelTagFilter = clTagIds; -+ m_pickLabelTagFilter = plTagIds; -+} -+ -+void ImageFilterSettings::setRatingFilter(int rating, RatingCondition ratingCondition, bool isUnratedExcluded) -+{ -+ m_ratingFilter = rating; -+ m_ratingCond = ratingCondition; -+ m_isUnratedExcluded = isUnratedExcluded; -+} -+ -+void ImageFilterSettings::setMimeTypeFilter(int mime) -+{ -+ m_mimeTypeFilter = (MimeFilter::TypeMimeFilter)mime; -+} -+ -+void ImageFilterSettings::setGeolocationFilter(const GeolocationCondition& condition) -+{ -+ m_geolocationCondition = condition; -+} -+ -+void ImageFilterSettings::setTextFilter(const SearchTextFilterSettings& settings) -+{ -+ m_textFilterSettings = settings; -+} -+ -+void ImageFilterSettings::setTagNames(const QHash& hash) -+{ -+ m_tagNameHash = hash; -+} -+ -+void ImageFilterSettings::setAlbumNames(const QHash& hash) -+{ -+ m_albumNameHash = hash; -+} -+ -+void ImageFilterSettings::setUrlWhitelist(const QList& urlList, const QString& id) -+{ -+ if (urlList.isEmpty()) -+ { -+ m_urlWhitelists.remove(id); -+ } -+ else -+ { -+ m_urlWhitelists.insert(id, urlList); -+ } -+} -+ -+void ImageFilterSettings::setIdWhitelist(const QList& idList, const QString& id) -+{ -+ if (idList.isEmpty()) -+ { -+ m_idWhitelists.remove(id); -+ } -+ else -+ { -+ m_idWhitelists.insert(id, idList); -+ } -+} -+ -+template -+bool containsAnyOf(const ContainerA& listA, const ContainerB& listB) -+{ -+ foreach (const typename ContainerA::value_type& a, listA) -+ { -+ if (listB.contains(a)) -+ { -+ return true; -+ } -+ } -+ return false; -+} -+ -+template -+bool containsNoneOfExcept(const ContainerA& list, const ContainerB& noneOfList, const Value& exception) -+{ -+ foreach (const typename ContainerB::value_type& n, noneOfList) -+ { -+ if (n != exception && list.contains(n)) -+ { -+ return false; -+ } -+ } -+ return true; -+} -+ -+bool ImageFilterSettings::matches(const ImageInfo& info, bool* const foundText) const -+{ -+ if (foundText) -+ { -+ *foundText = false; -+ } -+ -+ if (!isFilteringInternally()) -+ { -+ return true; -+ } -+ -+ bool match = false; -+ -+ if (!m_includeTagFilter.isEmpty() || !m_excludeTagFilter.isEmpty()) -+ { -+ QList tagIds = info.tagIds(); -+ QList::const_iterator it; -+ -+ match = m_includeTagFilter.isEmpty(); -+ -+ if (m_matchingCond == OrCondition) -+ { -+ for (it = m_includeTagFilter.begin(); it != m_includeTagFilter.end(); ++it) -+ { -+ if (tagIds.contains(*it)) -+ { -+ match = true; -+ break; -+ } -+ } -+ -+ match |= (m_untaggedFilter && tagIds.isEmpty()); -+ } -+ else // AND matching condition... -+ { -+ // m_untaggedFilter and non-empty tag filter, combined with AND, is logically no match -+ if (!m_untaggedFilter) -+ { -+ for (it = m_includeTagFilter.begin(); it != m_includeTagFilter.end(); ++it) -+ { -+ if (!tagIds.contains(*it)) -+ { -+ break; -+ } -+ } -+ -+ if (it == m_includeTagFilter.end()) -+ { -+ match = true; -+ } -+ } -+ } -+ -+ for (it = m_excludeTagFilter.begin(); it != m_excludeTagFilter.end(); ++it) -+ { -+ if (tagIds.contains(*it)) -+ { -+ match = false; -+ break; -+ } -+ } -+ } -+ else if (m_untaggedFilter) -+ { -+ match = !TagsCache::instance()->containsPublicTags(info.tagIds()); -+ } -+ else -+ { -+ match = true; -+ } -+ -+ //-- Filter by pick labels ------------------------------------------------ -+ -+ if (!m_pickLabelTagFilter.isEmpty()) -+ { -+ QList tagIds = info.tagIds(); -+ bool matchPL = false; -+ -+ if (containsAnyOf(m_pickLabelTagFilter, tagIds)) -+ { -+ matchPL = true; -+ } -+ else if (!matchPL) -+ { -+ int noPickLabelTagId = TagsCache::instance()->tagForPickLabel(NoPickLabel); -+ -+ if (m_pickLabelTagFilter.contains(noPickLabelTagId)) -+ { -+ // Searching for "has no ColorLabel" requires special handling: -+ // Scan that the tag ids contains none of the ColorLabel tags, except maybe the NoColorLabel tag -+ matchPL = containsNoneOfExcept(tagIds, TagsCache::instance()->pickLabelTags(), noPickLabelTagId); -+ } -+ } -+ -+ match &= matchPL; -+ } -+ -+ //-- Filter by color labels ------------------------------------------------ -+ -+ if (!m_colorLabelTagFilter.isEmpty()) -+ { -+ QList tagIds = info.tagIds(); -+ bool matchCL = false; -+ -+ if (containsAnyOf(m_colorLabelTagFilter, tagIds)) -+ { -+ matchCL = true; -+ } -+ else if (!matchCL) -+ { -+ int noColorLabelTagId = TagsCache::instance()->tagForColorLabel(NoColorLabel); -+ -+ if (m_colorLabelTagFilter.contains(noColorLabelTagId)) -+ { -+ // Searching for "has no ColorLabel" requires special handling: -+ // Scan that the tag ids contains none of the ColorLabel tags, except maybe the NoColorLabel tag -+ matchCL = containsNoneOfExcept(tagIds, TagsCache::instance()->colorLabelTags(), noColorLabelTagId); -+ } -+ } -+ -+ match &= matchCL; -+ } -+ -+ //-- Filter by date ----------------------------------------------------------- -+ -+ if (!m_dayFilter.isEmpty()) -+ { -+ match &= m_dayFilter.contains(QDateTime(info.dateTime().date(), QTime())); -+ } -+ -+ //-- Filter by rating --------------------------------------------------------- -+ -+ if (m_ratingFilter >= 0) -+ { -+ // for now we treat -1 (no rating) just like a rating of 0. -+ int rating = info.rating(); -+ -+ if (rating == -1) -+ { -+ rating = 0; -+ } -+ -+ if(m_isUnratedExcluded && rating == 0) -+ { -+ match = false; -+ } -+ else -+ { -+ if (m_ratingCond == GreaterEqualCondition) -+ { -+ // If the rating is not >=, i.e it is <, then it does not match. -+ if (rating < m_ratingFilter) -+ { -+ match = false; -+ } -+ } -+ else if (m_ratingCond == EqualCondition) -+ { -+ // If the rating is not =, i.e it is !=, then it does not match. -+ if (rating != m_ratingFilter) -+ { -+ match = false; -+ } -+ } -+ else -+ { -+ // If the rating is not <=, i.e it is >, then it does not match. -+ if (rating > m_ratingFilter) -+ { -+ match = false; -+ } -+ } -+ } -+ } -+ -+ // -- Filter by mime type ----------------------------------------------------- -+ -+ switch (m_mimeTypeFilter) -+ { -+ // info.format is a standardized string: Only one possibility per mime type -+ case MimeFilter::ImageFiles: -+ { -+ if (info.category() != DatabaseItem::Image) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::JPGFiles: -+ { -+ if (info.format() != QLatin1String("JPG")) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::PNGFiles: -+ { -+ if (info.format() != QLatin1String("PNG")) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::TIFFiles: -+ { -+ if (info.format() != QLatin1String("TIFF")) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::DNGFiles: -+ { -+ if (info.format() != QLatin1String("RAW-DNG")) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::NoRAWFiles: -+ { -+ if (info.format().startsWith(QLatin1String("RAW"))) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::RAWFiles: -+ { -+ if (!info.format().startsWith(QLatin1String("RAW"))) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::MoviesFiles: -+ { -+ if (info.category() != DatabaseItem::Video) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::AudioFiles: -+ { -+ if (info.category() != DatabaseItem::Audio) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ case MimeFilter::RasterFiles: -+ { -+ if (info.format() != QLatin1String("PSD") && // Adobe Photoshop Document -+ info.format() != QLatin1String("PSB") && // Adobe Photoshop Big -+ info.format() != QLatin1String("XCF") && // Gimp -+ info.format() != QLatin1String("KRA") && // Krita -+ info.format() != QLatin1String("ORA") // Open Raster -+ ) -+ { -+ match = false; -+ } -+ -+ break; -+ } -+ default: -+ { -+ // All Files: do nothing... -+ break; -+ } -+ } -+ -+ //-- Filter by geolocation ---------------------------------------------------- -+ -+ if (m_geolocationCondition!=GeolocationNoFilter) -+ { -+ if (m_geolocationCondition==GeolocationNoCoordinates) -+ { -+ if (info.hasCoordinates()) -+ { -+ match = false; -+ } -+ } -+ else if (m_geolocationCondition==GeolocationHasCoordinates) -+ { -+ if (!info.hasCoordinates()) -+ { -+ match = false; -+ } -+ } -+ } -+ -+ //-- Filter by text ----------------------------------------------------------- -+ -+ if (!m_textFilterSettings.text.isEmpty()) -+ { -+ bool textMatch = false; -+ -+ // Image name -+ if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageName && -+ info.name().contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -+ { -+ textMatch = true; -+ } -+ -+ // Image title -+ if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageTitle && -+ info.title().contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -+ { -+ textMatch = true; -+ } -+ -+ // Image comment -+ if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageComment && -+ info.comment().contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -+ { -+ textMatch = true; -+ } -+ -+ // Tag names -+ foreach(int id, info.tagIds()) -+ { -+ if (m_textFilterSettings.textFields & SearchTextFilterSettings::TagName && -+ m_tagNameHash.value(id).contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -+ { -+ textMatch = true; -+ } -+ } -+ -+ // Album names -+ if (m_textFilterSettings.textFields & SearchTextFilterSettings::AlbumName && -+ m_albumNameHash.value(info.albumId()).contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -+ { -+ textMatch = true; -+ } -+ -+ // Image Aspect Ratio -+ if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageAspectRatio) -+ { -+ QRegExp expRatio (QLatin1String("^\\d+:\\d+$")); -+ QRegExp expFloat (QLatin1String("^\\d+(.\\d+)?$")); -+ -+ if (expRatio.indexIn(m_textFilterSettings.text) > -1 && m_textFilterSettings.text.contains(QRegExp(QLatin1String(":\\d+")))) -+ { -+ QString trimmedTextFilterSettingsText = m_textFilterSettings.text; -+ QStringList numberStringList = trimmedTextFilterSettingsText.split(QLatin1String(":"), QString::SkipEmptyParts); -+ -+ if (numberStringList.length() == 2) -+ { -+ QString numString = (QString)numberStringList.at(0), denomString = (QString)numberStringList.at(1); -+ bool canConverseNum = false; -+ bool canConverseDenom = false; -+ int num = numString.toInt(&canConverseNum, 10), denom = denomString.toInt(&canConverseDenom, 10); -+ -+ if (canConverseNum && canConverseDenom) -+ { -+ if (fabs(info.aspectRatio() - (double)num / denom) < 0.1) -+ textMatch = true; -+ } -+ } -+ } -+ else if (expFloat.indexIn(m_textFilterSettings.text) > -1) -+ { -+ QString trimmedTextFilterSettingsText = m_textFilterSettings.text; -+ bool canConverse = false; -+ double ratio = trimmedTextFilterSettingsText.toDouble(&canConverse); -+ -+ if (canConverse) -+ { -+ if (fabs(info.aspectRatio() - ratio) < 0.1) -+ textMatch = true; -+ } -+ } -+ } -+ -+ // Image Pixel Size -+ // See bug #341053 for details. -+ -+ if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImagePixelSize) -+ { -+ QSize size = info.dimensions(); -+ int pixelSize = size.height()*size.width(); -+ QString text = m_textFilterSettings.text; -+ -+ if(text.contains(QRegExp(QLatin1String("^>\\d{1,15}$"))) && pixelSize > (text.remove(0,1)).toInt()) -+ { -+ textMatch = true; -+ } -+ else if(text.contains(QRegExp(QLatin1String("^<\\d{1,15}$"))) && pixelSize < (text.remove(0,1)).toInt()) -+ { -+ textMatch = true; -+ } -+ else if(text.contains(QRegExp(QLatin1String("^\\d+$"))) && pixelSize == text.toInt()) -+ { -+ textMatch = true; -+ } -+ } -+ -+ match &= textMatch; -+ -+ if (foundText) -+ { -+ *foundText = textMatch; -+ } -+ } -+ -+ // -- filter by URL-whitelists ------------------------------------------------ -+ // NOTE: whitelists are always AND for now. -+ -+ if (match) -+ { -+ const QUrl url = info.fileUrl(); -+ -+ for (QHash>::const_iterator it = m_urlWhitelists.constBegin(); -+ it!=m_urlWhitelists.constEnd(); ++it) -+ { -+ match = it->contains(url); -+ -+ if (!match) -+ { -+ break; -+ } -+ } -+ } -+ -+ if (match) -+ { -+ const qlonglong id = info.id(); -+ -+ for (QHash >::const_iterator it = m_idWhitelists.constBegin(); -+ it!=m_idWhitelists.constEnd(); ++it) -+ { -+ match = it->contains(id); -+ -+ if (!match) -+ { -+ break; -+ } -+ } -+ } -+ -+ return match; -+} -+ -+// ------------------------------------------------------------------------------------------------- -+ -+VersionImageFilterSettings::VersionImageFilterSettings() -+{ -+ m_includeTagFilter = 0; -+ m_exceptionTagFilter = 0; -+} -+ -+VersionImageFilterSettings::VersionImageFilterSettings(const VersionManagerSettings& settings) -+{ -+ setVersionManagerSettings(settings); -+} -+ -+bool VersionImageFilterSettings::operator==(const VersionImageFilterSettings& other) const -+{ -+ return m_excludeTagFilter == other.m_excludeTagFilter && -+ m_exceptionLists == other.m_exceptionLists; -+} -+ -+bool VersionImageFilterSettings::matches(const ImageInfo& info) const -+{ -+ if (!isFiltering()) -+ { -+ return true; -+ } -+ -+ const qlonglong id = info.id(); -+ -+ for (QHash >::const_iterator it = m_exceptionLists.constBegin(); -+ it != m_exceptionLists.constEnd(); ++it) -+ { -+ if (it->contains(id)) -+ { -+ return true; -+ } -+ } -+ -+ bool match = true; -+ QList tagIds = info.tagIds(); -+ -+ if (!tagIds.contains(m_includeTagFilter)) -+ { -+ for (QList::const_iterator it = m_excludeTagFilter.begin(); -+ it != m_excludeTagFilter.end(); ++it) -+ { -+ if (tagIds.contains(*it)) -+ { -+ match = false; -+ break; -+ } -+ } -+ } -+ -+ if (!match) -+ { -+ if (tagIds.contains(m_exceptionTagFilter)) -+ { -+ match = true; -+ } -+ } -+ -+ return match; -+} -+ -+bool VersionImageFilterSettings::isHiddenBySettings(const ImageInfo& info) const -+{ -+ QList tagIds = info.tagIds(); -+ -+ foreach(int tagId, m_excludeTagFilter) -+ { -+ if (tagIds.contains(tagId)) -+ { -+ return true; -+ } -+ } -+ -+ return false; -+} -+ -+bool VersionImageFilterSettings::isExemptedBySettings(const ImageInfo& info) const -+{ -+ return info.tagIds().contains(m_exceptionTagFilter); -+} -+ -+void VersionImageFilterSettings::setVersionManagerSettings(const VersionManagerSettings& settings) -+{ -+ m_excludeTagFilter.clear(); -+ -+ if (!settings.enabled) -+ { -+ return; -+ } -+ -+ if (!(settings.showInViewFlags & VersionManagerSettings::ShowOriginal)) -+ { -+ m_excludeTagFilter << TagsCache::instance()->getOrCreateInternalTag(InternalTagName::originalVersion()); -+ } -+ -+ if (!(settings.showInViewFlags & VersionManagerSettings::ShowIntermediates)) -+ { -+ m_excludeTagFilter << TagsCache::instance()->getOrCreateInternalTag(InternalTagName::intermediateVersion()); -+ } -+ -+ m_includeTagFilter = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::currentVersion()); -+ m_exceptionTagFilter = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::versionAlwaysVisible()); -+} -+ -+void VersionImageFilterSettings::setExceptionList(const QList& idList, const QString& id) -+{ -+ if (idList.isEmpty()) -+ { -+ m_exceptionLists.remove(id); -+ } -+ else -+ { -+ m_exceptionLists.insert(id, idList); -+ } -+} -+ -+bool VersionImageFilterSettings::isFiltering() const -+{ -+ return !m_excludeTagFilter.isEmpty(); -+} -+ -+bool VersionImageFilterSettings::isFilteringByTags() const -+{ -+ return isFiltering(); -+} -+ -+// ------------------------------------------------------------------------------------------------- -+ -+GroupImageFilterSettings::GroupImageFilterSettings() -+ : m_allOpen(false) -+{ -+} -+ -+bool GroupImageFilterSettings::operator==(const GroupImageFilterSettings& other) const -+{ -+ return (m_allOpen == other.m_allOpen && -+ m_openGroups == other.m_openGroups); -+} -+ -+bool GroupImageFilterSettings::matches(const ImageInfo& info) const -+{ -+ if (m_allOpen) -+ { -+ return true; -+ } -+ -+ if (info.isGrouped()) -+ { -+ return m_openGroups.contains(info.groupImage().id()); -+ } -+ return true; -+} -+ -+void GroupImageFilterSettings::setOpen(qlonglong group, bool open) -+{ -+ if (open) -+ { -+ m_openGroups << group; -+ } -+ else -+ { -+ m_openGroups.remove(group); -+ } -+} -+ -+bool GroupImageFilterSettings::isOpen(qlonglong group) const -+{ -+ return m_openGroups.contains(group); -+} -+ -+void GroupImageFilterSettings::setAllOpen(bool open) -+{ -+ m_allOpen = open; -+} -+ -+bool GroupImageFilterSettings::isAllOpen() const -+{ -+ return m_allOpen; -+} -+ -+bool GroupImageFilterSettings::isFiltering() const -+{ -+ return !m_allOpen; -+} -+ -+DatabaseFields::Set GroupImageFilterSettings::watchFlags() const -+{ -+ return DatabaseFields::ImageRelations; -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagefiltersettings.h b/libs/database/models/imagefiltersettings.h -new file mode 100644 -index 0000000..0e7beae ---- /dev/null -+++ b/libs/database/models/imagefiltersettings.h -@@ -0,0 +1,349 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Filter values for use with ImageFilterModel -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011-2017 by Gilles Caulier -+ * Copyright (C) 2010 by Andi Clemens -+ * Copyright (C) 2011 by Michael G. Hansen -+ * Copyright (C) 2014 by Mohamed Anwer -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGEFILTERSETTINGS_H -+#define IMAGEFILTERSETTINGS_H -+ -+// Qt includes -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+// Local includes -+ -+#include "searchtextbar.h" -+#include "mimefilter.h" -+#include "digikam_export.h" -+ -+namespace Digikam -+{ -+ -+class ImageInfo; -+class VersionManagerSettings; -+ -+namespace DatabaseFields -+{ -+ class Set; -+} -+ -+// --------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT SearchTextFilterSettings : public SearchTextSettings -+{ -+ -+public: -+ -+ enum TextFilterFields -+ { -+ None = 0x00, -+ ImageName = 0x01, -+ ImageTitle = 0x02, -+ ImageComment = 0x04, -+ TagName = 0x08, -+ AlbumName = 0x10, -+ ImageAspectRatio = 0x20, -+ ImagePixelSize = 0x40, -+ All = ImageName | ImageTitle | ImageComment | TagName | AlbumName | ImageAspectRatio | ImagePixelSize -+ }; -+ -+public: -+ -+ SearchTextFilterSettings() -+ { -+ textFields = None; -+ } -+ -+ explicit SearchTextFilterSettings(const SearchTextSettings& settings) -+ { -+ caseSensitive = settings.caseSensitive; -+ text = settings.text; -+ textFields = None; -+ } -+ -+ TextFilterFields textFields; -+}; -+ -+// --------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT ImageFilterSettings -+{ -+public: -+ -+ ImageFilterSettings(); -+ -+ /** -+ * Returns true if the given ImageInfo matches the filter criteria. -+ * Optionally, foundText is set to true if it matched by text search. -+ */ -+ bool matches(const ImageInfo& info, bool* const foundText = 0) const; -+ -+public: -+ -+ /// --- Tags filter --- -+ -+ /// Possible logical matching condition used to sort tags id. -+ enum MatchingCondition -+ { -+ OrCondition, -+ AndCondition -+ }; -+ -+ void setTagFilter(const QList& includedTags, -+ const QList& excludedTags, -+ MatchingCondition matchingCond, -+ bool showUnTagged, -+ const QList& clTagIds, -+ const QList& plTagIds); -+ -+public: -+ -+ /// --- Rating filter --- -+ -+ /// Possible conditions used to filter rating: >=, =, <= -+ enum RatingCondition -+ { -+ GreaterEqualCondition, -+ EqualCondition, -+ LessEqualCondition -+ }; -+ -+ void setRatingFilter(int rating, RatingCondition ratingCond, bool isUnratedExcluded); -+ -+public: -+ -+ /// --- Date filter --- -+ void setDayFilter(const QList& days); -+ -+public: -+ -+ /// --- Text filter --- -+ void setTextFilter(const SearchTextFilterSettings& settings); -+ void setTagNames(const QHash& tagNameHash); -+ void setAlbumNames(const QHash& albumNameHash); -+ -+public: -+ -+ /// --- Mime filter --- -+ void setMimeTypeFilter(int mimeTypeFilter); -+ -+public: -+ -+ /// --- Geolocation filter -+ enum GeolocationCondition -+ { -+ GeolocationNoFilter = 0, -+ GeolocationNoCoordinates = 1 << 1, -+ GeolocationHasCoordinates = 1 << 2 -+ }; -+ -+ void setGeolocationFilter(const GeolocationCondition& condition); -+ -+public: -+ -+ /// Returns if the day is a filter criteria -+ bool isFilteringByDay() const; -+ -+ /// Returns if the type mime is a filter criteria -+ bool isFilteringByTypeMime() const; -+ -+ /// Returns whether geolocation is a filter criteria -+ bool isFilteringByGeolocation() const; -+ -+ /// Returns if the rating is a filter criteria -+ bool isFilteringByRating() const; -+ -+ /// Returns if the pick labels is a filter criteria -+ bool isFilteringByPickLabels() const; -+ -+ /// Returns if the color labels is a filter criteria -+ bool isFilteringByColorLabels() const; -+ -+ /// Returns if the tag is a filter criteria -+ bool isFilteringByTags() const; -+ -+ /// Returns if the text (including comment) is a filter criteria -+ bool isFilteringByText() const; -+ -+ /// Returns if images will be filtered by these criteria at all -+ bool isFiltering() const; -+ -+public: -+ -+ /// --- URL whitelist filter -+ void setUrlWhitelist(const QList& urlList, const QString& id); -+ -+public: -+ -+ /// --- ID whitelist filter -+ void setIdWhitelist(const QList& idList, const QString& id); -+ -+public: -+ -+ /// --- Change notification --- -+ -+ /** Returns database fields a change in which would affect the current filtering. -+ * To find out if an image tag change affects filtering, test isFilteringByTags(). -+ * The text filter will also be affected by changes in tags and album names. -+ */ -+ DatabaseFields::Set watchFlags() const; -+ -+private: -+ -+ /** -+ * @brief Returns whether some internal filtering (whitelist by id or URL) or normal filtering is going on -+ */ -+ bool isFilteringInternally() const; -+ -+private: -+ -+ /// --- Tags filter --- -+ bool m_untaggedFilter; -+ QList m_includeTagFilter; -+ QList m_excludeTagFilter; -+ MatchingCondition m_matchingCond; -+ QList m_colorLabelTagFilter; -+ QList m_pickLabelTagFilter; -+ -+ /// --- Rating filter --- -+ int m_ratingFilter; -+ RatingCondition m_ratingCond; -+ bool m_isUnratedExcluded; -+ -+ /// --- Date filter --- -+ QMap m_dayFilter; -+ -+ /// --- Text filter --- -+ SearchTextFilterSettings m_textFilterSettings; -+ -+ /// Helpers for text search: Set these if you want to search album or tag names with text search -+ QHash m_tagNameHash; -+ QHash m_albumNameHash; -+ -+ /// --- Mime filter --- -+ MimeFilter::TypeMimeFilter m_mimeTypeFilter; -+ -+ /// --- Geolocation filter -+ GeolocationCondition m_geolocationCondition; -+ -+ /// --- URL whitelist filter -+ QHash> m_urlWhitelists; -+ -+ /// --- ID whitelist filter -+ QHash > m_idWhitelists; -+}; -+ -+// --------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT VersionImageFilterSettings -+{ -+public: -+ -+ VersionImageFilterSettings(); -+ explicit VersionImageFilterSettings(const VersionManagerSettings& settings); -+ -+ bool operator==(const VersionImageFilterSettings& other) const; -+ -+ /** -+ * Returns true if the given ImageInfo matches the filter criteria. -+ */ -+ bool matches(const ImageInfo& info) const; -+ -+ bool isHiddenBySettings(const ImageInfo& info) const; -+ bool isExemptedBySettings(const ImageInfo& info) const; -+ -+ /// --- Tags filter --- -+ -+ void setVersionManagerSettings(const VersionManagerSettings& settings); -+ -+ /** -+ * Add list with exceptions: These images will be exempted from filtering by this filter -+ */ -+ void setExceptionList(const QList& idlist, const QString& id); -+ -+ /// Returns if images will be filtered by these criteria at all -+ bool isFiltering() const; -+ -+ /// Returns if the tag is a filter criteria -+ bool isFilteringByTags() const; -+ -+ /// DatabaseFields::Set watchFlags() const: Would return 0 -+ -+protected: -+ -+ QList m_excludeTagFilter; -+ int m_includeTagFilter; -+ int m_exceptionTagFilter; -+ QHash > m_exceptionLists; -+}; -+ -+// --------------------------------------------------------------------------------------- -+ -+class DIGIKAM_DATABASE_EXPORT GroupImageFilterSettings -+{ -+public: -+ -+ GroupImageFilterSettings(); -+ -+ bool operator==(const GroupImageFilterSettings& other) const; -+ -+ /** -+ * Returns true if the given ImageInfo matches the filter criteria. -+ */ -+ bool matches(const ImageInfo& info) const; -+ -+ /** -+ * Open or close a group. -+ */ -+ void setOpen(qlonglong group, bool open); -+ bool isOpen(qlonglong group) const; -+ -+ /** -+ * Open all groups -+ */ -+ void setAllOpen(bool open); -+ bool isAllOpen() const; -+ -+ /// Returns if images will be filtered by these criteria at all -+ bool isFiltering() const; -+ -+ DatabaseFields::Set watchFlags() const; -+ -+protected: -+ -+ bool m_allOpen; -+ QSet m_openGroups; -+}; -+ -+} // namespace Digikam -+ -+Q_DECLARE_METATYPE(Digikam::ImageFilterSettings::GeolocationCondition) -+ -+#endif // IMAGEFILTERSETTINGS_H -diff --git a/libs/database/models/imagelistmodel.cpp b/libs/database/models/imagelistmodel.cpp -new file mode 100644 -index 0000000..fafce34 ---- /dev/null -+++ b/libs/database/models/imagelistmodel.cpp -@@ -0,0 +1,70 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2010-12-06 -+ * Description : An image model based on a static list -+ * -+ * Copyright (C) 2010-2011 by Marcel Wiesweg -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagelistmodel.h" -+ -+// Local includes -+ -+#include "digikam_debug.h" -+#include "coredbaccess.h" -+#include "coredbchangesets.h" -+#include "coredbwatch.h" -+#include "imageinfo.h" -+#include "imageinfolist.h" -+ -+namespace Digikam -+{ -+ -+ImageListModel::ImageListModel(QObject* parent) -+ : ImageThumbnailModel(parent) -+{ -+ connect(CoreDbAccess::databaseWatch(), SIGNAL(collectionImageChange(CollectionImageChangeset)), -+ this, SLOT(slotCollectionImageChange(CollectionImageChangeset))); -+} -+ -+ImageListModel::~ImageListModel() -+{ -+} -+ -+void ImageListModel::slotCollectionImageChange(const CollectionImageChangeset& changeset) -+{ -+ if (isEmpty()) -+ { -+ return; -+ } -+ -+ switch (changeset.operation()) -+ { -+ case CollectionImageChangeset::Added: -+ break; -+ case CollectionImageChangeset::Removed: -+ case CollectionImageChangeset::RemovedAll: -+ removeImageInfos(ImageInfoList(changeset.ids())); -+ break; -+ -+ default: -+ break; -+ } -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagelistmodel.h b/libs/database/models/imagelistmodel.h -new file mode 100644 -index 0000000..a225b1b ---- /dev/null -+++ b/libs/database/models/imagelistmodel.h -@@ -0,0 +1,63 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2010-12-06 -+ * Description : An image model based on a static list -+ * -+ * Copyright (C) 2010-2011 by Marcel Wiesweg -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGELISTMODEL_H -+#define IMAGELISTMODEL_H -+ -+// Local includes -+ -+#include "imagethumbnailmodel.h" -+#include "digikam_export.h" -+ -+namespace Digikam -+{ -+ -+class ImageChangeset; -+class CollectionImageChangeset; -+ -+class DIGIKAM_DATABASE_EXPORT ImageListModel : public ImageThumbnailModel -+{ -+ Q_OBJECT -+ -+public: -+ -+ explicit ImageListModel(QObject* parent = 0); -+ ~ImageListModel(); -+ -+ // NOTE: necessary methods to add and remove ImageInfos to the model are inherited from ImageModel -+ -+Q_SIGNALS: -+ -+ /** -+ * Emitted when images are removed from the model because they are removed in the database -+ */ -+ void imageInfosRemoved(const QList& infos); -+ -+protected Q_SLOTS: -+ -+ void slotCollectionImageChange(const CollectionImageChangeset& changeset); -+}; -+ -+} // namespace Digikam -+ -+#endif // IMAGELISTMODEL_H -diff --git a/libs/database/models/imagemodel.cpp b/libs/database/models/imagemodel.cpp -new file mode 100644 -index 0000000..41b43cf ---- /dev/null -+++ b/libs/database/models/imagemodel.cpp -@@ -0,0 +1,1368 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagemodel.h" -+ -+// Qt includes -+ -+#include -+#include -+ -+// Local includes -+ -+#include "digikam_debug.h" -+#include "coredbchangesets.h" -+#include "coredbfields.h" -+#include "coredbwatch.h" -+#include "imageinfo.h" -+#include "imageinfolist.h" -+#include "abstractitemdragdrophandler.h" -+ -+namespace Digikam -+{ -+ -+class ImageModel::Private -+{ -+public: -+ -+ Private() -+ { -+ preprocessor = 0; -+ keepFilePathCache = false; -+ sendRemovalSignals = false; -+ incrementalUpdater = 0; -+ refreshing = false; -+ reAdding = false; -+ incrementalRefreshRequested = false; -+ } -+ -+ ImageInfoList infos; -+ QList extraValues; -+ QHash idHash; -+ -+ bool keepFilePathCache; -+ QHash filePathHash; -+ -+ bool sendRemovalSignals; -+ -+ QObject* preprocessor; -+ bool refreshing; -+ bool reAdding; -+ bool incrementalRefreshRequested; -+ -+ DatabaseFields::Set watchFlags; -+ -+ class ImageModelIncrementalUpdater* incrementalUpdater; -+ -+ ImageInfoList pendingInfos; -+ QList pendingExtraValues; -+ -+ inline bool isValid(const QModelIndex& index) -+ { -+ if (!index.isValid()) -+ { -+ return false; -+ } -+ -+ if (index.row() < 0 || index.row() >= infos.size()) -+ { -+ qCDebug(DIGIKAM_GENERAL_LOG) << "Invalid index" << index; -+ return false; -+ } -+ -+ return true; -+ } -+ inline bool extraValueValid(const QModelIndex& index) -+ { -+ // we assume isValid() being called before, no duplicate checks -+ if (index.row() >= extraValues.size()) -+ { -+ qCDebug(DIGIKAM_GENERAL_LOG) << "Invalid index for extraData" << index; -+ return false; -+ } -+ -+ return true; -+ } -+}; -+ -+typedef QPair IntPair; // to make foreach macro happy -+typedef QList IntPairList; -+ -+class ImageModelIncrementalUpdater -+{ -+public: -+ -+ explicit ImageModelIncrementalUpdater(ImageModel::Private* d); -+ -+ void appendInfos(const QList& infos, const QList& extraValues); -+ void aboutToBeRemovedInModel(const IntPairList& aboutToBeRemoved); -+ QList oldIndexes(); -+ -+ static QList toContiguousPairs(const QList& ids); -+ -+public: -+ -+ QHash oldIds; -+ QList oldExtraValues; -+ QList newInfos; -+ QList newExtraValues; -+ QList modelRemovals; -+}; -+ -+ImageModel::ImageModel(QObject* parent) -+ : QAbstractListModel(parent), -+ d(new Private) -+{ -+ connect(CoreDbAccess::databaseWatch(), SIGNAL(imageChange(ImageChangeset)), -+ this, SLOT(slotImageChange(ImageChangeset))); -+ -+ connect(CoreDbAccess::databaseWatch(), SIGNAL(imageTagChange(ImageTagChangeset)), -+ this, SLOT(slotImageTagChange(ImageTagChangeset))); -+} -+ -+ImageModel::~ImageModel() -+{ -+ delete d->incrementalUpdater; -+ delete d; -+} -+ -+// ------------ Access methods ------------- -+ -+void ImageModel::setKeepsFilePathCache(bool keepCache) -+{ -+ d->keepFilePathCache = keepCache; -+} -+ -+bool ImageModel::keepsFilePathCache() const -+{ -+ return d->keepFilePathCache; -+} -+ -+bool ImageModel::isEmpty() const -+{ -+ return d->infos.isEmpty(); -+} -+ -+void ImageModel::setWatchFlags(const DatabaseFields::Set& set) -+{ -+ d->watchFlags = set; -+} -+ -+ImageInfo ImageModel::imageInfo(const QModelIndex& index) const -+{ -+ if (!d->isValid(index)) -+ { -+ return ImageInfo(); -+ } -+ -+ return d->infos.at(index.row()); -+} -+ -+ImageInfo& ImageModel::imageInfoRef(const QModelIndex& index) const -+{ -+ return d->infos[index.row()]; -+} -+ -+qlonglong ImageModel::imageId(const QModelIndex& index) const -+{ -+ if (!d->isValid(index)) -+ { -+ return 0; -+ } -+ -+ return d->infos.at(index.row()).id(); -+} -+ -+QList ImageModel::imageInfos(const QList& indexes) const -+{ -+ QList infos; -+ -+ foreach(const QModelIndex& index, indexes) -+ { -+ infos << imageInfo(index); -+ } -+ -+ return infos; -+} -+ -+QList ImageModel::imageIds(const QList& indexes) const -+{ -+ QList ids; -+ -+ foreach(const QModelIndex& index, indexes) -+ { -+ ids << imageId(index); -+ } -+ -+ return ids; -+} -+ -+ImageInfo ImageModel::imageInfo(int row) const -+{ -+ if (row >= d->infos.size()) -+ { -+ return ImageInfo(); -+ } -+ -+ return d->infos.at(row); -+} -+ -+ImageInfo& ImageModel::imageInfoRef(int row) const -+{ -+ return d->infos[row]; -+} -+ -+qlonglong ImageModel::imageId(int row) const -+{ -+ if (row < 0 || row >= d->infos.size()) -+ { -+ return -1; -+ } -+ -+ return d->infos.at(row).id(); -+} -+ -+QModelIndex ImageModel::indexForImageInfo(const ImageInfo& info) const -+{ -+ return indexForImageId(info.id()); -+} -+ -+QModelIndex ImageModel::indexForImageInfo(const ImageInfo& info, const QVariant& extraValue) const -+{ -+ return indexForImageId(info.id(), extraValue); -+} -+ -+QList ImageModel::indexesForImageInfo(const ImageInfo& info) const -+{ -+ return indexesForImageId(info.id()); -+} -+ -+QModelIndex ImageModel::indexForImageId(qlonglong id) const -+{ -+ int index = d->idHash.value(id, -1); -+ -+ if (index != -1) -+ { -+ return createIndex(index, 0); -+ } -+ -+ return QModelIndex(); -+} -+ -+QModelIndex ImageModel::indexForImageId(qlonglong id, const QVariant& extraValue) const -+{ -+ if (d->extraValues.isEmpty()) -+ return indexForImageId(id); -+ -+ QHash::const_iterator it; -+ -+ for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -+ { -+ if (d->extraValues.at(it.value()) == extraValue) -+ return createIndex(it.value(), 0); -+ } -+ -+ return QModelIndex(); -+} -+ -+QList ImageModel::indexesForImageId(qlonglong id) const -+{ -+ QList indexes; -+ QHash::const_iterator it; -+ -+ for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -+ { -+ indexes << createIndex(it.value(), 0); -+ } -+ -+ return indexes; -+} -+ -+int ImageModel::numberOfIndexesForImageInfo(const ImageInfo& info) const -+{ -+ return numberOfIndexesForImageId(info.id()); -+} -+ -+int ImageModel::numberOfIndexesForImageId(qlonglong id) const -+{ -+ if (d->extraValues.isEmpty()) -+ { -+ return 0; -+ } -+ -+ int count = 0; -+ QHash::const_iterator it; -+ -+ for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -+ { -+ ++count; -+ } -+ -+ return count; -+} -+ -+// static method -+ImageInfo ImageModel::retrieveImageInfo(const QModelIndex& index) -+{ -+ if (!index.isValid()) -+ { -+ return ImageInfo(); -+ } -+ -+ ImageModel* const model = index.data(ImageModelPointerRole).value(); -+ int row = index.data(ImageModelInternalId).toInt(); -+ -+ if (!model) -+ { -+ return ImageInfo(); -+ } -+ -+ return model->imageInfo(row); -+} -+ -+// static method -+qlonglong ImageModel::retrieveImageId(const QModelIndex& index) -+{ -+ if (!index.isValid()) -+ { -+ return 0; -+ } -+ -+ ImageModel* const model = index.data(ImageModelPointerRole).value(); -+ int row = index.data(ImageModelInternalId).toInt(); -+ -+ if (!model) -+ { -+ return 0; -+ } -+ -+ return model->imageId(row); -+} -+ -+QModelIndex ImageModel::indexForPath(const QString& filePath) const -+{ -+ if (d->keepFilePathCache) -+ { -+ return indexForImageId(d->filePathHash.value(filePath)); -+ } -+ else -+ { -+ const int size = d->infos.size(); -+ -+ for (int i=0; iinfos.at(i).filePath() == filePath) -+ { -+ return createIndex(i, 0); -+ } -+ } -+ } -+ -+ return QModelIndex(); -+} -+ -+QList ImageModel::indexesForPath(const QString& filePath) const -+{ -+ if (d->keepFilePathCache) -+ { -+ return indexesForImageId(d->filePathHash.value(filePath)); -+ } -+ else -+ { -+ QList indexes; -+ const int size = d->infos.size(); -+ -+ for (int i=0; iinfos.at(i).filePath() == filePath) -+ { -+ indexes << createIndex(i, 0); -+ } -+ } -+ -+ return indexes; -+ } -+} -+ -+ImageInfo ImageModel::imageInfo(const QString& filePath) const -+{ -+ if (d->keepFilePathCache) -+ { -+ qlonglong id = d->filePathHash.value(filePath); -+ -+ if (id) -+ { -+ int index = d->idHash.value(id, -1); -+ -+ if (index != -1) -+ { -+ return d->infos.at(index); -+ } -+ } -+ } -+ else -+ { -+ foreach(const ImageInfo& info, d->infos) -+ { -+ if (info.filePath() == filePath) -+ { -+ return info; -+ } -+ } -+ } -+ -+ return ImageInfo(); -+} -+ -+QList ImageModel::imageInfos(const QString& filePath) const -+{ -+ QList infos; -+ -+ if (d->keepFilePathCache) -+ { -+ qlonglong id = d->filePathHash.value(filePath); -+ -+ if (id) -+ { -+ foreach(int index, d->idHash.values(id)) -+ { -+ infos << d->infos.at(index); -+ } -+ } -+ } -+ else -+ { -+ foreach(const ImageInfo& info, d->infos) -+ { -+ if (info.filePath() == filePath) -+ { -+ infos << info; -+ } -+ } -+ } -+ -+ return infos; -+} -+ -+void ImageModel::addImageInfo(const ImageInfo& info) -+{ -+ addImageInfos(QList() << info, QList()); -+} -+ -+void ImageModel::addImageInfos(const QList& infos) -+{ -+ addImageInfos(infos, QList()); -+} -+ -+void ImageModel::addImageInfos(const QList& infos, const QList& extraValues) -+{ -+ if (infos.isEmpty()) -+ { -+ return; -+ } -+ -+ if (d->incrementalUpdater) -+ { -+ d->incrementalUpdater->appendInfos(infos, extraValues); -+ } -+ else -+ { -+ appendInfos(infos, extraValues); -+ } -+} -+ -+void ImageModel::addImageInfoSynchronously(const ImageInfo& info) -+{ -+ addImageInfosSynchronously(QList() << info, QList()); -+} -+ -+void ImageModel::addImageInfosSynchronously(const QList& infos) -+{ -+ addImageInfos(infos, QList()); -+} -+ -+void ImageModel::addImageInfosSynchronously(const QList& infos, const QList& extraValues) -+{ -+ if (infos.isEmpty()) -+ { -+ return; -+ } -+ -+ publiciseInfos(infos, extraValues); -+ emit processAdded(infos, extraValues); -+} -+ -+void ImageModel::ensureHasImageInfo(const ImageInfo& info) -+{ -+ ensureHasImageInfos(QList() << info, QList()); -+} -+ -+void ImageModel::ensureHasImageInfos(const QList& infos) -+{ -+ ensureHasImageInfos(infos, QList()); -+} -+ -+void ImageModel::ensureHasImageInfos(const QList& infos, const QList& extraValues) -+{ -+ if (extraValues.isEmpty()) -+ { -+ if (!d->pendingExtraValues.isEmpty()) -+ { -+ qCDebug(DIGIKAM_GENERAL_LOG) << "ExtraValue / No Extra Value mismatch. Ignoring added infos."; -+ return; -+ } -+ } -+ else -+ { -+ if (d->pendingInfos.size() != d->pendingExtraValues.size()) -+ { -+ qCDebug(DIGIKAM_GENERAL_LOG) << "ExtraValue / No Extra Value mismatch. Ignoring added infos."; -+ return; -+ } -+ } -+ -+ d->pendingInfos << infos; -+ d->pendingExtraValues << extraValues; -+ cleanSituationChecks(); -+} -+ -+void ImageModel::clearImageInfos() -+{ -+ d->infos.clear(); -+ d->extraValues.clear(); -+ d->idHash.clear(); -+ d->filePathHash.clear(); -+ delete d->incrementalUpdater; -+ d->incrementalUpdater = 0; -+ d->pendingInfos.clear(); -+ d->pendingExtraValues.clear(); -+ d->refreshing = false; -+ d->reAdding = false; -+ d->incrementalRefreshRequested = false; -+ -+ beginResetModel(); -+ endResetModel(); -+ -+ imageInfosCleared(); -+} -+ -+void ImageModel::setImageInfos(const QList& infos) -+{ -+ clearImageInfos(); -+ addImageInfos(infos); -+} -+ -+QList ImageModel::imageInfos() const -+{ -+ return d->infos; -+} -+ -+QList ImageModel::imageIds() const -+{ -+ return d->idHash.keys(); -+} -+ -+bool ImageModel::hasImage(qlonglong id) const -+{ -+ return d->idHash.contains(id); -+} -+ -+bool ImageModel::hasImage(const ImageInfo& info) const -+{ -+ return d->idHash.contains(info.id()); -+} -+ -+bool ImageModel::hasImage(const ImageInfo& info, const QVariant& extraValue) const -+{ -+ return hasImage(info.id(), extraValue); -+} -+ -+bool ImageModel::hasImage(qlonglong id, const QVariant& extraValue) const -+{ -+ if (d->extraValues.isEmpty()) -+ return hasImage(id); -+ -+ QHash::const_iterator it; -+ -+ for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -+ { -+ if (d->extraValues.at(it.value()) == extraValue) -+ return true; -+ } -+ -+ return false;; -+} -+ -+QList ImageModel::uniqueImageInfos() const -+{ -+ if (d->extraValues.isEmpty()) -+ { -+ return d->infos; -+ } -+ -+ QList uniqueInfos; -+ const int size = d->infos.size(); -+ -+ for (int i=0; iinfos.at(i); -+ -+ if (d->idHash.value(info.id()) == i) -+ { -+ uniqueInfos << info; -+ } -+ } -+ -+ return uniqueInfos; -+} -+ -+void ImageModel::emitDataChangedForAll() -+{ -+ if (d->infos.isEmpty()) -+ { -+ return; -+ } -+ -+ QModelIndex first = createIndex(0, 0); -+ QModelIndex last = createIndex(d->infos.size() - 1, 0); -+ emit dataChanged(first, last); -+} -+ -+void ImageModel::emitDataChangedForSelection(const QItemSelection& selection) -+{ -+ if (!selection.isEmpty()) -+ { -+ foreach(const QItemSelectionRange& range, selection) -+ { -+ emit dataChanged(range.topLeft(), range.bottomRight()); -+ } -+ } -+} -+ -+void ImageModel::ensureHasGroupedImages(const ImageInfo& groupLeader) -+{ -+ ensureHasImageInfos(groupLeader.groupedImages()); -+} -+ -+// ------------ Preprocessing ------------- -+ -+void ImageModel::setPreprocessor(QObject* preprocessor) -+{ -+ unsetPreprocessor(d->preprocessor); -+ d->preprocessor = preprocessor; -+} -+ -+void ImageModel::unsetPreprocessor(QObject* preprocessor) -+{ -+ if (preprocessor && d->preprocessor == preprocessor) -+ { -+ disconnect(this, SIGNAL(preprocess(QList,QList)), 0, 0); -+ disconnect(d->preprocessor, 0, this, SLOT(reAddImageInfos(QList,QList))); -+ disconnect(d->preprocessor, 0, this, SLOT(reAddingFinished())); -+ } -+} -+ -+void ImageModel::appendInfos(const QList& infos, const QList& extraValues) -+{ -+ if (infos.isEmpty()) -+ { -+ return; -+ } -+ -+ if (d->preprocessor) -+ { -+ d->reAdding = true; -+ emit preprocess(infos, extraValues); -+ } -+ else -+ { -+ publiciseInfos(infos, extraValues); -+ } -+} -+ -+void ImageModel::appendInfosChecked(const QList& infos, const QList& extraValues) -+{ -+ // This method does deduplication. It is private because in context of readding or refreshing it is of no use. -+ -+ if (extraValues.isEmpty()) -+ { -+ QList checkedInfos; -+ -+ foreach (const ImageInfo& info, infos) -+ { -+ if (!hasImage(info)) -+ { -+ checkedInfos << info; -+ } -+ } -+ -+ appendInfos(checkedInfos, QList()); -+ } -+ else -+ { -+ QList checkedInfos; -+ QList checkedExtraValues; -+ const int size = infos.size(); -+ -+ for (int i=0; i& infos, const QList& extraValues) -+{ -+ // addImageInfos -> appendInfos -> preprocessor -> reAddImageInfos -+ publiciseInfos(infos, extraValues); -+} -+ -+void ImageModel::reAddingFinished() -+{ -+ d->reAdding = false; -+ cleanSituationChecks(); -+} -+ -+void ImageModel::startRefresh() -+{ -+ d->refreshing = true; -+} -+ -+void ImageModel::finishRefresh() -+{ -+ d->refreshing = false; -+ cleanSituationChecks(); -+} -+ -+bool ImageModel::isRefreshing() const -+{ -+ return d->refreshing; -+} -+ -+void ImageModel::cleanSituationChecks() -+{ -+ // For starting an incremental refresh we want a clear situation: -+ // Any remaining batches from non-incremental refreshing subclasses have been received in appendInfos(), -+ // any batches sent to preprocessor for re-adding have been re-added. -+ if (d->refreshing || d->reAdding) -+ { -+ return; -+ } -+ -+ if (!d->pendingInfos.isEmpty()) -+ { -+ appendInfosChecked(d->pendingInfos, d->pendingExtraValues); -+ d->pendingInfos.clear(); -+ d->pendingExtraValues.clear(); -+ cleanSituationChecks(); -+ return; -+ } -+ -+ if (d->incrementalRefreshRequested) -+ { -+ d->incrementalRefreshRequested = false; -+ emit readyForIncrementalRefresh(); -+ } -+ else -+ { -+ emit allRefreshingFinished(); -+ } -+} -+ -+void ImageModel::publiciseInfos(const QList& infos, const QList& extraValues) -+{ -+ if (infos.isEmpty()) -+ { -+ return; -+ } -+ -+ Q_ASSERT(infos.size() == extraValues.size() || (extraValues.isEmpty() && d->extraValues.isEmpty())); -+ -+ emit imageInfosAboutToBeAdded(infos); -+ const int firstNewIndex = d->infos.size(); -+ const int lastNewIndex = d->infos.size() + infos.size() - 1; -+ beginInsertRows(QModelIndex(), firstNewIndex, lastNewIndex); -+ d->infos << infos; -+ d->extraValues << extraValues; -+ -+ for (int i=firstNewIndex; i<=lastNewIndex; ++i) -+ { -+ const ImageInfo& info = d->infos.at(i); -+ qlonglong id = info.id(); -+ d->idHash.insertMulti(id, i); -+ -+ if (d->keepFilePathCache) -+ { -+ d->filePathHash[info.filePath()] = id; -+ } -+ } -+ -+ endInsertRows(); -+ emit imageInfosAdded(infos); -+} -+ -+void ImageModel::requestIncrementalRefresh() -+{ -+ if (d->reAdding) -+ { -+ d->incrementalRefreshRequested = true; -+ } -+ else -+ { -+ emit readyForIncrementalRefresh(); -+ } -+} -+ -+bool ImageModel::hasIncrementalRefreshPending() const -+{ -+ return d->incrementalRefreshRequested; -+} -+ -+void ImageModel::startIncrementalRefresh() -+{ -+ delete d->incrementalUpdater; -+ -+ d->incrementalUpdater = new ImageModelIncrementalUpdater(d); -+} -+ -+void ImageModel::finishIncrementalRefresh() -+{ -+ if (!d->incrementalUpdater) -+ { -+ return; -+ } -+ -+ // remove old entries -+ QList > pairs = d->incrementalUpdater->oldIndexes(); -+ removeRowPairs(pairs); -+ -+ // add new indexes -+ appendInfos(d->incrementalUpdater->newInfos, d->incrementalUpdater->newExtraValues); -+ -+ delete d->incrementalUpdater; -+ d->incrementalUpdater = 0; -+} -+ -+void ImageModel::removeIndex(const QModelIndex& index) -+{ -+ removeIndexes(QList() << index); -+} -+ -+void ImageModel::removeIndexes(const QList& indexes) -+{ -+ QList listIndexes; -+ -+ foreach(const QModelIndex& index, indexes) -+ { -+ if (d->isValid(index)) -+ { -+ listIndexes << index.row(); -+ } -+ } -+ -+ if (listIndexes.isEmpty()) -+ { -+ return; -+ } -+ -+ removeRowPairsWithCheck(ImageModelIncrementalUpdater::toContiguousPairs(listIndexes)); -+} -+ -+void ImageModel::removeImageInfo(const ImageInfo& info) -+{ -+ removeImageInfos(QList() << info); -+} -+ -+void ImageModel::removeImageInfos(const QList& infos) -+{ -+ QList listIndexes; -+ -+ foreach(const ImageInfo& info, infos) -+ { -+ QModelIndex index = indexForImageId(info.id()); -+ -+ if (index.isValid()) -+ { -+ listIndexes << index.row(); -+ } -+ } -+ removeRowPairsWithCheck(ImageModelIncrementalUpdater::toContiguousPairs(listIndexes)); -+} -+ -+void ImageModel::removeImageInfos(const QList& infos, const QList& extraValues) -+{ -+ if (extraValues.isEmpty()) -+ { -+ removeImageInfos(infos); -+ return; -+ } -+ -+ QList listIndexes; -+ -+ for (int i=0; isendRemovalSignals = send; -+} -+ -+template -+static bool pairsContain(const List& list, T value) -+{ -+ typename List::const_iterator middle; -+ typename List::const_iterator begin = list.begin(); -+ typename List::const_iterator end = list.end(); -+ int n = int(end - begin); -+ int half; -+ -+ while (n > 0) -+ { -+ half = n >> 1; -+ middle = begin + half; -+ -+ if (middle->first <= value && middle->second >= value) -+ { -+ return true; -+ } -+ else if (middle->second < value) -+ { -+ begin = middle + 1; -+ n -= half + 1; -+ } -+ else -+ { -+ n = half; -+ } -+ } -+ -+ return false; -+} -+ -+void ImageModel::removeRowPairsWithCheck(const QList >& toRemove) -+{ -+ if (d->incrementalUpdater) -+ { -+ d->incrementalUpdater->aboutToBeRemovedInModel(toRemove); -+ } -+ -+ removeRowPairs(toRemove); -+} -+ -+void ImageModel::removeRowPairs(const QList >& toRemove) -+{ -+ if (toRemove.isEmpty()) -+ { -+ return; -+ } -+ -+ // Remove old indexes -+ // Keep in mind that when calling beginRemoveRows all structures announced to be removed -+ // must still be valid, and this includes our hashes as well, which limits what we can optimize -+ -+ int removedRows = 0, offset = 0; -+ typedef QPair IntPair; // to make foreach macro happy -+ -+ foreach(const IntPair& pair, toRemove) -+ { -+ const int begin = pair.first - offset; -+ const int end = pair.second - offset; // inclusive -+ removedRows = end - begin + 1; -+ -+ // when removing from the list, all subsequent indexes are affected -+ offset += removedRows; -+ -+ QList removedInfos; -+ -+ if (d->sendRemovalSignals) -+ { -+ qCopy(d->infos.begin() + begin, d->infos.begin() + end, removedInfos.begin()); -+ emit imageInfosAboutToBeRemoved(removedInfos); -+ } -+ -+ imageInfosAboutToBeRemoved(begin, end); -+ beginRemoveRows(QModelIndex(), begin, end); -+ -+ // update idHash - which points to indexes of d->infos, and these change now! -+ QHash::iterator it; -+ -+ for (it = d->idHash.begin(); it != d->idHash.end(); ) -+ { -+ if (it.value() >= begin) -+ { -+ if (it.value() > end) -+ { -+ // after the removed interval: adjust index -+ it.value() -= removedRows; -+ } -+ else -+ { -+ // in the removed interval -+ it = d->idHash.erase(it); -+ continue; -+ } -+ } -+ -+ ++it; -+ } -+ -+ // remove from list -+ d->infos.erase(d->infos.begin() + begin, d->infos.begin() + (end + 1)); -+ -+ if (!d->extraValues.isEmpty()) -+ { -+ d->extraValues.erase(d->extraValues.begin() + begin, d->extraValues.begin() + (end + 1)); -+ } -+ -+ endRemoveRows(); -+ -+ if (d->sendRemovalSignals) -+ { -+ emit imageInfosRemoved(removedInfos); -+ } -+ } -+ -+ // tidy up: remove old indexes from file path hash now -+ if (d->keepFilePathCache) -+ { -+ QHash::iterator it; -+ -+ for (it = d->filePathHash.begin(); it != d->filePathHash.end(); ) -+ { -+ if (pairsContain(toRemove, it.value())) -+ { -+ it = d->filePathHash.erase(it); -+ } -+ else -+ { -+ ++it; -+ } -+ } -+ } -+} -+ -+ImageModelIncrementalUpdater::ImageModelIncrementalUpdater(ImageModel::Private* d) -+{ -+ oldIds = d->idHash; -+ oldExtraValues = d->extraValues; -+} -+ -+void ImageModelIncrementalUpdater::appendInfos(const QList& infos, const QList& extraValues) -+{ -+ if (extraValues.isEmpty()) -+ { -+ foreach(const ImageInfo& info, infos) -+ { -+ QHash::iterator it = oldIds.find(info.id()); -+ -+ if (it != oldIds.end()) -+ { -+ oldIds.erase(it); -+ } -+ else -+ { -+ newInfos << info; -+ } -+ } -+ } -+ else -+ { -+ for (int i=0; i::iterator it; -+ -+ for (it = oldIds.find(info.id()); it != oldIds.end() && it.key() == info.id(); ++it) -+ { -+ // first check is for bug #262596. Not sure if needed. -+ if (it.value() < oldExtraValues.size() && extraValues.at(i) == oldExtraValues.at(it.value())) -+ { -+ found = true; -+ break; -+ } -+ } -+ -+ if (found) -+ { -+ oldIds.erase(it); -+ // do not erase from oldExtraValues - oldIds is a hash id -> index. -+ } -+ else -+ { -+ newInfos << info; -+ newExtraValues << extraValues.at(i); -+ } -+ } -+ } -+} -+ -+void ImageModelIncrementalUpdater::aboutToBeRemovedInModel(const IntPairList& toRemove) -+{ -+ modelRemovals << toRemove; -+} -+ -+QList > ImageModelIncrementalUpdater::oldIndexes() -+{ -+ // first, apply all changes to indexes by direct removal in model -+ // while the updater was active -+ foreach(const IntPairList& list, modelRemovals) -+ { -+ int removedRows = 0, offset = 0; -+ -+ foreach(const IntPair& pair, list) -+ { -+ const int begin = pair.first - offset; -+ const int end = pair.second - offset; // inclusive -+ removedRows = end - begin + 1; -+ -+ // when removing from the list, all subsequent indexes are affected -+ offset += removedRows; -+ -+ // update idHash - which points to indexes of d->infos, and these change now! -+ QHash::iterator it; -+ -+ for (it = oldIds.begin(); it != oldIds.end(); ) -+ { -+ if (it.value() >= begin) -+ { -+ if (it.value() > end) -+ { -+ // after the removed interval: adjust index -+ it.value() -= removedRows; -+ } -+ else -+ { -+ // in the removed interval -+ it = oldIds.erase(it); -+ continue; -+ } -+ } -+ -+ ++it; -+ } -+ } -+ } -+ -+ modelRemovals.clear(); -+ -+ return toContiguousPairs(oldIds.values()); -+} -+ -+QList > ImageModelIncrementalUpdater::toContiguousPairs(const QList& unsorted) -+{ -+ // Take the given indices and return them as contiguous pairs [begin, end] -+ -+ QList > pairs; -+ -+ if (unsorted.isEmpty()) -+ { -+ return pairs; -+ } -+ -+ QList indices(unsorted); -+ qSort(indices); -+ -+ QPair pair(indices.first(), indices.first()); -+ -+ for (int i=1; iisValid(index)) -+ { -+ return QVariant(); -+ } -+ -+ switch (role) -+ { -+ case Qt::DisplayRole: -+ case Qt::ToolTipRole: -+ return d->infos.at(index.row()).name(); -+ -+ case ImageModelPointerRole: -+ return QVariant::fromValue(const_cast(this)); -+ -+ case ImageModelInternalId: -+ return index.row(); -+ -+ case CreationDateRole: -+ return d->infos.at(index.row()).dateTime(); -+ -+ case ExtraDataRole: -+ -+ if (d->extraValueValid(index)) -+ { -+ return d->extraValues.at(index.row()); -+ } -+ else -+ { -+ return QVariant(); -+ } -+ -+ case ExtraDataDuplicateCount: -+ { -+ qlonglong id = d->infos.at(index.row()).id(); -+ return numberOfIndexesForImageId(id); -+ } -+ } -+ -+ return QVariant(); -+} -+ -+QVariant ImageModel::headerData(int section, Qt::Orientation orientation, int role) const -+{ -+ Q_UNUSED(section) -+ Q_UNUSED(orientation) -+ Q_UNUSED(role) -+ return QVariant(); -+} -+ -+int ImageModel::rowCount(const QModelIndex& parent) const -+{ -+ if (parent.isValid()) -+ { -+ return 0; -+ } -+ -+ return d->infos.size(); -+} -+ -+Qt::ItemFlags ImageModel::flags(const QModelIndex& index) const -+{ -+ if (!d->isValid(index)) -+ { -+ return 0; -+ } -+ -+ Qt::ItemFlags f = Qt::ItemIsSelectable | Qt::ItemIsEnabled; -+ -+ f |= dragDropFlags(index); -+ -+ return f; -+} -+ -+QModelIndex ImageModel::index(int row, int column, const QModelIndex& parent) const -+{ -+ if (column != 0 || row < 0 || parent.isValid() || row >= d->infos.size()) -+ { -+ return QModelIndex(); -+ } -+ -+ return createIndex(row, 0); -+} -+ -+// ------------ Database watch ------------- -+ -+void ImageModel::slotImageChange(const ImageChangeset& changeset) -+{ -+ if (d->infos.isEmpty()) -+ { -+ return; -+ } -+ -+ if (d->watchFlags & changeset.changes()) -+ { -+ QItemSelection items; -+ -+ foreach(const qlonglong& id, changeset.ids()) -+ { -+ QModelIndex index = indexForImageId(id); -+ -+ if (index.isValid()) -+ { -+ items.select(index, index); -+ } -+ } -+ -+ if (!items.isEmpty()) -+ { -+ emitDataChangedForSelection(items); -+ emit imageChange(changeset, items); -+ } -+ } -+} -+ -+void ImageModel::slotImageTagChange(const ImageTagChangeset& changeset) -+{ -+ if (d->infos.isEmpty()) -+ { -+ return; -+ } -+ -+ QItemSelection items; -+ -+ foreach(const qlonglong& id, changeset.ids()) -+ { -+ QModelIndex index = indexForImageId(id); -+ -+ if (index.isValid()) -+ { -+ items.select(index, index); -+ } -+ } -+ -+ if (!items.isEmpty()) -+ { -+ emitDataChangedForSelection(items); -+ emit imageTagChange(changeset, items); -+ } -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagemodel.h b/libs/database/models/imagemodel.h -new file mode 100644 -index 0000000..dcf94c2 ---- /dev/null -+++ b/libs/database/models/imagemodel.h -@@ -0,0 +1,364 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGEMODEL_H -+#define IMAGEMODEL_H -+ -+// Qt includes -+ -+#include -+ -+// Local includes -+ -+#include "dragdropimplementations.h" -+#include "imageinfo.h" -+#include "digikam_export.h" -+ -+class QItemSelection; -+ -+namespace Digikam -+{ -+ -+class ImageChangeset; -+class ImageTagChangeset; -+ -+namespace DatabaseFields -+{ -+class Set; -+} -+ -+class DIGIKAM_DATABASE_EXPORT ImageModel : public QAbstractListModel, public DragDropModelImplementation -+{ -+ Q_OBJECT -+ -+public: -+ -+ enum ImageModelRoles -+ { -+ /// An ImageModel* pointer to this model -+ ImageModelPointerRole = Qt::UserRole, -+ ImageModelInternalId = Qt::UserRole + 1, -+ /// Returns a thumbnail pixmap. May be implemented by subclasses. -+ /// Returns either a valid pixmap or a null QVariant. -+ ThumbnailRole = Qt::UserRole + 2, -+ /// Returns a QDateTime with the creation date -+ CreationDateRole = Qt::UserRole + 3, -+ /// Return (optional) extraData field -+ ExtraDataRole = Qt::UserRole + 5, -+ /// Returns the number of duplicate indexes for the same image id -+ ExtraDataDuplicateCount = Qt::UserRole + 6, -+ -+ // Roles which are defined here but not implemented by ImageModel -+ /// Returns position of item in Left Light Table preview. -+ LTLeftPanelRole = Qt::UserRole + 50, -+ /// Returns position of item in Right Light Table preview. -+ LTRightPanelRole = Qt::UserRole + 51, -+ -+ // For use by subclasses -+ SubclassRoles = Qt::UserRole + 100, -+ // For use by filter models -+ FilterModelRoles = Qt::UserRole + 500 -+ }; -+ -+public: -+ -+ explicit ImageModel(QObject* parent = 0); -+ ~ImageModel(); -+ -+ /** If a cache is kept, lookup by file path is fast, -+ * without a cache it is O(n). Default is false. -+ */ -+ void setKeepsFilePathCache(bool keepCache); -+ bool keepsFilePathCache() const; -+ -+ /** Set a set of database fields to watch. -+ * If either of these is changed, dataChanged() will be emitted. -+ * Default is no flag (no signal will be emitted). -+ */ -+ void setWatchFlags(const DatabaseFields::Set& set); -+ -+ /** Returns the ImageInfo object, reference or image id from the underlying data -+ * pointed to by the index. -+ * If the index is not valid, imageInfo will return a null ImageInfo, imageId will -+ * return 0, imageInfoRef must not be called with an invalid index. -+ */ -+ ImageInfo imageInfo(const QModelIndex& index) const; -+ ImageInfo& imageInfoRef(const QModelIndex& index) const; -+ qlonglong imageId(const QModelIndex& index) const; -+ QList imageInfos(const QList& indexes) const; -+ QList imageIds(const QList& indexes) const; -+ -+ /** Returns the ImageInfo object, reference or image id from the underlying data -+ * of the given row (parent is the invalid QModelIndex, column is 0). -+ * Note that imageInfoRef will crash if index is invalid. -+ */ -+ ImageInfo imageInfo(int row) const; -+ ImageInfo& imageInfoRef(int row) const; -+ qlonglong imageId(int row) const; -+ -+ /** Return the index for the given ImageInfo or id, if contained in this model. -+ */ -+ QModelIndex indexForImageInfo(const ImageInfo& info) const; -+ QModelIndex indexForImageInfo(const ImageInfo& info, const QVariant& extraValue) const; -+ QModelIndex indexForImageId(qlonglong id) const; -+ QModelIndex indexForImageId(qlonglong id, const QVariant& extraValue) const; -+ QList indexesForImageInfo(const ImageInfo& info) const; -+ QList indexesForImageId(qlonglong id) const; -+ -+ int numberOfIndexesForImageInfo(const ImageInfo& info) const; -+ int numberOfIndexesForImageId(qlonglong id) const; -+ -+ /** Returns the index or ImageInfo object from the underlying data -+ * for the given file path. This is fast if keepsFilePathCache is enabled. -+ * The file path is as returned by ImageInfo.filePath(). -+ * In case of multiple occurrences of the same file, the simpler variants return -+ * any one found first, use the QList methods to retrieve all occurrences. -+ */ -+ QModelIndex indexForPath(const QString& filePath) const; -+ ImageInfo imageInfo(const QString& filePath) const; -+ QList indexesForPath(const QString& filePath) const; -+ QList imageInfos(const QString& filePath) const; -+ -+ /** Main entry point for subclasses adding image infos to the model. -+ * If you list entries not unique per image id, you must add an extraValue -+ * so that every entry is unique by imageId and extraValues. -+ * Please note that these methods do not prevent addition of duplicate entries. -+ */ -+ void addImageInfo(const ImageInfo& info); -+ void addImageInfos(const QList& infos); -+ void addImageInfos(const QList& infos, const QList& extraValues); -+ -+ /** Clears image infos and resets model. -+ */ -+ void clearImageInfos(); -+ -+ /** Clears and adds the infos. -+ */ -+ void setImageInfos(const QList& infos); -+ -+ /** -+ * Directly remove the given indexes or infos from the model. -+ */ -+ void removeIndex(const QModelIndex& indexes); -+ void removeIndexes(const QList& indexes); -+ void removeImageInfo(const ImageInfo& info); -+ void removeImageInfos(const QList& infos); -+ void removeImageInfos(const QList& infos, const QList& extraValues); -+ -+ /** -+ * addImageInfo() is asynchronous if a prepocessor is set. -+ * This method first adds the info, synchronously. -+ * Only afterwards, the preprocessor will have the opportunity to process it. -+ * This method also bypasses any incremental updates. -+ * Please note that these methods do not prevent addition of duplicate entries. -+ */ -+ void addImageInfoSynchronously(const ImageInfo& info); -+ void addImageInfosSynchronously(const QList& infos); -+ void addImageInfosSynchronously(const QList& infos, const QList& extraValues); -+ -+ /** -+ * Add the given entries. Method returns immediately, the -+ * addition may happen later asynchronously. -+ * These methods prevent the addition of duplicate entries. -+ */ -+ void ensureHasImageInfo(const ImageInfo& info); -+ void ensureHasImageInfos(const QList& infos); -+ void ensureHasImageInfos(const QList& infos, const QList& extraValues); -+ -+ /** -+ * Ensure that all images grouped on the given leader are contained in the model. -+ */ -+ void ensureHasGroupedImages(const ImageInfo& groupLeader); -+ -+ QList imageInfos() const; -+ QList imageIds() const; -+ QList uniqueImageInfos() const; -+ -+ bool hasImage(qlonglong id) const; -+ bool hasImage(const ImageInfo& info) const; -+ bool hasImage(const ImageInfo& info, const QVariant& extraValue) const; -+ bool hasImage(qlonglong id, const QVariant& extraValue) const; -+ -+ bool isEmpty() const; -+ -+ // Drag and Drop -+ DECLARE_MODEL_DRAG_DROP_METHODS -+ -+ /** -+ * Install an object as a preprocessor for ImageInfos added to this model. -+ * For every QList of ImageInfos added to addImageInfo, the signal preprocess() -+ * will be emitted. The preprocessor may process the items and shall then readd -+ * them by calling reAddImageInfos(). It may take some time to process. -+ * It shall discard any held infos when the modelReset() signal is sent. -+ * It shall call readdFinished() when no reset occurred and all infos on the way have been readded. -+ * This means that only after calling this method, you shall make three connections -+ * (preprocess -> your slot, your signal -> reAddImageInfos, your signal -> reAddingFinished) -+ * and make or already hold a connection modelReset() -> your slot. -+ * There is only one preprocessor at a time, a previously set object will be disconnected. -+ */ -+ void setPreprocessor(QObject* processor); -+ void unsetPreprocessor(QObject* processor); -+ -+ /** -+ * Returns true if this model is currently refreshing. -+ * For a preprocessor this means that, although the preprocessor may currently have -+ * processed all it got, more batches are to be expected. -+ */ -+ bool isRefreshing() const; -+ -+ /** -+ * Enable sending of imageInfosAboutToBeRemoved and imageInfosRemoved signals. -+ * Default: false -+ */ -+ void setSendRemovalSignals(bool send); -+ -+ virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -+ virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; -+ virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; -+ virtual Qt::ItemFlags flags(const QModelIndex& index) const; -+ virtual QModelIndex index(int row, int column = 0, const QModelIndex& parent = QModelIndex()) const; -+ -+ /** Retrieves the imageInfo object from the data() method of the given index. -+ * The index may be from a QSortFilterProxyModel as long as an ImageModel is at the end. */ -+ static ImageInfo retrieveImageInfo(const QModelIndex& index); -+ static qlonglong retrieveImageId(const QModelIndex& index); -+ -+Q_SIGNALS: -+ -+ /** Informs that ImageInfos will be added to the model. -+ * This signal is sent before the model data is changed and views are informed. -+ */ -+ void imageInfosAboutToBeAdded(const QList& infos); -+ -+ /** Informs that ImageInfos have been added to the model. -+ * This signal is sent after the model data is changed and views are informed. -+ */ -+ void imageInfosAdded(const QList& infos); -+ -+ /** Informs that ImageInfos will be removed from the model. -+ * This signal is sent before the model data is changed and views are informed. -+ * Note: You need to explicitly enable sending of this signal. It is not sent -+ * in clearImageInfos(). -+ */ -+ void imageInfosAboutToBeRemoved(const QList& infos); -+ -+ /** Informs that ImageInfos have been removed from the model. -+ * This signal is sent after the model data is changed and views are informed. * -+ * Note: You need to explicitly enable sending of this signal. It is not sent -+ * in clearImageInfos(). -+ */ -+ void imageInfosRemoved(const QList& infos); -+ -+ /** Connect to this signal only if you are the current preprocessor. -+ */ -+ void preprocess(const QList& infos, const QList&); -+ void processAdded(const QList& infos, const QList&); -+ -+ /** If an ImageChangeset affected indexes of this model with changes as set in watchFlags(), -+ * this signal contains the changeset and the affected indexes. -+ */ -+ void imageChange(const ImageChangeset&, const QItemSelection&); -+ -+ /** If an ImageTagChangeset affected indexes of this model, -+ * this signal contains the changeset and the affected indexes. -+ */ -+ void imageTagChange(const ImageTagChangeset&, const QItemSelection&); -+ -+ /** Signals that the model is right now ready to start an incremental refresh. -+ * This is guaranteed only for the scope of emitting this signal. -+ */ -+ void readyForIncrementalRefresh(); -+ -+ /** Signals that the model has finished currently with all scheduled -+ * refreshing, full or incremental, and all preprocessing. -+ * The model is in polished, clean situation right now. -+ */ -+ void allRefreshingFinished(); -+ -+public Q_SLOTS: -+ -+ void reAddImageInfos(const QList& infos, const QList& extraValues); -+ void reAddingFinished(); -+ -+protected: -+ -+ /** Subclasses that add ImageInfos in batches shall call startRefresh() -+ * when they start sending batches and finishRefresh() when they have finished. -+ * No incremental refreshes will be started while listing. -+ * A clearImageInfos() always stops listing, calling finishRefresh() is then not necessary. -+ */ -+ void startRefresh(); -+ void finishRefresh(); -+ -+ /** As soon as the model is ready to start an incremental refresh, the signal -+ * readyForIncrementalRefresh() will be emitted. The signal will be emitted inline -+ * if the model is ready right now. -+ */ -+ void requestIncrementalRefresh(); -+ bool hasIncrementalRefreshPending() const; -+ -+ /** Starts an incremental refresh operation. You shall only call this method from a slot -+ * connected to readyForIncrementalRefresh(). To initiate an incremental refresh, -+ * call requestIncrementalRefresh(). -+ */ -+ void startIncrementalRefresh(); -+ void finishIncrementalRefresh(); -+ -+ void emitDataChangedForAll(); -+ void emitDataChangedForSelection(const QItemSelection& selection); -+ -+ // Called when the internal storage is cleared -+ virtual void imageInfosCleared() {}; -+ -+ // Called before rowsAboutToBeRemoved -+ virtual void imageInfosAboutToBeRemoved(int /*begin*/, int /*end*/) {}; -+ -+protected Q_SLOTS: -+ -+ virtual void slotImageChange(const ImageChangeset& changeset); -+ virtual void slotImageTagChange(const ImageTagChangeset& changeset); -+ -+private: -+ -+ void appendInfos(const QList& infos, const QList& extraValues); -+ void appendInfosChecked(const QList& infos, const QList& extraValues); -+ void publiciseInfos(const QList& infos, const QList& extraValues); -+ void cleanSituationChecks(); -+ void removeRowPairsWithCheck(const QList >& toRemove); -+ void removeRowPairs(const QList >& toRemove); -+ -+public: -+ -+ // Declared public because it's used in ImageModelIncrementalUpdater class -+ class Private; -+ -+private: -+ -+ Private* const d; -+}; -+ -+} // namespace Digikam -+ -+Q_DECLARE_METATYPE(Digikam::ImageModel*) -+ -+#endif // IMAGEMODEL_H -diff --git a/libs/database/models/imagesortsettings.cpp b/libs/database/models/imagesortsettings.cpp -new file mode 100644 -index 0000000..39ee6e1 ---- /dev/null -+++ b/libs/database/models/imagesortsettings.cpp -@@ -0,0 +1,400 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Filter values for use with ImageFilterModel -+ * -+ * Copyright (C) 2009 by Marcel Wiesweg -+ * Copyright (C) 2014 by Mohamed Anwer -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagesortsettings.h" -+ -+// Qt includes -+ -+#include -+#include -+ -+// Local includes -+ -+#include "coredbfields.h" -+#include "imageinfo.h" -+ -+namespace Digikam -+{ -+ -+ImageSortSettings::ImageSortSettings() -+{ -+ categorizationMode = NoCategories; -+ categorizationSortOrder = DefaultOrder; -+ categorizationCaseSensitivity = Qt::CaseSensitive; -+ sortRole = SortByFileName; -+ sortOrder = DefaultOrder; -+ strTypeNatural = true; -+ sortCaseSensitivity = Qt::CaseSensitive; -+ currentCategorizationSortOrder = Qt::AscendingOrder; -+ currentSortOrder = Qt::AscendingOrder; -+} -+ -+bool ImageSortSettings::operator==(const ImageSortSettings& other) const -+{ -+ return -+ categorizationMode == other.categorizationMode && -+ categorizationSortOrder == other.categorizationSortOrder && -+ categorizationCaseSensitivity == other.categorizationCaseSensitivity && -+ sortRole == other.sortRole && -+ sortOrder == other.sortOrder && -+ sortCaseSensitivity == other.sortCaseSensitivity; -+} -+ -+void ImageSortSettings::setCategorizationMode(CategorizationMode mode) -+{ -+ categorizationMode = mode; -+ -+ if (categorizationSortOrder == DefaultOrder) -+ { -+ currentCategorizationSortOrder = defaultSortOrderForCategorizationMode(categorizationMode); -+ } -+} -+ -+void ImageSortSettings::setCategorizationSortOrder(SortOrder order) -+{ -+ categorizationSortOrder = order; -+ -+ if (categorizationSortOrder == DefaultOrder) -+ { -+ currentCategorizationSortOrder = defaultSortOrderForCategorizationMode(categorizationMode); -+ } -+ else -+ { -+ currentCategorizationSortOrder = (Qt::SortOrder)categorizationSortOrder; -+ } -+} -+ -+void ImageSortSettings::setSortRole(SortRole role) -+{ -+ sortRole = role; -+ -+ if (sortOrder == DefaultOrder) -+ { -+ currentSortOrder = defaultSortOrderForSortRole(sortRole); -+ } -+} -+ -+void ImageSortSettings::setSortOrder(SortOrder order) -+{ -+ sortOrder = order; -+ -+ if (sortOrder == DefaultOrder) -+ { -+ currentSortOrder = defaultSortOrderForSortRole(sortRole); -+ } -+ else -+ { -+ currentSortOrder = (Qt::SortOrder)order; -+ } -+} -+ -+void ImageSortSettings::setStringTypeNatural(bool natural) -+{ -+ strTypeNatural = natural; -+} -+ -+Qt::SortOrder ImageSortSettings::defaultSortOrderForCategorizationMode(CategorizationMode mode) -+{ -+ switch (mode) -+ { -+ case NoCategories: -+ case OneCategory: -+ case CategoryByAlbum: -+ case CategoryByFormat: -+ default: -+ return Qt::AscendingOrder; -+ } -+} -+ -+Qt::SortOrder ImageSortSettings::defaultSortOrderForSortRole(SortRole role) -+{ -+ switch (role) -+ { -+ case SortByFileName: -+ case SortByFilePath: -+ return Qt::AscendingOrder; -+ case SortByFileSize: -+ return Qt::DescendingOrder; -+ case SortByModificationDate: -+ case SortByCreationDate: -+ return Qt::AscendingOrder; -+ case SortByRating: -+ case SortByImageSize: -+ return Qt::DescendingOrder; -+ case SortByAspectRatio: -+ return Qt::DescendingOrder; -+ case SortBySimilarity: -+ return Qt::DescendingOrder; -+ default: -+ return Qt::AscendingOrder; -+ } -+} -+ -+int ImageSortSettings::compareCategories(const ImageInfo& left, const ImageInfo& right) const -+{ -+ switch (categorizationMode) -+ { -+ case NoCategories: -+ case OneCategory: -+ return 0; -+ case CategoryByAlbum: -+ { -+ int leftAlbum = left.albumId(); -+ int rightAlbum = right.albumId(); -+ -+ // return comparation result -+ if (leftAlbum == rightAlbum) -+ { -+ return 0; -+ } -+ else if (lessThanByOrder(leftAlbum, rightAlbum, currentCategorizationSortOrder)) -+ { -+ return -1; -+ } -+ else -+ { -+ return 1; -+ } -+ } -+ case CategoryByFormat: -+ { -+ return naturalCompare(left.format(), right.format(), -+ currentCategorizationSortOrder, categorizationCaseSensitivity, strTypeNatural); -+ } -+ default: -+ return 0; -+ } -+} -+ -+bool ImageSortSettings::lessThan(const ImageInfo& left, const ImageInfo& right) const -+{ -+ int result = compare(left, right, sortRole); -+ -+ if (result != 0) -+ { -+ return result < 0; -+ } -+ -+ // are they identical? -+ if (left == right) -+ { -+ return false; -+ } -+ -+ // If left and right equal for first sort order, use a hierarchy of all sort orders -+ if ( (result = compare(left, right, SortByFileName)) != 0) -+ { -+ return result < 0; -+ } -+ -+ if ( (result = compare(left, right, SortByCreationDate)) != 0) -+ { -+ return result < 0; -+ } -+ -+ if ( (result = compare(left, right, SortByModificationDate)) != 0) -+ { -+ return result < 0; -+ } -+ -+ if ( (result = compare(left, right, SortByFilePath)) != 0) -+ { -+ return result < 0; -+ } -+ -+ if ( (result = compare(left, right, SortByFileSize)) != 0) -+ { -+ return result < 0; -+ } -+ -+ if ( (result = compare(left, right, SortBySimilarity)) != 0) -+ { -+ return result < 0; -+ } -+ -+ return false; -+} -+ -+int ImageSortSettings::compare(const ImageInfo& left, const ImageInfo& right) const -+{ -+ return compare(left, right, sortRole); -+} -+ -+int ImageSortSettings::compare(const ImageInfo& left, const ImageInfo& right, SortRole role) const -+{ -+ switch (role) -+ { -+ case SortByFileName: -+ { -+ bool versioning = (left.name().contains(QLatin1String("_v"), Qt::CaseInsensitive) || -+ right.name().contains(QLatin1String("_v"), Qt::CaseInsensitive)); -+ return naturalCompare(left.name(), right.name(), currentSortOrder, sortCaseSensitivity, strTypeNatural, versioning); -+ } -+ case SortByFilePath: -+ return naturalCompare(left.filePath(), right.filePath(), currentSortOrder, sortCaseSensitivity, strTypeNatural); -+ case SortByFileSize: -+ return compareByOrder(left.fileSize(), right.fileSize(), currentSortOrder); -+ case SortByModificationDate: -+ return compareByOrder(left.modDateTime(), right.modDateTime(), currentSortOrder); -+ case SortByCreationDate: -+ return compareByOrder(left.dateTime(), right.dateTime(), currentSortOrder); -+ case SortByRating: -+ // I have the feeling that inverting the sort order for rating is the natural order -+ return - compareByOrder(left.rating(), right.rating(), currentSortOrder); -+ case SortByImageSize: -+ { -+ QSize leftSize = left.dimensions(); -+ QSize rightSize = right.dimensions(); -+ int leftPixels = leftSize.width() * leftSize.height(); -+ int rightPixels = rightSize.width() * rightSize.height(); -+ return compareByOrder(leftPixels, rightPixels, currentSortOrder); -+ } -+ case SortByAspectRatio: -+ { -+ QSize leftSize = left.dimensions(); -+ QSize rightSize = right.dimensions(); -+ int leftAR = (double(leftSize.width()) / double(leftSize.height())) * 1000000; -+ int rightAR = (double(rightSize.width()) / double(rightSize.height())) * 1000000; -+ return compareByOrder(leftAR, rightAR, currentSortOrder); -+ } -+ case SortBySimilarity: -+ { -+ qlonglong leftReferenceImageId = left.currentReferenceImage(); -+ qlonglong rightReferenceImageId = right.currentReferenceImage(); -+ // make sure that the original image has always the highest similarity. -+ double leftSimilarity = left.id() == leftReferenceImageId ? 1.1 : left.currentSimilarity(); -+ double rightSimilarity = right.id() == rightReferenceImageId ? 1.1 : right.currentSimilarity(); -+ return compareByOrder(leftSimilarity, rightSimilarity, currentSortOrder); -+ } -+ default: -+ return 1; -+ } -+} -+ -+bool ImageSortSettings::lessThan(const QVariant& left, const QVariant& right) const -+{ -+ if (left.type() != right.type()) -+ { -+ return false; -+ } -+ -+ switch (left.type()) -+ { -+ case QVariant::Int: -+ return compareByOrder(left.toInt(), right.toInt(), currentSortOrder); -+ case QVariant::UInt: -+ return compareByOrder(left.toUInt(), right.toUInt(), currentSortOrder); -+ case QVariant::LongLong: -+ return compareByOrder(left.toLongLong(), right.toLongLong(), currentSortOrder); -+ case QVariant::ULongLong: -+ return compareByOrder(left.toULongLong(), right.toULongLong(), currentSortOrder); -+ case QVariant::Double: -+ return compareByOrder(left.toDouble(), right.toDouble(), currentSortOrder); -+ case QVariant::Date: -+ return compareByOrder(left.toDate(), right.toDate(), currentSortOrder); -+ case QVariant::DateTime: -+ return compareByOrder(left.toDateTime(), right.toDateTime(), currentSortOrder); -+ case QVariant::Time: -+ return compareByOrder(left.toTime(), right.toTime(), currentSortOrder); -+ case QVariant::Rect: -+ case QVariant::RectF: -+ { -+ QRectF rectLeft = left.toRectF(); -+ QRectF rectRight = right.toRectF(); -+ int result; -+ -+ if ((result = compareByOrder(rectLeft.top(), rectRight.top(), currentSortOrder)) != 0) -+ { -+ return result < 0; -+ } -+ -+ if ((result = compareByOrder(rectLeft.left(), rectRight.left(), currentSortOrder)) != 0) -+ { -+ return result < 0; -+ } -+ -+ QSizeF sizeLeft = rectLeft.size(), sizeRight = rectRight.size(); -+ -+ if ((result = compareByOrder(sizeLeft.width()*sizeLeft.height(), sizeRight.width()*sizeRight.height(), currentSortOrder)) != 0) -+ { -+ return result < 0; -+ } -+ // FIXME: fall through?? If not, add "break" here -+ } -+ default: -+ return naturalCompare(left.toString(), right.toString(), currentSortOrder, sortCaseSensitivity, strTypeNatural); -+ } -+} -+ -+DatabaseFields::Set ImageSortSettings::watchFlags() const -+{ -+ DatabaseFields::Set set; -+ -+ switch (sortRole) -+ { -+ case SortByFileName: -+ set |= DatabaseFields::Name; -+ break; -+ case SortByFilePath: -+ set |= DatabaseFields::Name; -+ break; -+ case SortByFileSize: -+ set |= DatabaseFields::FileSize; -+ break; -+ case SortByModificationDate: -+ set |= DatabaseFields::ModificationDate; -+ break; -+ case SortByCreationDate: -+ set |= DatabaseFields::CreationDate; -+ break; -+ case SortByRating: -+ set |= DatabaseFields::Rating; -+ break; -+ case SortByImageSize: -+ set |= DatabaseFields::Width | DatabaseFields::Height; -+ break; -+ case SortByAspectRatio: -+ set |= DatabaseFields::Width | DatabaseFields::Height; -+ break; -+ case SortBySimilarity: -+ // TODO: Not sure what to do here.... -+ set |= DatabaseFields::Name; -+ break; -+ } -+ -+ switch (categorizationMode) -+ { -+ case NoCategories: -+ case OneCategory: -+ case CategoryByAlbum: -+ break; -+ case CategoryByFormat: -+ set |= DatabaseFields::Format; -+ break; -+ } -+ -+ return set; -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagesortsettings.h b/libs/database/models/imagesortsettings.h -new file mode 100644 -index 0000000..2a5fd8c ---- /dev/null -+++ b/libs/database/models/imagesortsettings.h -@@ -0,0 +1,225 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-05-31 -+ * Description : Sort settings for use with ImageFilterModel -+ * -+ * Copyright (C) 2009 by Marcel Wiesweg -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGESORTSETTINGS_H -+#define IMAGESORTSETTINGS_H -+ -+// Qt includes -+ -+#include -+#include -+#include -+#include -+#include -+ -+// Local includes -+ -+#include "digikam_export.h" -+ -+namespace Digikam -+{ -+ -+class ImageInfo; -+ -+namespace DatabaseFields -+{ -+ class Set; -+} -+ -+class DIGIKAM_DATABASE_EXPORT ImageSortSettings -+{ -+public: -+ -+ ImageSortSettings(); -+ -+ bool operator==(const ImageSortSettings& other) const; -+ -+ /** Compares the categories of left and right. -+ * Return -1 if left is less than right, 0 if both fall in the same category, -+ * and 1 if left is greater than right. -+ * Adheres to set categorization mode and current category sort order. -+ */ -+ int compareCategories(const ImageInfo& left, const ImageInfo& right) const; -+ -+ /** Returns true if left is less than right. -+ * Adheres to current sort role and sort order. -+ */ -+ bool lessThan(const ImageInfo& left, const ImageInfo& right) const; -+ -+ /** Compares the ImageInfos left and right. -+ * Return -1 if left is less than right, 1 if left is greater than right, -+ * and 0 if left equals right comparing the current sort role's value. -+ * Adheres to set sort role and sort order. -+ */ -+ int compare(const ImageInfo& left, const ImageInfo& right) const; -+ -+ /** Returns true if left QVariant is less than right. -+ * Adheres to current sort role and sort order. -+ * Use for extraValue, if necessary. -+ */ -+ bool lessThan(const QVariant& left, const QVariant& right) const; -+ -+ enum SortOrder -+ { -+ AscendingOrder = Qt::AscendingOrder, -+ DescendingOrder = Qt::DescendingOrder, -+ DefaultOrder /// sort order depends on the chosen sort role -+ }; -+ -+ /// --- Categories --- -+ -+ enum CategorizationMode -+ { -+ NoCategories, /// categorization switched off -+ OneCategory, /// all items in one global category -+ CategoryByAlbum, -+ CategoryByFormat -+ }; -+ -+ CategorizationMode categorizationMode; -+ SortOrder categorizationSortOrder; -+ -+ void setCategorizationMode(CategorizationMode mode); -+ void setCategorizationSortOrder(SortOrder order); -+ -+ /// Only Ascending or Descending, never DefaultOrder -+ Qt::SortOrder currentCategorizationSortOrder; -+ Qt::CaseSensitivity categorizationCaseSensitivity; -+ -+ bool isCategorized() const { return categorizationMode >= CategoryByAlbum; } -+ -+ /// --- Image Sorting --- -+ -+ enum SortRole -+ { -+ // Note: For legacy reasons, the order of the first five entries must remain unchanged -+ SortByFileName, -+ SortByFilePath, -+ SortByCreationDate, -+ SortByFileSize, -+ SortByRating, -+ SortByModificationDate, -+ SortByImageSize, // pixel number -+ SortByAspectRatio, // width / height * 100000 -+ SortBySimilarity -+ }; -+ -+ SortRole sortRole; -+ SortOrder sortOrder; -+ bool strTypeNatural; -+ -+ void setSortRole(SortRole role); -+ void setSortOrder(SortOrder order); -+ void setStringTypeNatural(bool natural); -+ -+ Qt::SortOrder currentSortOrder; -+ Qt::CaseSensitivity sortCaseSensitivity; -+ -+ int compare(const ImageInfo& left, const ImageInfo& right, SortRole sortRole) const; -+ -+ // --- --- -+ -+ static Qt::SortOrder defaultSortOrderForCategorizationMode(CategorizationMode mode); -+ static Qt::SortOrder defaultSortOrderForSortRole(SortRole role); -+ -+ /// --- Change notification --- -+ -+ /** Returns database fields a change in which would affect the current sorting. -+ */ -+ DatabaseFields::Set watchFlags() const; -+ -+ /// --- Utilities --- -+ -+ /** Returns a < b if sortOrder is Ascending, or b < a if order is descending. -+ */ -+ template -+ static inline bool lessThanByOrder(const T& a, const T& b, Qt::SortOrder sortOrder) -+ { -+ if (sortOrder == Qt::AscendingOrder) -+ { -+ return a < b; -+ } -+ else -+ { -+ return b < a; -+ } -+ } -+ -+ /** Returns the usual compare result of -1, 0, or 1 for lessThan, equals and greaterThan. -+ */ -+ template -+ static inline int compareValue(const T& a, const T& b) -+ { -+ if (a == b) -+ { -+ return 0; -+ } -+ -+ if (a < b) -+ { -+ return -1; -+ } -+ else -+ { -+ return 1; -+ } -+ } -+ -+ /** Takes a typical result from a compare method (0 is equal, -1 is less than, 1 is greater than) -+ * and applies the given sort order to it. -+ */ -+ static inline int compareByOrder(int compareResult, Qt::SortOrder sortOrder) -+ { -+ if (sortOrder == Qt::AscendingOrder) -+ { -+ return compareResult; -+ } -+ else -+ { -+ return - compareResult; -+ } -+ } -+ -+ template -+ static inline int compareByOrder(const T& a, const T& b, Qt::SortOrder sortOrder) -+ { -+ return compareByOrder(compareValue(a, b), sortOrder); -+ } -+ -+ /** Compares the two string by natural comparison and adheres to given sort order -+ */ -+ static inline int naturalCompare(const QString& a, const QString& b, Qt::SortOrder sortOrder, -+ Qt::CaseSensitivity caseSensitive = Qt::CaseSensitive, -+ bool natural = true, bool versioning = false) -+ { -+ QCollator collator; -+ collator.setNumericMode(natural); -+ collator.setIgnorePunctuation(versioning); -+ collator.setCaseSensitivity(caseSensitive); -+ return (compareByOrder(collator.compare(a, b), sortOrder)); -+ } -+}; -+ -+} // namespace Digikam -+ -+#endif // IMAGESORTSETTINGS_H -diff --git a/libs/database/models/imagethumbnailmodel.cpp b/libs/database/models/imagethumbnailmodel.cpp -new file mode 100644 -index 0000000..b7f5661 ---- /dev/null -+++ b/libs/database/models/imagethumbnailmodel.cpp -@@ -0,0 +1,323 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries with support for thumbnail loading -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011-2017 by Gilles Caulier -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imagethumbnailmodel.h" -+ -+// Qt includes -+ -+#include -+ -+// Local includes -+ -+#include "digikam_debug.h" -+#include "thumbnailloadthread.h" -+#include "digikam_export.h" -+#include "digikam_globals.h" -+ -+namespace Digikam -+{ -+ -+class ImageThumbnailModel::ImageThumbnailModelPriv -+{ -+public: -+ -+ ImageThumbnailModelPriv() : -+ thread(0), -+ preloadThread(0), -+ thumbSize(0), -+ lastGlobalThumbSize(0), -+ preloadThumbSize(0), -+ emitDataChanged(true) -+ { -+ staticListContainingThumbnailRole << ImageModel::ThumbnailRole; -+ } -+ -+ ThumbnailLoadThread* thread; -+ ThumbnailLoadThread* preloadThread; -+ ThumbnailSize thumbSize; -+ ThumbnailSize lastGlobalThumbSize; -+ ThumbnailSize preloadThumbSize; -+ QRect detailRect; -+ QVector staticListContainingThumbnailRole; -+ -+ bool emitDataChanged; -+ -+ int preloadThumbnailSize() const -+ { -+ if (preloadThumbSize.size()) -+ { -+ return preloadThumbSize.size(); -+ } -+ -+ return thumbSize.size(); -+ } -+}; -+ -+ImageThumbnailModel::ImageThumbnailModel(QObject* parent) -+ : ImageModel(parent), d(new ImageThumbnailModelPriv) -+{ -+ setKeepsFilePathCache(true); -+} -+ -+ImageThumbnailModel::~ImageThumbnailModel() -+{ -+ delete d->preloadThread; -+ delete d; -+} -+ -+void ImageThumbnailModel::setThumbnailLoadThread(ThumbnailLoadThread* thread) -+{ -+ d->thread = thread; -+ -+ connect(d->thread, SIGNAL(signalThumbnailLoaded(LoadingDescription,QPixmap)), -+ this, SLOT(slotThumbnailLoaded(LoadingDescription,QPixmap))); -+} -+ -+ThumbnailLoadThread* ImageThumbnailModel::thumbnailLoadThread() const -+{ -+ return d->thread; -+} -+ -+ThumbnailSize ImageThumbnailModel::thumbnailSize() const -+{ -+ return d->thumbSize; -+} -+ -+void ImageThumbnailModel::setThumbnailSize(const ThumbnailSize& size) -+{ -+ d->lastGlobalThumbSize = size; -+ d->thumbSize = size; -+} -+ -+void ImageThumbnailModel::setPreloadThumbnailSize(const ThumbnailSize& size) -+{ -+ d->preloadThumbSize = size; -+} -+ -+void ImageThumbnailModel::setEmitDataChanged(bool emitSignal) -+{ -+ d->emitDataChanged = emitSignal; -+} -+ -+void ImageThumbnailModel::setPreloadThumbnails(bool preload) -+{ -+ if (preload) -+ { -+ if (!d->preloadThread) -+ { -+ d->preloadThread = new ThumbnailLoadThread; -+ d->preloadThread->setPixmapRequested(false); -+ d->preloadThread->setPriority(QThread::LowestPriority); -+ } -+ -+ connect(this, SIGNAL(allRefreshingFinished()), -+ this, SLOT(preloadAllThumbnails())); -+ } -+ else -+ { -+ delete d->preloadThread; -+ d->preloadThread = 0; -+ disconnect(this, SIGNAL(allRefreshingFinished()), -+ this, SLOT(preloadAllThumbnails())); -+ } -+} -+ -+void ImageThumbnailModel::prepareThumbnails(const QList& indexesToPrepare) -+{ -+ prepareThumbnails(indexesToPrepare, d->thumbSize); -+} -+ -+void ImageThumbnailModel::prepareThumbnails(const QList& indexesToPrepare, const ThumbnailSize& thumbSize) -+{ -+ if (!d->thread) -+ { -+ return; -+ } -+ -+ QList ids; -+ foreach(const QModelIndex& index, indexesToPrepare) -+ { -+ ids << imageInfoRef(index).thumbnailIdentifier(); -+ } -+ d->thread->findGroup(ids, thumbSize.size()); -+} -+ -+void ImageThumbnailModel::preloadThumbnails(const QList& infos) -+{ -+ if (!d->preloadThread) -+ { -+ return; -+ } -+ -+ QList ids; -+ foreach(const ImageInfo& info, infos) -+ { -+ ids << info.thumbnailIdentifier(); -+ } -+ d->preloadThread->pregenerateGroup(ids, d->preloadThumbnailSize()); -+} -+ -+void ImageThumbnailModel::preloadThumbnails(const QList& indexesToPreload) -+{ -+ if (!d->preloadThread) -+ { -+ return; -+ } -+ -+ QList ids; -+ foreach(const QModelIndex& index, indexesToPreload) -+ { -+ ids << imageInfoRef(index).thumbnailIdentifier(); -+ } -+ d->preloadThread->stopAllTasks(); -+ d->preloadThread->pregenerateGroup(ids, d->preloadThumbnailSize()); -+} -+ -+void ImageThumbnailModel::preloadAllThumbnails() -+{ -+ preloadThumbnails(imageInfos()); -+} -+ -+void ImageThumbnailModel::imageInfosCleared() -+{ -+ if (d->preloadThread) -+ { -+ d->preloadThread->stopAllTasks(); -+ } -+} -+ -+QVariant ImageThumbnailModel::data(const QModelIndex& index, int role) const -+{ -+ if (role == ThumbnailRole && d->thread && index.isValid()) -+ { -+ QPixmap thumbnail; -+ ImageInfo info = imageInfo(index); -+ QString path = info.filePath(); -+ -+ if (info.isNull()) -+ { -+ return QVariant(QVariant::Pixmap); -+ } -+ -+ if (!d->detailRect.isNull()) -+ { -+ if (d->thread->find(info.thumbnailIdentifier(), d->detailRect, thumbnail, d->thumbSize.size())) -+ { -+ return thumbnail; -+ } -+ } -+ else -+ { -+ if (d->thread->find(info.thumbnailIdentifier(), thumbnail, d->thumbSize.size())) -+ { -+ return thumbnail; -+ } -+ } -+ -+ return QVariant(QVariant::Pixmap); -+ } -+ -+ return ImageModel::data(index, role); -+} -+ -+bool ImageThumbnailModel::setData(const QModelIndex& index, const QVariant& value, int role) -+{ -+ if (role == ThumbnailRole) -+ { -+ switch (value.type()) -+ { -+ case QVariant::Invalid: -+ d->thumbSize = d->lastGlobalThumbSize; -+ d->detailRect = QRect(); -+ break; -+ -+ case QVariant::Int: -+ -+ if (value.isNull()) -+ { -+ d->thumbSize = d->lastGlobalThumbSize; -+ } -+ else -+ { -+ d->thumbSize = value.toInt(); -+ } -+ break; -+ -+ case QVariant::Rect: -+ -+ if (value.isNull()) -+ { -+ d->detailRect = QRect(); -+ } -+ else -+ { -+ d->detailRect = value.toRect(); -+ } -+ break; -+ -+ default: -+ break; -+ } -+ } -+ -+ return ImageModel::setData(index, value, role); -+} -+ -+void ImageThumbnailModel::slotThumbnailLoaded(const LoadingDescription& loadingDescription, const QPixmap& thumb) -+{ -+ if (thumb.isNull()) -+ { -+ return; -+ } -+ -+ // In case of multiple occurrence, we currently do not know which thumbnail is this. Signal change on all. -+ QModelIndexList indexes; -+ ThumbnailIdentifier thumbId = loadingDescription.thumbnailIdentifier(); -+ if (thumbId.filePath.isEmpty()) -+ { -+ indexes = indexesForImageId(thumbId.id); -+ } -+ else -+ { -+ indexes = indexesForPath(thumbId.filePath); -+ } -+ foreach(const QModelIndex& index, indexes) -+ { -+ if (thumb.isNull()) -+ { -+ emit thumbnailFailed(index, loadingDescription.previewParameters.size); -+ } -+ else -+ { -+ emit thumbnailAvailable(index, loadingDescription.previewParameters.size); -+ -+ if (d->emitDataChanged) -+ { -+ emit dataChanged(index, index, d->staticListContainingThumbnailRole); -+ } -+ } -+ } -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imagethumbnailmodel.h b/libs/database/models/imagethumbnailmodel.h -new file mode 100644 -index 0000000..366ca65 ---- /dev/null -+++ b/libs/database/models/imagethumbnailmodel.h -@@ -0,0 +1,140 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2009-03-05 -+ * Description : Qt item model for database entries with support for thumbnail loading -+ * -+ * Copyright (C) 2009-2011 by Marcel Wiesweg -+ * Copyright (C) 2011 by Gilles Caulier -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGETHUMBNAILMODEL_H -+#define IMAGETHUMBNAILMODEL_H -+ -+// Local includes -+ -+#include "imagemodel.h" -+#include "thumbnailsize.h" -+#include "digikam_export.h" -+ -+namespace Digikam -+{ -+ -+class LoadingDescription; -+class ThumbnailLoadThread; -+ -+class DIGIKAM_DATABASE_EXPORT ImageThumbnailModel : public ImageModel -+{ -+ Q_OBJECT -+ -+public: -+ -+ /** -+ * An ImageModel that supports thumbnail loading. -+ * You need to set a ThumbnailLoadThread to enable thumbnail loading. -+ * Adjust the thumbnail size to your needs. -+ * Note that setKeepsFilePathCache is enabled per default. -+ */ -+ explicit ImageThumbnailModel(QObject* parent); -+ ~ImageThumbnailModel(); -+ -+ /** Enable thumbnail loading and set the thread that shall be used. -+ * The thumbnail size of this thread will be adjusted. -+ */ -+ void setThumbnailLoadThread(ThumbnailLoadThread* thread); -+ ThumbnailLoadThread* thumbnailLoadThread() const; -+ -+ /// Set the thumbnail size to use -+ void setThumbnailSize(const ThumbnailSize& thumbSize); -+ -+ /// If you want to fix a size for preloading, do it here. -+ void setPreloadThumbnailSize(const ThumbnailSize& thumbSize); -+ -+ void setExifRotate(bool rotate); -+ -+ /** -+ * Enable emitting dataChanged() when a thumbnail becomes available. -+ * The thumbnailAvailable() signal will be emitted in any case. -+ * Default is true. -+ */ -+ void setEmitDataChanged(bool emitSignal); -+ -+ /** -+ * Enable preloading of thumbnails: -+ * If preloading is enabled, for every entry in the model a thumbnail generation is started. -+ * Default: false. -+ */ -+ void setPreloadThumbnails(bool preload); -+ -+ ThumbnailSize thumbnailSize() const; -+ -+ /** -+ * Handles the ThumbnailRole. -+ * If the pixmap is available, returns it in the QVariant. -+ * If it still needs to be loaded, returns a null QVariant and emits -+ * thumbnailAvailable() as soon as it is available. -+ */ -+ virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -+ -+ /** -+ * You can override the current thumbnail size by giving an integer value for ThumbnailRole. -+ * Set a null QVariant to use the thumbnail size set by setThumbnailSize() again. -+ * The index given here is ignored for this purpose. -+ */ -+ virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::DisplayRole); -+ -+public Q_SLOTS: -+ -+ /** Prepare the thumbnail loading for the given indexes -+ */ -+ void prepareThumbnails(const QList& indexesToPrepare); -+ void prepareThumbnails(const QList& indexesToPrepare, const ThumbnailSize& thumbSize); -+ -+ /** -+ * Preload thumbnail for the given infos resp. indexes. -+ * Note: Use setPreloadThumbnails to automatically preload all entries in the model. -+ * Note: This only ensures thumbnail generation. It is not guaranteed that pixmaps -+ * are stored in the cache. For thumbnails that are expect to be drawn immediately, -+ * include them in prepareThumbnails(). -+ * Note: Stops preloading of previously added thumbnails. -+ */ -+ void preloadThumbnails(const QList&); -+ void preloadThumbnails(const QList&); -+ void preloadAllThumbnails(); -+ -+Q_SIGNALS: -+ -+ void thumbnailAvailable(const QModelIndex& index, int requestedSize); -+ void thumbnailFailed(const QModelIndex& index, int requestedSize); -+ -+protected: -+ -+ virtual void imageInfosCleared(); -+ -+protected Q_SLOTS: -+ -+ void slotThumbnailLoaded(const LoadingDescription& loadingDescription, const QPixmap& thumb); -+ -+private: -+ -+ class ImageThumbnailModelPriv; -+ ImageThumbnailModelPriv* const d; -+}; -+ -+} // namespace Digikam -+ -+#endif /* IMAGETHUMBNAILMODEL_H */ -diff --git a/libs/database/models/imageversionsmodel.cpp b/libs/database/models/imageversionsmodel.cpp -new file mode 100644 -index 0000000..e6ba582 ---- /dev/null -+++ b/libs/database/models/imageversionsmodel.cpp -@@ -0,0 +1,183 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2010-07-13 -+ * Description : Model for image versions -+ * -+ * Copyright (C) 2010 by Martin Klapetek -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#include "imageversionsmodel.h" -+ -+// KDE includes -+ -+#include -+ -+// Local includes -+ -+#include "digikam_debug.h" -+#include "workingwidget.h" -+ -+namespace Digikam -+{ -+ -+class ImageVersionsModel::Private -+{ -+public: -+ -+ Private() -+ { -+ data = 0; -+ paintTree = false; -+ } -+ -+ ///Complete paths with filenames and tree level -+ QList >* data; -+ ///This is for delegate to paint it as selected -+ QString currentSelectedImage; -+ ///If true, the delegate will paint items as a tree -+ ///if false, it will be painted as a list -+ bool paintTree; -+}; -+ -+ImageVersionsModel::ImageVersionsModel(QObject* parent) -+ : QAbstractListModel(parent), -+ d(new Private) -+{ -+ d->data = new QList >; -+} -+ -+ImageVersionsModel::~ImageVersionsModel() -+{ -+ //qDeleteAll(d->data); -+ delete d; -+} -+ -+Qt::ItemFlags ImageVersionsModel::flags(const QModelIndex& index) const -+{ -+ if (!index.isValid()) -+ { -+ return 0; -+ } -+ -+ return Qt::ItemIsEnabled | Qt::ItemIsSelectable; -+} -+ -+QVariant ImageVersionsModel::data(const QModelIndex& index, int role) const -+{ -+ if (!index.isValid()) -+ { -+ return QVariant(); -+ } -+ -+ if (role == Qt::DisplayRole && !d->data->isEmpty()) -+ { -+ return d->data->at(index.row()).first; -+ } -+ else if (role == Qt::UserRole && !d->data->isEmpty()) -+ { -+ return d->data->at(index.row()).second; -+ } -+ else if (role == Qt::DisplayRole && d->data->isEmpty()) -+ { -+ //TODO: make this text Italic -+ return QVariant(QString(i18n("No image selected"))); -+ } -+ -+ return QVariant(); -+} -+ -+int ImageVersionsModel::rowCount(const QModelIndex& parent) const -+{ -+ Q_UNUSED(parent) -+ return d->data->count(); -+} -+ -+void ImageVersionsModel::setupModelData(QList >& data) -+{ -+ beginResetModel(); -+ -+ d->data->clear(); -+ -+ if (!data.isEmpty()) -+ { -+ d->data->append(data); -+ } -+ else -+ { -+ d->data->append(qMakePair(QString(i18n("This is the original image")), 0)); -+ } -+ -+ endResetModel(); -+} -+ -+void ImageVersionsModel::clearModelData() -+{ -+ beginResetModel(); -+ -+ if (!d->data->isEmpty()) -+ { -+ d->data->clear(); -+ } -+ -+ endResetModel(); -+} -+ -+void ImageVersionsModel::slotAnimationStep() -+{ -+ emit dataChanged(createIndex(0, 0), createIndex(rowCount()-1, 1)); -+} -+ -+QString ImageVersionsModel::currentSelectedImage() const -+{ -+ return d->currentSelectedImage; -+} -+ -+void ImageVersionsModel::setCurrentSelectedImage(const QString& path) -+{ -+ d->currentSelectedImage = path; -+} -+ -+QModelIndex ImageVersionsModel::currentSelectedImageIndex() const -+{ -+ return index(listIndexOf(d->currentSelectedImage), 0); -+} -+ -+bool ImageVersionsModel::paintTree() const -+{ -+ return d->paintTree; -+} -+ -+void ImageVersionsModel::setPaintTree(bool paint) -+{ -+ d->paintTree = paint; -+} -+ -+int ImageVersionsModel::listIndexOf(const QString& item) const -+{ -+ for (int i = 0; i < d->data->size(); ++i) -+ { -+ if (d->data->at(i).first == item) -+ { -+ return i; -+ } -+ } -+ -+ return -1; -+} -+ -+} // namespace Digikam -diff --git a/libs/database/models/imageversionsmodel.h b/libs/database/models/imageversionsmodel.h -new file mode 100644 -index 0000000..ed08529 ---- /dev/null -+++ b/libs/database/models/imageversionsmodel.h -@@ -0,0 +1,75 @@ -+/* ============================================================ -+ * -+ * This file is a part of digiKam project -+ * http://www.digikam.org -+ * -+ * Date : 2010-07-13 -+ * Description : Model for image versions -+ * -+ * Copyright (C) 2010 by Martin Klapetek -+ * -+ * 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, 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. -+ * -+ * ============================================================ */ -+ -+#ifndef IMAGEVERSIONSMODEL_H -+#define IMAGEVERSIONSMODEL_H -+ -+// Qt includes -+ -+#include -+#include -+ -+// Local includes -+ -+#include "digikam_export.h" -+ -+namespace Digikam -+{ -+ -+class DIGIKAM_DATABASE_EXPORT ImageVersionsModel : public QAbstractListModel -+{ -+ Q_OBJECT -+ -+public: -+ -+ explicit ImageVersionsModel(QObject* parent = 0); -+ ~ImageVersionsModel(); -+ -+ Qt::ItemFlags flags(const QModelIndex& index) const; -+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -+ int rowCount(const QModelIndex& parent = QModelIndex()) const; -+ -+ void setupModelData(QList >& data); -+ void clearModelData(); -+ -+ QString currentSelectedImage() const; -+ void setCurrentSelectedImage(const QString& path); -+ QModelIndex currentSelectedImageIndex() const; -+ -+ bool paintTree() const; -+ int listIndexOf(const QString& item) const; -+ -+public Q_SLOTS: -+ -+ void slotAnimationStep(); -+ void setPaintTree(bool paint); -+ -+private: -+ -+ class Private; -+ Private* const d; -+}; -+ -+} // namespace Digikam -+ -+#endif // IMAGEVERSIONSMODEL_H -diff --git a/libs/models/CMakeLists.txt b/libs/models/CMakeLists.txt -index cbabfaa..804456b 100644 ---- a/libs/models/CMakeLists.txt -+++ b/libs/models/CMakeLists.txt -@@ -9,18 +9,6 @@ if (POLICY CMP0063) - cmake_policy(SET CMP0063 NEW) - endif (POLICY CMP0063) - --set(libdatabasemodels_SRCS -- imagemodel.cpp -- imagefiltermodel.cpp -- imagefiltermodelpriv.cpp -- imagefiltermodelthreads.cpp -- imagefiltersettings.cpp -- imagelistmodel.cpp -- imagesortsettings.cpp -- imagethumbnailmodel.cpp -- imageversionsmodel.cpp --) -- - set(libalbummodels_SRCS - imagealbummodel.cpp - imagealbumfiltermodel.cpp -@@ -52,5 +40,4 @@ endif() - #for digikam core lib - add_library(digikamgenericmodels_src OBJECT ${libgenericmodels_SRCS}) - --add_library(digikamdatabasemodels_src OBJECT ${libdatabasemodels_SRCS}) --add_library(digikammodels_src OBJECT ${libalbummodels_SRCS} ${libgenericmodels_SRCS}) -+add_library(digikammodels_src OBJECT ${libalbummodels_SRCS} ${libgenericmodels_SRCS}) -diff --git a/libs/models/imagefiltermodel.cpp b/libs/models/imagefiltermodel.cpp -deleted file mode 100644 -index 3d57e05..0000000 ---- a/libs/models/imagefiltermodel.cpp -+++ /dev/null -@@ -1,1116 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011-2017 by Gilles Caulier -- * Copyright (C) 2010 by Andi Clemens -- * Copyright (C) 2011 by Michael G. Hansen -- * Copyright (C) 2014 by Mohamed Anwer -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagefiltermodel.h" --#include "imagefiltermodelpriv.h" --#include "imagefiltermodelthreads.h" -- --// Local includes -- --#include "digikam_debug.h" --#include "coredbaccess.h" --#include "coredbchangesets.h" --#include "coredbwatch.h" --#include "imageinfolist.h" --#include "imagemodel.h" -- --namespace Digikam --{ -- --ImageSortFilterModel::ImageSortFilterModel(QObject* parent) -- : DCategorizedSortFilterProxyModel(parent), m_chainedModel(0) --{ --} -- --void ImageSortFilterModel::setSourceImageModel(ImageModel* source) --{ -- if (m_chainedModel) -- { -- m_chainedModel->setSourceImageModel(source); -- } -- else -- { -- setDirectSourceImageModel(source); -- } --} -- --void ImageSortFilterModel::setSourceFilterModel(ImageSortFilterModel* source) --{ -- if (source) -- { -- ImageModel* const model = sourceImageModel(); -- -- if (model) -- { -- source->setSourceImageModel(model); -- } -- } -- -- m_chainedModel = source; -- setSourceModel(source); --} -- --void ImageSortFilterModel::setDirectSourceImageModel(ImageModel* model) --{ -- setSourceModel(model); --} -- --void ImageSortFilterModel::setSourceModel(QAbstractItemModel* model) --{ -- // made it protected, only setSourceImageModel is public -- DCategorizedSortFilterProxyModel::setSourceModel(model); --} -- --ImageModel* ImageSortFilterModel::sourceImageModel() const --{ -- if (m_chainedModel) -- { -- return m_chainedModel->sourceImageModel(); -- } -- -- return static_cast(sourceModel()); --} -- --ImageSortFilterModel* ImageSortFilterModel::sourceFilterModel() const --{ -- return m_chainedModel; --} -- --ImageFilterModel* ImageSortFilterModel::imageFilterModel() const --{ -- // reimplemented in ImageFilterModel -- if (m_chainedModel) -- { -- return m_chainedModel->imageFilterModel(); -- } -- -- return 0; --} -- --QModelIndex ImageSortFilterModel::mapToSourceImageModel(const QModelIndex& index) const --{ -- if (m_chainedModel) -- { -- return m_chainedModel->mapToSourceImageModel(mapToSource(index)); -- } -- -- return mapToSource(index); --} -- --QModelIndex ImageSortFilterModel::mapFromSourceImageModel(const QModelIndex& albummodel_index) const --{ -- if (m_chainedModel) -- { -- return mapFromSource(m_chainedModel->mapFromSourceImageModel(albummodel_index)); -- } -- -- return mapFromSource(albummodel_index); --} -- -- --QModelIndex ImageSortFilterModel::mapFromDirectSourceToSourceImageModel(const QModelIndex& sourceModel_index) const --{ -- if (m_chainedModel) -- { -- return m_chainedModel->mapToSourceImageModel(sourceModel_index); -- } -- return sourceModel_index; --} -- --// -------------- Convenience mappers ------------------------------------------------------------------- -- --QList ImageSortFilterModel::mapListToSource(const QList& indexes) const --{ -- QList sourceIndexes; -- foreach(const QModelIndex& index, indexes) -- { -- sourceIndexes << mapToSourceImageModel(index); -- } -- return sourceIndexes; --} -- --QList ImageSortFilterModel::mapListFromSource(const QList& sourceIndexes) const --{ -- QList indexes; -- foreach(const QModelIndex& index, sourceIndexes) -- { -- indexes << mapFromSourceImageModel(index); -- } -- return indexes; --} -- --ImageInfo ImageSortFilterModel::imageInfo(const QModelIndex& index) const --{ -- return sourceImageModel()->imageInfo(mapToSourceImageModel(index)); --} -- --qlonglong ImageSortFilterModel::imageId(const QModelIndex& index) const --{ -- return sourceImageModel()->imageId(mapToSourceImageModel(index)); --} -- --QList ImageSortFilterModel::imageInfos(const QList& indexes) const --{ -- QList infos; -- ImageModel* const model = sourceImageModel(); -- -- foreach(const QModelIndex& index, indexes) -- { -- infos << model->imageInfo(mapToSourceImageModel(index)); -- } -- -- return infos; --} -- --QList ImageSortFilterModel::imageIds(const QList& indexes) const --{ -- QList ids; -- ImageModel* const model = sourceImageModel(); -- -- foreach(const QModelIndex& index, indexes) -- { -- ids << model->imageId(mapToSourceImageModel(index)); -- } -- -- return ids; --} -- --QModelIndex ImageSortFilterModel::indexForPath(const QString& filePath) const --{ -- return mapFromSourceImageModel(sourceImageModel()->indexForPath(filePath)); --} -- --QModelIndex ImageSortFilterModel::indexForImageInfo(const ImageInfo& info) const --{ -- return mapFromSourceImageModel(sourceImageModel()->indexForImageInfo(info)); --} -- --QModelIndex ImageSortFilterModel::indexForImageId(qlonglong id) const --{ -- return mapFromSourceImageModel(sourceImageModel()->indexForImageId(id)); --} -- --QList ImageSortFilterModel::imageInfosSorted() const --{ -- QList infos; -- const int size = rowCount(); -- ImageModel* const model = sourceImageModel(); -- -- for (int i=0; iimageInfo(mapToSourceImageModel(index(i, 0))); -- } -- -- return infos; --} -- --// -------------------------------------------------------------------------------------------- -- --ImageFilterModel::ImageFilterModel(QObject* parent) -- : ImageSortFilterModel(parent), -- d_ptr(new ImageFilterModelPrivate) --{ -- d_ptr->init(this); --} -- --ImageFilterModel::ImageFilterModel(ImageFilterModelPrivate& dd, QObject* parent) -- : ImageSortFilterModel(parent), -- d_ptr(&dd) --{ -- d_ptr->init(this); --} -- --ImageFilterModel::~ImageFilterModel() --{ -- Q_D(ImageFilterModel); -- delete d; --} -- --void ImageFilterModel::setDirectSourceImageModel(ImageModel* sourceModel) --{ -- Q_D(ImageFilterModel); -- -- if (d->imageModel) -- { -- d->imageModel->unsetPreprocessor(d); -- disconnect(d->imageModel, SIGNAL(modelReset()), -- this, SLOT(slotModelReset())); -- slotModelReset(); -- } -- -- d->imageModel = sourceModel; -- -- if (d->imageModel) -- { -- d->imageModel->setPreprocessor(d); -- -- connect(d->imageModel, SIGNAL(preprocess(QList,QList)), -- d, SLOT(preprocessInfos(QList,QList))); -- -- connect(d->imageModel, SIGNAL(processAdded(QList,QList)), -- d, SLOT(processAddedInfos(QList,QList))); -- -- connect(d, SIGNAL(reAddImageInfos(QList,QList)), -- d->imageModel, SLOT(reAddImageInfos(QList,QList))); -- -- connect(d, SIGNAL(reAddingFinished()), -- d->imageModel, SLOT(reAddingFinished())); -- -- connect(d->imageModel, SIGNAL(modelReset()), -- this, SLOT(slotModelReset())); -- -- connect(d->imageModel, SIGNAL(imageChange(ImageChangeset,QItemSelection)), -- this, SLOT(slotImageChange(ImageChangeset))); -- -- connect(d->imageModel, SIGNAL(imageTagChange(ImageTagChangeset,QItemSelection)), -- this, SLOT(slotImageTagChange(ImageTagChangeset))); -- } -- -- setSourceModel(d->imageModel); --} -- --QVariant ImageFilterModel::data(const QModelIndex& index, int role) const --{ -- Q_D(const ImageFilterModel); -- -- if (!index.isValid()) -- { -- return QVariant(); -- } -- -- switch (role) -- { -- // Attention: This breaks should there ever be another filter model between this and the ImageModel -- -- case DCategorizedSortFilterProxyModel::CategoryDisplayRole: -- return categoryIdentifier(d->imageModel->imageInfoRef(mapToSource(index))); -- case CategorizationModeRole: -- return d->sorter.categorizationMode; -- case SortOrderRole: -- return d->sorter.sortRole; -- //case CategoryCountRole: -- // return categoryCount(d->imageModel->imageInfoRef(mapToSource(index))); -- case CategoryAlbumIdRole: -- return d->imageModel->imageInfoRef(mapToSource(index)).albumId(); -- case CategoryFormatRole: -- return d->imageModel->imageInfoRef(mapToSource(index)).format(); -- case GroupIsOpenRole: -- return d->groupFilter.isAllOpen() || -- d->groupFilter.isOpen(d->imageModel->imageInfoRef(mapToSource(index)).id()); -- case ImageFilterModelPointerRole: -- return QVariant::fromValue(const_cast(this)); -- } -- -- return DCategorizedSortFilterProxyModel::data(index, role); --} -- --ImageFilterModel* ImageFilterModel::imageFilterModel() const --{ -- return const_cast(this); --} -- --DatabaseFields::Set ImageFilterModel::suggestedWatchFlags() const --{ -- DatabaseFields::Set watchFlags; -- watchFlags |= DatabaseFields::Name | DatabaseFields::FileSize | DatabaseFields::ModificationDate; -- watchFlags |= DatabaseFields::Rating | DatabaseFields::CreationDate | DatabaseFields::Orientation | -- DatabaseFields::Width | DatabaseFields::Height; -- watchFlags |= DatabaseFields::Comment; -- watchFlags |= DatabaseFields::ImageRelations; -- return watchFlags; --} -- --// -------------- Filter settings -------------- -- --void ImageFilterModel::setDayFilter(const QList& days) --{ -- Q_D(ImageFilterModel); -- d->filter.setDayFilter(days); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setTagFilter(const QList& includedTags, const QList& excludedTags, -- ImageFilterSettings::MatchingCondition matchingCond, -- bool showUnTagged, const QList& clTagIds, const QList& plTagIds) --{ -- Q_D(ImageFilterModel); -- d->filter.setTagFilter(includedTags, excludedTags, matchingCond, showUnTagged, clTagIds, plTagIds); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setRatingFilter(int rating, ImageFilterSettings::RatingCondition ratingCond, bool isUnratedExcluded) --{ -- Q_D(ImageFilterModel); -- d->filter.setRatingFilter(rating, ratingCond, isUnratedExcluded); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setUrlWhitelist(const QList urlList, const QString& id) --{ -- Q_D(ImageFilterModel); -- d->filter.setUrlWhitelist(urlList, id); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setIdWhitelist(const QList& idList, const QString& id) --{ -- Q_D(ImageFilterModel); -- d->filter.setIdWhitelist(idList, id); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setMimeTypeFilter(int mimeTypeFilter) --{ -- Q_D(ImageFilterModel); -- d->filter.setMimeTypeFilter(mimeTypeFilter); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setGeolocationFilter(const ImageFilterSettings::GeolocationCondition& condition) --{ -- Q_D(ImageFilterModel); -- d->filter.setGeolocationFilter(condition); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setTextFilter(const SearchTextFilterSettings& settings) --{ -- Q_D(ImageFilterModel); -- d->filter.setTextFilter(settings); -- setImageFilterSettings(d->filter); --} -- --void ImageFilterModel::setImageFilterSettings(const ImageFilterSettings& settings) --{ -- Q_D(ImageFilterModel); -- -- { -- QMutexLocker lock(&d->mutex); -- d->version++; -- d->filter = settings; -- d->filterCopy = settings; -- d->versionFilterCopy = d->versionFilter; -- d->groupFilterCopy = d->groupFilter; -- -- d->needPrepareComments = settings.isFilteringByText(); -- d->needPrepareTags = settings.isFilteringByTags(); -- d->needPrepareGroups = true; -- d->needPrepare = d->needPrepareComments || d->needPrepareTags || d->needPrepareGroups; -- -- d->hasOneMatch = false; -- d->hasOneMatchForText = false; -- } -- -- d->filterResults.clear(); -- -- //d->categoryCountHashInt.clear(); -- //d->categoryCountHashString.clear(); -- if (d->imageModel) -- { -- d->infosToProcess(d->imageModel->imageInfos()); -- } -- -- emit filterSettingsChanged(settings); --} -- --void ImageFilterModel::setVersionManagerSettings(const VersionManagerSettings& settings) --{ -- Q_D(ImageFilterModel); -- d->versionFilter.setVersionManagerSettings(settings); -- setVersionImageFilterSettings(d->versionFilter); --} -- --void ImageFilterModel::setExceptionList(const QList& idList, const QString& id) --{ -- Q_D(ImageFilterModel); -- d->versionFilter.setExceptionList(idList, id); -- setVersionImageFilterSettings(d->versionFilter); --} -- --void ImageFilterModel::setVersionImageFilterSettings(const VersionImageFilterSettings& settings) --{ -- Q_D(ImageFilterModel); -- d->versionFilter = settings; -- slotUpdateFilter(); --} -- --bool ImageFilterModel::isGroupOpen(qlonglong group) const --{ -- Q_D(const ImageFilterModel); -- return d->groupFilter.isOpen(group); --} -- --bool ImageFilterModel::isAllGroupsOpen() const --{ -- Q_D(const ImageFilterModel); -- return d->groupFilter.isAllOpen(); --} -- --void ImageFilterModel::setGroupOpen(qlonglong group, bool open) --{ -- Q_D(ImageFilterModel); -- d->groupFilter.setOpen(group, open); -- setGroupImageFilterSettings(d->groupFilter); --} -- --void ImageFilterModel::toggleGroupOpen(qlonglong group) --{ -- setGroupOpen(group, !isGroupOpen(group)); --} -- --void ImageFilterModel::setAllGroupsOpen(bool open) --{ -- Q_D(ImageFilterModel); -- d->groupFilter.setAllOpen(open); -- setGroupImageFilterSettings(d->groupFilter); --} -- --void ImageFilterModel::setGroupImageFilterSettings(const GroupImageFilterSettings& settings) --{ -- Q_D(ImageFilterModel); -- d->groupFilter = settings; -- slotUpdateFilter(); --} -- --void ImageFilterModel::slotUpdateFilter() --{ -- Q_D(ImageFilterModel); -- setImageFilterSettings(d->filter); --} -- --ImageFilterSettings ImageFilterModel::imageFilterSettings() const --{ -- Q_D(const ImageFilterModel); -- return d->filter; --} -- --ImageSortSettings ImageFilterModel::imageSortSettings() const --{ -- Q_D(const ImageFilterModel); -- return d->sorter; --} -- --VersionImageFilterSettings ImageFilterModel::versionImageFilterSettings() const --{ -- Q_D(const ImageFilterModel); -- return d->versionFilter; --} -- --GroupImageFilterSettings ImageFilterModel::groupImageFilterSettings() const --{ -- Q_D(const ImageFilterModel); -- return d->groupFilter; --} -- --void ImageFilterModel::slotModelReset() --{ -- Q_D(ImageFilterModel); -- { -- QMutexLocker lock(&d->mutex); -- // discard all packages on the way that are marked as send out for re-add -- d->lastDiscardVersion = d->version; -- d->sentOutForReAdd = 0; -- // discard all packages on the way -- d->version++; -- d->sentOut = 0; -- -- d->hasOneMatch = false; -- d->hasOneMatchForText = false; -- } -- d->filterResults.clear(); --} -- --bool ImageFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const --{ -- Q_D(const ImageFilterModel); -- -- if (source_parent.isValid()) -- { -- return false; -- } -- -- qlonglong id = d->imageModel->imageId(source_row); -- QHash::const_iterator it = d->filterResults.constFind(id); -- -- if (it != d->filterResults.constEnd()) -- { -- return it.value(); -- } -- -- // usually done in thread and cache, unless source model changed -- ImageInfo info = d->imageModel->imageInfo(source_row); -- bool match = d->filter.matches(info); -- match = match ? d->versionFilter.matches(info) : false; -- -- return match ? d->groupFilter.matches(info) : false; --} -- --void ImageFilterModel::setSendImageInfoSignals(bool sendSignals) --{ -- if (sendSignals) -- { -- connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), -- this, SLOT(slotRowsInserted(QModelIndex,int,int))); -- -- connect(this, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), -- this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); -- } -- else -- { -- disconnect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), -- this, SLOT(slotRowsInserted(QModelIndex,int,int))); -- -- disconnect(this, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), -- this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); -- } --} -- --void ImageFilterModel::slotRowsInserted(const QModelIndex& /*parent*/, int start, int end) --{ -- QList infos; -- -- for (int i=start; i<=end; ++i) -- { -- infos << imageInfo(index(i, 0)); -- } -- -- emit imageInfosAdded(infos); --} -- --void ImageFilterModel::slotRowsAboutToBeRemoved(const QModelIndex& /*parent*/, int start, int end) --{ -- QList infos; -- -- for (int i=start; i<=end; ++i) -- { -- infos << imageInfo(index(i, 0)); -- } -- -- emit imageInfosAboutToBeRemoved(infos); --} -- --// -------------- Threaded preparation & filtering -------------- -- --void ImageFilterModel::addPrepareHook(ImageFilterModelPrepareHook* hook) --{ -- Q_D(ImageFilterModel); -- QMutexLocker lock(&d->mutex); -- d->prepareHooks << hook; --} -- --void ImageFilterModel::removePrepareHook(ImageFilterModelPrepareHook* hook) --{ -- Q_D(ImageFilterModel); -- QMutexLocker lock(&d->mutex); -- d->prepareHooks.removeAll(hook); --} -- --void ImageFilterModelPreparer::process(ImageFilterModelTodoPackage package) --{ -- if (!checkVersion(package)) -- { -- emit discarded(package); -- return; -- } -- -- // get thread-local copy -- bool needPrepareTags, needPrepareComments, needPrepareGroups; -- QList prepareHooks; -- { -- QMutexLocker lock(&d->mutex); -- needPrepareTags = d->needPrepareTags; -- needPrepareComments = d->needPrepareComments; -- needPrepareGroups = d->needPrepareGroups; -- prepareHooks = d->prepareHooks; -- } -- -- //TODO: Make efficient!! -- if (needPrepareComments) -- { -- foreach(const ImageInfo& info, package.infos) -- { -- info.comment(); -- } -- } -- -- if (!checkVersion(package)) -- { -- emit discarded(package); -- return; -- } -- -- // The downside of QVector: At some point, we may need a QList for an API. -- // Nonetheless, QList and ImageInfo is fast. We could as well -- // reimplement ImageInfoList to ImageInfoVector (internally with templates?) -- ImageInfoList infoList; -- -- if (needPrepareTags || needPrepareGroups) -- { -- infoList = package.infos.toList(); -- } -- -- if (needPrepareTags) -- { -- infoList.loadTagIds(); -- } -- -- if (needPrepareGroups) -- { -- infoList.loadGroupImageIds(); -- } -- -- foreach(ImageFilterModelPrepareHook* hook, prepareHooks) -- { -- hook->prepare(package.infos); -- } -- -- emit processed(package); --} -- --void ImageFilterModelFilterer::process(ImageFilterModelTodoPackage package) --{ -- if (!checkVersion(package)) -- { -- emit discarded(package); -- return; -- } -- -- // get thread-local copy -- ImageFilterSettings localFilter; -- VersionImageFilterSettings localVersionFilter; -- GroupImageFilterSettings localGroupFilter; -- bool hasOneMatch; -- bool hasOneMatchForText; -- { -- QMutexLocker lock(&d->mutex); -- localFilter = d->filterCopy; -- localVersionFilter = d->versionFilterCopy; -- localGroupFilter = d->groupFilterCopy; -- hasOneMatch = d->hasOneMatch; -- hasOneMatchForText = d->hasOneMatchForText; -- } -- -- // Actual filtering. The variants to spare checking hasOneMatch over and over again. -- if (hasOneMatch && hasOneMatchForText) -- { -- foreach(const ImageInfo& info, package.infos) -- { -- package.filterResults[info.id()] = localFilter.matches(info) && -- localVersionFilter.matches(info) && -- localGroupFilter.matches(info); -- } -- } -- else if (hasOneMatch) -- { -- bool matchForText; -- -- foreach(const ImageInfo& info, package.infos) -- { -- package.filterResults[info.id()] = localFilter.matches(info, &matchForText) && -- localVersionFilter.matches(info) && -- localGroupFilter.matches(info); -- -- if (matchForText) -- { -- hasOneMatchForText = true; -- } -- } -- } -- else -- { -- bool result, matchForText; -- -- foreach(const ImageInfo& info, package.infos) -- { -- result = localFilter.matches(info, &matchForText) && -- localVersionFilter.matches(info) && -- localGroupFilter.matches(info); -- package.filterResults[info.id()] = result; -- -- if (result) -- { -- hasOneMatch = true; -- } -- -- if (matchForText) -- { -- hasOneMatchForText = true; -- } -- } -- } -- -- if (checkVersion(package)) -- { -- QMutexLocker lock(&d->mutex); -- d->hasOneMatch = hasOneMatch; -- d->hasOneMatchForText = hasOneMatchForText; -- } -- -- emit processed(package); --} -- --// -------------- Sorting and Categorization ------------------------------------------------------- -- --void ImageFilterModel::setImageSortSettings(const ImageSortSettings& sorter) --{ -- Q_D(ImageFilterModel); -- d->sorter = sorter; -- setCategorizedModel(d->sorter.categorizationMode != ImageSortSettings::NoCategories); -- invalidate(); --} -- --void ImageFilterModel::setCategorizationMode(ImageSortSettings::CategorizationMode mode) --{ -- Q_D(ImageFilterModel); -- d->sorter.setCategorizationMode(mode); -- setImageSortSettings(d->sorter); --} -- --void ImageFilterModel::setCategorizationSortOrder(ImageSortSettings::SortOrder order) --{ -- Q_D(ImageFilterModel); -- d->sorter.setCategorizationSortOrder(order); -- setImageSortSettings(d->sorter); --} -- --void ImageFilterModel::setSortRole(ImageSortSettings::SortRole role) --{ -- Q_D(ImageFilterModel); -- d->sorter.setSortRole(role); -- setImageSortSettings(d->sorter); --} -- --void ImageFilterModel::setSortOrder(ImageSortSettings::SortOrder order) --{ -- Q_D(ImageFilterModel); -- d->sorter.setSortOrder(order); -- setImageSortSettings(d->sorter); --} -- --void ImageFilterModel::setStringTypeNatural(bool natural) --{ -- Q_D(ImageFilterModel); -- d->sorter.setStringTypeNatural(natural); -- setImageSortSettings(d->sorter); --} -- --int ImageFilterModel::compareCategories(const QModelIndex& left, const QModelIndex& right) const --{ -- // source indexes -- Q_D(const ImageFilterModel); -- -- if (!d->sorter.isCategorized()) -- { -- return 0; -- } -- -- if (!left.isValid() || !right.isValid()) -- { -- return -1; -- } -- -- const ImageInfo& leftInfo = d->imageModel->imageInfoRef(left); -- const ImageInfo& rightInfo = d->imageModel->imageInfoRef(right); -- -- // Check grouping -- qlonglong leftGroupImageId = leftInfo.groupImageId(); -- qlonglong rightGroupImageId = rightInfo.groupImageId(); -- -- return compareInfosCategories(leftGroupImageId == -1 ? leftInfo : ImageInfo(leftGroupImageId), -- rightGroupImageId == -1 ? rightInfo : ImageInfo(rightGroupImageId)); --} -- --bool ImageFilterModel::subSortLessThan(const QModelIndex& left, const QModelIndex& right) const --{ -- // source indexes -- Q_D(const ImageFilterModel); -- -- if (!left.isValid() || !right.isValid()) -- { -- return true; -- } -- -- if (left == right) -- { -- return false; -- } -- -- const ImageInfo& leftInfo = d->imageModel->imageInfoRef(left); -- const ImageInfo& rightInfo = d->imageModel->imageInfoRef(right); -- -- if (leftInfo == rightInfo) -- { -- return d->sorter.lessThan(left.data(ImageModel::ExtraDataRole), right.data(ImageModel::ExtraDataRole)); -- } -- -- // Check grouping -- qlonglong leftGroupImageId = leftInfo.groupImageId(); -- qlonglong rightGroupImageId = rightInfo.groupImageId(); -- -- // Either no grouping (-1), or same group image, or same image -- if (leftGroupImageId == rightGroupImageId) -- { -- return infosLessThan(leftInfo, rightInfo); -- } -- -- // We have grouping to handle -- -- // Is one grouped on the other? Sort behind leader. -- if (leftGroupImageId == rightInfo.id()) -- { -- return false; -- } -- if (rightGroupImageId == leftInfo.id()) -- { -- return true; -- } -- -- // Use the group leader for sorting -- return infosLessThan(leftGroupImageId == -1 ? leftInfo : ImageInfo(leftGroupImageId), -- rightGroupImageId == -1 ? rightInfo : ImageInfo(rightGroupImageId)); --} -- --int ImageFilterModel::compareInfosCategories(const ImageInfo& left, const ImageInfo& right) const --{ -- // Note: reimplemented in ImageAlbumFilterModel -- Q_D(const ImageFilterModel); -- return d->sorter.compareCategories(left, right); --} -- --// Feel free to optimize. QString::number is 3x slower. --static inline QString fastNumberToString(int id) --{ -- const int size = sizeof(int) * 2; -- char c[size+1]; -- c[size] = '\0'; -- char* p = c; -- int number = id; -- -- for (int i=0; i>= 4; -- ++p; -- } -- -- return QString::fromLatin1(c); --} -- --QString ImageFilterModel::categoryIdentifier(const ImageInfo& i) const --{ -- Q_D(const ImageFilterModel); -- -- if (!d->sorter.isCategorized()) -- { -- return QString(); -- } -- -- qlonglong groupedImageId = i.groupImageId(); -- ImageInfo info = groupedImageId == -1 ? i : ImageInfo(groupedImageId); -- -- switch (d->sorter.categorizationMode) -- { -- case ImageSortSettings::NoCategories: -- return QString(); -- case ImageSortSettings::OneCategory: -- return QString(); -- case ImageSortSettings::CategoryByAlbum: -- return fastNumberToString(info.albumId()); -- case ImageSortSettings::CategoryByFormat: -- return info.format(); -- default: -- return QString(); -- } --} -- --bool ImageFilterModel::infosLessThan(const ImageInfo& left, const ImageInfo& right) const --{ -- Q_D(const ImageFilterModel); -- return d->sorter.lessThan(left, right); --} -- --// -------------- Watching changes ----------------------------------------------------------------- -- --void ImageFilterModel::slotImageTagChange(const ImageTagChangeset& changeset) --{ -- Q_D(ImageFilterModel); -- -- if (!d->imageModel || d->imageModel->isEmpty()) -- { -- return; -- } -- -- // already scheduled to re-filter? -- if (d->updateFilterTimer->isActive()) -- { -- return; -- } -- -- // do we filter at all? -- if (!d->versionFilter.isFilteringByTags() && -- !d->filter.isFilteringByTags() && -- !d->filter.isFilteringByText()) -- { -- return; -- } -- -- // is one of our images affected? -- foreach(const qlonglong& id, changeset.ids()) -- { -- // if one matching image id is found, trigger a refresh -- if (d->imageModel->hasImage(id)) -- { -- d->updateFilterTimer->start(); -- return; -- } -- } --} -- --void ImageFilterModel::slotImageChange(const ImageChangeset& changeset) --{ -- Q_D(ImageFilterModel); -- -- if (!d->imageModel || d->imageModel->isEmpty()) -- { -- return; -- } -- -- // already scheduled to re-filter? -- if (d->updateFilterTimer->isActive()) -- { -- return; -- } -- -- // is one of the values affected that we filter or sort by? -- DatabaseFields::Set set = changeset.changes(); -- bool sortAffected = (set & d->sorter.watchFlags()); -- bool filterAffected = (set & d->filter.watchFlags()) || (set & d->groupFilter.watchFlags()); -- -- if (!sortAffected && !filterAffected) -- { -- return; -- } -- -- // is one of our images affected? -- bool imageAffected = false; -- -- foreach(const qlonglong& id, changeset.ids()) -- { -- // if one matching image id is found, trigger a refresh -- if (d->imageModel->hasImage(id)) -- { -- imageAffected = true; -- break; -- } -- } -- -- if (!imageAffected) -- { -- return; -- } -- -- if (filterAffected) -- { -- d->updateFilterTimer->start(); -- } -- else -- { -- invalidate(); // just resort, reuse filter results -- } --} -- --// ------------------------------------------------------------------------------------------------------- -- --NoDuplicatesImageFilterModel::NoDuplicatesImageFilterModel(QObject* parent) -- : ImageSortFilterModel(parent) --{ --} -- --bool NoDuplicatesImageFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const --{ -- QModelIndex index = sourceModel()->index(source_row, 0, source_parent); -- -- if (index.data(ImageModel::ExtraDataDuplicateCount).toInt() <= 1) -- { -- return true; -- } -- -- QModelIndex previousIndex = sourceModel()->index(source_row - 1, 0, source_parent); -- -- if (!previousIndex.isValid()) -- { -- return true; -- } -- -- if (sourceImageModel()->imageId(mapFromDirectSourceToSourceImageModel(index)) == sourceImageModel()->imageId(mapFromDirectSourceToSourceImageModel(previousIndex))) -- { -- return false; -- } -- return true; --} -- --/* --void NoDuplicatesImageFilterModel::setSourceModel(QAbstractItemModel* model) --{ -- if (sourceModel()) -- { -- } -- -- ImageSortFilterModel::setSourceModel(model); -- -- if (sourceModel()) -- { -- connect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), -- this, SLOT(slotRowsAboutToBeRemoved(QModelIndex,int,int))); -- } --} -- --void NoDuplicatesImageFilterModel::slotRowsAboutToBeRemoved(const QModelIndex& parent, int begin, int end) --{ -- bool needInvalidate = false; -- -- for (int i = begin; i<=end; ++i) -- { -- QModelIndex index = sourceModel()->index(i, 0, parent); -- -- // filtered out by us? -- if (!mapFromSource(index).isValid()) -- { -- continue; -- } -- -- QModelIndex sourceIndex = mapFromDirectSourceToSourceImageModel(index); -- qlonglong id = sourceImageModel()->imageId(sourceIndex); -- -- if (sourceImageModel()->numberOfIndexesForImageId(id) > 1) -- { -- needInvalidate = true; -- } -- } --}*/ -- --} // namespace Digikam -diff --git a/libs/models/imagefiltermodel.h b/libs/models/imagefiltermodel.h -deleted file mode 100644 -index d131b3e..0000000 ---- a/libs/models/imagefiltermodel.h -+++ /dev/null -@@ -1,299 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011 by Gilles Caulier -- * Copyright (C) 2010 by Andi Clemens -- * Copyright (C) 2011 by Michael G. Hansen -- * Copyright (C) 2014 by Mohamed Anwer -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGEFILTERMODEL_H --#define IMAGEFILTERMODEL_H -- --// Local includes -- --#include "dcategorizedsortfilterproxymodel.h" --#include "textfilter.h" --#include "imagefiltersettings.h" --#include "imagemodel.h" --#include "imagesortsettings.h" --#include "digikam_export.h" -- --namespace Digikam --{ -- --class ImageChangeset; --class ImageFilterModel; --class ImageTagChangeset; -- --class DIGIKAM_DATABASE_EXPORT ImageFilterModelPrepareHook --{ --public: -- -- virtual ~ImageFilterModelPrepareHook() {}; -- virtual void prepare(const QVector& infos) = 0; --}; -- --// ----------------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT ImageSortFilterModel : public DCategorizedSortFilterProxyModel --{ -- Q_OBJECT -- --public: -- -- explicit ImageSortFilterModel(QObject* parent = 0); -- -- void setSourceImageModel(ImageModel* model); -- ImageModel* sourceImageModel() const; -- -- void setSourceFilterModel(ImageSortFilterModel* model); -- ImageSortFilterModel* sourceFilterModel() const; -- -- QModelIndex mapToSourceImageModel(const QModelIndex& index) const; -- QModelIndex mapFromSourceImageModel(const QModelIndex& imagemodel_index) const; -- QModelIndex mapFromDirectSourceToSourceImageModel(const QModelIndex& sourceModel_index) const; -- -- /// Convenience methods mapped to ImageModel. -- /// Mentioned indexes returned come from the source image model. -- QList mapListToSource(const QList& indexes) const; -- QList mapListFromSource(const QList& sourceIndexes) const; -- -- ImageInfo imageInfo(const QModelIndex& index) const; -- qlonglong imageId(const QModelIndex& index) const; -- QList imageInfos(const QList& indexes) const; -- QList imageIds(const QList& indexes) const; -- -- QModelIndex indexForPath(const QString& filePath) const; -- QModelIndex indexForImageInfo(const ImageInfo& info) const; -- QModelIndex indexForImageId(qlonglong id) const; -- -- /** Returns a list of all image infos, sorted according to this model. -- * If you do not need a sorted list, use ImageModel's imageInfos() method. -- */ -- QList imageInfosSorted() const; -- -- /// Returns this, any chained ImageFilterModel, or 0. -- virtual ImageFilterModel* imageFilterModel() const; -- --protected: -- -- /// Reimplement if needed. Called only when model shall be set as (direct) sourceModel. -- virtual void setDirectSourceImageModel(ImageModel* model); -- -- // made protected -- virtual void setSourceModel(QAbstractItemModel* model); -- --protected: -- -- ImageSortFilterModel* m_chainedModel; --}; -- --// ----------------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT ImageFilterModel : public ImageSortFilterModel --{ -- Q_OBJECT -- --public: -- -- enum ImageFilterModelRoles -- { -- /// Returns the current categorization mode -- CategorizationModeRole = ImageModel::FilterModelRoles + 1, -- /// Returns the current sort order -- SortOrderRole = ImageModel::FilterModelRoles + 2, -- // / Returns the number of items in the index' category -- //CategoryCountRole = ImageModel::FilterModelRoles + 3, -- /// Returns the id of the PAlbum of the index which is used for category -- CategoryAlbumIdRole = ImageModel::FilterModelRoles + 3, -- /// Returns the format of the index which is used for category -- CategoryFormatRole = ImageModel::FilterModelRoles + 4, -- /// Returns true if the given image is a group leader, and the group is opened -- GroupIsOpenRole = ImageModel::FilterModelRoles + 5, -- ImageFilterModelPointerRole = ImageModel::FilterModelRoles + 50 -- }; -- --public: -- -- explicit ImageFilterModel(QObject* parent = 0); -- ~ImageFilterModel(); -- -- /** Add a hook to get added images for preparation tasks before they are added in the model */ -- void addPrepareHook(ImageFilterModelPrepareHook* hook); -- void removePrepareHook(ImageFilterModelPrepareHook* hook); -- -- /** Returns a set of DatabaseFields suggested to set as watch flags on the source ImageModel. -- * The contained flags will be those that this model can sort or filter by. */ -- DatabaseFields::Set suggestedWatchFlags() const; -- -- ImageFilterSettings imageFilterSettings() const; -- VersionImageFilterSettings versionImageFilterSettings() const; -- GroupImageFilterSettings groupImageFilterSettings() const; -- ImageSortSettings imageSortSettings() const; -- -- // group is identified by the id of its group leader -- bool isGroupOpen(qlonglong group) const; -- bool isAllGroupsOpen() const; -- -- /// Enables sending imageInfosAdded and imageInfosAboutToBeRemoved -- void setSendImageInfoSignals(bool sendSignals); -- -- virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -- virtual ImageFilterModel* imageFilterModel() const; -- --public Q_SLOTS: -- -- /** Changes the current version image filter settings and refilters. */ -- void setVersionImageFilterSettings(const VersionImageFilterSettings& settings); -- -- /** Changes the current version image filter settings and refilters. */ -- void setGroupImageFilterSettings(const GroupImageFilterSettings& settings); -- -- /** Adjust the current ImageFilterSettings. -- * Equivalent to retrieving the current filter settings, adjusting the parameter -- * and calling setImageFilterSettings. -- * Provided for convenience. -- * It is encouraged to use setImageFilterSettings if you change more than one -- * parameter at a time. -- */ -- void setDayFilter(const QList& days); -- void setTagFilter(const QList& includedTags, const QList& excludedTags, -- ImageFilterSettings::MatchingCondition matchingCond, bool showUnTagged, -- const QList& clTagIds, const QList& plTagIds); -- void setRatingFilter(int rating, ImageFilterSettings::RatingCondition ratingCond, bool isUnratedExcluded); -- void setMimeTypeFilter(int mimeTypeFilter); -- void setGeolocationFilter(const ImageFilterSettings::GeolocationCondition& condition); -- void setTextFilter(const SearchTextFilterSettings& settings); -- -- void setCategorizationMode(ImageSortSettings::CategorizationMode mode); -- void setCategorizationSortOrder(ImageSortSettings::SortOrder order); -- void setSortRole(ImageSortSettings::SortRole role); -- void setSortOrder(ImageSortSettings::SortOrder order); -- void setStringTypeNatural(bool natural); -- void setUrlWhitelist(const QList urlList, const QString& id); -- void setIdWhitelist(const QList& idList, const QString& id); -- -- void setVersionManagerSettings(const VersionManagerSettings& settings); -- void setExceptionList(const QList& idlist, const QString& id); -- -- void setGroupOpen(qlonglong group, bool open); -- void toggleGroupOpen(qlonglong group); -- void setAllGroupsOpen(bool open); -- -- /** Changes the current image filter settings and refilters. */ -- virtual void setImageFilterSettings(const ImageFilterSettings& settings); -- -- /** Changes the current image sort settings and resorts. */ -- virtual void setImageSortSettings(const ImageSortSettings& settings); -- --Q_SIGNALS: -- -- /// Signals that the set filter matches at least one index -- void filterMatches(bool matches); -- -- /** Signals that the set text filter matches at least one entry. -- If no text filter is set, this signal is emitted -- with 'false' when filterMatches() is emitted. -- */ -- void filterMatchesForText(bool matchesByText); -- -- /** Emitted when the filter settings have been changed -- (the model may not yet have been updated) -- */ -- void filterSettingsChanged(const ImageFilterSettings& settings); -- -- /** These signals need to be explicitly enabled with setSendImageInfoSignals() -- */ -- void imageInfosAdded(const QList& infos); -- void imageInfosAboutToBeRemoved(const QList& infos); -- --public: -- -- // Declared as public because of use in sub-classes. -- class ImageFilterModelPrivate; -- --protected: -- -- ImageFilterModelPrivate* const d_ptr; -- --protected: -- -- ImageFilterModel(ImageFilterModelPrivate& dd, QObject* parent); -- -- virtual void setDirectSourceImageModel(ImageModel* model); -- -- virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; -- -- virtual int compareCategories(const QModelIndex& left, const QModelIndex& right) const; -- virtual bool subSortLessThan(const QModelIndex& left, const QModelIndex& right) const; -- //virtual int categoryCount(const ImageInfo& info) const; -- -- /** Reimplement to customize category sorting, -- * Return negative if category of left < category right, -- * Return 0 if left and right are in the same category, else return positive. -- */ -- virtual int compareInfosCategories(const ImageInfo& left, const ImageInfo& right) const; -- -- /** Reimplement to customize sorting. Do not take categories into account here. -- */ -- virtual bool infosLessThan(const ImageInfo& left, const ImageInfo& right) const; -- -- /** Returns a unique identifier for the category if info. The string need not be for user display. -- */ -- virtual QString categoryIdentifier(const ImageInfo& info) const; -- --protected Q_SLOTS: -- -- void slotModelReset(); -- void slotUpdateFilter(); -- -- void slotImageTagChange(const ImageTagChangeset& changeset); -- void slotImageChange(const ImageChangeset& changeset); -- -- void slotRowsInserted(const QModelIndex& parent, int start, int end); -- void slotRowsAboutToBeRemoved(const QModelIndex& parent, int start, int end); -- --private: -- -- Q_DECLARE_PRIVATE(ImageFilterModel) --}; -- --// ----------------------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT NoDuplicatesImageFilterModel : public ImageSortFilterModel --{ -- Q_OBJECT -- --public: -- -- explicit NoDuplicatesImageFilterModel(QObject* parent = 0); -- --protected: -- -- virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; --}; -- --} // namespace Digikam -- --Q_DECLARE_METATYPE(Digikam::ImageFilterModel*) -- --#endif // IMAGEMODEL_H -diff --git a/libs/models/imagefiltermodelpriv.cpp b/libs/models/imagefiltermodelpriv.cpp -deleted file mode 100644 -index 07d9e79..0000000 ---- a/libs/models/imagefiltermodelpriv.cpp -+++ /dev/null -@@ -1,258 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011-2017 by Gilles Caulier -- * Copyright (C) 2010 by Andi Clemens -- * Copyright (C) 2011 by Michael G. Hansen -- * Copyright (C) 2014 by Mohamed Anwer -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagefiltermodelpriv.h" -- --// Local includes -- --#include "digikam_debug.h" --#include "imagefiltermodelthreads.h" -- --namespace Digikam --{ -- --ImageFilterModel::ImageFilterModelPrivate::ImageFilterModelPrivate() --{ -- imageModel = 0; -- version = 0; -- lastDiscardVersion = 0; -- sentOut = 0; -- sentOutForReAdd = 0; -- updateFilterTimer = 0; -- needPrepare = false; -- needPrepareComments = false; -- needPrepareTags = false; -- needPrepareGroups = false; -- preparer = 0; -- filterer = 0; -- hasOneMatch = false; -- hasOneMatchForText = false; -- -- setupWorkers(); --} -- --ImageFilterModel::ImageFilterModelPrivate::~ImageFilterModelPrivate() --{ -- // facilitate thread stopping -- ++version; -- preparer->deactivate(); -- filterer->deactivate(); -- delete preparer; -- delete filterer; --} -- --void ImageFilterModel::ImageFilterModelPrivate::init(ImageFilterModel* _q) --{ -- q = _q; -- -- updateFilterTimer = new QTimer(this); -- updateFilterTimer->setSingleShot(true); -- updateFilterTimer->setInterval(250); -- -- connect(updateFilterTimer, SIGNAL(timeout()), -- q, SLOT(slotUpdateFilter())); -- -- // inter-thread redirection -- qRegisterMetaType("ImageFilterModelTodoPackage"); --} -- --void ImageFilterModel::ImageFilterModelPrivate::preprocessInfos(const QList& infos, const QList& extraValues) --{ -- infosToProcess(infos, extraValues, true); --} -- --void ImageFilterModel::ImageFilterModelPrivate::processAddedInfos(const QList& infos, const QList& extraValues) --{ -- // These have already been added, we just process them afterwards -- infosToProcess(infos, extraValues, false); --} -- --void ImageFilterModel::ImageFilterModelPrivate::setupWorkers() --{ -- preparer = new ImageFilterModelPreparer(this); -- filterer = new ImageFilterModelFilterer(this); -- -- // A package in constructed in infosToProcess. -- // Normal flow is infosToProcess -> preparer::process -> filterer::process -> packageFinished. -- // If no preparation is needed, the first step is skipped. -- // If filter version changes, both will discard old package and send them to packageDiscarded. -- -- connect(this, SIGNAL(packageToPrepare(ImageFilterModelTodoPackage)), -- preparer, SLOT(process(ImageFilterModelTodoPackage))); -- -- connect(this, SIGNAL(packageToFilter(ImageFilterModelTodoPackage)), -- filterer, SLOT(process(ImageFilterModelTodoPackage))); -- -- connect(preparer, SIGNAL(processed(ImageFilterModelTodoPackage)), -- filterer, SLOT(process(ImageFilterModelTodoPackage))); -- -- connect(filterer, SIGNAL(processed(ImageFilterModelTodoPackage)), -- this, SLOT(packageFinished(ImageFilterModelTodoPackage))); -- -- connect(preparer, SIGNAL(discarded(ImageFilterModelTodoPackage)), -- this, SLOT(packageDiscarded(ImageFilterModelTodoPackage))); -- -- connect(filterer, SIGNAL(discarded(ImageFilterModelTodoPackage)), -- this, SLOT(packageDiscarded(ImageFilterModelTodoPackage))); --} -- --void ImageFilterModel::ImageFilterModelPrivate::infosToProcess(const QList& infos) --{ -- infosToProcess(infos, QList(), false); --} -- --void ImageFilterModel::ImageFilterModelPrivate::infosToProcess(const QList& infos, const QList& extraValues, bool forReAdd) --{ -- if (infos.isEmpty()) -- { -- return; -- } -- -- filterer->schedule(); -- -- if (needPrepare) -- { -- preparer->schedule(); -- } -- -- Q_ASSERT(extraValues.isEmpty() || infos.size() == extraValues.size()); -- -- // prepare and filter in chunks -- const int size = infos.size(); -- const int maxChunkSize = needPrepare ? PrepareChunkSize : FilterChunkSize; -- const bool hasExtraValues = !extraValues.isEmpty(); -- QList::const_iterator it = infos.constBegin(), end; -- QList::const_iterator xit = extraValues.constBegin(), xend; -- int index = 0; -- QVector infoVector; -- QVector extraValueVector; -- -- while (it != infos.constEnd()) -- { -- const int chunkSize = qMin(maxChunkSize, size - index); -- infoVector.resize(chunkSize); -- end = it + chunkSize; -- qCopy(it, end, infoVector.begin()); -- -- if (hasExtraValues) -- { -- extraValueVector.resize(chunkSize); -- xend = xit + chunkSize; -- qCopy(xit, xend, extraValueVector.begin()); -- xit = xend; -- } -- -- it = end; -- index += chunkSize; -- -- ++sentOut; -- -- if (forReAdd) -- { -- ++sentOutForReAdd; -- } -- -- if (needPrepare) -- { -- emit packageToPrepare(ImageFilterModelTodoPackage(infoVector, extraValueVector, version, forReAdd)); -- } -- else -- { -- emit packageToFilter(ImageFilterModelTodoPackage(infoVector, extraValueVector, version, forReAdd)); -- } -- } --} -- --void ImageFilterModel::ImageFilterModelPrivate::packageFinished(const ImageFilterModelTodoPackage& package) --{ -- // check if it got discarded on the journey -- if (package.version != version) -- { -- packageDiscarded(package); -- return; -- } -- -- // incorporate result -- QHash::const_iterator it = package.filterResults.constBegin(); -- -- for (; it != package.filterResults.constEnd(); ++it) -- { -- filterResults.insert(it.key(), it.value()); -- } -- -- // re-add if necessary -- if (package.isForReAdd) -- { -- emit reAddImageInfos(package.infos.toList(), package.extraValues.toList()); -- -- if (sentOutForReAdd == 1) // last package -- { -- emit reAddingFinished(); -- } -- } -- -- // decrement counters -- --sentOut; -- -- if (package.isForReAdd) -- { -- --sentOutForReAdd; -- } -- -- // If all packages have returned, filtered and readded, and no more are expected, -- // and there is need to tell the filter result to the view, do that -- if (sentOut == 0 && sentOutForReAdd == 0 && !imageModel->isRefreshing()) -- { -- q->invalidate(); // use invalidate, not invalidateFilter only. Sorting may have changed as well. -- emit (q->filterMatches(hasOneMatch)); -- emit (q->filterMatchesForText(hasOneMatchForText)); -- filterer->deactivate(); -- preparer->deactivate(); -- } --} -- --void ImageFilterModel::ImageFilterModelPrivate::packageDiscarded(const ImageFilterModelTodoPackage& package) --{ -- // Either, the model was reset, or the filter changed -- // In the former case throw all away, in the latter case, recycle -- if (package.version > lastDiscardVersion) -- { -- // Recycle packages: Send again with current version -- // Do not increment sentOut or sentOutForReAdd here: it was not decremented! -- -- if (needPrepare) -- { -- emit packageToPrepare(ImageFilterModelTodoPackage(package.infos, package.extraValues, version, package.isForReAdd)); -- } -- else -- { -- emit packageToFilter(ImageFilterModelTodoPackage(package.infos, package.extraValues, version, package.isForReAdd)); -- } -- } --} -- --} // namespace Digikam -diff --git a/libs/models/imagefiltermodelpriv.h b/libs/models/imagefiltermodelpriv.h -deleted file mode 100644 -index a9e3f22..0000000 ---- a/libs/models/imagefiltermodelpriv.h -+++ /dev/null -@@ -1,159 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-11 -- * Description : Qt item model for database entries - private shared header -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGEFILTERMODELPRIV_H --#define IMAGEFILTERMODELPRIV_H -- --// Qt includes -- --#include --#include --#include --#include --#include --#include --#include -- --// Local includes -- --#include "imageinfo.h" --#include "imagefiltermodel.h" -- --#include "digikam_export.h" --// Yes, we need the EXPORT macro in a private header because --// this private header is shared across binary objects. --// This does NOT make this classes here any more public! -- --namespace Digikam --{ -- --const int PrepareChunkSize = 101; --const int FilterChunkSize = 2001; -- --class ImageFilterModelTodoPackage --{ --public: -- -- ImageFilterModelTodoPackage() -- : version(0), isForReAdd(false) -- { -- } -- -- ImageFilterModelTodoPackage(const QVector& infos, const QVector& extraValues, int version, bool isForReAdd) -- : infos(infos), extraValues(extraValues), version(version), isForReAdd(isForReAdd) -- { -- } -- -- QVector infos; -- QVector extraValues; -- unsigned int version; -- bool isForReAdd; -- QHash filterResults; --}; -- --// ------------------------------------------------------------------------------------------------ -- --class ImageFilterModelPreparer; --class ImageFilterModelFilterer; -- --class DIGIKAM_DATABASE_EXPORT ImageFilterModel::ImageFilterModelPrivate : public QObject --{ -- Q_OBJECT -- --public: -- -- ImageFilterModelPrivate(); -- ~ImageFilterModelPrivate(); -- -- void init(ImageFilterModel* q); -- void setupWorkers(); -- void infosToProcess(const QList& infos); -- void infosToProcess(const QList& infos, const QList& extraValues, bool forReAdd = true); -- --public: -- -- ImageFilterModel* q; -- -- ImageModel* imageModel; -- -- ImageFilterSettings filter; -- ImageSortSettings sorter; -- VersionImageFilterSettings versionFilter; -- GroupImageFilterSettings groupFilter; -- -- volatile unsigned int version; -- unsigned int lastDiscardVersion; -- unsigned int lastFilteredVersion; -- int sentOut; -- int sentOutForReAdd; -- -- QTimer* updateFilterTimer; -- -- bool needPrepare; -- bool needPrepareComments; -- bool needPrepareTags; -- bool needPrepareGroups; -- -- QMutex mutex; -- ImageFilterSettings filterCopy; -- VersionImageFilterSettings versionFilterCopy; -- GroupImageFilterSettings groupFilterCopy; -- ImageFilterModelPreparer* preparer; -- ImageFilterModelFilterer* filterer; -- -- QHash filterResults; -- bool hasOneMatch; -- bool hasOneMatchForText; -- -- QList prepareHooks; -- --/* -- QHash > categoryCountHashInt; -- QHash > categoryCountHashString; -- --public: -- -- void cacheCategoryCount(int id, qlonglong imageid) const -- { const_cast(this)->categoryCountHashInt[id].insert(imageid); } -- void cacheCategoryCount(const QString& id, qlonglong imageid) const -- { const_cast(this)->categoryCountHashString[id].insert(imageid); } --*/ -- --public Q_SLOTS: -- -- void preprocessInfos(const QList& infos, const QList& extraValues); -- void processAddedInfos(const QList& infos, const QList& extraValues); -- void packageFinished(const ImageFilterModelTodoPackage& package); -- void packageDiscarded(const ImageFilterModelTodoPackage& package); -- --Q_SIGNALS: -- -- void packageToPrepare(const ImageFilterModelTodoPackage& package); -- void packageToFilter(const ImageFilterModelTodoPackage& package); -- void reAddImageInfos(const QList& infos, const QList& extraValues); -- void reAddingFinished(); --}; -- --} // namespace Digikam -- --#endif // IMAGEFILTERMODELPRIV_H -diff --git a/libs/models/imagefiltermodelthreads.cpp b/libs/models/imagefiltermodelthreads.cpp -deleted file mode 100644 -index aa5c462..0000000 ---- a/libs/models/imagefiltermodelthreads.cpp -+++ /dev/null -@@ -1,40 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011-2017 by Gilles Caulier -- * Copyright (C) 2010 by Andi Clemens -- * Copyright (C) 2011 by Michael G. Hansen -- * Copyright (C) 2014 by Mohamed Anwer -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagefiltermodel.h" --#include "imagefiltermodelpriv.h" --#include "imagefiltermodelthreads.h" -- --namespace Digikam --{ -- --ImageFilterModelWorker::ImageFilterModelWorker(ImageFilterModel::ImageFilterModelPrivate* const d) -- : d(d) --{ --} -- --} // namespace Digikam -diff --git a/libs/models/imagefiltermodelthreads.h b/libs/models/imagefiltermodelthreads.h -deleted file mode 100644 -index 83fa987..0000000 ---- a/libs/models/imagefiltermodelthreads.h -+++ /dev/null -@@ -1,100 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-11 -- * Description : Qt item model for database entries - private header -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGEFILTERMODELTHREADS_H --#define IMAGEFILTERMODELTHREADS_H -- --// Qt includes -- --#include -- --// Local includes -- --#include "digikam_export.h" --#include "workerobject.h" -- --namespace Digikam --{ -- --class DIGIKAM_DATABASE_EXPORT ImageFilterModelWorker : public WorkerObject --{ -- Q_OBJECT -- --public: -- -- explicit ImageFilterModelWorker(ImageFilterModel::ImageFilterModelPrivate* const d); -- -- bool checkVersion(const ImageFilterModelTodoPackage& package) -- { -- return d->version == package.version; -- } -- --public Q_SLOTS: -- -- virtual void process(ImageFilterModelTodoPackage package) = 0; -- --Q_SIGNALS: -- -- void processed(const ImageFilterModelTodoPackage& package); -- void discarded(const ImageFilterModelTodoPackage& package); -- --protected: -- -- ImageFilterModel::ImageFilterModelPrivate* d; --}; -- --// ----------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT ImageFilterModelPreparer : public ImageFilterModelWorker --{ -- Q_OBJECT -- --public: -- -- explicit ImageFilterModelPreparer(ImageFilterModel::ImageFilterModelPrivate* const d) -- : ImageFilterModelWorker(d) -- { -- } -- -- void process(ImageFilterModelTodoPackage package); --}; -- --// ---------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT ImageFilterModelFilterer : public ImageFilterModelWorker --{ -- Q_OBJECT -- --public: -- -- explicit ImageFilterModelFilterer(ImageFilterModel::ImageFilterModelPrivate* const d) -- : ImageFilterModelWorker(d) -- { -- } -- -- void process(ImageFilterModelTodoPackage package); --}; -- --} // namespace Digikam -- --#endif // IMAGEFILTERMODELTHREADS_H -diff --git a/libs/models/imagefiltersettings.cpp b/libs/models/imagefiltersettings.cpp -deleted file mode 100644 -index b61e7f9..0000000 ---- a/libs/models/imagefiltersettings.cpp -+++ /dev/null -@@ -1,952 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Filter values for use with ImageFilterModel -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011-2017 by Gilles Caulier -- * Copyright (C) 2010 by Andi Clemens -- * Copyright (C) 2011 by Michael G. Hansen -- * Copyright (C) 2014 by Mohamed Anwer -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagefiltersettings.h" -- --// C++ includes -- --#include -- --// Qt includes -- --#include -- --// Local includes -- --#include "digikam_debug.h" --#include "coredbfields.h" --#include "digikam_globals.h" --#include "imageinfo.h" --#include "tagscache.h" --#include "versionmanagersettings.h" -- --namespace Digikam --{ -- --ImageFilterSettings::ImageFilterSettings() --{ -- m_untaggedFilter = false; -- m_isUnratedExcluded = false; -- m_ratingFilter = 0; -- m_mimeTypeFilter = MimeFilter::AllFiles; -- m_ratingCond = GreaterEqualCondition; -- m_matchingCond = OrCondition; -- m_geolocationCondition = GeolocationNoFilter; --} -- --DatabaseFields::Set ImageFilterSettings::watchFlags() const --{ -- DatabaseFields::Set set; -- -- if (isFilteringByDay()) -- { -- set |= DatabaseFields::CreationDate; -- } -- -- if (isFilteringByText()) -- { -- set |= DatabaseFields::Name; -- set |= DatabaseFields::Comment; -- } -- -- if (isFilteringByRating()) -- { -- set |= DatabaseFields::Rating; -- } -- -- if (isFilteringByTypeMime()) -- { -- set |= DatabaseFields::Category; -- set |= DatabaseFields::Format; -- } -- -- if (isFilteringByGeolocation()) -- { -- set |= DatabaseFields::ImagePositionsAll; -- } -- -- if (isFilteringByColorLabels()) -- { -- set |= DatabaseFields::ColorLabel; -- } -- -- if (isFilteringByPickLabels()) -- { -- set |= DatabaseFields::PickLabel; -- } -- -- return set; --} -- --bool ImageFilterSettings::isFilteringByDay() const --{ -- if (!m_dayFilter.isEmpty()) -- { -- return true; -- } -- -- return false; --} -- --bool ImageFilterSettings::isFilteringByTags() const --{ -- if (!m_includeTagFilter.isEmpty() || !m_excludeTagFilter.isEmpty() || m_untaggedFilter) -- { -- return true; -- } -- -- return false; --} -- --bool ImageFilterSettings::isFilteringByColorLabels() const --{ -- if (!m_colorLabelTagFilter.isEmpty()) -- { -- return true; -- } -- -- return false; --} -- --bool ImageFilterSettings::isFilteringByPickLabels() const --{ -- if (!m_pickLabelTagFilter.isEmpty()) -- { -- return true; -- } -- -- return false; --} -- --bool ImageFilterSettings::isFilteringByText() const --{ -- if (!m_textFilterSettings.text.isEmpty()) -- { -- return true; -- } -- -- return false; --} -- --bool ImageFilterSettings::isFilteringByTypeMime() const --{ -- if (m_mimeTypeFilter != MimeFilter::AllFiles) -- { -- return true; -- } -- -- return false; --} -- --bool ImageFilterSettings::isFilteringByGeolocation() const --{ -- return (m_geolocationCondition != GeolocationNoFilter); --} -- --bool ImageFilterSettings::isFilteringByRating() const --{ -- if (m_ratingFilter != 0 || m_ratingCond != GreaterEqualCondition || m_isUnratedExcluded) -- { -- return true; -- } -- -- return false; --} -- --bool ImageFilterSettings::isFilteringInternally() const --{ -- return (isFiltering() || !m_urlWhitelists.isEmpty() || !m_idWhitelists.isEmpty()); --} -- --bool ImageFilterSettings::isFiltering() const --{ -- return isFilteringByDay() || -- isFilteringByTags() || -- isFilteringByText() || -- isFilteringByRating() || -- isFilteringByTypeMime() || -- isFilteringByColorLabels() || -- isFilteringByPickLabels() || -- isFilteringByGeolocation(); --} -- --void ImageFilterSettings::setDayFilter(const QList& days) --{ -- m_dayFilter.clear(); -- -- for (QList::const_iterator it = days.constBegin(); it != days.constEnd(); ++it) -- { -- m_dayFilter.insert(*it, true); -- } --} -- --void ImageFilterSettings::setTagFilter(const QList& includedTags, -- const QList& excludedTags, -- MatchingCondition matchingCondition, -- bool showUnTagged, -- const QList& clTagIds, -- const QList& plTagIds) --{ -- m_includeTagFilter = includedTags; -- m_excludeTagFilter = excludedTags; -- m_matchingCond = matchingCondition; -- m_untaggedFilter = showUnTagged; -- m_colorLabelTagFilter = clTagIds; -- m_pickLabelTagFilter = plTagIds; --} -- --void ImageFilterSettings::setRatingFilter(int rating, RatingCondition ratingCondition, bool isUnratedExcluded) --{ -- m_ratingFilter = rating; -- m_ratingCond = ratingCondition; -- m_isUnratedExcluded = isUnratedExcluded; --} -- --void ImageFilterSettings::setMimeTypeFilter(int mime) --{ -- m_mimeTypeFilter = (MimeFilter::TypeMimeFilter)mime; --} -- --void ImageFilterSettings::setGeolocationFilter(const GeolocationCondition& condition) --{ -- m_geolocationCondition = condition; --} -- --void ImageFilterSettings::setTextFilter(const SearchTextFilterSettings& settings) --{ -- m_textFilterSettings = settings; --} -- --void ImageFilterSettings::setTagNames(const QHash& hash) --{ -- m_tagNameHash = hash; --} -- --void ImageFilterSettings::setAlbumNames(const QHash& hash) --{ -- m_albumNameHash = hash; --} -- --void ImageFilterSettings::setUrlWhitelist(const QList& urlList, const QString& id) --{ -- if (urlList.isEmpty()) -- { -- m_urlWhitelists.remove(id); -- } -- else -- { -- m_urlWhitelists.insert(id, urlList); -- } --} -- --void ImageFilterSettings::setIdWhitelist(const QList& idList, const QString& id) --{ -- if (idList.isEmpty()) -- { -- m_idWhitelists.remove(id); -- } -- else -- { -- m_idWhitelists.insert(id, idList); -- } --} -- --template --bool containsAnyOf(const ContainerA& listA, const ContainerB& listB) --{ -- foreach (const typename ContainerA::value_type& a, listA) -- { -- if (listB.contains(a)) -- { -- return true; -- } -- } -- return false; --} -- --template --bool containsNoneOfExcept(const ContainerA& list, const ContainerB& noneOfList, const Value& exception) --{ -- foreach (const typename ContainerB::value_type& n, noneOfList) -- { -- if (n != exception && list.contains(n)) -- { -- return false; -- } -- } -- return true; --} -- --bool ImageFilterSettings::matches(const ImageInfo& info, bool* const foundText) const --{ -- if (foundText) -- { -- *foundText = false; -- } -- -- if (!isFilteringInternally()) -- { -- return true; -- } -- -- bool match = false; -- -- if (!m_includeTagFilter.isEmpty() || !m_excludeTagFilter.isEmpty()) -- { -- QList tagIds = info.tagIds(); -- QList::const_iterator it; -- -- match = m_includeTagFilter.isEmpty(); -- -- if (m_matchingCond == OrCondition) -- { -- for (it = m_includeTagFilter.begin(); it != m_includeTagFilter.end(); ++it) -- { -- if (tagIds.contains(*it)) -- { -- match = true; -- break; -- } -- } -- -- match |= (m_untaggedFilter && tagIds.isEmpty()); -- } -- else // AND matching condition... -- { -- // m_untaggedFilter and non-empty tag filter, combined with AND, is logically no match -- if (!m_untaggedFilter) -- { -- for (it = m_includeTagFilter.begin(); it != m_includeTagFilter.end(); ++it) -- { -- if (!tagIds.contains(*it)) -- { -- break; -- } -- } -- -- if (it == m_includeTagFilter.end()) -- { -- match = true; -- } -- } -- } -- -- for (it = m_excludeTagFilter.begin(); it != m_excludeTagFilter.end(); ++it) -- { -- if (tagIds.contains(*it)) -- { -- match = false; -- break; -- } -- } -- } -- else if (m_untaggedFilter) -- { -- match = !TagsCache::instance()->containsPublicTags(info.tagIds()); -- } -- else -- { -- match = true; -- } -- -- //-- Filter by pick labels ------------------------------------------------ -- -- if (!m_pickLabelTagFilter.isEmpty()) -- { -- QList tagIds = info.tagIds(); -- bool matchPL = false; -- -- if (containsAnyOf(m_pickLabelTagFilter, tagIds)) -- { -- matchPL = true; -- } -- else if (!matchPL) -- { -- int noPickLabelTagId = TagsCache::instance()->tagForPickLabel(NoPickLabel); -- -- if (m_pickLabelTagFilter.contains(noPickLabelTagId)) -- { -- // Searching for "has no ColorLabel" requires special handling: -- // Scan that the tag ids contains none of the ColorLabel tags, except maybe the NoColorLabel tag -- matchPL = containsNoneOfExcept(tagIds, TagsCache::instance()->pickLabelTags(), noPickLabelTagId); -- } -- } -- -- match &= matchPL; -- } -- -- //-- Filter by color labels ------------------------------------------------ -- -- if (!m_colorLabelTagFilter.isEmpty()) -- { -- QList tagIds = info.tagIds(); -- bool matchCL = false; -- -- if (containsAnyOf(m_colorLabelTagFilter, tagIds)) -- { -- matchCL = true; -- } -- else if (!matchCL) -- { -- int noColorLabelTagId = TagsCache::instance()->tagForColorLabel(NoColorLabel); -- -- if (m_colorLabelTagFilter.contains(noColorLabelTagId)) -- { -- // Searching for "has no ColorLabel" requires special handling: -- // Scan that the tag ids contains none of the ColorLabel tags, except maybe the NoColorLabel tag -- matchCL = containsNoneOfExcept(tagIds, TagsCache::instance()->colorLabelTags(), noColorLabelTagId); -- } -- } -- -- match &= matchCL; -- } -- -- //-- Filter by date ----------------------------------------------------------- -- -- if (!m_dayFilter.isEmpty()) -- { -- match &= m_dayFilter.contains(QDateTime(info.dateTime().date(), QTime())); -- } -- -- //-- Filter by rating --------------------------------------------------------- -- -- if (m_ratingFilter >= 0) -- { -- // for now we treat -1 (no rating) just like a rating of 0. -- int rating = info.rating(); -- -- if (rating == -1) -- { -- rating = 0; -- } -- -- if(m_isUnratedExcluded && rating == 0) -- { -- match = false; -- } -- else -- { -- if (m_ratingCond == GreaterEqualCondition) -- { -- // If the rating is not >=, i.e it is <, then it does not match. -- if (rating < m_ratingFilter) -- { -- match = false; -- } -- } -- else if (m_ratingCond == EqualCondition) -- { -- // If the rating is not =, i.e it is !=, then it does not match. -- if (rating != m_ratingFilter) -- { -- match = false; -- } -- } -- else -- { -- // If the rating is not <=, i.e it is >, then it does not match. -- if (rating > m_ratingFilter) -- { -- match = false; -- } -- } -- } -- } -- -- // -- Filter by mime type ----------------------------------------------------- -- -- switch (m_mimeTypeFilter) -- { -- // info.format is a standardized string: Only one possibility per mime type -- case MimeFilter::ImageFiles: -- { -- if (info.category() != DatabaseItem::Image) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::JPGFiles: -- { -- if (info.format() != QLatin1String("JPG")) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::PNGFiles: -- { -- if (info.format() != QLatin1String("PNG")) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::TIFFiles: -- { -- if (info.format() != QLatin1String("TIFF")) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::DNGFiles: -- { -- if (info.format() != QLatin1String("RAW-DNG")) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::NoRAWFiles: -- { -- if (info.format().startsWith(QLatin1String("RAW"))) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::RAWFiles: -- { -- if (!info.format().startsWith(QLatin1String("RAW"))) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::MoviesFiles: -- { -- if (info.category() != DatabaseItem::Video) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::AudioFiles: -- { -- if (info.category() != DatabaseItem::Audio) -- { -- match = false; -- } -- -- break; -- } -- case MimeFilter::RasterFiles: -- { -- if (info.format() != QLatin1String("PSD") && // Adobe Photoshop Document -- info.format() != QLatin1String("PSB") && // Adobe Photoshop Big -- info.format() != QLatin1String("XCF") && // Gimp -- info.format() != QLatin1String("KRA") && // Krita -- info.format() != QLatin1String("ORA") // Open Raster -- ) -- { -- match = false; -- } -- -- break; -- } -- default: -- { -- // All Files: do nothing... -- break; -- } -- } -- -- //-- Filter by geolocation ---------------------------------------------------- -- -- if (m_geolocationCondition!=GeolocationNoFilter) -- { -- if (m_geolocationCondition==GeolocationNoCoordinates) -- { -- if (info.hasCoordinates()) -- { -- match = false; -- } -- } -- else if (m_geolocationCondition==GeolocationHasCoordinates) -- { -- if (!info.hasCoordinates()) -- { -- match = false; -- } -- } -- } -- -- //-- Filter by text ----------------------------------------------------------- -- -- if (!m_textFilterSettings.text.isEmpty()) -- { -- bool textMatch = false; -- -- // Image name -- if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageName && -- info.name().contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -- { -- textMatch = true; -- } -- -- // Image title -- if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageTitle && -- info.title().contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -- { -- textMatch = true; -- } -- -- // Image comment -- if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageComment && -- info.comment().contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -- { -- textMatch = true; -- } -- -- // Tag names -- foreach(int id, info.tagIds()) -- { -- if (m_textFilterSettings.textFields & SearchTextFilterSettings::TagName && -- m_tagNameHash.value(id).contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -- { -- textMatch = true; -- } -- } -- -- // Album names -- if (m_textFilterSettings.textFields & SearchTextFilterSettings::AlbumName && -- m_albumNameHash.value(info.albumId()).contains(m_textFilterSettings.text, m_textFilterSettings.caseSensitive)) -- { -- textMatch = true; -- } -- -- // Image Aspect Ratio -- if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImageAspectRatio) -- { -- QRegExp expRatio (QLatin1String("^\\d+:\\d+$")); -- QRegExp expFloat (QLatin1String("^\\d+(.\\d+)?$")); -- -- if (expRatio.indexIn(m_textFilterSettings.text) > -1 && m_textFilterSettings.text.contains(QRegExp(QLatin1String(":\\d+")))) -- { -- QString trimmedTextFilterSettingsText = m_textFilterSettings.text; -- QStringList numberStringList = trimmedTextFilterSettingsText.split(QLatin1String(":"), QString::SkipEmptyParts); -- -- if (numberStringList.length() == 2) -- { -- QString numString = (QString)numberStringList.at(0), denomString = (QString)numberStringList.at(1); -- bool canConverseNum = false; -- bool canConverseDenom = false; -- int num = numString.toInt(&canConverseNum, 10), denom = denomString.toInt(&canConverseDenom, 10); -- -- if (canConverseNum && canConverseDenom) -- { -- if (fabs(info.aspectRatio() - (double)num / denom) < 0.1) -- textMatch = true; -- } -- } -- } -- else if (expFloat.indexIn(m_textFilterSettings.text) > -1) -- { -- QString trimmedTextFilterSettingsText = m_textFilterSettings.text; -- bool canConverse = false; -- double ratio = trimmedTextFilterSettingsText.toDouble(&canConverse); -- -- if (canConverse) -- { -- if (fabs(info.aspectRatio() - ratio) < 0.1) -- textMatch = true; -- } -- } -- } -- -- // Image Pixel Size -- // See bug #341053 for details. -- -- if (m_textFilterSettings.textFields & SearchTextFilterSettings::ImagePixelSize) -- { -- QSize size = info.dimensions(); -- int pixelSize = size.height()*size.width(); -- QString text = m_textFilterSettings.text; -- -- if(text.contains(QRegExp(QLatin1String("^>\\d{1,15}$"))) && pixelSize > (text.remove(0,1)).toInt()) -- { -- textMatch = true; -- } -- else if(text.contains(QRegExp(QLatin1String("^<\\d{1,15}$"))) && pixelSize < (text.remove(0,1)).toInt()) -- { -- textMatch = true; -- } -- else if(text.contains(QRegExp(QLatin1String("^\\d+$"))) && pixelSize == text.toInt()) -- { -- textMatch = true; -- } -- } -- -- match &= textMatch; -- -- if (foundText) -- { -- *foundText = textMatch; -- } -- } -- -- // -- filter by URL-whitelists ------------------------------------------------ -- // NOTE: whitelists are always AND for now. -- -- if (match) -- { -- const QUrl url = info.fileUrl(); -- -- for (QHash>::const_iterator it = m_urlWhitelists.constBegin(); -- it!=m_urlWhitelists.constEnd(); ++it) -- { -- match = it->contains(url); -- -- if (!match) -- { -- break; -- } -- } -- } -- -- if (match) -- { -- const qlonglong id = info.id(); -- -- for (QHash >::const_iterator it = m_idWhitelists.constBegin(); -- it!=m_idWhitelists.constEnd(); ++it) -- { -- match = it->contains(id); -- -- if (!match) -- { -- break; -- } -- } -- } -- -- return match; --} -- --// ------------------------------------------------------------------------------------------------- -- --VersionImageFilterSettings::VersionImageFilterSettings() --{ -- m_includeTagFilter = 0; -- m_exceptionTagFilter = 0; --} -- --VersionImageFilterSettings::VersionImageFilterSettings(const VersionManagerSettings& settings) --{ -- setVersionManagerSettings(settings); --} -- --bool VersionImageFilterSettings::operator==(const VersionImageFilterSettings& other) const --{ -- return m_excludeTagFilter == other.m_excludeTagFilter && -- m_exceptionLists == other.m_exceptionLists; --} -- --bool VersionImageFilterSettings::matches(const ImageInfo& info) const --{ -- if (!isFiltering()) -- { -- return true; -- } -- -- const qlonglong id = info.id(); -- -- for (QHash >::const_iterator it = m_exceptionLists.constBegin(); -- it != m_exceptionLists.constEnd(); ++it) -- { -- if (it->contains(id)) -- { -- return true; -- } -- } -- -- bool match = true; -- QList tagIds = info.tagIds(); -- -- if (!tagIds.contains(m_includeTagFilter)) -- { -- for (QList::const_iterator it = m_excludeTagFilter.begin(); -- it != m_excludeTagFilter.end(); ++it) -- { -- if (tagIds.contains(*it)) -- { -- match = false; -- break; -- } -- } -- } -- -- if (!match) -- { -- if (tagIds.contains(m_exceptionTagFilter)) -- { -- match = true; -- } -- } -- -- return match; --} -- --bool VersionImageFilterSettings::isHiddenBySettings(const ImageInfo& info) const --{ -- QList tagIds = info.tagIds(); -- -- foreach(int tagId, m_excludeTagFilter) -- { -- if (tagIds.contains(tagId)) -- { -- return true; -- } -- } -- -- return false; --} -- --bool VersionImageFilterSettings::isExemptedBySettings(const ImageInfo& info) const --{ -- return info.tagIds().contains(m_exceptionTagFilter); --} -- --void VersionImageFilterSettings::setVersionManagerSettings(const VersionManagerSettings& settings) --{ -- m_excludeTagFilter.clear(); -- -- if (!settings.enabled) -- { -- return; -- } -- -- if (!(settings.showInViewFlags & VersionManagerSettings::ShowOriginal)) -- { -- m_excludeTagFilter << TagsCache::instance()->getOrCreateInternalTag(InternalTagName::originalVersion()); -- } -- -- if (!(settings.showInViewFlags & VersionManagerSettings::ShowIntermediates)) -- { -- m_excludeTagFilter << TagsCache::instance()->getOrCreateInternalTag(InternalTagName::intermediateVersion()); -- } -- -- m_includeTagFilter = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::currentVersion()); -- m_exceptionTagFilter = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::versionAlwaysVisible()); --} -- --void VersionImageFilterSettings::setExceptionList(const QList& idList, const QString& id) --{ -- if (idList.isEmpty()) -- { -- m_exceptionLists.remove(id); -- } -- else -- { -- m_exceptionLists.insert(id, idList); -- } --} -- --bool VersionImageFilterSettings::isFiltering() const --{ -- return !m_excludeTagFilter.isEmpty(); --} -- --bool VersionImageFilterSettings::isFilteringByTags() const --{ -- return isFiltering(); --} -- --// ------------------------------------------------------------------------------------------------- -- --GroupImageFilterSettings::GroupImageFilterSettings() -- : m_allOpen(false) --{ --} -- --bool GroupImageFilterSettings::operator==(const GroupImageFilterSettings& other) const --{ -- return (m_allOpen == other.m_allOpen && -- m_openGroups == other.m_openGroups); --} -- --bool GroupImageFilterSettings::matches(const ImageInfo& info) const --{ -- if (m_allOpen) -- { -- return true; -- } -- -- if (info.isGrouped()) -- { -- return m_openGroups.contains(info.groupImage().id()); -- } -- return true; --} -- --void GroupImageFilterSettings::setOpen(qlonglong group, bool open) --{ -- if (open) -- { -- m_openGroups << group; -- } -- else -- { -- m_openGroups.remove(group); -- } --} -- --bool GroupImageFilterSettings::isOpen(qlonglong group) const --{ -- return m_openGroups.contains(group); --} -- --void GroupImageFilterSettings::setAllOpen(bool open) --{ -- m_allOpen = open; --} -- --bool GroupImageFilterSettings::isAllOpen() const --{ -- return m_allOpen; --} -- --bool GroupImageFilterSettings::isFiltering() const --{ -- return !m_allOpen; --} -- --DatabaseFields::Set GroupImageFilterSettings::watchFlags() const --{ -- return DatabaseFields::ImageRelations; --} -- --} // namespace Digikam -diff --git a/libs/models/imagefiltersettings.h b/libs/models/imagefiltersettings.h -deleted file mode 100644 -index 0e7beae..0000000 ---- a/libs/models/imagefiltersettings.h -+++ /dev/null -@@ -1,349 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Filter values for use with ImageFilterModel -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011-2017 by Gilles Caulier -- * Copyright (C) 2010 by Andi Clemens -- * Copyright (C) 2011 by Michael G. Hansen -- * Copyright (C) 2014 by Mohamed Anwer -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGEFILTERSETTINGS_H --#define IMAGEFILTERSETTINGS_H -- --// Qt includes -- --#include --#include --#include --#include --#include --#include -- --// Local includes -- --#include "searchtextbar.h" --#include "mimefilter.h" --#include "digikam_export.h" -- --namespace Digikam --{ -- --class ImageInfo; --class VersionManagerSettings; -- --namespace DatabaseFields --{ -- class Set; --} -- --// --------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT SearchTextFilterSettings : public SearchTextSettings --{ -- --public: -- -- enum TextFilterFields -- { -- None = 0x00, -- ImageName = 0x01, -- ImageTitle = 0x02, -- ImageComment = 0x04, -- TagName = 0x08, -- AlbumName = 0x10, -- ImageAspectRatio = 0x20, -- ImagePixelSize = 0x40, -- All = ImageName | ImageTitle | ImageComment | TagName | AlbumName | ImageAspectRatio | ImagePixelSize -- }; -- --public: -- -- SearchTextFilterSettings() -- { -- textFields = None; -- } -- -- explicit SearchTextFilterSettings(const SearchTextSettings& settings) -- { -- caseSensitive = settings.caseSensitive; -- text = settings.text; -- textFields = None; -- } -- -- TextFilterFields textFields; --}; -- --// --------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT ImageFilterSettings --{ --public: -- -- ImageFilterSettings(); -- -- /** -- * Returns true if the given ImageInfo matches the filter criteria. -- * Optionally, foundText is set to true if it matched by text search. -- */ -- bool matches(const ImageInfo& info, bool* const foundText = 0) const; -- --public: -- -- /// --- Tags filter --- -- -- /// Possible logical matching condition used to sort tags id. -- enum MatchingCondition -- { -- OrCondition, -- AndCondition -- }; -- -- void setTagFilter(const QList& includedTags, -- const QList& excludedTags, -- MatchingCondition matchingCond, -- bool showUnTagged, -- const QList& clTagIds, -- const QList& plTagIds); -- --public: -- -- /// --- Rating filter --- -- -- /// Possible conditions used to filter rating: >=, =, <= -- enum RatingCondition -- { -- GreaterEqualCondition, -- EqualCondition, -- LessEqualCondition -- }; -- -- void setRatingFilter(int rating, RatingCondition ratingCond, bool isUnratedExcluded); -- --public: -- -- /// --- Date filter --- -- void setDayFilter(const QList& days); -- --public: -- -- /// --- Text filter --- -- void setTextFilter(const SearchTextFilterSettings& settings); -- void setTagNames(const QHash& tagNameHash); -- void setAlbumNames(const QHash& albumNameHash); -- --public: -- -- /// --- Mime filter --- -- void setMimeTypeFilter(int mimeTypeFilter); -- --public: -- -- /// --- Geolocation filter -- enum GeolocationCondition -- { -- GeolocationNoFilter = 0, -- GeolocationNoCoordinates = 1 << 1, -- GeolocationHasCoordinates = 1 << 2 -- }; -- -- void setGeolocationFilter(const GeolocationCondition& condition); -- --public: -- -- /// Returns if the day is a filter criteria -- bool isFilteringByDay() const; -- -- /// Returns if the type mime is a filter criteria -- bool isFilteringByTypeMime() const; -- -- /// Returns whether geolocation is a filter criteria -- bool isFilteringByGeolocation() const; -- -- /// Returns if the rating is a filter criteria -- bool isFilteringByRating() const; -- -- /// Returns if the pick labels is a filter criteria -- bool isFilteringByPickLabels() const; -- -- /// Returns if the color labels is a filter criteria -- bool isFilteringByColorLabels() const; -- -- /// Returns if the tag is a filter criteria -- bool isFilteringByTags() const; -- -- /// Returns if the text (including comment) is a filter criteria -- bool isFilteringByText() const; -- -- /// Returns if images will be filtered by these criteria at all -- bool isFiltering() const; -- --public: -- -- /// --- URL whitelist filter -- void setUrlWhitelist(const QList& urlList, const QString& id); -- --public: -- -- /// --- ID whitelist filter -- void setIdWhitelist(const QList& idList, const QString& id); -- --public: -- -- /// --- Change notification --- -- -- /** Returns database fields a change in which would affect the current filtering. -- * To find out if an image tag change affects filtering, test isFilteringByTags(). -- * The text filter will also be affected by changes in tags and album names. -- */ -- DatabaseFields::Set watchFlags() const; -- --private: -- -- /** -- * @brief Returns whether some internal filtering (whitelist by id or URL) or normal filtering is going on -- */ -- bool isFilteringInternally() const; -- --private: -- -- /// --- Tags filter --- -- bool m_untaggedFilter; -- QList m_includeTagFilter; -- QList m_excludeTagFilter; -- MatchingCondition m_matchingCond; -- QList m_colorLabelTagFilter; -- QList m_pickLabelTagFilter; -- -- /// --- Rating filter --- -- int m_ratingFilter; -- RatingCondition m_ratingCond; -- bool m_isUnratedExcluded; -- -- /// --- Date filter --- -- QMap m_dayFilter; -- -- /// --- Text filter --- -- SearchTextFilterSettings m_textFilterSettings; -- -- /// Helpers for text search: Set these if you want to search album or tag names with text search -- QHash m_tagNameHash; -- QHash m_albumNameHash; -- -- /// --- Mime filter --- -- MimeFilter::TypeMimeFilter m_mimeTypeFilter; -- -- /// --- Geolocation filter -- GeolocationCondition m_geolocationCondition; -- -- /// --- URL whitelist filter -- QHash> m_urlWhitelists; -- -- /// --- ID whitelist filter -- QHash > m_idWhitelists; --}; -- --// --------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT VersionImageFilterSettings --{ --public: -- -- VersionImageFilterSettings(); -- explicit VersionImageFilterSettings(const VersionManagerSettings& settings); -- -- bool operator==(const VersionImageFilterSettings& other) const; -- -- /** -- * Returns true if the given ImageInfo matches the filter criteria. -- */ -- bool matches(const ImageInfo& info) const; -- -- bool isHiddenBySettings(const ImageInfo& info) const; -- bool isExemptedBySettings(const ImageInfo& info) const; -- -- /// --- Tags filter --- -- -- void setVersionManagerSettings(const VersionManagerSettings& settings); -- -- /** -- * Add list with exceptions: These images will be exempted from filtering by this filter -- */ -- void setExceptionList(const QList& idlist, const QString& id); -- -- /// Returns if images will be filtered by these criteria at all -- bool isFiltering() const; -- -- /// Returns if the tag is a filter criteria -- bool isFilteringByTags() const; -- -- /// DatabaseFields::Set watchFlags() const: Would return 0 -- --protected: -- -- QList m_excludeTagFilter; -- int m_includeTagFilter; -- int m_exceptionTagFilter; -- QHash > m_exceptionLists; --}; -- --// --------------------------------------------------------------------------------------- -- --class DIGIKAM_DATABASE_EXPORT GroupImageFilterSettings --{ --public: -- -- GroupImageFilterSettings(); -- -- bool operator==(const GroupImageFilterSettings& other) const; -- -- /** -- * Returns true if the given ImageInfo matches the filter criteria. -- */ -- bool matches(const ImageInfo& info) const; -- -- /** -- * Open or close a group. -- */ -- void setOpen(qlonglong group, bool open); -- bool isOpen(qlonglong group) const; -- -- /** -- * Open all groups -- */ -- void setAllOpen(bool open); -- bool isAllOpen() const; -- -- /// Returns if images will be filtered by these criteria at all -- bool isFiltering() const; -- -- DatabaseFields::Set watchFlags() const; -- --protected: -- -- bool m_allOpen; -- QSet m_openGroups; --}; -- --} // namespace Digikam -- --Q_DECLARE_METATYPE(Digikam::ImageFilterSettings::GeolocationCondition) -- --#endif // IMAGEFILTERSETTINGS_H -diff --git a/libs/models/imagelistmodel.cpp b/libs/models/imagelistmodel.cpp -deleted file mode 100644 -index fafce34..0000000 ---- a/libs/models/imagelistmodel.cpp -+++ /dev/null -@@ -1,70 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2010-12-06 -- * Description : An image model based on a static list -- * -- * Copyright (C) 2010-2011 by Marcel Wiesweg -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagelistmodel.h" -- --// Local includes -- --#include "digikam_debug.h" --#include "coredbaccess.h" --#include "coredbchangesets.h" --#include "coredbwatch.h" --#include "imageinfo.h" --#include "imageinfolist.h" -- --namespace Digikam --{ -- --ImageListModel::ImageListModel(QObject* parent) -- : ImageThumbnailModel(parent) --{ -- connect(CoreDbAccess::databaseWatch(), SIGNAL(collectionImageChange(CollectionImageChangeset)), -- this, SLOT(slotCollectionImageChange(CollectionImageChangeset))); --} -- --ImageListModel::~ImageListModel() --{ --} -- --void ImageListModel::slotCollectionImageChange(const CollectionImageChangeset& changeset) --{ -- if (isEmpty()) -- { -- return; -- } -- -- switch (changeset.operation()) -- { -- case CollectionImageChangeset::Added: -- break; -- case CollectionImageChangeset::Removed: -- case CollectionImageChangeset::RemovedAll: -- removeImageInfos(ImageInfoList(changeset.ids())); -- break; -- -- default: -- break; -- } --} -- --} // namespace Digikam -diff --git a/libs/models/imagelistmodel.h b/libs/models/imagelistmodel.h -deleted file mode 100644 -index a225b1b..0000000 ---- a/libs/models/imagelistmodel.h -+++ /dev/null -@@ -1,63 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2010-12-06 -- * Description : An image model based on a static list -- * -- * Copyright (C) 2010-2011 by Marcel Wiesweg -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGELISTMODEL_H --#define IMAGELISTMODEL_H -- --// Local includes -- --#include "imagethumbnailmodel.h" --#include "digikam_export.h" -- --namespace Digikam --{ -- --class ImageChangeset; --class CollectionImageChangeset; -- --class DIGIKAM_DATABASE_EXPORT ImageListModel : public ImageThumbnailModel --{ -- Q_OBJECT -- --public: -- -- explicit ImageListModel(QObject* parent = 0); -- ~ImageListModel(); -- -- // NOTE: necessary methods to add and remove ImageInfos to the model are inherited from ImageModel -- --Q_SIGNALS: -- -- /** -- * Emitted when images are removed from the model because they are removed in the database -- */ -- void imageInfosRemoved(const QList& infos); -- --protected Q_SLOTS: -- -- void slotCollectionImageChange(const CollectionImageChangeset& changeset); --}; -- --} // namespace Digikam -- --#endif // IMAGELISTMODEL_H -diff --git a/libs/models/imagemodel.cpp b/libs/models/imagemodel.cpp -deleted file mode 100644 -index 41b43cf..0000000 ---- a/libs/models/imagemodel.cpp -+++ /dev/null -@@ -1,1368 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagemodel.h" -- --// Qt includes -- --#include --#include -- --// Local includes -- --#include "digikam_debug.h" --#include "coredbchangesets.h" --#include "coredbfields.h" --#include "coredbwatch.h" --#include "imageinfo.h" --#include "imageinfolist.h" --#include "abstractitemdragdrophandler.h" -- --namespace Digikam --{ -- --class ImageModel::Private --{ --public: -- -- Private() -- { -- preprocessor = 0; -- keepFilePathCache = false; -- sendRemovalSignals = false; -- incrementalUpdater = 0; -- refreshing = false; -- reAdding = false; -- incrementalRefreshRequested = false; -- } -- -- ImageInfoList infos; -- QList extraValues; -- QHash idHash; -- -- bool keepFilePathCache; -- QHash filePathHash; -- -- bool sendRemovalSignals; -- -- QObject* preprocessor; -- bool refreshing; -- bool reAdding; -- bool incrementalRefreshRequested; -- -- DatabaseFields::Set watchFlags; -- -- class ImageModelIncrementalUpdater* incrementalUpdater; -- -- ImageInfoList pendingInfos; -- QList pendingExtraValues; -- -- inline bool isValid(const QModelIndex& index) -- { -- if (!index.isValid()) -- { -- return false; -- } -- -- if (index.row() < 0 || index.row() >= infos.size()) -- { -- qCDebug(DIGIKAM_GENERAL_LOG) << "Invalid index" << index; -- return false; -- } -- -- return true; -- } -- inline bool extraValueValid(const QModelIndex& index) -- { -- // we assume isValid() being called before, no duplicate checks -- if (index.row() >= extraValues.size()) -- { -- qCDebug(DIGIKAM_GENERAL_LOG) << "Invalid index for extraData" << index; -- return false; -- } -- -- return true; -- } --}; -- --typedef QPair IntPair; // to make foreach macro happy --typedef QList IntPairList; -- --class ImageModelIncrementalUpdater --{ --public: -- -- explicit ImageModelIncrementalUpdater(ImageModel::Private* d); -- -- void appendInfos(const QList& infos, const QList& extraValues); -- void aboutToBeRemovedInModel(const IntPairList& aboutToBeRemoved); -- QList oldIndexes(); -- -- static QList toContiguousPairs(const QList& ids); -- --public: -- -- QHash oldIds; -- QList oldExtraValues; -- QList newInfos; -- QList newExtraValues; -- QList modelRemovals; --}; -- --ImageModel::ImageModel(QObject* parent) -- : QAbstractListModel(parent), -- d(new Private) --{ -- connect(CoreDbAccess::databaseWatch(), SIGNAL(imageChange(ImageChangeset)), -- this, SLOT(slotImageChange(ImageChangeset))); -- -- connect(CoreDbAccess::databaseWatch(), SIGNAL(imageTagChange(ImageTagChangeset)), -- this, SLOT(slotImageTagChange(ImageTagChangeset))); --} -- --ImageModel::~ImageModel() --{ -- delete d->incrementalUpdater; -- delete d; --} -- --// ------------ Access methods ------------- -- --void ImageModel::setKeepsFilePathCache(bool keepCache) --{ -- d->keepFilePathCache = keepCache; --} -- --bool ImageModel::keepsFilePathCache() const --{ -- return d->keepFilePathCache; --} -- --bool ImageModel::isEmpty() const --{ -- return d->infos.isEmpty(); --} -- --void ImageModel::setWatchFlags(const DatabaseFields::Set& set) --{ -- d->watchFlags = set; --} -- --ImageInfo ImageModel::imageInfo(const QModelIndex& index) const --{ -- if (!d->isValid(index)) -- { -- return ImageInfo(); -- } -- -- return d->infos.at(index.row()); --} -- --ImageInfo& ImageModel::imageInfoRef(const QModelIndex& index) const --{ -- return d->infos[index.row()]; --} -- --qlonglong ImageModel::imageId(const QModelIndex& index) const --{ -- if (!d->isValid(index)) -- { -- return 0; -- } -- -- return d->infos.at(index.row()).id(); --} -- --QList ImageModel::imageInfos(const QList& indexes) const --{ -- QList infos; -- -- foreach(const QModelIndex& index, indexes) -- { -- infos << imageInfo(index); -- } -- -- return infos; --} -- --QList ImageModel::imageIds(const QList& indexes) const --{ -- QList ids; -- -- foreach(const QModelIndex& index, indexes) -- { -- ids << imageId(index); -- } -- -- return ids; --} -- --ImageInfo ImageModel::imageInfo(int row) const --{ -- if (row >= d->infos.size()) -- { -- return ImageInfo(); -- } -- -- return d->infos.at(row); --} -- --ImageInfo& ImageModel::imageInfoRef(int row) const --{ -- return d->infos[row]; --} -- --qlonglong ImageModel::imageId(int row) const --{ -- if (row < 0 || row >= d->infos.size()) -- { -- return -1; -- } -- -- return d->infos.at(row).id(); --} -- --QModelIndex ImageModel::indexForImageInfo(const ImageInfo& info) const --{ -- return indexForImageId(info.id()); --} -- --QModelIndex ImageModel::indexForImageInfo(const ImageInfo& info, const QVariant& extraValue) const --{ -- return indexForImageId(info.id(), extraValue); --} -- --QList ImageModel::indexesForImageInfo(const ImageInfo& info) const --{ -- return indexesForImageId(info.id()); --} -- --QModelIndex ImageModel::indexForImageId(qlonglong id) const --{ -- int index = d->idHash.value(id, -1); -- -- if (index != -1) -- { -- return createIndex(index, 0); -- } -- -- return QModelIndex(); --} -- --QModelIndex ImageModel::indexForImageId(qlonglong id, const QVariant& extraValue) const --{ -- if (d->extraValues.isEmpty()) -- return indexForImageId(id); -- -- QHash::const_iterator it; -- -- for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -- { -- if (d->extraValues.at(it.value()) == extraValue) -- return createIndex(it.value(), 0); -- } -- -- return QModelIndex(); --} -- --QList ImageModel::indexesForImageId(qlonglong id) const --{ -- QList indexes; -- QHash::const_iterator it; -- -- for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -- { -- indexes << createIndex(it.value(), 0); -- } -- -- return indexes; --} -- --int ImageModel::numberOfIndexesForImageInfo(const ImageInfo& info) const --{ -- return numberOfIndexesForImageId(info.id()); --} -- --int ImageModel::numberOfIndexesForImageId(qlonglong id) const --{ -- if (d->extraValues.isEmpty()) -- { -- return 0; -- } -- -- int count = 0; -- QHash::const_iterator it; -- -- for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -- { -- ++count; -- } -- -- return count; --} -- --// static method --ImageInfo ImageModel::retrieveImageInfo(const QModelIndex& index) --{ -- if (!index.isValid()) -- { -- return ImageInfo(); -- } -- -- ImageModel* const model = index.data(ImageModelPointerRole).value(); -- int row = index.data(ImageModelInternalId).toInt(); -- -- if (!model) -- { -- return ImageInfo(); -- } -- -- return model->imageInfo(row); --} -- --// static method --qlonglong ImageModel::retrieveImageId(const QModelIndex& index) --{ -- if (!index.isValid()) -- { -- return 0; -- } -- -- ImageModel* const model = index.data(ImageModelPointerRole).value(); -- int row = index.data(ImageModelInternalId).toInt(); -- -- if (!model) -- { -- return 0; -- } -- -- return model->imageId(row); --} -- --QModelIndex ImageModel::indexForPath(const QString& filePath) const --{ -- if (d->keepFilePathCache) -- { -- return indexForImageId(d->filePathHash.value(filePath)); -- } -- else -- { -- const int size = d->infos.size(); -- -- for (int i=0; iinfos.at(i).filePath() == filePath) -- { -- return createIndex(i, 0); -- } -- } -- } -- -- return QModelIndex(); --} -- --QList ImageModel::indexesForPath(const QString& filePath) const --{ -- if (d->keepFilePathCache) -- { -- return indexesForImageId(d->filePathHash.value(filePath)); -- } -- else -- { -- QList indexes; -- const int size = d->infos.size(); -- -- for (int i=0; iinfos.at(i).filePath() == filePath) -- { -- indexes << createIndex(i, 0); -- } -- } -- -- return indexes; -- } --} -- --ImageInfo ImageModel::imageInfo(const QString& filePath) const --{ -- if (d->keepFilePathCache) -- { -- qlonglong id = d->filePathHash.value(filePath); -- -- if (id) -- { -- int index = d->idHash.value(id, -1); -- -- if (index != -1) -- { -- return d->infos.at(index); -- } -- } -- } -- else -- { -- foreach(const ImageInfo& info, d->infos) -- { -- if (info.filePath() == filePath) -- { -- return info; -- } -- } -- } -- -- return ImageInfo(); --} -- --QList ImageModel::imageInfos(const QString& filePath) const --{ -- QList infos; -- -- if (d->keepFilePathCache) -- { -- qlonglong id = d->filePathHash.value(filePath); -- -- if (id) -- { -- foreach(int index, d->idHash.values(id)) -- { -- infos << d->infos.at(index); -- } -- } -- } -- else -- { -- foreach(const ImageInfo& info, d->infos) -- { -- if (info.filePath() == filePath) -- { -- infos << info; -- } -- } -- } -- -- return infos; --} -- --void ImageModel::addImageInfo(const ImageInfo& info) --{ -- addImageInfos(QList() << info, QList()); --} -- --void ImageModel::addImageInfos(const QList& infos) --{ -- addImageInfos(infos, QList()); --} -- --void ImageModel::addImageInfos(const QList& infos, const QList& extraValues) --{ -- if (infos.isEmpty()) -- { -- return; -- } -- -- if (d->incrementalUpdater) -- { -- d->incrementalUpdater->appendInfos(infos, extraValues); -- } -- else -- { -- appendInfos(infos, extraValues); -- } --} -- --void ImageModel::addImageInfoSynchronously(const ImageInfo& info) --{ -- addImageInfosSynchronously(QList() << info, QList()); --} -- --void ImageModel::addImageInfosSynchronously(const QList& infos) --{ -- addImageInfos(infos, QList()); --} -- --void ImageModel::addImageInfosSynchronously(const QList& infos, const QList& extraValues) --{ -- if (infos.isEmpty()) -- { -- return; -- } -- -- publiciseInfos(infos, extraValues); -- emit processAdded(infos, extraValues); --} -- --void ImageModel::ensureHasImageInfo(const ImageInfo& info) --{ -- ensureHasImageInfos(QList() << info, QList()); --} -- --void ImageModel::ensureHasImageInfos(const QList& infos) --{ -- ensureHasImageInfos(infos, QList()); --} -- --void ImageModel::ensureHasImageInfos(const QList& infos, const QList& extraValues) --{ -- if (extraValues.isEmpty()) -- { -- if (!d->pendingExtraValues.isEmpty()) -- { -- qCDebug(DIGIKAM_GENERAL_LOG) << "ExtraValue / No Extra Value mismatch. Ignoring added infos."; -- return; -- } -- } -- else -- { -- if (d->pendingInfos.size() != d->pendingExtraValues.size()) -- { -- qCDebug(DIGIKAM_GENERAL_LOG) << "ExtraValue / No Extra Value mismatch. Ignoring added infos."; -- return; -- } -- } -- -- d->pendingInfos << infos; -- d->pendingExtraValues << extraValues; -- cleanSituationChecks(); --} -- --void ImageModel::clearImageInfos() --{ -- d->infos.clear(); -- d->extraValues.clear(); -- d->idHash.clear(); -- d->filePathHash.clear(); -- delete d->incrementalUpdater; -- d->incrementalUpdater = 0; -- d->pendingInfos.clear(); -- d->pendingExtraValues.clear(); -- d->refreshing = false; -- d->reAdding = false; -- d->incrementalRefreshRequested = false; -- -- beginResetModel(); -- endResetModel(); -- -- imageInfosCleared(); --} -- --void ImageModel::setImageInfos(const QList& infos) --{ -- clearImageInfos(); -- addImageInfos(infos); --} -- --QList ImageModel::imageInfos() const --{ -- return d->infos; --} -- --QList ImageModel::imageIds() const --{ -- return d->idHash.keys(); --} -- --bool ImageModel::hasImage(qlonglong id) const --{ -- return d->idHash.contains(id); --} -- --bool ImageModel::hasImage(const ImageInfo& info) const --{ -- return d->idHash.contains(info.id()); --} -- --bool ImageModel::hasImage(const ImageInfo& info, const QVariant& extraValue) const --{ -- return hasImage(info.id(), extraValue); --} -- --bool ImageModel::hasImage(qlonglong id, const QVariant& extraValue) const --{ -- if (d->extraValues.isEmpty()) -- return hasImage(id); -- -- QHash::const_iterator it; -- -- for (it = d->idHash.constFind(id); it != d->idHash.constEnd() && it.key() == id; ++it) -- { -- if (d->extraValues.at(it.value()) == extraValue) -- return true; -- } -- -- return false;; --} -- --QList ImageModel::uniqueImageInfos() const --{ -- if (d->extraValues.isEmpty()) -- { -- return d->infos; -- } -- -- QList uniqueInfos; -- const int size = d->infos.size(); -- -- for (int i=0; iinfos.at(i); -- -- if (d->idHash.value(info.id()) == i) -- { -- uniqueInfos << info; -- } -- } -- -- return uniqueInfos; --} -- --void ImageModel::emitDataChangedForAll() --{ -- if (d->infos.isEmpty()) -- { -- return; -- } -- -- QModelIndex first = createIndex(0, 0); -- QModelIndex last = createIndex(d->infos.size() - 1, 0); -- emit dataChanged(first, last); --} -- --void ImageModel::emitDataChangedForSelection(const QItemSelection& selection) --{ -- if (!selection.isEmpty()) -- { -- foreach(const QItemSelectionRange& range, selection) -- { -- emit dataChanged(range.topLeft(), range.bottomRight()); -- } -- } --} -- --void ImageModel::ensureHasGroupedImages(const ImageInfo& groupLeader) --{ -- ensureHasImageInfos(groupLeader.groupedImages()); --} -- --// ------------ Preprocessing ------------- -- --void ImageModel::setPreprocessor(QObject* preprocessor) --{ -- unsetPreprocessor(d->preprocessor); -- d->preprocessor = preprocessor; --} -- --void ImageModel::unsetPreprocessor(QObject* preprocessor) --{ -- if (preprocessor && d->preprocessor == preprocessor) -- { -- disconnect(this, SIGNAL(preprocess(QList,QList)), 0, 0); -- disconnect(d->preprocessor, 0, this, SLOT(reAddImageInfos(QList,QList))); -- disconnect(d->preprocessor, 0, this, SLOT(reAddingFinished())); -- } --} -- --void ImageModel::appendInfos(const QList& infos, const QList& extraValues) --{ -- if (infos.isEmpty()) -- { -- return; -- } -- -- if (d->preprocessor) -- { -- d->reAdding = true; -- emit preprocess(infos, extraValues); -- } -- else -- { -- publiciseInfos(infos, extraValues); -- } --} -- --void ImageModel::appendInfosChecked(const QList& infos, const QList& extraValues) --{ -- // This method does deduplication. It is private because in context of readding or refreshing it is of no use. -- -- if (extraValues.isEmpty()) -- { -- QList checkedInfos; -- -- foreach (const ImageInfo& info, infos) -- { -- if (!hasImage(info)) -- { -- checkedInfos << info; -- } -- } -- -- appendInfos(checkedInfos, QList()); -- } -- else -- { -- QList checkedInfos; -- QList checkedExtraValues; -- const int size = infos.size(); -- -- for (int i=0; i& infos, const QList& extraValues) --{ -- // addImageInfos -> appendInfos -> preprocessor -> reAddImageInfos -- publiciseInfos(infos, extraValues); --} -- --void ImageModel::reAddingFinished() --{ -- d->reAdding = false; -- cleanSituationChecks(); --} -- --void ImageModel::startRefresh() --{ -- d->refreshing = true; --} -- --void ImageModel::finishRefresh() --{ -- d->refreshing = false; -- cleanSituationChecks(); --} -- --bool ImageModel::isRefreshing() const --{ -- return d->refreshing; --} -- --void ImageModel::cleanSituationChecks() --{ -- // For starting an incremental refresh we want a clear situation: -- // Any remaining batches from non-incremental refreshing subclasses have been received in appendInfos(), -- // any batches sent to preprocessor for re-adding have been re-added. -- if (d->refreshing || d->reAdding) -- { -- return; -- } -- -- if (!d->pendingInfos.isEmpty()) -- { -- appendInfosChecked(d->pendingInfos, d->pendingExtraValues); -- d->pendingInfos.clear(); -- d->pendingExtraValues.clear(); -- cleanSituationChecks(); -- return; -- } -- -- if (d->incrementalRefreshRequested) -- { -- d->incrementalRefreshRequested = false; -- emit readyForIncrementalRefresh(); -- } -- else -- { -- emit allRefreshingFinished(); -- } --} -- --void ImageModel::publiciseInfos(const QList& infos, const QList& extraValues) --{ -- if (infos.isEmpty()) -- { -- return; -- } -- -- Q_ASSERT(infos.size() == extraValues.size() || (extraValues.isEmpty() && d->extraValues.isEmpty())); -- -- emit imageInfosAboutToBeAdded(infos); -- const int firstNewIndex = d->infos.size(); -- const int lastNewIndex = d->infos.size() + infos.size() - 1; -- beginInsertRows(QModelIndex(), firstNewIndex, lastNewIndex); -- d->infos << infos; -- d->extraValues << extraValues; -- -- for (int i=firstNewIndex; i<=lastNewIndex; ++i) -- { -- const ImageInfo& info = d->infos.at(i); -- qlonglong id = info.id(); -- d->idHash.insertMulti(id, i); -- -- if (d->keepFilePathCache) -- { -- d->filePathHash[info.filePath()] = id; -- } -- } -- -- endInsertRows(); -- emit imageInfosAdded(infos); --} -- --void ImageModel::requestIncrementalRefresh() --{ -- if (d->reAdding) -- { -- d->incrementalRefreshRequested = true; -- } -- else -- { -- emit readyForIncrementalRefresh(); -- } --} -- --bool ImageModel::hasIncrementalRefreshPending() const --{ -- return d->incrementalRefreshRequested; --} -- --void ImageModel::startIncrementalRefresh() --{ -- delete d->incrementalUpdater; -- -- d->incrementalUpdater = new ImageModelIncrementalUpdater(d); --} -- --void ImageModel::finishIncrementalRefresh() --{ -- if (!d->incrementalUpdater) -- { -- return; -- } -- -- // remove old entries -- QList > pairs = d->incrementalUpdater->oldIndexes(); -- removeRowPairs(pairs); -- -- // add new indexes -- appendInfos(d->incrementalUpdater->newInfos, d->incrementalUpdater->newExtraValues); -- -- delete d->incrementalUpdater; -- d->incrementalUpdater = 0; --} -- --void ImageModel::removeIndex(const QModelIndex& index) --{ -- removeIndexes(QList() << index); --} -- --void ImageModel::removeIndexes(const QList& indexes) --{ -- QList listIndexes; -- -- foreach(const QModelIndex& index, indexes) -- { -- if (d->isValid(index)) -- { -- listIndexes << index.row(); -- } -- } -- -- if (listIndexes.isEmpty()) -- { -- return; -- } -- -- removeRowPairsWithCheck(ImageModelIncrementalUpdater::toContiguousPairs(listIndexes)); --} -- --void ImageModel::removeImageInfo(const ImageInfo& info) --{ -- removeImageInfos(QList() << info); --} -- --void ImageModel::removeImageInfos(const QList& infos) --{ -- QList listIndexes; -- -- foreach(const ImageInfo& info, infos) -- { -- QModelIndex index = indexForImageId(info.id()); -- -- if (index.isValid()) -- { -- listIndexes << index.row(); -- } -- } -- removeRowPairsWithCheck(ImageModelIncrementalUpdater::toContiguousPairs(listIndexes)); --} -- --void ImageModel::removeImageInfos(const QList& infos, const QList& extraValues) --{ -- if (extraValues.isEmpty()) -- { -- removeImageInfos(infos); -- return; -- } -- -- QList listIndexes; -- -- for (int i=0; isendRemovalSignals = send; --} -- --template --static bool pairsContain(const List& list, T value) --{ -- typename List::const_iterator middle; -- typename List::const_iterator begin = list.begin(); -- typename List::const_iterator end = list.end(); -- int n = int(end - begin); -- int half; -- -- while (n > 0) -- { -- half = n >> 1; -- middle = begin + half; -- -- if (middle->first <= value && middle->second >= value) -- { -- return true; -- } -- else if (middle->second < value) -- { -- begin = middle + 1; -- n -= half + 1; -- } -- else -- { -- n = half; -- } -- } -- -- return false; --} -- --void ImageModel::removeRowPairsWithCheck(const QList >& toRemove) --{ -- if (d->incrementalUpdater) -- { -- d->incrementalUpdater->aboutToBeRemovedInModel(toRemove); -- } -- -- removeRowPairs(toRemove); --} -- --void ImageModel::removeRowPairs(const QList >& toRemove) --{ -- if (toRemove.isEmpty()) -- { -- return; -- } -- -- // Remove old indexes -- // Keep in mind that when calling beginRemoveRows all structures announced to be removed -- // must still be valid, and this includes our hashes as well, which limits what we can optimize -- -- int removedRows = 0, offset = 0; -- typedef QPair IntPair; // to make foreach macro happy -- -- foreach(const IntPair& pair, toRemove) -- { -- const int begin = pair.first - offset; -- const int end = pair.second - offset; // inclusive -- removedRows = end - begin + 1; -- -- // when removing from the list, all subsequent indexes are affected -- offset += removedRows; -- -- QList removedInfos; -- -- if (d->sendRemovalSignals) -- { -- qCopy(d->infos.begin() + begin, d->infos.begin() + end, removedInfos.begin()); -- emit imageInfosAboutToBeRemoved(removedInfos); -- } -- -- imageInfosAboutToBeRemoved(begin, end); -- beginRemoveRows(QModelIndex(), begin, end); -- -- // update idHash - which points to indexes of d->infos, and these change now! -- QHash::iterator it; -- -- for (it = d->idHash.begin(); it != d->idHash.end(); ) -- { -- if (it.value() >= begin) -- { -- if (it.value() > end) -- { -- // after the removed interval: adjust index -- it.value() -= removedRows; -- } -- else -- { -- // in the removed interval -- it = d->idHash.erase(it); -- continue; -- } -- } -- -- ++it; -- } -- -- // remove from list -- d->infos.erase(d->infos.begin() + begin, d->infos.begin() + (end + 1)); -- -- if (!d->extraValues.isEmpty()) -- { -- d->extraValues.erase(d->extraValues.begin() + begin, d->extraValues.begin() + (end + 1)); -- } -- -- endRemoveRows(); -- -- if (d->sendRemovalSignals) -- { -- emit imageInfosRemoved(removedInfos); -- } -- } -- -- // tidy up: remove old indexes from file path hash now -- if (d->keepFilePathCache) -- { -- QHash::iterator it; -- -- for (it = d->filePathHash.begin(); it != d->filePathHash.end(); ) -- { -- if (pairsContain(toRemove, it.value())) -- { -- it = d->filePathHash.erase(it); -- } -- else -- { -- ++it; -- } -- } -- } --} -- --ImageModelIncrementalUpdater::ImageModelIncrementalUpdater(ImageModel::Private* d) --{ -- oldIds = d->idHash; -- oldExtraValues = d->extraValues; --} -- --void ImageModelIncrementalUpdater::appendInfos(const QList& infos, const QList& extraValues) --{ -- if (extraValues.isEmpty()) -- { -- foreach(const ImageInfo& info, infos) -- { -- QHash::iterator it = oldIds.find(info.id()); -- -- if (it != oldIds.end()) -- { -- oldIds.erase(it); -- } -- else -- { -- newInfos << info; -- } -- } -- } -- else -- { -- for (int i=0; i::iterator it; -- -- for (it = oldIds.find(info.id()); it != oldIds.end() && it.key() == info.id(); ++it) -- { -- // first check is for bug #262596. Not sure if needed. -- if (it.value() < oldExtraValues.size() && extraValues.at(i) == oldExtraValues.at(it.value())) -- { -- found = true; -- break; -- } -- } -- -- if (found) -- { -- oldIds.erase(it); -- // do not erase from oldExtraValues - oldIds is a hash id -> index. -- } -- else -- { -- newInfos << info; -- newExtraValues << extraValues.at(i); -- } -- } -- } --} -- --void ImageModelIncrementalUpdater::aboutToBeRemovedInModel(const IntPairList& toRemove) --{ -- modelRemovals << toRemove; --} -- --QList > ImageModelIncrementalUpdater::oldIndexes() --{ -- // first, apply all changes to indexes by direct removal in model -- // while the updater was active -- foreach(const IntPairList& list, modelRemovals) -- { -- int removedRows = 0, offset = 0; -- -- foreach(const IntPair& pair, list) -- { -- const int begin = pair.first - offset; -- const int end = pair.second - offset; // inclusive -- removedRows = end - begin + 1; -- -- // when removing from the list, all subsequent indexes are affected -- offset += removedRows; -- -- // update idHash - which points to indexes of d->infos, and these change now! -- QHash::iterator it; -- -- for (it = oldIds.begin(); it != oldIds.end(); ) -- { -- if (it.value() >= begin) -- { -- if (it.value() > end) -- { -- // after the removed interval: adjust index -- it.value() -= removedRows; -- } -- else -- { -- // in the removed interval -- it = oldIds.erase(it); -- continue; -- } -- } -- -- ++it; -- } -- } -- } -- -- modelRemovals.clear(); -- -- return toContiguousPairs(oldIds.values()); --} -- --QList > ImageModelIncrementalUpdater::toContiguousPairs(const QList& unsorted) --{ -- // Take the given indices and return them as contiguous pairs [begin, end] -- -- QList > pairs; -- -- if (unsorted.isEmpty()) -- { -- return pairs; -- } -- -- QList indices(unsorted); -- qSort(indices); -- -- QPair pair(indices.first(), indices.first()); -- -- for (int i=1; iisValid(index)) -- { -- return QVariant(); -- } -- -- switch (role) -- { -- case Qt::DisplayRole: -- case Qt::ToolTipRole: -- return d->infos.at(index.row()).name(); -- -- case ImageModelPointerRole: -- return QVariant::fromValue(const_cast(this)); -- -- case ImageModelInternalId: -- return index.row(); -- -- case CreationDateRole: -- return d->infos.at(index.row()).dateTime(); -- -- case ExtraDataRole: -- -- if (d->extraValueValid(index)) -- { -- return d->extraValues.at(index.row()); -- } -- else -- { -- return QVariant(); -- } -- -- case ExtraDataDuplicateCount: -- { -- qlonglong id = d->infos.at(index.row()).id(); -- return numberOfIndexesForImageId(id); -- } -- } -- -- return QVariant(); --} -- --QVariant ImageModel::headerData(int section, Qt::Orientation orientation, int role) const --{ -- Q_UNUSED(section) -- Q_UNUSED(orientation) -- Q_UNUSED(role) -- return QVariant(); --} -- --int ImageModel::rowCount(const QModelIndex& parent) const --{ -- if (parent.isValid()) -- { -- return 0; -- } -- -- return d->infos.size(); --} -- --Qt::ItemFlags ImageModel::flags(const QModelIndex& index) const --{ -- if (!d->isValid(index)) -- { -- return 0; -- } -- -- Qt::ItemFlags f = Qt::ItemIsSelectable | Qt::ItemIsEnabled; -- -- f |= dragDropFlags(index); -- -- return f; --} -- --QModelIndex ImageModel::index(int row, int column, const QModelIndex& parent) const --{ -- if (column != 0 || row < 0 || parent.isValid() || row >= d->infos.size()) -- { -- return QModelIndex(); -- } -- -- return createIndex(row, 0); --} -- --// ------------ Database watch ------------- -- --void ImageModel::slotImageChange(const ImageChangeset& changeset) --{ -- if (d->infos.isEmpty()) -- { -- return; -- } -- -- if (d->watchFlags & changeset.changes()) -- { -- QItemSelection items; -- -- foreach(const qlonglong& id, changeset.ids()) -- { -- QModelIndex index = indexForImageId(id); -- -- if (index.isValid()) -- { -- items.select(index, index); -- } -- } -- -- if (!items.isEmpty()) -- { -- emitDataChangedForSelection(items); -- emit imageChange(changeset, items); -- } -- } --} -- --void ImageModel::slotImageTagChange(const ImageTagChangeset& changeset) --{ -- if (d->infos.isEmpty()) -- { -- return; -- } -- -- QItemSelection items; -- -- foreach(const qlonglong& id, changeset.ids()) -- { -- QModelIndex index = indexForImageId(id); -- -- if (index.isValid()) -- { -- items.select(index, index); -- } -- } -- -- if (!items.isEmpty()) -- { -- emitDataChangedForSelection(items); -- emit imageTagChange(changeset, items); -- } --} -- --} // namespace Digikam -diff --git a/libs/models/imagemodel.h b/libs/models/imagemodel.h -deleted file mode 100644 -index dcf94c2..0000000 ---- a/libs/models/imagemodel.h -+++ /dev/null -@@ -1,364 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGEMODEL_H --#define IMAGEMODEL_H -- --// Qt includes -- --#include -- --// Local includes -- --#include "dragdropimplementations.h" --#include "imageinfo.h" --#include "digikam_export.h" -- --class QItemSelection; -- --namespace Digikam --{ -- --class ImageChangeset; --class ImageTagChangeset; -- --namespace DatabaseFields --{ --class Set; --} -- --class DIGIKAM_DATABASE_EXPORT ImageModel : public QAbstractListModel, public DragDropModelImplementation --{ -- Q_OBJECT -- --public: -- -- enum ImageModelRoles -- { -- /// An ImageModel* pointer to this model -- ImageModelPointerRole = Qt::UserRole, -- ImageModelInternalId = Qt::UserRole + 1, -- /// Returns a thumbnail pixmap. May be implemented by subclasses. -- /// Returns either a valid pixmap or a null QVariant. -- ThumbnailRole = Qt::UserRole + 2, -- /// Returns a QDateTime with the creation date -- CreationDateRole = Qt::UserRole + 3, -- /// Return (optional) extraData field -- ExtraDataRole = Qt::UserRole + 5, -- /// Returns the number of duplicate indexes for the same image id -- ExtraDataDuplicateCount = Qt::UserRole + 6, -- -- // Roles which are defined here but not implemented by ImageModel -- /// Returns position of item in Left Light Table preview. -- LTLeftPanelRole = Qt::UserRole + 50, -- /// Returns position of item in Right Light Table preview. -- LTRightPanelRole = Qt::UserRole + 51, -- -- // For use by subclasses -- SubclassRoles = Qt::UserRole + 100, -- // For use by filter models -- FilterModelRoles = Qt::UserRole + 500 -- }; -- --public: -- -- explicit ImageModel(QObject* parent = 0); -- ~ImageModel(); -- -- /** If a cache is kept, lookup by file path is fast, -- * without a cache it is O(n). Default is false. -- */ -- void setKeepsFilePathCache(bool keepCache); -- bool keepsFilePathCache() const; -- -- /** Set a set of database fields to watch. -- * If either of these is changed, dataChanged() will be emitted. -- * Default is no flag (no signal will be emitted). -- */ -- void setWatchFlags(const DatabaseFields::Set& set); -- -- /** Returns the ImageInfo object, reference or image id from the underlying data -- * pointed to by the index. -- * If the index is not valid, imageInfo will return a null ImageInfo, imageId will -- * return 0, imageInfoRef must not be called with an invalid index. -- */ -- ImageInfo imageInfo(const QModelIndex& index) const; -- ImageInfo& imageInfoRef(const QModelIndex& index) const; -- qlonglong imageId(const QModelIndex& index) const; -- QList imageInfos(const QList& indexes) const; -- QList imageIds(const QList& indexes) const; -- -- /** Returns the ImageInfo object, reference or image id from the underlying data -- * of the given row (parent is the invalid QModelIndex, column is 0). -- * Note that imageInfoRef will crash if index is invalid. -- */ -- ImageInfo imageInfo(int row) const; -- ImageInfo& imageInfoRef(int row) const; -- qlonglong imageId(int row) const; -- -- /** Return the index for the given ImageInfo or id, if contained in this model. -- */ -- QModelIndex indexForImageInfo(const ImageInfo& info) const; -- QModelIndex indexForImageInfo(const ImageInfo& info, const QVariant& extraValue) const; -- QModelIndex indexForImageId(qlonglong id) const; -- QModelIndex indexForImageId(qlonglong id, const QVariant& extraValue) const; -- QList indexesForImageInfo(const ImageInfo& info) const; -- QList indexesForImageId(qlonglong id) const; -- -- int numberOfIndexesForImageInfo(const ImageInfo& info) const; -- int numberOfIndexesForImageId(qlonglong id) const; -- -- /** Returns the index or ImageInfo object from the underlying data -- * for the given file path. This is fast if keepsFilePathCache is enabled. -- * The file path is as returned by ImageInfo.filePath(). -- * In case of multiple occurrences of the same file, the simpler variants return -- * any one found first, use the QList methods to retrieve all occurrences. -- */ -- QModelIndex indexForPath(const QString& filePath) const; -- ImageInfo imageInfo(const QString& filePath) const; -- QList indexesForPath(const QString& filePath) const; -- QList imageInfos(const QString& filePath) const; -- -- /** Main entry point for subclasses adding image infos to the model. -- * If you list entries not unique per image id, you must add an extraValue -- * so that every entry is unique by imageId and extraValues. -- * Please note that these methods do not prevent addition of duplicate entries. -- */ -- void addImageInfo(const ImageInfo& info); -- void addImageInfos(const QList& infos); -- void addImageInfos(const QList& infos, const QList& extraValues); -- -- /** Clears image infos and resets model. -- */ -- void clearImageInfos(); -- -- /** Clears and adds the infos. -- */ -- void setImageInfos(const QList& infos); -- -- /** -- * Directly remove the given indexes or infos from the model. -- */ -- void removeIndex(const QModelIndex& indexes); -- void removeIndexes(const QList& indexes); -- void removeImageInfo(const ImageInfo& info); -- void removeImageInfos(const QList& infos); -- void removeImageInfos(const QList& infos, const QList& extraValues); -- -- /** -- * addImageInfo() is asynchronous if a prepocessor is set. -- * This method first adds the info, synchronously. -- * Only afterwards, the preprocessor will have the opportunity to process it. -- * This method also bypasses any incremental updates. -- * Please note that these methods do not prevent addition of duplicate entries. -- */ -- void addImageInfoSynchronously(const ImageInfo& info); -- void addImageInfosSynchronously(const QList& infos); -- void addImageInfosSynchronously(const QList& infos, const QList& extraValues); -- -- /** -- * Add the given entries. Method returns immediately, the -- * addition may happen later asynchronously. -- * These methods prevent the addition of duplicate entries. -- */ -- void ensureHasImageInfo(const ImageInfo& info); -- void ensureHasImageInfos(const QList& infos); -- void ensureHasImageInfos(const QList& infos, const QList& extraValues); -- -- /** -- * Ensure that all images grouped on the given leader are contained in the model. -- */ -- void ensureHasGroupedImages(const ImageInfo& groupLeader); -- -- QList imageInfos() const; -- QList imageIds() const; -- QList uniqueImageInfos() const; -- -- bool hasImage(qlonglong id) const; -- bool hasImage(const ImageInfo& info) const; -- bool hasImage(const ImageInfo& info, const QVariant& extraValue) const; -- bool hasImage(qlonglong id, const QVariant& extraValue) const; -- -- bool isEmpty() const; -- -- // Drag and Drop -- DECLARE_MODEL_DRAG_DROP_METHODS -- -- /** -- * Install an object as a preprocessor for ImageInfos added to this model. -- * For every QList of ImageInfos added to addImageInfo, the signal preprocess() -- * will be emitted. The preprocessor may process the items and shall then readd -- * them by calling reAddImageInfos(). It may take some time to process. -- * It shall discard any held infos when the modelReset() signal is sent. -- * It shall call readdFinished() when no reset occurred and all infos on the way have been readded. -- * This means that only after calling this method, you shall make three connections -- * (preprocess -> your slot, your signal -> reAddImageInfos, your signal -> reAddingFinished) -- * and make or already hold a connection modelReset() -> your slot. -- * There is only one preprocessor at a time, a previously set object will be disconnected. -- */ -- void setPreprocessor(QObject* processor); -- void unsetPreprocessor(QObject* processor); -- -- /** -- * Returns true if this model is currently refreshing. -- * For a preprocessor this means that, although the preprocessor may currently have -- * processed all it got, more batches are to be expected. -- */ -- bool isRefreshing() const; -- -- /** -- * Enable sending of imageInfosAboutToBeRemoved and imageInfosRemoved signals. -- * Default: false -- */ -- void setSendRemovalSignals(bool send); -- -- virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -- virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; -- virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; -- virtual Qt::ItemFlags flags(const QModelIndex& index) const; -- virtual QModelIndex index(int row, int column = 0, const QModelIndex& parent = QModelIndex()) const; -- -- /** Retrieves the imageInfo object from the data() method of the given index. -- * The index may be from a QSortFilterProxyModel as long as an ImageModel is at the end. */ -- static ImageInfo retrieveImageInfo(const QModelIndex& index); -- static qlonglong retrieveImageId(const QModelIndex& index); -- --Q_SIGNALS: -- -- /** Informs that ImageInfos will be added to the model. -- * This signal is sent before the model data is changed and views are informed. -- */ -- void imageInfosAboutToBeAdded(const QList& infos); -- -- /** Informs that ImageInfos have been added to the model. -- * This signal is sent after the model data is changed and views are informed. -- */ -- void imageInfosAdded(const QList& infos); -- -- /** Informs that ImageInfos will be removed from the model. -- * This signal is sent before the model data is changed and views are informed. -- * Note: You need to explicitly enable sending of this signal. It is not sent -- * in clearImageInfos(). -- */ -- void imageInfosAboutToBeRemoved(const QList& infos); -- -- /** Informs that ImageInfos have been removed from the model. -- * This signal is sent after the model data is changed and views are informed. * -- * Note: You need to explicitly enable sending of this signal. It is not sent -- * in clearImageInfos(). -- */ -- void imageInfosRemoved(const QList& infos); -- -- /** Connect to this signal only if you are the current preprocessor. -- */ -- void preprocess(const QList& infos, const QList&); -- void processAdded(const QList& infos, const QList&); -- -- /** If an ImageChangeset affected indexes of this model with changes as set in watchFlags(), -- * this signal contains the changeset and the affected indexes. -- */ -- void imageChange(const ImageChangeset&, const QItemSelection&); -- -- /** If an ImageTagChangeset affected indexes of this model, -- * this signal contains the changeset and the affected indexes. -- */ -- void imageTagChange(const ImageTagChangeset&, const QItemSelection&); -- -- /** Signals that the model is right now ready to start an incremental refresh. -- * This is guaranteed only for the scope of emitting this signal. -- */ -- void readyForIncrementalRefresh(); -- -- /** Signals that the model has finished currently with all scheduled -- * refreshing, full or incremental, and all preprocessing. -- * The model is in polished, clean situation right now. -- */ -- void allRefreshingFinished(); -- --public Q_SLOTS: -- -- void reAddImageInfos(const QList& infos, const QList& extraValues); -- void reAddingFinished(); -- --protected: -- -- /** Subclasses that add ImageInfos in batches shall call startRefresh() -- * when they start sending batches and finishRefresh() when they have finished. -- * No incremental refreshes will be started while listing. -- * A clearImageInfos() always stops listing, calling finishRefresh() is then not necessary. -- */ -- void startRefresh(); -- void finishRefresh(); -- -- /** As soon as the model is ready to start an incremental refresh, the signal -- * readyForIncrementalRefresh() will be emitted. The signal will be emitted inline -- * if the model is ready right now. -- */ -- void requestIncrementalRefresh(); -- bool hasIncrementalRefreshPending() const; -- -- /** Starts an incremental refresh operation. You shall only call this method from a slot -- * connected to readyForIncrementalRefresh(). To initiate an incremental refresh, -- * call requestIncrementalRefresh(). -- */ -- void startIncrementalRefresh(); -- void finishIncrementalRefresh(); -- -- void emitDataChangedForAll(); -- void emitDataChangedForSelection(const QItemSelection& selection); -- -- // Called when the internal storage is cleared -- virtual void imageInfosCleared() {}; -- -- // Called before rowsAboutToBeRemoved -- virtual void imageInfosAboutToBeRemoved(int /*begin*/, int /*end*/) {}; -- --protected Q_SLOTS: -- -- virtual void slotImageChange(const ImageChangeset& changeset); -- virtual void slotImageTagChange(const ImageTagChangeset& changeset); -- --private: -- -- void appendInfos(const QList& infos, const QList& extraValues); -- void appendInfosChecked(const QList& infos, const QList& extraValues); -- void publiciseInfos(const QList& infos, const QList& extraValues); -- void cleanSituationChecks(); -- void removeRowPairsWithCheck(const QList >& toRemove); -- void removeRowPairs(const QList >& toRemove); -- --public: -- -- // Declared public because it's used in ImageModelIncrementalUpdater class -- class Private; -- --private: -- -- Private* const d; --}; -- --} // namespace Digikam -- --Q_DECLARE_METATYPE(Digikam::ImageModel*) -- --#endif // IMAGEMODEL_H -diff --git a/libs/models/imagesortsettings.cpp b/libs/models/imagesortsettings.cpp -deleted file mode 100644 -index 39ee6e1..0000000 ---- a/libs/models/imagesortsettings.cpp -+++ /dev/null -@@ -1,400 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Filter values for use with ImageFilterModel -- * -- * Copyright (C) 2009 by Marcel Wiesweg -- * Copyright (C) 2014 by Mohamed Anwer -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagesortsettings.h" -- --// Qt includes -- --#include --#include -- --// Local includes -- --#include "coredbfields.h" --#include "imageinfo.h" -- --namespace Digikam --{ -- --ImageSortSettings::ImageSortSettings() --{ -- categorizationMode = NoCategories; -- categorizationSortOrder = DefaultOrder; -- categorizationCaseSensitivity = Qt::CaseSensitive; -- sortRole = SortByFileName; -- sortOrder = DefaultOrder; -- strTypeNatural = true; -- sortCaseSensitivity = Qt::CaseSensitive; -- currentCategorizationSortOrder = Qt::AscendingOrder; -- currentSortOrder = Qt::AscendingOrder; --} -- --bool ImageSortSettings::operator==(const ImageSortSettings& other) const --{ -- return -- categorizationMode == other.categorizationMode && -- categorizationSortOrder == other.categorizationSortOrder && -- categorizationCaseSensitivity == other.categorizationCaseSensitivity && -- sortRole == other.sortRole && -- sortOrder == other.sortOrder && -- sortCaseSensitivity == other.sortCaseSensitivity; --} -- --void ImageSortSettings::setCategorizationMode(CategorizationMode mode) --{ -- categorizationMode = mode; -- -- if (categorizationSortOrder == DefaultOrder) -- { -- currentCategorizationSortOrder = defaultSortOrderForCategorizationMode(categorizationMode); -- } --} -- --void ImageSortSettings::setCategorizationSortOrder(SortOrder order) --{ -- categorizationSortOrder = order; -- -- if (categorizationSortOrder == DefaultOrder) -- { -- currentCategorizationSortOrder = defaultSortOrderForCategorizationMode(categorizationMode); -- } -- else -- { -- currentCategorizationSortOrder = (Qt::SortOrder)categorizationSortOrder; -- } --} -- --void ImageSortSettings::setSortRole(SortRole role) --{ -- sortRole = role; -- -- if (sortOrder == DefaultOrder) -- { -- currentSortOrder = defaultSortOrderForSortRole(sortRole); -- } --} -- --void ImageSortSettings::setSortOrder(SortOrder order) --{ -- sortOrder = order; -- -- if (sortOrder == DefaultOrder) -- { -- currentSortOrder = defaultSortOrderForSortRole(sortRole); -- } -- else -- { -- currentSortOrder = (Qt::SortOrder)order; -- } --} -- --void ImageSortSettings::setStringTypeNatural(bool natural) --{ -- strTypeNatural = natural; --} -- --Qt::SortOrder ImageSortSettings::defaultSortOrderForCategorizationMode(CategorizationMode mode) --{ -- switch (mode) -- { -- case NoCategories: -- case OneCategory: -- case CategoryByAlbum: -- case CategoryByFormat: -- default: -- return Qt::AscendingOrder; -- } --} -- --Qt::SortOrder ImageSortSettings::defaultSortOrderForSortRole(SortRole role) --{ -- switch (role) -- { -- case SortByFileName: -- case SortByFilePath: -- return Qt::AscendingOrder; -- case SortByFileSize: -- return Qt::DescendingOrder; -- case SortByModificationDate: -- case SortByCreationDate: -- return Qt::AscendingOrder; -- case SortByRating: -- case SortByImageSize: -- return Qt::DescendingOrder; -- case SortByAspectRatio: -- return Qt::DescendingOrder; -- case SortBySimilarity: -- return Qt::DescendingOrder; -- default: -- return Qt::AscendingOrder; -- } --} -- --int ImageSortSettings::compareCategories(const ImageInfo& left, const ImageInfo& right) const --{ -- switch (categorizationMode) -- { -- case NoCategories: -- case OneCategory: -- return 0; -- case CategoryByAlbum: -- { -- int leftAlbum = left.albumId(); -- int rightAlbum = right.albumId(); -- -- // return comparation result -- if (leftAlbum == rightAlbum) -- { -- return 0; -- } -- else if (lessThanByOrder(leftAlbum, rightAlbum, currentCategorizationSortOrder)) -- { -- return -1; -- } -- else -- { -- return 1; -- } -- } -- case CategoryByFormat: -- { -- return naturalCompare(left.format(), right.format(), -- currentCategorizationSortOrder, categorizationCaseSensitivity, strTypeNatural); -- } -- default: -- return 0; -- } --} -- --bool ImageSortSettings::lessThan(const ImageInfo& left, const ImageInfo& right) const --{ -- int result = compare(left, right, sortRole); -- -- if (result != 0) -- { -- return result < 0; -- } -- -- // are they identical? -- if (left == right) -- { -- return false; -- } -- -- // If left and right equal for first sort order, use a hierarchy of all sort orders -- if ( (result = compare(left, right, SortByFileName)) != 0) -- { -- return result < 0; -- } -- -- if ( (result = compare(left, right, SortByCreationDate)) != 0) -- { -- return result < 0; -- } -- -- if ( (result = compare(left, right, SortByModificationDate)) != 0) -- { -- return result < 0; -- } -- -- if ( (result = compare(left, right, SortByFilePath)) != 0) -- { -- return result < 0; -- } -- -- if ( (result = compare(left, right, SortByFileSize)) != 0) -- { -- return result < 0; -- } -- -- if ( (result = compare(left, right, SortBySimilarity)) != 0) -- { -- return result < 0; -- } -- -- return false; --} -- --int ImageSortSettings::compare(const ImageInfo& left, const ImageInfo& right) const --{ -- return compare(left, right, sortRole); --} -- --int ImageSortSettings::compare(const ImageInfo& left, const ImageInfo& right, SortRole role) const --{ -- switch (role) -- { -- case SortByFileName: -- { -- bool versioning = (left.name().contains(QLatin1String("_v"), Qt::CaseInsensitive) || -- right.name().contains(QLatin1String("_v"), Qt::CaseInsensitive)); -- return naturalCompare(left.name(), right.name(), currentSortOrder, sortCaseSensitivity, strTypeNatural, versioning); -- } -- case SortByFilePath: -- return naturalCompare(left.filePath(), right.filePath(), currentSortOrder, sortCaseSensitivity, strTypeNatural); -- case SortByFileSize: -- return compareByOrder(left.fileSize(), right.fileSize(), currentSortOrder); -- case SortByModificationDate: -- return compareByOrder(left.modDateTime(), right.modDateTime(), currentSortOrder); -- case SortByCreationDate: -- return compareByOrder(left.dateTime(), right.dateTime(), currentSortOrder); -- case SortByRating: -- // I have the feeling that inverting the sort order for rating is the natural order -- return - compareByOrder(left.rating(), right.rating(), currentSortOrder); -- case SortByImageSize: -- { -- QSize leftSize = left.dimensions(); -- QSize rightSize = right.dimensions(); -- int leftPixels = leftSize.width() * leftSize.height(); -- int rightPixels = rightSize.width() * rightSize.height(); -- return compareByOrder(leftPixels, rightPixels, currentSortOrder); -- } -- case SortByAspectRatio: -- { -- QSize leftSize = left.dimensions(); -- QSize rightSize = right.dimensions(); -- int leftAR = (double(leftSize.width()) / double(leftSize.height())) * 1000000; -- int rightAR = (double(rightSize.width()) / double(rightSize.height())) * 1000000; -- return compareByOrder(leftAR, rightAR, currentSortOrder); -- } -- case SortBySimilarity: -- { -- qlonglong leftReferenceImageId = left.currentReferenceImage(); -- qlonglong rightReferenceImageId = right.currentReferenceImage(); -- // make sure that the original image has always the highest similarity. -- double leftSimilarity = left.id() == leftReferenceImageId ? 1.1 : left.currentSimilarity(); -- double rightSimilarity = right.id() == rightReferenceImageId ? 1.1 : right.currentSimilarity(); -- return compareByOrder(leftSimilarity, rightSimilarity, currentSortOrder); -- } -- default: -- return 1; -- } --} -- --bool ImageSortSettings::lessThan(const QVariant& left, const QVariant& right) const --{ -- if (left.type() != right.type()) -- { -- return false; -- } -- -- switch (left.type()) -- { -- case QVariant::Int: -- return compareByOrder(left.toInt(), right.toInt(), currentSortOrder); -- case QVariant::UInt: -- return compareByOrder(left.toUInt(), right.toUInt(), currentSortOrder); -- case QVariant::LongLong: -- return compareByOrder(left.toLongLong(), right.toLongLong(), currentSortOrder); -- case QVariant::ULongLong: -- return compareByOrder(left.toULongLong(), right.toULongLong(), currentSortOrder); -- case QVariant::Double: -- return compareByOrder(left.toDouble(), right.toDouble(), currentSortOrder); -- case QVariant::Date: -- return compareByOrder(left.toDate(), right.toDate(), currentSortOrder); -- case QVariant::DateTime: -- return compareByOrder(left.toDateTime(), right.toDateTime(), currentSortOrder); -- case QVariant::Time: -- return compareByOrder(left.toTime(), right.toTime(), currentSortOrder); -- case QVariant::Rect: -- case QVariant::RectF: -- { -- QRectF rectLeft = left.toRectF(); -- QRectF rectRight = right.toRectF(); -- int result; -- -- if ((result = compareByOrder(rectLeft.top(), rectRight.top(), currentSortOrder)) != 0) -- { -- return result < 0; -- } -- -- if ((result = compareByOrder(rectLeft.left(), rectRight.left(), currentSortOrder)) != 0) -- { -- return result < 0; -- } -- -- QSizeF sizeLeft = rectLeft.size(), sizeRight = rectRight.size(); -- -- if ((result = compareByOrder(sizeLeft.width()*sizeLeft.height(), sizeRight.width()*sizeRight.height(), currentSortOrder)) != 0) -- { -- return result < 0; -- } -- // FIXME: fall through?? If not, add "break" here -- } -- default: -- return naturalCompare(left.toString(), right.toString(), currentSortOrder, sortCaseSensitivity, strTypeNatural); -- } --} -- --DatabaseFields::Set ImageSortSettings::watchFlags() const --{ -- DatabaseFields::Set set; -- -- switch (sortRole) -- { -- case SortByFileName: -- set |= DatabaseFields::Name; -- break; -- case SortByFilePath: -- set |= DatabaseFields::Name; -- break; -- case SortByFileSize: -- set |= DatabaseFields::FileSize; -- break; -- case SortByModificationDate: -- set |= DatabaseFields::ModificationDate; -- break; -- case SortByCreationDate: -- set |= DatabaseFields::CreationDate; -- break; -- case SortByRating: -- set |= DatabaseFields::Rating; -- break; -- case SortByImageSize: -- set |= DatabaseFields::Width | DatabaseFields::Height; -- break; -- case SortByAspectRatio: -- set |= DatabaseFields::Width | DatabaseFields::Height; -- break; -- case SortBySimilarity: -- // TODO: Not sure what to do here.... -- set |= DatabaseFields::Name; -- break; -- } -- -- switch (categorizationMode) -- { -- case NoCategories: -- case OneCategory: -- case CategoryByAlbum: -- break; -- case CategoryByFormat: -- set |= DatabaseFields::Format; -- break; -- } -- -- return set; --} -- --} // namespace Digikam -diff --git a/libs/models/imagesortsettings.h b/libs/models/imagesortsettings.h -deleted file mode 100644 -index 2a5fd8c..0000000 ---- a/libs/models/imagesortsettings.h -+++ /dev/null -@@ -1,225 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-05-31 -- * Description : Sort settings for use with ImageFilterModel -- * -- * Copyright (C) 2009 by Marcel Wiesweg -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGESORTSETTINGS_H --#define IMAGESORTSETTINGS_H -- --// Qt includes -- --#include --#include --#include --#include --#include -- --// Local includes -- --#include "digikam_export.h" -- --namespace Digikam --{ -- --class ImageInfo; -- --namespace DatabaseFields --{ -- class Set; --} -- --class DIGIKAM_DATABASE_EXPORT ImageSortSettings --{ --public: -- -- ImageSortSettings(); -- -- bool operator==(const ImageSortSettings& other) const; -- -- /** Compares the categories of left and right. -- * Return -1 if left is less than right, 0 if both fall in the same category, -- * and 1 if left is greater than right. -- * Adheres to set categorization mode and current category sort order. -- */ -- int compareCategories(const ImageInfo& left, const ImageInfo& right) const; -- -- /** Returns true if left is less than right. -- * Adheres to current sort role and sort order. -- */ -- bool lessThan(const ImageInfo& left, const ImageInfo& right) const; -- -- /** Compares the ImageInfos left and right. -- * Return -1 if left is less than right, 1 if left is greater than right, -- * and 0 if left equals right comparing the current sort role's value. -- * Adheres to set sort role and sort order. -- */ -- int compare(const ImageInfo& left, const ImageInfo& right) const; -- -- /** Returns true if left QVariant is less than right. -- * Adheres to current sort role and sort order. -- * Use for extraValue, if necessary. -- */ -- bool lessThan(const QVariant& left, const QVariant& right) const; -- -- enum SortOrder -- { -- AscendingOrder = Qt::AscendingOrder, -- DescendingOrder = Qt::DescendingOrder, -- DefaultOrder /// sort order depends on the chosen sort role -- }; -- -- /// --- Categories --- -- -- enum CategorizationMode -- { -- NoCategories, /// categorization switched off -- OneCategory, /// all items in one global category -- CategoryByAlbum, -- CategoryByFormat -- }; -- -- CategorizationMode categorizationMode; -- SortOrder categorizationSortOrder; -- -- void setCategorizationMode(CategorizationMode mode); -- void setCategorizationSortOrder(SortOrder order); -- -- /// Only Ascending or Descending, never DefaultOrder -- Qt::SortOrder currentCategorizationSortOrder; -- Qt::CaseSensitivity categorizationCaseSensitivity; -- -- bool isCategorized() const { return categorizationMode >= CategoryByAlbum; } -- -- /// --- Image Sorting --- -- -- enum SortRole -- { -- // Note: For legacy reasons, the order of the first five entries must remain unchanged -- SortByFileName, -- SortByFilePath, -- SortByCreationDate, -- SortByFileSize, -- SortByRating, -- SortByModificationDate, -- SortByImageSize, // pixel number -- SortByAspectRatio, // width / height * 100000 -- SortBySimilarity -- }; -- -- SortRole sortRole; -- SortOrder sortOrder; -- bool strTypeNatural; -- -- void setSortRole(SortRole role); -- void setSortOrder(SortOrder order); -- void setStringTypeNatural(bool natural); -- -- Qt::SortOrder currentSortOrder; -- Qt::CaseSensitivity sortCaseSensitivity; -- -- int compare(const ImageInfo& left, const ImageInfo& right, SortRole sortRole) const; -- -- // --- --- -- -- static Qt::SortOrder defaultSortOrderForCategorizationMode(CategorizationMode mode); -- static Qt::SortOrder defaultSortOrderForSortRole(SortRole role); -- -- /// --- Change notification --- -- -- /** Returns database fields a change in which would affect the current sorting. -- */ -- DatabaseFields::Set watchFlags() const; -- -- /// --- Utilities --- -- -- /** Returns a < b if sortOrder is Ascending, or b < a if order is descending. -- */ -- template -- static inline bool lessThanByOrder(const T& a, const T& b, Qt::SortOrder sortOrder) -- { -- if (sortOrder == Qt::AscendingOrder) -- { -- return a < b; -- } -- else -- { -- return b < a; -- } -- } -- -- /** Returns the usual compare result of -1, 0, or 1 for lessThan, equals and greaterThan. -- */ -- template -- static inline int compareValue(const T& a, const T& b) -- { -- if (a == b) -- { -- return 0; -- } -- -- if (a < b) -- { -- return -1; -- } -- else -- { -- return 1; -- } -- } -- -- /** Takes a typical result from a compare method (0 is equal, -1 is less than, 1 is greater than) -- * and applies the given sort order to it. -- */ -- static inline int compareByOrder(int compareResult, Qt::SortOrder sortOrder) -- { -- if (sortOrder == Qt::AscendingOrder) -- { -- return compareResult; -- } -- else -- { -- return - compareResult; -- } -- } -- -- template -- static inline int compareByOrder(const T& a, const T& b, Qt::SortOrder sortOrder) -- { -- return compareByOrder(compareValue(a, b), sortOrder); -- } -- -- /** Compares the two string by natural comparison and adheres to given sort order -- */ -- static inline int naturalCompare(const QString& a, const QString& b, Qt::SortOrder sortOrder, -- Qt::CaseSensitivity caseSensitive = Qt::CaseSensitive, -- bool natural = true, bool versioning = false) -- { -- QCollator collator; -- collator.setNumericMode(natural); -- collator.setIgnorePunctuation(versioning); -- collator.setCaseSensitivity(caseSensitive); -- return (compareByOrder(collator.compare(a, b), sortOrder)); -- } --}; -- --} // namespace Digikam -- --#endif // IMAGESORTSETTINGS_H -diff --git a/libs/models/imagethumbnailmodel.cpp b/libs/models/imagethumbnailmodel.cpp -deleted file mode 100644 -index b7f5661..0000000 ---- a/libs/models/imagethumbnailmodel.cpp -+++ /dev/null -@@ -1,323 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries with support for thumbnail loading -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011-2017 by Gilles Caulier -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imagethumbnailmodel.h" -- --// Qt includes -- --#include -- --// Local includes -- --#include "digikam_debug.h" --#include "thumbnailloadthread.h" --#include "digikam_export.h" --#include "digikam_globals.h" -- --namespace Digikam --{ -- --class ImageThumbnailModel::ImageThumbnailModelPriv --{ --public: -- -- ImageThumbnailModelPriv() : -- thread(0), -- preloadThread(0), -- thumbSize(0), -- lastGlobalThumbSize(0), -- preloadThumbSize(0), -- emitDataChanged(true) -- { -- staticListContainingThumbnailRole << ImageModel::ThumbnailRole; -- } -- -- ThumbnailLoadThread* thread; -- ThumbnailLoadThread* preloadThread; -- ThumbnailSize thumbSize; -- ThumbnailSize lastGlobalThumbSize; -- ThumbnailSize preloadThumbSize; -- QRect detailRect; -- QVector staticListContainingThumbnailRole; -- -- bool emitDataChanged; -- -- int preloadThumbnailSize() const -- { -- if (preloadThumbSize.size()) -- { -- return preloadThumbSize.size(); -- } -- -- return thumbSize.size(); -- } --}; -- --ImageThumbnailModel::ImageThumbnailModel(QObject* parent) -- : ImageModel(parent), d(new ImageThumbnailModelPriv) --{ -- setKeepsFilePathCache(true); --} -- --ImageThumbnailModel::~ImageThumbnailModel() --{ -- delete d->preloadThread; -- delete d; --} -- --void ImageThumbnailModel::setThumbnailLoadThread(ThumbnailLoadThread* thread) --{ -- d->thread = thread; -- -- connect(d->thread, SIGNAL(signalThumbnailLoaded(LoadingDescription,QPixmap)), -- this, SLOT(slotThumbnailLoaded(LoadingDescription,QPixmap))); --} -- --ThumbnailLoadThread* ImageThumbnailModel::thumbnailLoadThread() const --{ -- return d->thread; --} -- --ThumbnailSize ImageThumbnailModel::thumbnailSize() const --{ -- return d->thumbSize; --} -- --void ImageThumbnailModel::setThumbnailSize(const ThumbnailSize& size) --{ -- d->lastGlobalThumbSize = size; -- d->thumbSize = size; --} -- --void ImageThumbnailModel::setPreloadThumbnailSize(const ThumbnailSize& size) --{ -- d->preloadThumbSize = size; --} -- --void ImageThumbnailModel::setEmitDataChanged(bool emitSignal) --{ -- d->emitDataChanged = emitSignal; --} -- --void ImageThumbnailModel::setPreloadThumbnails(bool preload) --{ -- if (preload) -- { -- if (!d->preloadThread) -- { -- d->preloadThread = new ThumbnailLoadThread; -- d->preloadThread->setPixmapRequested(false); -- d->preloadThread->setPriority(QThread::LowestPriority); -- } -- -- connect(this, SIGNAL(allRefreshingFinished()), -- this, SLOT(preloadAllThumbnails())); -- } -- else -- { -- delete d->preloadThread; -- d->preloadThread = 0; -- disconnect(this, SIGNAL(allRefreshingFinished()), -- this, SLOT(preloadAllThumbnails())); -- } --} -- --void ImageThumbnailModel::prepareThumbnails(const QList& indexesToPrepare) --{ -- prepareThumbnails(indexesToPrepare, d->thumbSize); --} -- --void ImageThumbnailModel::prepareThumbnails(const QList& indexesToPrepare, const ThumbnailSize& thumbSize) --{ -- if (!d->thread) -- { -- return; -- } -- -- QList ids; -- foreach(const QModelIndex& index, indexesToPrepare) -- { -- ids << imageInfoRef(index).thumbnailIdentifier(); -- } -- d->thread->findGroup(ids, thumbSize.size()); --} -- --void ImageThumbnailModel::preloadThumbnails(const QList& infos) --{ -- if (!d->preloadThread) -- { -- return; -- } -- -- QList ids; -- foreach(const ImageInfo& info, infos) -- { -- ids << info.thumbnailIdentifier(); -- } -- d->preloadThread->pregenerateGroup(ids, d->preloadThumbnailSize()); --} -- --void ImageThumbnailModel::preloadThumbnails(const QList& indexesToPreload) --{ -- if (!d->preloadThread) -- { -- return; -- } -- -- QList ids; -- foreach(const QModelIndex& index, indexesToPreload) -- { -- ids << imageInfoRef(index).thumbnailIdentifier(); -- } -- d->preloadThread->stopAllTasks(); -- d->preloadThread->pregenerateGroup(ids, d->preloadThumbnailSize()); --} -- --void ImageThumbnailModel::preloadAllThumbnails() --{ -- preloadThumbnails(imageInfos()); --} -- --void ImageThumbnailModel::imageInfosCleared() --{ -- if (d->preloadThread) -- { -- d->preloadThread->stopAllTasks(); -- } --} -- --QVariant ImageThumbnailModel::data(const QModelIndex& index, int role) const --{ -- if (role == ThumbnailRole && d->thread && index.isValid()) -- { -- QPixmap thumbnail; -- ImageInfo info = imageInfo(index); -- QString path = info.filePath(); -- -- if (info.isNull()) -- { -- return QVariant(QVariant::Pixmap); -- } -- -- if (!d->detailRect.isNull()) -- { -- if (d->thread->find(info.thumbnailIdentifier(), d->detailRect, thumbnail, d->thumbSize.size())) -- { -- return thumbnail; -- } -- } -- else -- { -- if (d->thread->find(info.thumbnailIdentifier(), thumbnail, d->thumbSize.size())) -- { -- return thumbnail; -- } -- } -- -- return QVariant(QVariant::Pixmap); -- } -- -- return ImageModel::data(index, role); --} -- --bool ImageThumbnailModel::setData(const QModelIndex& index, const QVariant& value, int role) --{ -- if (role == ThumbnailRole) -- { -- switch (value.type()) -- { -- case QVariant::Invalid: -- d->thumbSize = d->lastGlobalThumbSize; -- d->detailRect = QRect(); -- break; -- -- case QVariant::Int: -- -- if (value.isNull()) -- { -- d->thumbSize = d->lastGlobalThumbSize; -- } -- else -- { -- d->thumbSize = value.toInt(); -- } -- break; -- -- case QVariant::Rect: -- -- if (value.isNull()) -- { -- d->detailRect = QRect(); -- } -- else -- { -- d->detailRect = value.toRect(); -- } -- break; -- -- default: -- break; -- } -- } -- -- return ImageModel::setData(index, value, role); --} -- --void ImageThumbnailModel::slotThumbnailLoaded(const LoadingDescription& loadingDescription, const QPixmap& thumb) --{ -- if (thumb.isNull()) -- { -- return; -- } -- -- // In case of multiple occurrence, we currently do not know which thumbnail is this. Signal change on all. -- QModelIndexList indexes; -- ThumbnailIdentifier thumbId = loadingDescription.thumbnailIdentifier(); -- if (thumbId.filePath.isEmpty()) -- { -- indexes = indexesForImageId(thumbId.id); -- } -- else -- { -- indexes = indexesForPath(thumbId.filePath); -- } -- foreach(const QModelIndex& index, indexes) -- { -- if (thumb.isNull()) -- { -- emit thumbnailFailed(index, loadingDescription.previewParameters.size); -- } -- else -- { -- emit thumbnailAvailable(index, loadingDescription.previewParameters.size); -- -- if (d->emitDataChanged) -- { -- emit dataChanged(index, index, d->staticListContainingThumbnailRole); -- } -- } -- } --} -- --} // namespace Digikam -diff --git a/libs/models/imagethumbnailmodel.h b/libs/models/imagethumbnailmodel.h -deleted file mode 100644 -index 366ca65..0000000 ---- a/libs/models/imagethumbnailmodel.h -+++ /dev/null -@@ -1,140 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2009-03-05 -- * Description : Qt item model for database entries with support for thumbnail loading -- * -- * Copyright (C) 2009-2011 by Marcel Wiesweg -- * Copyright (C) 2011 by Gilles Caulier -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGETHUMBNAILMODEL_H --#define IMAGETHUMBNAILMODEL_H -- --// Local includes -- --#include "imagemodel.h" --#include "thumbnailsize.h" --#include "digikam_export.h" -- --namespace Digikam --{ -- --class LoadingDescription; --class ThumbnailLoadThread; -- --class DIGIKAM_DATABASE_EXPORT ImageThumbnailModel : public ImageModel --{ -- Q_OBJECT -- --public: -- -- /** -- * An ImageModel that supports thumbnail loading. -- * You need to set a ThumbnailLoadThread to enable thumbnail loading. -- * Adjust the thumbnail size to your needs. -- * Note that setKeepsFilePathCache is enabled per default. -- */ -- explicit ImageThumbnailModel(QObject* parent); -- ~ImageThumbnailModel(); -- -- /** Enable thumbnail loading and set the thread that shall be used. -- * The thumbnail size of this thread will be adjusted. -- */ -- void setThumbnailLoadThread(ThumbnailLoadThread* thread); -- ThumbnailLoadThread* thumbnailLoadThread() const; -- -- /// Set the thumbnail size to use -- void setThumbnailSize(const ThumbnailSize& thumbSize); -- -- /// If you want to fix a size for preloading, do it here. -- void setPreloadThumbnailSize(const ThumbnailSize& thumbSize); -- -- void setExifRotate(bool rotate); -- -- /** -- * Enable emitting dataChanged() when a thumbnail becomes available. -- * The thumbnailAvailable() signal will be emitted in any case. -- * Default is true. -- */ -- void setEmitDataChanged(bool emitSignal); -- -- /** -- * Enable preloading of thumbnails: -- * If preloading is enabled, for every entry in the model a thumbnail generation is started. -- * Default: false. -- */ -- void setPreloadThumbnails(bool preload); -- -- ThumbnailSize thumbnailSize() const; -- -- /** -- * Handles the ThumbnailRole. -- * If the pixmap is available, returns it in the QVariant. -- * If it still needs to be loaded, returns a null QVariant and emits -- * thumbnailAvailable() as soon as it is available. -- */ -- virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -- -- /** -- * You can override the current thumbnail size by giving an integer value for ThumbnailRole. -- * Set a null QVariant to use the thumbnail size set by setThumbnailSize() again. -- * The index given here is ignored for this purpose. -- */ -- virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::DisplayRole); -- --public Q_SLOTS: -- -- /** Prepare the thumbnail loading for the given indexes -- */ -- void prepareThumbnails(const QList& indexesToPrepare); -- void prepareThumbnails(const QList& indexesToPrepare, const ThumbnailSize& thumbSize); -- -- /** -- * Preload thumbnail for the given infos resp. indexes. -- * Note: Use setPreloadThumbnails to automatically preload all entries in the model. -- * Note: This only ensures thumbnail generation. It is not guaranteed that pixmaps -- * are stored in the cache. For thumbnails that are expect to be drawn immediately, -- * include them in prepareThumbnails(). -- * Note: Stops preloading of previously added thumbnails. -- */ -- void preloadThumbnails(const QList&); -- void preloadThumbnails(const QList&); -- void preloadAllThumbnails(); -- --Q_SIGNALS: -- -- void thumbnailAvailable(const QModelIndex& index, int requestedSize); -- void thumbnailFailed(const QModelIndex& index, int requestedSize); -- --protected: -- -- virtual void imageInfosCleared(); -- --protected Q_SLOTS: -- -- void slotThumbnailLoaded(const LoadingDescription& loadingDescription, const QPixmap& thumb); -- --private: -- -- class ImageThumbnailModelPriv; -- ImageThumbnailModelPriv* const d; --}; -- --} // namespace Digikam -- --#endif /* IMAGETHUMBNAILMODEL_H */ -diff --git a/libs/models/imageversionsmodel.cpp b/libs/models/imageversionsmodel.cpp -deleted file mode 100644 -index e6ba582..0000000 ---- a/libs/models/imageversionsmodel.cpp -+++ /dev/null -@@ -1,183 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2010-07-13 -- * Description : Model for image versions -- * -- * Copyright (C) 2010 by Martin Klapetek -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#include "imageversionsmodel.h" -- --// KDE includes -- --#include -- --// Local includes -- --#include "digikam_debug.h" --#include "workingwidget.h" -- --namespace Digikam --{ -- --class ImageVersionsModel::Private --{ --public: -- -- Private() -- { -- data = 0; -- paintTree = false; -- } -- -- ///Complete paths with filenames and tree level -- QList >* data; -- ///This is for delegate to paint it as selected -- QString currentSelectedImage; -- ///If true, the delegate will paint items as a tree -- ///if false, it will be painted as a list -- bool paintTree; --}; -- --ImageVersionsModel::ImageVersionsModel(QObject* parent) -- : QAbstractListModel(parent), -- d(new Private) --{ -- d->data = new QList >; --} -- --ImageVersionsModel::~ImageVersionsModel() --{ -- //qDeleteAll(d->data); -- delete d; --} -- --Qt::ItemFlags ImageVersionsModel::flags(const QModelIndex& index) const --{ -- if (!index.isValid()) -- { -- return 0; -- } -- -- return Qt::ItemIsEnabled | Qt::ItemIsSelectable; --} -- --QVariant ImageVersionsModel::data(const QModelIndex& index, int role) const --{ -- if (!index.isValid()) -- { -- return QVariant(); -- } -- -- if (role == Qt::DisplayRole && !d->data->isEmpty()) -- { -- return d->data->at(index.row()).first; -- } -- else if (role == Qt::UserRole && !d->data->isEmpty()) -- { -- return d->data->at(index.row()).second; -- } -- else if (role == Qt::DisplayRole && d->data->isEmpty()) -- { -- //TODO: make this text Italic -- return QVariant(QString(i18n("No image selected"))); -- } -- -- return QVariant(); --} -- --int ImageVersionsModel::rowCount(const QModelIndex& parent) const --{ -- Q_UNUSED(parent) -- return d->data->count(); --} -- --void ImageVersionsModel::setupModelData(QList >& data) --{ -- beginResetModel(); -- -- d->data->clear(); -- -- if (!data.isEmpty()) -- { -- d->data->append(data); -- } -- else -- { -- d->data->append(qMakePair(QString(i18n("This is the original image")), 0)); -- } -- -- endResetModel(); --} -- --void ImageVersionsModel::clearModelData() --{ -- beginResetModel(); -- -- if (!d->data->isEmpty()) -- { -- d->data->clear(); -- } -- -- endResetModel(); --} -- --void ImageVersionsModel::slotAnimationStep() --{ -- emit dataChanged(createIndex(0, 0), createIndex(rowCount()-1, 1)); --} -- --QString ImageVersionsModel::currentSelectedImage() const --{ -- return d->currentSelectedImage; --} -- --void ImageVersionsModel::setCurrentSelectedImage(const QString& path) --{ -- d->currentSelectedImage = path; --} -- --QModelIndex ImageVersionsModel::currentSelectedImageIndex() const --{ -- return index(listIndexOf(d->currentSelectedImage), 0); --} -- --bool ImageVersionsModel::paintTree() const --{ -- return d->paintTree; --} -- --void ImageVersionsModel::setPaintTree(bool paint) --{ -- d->paintTree = paint; --} -- --int ImageVersionsModel::listIndexOf(const QString& item) const --{ -- for (int i = 0; i < d->data->size(); ++i) -- { -- if (d->data->at(i).first == item) -- { -- return i; -- } -- } -- -- return -1; --} -- --} // namespace Digikam -diff --git a/libs/models/imageversionsmodel.h b/libs/models/imageversionsmodel.h -deleted file mode 100644 -index ed08529..0000000 ---- a/libs/models/imageversionsmodel.h -+++ /dev/null -@@ -1,75 +0,0 @@ --/* ============================================================ -- * -- * This file is a part of digiKam project -- * http://www.digikam.org -- * -- * Date : 2010-07-13 -- * Description : Model for image versions -- * -- * Copyright (C) 2010 by Martin Klapetek -- * -- * 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, 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. -- * -- * ============================================================ */ -- --#ifndef IMAGEVERSIONSMODEL_H --#define IMAGEVERSIONSMODEL_H -- --// Qt includes -- --#include --#include -- --// Local includes -- --#include "digikam_export.h" -- --namespace Digikam --{ -- --class DIGIKAM_DATABASE_EXPORT ImageVersionsModel : public QAbstractListModel --{ -- Q_OBJECT -- --public: -- -- explicit ImageVersionsModel(QObject* parent = 0); -- ~ImageVersionsModel(); -- -- Qt::ItemFlags flags(const QModelIndex& index) const; -- QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; -- int rowCount(const QModelIndex& parent = QModelIndex()) const; -- -- void setupModelData(QList >& data); -- void clearModelData(); -- -- QString currentSelectedImage() const; -- void setCurrentSelectedImage(const QString& path); -- QModelIndex currentSelectedImageIndex() const; -- -- bool paintTree() const; -- int listIndexOf(const QString& item) const; -- --public Q_SLOTS: -- -- void slotAnimationStep(); -- void setPaintTree(bool paint); -- --private: -- -- class Private; -- Private* const d; --}; -- --} // namespace Digikam -- --#endif // IMAGEVERSIONSMODEL_H --- -cgit v0.11.2 - diff --git a/kde/patch/digikam/digikam_imagemagick7.patch b/kde/patch/digikam/digikam_imagemagick7.patch deleted file mode 100644 index 04a7752..0000000 --- a/kde/patch/digikam/digikam_imagemagick7.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Antonio Rojas -Date: Thu, 7 Nov 2019 09:25:02 +0100 -Subject: Properly initialize ExceptionInfo in libMagick - -Otherwise it will crash if some plugins can't be loaded. - -diff --git a/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp b/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp -index 1858b4d..20ef01b 100644 ---- a/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp -+++ b/core/dplugins/dimg/imagemagick/dimgimagemagickplugin.cpp -@@ -125,7 +125,7 @@ QMap DImgImageMagickPlugin::extraAboutData() const - QString mimes = typeMimes(); - - QMap map; -- ExceptionInfo ex; -+ ExceptionInfo ex = *AcquireExceptionInfo(); - size_t n = 0; - const MagickInfo** inflst = GetMagickInfoList("*", &n, &ex); - -@@ -219,7 +219,7 @@ int DImgImageMagickPlugin::canRead(const QFileInfo& fileInfo, bool magic) const - int DImgImageMagickPlugin::canWrite(const QString& format) const - { - QStringList formats; -- ExceptionInfo ex; -+ ExceptionInfo ex = *AcquireExceptionInfo(); - size_t n = 0; - const MagickInfo** inflst = GetMagickInfoList("*", &n, &ex); - -@@ -266,7 +266,7 @@ DImgLoader* DImgImageMagickPlugin::loader(DImg* const image, const DRawDecoding& - QStringList DImgImageMagickPlugin::decoderFormats() const - { - QStringList formats; -- ExceptionInfo ex; -+ ExceptionInfo ex = *AcquireExceptionInfo(); - size_t n = 0; - const MagickInfo** inflst = GetMagickInfoList("*", &n, &ex); - --- -cgit v1.1 - diff --git a/kde/patch/dolphin.patch b/kde/patch/dolphin.patch index dfe3a2f..02a7950 100644 --- a/kde/patch/dolphin.patch +++ b/kde/patch/dolphin.patch @@ -1,3 +1,2 @@ # Let the user decide whether she wants to run Dolphin as root: cat $CWD/patch/dolphin/dolphin_revert_noroot.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/gwenview.patch b/kde/patch/gwenview.patch deleted file mode 100644 index 04dfe50..0000000 --- a/kde/patch/gwenview.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Prevent dataloss when importing pictures; -# Will be fixed in 17.04.2: -#cat $CWD/patch/gwenview/gwenview-17.04.1_dataloss.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/gwenview/gwenview-17.04.1_dataloss.patch b/kde/patch/gwenview/gwenview-17.04.1_dataloss.patch deleted file mode 100644 index fa93428..0000000 --- a/kde/patch/gwenview/gwenview-17.04.1_dataloss.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 6ce5d2f8d82f83c5a3d726ee5807ebaf7a6e3c6c Mon Sep 17 00:00:00 2001 -From: Henrik Fehlauer -Date: Thu, 11 May 2017 22:40:15 +0200 -Subject: Avoid data loss when importing pictures - -Summary: -Fix porting regressions, which left users of Gwenview Importer with: -- failed import (import destination still empty) -- additionally (when choosing "Delete" instead of "Keep" after import): - pictures also removed from import source, with no way to recover - -Correct additional problems remaining after fixing the import failure: -- hang on duplicate filenames -- identically named files with different content are never imported -- error dialog when deleting pictures from import source - -BUG: 379615 - -In detail: - -1st problem (introduced in 017b4fe5dc7f4b6e876cfd7b108dcebbf609ae94): - - Initially, pictures are copied to a temporary folder - (e.g. "foo/.gwenview_importer-IcQqvo/"), before being moved/renamed - to the final destination (e.g. "foo/"), which is determined by - calling "cd .." on the temporary folder. - - However, mistakenly this path contains a superfluous '/' - (e.g. "foo/.gwenview_importer-IcQqvo//"), resulting in the final - destination reading "foo/.gwenview_importer-IcQqvo/" instead of - "foo/". On cleanup, the temporary folder is removed, simultaneously - deleting all new pictures. - - Fix: Omit '/' where appropriate. - -2nd problem (broken by a3262e9b197ee97323ef8bf3a9dca1e13f61a74c): - - When trying to find a unique filename, the while loop "stat"ing the - file repeats forever. - - Fix: Call "KIO::stat" and "KJobWidgets::setWindow" - also inside the loop. - -3rd problem (introduced in 017b4fe5dc7f4b6e876cfd7b108dcebbf609ae94): - - If the destination directory already contains an identically named - file, we try to find a different name by appending a number. For - this, we need to strip the old filename from the full path. - Unfortunately, only calling "path()" is incorrect, giving - "foo/pict0001.jpg/pict0001_1.jpg", rather than "foo/pict0001_1.jpg". - - Fix: Use "adjusted(QUrl::RemoveFilename)". - -4th problem (broken by a3262e9b197ee97323ef8bf3a9dca1e13f61a74c): - - Although deletion works, we show a warning dialog stating failure. - - Fix: Invert the logic of "job->exec()", as the error handling should - be skipped by "break"ing out of the while loop. - -Test Plan: -Steps to reproduce (see https://bugs.kde.org/show_bug.cgi?id=379615) no longer result in data loss. - -Autotests for importer (separate review request in D5750) pass. Hopefully, this helps catching any future porting regressions. - -Reviewers: ltoscano, sandsmark, gateau - -Reviewed By: ltoscano - -Differential Revision: https://phabricator.kde.org/D5749 ---- - importer/fileutils.cpp | 5 ++++- - importer/importdialog.cpp | 2 +- - importer/importer.cpp | 4 ++-- - 3 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/importer/fileutils.cpp b/importer/fileutils.cpp -index 5293d56..a51a18c 100644 ---- a/importer/fileutils.cpp -+++ b/importer/fileutils.cpp -@@ -128,7 +128,10 @@ RenameResult rename(const QUrl& src, const QUrl& dst_, QWidget* authWindow) - } - result = RenamedUnderNewName; - -- dst.setPath(dst.path() + '/' + prefix + QString::number(count) + suffix); -+ dst.setPath(dst.adjusted(QUrl::RemoveFilename).path() + prefix + QString::number(count) + suffix); -+ statJob = KIO::stat(dst); -+ KJobWidgets::setWindow(statJob, authWindow); -+ - ++count; - } - -diff --git a/importer/importdialog.cpp b/importer/importdialog.cpp -index ee6f7cd..5e9e847 100644 ---- a/importer/importdialog.cpp -+++ b/importer/importdialog.cpp -@@ -121,7 +121,7 @@ public: - QList urls = importedUrls + skippedUrls; - while (true) { - KIO::Job* job = KIO::del(urls); -- if (!job->exec()) { -+ if (job->exec()) { - break; - } - // Deleting failed -diff --git a/importer/importer.cpp b/importer/importer.cpp -index 51c4b96..a7e1d4e 100644 ---- a/importer/importer.cpp -+++ b/importer/importer.cpp -@@ -98,7 +98,7 @@ struct ImporterPrivate - } - mCurrentUrl = mUrlList.takeFirst(); - QUrl dst = mTempImportDirUrl; -- dst.setPath(dst.path() + '/' + mCurrentUrl.fileName()); -+ dst.setPath(dst.path() + mCurrentUrl.fileName()); - KIO::Job* job = KIO::copy(mCurrentUrl, dst, KIO::HideProgressInfo); - KJobWidgets::setWindow(job, mAuthWindow); - QObject::connect(job, SIGNAL(result(KJob*)), -@@ -122,7 +122,7 @@ struct ImporterPrivate - } else { - fileName = src.fileName(); - } -- dst.setPath(dst.path() + '/' + fileName); -+ dst.setPath(dst.path() + fileName); - - FileUtils::RenameResult result = FileUtils::rename(src, dst, mAuthWindow); - switch (result) { --- -cgit v0.11.2 - - diff --git a/kde/patch/kaccounts-integration.patch b/kde/patch/kaccounts-integration.patch deleted file mode 100644 index 26b87d4..0000000 --- a/kde/patch/kaccounts-integration.patch +++ /dev/null @@ -1,4 +0,0 @@ -# A bug with 15.08.2/.3 breaks KDE Telepathy accounts connection . -# Will be fixed in 15.12.0: -#cat $CWD/patch/kaccounts-integration/kaccounts-integration-15.08.3_service.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kaccounts-integration/kaccounts-integration-15.08.3_service.patch b/kde/patch/kaccounts-integration/kaccounts-integration-15.08.3_service.patch deleted file mode 100644 index e41d58b..0000000 --- a/kde/patch/kaccounts-integration/kaccounts-integration-15.08.3_service.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/src/jobs/createaccount.cpp -+++ b/src/jobs/createaccount.cpp -@@ -141,8 +141,8 @@ - - m_done = true; - -+ connect(m_identity, &SignOn::Identity::credentialsStored, m_identity, &SignOn::Identity::queryInfo); - m_identity->storeCredentials(); -- connect(m_identity, &SignOn::Identity::credentialsStored, m_identity, &SignOn::Identity::queryInfo); - } - - void CreateAccount::pluginError(const QString &error) -@@ -177,12 +177,12 @@ - return; - } - -+ m_account->selectService(); -+ - if (m_account->displayName().isEmpty()) { - m_account->setDisplayName(info.userName()); - } - m_account->setValue("username", info.userName()); -- -- m_account->selectService(); - m_account->setCredentialsId(info.id()); - - Accounts::AuthData authData = m_accInfo->authData(); - diff --git a/kde/patch/kalgebra.patch b/kde/patch/kalgebra.patch index 8365ff3..d17f482 100644 --- a/kde/patch/kalgebra.patch +++ b/kde/patch/kalgebra.patch @@ -2,4 +2,3 @@ # on other, it's not, requiring you to link both Curses and Readline libraries # manually. cat $CWD/patch/kalgebra/kalgebra_ncurses_linking.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kalzium.patch b/kde/patch/kalzium.patch deleted file mode 100644 index 6593e9d..0000000 --- a/kde/patch/kalzium.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix build against KF 5.31.0 (repaired in 16.12.3): -#cat $CWD/patch/kalzium/kalzium_kf_5.31.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kalzium/kalzium_kf_5.31.patch b/kde/patch/kalzium/kalzium_kf_5.31.patch deleted file mode 100644 index a3d4e00..0000000 --- a/kde/patch/kalzium/kalzium_kf_5.31.patch +++ /dev/null @@ -1,156 +0,0 @@ -Patch taken from: -https://gitweb.gentoo.org/repo/gentoo.git/plain/kde-apps/kalzium/files/kalzium-16.12.2-kf-5.31.patch - -From f233d458959548ab371e3faeca7313f746625afc Mon Sep 17 00:00:00 2001 -From: Heiko Becker -Date: Sun, 22 Jan 2017 14:46:24 +0100 -Subject: Fix build with extra-cmake-modules > 5.30 - -Since a5f3a76e14799c68b5e8f74e375baa5f6f6ab4dc in -extra-cmake-modules.git -fno-operator-names is passed to the build -(when supported), causing a build error for kalzium. - -REVIEW: 129873 ---- - src/calculator/titrationCalculator.cpp | 39 +++++++++++++++------------------- - 1 file changed, 17 insertions(+), 22 deletions(-) - -diff --git a/src/calculator/titrationCalculator.cpp b/src/calculator/titrationCalculator.cpp -index 44ea152..6ea9ac9 100644 ---- a/src/calculator/titrationCalculator.cpp -+++ b/src/calculator/titrationCalculator.cpp -@@ -41,11 +41,6 @@ - - using namespace std; - --#ifdef _MSC_VER --#define and && --#define or || --#endif -- - titrationCalculator::titrationCalculator(QWidget * parent) : QWidget(parent) - { - xmin = 0; -@@ -112,7 +107,7 @@ void titrationCalculator::plot() - } - QString mreporto; - int iter = 0; -- if (uid.xaxis->text() == "" or uid.xaxis->text() == " ") { -+ if (uid.xaxis->text() == "" || uid.xaxis->text() == " ") { - uid.xaxis->setText(i18n("nothing")); - } - if (tmpy == 0) { -@@ -121,11 +116,11 @@ void titrationCalculator::plot() - //now we have to solve the system of equations NOTE:yvalue contains the equation of Y-axis variable - //we iterates the process until you have an equation in one only unknown variable or a numeric expression - mreporto = solve(yvalue); -- while (end == 0 or lettere == 1) { -+ while (end == 0 || lettere == 1) { - QByteArray ba = mreporto.toLatin1(); - char *tmreport = ba.data(); - ++iter; -- if (end == 1 or lettere == 0) { -+ if (end == 1 || lettere == 0) { - break; - } - if (iter > 100) { -@@ -273,13 +268,13 @@ QString titrationCalculator::solve(char *yvalue) - QString tempyval; - QString ptem; - for (int i = 0; strlen(yvalue) + 1; ++i) { -- if (!(yvalue[i]=='q' or yvalue[i]=='w' or yvalue[i]=='e' or yvalue[i]=='r' or yvalue[i]=='t' or yvalue[i]=='y' or yvalue[i]=='u' or yvalue[i]=='i' or yvalue[i]=='o' or yvalue[i]=='p' or yvalue[i]=='a' or yvalue[i]=='s' or yvalue[i]=='d' or yvalue[i]=='f' or yvalue[i]=='g' or yvalue[i]=='h' or yvalue[i]=='j' or yvalue[i]=='k' or yvalue[i]=='l' or yvalue[i]=='z' or yvalue[i]=='x' or yvalue[i]=='c' or yvalue[i]=='v' or yvalue[i]=='b' or yvalue[i]=='n' or yvalue[i]=='m' or yvalue[i]=='+' or yvalue[i]=='-' or yvalue[i]=='^' or yvalue[i]=='*' or yvalue[i]=='/' or yvalue[i]=='(' or yvalue[i]==')' or yvalue[i]=='Q' or yvalue[i]=='W' or yvalue[i]=='E' or yvalue[i]=='R' or yvalue[i]=='T' or yvalue[i]=='Y' or yvalue[i]=='U' or yvalue[i]=='I' or yvalue[i]=='O' or yvalue[i]=='P' or yvalue[i]=='A' or yvalue[i]=='S' or yvalue[i]=='D' or yvalue[i]=='F' or yvalue[i]=='G' or yvalue[i]=='H' or yvalue[i]=='J' or yvalue[i]=='K' or yvalue[i]=='L' or yvalue[i]=='Z' or yvalue[i]=='X' or yvalue[i]=='C' or yvalue[i]=='V' or yvalue[i]=='B' or yvalue[i]=='N' or yvalue[i]=='M' or yvalue[i]=='1' or yvalue[i]=='2' or yvalue[i]=='3' or yvalue[i]=='4' or yvalue[i]=='5' or yvalue[i]=='6' or yvalue[i]=='7' or yvalue[i]=='8' or yvalue[i]=='9' or yvalue[i]=='0' or yvalue[i]=='.' or yvalue[i]==',')) { -+ if (!(yvalue[i]=='q' || yvalue[i]=='w' || yvalue[i]=='e' || yvalue[i]=='r' || yvalue[i]=='t' || yvalue[i]=='y' || yvalue[i]=='u' || yvalue[i]=='i' || yvalue[i]=='o' || yvalue[i]=='p' || yvalue[i]=='a' || yvalue[i]=='s' || yvalue[i]=='d' || yvalue[i]=='f' || yvalue[i]=='g' || yvalue[i]=='h' || yvalue[i]=='j' || yvalue[i]=='k' || yvalue[i]=='l' || yvalue[i]=='z' || yvalue[i]=='x' || yvalue[i]=='c' || yvalue[i]=='v' || yvalue[i]=='b' || yvalue[i]=='n' || yvalue[i]=='m' || yvalue[i]=='+' || yvalue[i]=='-' || yvalue[i]=='^' || yvalue[i]=='*' || yvalue[i]=='/' || yvalue[i]=='(' || yvalue[i]==')' || yvalue[i]=='Q' || yvalue[i]=='W' || yvalue[i]=='E' || yvalue[i]=='R' || yvalue[i]=='T' || yvalue[i]=='Y' || yvalue[i]=='U' || yvalue[i]=='I' || yvalue[i]=='O' || yvalue[i]=='P' || yvalue[i]=='A' || yvalue[i]=='S' || yvalue[i]=='D' || yvalue[i]=='F' || yvalue[i]=='G' || yvalue[i]=='H' || yvalue[i]=='J' || yvalue[i]=='K' || yvalue[i]=='L' || yvalue[i]=='Z' || yvalue[i]=='X' || yvalue[i]=='C' || yvalue[i]=='V' || yvalue[i]=='B' || yvalue[i]=='N' || yvalue[i]=='M' || yvalue[i]=='1' || yvalue[i]=='2' || yvalue[i]=='3' || yvalue[i]=='4' || yvalue[i]=='5' || yvalue[i]=='6' || yvalue[i]=='7' || yvalue[i]=='8' || yvalue[i]=='9' || yvalue[i]=='0' || yvalue[i]=='.' || yvalue[i]==',')) { - break; //if current value is not a permitted value, this means that something is wrong - } -- if (yvalue[i]=='q' or yvalue[i]=='w' or yvalue[i]=='e' or yvalue[i]=='r' or yvalue[i]=='t' or yvalue[i]=='y' or yvalue[i]=='u' or yvalue[i]=='i' or yvalue[i]=='o' or yvalue[i]=='p' or yvalue[i]=='a' or yvalue[i]=='s' or yvalue[i]=='d' or yvalue[i]=='f' or yvalue[i]=='g' or yvalue[i]=='h' or yvalue[i]=='j' or yvalue[i]=='k' or yvalue[i]=='l' or yvalue[i]=='z' or yvalue[i]=='x' or yvalue[i]=='c' or yvalue[i]=='v' or yvalue[i]=='b' or yvalue[i]=='n' or yvalue[i]=='m' or yvalue[i]=='Q' or yvalue[i]=='W' or yvalue[i]=='E' or yvalue[i]=='R' or yvalue[i]=='T' or yvalue[i]=='Y' or yvalue[i]=='U' or yvalue[i]=='I' or yvalue[i]=='O' or yvalue[i]=='P' or yvalue[i]=='A' or yvalue[i]=='S' or yvalue[i]=='D' or yvalue[i]=='F' or yvalue[i]=='G' or yvalue[i]=='H' or yvalue[i]=='J' or yvalue[i]=='K' or yvalue[i]=='L' or yvalue[i]=='Z' or yvalue[i]=='X' or yvalue[i]=='C' or yvalue[i]=='V' or yvalue[i]=='B' or yvalue[i]=='N' or yvalue[i]=='M' or yvalue[i]=='.' or yvalue[i]==',') { -+ if (yvalue[i]=='q' || yvalue[i]=='w' || yvalue[i]=='e' || yvalue[i]=='r' || yvalue[i]=='t' || yvalue[i]=='y' || yvalue[i]=='u' || yvalue[i]=='i' || yvalue[i]=='o' || yvalue[i]=='p' || yvalue[i]=='a' || yvalue[i]=='s' || yvalue[i]=='d' || yvalue[i]=='f' || yvalue[i]=='g' || yvalue[i]=='h' || yvalue[i]=='j' || yvalue[i]=='k' || yvalue[i]=='l' || yvalue[i]=='z' || yvalue[i]=='x' || yvalue[i]=='c' || yvalue[i]=='v' || yvalue[i]=='b' || yvalue[i]=='n' || yvalue[i]=='m' || yvalue[i]=='Q' || yvalue[i]=='W' || yvalue[i]=='E' || yvalue[i]=='R' || yvalue[i]=='T' || yvalue[i]=='Y' || yvalue[i]=='U' || yvalue[i]=='I' || yvalue[i]=='O' || yvalue[i]=='P' || yvalue[i]=='A' || yvalue[i]=='S' || yvalue[i]=='D' || yvalue[i]=='F' || yvalue[i]=='G' || yvalue[i]=='H' || yvalue[i]=='J' || yvalue[i]=='K' || yvalue[i]=='L' || yvalue[i]=='Z' || yvalue[i]=='X' || yvalue[i]=='C' || yvalue[i]=='V' || yvalue[i]=='B' || yvalue[i]=='N' || yvalue[i]=='M' || yvalue[i]=='.' || yvalue[i]==',') { - lettere = 1; //if lettere == 0 then the equation contains only mnumbers - } -- if (yvalue[i]=='+' or yvalue[i]=='-' or yvalue[i]=='^' or yvalue[i]=='*' or yvalue[i]=='/' or yvalue[i]=='(' or yvalue[i]==')' or yvalue[i]=='1' or yvalue[i]=='2' or yvalue[i]=='3' or yvalue[i]=='4' or yvalue[i]=='5' or yvalue[i]=='6' or yvalue[i]=='7' or yvalue[i]=='8' or yvalue[i]=='9' or yvalue[i]=='0' or yvalue[i]=='.' or yvalue[i]==',') { -+ if (yvalue[i]=='+' || yvalue[i]=='-' || yvalue[i]=='^' || yvalue[i]=='*' || yvalue[i]=='/' || yvalue[i]=='(' || yvalue[i]==')' || yvalue[i]=='1' || yvalue[i]=='2' || yvalue[i]=='3' || yvalue[i]=='4' || yvalue[i]=='5' || yvalue[i]=='6' || yvalue[i]=='7' || yvalue[i]=='8' || yvalue[i]=='9' || yvalue[i]=='0' || yvalue[i]=='.' || yvalue[i]==',') { - tempyval = tempyval + QString(yvalue[i]); - } else { - tempy = tempy + QString(yvalue[i]); -@@ -302,7 +297,7 @@ QString titrationCalculator::solve(char *yvalue) - end = 1; - } - if (tempy!=uid.xaxis->text()) { -- if (yvalue[i]=='+' or yvalue[i]=='-' or yvalue[i]=='^' or yvalue[i]=='*' or yvalue[i]=='/' or yvalue[i]=='(' or yvalue[i]==')' or yvalue[i]=='1' or yvalue[i]=='2' or yvalue[i]=='3' or yvalue[i]=='4' or yvalue[i]=='5' or yvalue[i]=='6' or yvalue[i]=='7' or yvalue[i]=='8' or yvalue[i]=='9' or yvalue[i]=='0' or yvalue[i]=='.' or yvalue[i]==',') { -+ if (yvalue[i]=='+' || yvalue[i]=='-' || yvalue[i]=='^' || yvalue[i]=='*' || yvalue[i]=='/' || yvalue[i]=='(' || yvalue[i]==')' || yvalue[i]=='1' || yvalue[i]=='2' || yvalue[i]=='3' || yvalue[i]=='4' || yvalue[i]=='5' || yvalue[i]=='6' || yvalue[i]=='7' || yvalue[i]=='8' || yvalue[i]=='9' || yvalue[i]=='0' || yvalue[i]=='.' || yvalue[i]==',') { - //actually nothing - } else { - end = 0; -@@ -335,13 +330,13 @@ QString titrationCalculator::solvex(char *yvalue, QString dnum) { - QString tempyval; - tempy = ""; - for (int i = 0; strlen(yvalue) + 1; ++i) { -- if (!(yvalue[i]=='q' or yvalue[i]=='w' or yvalue[i]=='e' or yvalue[i]=='r' or yvalue[i]=='t' or yvalue[i]=='y' or yvalue[i]=='u' or yvalue[i]=='i' or yvalue[i]=='o' or yvalue[i]=='p' or yvalue[i]=='a' or yvalue[i]=='s' or yvalue[i]=='d' or yvalue[i]=='f' or yvalue[i]=='g' or yvalue[i]=='h' or yvalue[i]=='j' or yvalue[i]=='k' or yvalue[i]=='l' or yvalue[i]=='z' or yvalue[i]=='x' or yvalue[i]=='c' or yvalue[i]=='v' or yvalue[i]=='b' or yvalue[i]=='n' or yvalue[i]=='m' or yvalue[i]=='+' or yvalue[i]=='-' or yvalue[i]=='^' or yvalue[i]=='*' or yvalue[i]=='/' or yvalue[i]=='(' or yvalue[i]==')' or yvalue[i]=='Q' or yvalue[i]=='W' or yvalue[i]=='E' or yvalue[i]=='R' or yvalue[i]=='T' or yvalue[i]=='Y' or yvalue[i]=='U' or yvalue[i]=='I' or yvalue[i]=='O' or yvalue[i]=='P' or yvalue[i]=='A' or yvalue[i]=='S' or yvalue[i]=='D' or yvalue[i]=='F' or yvalue[i]=='G' or yvalue[i]=='H' or yvalue[i]=='J' or yvalue[i]=='K' or yvalue[i]=='L' or yvalue[i]=='Z' or yvalue[i]=='X' or yvalue[i]=='C' or yvalue[i]=='V' or yvalue[i]=='B' or yvalue[i]=='N' or yvalue[i]=='M' or yvalue[i]=='1' or yvalue[i]=='2' or yvalue[i]=='3' or yvalue[i]=='4' or yvalue[i]=='5' or yvalue[i]=='6' or yvalue[i]=='7' or yvalue[i]=='8' or yvalue[i]=='9' or yvalue[i]=='0' or yvalue[i]=='.' or yvalue[i]==',')) { -+ if (!(yvalue[i]=='q' || yvalue[i]=='w' || yvalue[i]=='e' || yvalue[i]=='r' || yvalue[i]=='t' || yvalue[i]=='y' || yvalue[i]=='u' || yvalue[i]=='i' || yvalue[i]=='o' || yvalue[i]=='p' || yvalue[i]=='a' || yvalue[i]=='s' || yvalue[i]=='d' || yvalue[i]=='f' || yvalue[i]=='g' || yvalue[i]=='h' || yvalue[i]=='j' || yvalue[i]=='k' || yvalue[i]=='l' || yvalue[i]=='z' || yvalue[i]=='x' || yvalue[i]=='c' || yvalue[i]=='v' || yvalue[i]=='b' || yvalue[i]=='n' || yvalue[i]=='m' || yvalue[i]=='+' || yvalue[i]=='-' || yvalue[i]=='^' || yvalue[i]=='*' || yvalue[i]=='/' || yvalue[i]=='(' || yvalue[i]==')' || yvalue[i]=='Q' || yvalue[i]=='W' || yvalue[i]=='E' || yvalue[i]=='R' || yvalue[i]=='T' || yvalue[i]=='Y' || yvalue[i]=='U' || yvalue[i]=='I' || yvalue[i]=='O' || yvalue[i]=='P' || yvalue[i]=='A' || yvalue[i]=='S' || yvalue[i]=='D' || yvalue[i]=='F' || yvalue[i]=='G' || yvalue[i]=='H' || yvalue[i]=='J' || yvalue[i]=='K' || yvalue[i]=='L' || yvalue[i]=='Z' || yvalue[i]=='X' || yvalue[i]=='C' || yvalue[i]=='V' || yvalue[i]=='B' || yvalue[i]=='N' || yvalue[i]=='M' || yvalue[i]=='1' || yvalue[i]=='2' || yvalue[i]=='3' || yvalue[i]=='4' || yvalue[i]=='5' || yvalue[i]=='6' || yvalue[i]=='7' || yvalue[i]=='8' || yvalue[i]=='9' || yvalue[i]=='0' || yvalue[i]=='.' || yvalue[i]==',')) { - break; //if current value is not a permitted value, this means that something is wrong - } -- if (yvalue[i]=='q' or yvalue[i]=='w' or yvalue[i]=='e' or yvalue[i]=='r' or yvalue[i]=='t' or yvalue[i]=='y' or yvalue[i]=='u' or yvalue[i]=='i' or yvalue[i]=='o' or yvalue[i]=='p' or yvalue[i]=='a' or yvalue[i]=='s' or yvalue[i]=='d' or yvalue[i]=='f' or yvalue[i]=='g' or yvalue[i]=='h' or yvalue[i]=='j' or yvalue[i]=='k' or yvalue[i]=='l' or yvalue[i]=='z' or yvalue[i]=='x' or yvalue[i]=='c' or yvalue[i]=='v' or yvalue[i]=='b' or yvalue[i]=='n' or yvalue[i]=='m' or yvalue[i]=='Q' or yvalue[i]=='W' or yvalue[i]=='E' or yvalue[i]=='R' or yvalue[i]=='T' or yvalue[i]=='Y' or yvalue[i]=='U' or yvalue[i]=='I' or yvalue[i]=='O' or yvalue[i]=='P' or yvalue[i]=='A' or yvalue[i]=='S' or yvalue[i]=='D' or yvalue[i]=='F' or yvalue[i]=='G' or yvalue[i]=='H' or yvalue[i]=='J' or yvalue[i]=='K' or yvalue[i]=='L' or yvalue[i]=='Z' or yvalue[i]=='X' or yvalue[i]=='C' or yvalue[i]=='V' or yvalue[i]=='B' or yvalue[i]=='N' or yvalue[i]=='M' or yvalue[i]=='.' or yvalue[i]==',') { -+ if (yvalue[i]=='q' || yvalue[i]=='w' || yvalue[i]=='e' || yvalue[i]=='r' || yvalue[i]=='t' || yvalue[i]=='y' || yvalue[i]=='u' || yvalue[i]=='i' || yvalue[i]=='o' || yvalue[i]=='p' || yvalue[i]=='a' || yvalue[i]=='s' || yvalue[i]=='d' || yvalue[i]=='f' || yvalue[i]=='g' || yvalue[i]=='h' || yvalue[i]=='j' || yvalue[i]=='k' || yvalue[i]=='l' || yvalue[i]=='z' || yvalue[i]=='x' || yvalue[i]=='c' || yvalue[i]=='v' || yvalue[i]=='b' || yvalue[i]=='n' || yvalue[i]=='m' || yvalue[i]=='Q' || yvalue[i]=='W' || yvalue[i]=='E' || yvalue[i]=='R' || yvalue[i]=='T' || yvalue[i]=='Y' || yvalue[i]=='U' || yvalue[i]=='I' || yvalue[i]=='O' || yvalue[i]=='P' || yvalue[i]=='A' || yvalue[i]=='S' || yvalue[i]=='D' || yvalue[i]=='F' || yvalue[i]=='G' || yvalue[i]=='H' || yvalue[i]=='J' || yvalue[i]=='K' || yvalue[i]=='L' || yvalue[i]=='Z' || yvalue[i]=='X' || yvalue[i]=='C' || yvalue[i]=='V' || yvalue[i]=='B' || yvalue[i]=='N' || yvalue[i]=='M' || yvalue[i]=='.' || yvalue[i]==',') { - tempy = tempy + yvalue[i]; //if lettere == 0 then the equation contains only mnumbers - } -- if (yvalue[i]=='+' or yvalue[i]=='-' or yvalue[i]=='^' or yvalue[i]=='*' or yvalue[i]=='/' or yvalue[i]=='(' or yvalue[i]==')' or yvalue[i]=='1' or yvalue[i]=='2' or yvalue[i]=='3' or yvalue[i]=='4' or yvalue[i]=='5' or yvalue[i]=='6' or yvalue[i]=='7' or yvalue[i]=='8' or yvalue[i]=='9' or yvalue[i]=='0' or yvalue[i]=='.' or yvalue[i]==',') { -+ if (yvalue[i]=='+' || yvalue[i]=='-' || yvalue[i]=='^' || yvalue[i]=='*' || yvalue[i]=='/' || yvalue[i]=='(' || yvalue[i]==')' || yvalue[i]=='1' || yvalue[i]=='2' || yvalue[i]=='3' || yvalue[i]=='4' || yvalue[i]=='5' || yvalue[i]=='6' || yvalue[i]=='7' || yvalue[i]=='8' || yvalue[i]=='9' || yvalue[i]=='0' || yvalue[i]=='.' || yvalue[i]==',') { - if (!tempyolda.isEmpty()) { - tempy = tempy + yvalue[i]; - if (tempyolda == uid.xaxis->text()) { -@@ -359,7 +354,7 @@ QString titrationCalculator::solvex(char *yvalue, QString dnum) { - tempyolda = tempyold; - } else { - tempyold = ""; -- if (((olda != 1) and (yvalue[i + 1] != '^')) or (yvalue[i] == '+' or yvalue[i] == '-' or yvalue[i] == '^' or yvalue[i] == '*' or yvalue[i] == '/' or yvalue[i] == '(' or yvalue[i] == ')')) { -+ if (((olda != 1) && (yvalue[i + 1] != '^')) || (yvalue[i] == '+' || yvalue[i] == '-' || yvalue[i] == '^' || yvalue[i] == '*' || yvalue[i] == '/' || yvalue[i] == '(' || yvalue[i] == ')')) { - tempyval = tempyval + QString(yvalue[i]); - } - } -@@ -374,7 +369,7 @@ QString titrationCalculator::solvex(char *yvalue, QString dnum) { - tempyold = ""; - olda = 1; - } -- if ((tempy==uid.xaxis->text()) and (!tempyolda.isEmpty())) { -+ if ((tempy==uid.xaxis->text()) && (!tempyolda.isEmpty())) { - if (yvalue[i + 1] != '^') { - tempyval = tempyval + dnum; - } -@@ -611,7 +606,7 @@ void titrationCalculator::on_actionOpen_triggered() - if (tmpchr != '|') { - tempyval = tempyval + tmpchr; - } else { -- if ((tablea == 1) and (tempyval != QString("table1")) and (tempyval != QString("table2")) and (tempyval != QString("xaxis")) and (tempyval != QString("yaxis")) and (tempyval != QString("note"))) { -+ if ((tablea == 1) && (tempyval != QString("table1")) && (tempyval != QString("table2")) && (tempyval != QString("xaxis")) && (tempyval != QString("yaxis")) && (tempyval != QString("note"))) { - if ((i % 2) != 0) { - QTableWidgetItem *titemo = uid.tableWidget->item((i - 1) / 2, 1); - if (titemo) { -@@ -626,7 +621,7 @@ void titrationCalculator::on_actionOpen_triggered() - ++i; - } - -- if ((tableb == 1) and (tempyval != QString("table1")) and (tempyval != QString("table2")) and (tempyval != QString("xaxis")) and (tempyval != QString("yaxis")) and (tempyval != QString("note"))) { -+ if ((tableb == 1) && (tempyval != QString("table1")) && (tempyval != QString("table2")) && (tempyval != QString("xaxis")) && (tempyval != QString("yaxis")) && (tempyval != QString("note"))) { - if ((i % 2) != 0) { - QTableWidgetItem *titemo = uid.tableWidget_2->item((i - 1) / 2, 1); - if (titemo) { -@@ -641,13 +636,13 @@ void titrationCalculator::on_actionOpen_triggered() - } - ++i; - } -- if ((xax == 1) and (tempyval != QString("table1")) and (tempyval != QString("table2")) and (tempyval != QString("xaxis")) and (tempyval != QString("yaxis")) and (tempyval != QString("note"))) { -+ if ((xax == 1) && (tempyval != QString("table1")) && (tempyval != QString("table2")) && (tempyval != QString("xaxis")) && (tempyval != QString("yaxis")) && (tempyval != QString("note"))) { - uid.xaxis->setText(tempyval); - } -- if ((yax == 1) and (tempyval != QString("table1")) and (tempyval != QString("table2")) and (tempyval != QString("xaxis")) and (tempyval != QString("yaxis")) and (tempyval != QString("note"))) { -+ if ((yax == 1) && (tempyval != QString("table1")) && (tempyval != QString("table2")) && (tempyval != QString("xaxis")) && (tempyval != QString("yaxis")) && (tempyval != QString("note"))) { - uid.yaxis->setText(tempyval); - } -- if ((notea == 1) and (tempyval != QString("table1")) and (tempyval != QString("table2")) and (tempyval != QString("xaxis")) and (tempyval != QString("yaxis")) and (tempyval != QString("note"))) { -+ if ((notea == 1) && (tempyval != QString("table1")) && (tempyval != QString("table2")) && (tempyval != QString("xaxis")) && (tempyval != QString("yaxis")) && (tempyval != QString("note"))) { - uid.note->setText(tempyval); - } - --- -cgit v0.11.2 - - diff --git a/kde/patch/kate.patch b/kde/patch/kate.patch index 45c2f53..59df062 100644 --- a/kde/patch/kate.patch +++ b/kde/patch/kate.patch @@ -1,8 +1,3 @@ -# Last-minute fixes for opening and closing files: -# Should be fixed after 15.12.0. -#cat $CWD/patch/kate/kate-15.12.0.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - # Allow Kate to be started by the root user; disallowing this is not # a decision that a developer should make for the user, it is patronizing: cat $CWD/patch/kate/kate_runasroot.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kate/kate-15.12.0.patch b/kde/patch/kate/kate-15.12.0.patch deleted file mode 100644 index 25067f4..0000000 --- a/kde/patch/kate/kate-15.12.0.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Michal Humpula -Date: Sun, 29 Nov 2015 10:24:42 +0000 -Subject: fix opening new files trough dbus -X-Git-Url: http://quickgit.kde.org/?p=kate.git&a=commitdiff&h=d61b121264d7b43d41c1c6417a18bbfb9078eb9d ---- -fix opening new files trough dbus - -REVIEW: 126197 ---- - - ---- a/urlinfo.h -+++ b/urlinfo.h -@@ -33,7 +33,7 @@ - : cursor(KTextEditor::Cursor::invalid()) - { - // convert to an url -- const QRegularExpression withProtocol(QStringLiteral("^[a-zA-Z]+:")); // TODO: remove after Qt supports this on its own -+ const QRegularExpression withProtocol(QStringLiteral("^[a-zA-Z]+://")); // TODO: remove after Qt supports this on its own - if (withProtocol.match(path).hasMatch()) { - url = QUrl::fromUserInput(path); - } else { -@@ -50,7 +50,7 @@ - int line = match.captured(1).toInt() - 1; - // don't use an invalid column when the line is valid - int column = qMax(0, match.captured(2).toInt() - 1); -- url = QUrl::fromLocalFile(path); -+ url = QUrl::fromLocalFile(QDir::current().absoluteFilePath(path)); - cursor = {line, column}; - } - } diff --git a/kde/patch/kcalc.patch b/kde/patch/kcalc.patch deleted file mode 100644 index 8cc3873..0000000 --- a/kde/patch/kcalc.patch +++ /dev/null @@ -1,5 +0,0 @@ -# Fix issue where kcalc has a zero-sized window and appears not to start, -# in combination with Qt 5.6. -# Should be fixed after 16.04.0. -#cat $CWD/patch/kcalc/kcalc-kdebug_360105.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kcalc/kcalc-kdebug_360105.patch b/kde/patch/kcalc/kcalc-kdebug_360105.patch deleted file mode 100644 index a2ff272..0000000 --- a/kde/patch/kcalc/kcalc-kdebug_360105.patch +++ /dev/null @@ -1,15 +0,0 @@ -Fix issue where kcalc has a zero-sized window and appears not to start. - -Patch-by: Rex Dieter -Gentoo-bug: 577782 -KDE-bug: 360105 - ---- a/kcalc.cpp -+++ b/kcalc.cpp -@@ -124,5 +124,5 @@ KCalculator::KCalculator(QWidget *parent - updateGeometry(); - -- setFixedSize(minimumSize()); -+ if ( ! minimumSize().isEmpty() ) setFixedSize(minimumSize()); - - updateDisplay(UPDATE_FROM_CORE); diff --git a/kde/patch/kcalcore.patch b/kde/patch/kcalcore.patch deleted file mode 100644 index 051150d..0000000 --- a/kde/patch/kcalcore.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Fix compile error against new libical 3: -# Fixed in Applications 17.12.0: -#cat $CWD/patch/kcalcore/kcalcore_libical3.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kcalcore/kcalcore_libical3.patch b/kde/patch/kcalcore/kcalcore_libical3.patch deleted file mode 100644 index 0a5155f..0000000 --- a/kde/patch/kcalcore/kcalcore_libical3.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 27eaa211b23a6bb0bcba5a91cf7cadfc1e888e21 Mon Sep 17 00:00:00 2001 -From: Allen Winter -Date: Fri, 6 Oct 2017 10:39:20 -0400 -Subject: icalformat_p.cpp, icaltimezones.cpp - follow API changes in libical3 - ---- - src/icalformat_p.cpp | 11 ++++++----- - src/icaltimezones.cpp | 10 ++++------ - 2 files changed, 10 insertions(+), 11 deletions(-) - -diff --git a/src/icalformat_p.cpp b/src/icalformat_p.cpp -index bd1d8a3..c2e4548 100644 ---- a/src/icalformat_p.cpp -+++ b/src/icalformat_p.cpp -@@ -2355,7 +2355,6 @@ icaltimetype ICalFormatImpl::writeICalDate(const QDate &date) - t.second = 0; - - t.is_date = 1; -- t.is_utc = 0; - t.zone = nullptr; - - return t; -@@ -2377,7 +2376,9 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const QDateTime &datetime, bool d - t.second = datetime.time().second(); - } - t.zone = nullptr; // zone is NOT set -- t.is_utc = datetime.isUtc() ? 1 : 0; -+ if ( datetime.isUtc() ) { -+ t = icaltime_convert_to_zone(t, icaltimezone_get_utc_timezone()); -+ } - - // _dumpIcaltime( t ); - -@@ -2450,7 +2452,7 @@ icalproperty *ICalFormatImpl::writeICalDateTimeProperty(const icalproperty_kind - } - - KTimeZone ktz; -- if (!t.is_utc) { -+ if (!icaltime_is_utc(t)) { - ktz = dt.timeZone(); - } - -@@ -2483,7 +2484,7 @@ QDateTime ICalFormatImpl::readICalDateTime(icalproperty *p, const icaltimetype & - // _dumpIcaltime( t ); - - KDateTime::Spec timeSpec; -- if (t.is_utc || t.zone == icaltimezone_get_utc_timezone()) { -+ if (icaltime_is_utc(t) || t.zone == icaltimezone_get_utc_timezone()) { - timeSpec = KDateTime::UTC; // the time zone is UTC - utc = false; // no need to convert to UTC - } else { -diff --git a/src/icaltimezones.cpp b/src/icaltimezones.cpp -index 2f6d42f..f8f8d5d 100644 ---- a/src/icaltimezones.cpp -+++ b/src/icaltimezones.cpp -@@ -54,7 +54,7 @@ static QDateTime toQDateTime(const icaltimetype &t) - { - return QDateTime(QDate(t.year, t.month, t.day), - QTime(t.hour, t.minute, t.second), -- (t.is_utc ? Qt::UTC : Qt::LocalTime)); -+ (icaltime_is_utc(t) ? Qt::UTC : Qt::LocalTime)); - } - - // Maximum date for time zone data. -@@ -81,7 +81,6 @@ static icaltimetype writeLocalICalDateTime(const QDateTime &utc, int offset) - t.second = local.time().second(); - t.is_date = 0; - t.zone = nullptr; -- t.is_utc = 0; - return t; - } - -@@ -888,7 +887,7 @@ - } - case ICAL_LASTMODIFIED_PROPERTY: { - const icaltimetype t = icalproperty_get_lastmodified(p); -- if (t.is_utc) { -+ if (icaltime_is_utc(t)) { - data->d->lastModified = toQDateTime(t); - } else { - qCDebug(KCALCORE_LOG) << "LAST-MODIFIED not UTC"; -@@ -1261,7 +1260,7 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, ICalTimeZonePhase &phase) - // Convert DTSTART to QDateTime, and from local time to UTC - const QDateTime localStart = toQDateTime(dtstart); // local time - dtstart.second -= prevOffset; -- dtstart.is_utc = 1; -+ dtstart = icaltime_convert_to_zone(dtstart, icaltimezone_get_utc_timezone()); - const QDateTime utcStart = toQDateTime(icaltime_normalize(dtstart)); // UTC - - transitions += utcStart; -@@ -1286,13 +1285,12 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, ICalTimeZonePhase &phase) - t.minute = dtstart.minute; - t.second = dtstart.second; - t.is_date = 0; -- t.is_utc = 0; // dtstart is in local time - } - // RFC2445 states that RDATE must be in local time, - // but we support UTC as well to be safe. -- if (!t.is_utc) { -+ if (!icaltime_is_utc(t)) { - t.second -= prevOffset; // convert to UTC -- t.is_utc = 1; -+ t = icaltime_convert_to_zone(t, icaltimezone_get_utc_timezone()); - t = icaltime_normalize(t); - } - transitions += toQDateTime(t); --- -cgit v0.11.2 - diff --git a/kde/patch/kcoreaddons.patch b/kde/patch/kcoreaddons.patch deleted file mode 100644 index 5cd190c..0000000 --- a/kde/patch/kcoreaddons.patch +++ /dev/null @@ -1,5 +0,0 @@ -# KDEBUG #362161 (fixed in Frameworks 5.22.0): -# Fixes regression introduced in 9ae6d765b37135bbfe3a8b936e5a88b8a435e424 -# Since the rand() was not seeded, the numbers generated were predictable. -#cat $CWD/patch/kcoreaddons/kcoreaddons.kdebug_362161.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kcoreaddons/kcoreaddons.kdebug_362161.patch b/kde/patch/kcoreaddons/kcoreaddons.kdebug_362161.patch deleted file mode 100644 index 31bbcf7..0000000 --- a/kde/patch/kcoreaddons/kcoreaddons.kdebug_362161.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Albert Astals Cid -Date: Tue, 26 Apr 2016 21:41:27 +0000 -Subject: Missing rand() -> qrand -X-Git-Url: http://quickgit.kde.org/?p=kcoreaddons.git&a=commitdiff&h=78212436643af95779facd9593c82fb149c2213d ---- -Missing rand() -> qrand - -Fixes regression introduced in 9ae6d765b37135bbfe3a8b936e5a88b8a435e424 - -Reviewed by Aleix - -BUGS: 362161 ---- - - ---- a/src/lib/randomness/krandom.cpp -+++ b/src/lib/randomness/krandom.cpp -@@ -51,7 +51,7 @@ - } - qsrand(seed); - } -- return rand(); -+ return qrand(); - } - - QString KRandom::randomString(int length) - diff --git a/kde/patch/kde-baseapps.patch b/kde/patch/kde-baseapps.patch deleted file mode 100644 index 988504d..0000000 --- a/kde/patch/kde-baseapps.patch +++ /dev/null @@ -1,5 +0,0 @@ -# Fix for bug https://bugs.kde.org/show_bug.cgi?id=327224 -# "Regression: Dolphin doesn't accept URLs containing a kio-slave as parameter" -# Fixed in KDE 4.11.4. -#cat $CWD/patch/kde-baseapps/dolphin_kdebug_327224.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kde-baseapps/dolphin_kdebug_327224.patch b/kde/patch/kde-baseapps/dolphin_kdebug_327224.patch deleted file mode 100644 index 8210d87..0000000 --- a/kde/patch/kde-baseapps/dolphin_kdebug_327224.patch +++ /dev/null @@ -1,57 +0,0 @@ -Revert "Files passed as arguments: Ignore unsupported files" - -This reverts commit cd9e50ae4f3ded5a78d0cfb09a67684a9c15d726. - -See bug#327224 for details. - ---- a/dolphin/src/dolphinmainwindow.cpp -+++ b/dolphin/src/dolphinmainwindow.cpp -@@ -31,7 +31,6 @@ - #include "panels/information/informationpanel.h" - #include "settings/dolphinsettingsdialog.h" - #include "statusbar/dolphinstatusbar.h" --#include "views/dolphinview.h" - #include "views/dolphinviewactionhandler.h" - #include "views/dolphinremoteencoding.h" - #include "views/draganddrophelper.h" -@@ -244,20 +243,8 @@ - return; - } - -- // dirs could contain URLs that actually point to archives or other files. -- // Replace them by URLs we can open where possible and filter the rest out. -- QList urlsToOpen; -- foreach (const KUrl& rawUrl, dirs) { -- const KFileItem& item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, rawUrl); -- item.determineMimeType(); -- const KUrl& url = DolphinView::openItemAsFolderUrl(item); -- if (!url.isEmpty()) { -- urlsToOpen.append(url); -- } -- } -- -- if (urlsToOpen.count() == 1) { -- m_activeViewContainer->setUrl(urlsToOpen.first()); -+ if (dirs.count() == 1) { -+ m_activeViewContainer->setUrl(dirs.first()); - return; - } - -@@ -267,12 +254,12 @@ - - // Open each directory inside a new tab. If the "split view" option has been enabled, - // always show two directories within one tab. -- QList::const_iterator it = urlsToOpen.begin(); -- while (it != urlsToOpen.end()) { -+ QList::const_iterator it = dirs.begin(); -+ while (it != dirs.end()) { - openNewTab(*it); - ++it; - -- if (hasSplitView && (it != urlsToOpen.end())) { -+ if (hasSplitView && (it != dirs.end())) { - const int tabIndex = m_viewTab.count() - 1; - m_viewTab[tabIndex].secondaryView->setUrl(*it); - ++it; - - diff --git a/kde/patch/kde-cli-tools.patch b/kde/patch/kde-cli-tools.patch deleted file mode 100644 index a76227d..0000000 --- a/kde/patch/kde-cli-tools.patch +++ /dev/null @@ -1,6 +0,0 @@ -# Remove CONFIG argument from find_package(KF5); -# This is no longer wanted, since ECM has a FindKF5 module. -#cat $CWD/patch/kde-cli-tools/kde-cli-tools_ecm.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Adjust for the change in KAboutData: -#cat $CWD/patch/kde-cli-tools/kde-cli-tools_kaboutdata.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } diff --git a/kde/patch/kde-cli-tools/kde-cli-tools_ecm.patch b/kde/patch/kde-cli-tools/kde-cli-tools_ecm.patch deleted file mode 100644 index 1ff1f84..0000000 --- a/kde/patch/kde-cli-tools/kde-cli-tools_ecm.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- kde-cli-tools-20140602git/CMakeLists.txt.orig 2014-06-02 13:45:49.000000000 +0200 -+++ kde-cli-tools-20140602git/CMakeLists.txt 2014-06-02 23:45:22.337682384 +0200 -@@ -21,7 +21,7 @@ - Test - ) - --find_package(KF5 CONFIG REQUIRED COMPONENTS -+find_package(KF5 REQUIRED COMPONENTS - Config - Init - KCMUtils diff --git a/kde/patch/kde-cli-tools/kde-cli-tools_kaboutdata.diff b/kde/patch/kde-cli-tools/kde-cli-tools_kaboutdata.diff deleted file mode 100644 index e88a512..0000000 --- a/kde/patch/kde-cli-tools/kde-cli-tools_kaboutdata.diff +++ /dev/null @@ -1,59 +0,0 @@ -diff -uar kde-cli-tools-20140602git.orig/kdesu/kdesu.cpp kde-cli-tools-20140602git/kdesu/kdesu.cpp ---- kde-cli-tools-20140602git.orig/kdesu/kdesu.cpp 2014-06-02 13:45:49.000000000 +0200 -+++ kde-cli-tools-20140602git/kdesu/kdesu.cpp 2014-06-03 00:41:16.998697492 +0200 -@@ -81,9 +81,9 @@ - if (duser.isEmpty()) - duser = "root"; - -- KAboutData aboutData("kdesu", 0, i18n("KDE su"), -+ KAboutData aboutData("kdesu", i18n("KDE su"), - Version, i18n("Runs a program with elevated privileges."), -- KAboutData::License_Artistic, -+ KAboutLicense::Artistic, - i18n("Copyright (c) 1998-2000 Geert Jansen, Pietro Iglio")); - aboutData.addAuthor(i18n("Geert Jansen"), i18n("Maintainer"), - "jansen@kde.org", "http://www.stack.nl/~geertj/"); -diff -uar kde-cli-tools-20140602git.orig/kioclient/kioclient.cpp kde-cli-tools-20140602git/kioclient/kioclient.cpp ---- kde-cli-tools-20140602git.orig/kioclient/kioclient.cpp 2014-06-02 13:45:49.000000000 +0200 -+++ kde-cli-tools-20140602git/kioclient/kioclient.cpp 2014-06-03 00:41:50.446696159 +0200 -@@ -133,7 +133,7 @@ - QString programName = i18n("KIO Client"); - QString description = i18n("Command-line tool for network-transparent operations"); - QString version = "2.0"; -- KAboutData data(appName, appName, programName, version, description, KAboutData::License_LGPL_V2); -+ KAboutData data(appName, programName, version, description, KAboutLicense::LGPL_V2); - - QCommandLineParser parser; - parser.addOption(QCommandLineOption("noninteractive", i18n("Non-interactive use: no message boxes. If you don't want a" -diff -uar kde-cli-tools-20140602git.orig/kreadconfig/kreadconfig.cpp kde-cli-tools-20140602git/kreadconfig/kreadconfig.cpp ---- kde-cli-tools-20140602git.orig/kreadconfig/kreadconfig.cpp 2014-06-02 13:45:49.000000000 +0200 -+++ kde-cli-tools-20140602git/kreadconfig/kreadconfig.cpp 2014-06-03 00:40:33.820702023 +0200 -@@ -53,10 +53,10 @@ - int main(int argc, char **argv) - { - QCoreApplication app(argc, argv); -- KAboutData aboutData("kreadconfig", 0, i18n("KReadConfig"), -+ KAboutData aboutData("kreadconfig", i18n("KReadConfig"), - "1.0.1", - i18n("Read KConfig entries - for use in shell scripts"), -- KAboutData::License_GPL, -+ KAboutLicense::GPL, - i18n("(c) 2001 Red Hat, Inc.")); - aboutData.addAuthor(i18n("Bernhard Rosenkraenzer"), QString(), "bero@redhat.com"); - -diff -uar kde-cli-tools-20140602git.orig/kreadconfig/kwriteconfig.cpp kde-cli-tools-20140602git/kreadconfig/kwriteconfig.cpp ---- kde-cli-tools-20140602git.orig/kreadconfig/kwriteconfig.cpp 2014-06-02 13:45:49.000000000 +0200 -+++ kde-cli-tools-20140602git/kreadconfig/kwriteconfig.cpp 2014-06-03 00:39:54.811701204 +0200 -@@ -31,10 +31,10 @@ - int main(int argc, char **argv) - { - QCoreApplication app(argc, argv); -- KAboutData aboutData("kwriteconfig", 0, i18n("KWriteConfig"), -+ KAboutData aboutData("kwriteconfig", i18n("KWriteConfig"), - "1.0.0", - i18n("Write KConfig entries - for use in shell scripts"), -- KAboutData::License_GPL, -+ KAboutLicense::GPL, - i18n("(c) 2001 Red Hat, Inc. & Luís Pedro Coelho")); - aboutData.addAuthor("Luís Pedro Coelho", QString(), "luis_pedro@netcabo.pt"); - aboutData.addAuthor("Bernhard Rosenkraenzer", i18n("Wrote kreadconfig on which this is based"), "bero@redhat.com"); diff --git a/kde/patch/kde-dev-utils.patch b/kde/patch/kde-dev-utils.patch deleted file mode 100644 index c5cbc92..0000000 --- a/kde/patch/kde-dev-utils.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix build against KF 5.48.0 (only relevant for 18.04.3): -#cat $CWD/patch/kde-dev-utils/build_with_kf548.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kde-dev-utils/build_with_kf548.patch b/kde/patch/kde-dev-utils/build_with_kf548.patch deleted file mode 100644 index e75838d..0000000 --- a/kde/patch/kde-dev-utils/build_with_kf548.patch +++ /dev/null @@ -1,156 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 369699a..00e1413 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,15 +1,18 @@ - cmake_minimum_required(VERSION 2.8.12) - - find_package(ECM 5.14 REQUIRED NO_MODULE) - set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) - - include(FeatureSummary) - include(ECMInstallIcons) - include(KDEInstallDirs) - include(KDECMakeSettings) - include(KDECompilerSettings NO_POLICY_SCOPE) - include(ECMQtDeclareLoggingCategory) - -+# Required for ki18n_install(po) added on tarball generation -+find_package(KF5 REQUIRED COMPONENTS I18n) -+ - add_subdirectory(kpartloader) - add_subdirectory(kuiviewer) - ki18n_install(po) -diff --git a/kpartloader/CMakeLists.txt b/kpartloader/CMakeLists.txt -index 4e54d94..1fe4136 100644 ---- a/kpartloader/CMakeLists.txt -+++ b/kpartloader/CMakeLists.txt -@@ -1,27 +1,26 @@ - project(kpartloader) - ########### kpartloader ############### - - set(QT_MIN_VERSION "5.5.0") - - find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE - COMPONENTS - Core - ) - - find_package(KF5 REQUIRED - COMPONENTS - CoreAddons -- I18n - Parts - WidgetsAddons - ) - - set(kpartloader_SRCS - kpartloader.cpp - ) - - add_executable(kpartloader ${kpartloader_SRCS}) - target_link_libraries(kpartloader KF5::Parts) - install(TARGETS kpartloader ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) - install(FILES kpartloaderui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kpartloader) - -diff --git a/kuiviewer/CMakeLists.txt b/kuiviewer/CMakeLists.txt -index fa72c59..3fe987e 100644 ---- a/kuiviewer/CMakeLists.txt -+++ b/kuiviewer/CMakeLists.txt -@@ -1,96 +1,95 @@ - project(kuiviewer) - - set(QT_MIN_VERSION "5.5.0") - - include(ECMAddAppIcon) - - find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE - COMPONENTS - Core - Designer - UiTools - ) - - find_package(KF5 REQUIRED - COMPONENTS - CoreAddons - KIO -- I18n - Parts - ) - - add_definitions( - -DQT_DEPRECATED_WARNINGS - -DQT_DISABLE_DEPRECATED_BEFORE=0x050500 - -DQT_NO_SIGNALS_SLOTS_KEYWORDS - -DQT_STRICT_ITERATORS - -DQT_USE_QSTRINGBUILDER - -DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_ASCII - -DQT_NO_CAST_FROM_BYTEARRAY - -DQT_NO_URL_CAST_FROM_STRING - ) - - ########### next target ############### - - set(kuiviewer_SRCS main.cpp kuiviewer.cpp ) - - file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-kuiviewer.png") - ecm_add_app_icon(kuiviewer_SRCS ICONS ${ICONS_SRCS}) - - add_executable(kuiviewer ${kuiviewer_SRCS}) - - target_link_libraries(kuiviewer KF5::Parts ) - - install(TARGETS kuiviewer ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} ) - - - ########### next target ############### - - set(kuiviewerpart_PART_SRCS kuiviewer_part.cpp ) - - ecm_qt_declare_logging_category(kuiviewerpart_PART_SRCS - HEADER kuiviewer_part_debug.h - IDENTIFIER KUIVIEWERPART - CATEGORY_NAME "kuiviewerpart" - ) - - add_library(kuiviewerpart MODULE ${kuiviewerpart_PART_SRCS}) - - target_link_libraries(kuiviewerpart KF5::Parts Qt5::Designer Qt5::UiTools) - - install(TARGETS kuiviewerpart DESTINATION ${KDE_INSTALL_PLUGINDIR} ) - - - ########### next target ############### - - set(quithumbnail_PART_SRCS quicreator.cpp ) - - add_library(quithumbnail MODULE ${quithumbnail_PART_SRCS}) - - target_link_libraries(quithumbnail - KF5::KIOWidgets - Qt5::Designer - Qt5::UiTools - ) - - install(TARGETS quithumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR} ) - - - ########### install files ############### - - install( PROGRAMS org.kde.kuiviewer.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) - install( FILES designerthumbnail.desktop kuiviewer_part.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) - install( FILES kuiviewer_part.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kuiviewerpart ) - install( FILES kuiviewerui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kuiviewer ) - - ecm_install_icons(ICONS - 16-apps-kuiviewer.png - 32-apps-kuiviewer.png - 48-apps-kuiviewer.png - 64-apps-kuiviewer.png - 128-apps-kuiviewer.png - sc-apps-kuiviewer.svg - DESTINATION ${KDE_INSTALL_ICONDIR} - THEME hicolor - ) diff --git a/kde/patch/kde-gtk-config.patch b/kde/patch/kde-gtk-config.patch deleted file mode 100644 index a62e649..0000000 --- a/kde/patch/kde-gtk-config.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Make the kde-gtk-config load the current config first: -# Fixed in 5.11.2 -#cat $CWD/patch/kde-gtk-config/kde-gtk-config_loadcurrentsettings.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kde-gtk-config/kde-gtk-config_loadcurrentsettings.patch b/kde/patch/kde-gtk-config/kde-gtk-config_loadcurrentsettings.patch deleted file mode 100644 index b5b074d..0000000 --- a/kde/patch/kde-gtk-config/kde-gtk-config_loadcurrentsettings.patch +++ /dev/null @@ -1,622 +0,0 @@ -From 0d0f812a1704c62c014bc87162b1280224b64f93 Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -Date: Tue, 24 Oct 2017 13:25:32 +0200 -Subject: Revert "Make the kde-gtk-config kcm better at checking global gtk - settings" - -Summary: -This reverts commit 34357f74ee2d98128ff423b0ec6ddcbf4232c475. - -Reverting this fixes loading of the actually used GTK settings. - -BUG: 382291 - -Test Plan: -Opened kcmshell5 kde-gtk-config with and without this revert. -Without, it shows Adwaita as theme, with it shows breeze. -GTK uses breeze, so the behaviour with the revert is correct. - -Reviewers: #plasma, apol - -Subscribers: plasma-devel - -Tags: #plasma - -Differential Revision: https://phabricator.kde.org/D8443 ---- - CMakeLists.txt | 2 +- - src/abstractappearance.h | 5 +- - src/appearancegtk2.cpp | 103 +++++++++++++--------------------- - src/appearancegtk2.h | 11 +--- - src/appearancegtk3.cpp | 143 +++++++++++++++++++++-------------------------- - src/appearancegtk3.h | 10 +--- - src/appearencegtk.cpp | 4 +- - tests/CMakeLists.txt | 2 +- - tests/configsavetest.cpp | 75 ++++++++++--------------- - tests/configsavetest.h | 8 +-- - 10 files changed, 144 insertions(+), 219 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 181cfc9..bf1ba29 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -51,7 +51,7 @@ ki18n_wrap_ui(kcm_SRCS - ) - add_library(kcm_kdegtkconfig MODULE ${kcm_SRCS}) - target_compile_definitions(kcm_kdegtkconfig PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") --target_link_libraries(kcm_kdegtkconfig ${X11_Xcursor_LIB} KF5::ConfigCore KF5::I18n KF5::KIOWidgets KF5::NewStuff KF5::Archive KF5::NewStuff KF5::ConfigWidgets KF5::IconThemes) -+target_link_libraries(kcm_kdegtkconfig ${X11_Xcursor_LIB} KF5::I18n KF5::KIOWidgets KF5::NewStuff KF5::Archive KF5::NewStuff KF5::ConfigWidgets KF5::IconThemes) - - kcoreaddons_desktop_to_json(kcm_kdegtkconfig kde-gtk-config.desktop) - -diff --git a/src/abstractappearance.h b/src/abstractappearance.h -index 208342e..2961a09 100644 ---- a/src/abstractappearance.h -+++ b/src/abstractappearance.h -@@ -30,11 +30,10 @@ class AbstractAppearance - { - public: - virtual ~AbstractAppearance() {} -- virtual bool loadSettings() = 0; -- virtual bool saveSettings() const = 0; -+ virtual QString defaultConfigFile() const = 0; - virtual bool loadSettings(const QString& path) = 0; - virtual bool saveSettings(const QString& path) const = 0; -- -+ - /** @returns the installed themes' paths*/ - virtual QStringList installedThemes() const = 0; - -diff --git a/src/appearancegtk2.cpp b/src/appearancegtk2.cpp -index 92cbee3..44a2239 100644 ---- a/src/appearancegtk2.cpp -+++ b/src/appearancegtk2.cpp -@@ -30,38 +30,48 @@ - #include - #include - --bool AppearanceGTK2::loadSettingsPrivate(const QString& path) -+bool AppearanceGTK2::loadSettings(const QString& path) - { - QFile configFile(path); - -- if (!configFile.open(QIODevice::ReadOnly | QIODevice::Text)) -- return false; -+ bool canRead = configFile.open(QIODevice::ReadOnly | QIODevice::Text); - -- const QMap foundSettings = readSettingsTuples(&configFile); -- -- for(auto it = foundSettings.constBegin(), itEnd = foundSettings.constEnd(); it!=itEnd; ++it) { -- if (it.key() == "gtk-theme-name") -- m_settings["theme"] = *it; -- else if (it.key() == "gtk-icon-theme-name") -- m_settings["icon"] = *it; -- else if (it.key() == "gtk-fallback-icon-theme") -- m_settings["icon_fallback"] = *it; -- else if (it.key() == "gtk-cursor-theme-name") -- m_settings["cursor"] = *it; -- else if (it.key() == "gtk-font-name") -- m_settings["font"] = *it; -- else if (it.key() == "gtk-toolbar-style") -- m_settings["toolbar_style"] = *it; -- else if (it.key() == "gtk-button-images") -- m_settings["show_icons_buttons"] = *it; -- else if(it.key() == "gtk-menu-images") -- m_settings["show_icons_menus"] = *it; -- else if (it.key() == "gtk-primary-button-warps-slider") -- m_settings["primary_button_warps_slider"] = *it; -- else -- qWarning() << "unknown field" << it.key(); -+ if(canRead) { -+// qDebug() << "The gtk2 config file exists..."; -+ const QMap foundSettings = readSettingsTuples(&configFile); -+ m_settings = QMap { -+ {"toolbar_style", "GTK_TOOLBAR_ICONS"}, -+ {"show_icons_buttons", "0"}, -+ {"show_icons_menus", "0"}, -+ {"primary_button_warps_slider", "false"} -+ }; -+ -+ for(auto it = foundSettings.constBegin(), itEnd = foundSettings.constEnd(); it!=itEnd; ++it) { -+ if (it.key() == "gtk-theme-name") -+ m_settings["theme"] = *it; -+ else if (it.key() == "gtk-icon-theme-name") -+ m_settings["icon"] = *it; -+ else if (it.key() == "gtk-fallback-icon-theme") -+ m_settings["icon_fallback"] = *it; -+ else if (it.key() == "gtk-cursor-theme-name") -+ m_settings["cursor"] = *it; -+ else if (it.key() == "gtk-font-name") -+ m_settings["font"] = *it; -+ else if (it.key() == "gtk-toolbar-style") -+ m_settings["toolbar_style"] = *it; -+ else if (it.key() == "gtk-button-images") -+ m_settings["show_icons_buttons"] = *it; -+ else if(it.key() == "gtk-menu-images") -+ m_settings["show_icons_menus"] = *it; -+ else if (it.key() == "gtk-primary-button-warps-slider") -+ m_settings["primary_button_warps_slider"] = *it; -+ else -+ qWarning() << "unknown field" << it.key(); -+ } -+ - } -- return true; -+ -+ return canRead; - } - - QString AppearanceGTK2::themesGtkrcFile(const QString& themeName) const -@@ -82,7 +92,7 @@ QString AppearanceGTK2::themesGtkrcFile(const QString& themeName) const - return QString(); - } - --bool AppearanceGTK2::saveSettingsPrivate(const QString& gtkrcFile) const -+bool AppearanceGTK2::saveSettings(const QString& gtkrcFile) const - { - QFile gtkrc(gtkrcFile); - gtkrc.remove(); -@@ -107,14 +117,14 @@ bool AppearanceGTK2::saveSettingsPrivate(const QString& gtkrcFile) const - flow << "include \"/etc/gtk-2.0/gtkrc\"\n"; //We include the /etc's config file - - int nameEnd = m_settings["font"].lastIndexOf(QRegExp(" ([0-9]+|bold|italic)")); -- const auto fontFamily = m_settings["font"].leftRef(nameEnd); -+ QString fontFamily = m_settings["font"].left(nameEnd); - - //TODO: is this really needed? - flow << "style \"user-font\" \n" - << "{\n" - << "\tfont_name=\""<< fontFamily << "\"\n" - << "}\n"; -- -+ - flow << "widget_class \"*\" style \"user-font\"\n"; - flow << "gtk-font-name=\"" << m_settings["font"] << "\"\n"; - flow << "gtk-theme-name=\"" << m_settings["theme"] << "\"\n"; -@@ -144,16 +154,6 @@ bool AppearanceGTK2::saveSettingsPrivate(const QString& gtkrcFile) const - return true; - } - --void AppearanceGTK2::reset() --{ -- m_settings = QMap { -- {"toolbar_style", "GTK_TOOLBAR_ICONS"}, -- {"show_icons_buttons", "0"}, -- {"show_icons_menus", "0"}, -- {"primary_button_warps_slider", "false"} -- }; --} -- - QString AppearanceGTK2::defaultConfigFile() const - { - return QDir::homePath()+"/.gtkrc-2.0"; -@@ -183,26 +183,3 @@ QStringList AppearanceGTK2::installedThemes() const - - return paths; - } -- --bool AppearanceGTK2::loadSettings() --{ -- reset(); -- -- return loadSettingsPrivate("/etc/gtk-2.0/gtkrc") && loadSettingsPrivate(defaultConfigFile()); --} -- --bool AppearanceGTK2::saveSettings() const --{ -- return saveSettings(defaultConfigFile()); --} -- --bool AppearanceGTK2::loadSettings(const QString& gtkrcFile) --{ -- reset(); -- return loadSettingsPrivate(gtkrcFile); --} -- --bool AppearanceGTK2::saveSettings(const QString& gtkrcFile) const --{ -- return saveSettingsPrivate(gtkrcFile); --} -diff --git a/src/appearancegtk2.h b/src/appearancegtk2.h -index 7df49bf..8bc28ee 100644 ---- a/src/appearancegtk2.h -+++ b/src/appearancegtk2.h -@@ -29,17 +29,10 @@ class AppearanceGTK2 : public AbstractAppearance - { - bool loadSettings(const QString& path) override; - bool saveSettings(const QString& path) const override; -- bool loadSettings() override; -- bool saveSettings() const override; -+ QString defaultConfigFile() const override; - QStringList installedThemes() const override; -- -+ - QString themesGtkrcFile(const QString& themeName) const; -- --private: -- void reset(); -- QString defaultConfigFile() const; -- bool loadSettingsPrivate(const QString& path); -- bool saveSettingsPrivate(const QString& path) const; - }; - - #endif // APPEARANCEGTK2_H -diff --git a/src/appearancegtk3.cpp b/src/appearancegtk3.cpp -index 7df48c3..fa1bde5 100644 ---- a/src/appearancegtk3.cpp -+++ b/src/appearancegtk3.cpp -@@ -25,8 +25,6 @@ - #include - #include - #include --#include --#include - - QStringList AppearanceGTK3::installedThemes() const - { -@@ -53,65 +51,76 @@ QStringList AppearanceGTK3::installedThemes() const - return themes; - } - --bool AppearanceGTK3::saveSettings(const KSharedConfig::Ptr& file) const --{ -- KConfigGroup group(file, "Settings"); -- -- group.writeEntry("gtk-font-name", m_settings["font"]); -- group.writeEntry("gtk-theme-name", m_settings["theme"]); -- group.writeEntry("gtk-icon-theme-name", m_settings["icon"]); -- group.writeEntry("gtk-fallback-icon-theme", m_settings["icon_fallback"]); -- group.writeEntry("gtk-cursor-theme-name", m_settings["cursor"]); -- group.writeEntry("gtk-toolbar-style", m_settings["toolbar_style"]); -- group.writeEntry("gtk-menu-images", m_settings["show_icons_menus"]); -- group.writeEntry("gtk-button-images", m_settings["show_icons_buttons"]); -- group.writeEntry("gtk-primary-button-warps-slider", m_settings["primary_button_warps_slider"]); -- group.writeEntry("gtk-application-prefer-dark-theme", m_settings["application_prefer_dark_theme"]); -- -- const bool sync = group.sync(); -- Q_ASSERT(sync); -- return true; --} -- --bool AppearanceGTK3::loadSettings(const KSharedConfig::Ptr& file) -+bool AppearanceGTK3::saveSettings(const QString& file) const - { -- KConfigGroup group(file, "Settings"); -- -- if (!file || !group.isValid()) { -- qWarning() << "Cannot open the GTK3 config file" << file; -+ //Opening GTK3 config file $ENV{XDG_CONFIG_HOME}/gtk-3.0/m_settings.ini -+ QDir::home().mkpath(file.left(file.lastIndexOf('/'))); //we make sure the path exists -+ QFile file_gtk3(file); -+ -+ if(!file_gtk3.open(QIODevice::WriteOnly | QIODevice::Text)) { -+ qWarning() << "Couldn't open GTK3 config file for writing at:" << file_gtk3.fileName(); - return false; - } -+ QTextStream flow3(&file_gtk3); -+ flow3 << "[Settings]\n"; -+ flow3 << "gtk-font-name=" << m_settings["font"] << "\n"; -+ flow3 << "gtk-theme-name=" << m_settings["theme"] << "\n"; -+ flow3 << "gtk-icon-theme-name="<< m_settings["icon"] << "\n"; -+ flow3 << "gtk-fallback-icon-theme=" << m_settings["icon_fallback"] << "\n"; -+ flow3 << "gtk-cursor-theme-name=" << m_settings["cursor"] << "\n"; -+ flow3 << "gtk-toolbar-style=" << m_settings["toolbar_style"] << "\n"; -+ flow3 << "gtk-menu-images=" << m_settings["show_icons_menus"] << "\n"; -+ flow3 << "gtk-button-images=" << m_settings["show_icons_buttons"] << "\n"; -+ flow3 << "gtk-primary-button-warps-slider=" << m_settings["primary_button_warps_slider"] << "\n"; -+ flow3 << "gtk-application-prefer-dark-theme=" << m_settings["application_prefer_dark_theme"] << "\n"; - -- m_settings = QMap { -- {"toolbar_style", "GTK_TOOLBAR_ICONS"}, -- {"show_icons_buttons", "0"}, -- {"show_icons_menus", "0"}, -- {"primary_button_warps_slider", "false"}, -- {"application_prefer_dark_theme", "false"} -- }; -- -- m_settings["theme"] = group.readEntry("gtk-theme-name"); -- m_settings["icon"] = group.readEntry("gtk-icon-theme-name"); -- m_settings["icon_fallback"] = group.readEntry("gtk-fallback-icon-theme"); -- m_settings["cursor"] = group.readEntry("gtk-cursor-theme-name"); -- m_settings["font"] = group.readEntry("gtk-font-name"); -- m_settings["toolbar_style"] = group.readEntry("gtk-toolbar-style"); -- m_settings["show_icons_buttons"] = group.readEntry("gtk-button-images"); -- m_settings["show_icons_menus"] = group.readEntry("gtk-menu-images"); -- m_settings["primary_button_warps_slider"] = group.readEntry("gtk-primary-button-warps-slider"); -- m_settings["application_prefer_dark_theme"] = group.readEntry("gtk-application-prefer-dark-theme"); -- for(auto it = m_settings.begin(); it != m_settings.end(); ) { -- if (it.value().isEmpty()) -- it = m_settings.erase(it); -- else -- ++it; -- } - return true; - } - --QString AppearanceGTK3::configFileName() const -+bool AppearanceGTK3::loadSettings(const QString& path) - { -- return QStringLiteral("gtk-3.0/settings.ini"); -+ QFile fileGtk3(path); -+ bool canRead=fileGtk3.open(QIODevice::ReadOnly | QIODevice::Text); -+ -+ if(canRead) { -+ const QMap foundSettings = readSettingsTuples(&fileGtk3); -+ -+ m_settings = QMap { -+ {"toolbar_style", "GTK_TOOLBAR_ICONS"}, -+ {"show_icons_buttons", "0"}, -+ {"show_icons_menus", "0"}, -+ {"primary_button_warps_slider", "false"}, -+ {"application_prefer_dark_theme", "false"} -+ }; -+ -+ for(auto it = foundSettings.constBegin(), itEnd = foundSettings.constEnd(); it!=itEnd; ++it) { -+ if (it.key() == "gtk-theme-name") -+ m_settings["theme"] = *it; -+ else if (it.key() == "gtk-icon-theme-name") -+ m_settings["icon"] = *it; -+ else if (it.key() == "gtk-fallback-icon-theme") -+ m_settings["icon_fallback"] = *it; -+ else if (it.key() == "gtk-cursor-theme-name") -+ m_settings["cursor"] = *it; -+ else if (it.key() == "gtk-font-name") -+ m_settings["font"] = *it; -+ else if (it.key() == "gtk-toolbar-style") -+ m_settings["toolbar_style"] = *it; -+ else if (it.key() == "gtk-button-images") -+ m_settings["show_icons_buttons"] = *it; -+ else if (it.key() == "gtk-menu-images") -+ m_settings["show_icons_menus"] = *it; -+ else if (it.key() == "gtk-primary-button-warps-slider") -+ m_settings["primary_button_warps_slider"] = *it; -+ else if (it.key() == "gtk-application-prefer-dark-theme") -+ m_settings["application_prefer_dark_theme"] = *it; -+ else -+ qWarning() << "unknown field" << it.key(); -+ } -+ } else -+ qWarning() << "Cannot open the GTK3 config file" << path; -+ -+ return canRead; - } - - QString AppearanceGTK3::defaultConfigFile() const -@@ -120,7 +129,7 @@ QString AppearanceGTK3::defaultConfigFile() const - if(root.isEmpty()) - root = QFileInfo(QDir::home(), ".config").absoluteFilePath(); - -- return root + '/' + configFileName(); -+ return root+"/gtk-3.0/settings.ini"; - } - - bool AppearanceGTK3::getApplicationPreferDarkTheme() const -@@ -132,29 +141,3 @@ void AppearanceGTK3::setApplicationPreferDarkTheme(const bool& enable) - { - m_settings["application_prefer_dark_theme"] = enable ? "true" : "false"; - } -- --bool AppearanceGTK3::saveSettings(const QString& file) const --{ -- auto cfg = KSharedConfig::openConfig(file); -- return saveSettings(cfg); --} -- --bool AppearanceGTK3::loadSettings(const QString& path) --{ -- auto cfg = KSharedConfig::openConfig(path); -- return loadSettings(cfg); --} -- --bool AppearanceGTK3::loadSettings() --{ -- auto cfg = KSharedConfig::openConfig(configFileName()); -- cfg->setReadDefaults(true); -- return loadSettings(cfg); --} -- --bool AppearanceGTK3::saveSettings() const --{ -- auto cfg = KSharedConfig::openConfig(configFileName()); -- cfg->setReadDefaults(true); -- return saveSettings(cfg); --} -diff --git a/src/appearancegtk3.h b/src/appearancegtk3.h -index 3ce5a05..d4562b1 100644 ---- a/src/appearancegtk3.h -+++ b/src/appearancegtk3.h -@@ -23,7 +23,6 @@ - #ifndef APPEARANCEGTK3_H - #define APPEARANCEGTK3_H - --#include - #include "abstractappearance.h" - - class AppearanceGTK3 : public AbstractAppearance -@@ -31,18 +30,11 @@ class AppearanceGTK3 : public AbstractAppearance - - public: - QStringList installedThemes() const override; -- bool saveSettings() const override; -- bool loadSettings() override; - bool saveSettings(const QString& file) const override; - bool loadSettings(const QString& path) override; -+ QString defaultConfigFile() const override; - bool getApplicationPreferDarkTheme() const; - void setApplicationPreferDarkTheme(const bool& enable); -- --private: -- QString defaultConfigFile() const; -- QString configFileName() const; -- bool saveSettings(const KSharedConfig::Ptr& file) const; -- bool loadSettings(const KSharedConfig::Ptr& file); - }; - - #endif // APPEARANCEGTK3_H -diff --git a/src/appearencegtk.cpp b/src/appearencegtk.cpp -index 95a6604..2e26a5a 100644 ---- a/src/appearencegtk.cpp -+++ b/src/appearencegtk.cpp -@@ -64,7 +64,7 @@ bool AppearenceGTK::loadFileConfig() - { - bool correct = false; - foreach(AbstractAppearance* app, m_app) { -- bool c = app->loadSettings(); -+ bool c = app->loadSettings(app->defaultConfigFile()); - correct = correct || c; - } - // qDebug() << "loading..." << correct; -@@ -75,7 +75,7 @@ bool AppearenceGTK::saveFileConfig() - { - bool correct = true; - foreach(AbstractAppearance* app, m_app) { -- bool c = app->saveSettings(); -+ bool c = app->saveSettings(app->defaultConfigFile()); - correct = correct && c; - } - // qDebug() << "saving..." << correct; -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 151725d..05bf8f1 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -2,7 +2,7 @@ macro(add_kgc_test name) - add_executable(${name} ${name}.cpp ${ARGV}) - add_test(${name} ${name}) - ecm_mark_as_test(${name}) -- target_link_libraries(${name} Qt5::Core Qt5::Gui Qt5::Test KF5::ConfigCore) -+ target_link_libraries(${name} Qt5::Core Qt5::Gui Qt5::Test) - target_include_directories(${name} PRIVATE ${CMAKE_BINARY_DIR}) - endmacro(add_kgc_test) - -diff --git a/tests/configsavetest.cpp b/tests/configsavetest.cpp -index 1fe8f4f..d5d8460 100644 ---- a/tests/configsavetest.cpp -+++ b/tests/configsavetest.cpp -@@ -9,40 +9,33 @@ - - QTEST_GUILESS_MAIN(ConfigSaveTest); - --ConfigSaveTest::ConfigSaveTest() --{ -- QStandardPaths::setTestModeEnabled(true); --} -- --static void fillValues(QScopedPointer& a) -+void ConfigSaveTest::fillValues(AbstractAppearance* a) - { - a->setFont("a"); - a->setIcon("a"); - a->setTheme("a"); - a->setToolbarStyle("a"); - a->setIconFallback("a"); -- a->setCursor("a"); - a->setShowIconsInButtons(true); - a->setShowIconsInMenus(true); - a->setPrimaryButtonWarpsSlider(true); - -- auto a3 = dynamic_cast(a.data()); -+ auto a3 = dynamic_cast(a); - if (a3) { - a3->setApplicationPreferDarkTheme(false); - } - } - --void compareAppearances(QScopedPointer& reloaded, QScopedPointer& instance) -+bool compareAppearances(AbstractAppearance* a, AbstractAppearance* b) - { -- QCOMPARE(reloaded->getFont(), instance->getFont()); -- QCOMPARE(reloaded->getIcon(), instance->getIcon()); -- QCOMPARE(reloaded->getTheme(), instance->getTheme()); -- QCOMPARE(reloaded->getCursor(), instance->getCursor()); -- QCOMPARE(reloaded->getToolbarStyle(), instance->getToolbarStyle()); -- QCOMPARE(reloaded->getIconFallback(), instance->getIconFallback()); -- QCOMPARE(reloaded->getShowIconsInButtons(), instance->getShowIconsInButtons()); -- QCOMPARE(reloaded->getShowIconsInMenus(), instance->getShowIconsInMenus()); -- QCOMPARE(reloaded->getPrimaryButtonWarpsSlider(), instance->getPrimaryButtonWarpsSlider()); -+ return a->getFont() == b->getFont() -+ && a->getIcon() == b->getIcon() -+ && a->getTheme() == b->getTheme() -+ && a->getToolbarStyle() == b->getToolbarStyle() -+ && a->getIconFallback() == b->getIconFallback() -+ && a->getShowIconsInButtons() == b->getShowIconsInButtons() -+ && a->getShowIconsInMenus() == b->getShowIconsInMenus() -+ && a->getPrimaryButtonWarpsSlider() == b->getPrimaryButtonWarpsSlider(); - } - - QByteArray readFile(const QString& path) -@@ -53,35 +46,23 @@ QByteArray readFile(const QString& path) - return f.readAll(); - } - --void ConfigSaveTest::testGtk2() -+void ConfigSaveTest::testOpen() - { -- const QString pathA = QDir::current().absoluteFilePath("test-gtk2") -- , pathB = QDir::current().absoluteFilePath("testB-gtk2"); -- -- QScopedPointer instance(new AppearanceGTK2); -- fillValues(instance); -- QVERIFY(instance->saveSettings(pathA)); -- -- QScopedPointer reloaded(new AppearanceGTK2); -- QVERIFY(reloaded->loadSettings(pathA)); -- compareAppearances(reloaded, instance); -- QVERIFY(reloaded->saveSettings(pathB)); -- QCOMPARE(readFile(pathA), readFile(pathB)); --} -- --void ConfigSaveTest::testGtk3() --{ -- QScopedPointer instance(new AppearanceGTK3); -- fillValues(instance); -- const QString pathA = QDir::current().absoluteFilePath("test-gtk3") -- , pathB = QDir::current().absoluteFilePath("testB-gtk3"); -- QVERIFY(instance->saveSettings(pathA)); -- -- QScopedPointer reloaded(new AppearanceGTK3); -- QVERIFY(QFile::exists(pathA)); -- QVERIFY(reloaded->loadSettings(pathA)); -- compareAppearances(reloaded, instance); -- QVERIFY(reloaded->saveSettings(pathB)); -+ QVector instances; -+ instances << new AppearanceGTK2 << new AppearanceGTK3; -+ fillValues(instances[0]); -+ fillValues(instances[1]); -+ QVERIFY(instances[0]->saveSettings("test-gtk2")); -+ QVERIFY(instances[1]->saveSettings("test-gtk3")); - -- QCOMPARE(readFile(pathA), readFile(pathB)); -+ QVector reloaded; -+ reloaded << new AppearanceGTK2 << new AppearanceGTK3; -+ QVERIFY(reloaded[0]->loadSettings("test-gtk2")); -+ QVERIFY(reloaded[1]->loadSettings("test-gtk3")); -+ QVERIFY(compareAppearances(reloaded[0], instances[0])); -+ QVERIFY(compareAppearances(reloaded[1], instances[1])); -+ QVERIFY(reloaded[0]->saveSettings("testB-gtk2")); -+ QVERIFY(reloaded[1]->saveSettings("testB-gtk3")); -+ QCOMPARE(readFile("test-gtk2"), readFile("testB-gtk2")); -+ QCOMPARE(readFile("test-gtk3"), readFile("testB-gtk3")); - } -diff --git a/tests/configsavetest.h b/tests/configsavetest.h -index 342b408..39fb4c2 100644 ---- a/tests/configsavetest.h -+++ b/tests/configsavetest.h -@@ -11,11 +11,11 @@ class AbstractAppearance; - class ConfigSaveTest : public QObject - { - Q_OBJECT --public: -- ConfigSaveTest(); - private slots: -- void testGtk2(); -- void testGtk3(); -+ void testOpen(); -+ -+private: -+ void fillValues(AbstractAppearance* a); - }; - - #endif // CONFIGSAVETEST_H --- -cgit v0.11.2 - diff --git a/kde/patch/kde-runtime.patch b/kde/patch/kde-runtime.patch index c3b6101..3201d76 100644 --- a/kde/patch/kde-runtime.patch +++ b/kde/patch/kde-runtime.patch @@ -1,10 +1,2 @@ -# Fix KDE bug 324470 - solved in KDE 4.11.2. -# - Minimize/maximize by clicking taskbar entries requires double click. -#cat $CWD/patch/kde-runtime/kde-runtime.kdebug324470.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - # Fix compilation against NetworkManager 1.0.6: cat $CWD/patch/kde-runtime/kde-runtime_networkmanager.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -## Fix compilation against gpgme 1.7+: -#cat $CWD/patch/kde-runtime/kde-runtime_gpgme.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kde-runtime/kde-runtime.kdebug324470.diff b/kde/patch/kde-runtime/kde-runtime.kdebug324470.diff deleted file mode 100644 index 4269df8..0000000 --- a/kde/patch/kde-runtime/kde-runtime.kdebug324470.diff +++ /dev/null @@ -1,49 +0,0 @@ -commit be1a5d484c70f4f6a383150810afbfbb367db2ac -Author: Eike Hein -Date: Tue Sep 3 20:29:23 2013 +0200 - - Discard the recorded events in the item-local handlers. - - Solves problems with identical events being ignored due to - QGraphicsView's reuse of QGraphicsSceneMouseEvent instances. - - CCMAIL:rdieter@fedoraproject.org - BUG:324470 - BUG:324471 - -diff --git a/plasma/declarativeimports/qtextracomponents/mouseeventlistener.cpp b/plasma/declarativeimports/qtextracomponents/mouseeventlistener.cpp -index b534845..36530e0 100644 ---- a/plasma/declarativeimports/qtextracomponents/mouseeventlistener.cpp -+++ b/plasma/declarativeimports/qtextracomponents/mouseeventlistener.cpp -@@ -90,6 +90,7 @@ bool MouseEventListener::containsMouse() const - void MouseEventListener::mousePressEvent(QGraphicsSceneMouseEvent *me) - { - if (m_lastEvent == me) { -+ m_lastEvent = 0; - return; - } - -@@ -112,6 +113,7 @@ void MouseEventListener::mousePressEvent(QGraphicsSceneMouseEvent *me) - void MouseEventListener::mouseMoveEvent(QGraphicsSceneMouseEvent *me) - { - if (m_lastEvent == me) { -+ m_lastEvent = 0; - return; - } - -@@ -122,6 +124,7 @@ void MouseEventListener::mouseMoveEvent(QGraphicsSceneMouseEvent *me) - void MouseEventListener::mouseReleaseEvent(QGraphicsSceneMouseEvent *me) - { - if (m_lastEvent == me) { -+ m_lastEvent = 0; - return; - } - -@@ -138,6 +141,7 @@ void MouseEventListener::mouseReleaseEvent(QGraphicsSceneMouseEvent *me) - void MouseEventListener::wheelEvent(QGraphicsSceneWheelEvent *we) - { - if (m_lastEvent == we) { -+ m_lastEvent = 0; - return; - } - diff --git a/kde/patch/kde-runtime/kde-runtime_gpgme.patch b/kde/patch/kde-runtime/kde-runtime_gpgme.patch deleted file mode 100644 index b1703ed..0000000 --- a/kde/patch/kde-runtime/kde-runtime_gpgme.patch +++ /dev/null @@ -1,133 +0,0 @@ -commit 1b80d1d0b961f8e28186928ede2b87af292c3de4 -Author: Antonio Rojas -Date: Thu Nov 10 16:58:10 2016 +0100 - - Allow building kwalletd against gpgme++ from gpgme 1.7 - - REVIEW: 129339 - -diff --git a/kwalletd/CMakeLists.txt b/kwalletd/CMakeLists.txt -index 73aec82..ae8c745 100644 ---- a/kwalletd/CMakeLists.txt -+++ b/kwalletd/CMakeLists.txt -@@ -5,11 +5,18 @@ find_package(Gpgme) # Called by FindQGpgme, but since we call some gpgme - # functions ourselves we need to link against it directly. - find_package(QGpgme) # provided by kdepimlibs - --if (GPGME_FOUND AND QGPGME_FOUND) -+if (NOT QGPGME_FOUND) -+find_package(Gpgmepp) # provided by gpgme 1.7 -+endif (NOT QGPGME_FOUND) -+ -+if ((GPGME_FOUND AND QGPGME_FOUND) OR Gpgmepp_FOUND) - add_definitions(-DHAVE_QGPGME) -- include_directories(${GPGME_INCLUDES} ${QGPGME_INCLUDE_DIR}) -+ include_directories(${GPGME_INCLUDES}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") --endif(GPGME_FOUND AND QGPGME_FOUND) -+endif((GPGME_FOUND AND QGPGME_FOUND) OR Gpgmepp_FOUND) -+if (GPGME_FOUND AND QGPGME_FOUND) -+ include_directories(${QGPGME_INCLUDE_DIR}) -+endif (GPGME_FOUND AND QGPGME_FOUND) - - ########### build backends ######### - add_subdirectory(backend) -@@ -37,7 +44,7 @@ kde4_add_ui_files(kwalletd_KDEINIT_SRCS - kwalletwizardpagepassword.ui - ) - --if (GPGME_FOUND AND QGPGME_FOUND) -+if ((GPGME_FOUND AND QGPGME_FOUND) OR Gpgmepp_FOUND) - set(kwalletd_KDEINIT_SRCS - ${kwalletd_KDEINIT_SRCS} - knewwalletdialog.cpp -@@ -48,7 +55,7 @@ if (GPGME_FOUND AND QGPGME_FOUND) - knewwalletdialogintro.ui - knewwalletdialoggpg.ui - ) --endif(GPGME_FOUND AND QGPGME_FOUND) -+endif((GPGME_FOUND AND QGPGME_FOUND) OR Gpgmepp_FOUND) - - find_file(kwallet_xml org.kde.KWallet.xml HINTS ${KDE4_DBUS_INTERFACES_DIR} ) - -@@ -57,8 +64,12 @@ qt4_add_dbus_adaptor( kwalletd_KDEINIT_SRCS ${kwallet_xml} kwalletd.h KWalletD ) - kde4_add_kdeinit_executable( kwalletd NOGUI ${kwalletd_KDEINIT_SRCS} ) - - target_link_libraries(kdeinit_kwalletd ${KDE4_KDEUI_LIBS} kwalletbackend ) --if (GPGME_FOUND AND QGPGME_FOUND) -- target_link_libraries(kdeinit_kwalletd ${QGPGME_LIBRARIES} ) -+if(GPGME_FOUND AND QGPGME_FOUND) -+target_link_libraries(kdeinit_kwalletd ${QGPGME_LIBRARIES} ) -+else(GPGME_FOUND AND QGPGME_FOUND) -+if(Gpgmepp_FOUND) -+target_link_libraries(kdeinit_kwalletd Gpgmepp) -+endif(Gpgmepp_FOUND) - endif(GPGME_FOUND AND QGPGME_FOUND) - - install(TARGETS kdeinit_kwalletd ${INSTALL_TARGETS_DEFAULT_ARGS}) -@@ -73,4 +84,4 @@ install( FILES kwalletd.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kwalletd ) - install( FILES kwallet-4.13.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update) - - add_subdirectory(tests) --add_subdirectory(autotests) -\ No newline at end of file -+add_subdirectory(autotests) -diff --git a/kwalletd/backend/CMakeLists.txt b/kwalletd/backend/CMakeLists.txt -index 4db348f..7347b12 100644 ---- a/kwalletd/backend/CMakeLists.txt -+++ b/kwalletd/backend/CMakeLists.txt -@@ -22,6 +22,10 @@ kde4_add_library(kwalletbackend SHARED ${kwalletbackend_LIB_SRCS}) - target_link_libraries(kwalletbackend ${KDE4_KDEUI_LIBS} ${LIBGCRYPT_LIBRARIES}) - if(QGPGME_FOUND) - target_link_libraries(kwalletbackend ${QGPGME_LIBRARIES} ) -+else(QGPGME_FOUND) -+if(Gpgmepp_FOUND) -+target_link_libraries(kwalletbackend Gpgmepp) -+endif(Gpgmepp_FOUND) - endif(QGPGME_FOUND) - - # link with advapi32 on windows -diff --git a/kwalletd/backend/backendpersisthandler.cpp b/kwalletd/backend/backendpersisthandler.cpp -index b7f63f8..9608af0 100644 ---- a/kwalletd/backend/backendpersisthandler.cpp -+++ b/kwalletd/backend/backendpersisthandler.cpp -@@ -33,6 +33,7 @@ - #include - #include - #include -+#include - #endif - #include "backendpersisthandler.h" - #include "kwalletbackend.h" -diff --git a/kwalletd/kwalletwizard.cpp b/kwalletd/kwalletwizard.cpp -index 78de78d..821b666 100644 ---- a/kwalletd/kwalletwizard.cpp -+++ b/kwalletd/kwalletwizard.cpp -@@ -40,6 +40,7 @@ - #include - #include - #include -+#include - #endif - - class PageIntro : public QWizardPage -commit cf28801cd34730da07a2c01704ca3114630f4fe7 -Author: Antonio Rojas -Date: Thu Nov 10 18:54:41 2016 +0100 - - Compiling against gmgpe 1.7 requires c++11 - -diff --git a/kwalletd/CMakeLists.txt b/kwalletd/CMakeLists.txt -index ae8c745..88d944e 100644 ---- a/kwalletd/CMakeLists.txt -+++ b/kwalletd/CMakeLists.txt -@@ -17,6 +17,9 @@ endif((GPGME_FOUND AND QGPGME_FOUND) OR Gpgmepp_FOUND) - if (GPGME_FOUND AND QGPGME_FOUND) - include_directories(${QGPGME_INCLUDE_DIR}) - endif (GPGME_FOUND AND QGPGME_FOUND) -+if (Gpgmepp_FOUND) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") -+endif (Gpgmepp_FOUND) - - ########### build backends ######### - add_subdirectory(backend) diff --git a/kde/patch/kde-workspace.patch b/kde/patch/kde-workspace.patch index 4a355d1..bebecfe 100644 --- a/kde/patch/kde-workspace.patch +++ b/kde/patch/kde-workspace.patch @@ -4,9 +4,5 @@ cat $CWD/patch/kde-workspace/kde-workspace.kdm.server.timeout.diff | patch -p1 - # Always show 'remaining time' in the popup of the battery plasmoid: cat $CWD/patch/kde-workspace/kde-workspace.batteryapplet.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } -# Fix crash when DesktopNames isn't set (fixed in 4.11.10): -#cat $CWD/patch/kde-workspace/kde-workspace.desktopnames.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - # In Plasma 5 we do not need the Plasma 4 core apps, they conflict. cat $CWD/patch/kde-workspace/kde-workspace.no.plasma4.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kde-workspace/kde-workspace.desktopnames.diff b/kde/patch/kde-workspace/kde-workspace.desktopnames.diff deleted file mode 100644 index 59aef1c..0000000 --- a/kde/patch/kde-workspace/kde-workspace.desktopnames.diff +++ /dev/null @@ -1,34 +0,0 @@ -commit e1724800ecf3c6a7035dfa7bcaa50b2a8f48688f -Author: David Faure -Date: Fri May 2 10:26:38 2014 +0200 - - Fix crash when DesktopNames isn't set - - BUG: 334159 - FIXED-IN: 4.11.10 - -diff --git a/kdm/backend/client.c b/kdm/backend/client.c -index 335cc3e..a2d06c2 100644 ---- a/kdm/backend/client.c -+++ b/kdm/backend/client.c -@@ -1810,12 +1810,14 @@ startClient(volatile int *pid) - !(sessargs = iniEntry(str, "Desktop Entry", "Exec", 0))) - sessargs = ""; - buf = iniEntry(str, "Desktop Entry", "DesktopNames", 0); -- for (buf2 = buf; *buf2; ++buf2) { -- if (*buf2 == ';') -- *buf2 = ':'; -+ if (buf) { -+ for (buf2 = buf; *buf2; ++buf2) { -+ if (*buf2 == ';') -+ *buf2 = ':'; -+ } -+ userEnviron = setEnv(userEnviron, "XDG_CURRENT_DESKTOP", buf); -+ free(buf); - } -- userEnviron = setEnv(userEnviron, "XDG_CURRENT_DESKTOP", buf); -- free(buf); - free(str); - free(fname); - goto gotit; - diff --git a/kde/patch/kdeconnect-kde.patch b/kde/patch/kdeconnect-kde.patch index 47f98f5..122440d 100644 --- a/kde/patch/kdeconnect-kde.patch +++ b/kde/patch/kdeconnect-kde.patch @@ -1,3 +1,2 @@ # Fix remote device browsing with openssh 8.2: cat $CWD/patch/kdeconnect-kde/kdeconnect-kde_openssh-8.2.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdelibs4support.patch b/kde/patch/kdelibs4support.patch index 8e9fe7b..7d6626e 100644 --- a/kde/patch/kdelibs4support.patch +++ b/kde/patch/kdelibs4support.patch @@ -1,6 +1,2 @@ -# Make FindGettext compatible with the one provided by CMake: -# Fixed in 5.1.0. -#cat $CWD/patch/kdelibs4support/update-FindGettext.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - # Allow cmake to find our doctools: cat $CWD/patch/kdelibs4support/FindDocBookXML4.cmake.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } diff --git a/kde/patch/kdelibs4support/update-FindGettext.patch b/kde/patch/kdelibs4support/update-FindGettext.patch deleted file mode 100644 index 1b75cd8..0000000 --- a/kde/patch/kdelibs4support/update-FindGettext.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Alex Merry -Date: Fri, 04 Jul 2014 10:10:27 +0000 -Subject: Make FindGettext compatible with the one provided by CMake -X-Git-Url: http://quickgit.kde.org/?p=kdelibs4support.git&a=commitdiff&h=581ee6b370d8b5627196c8d6d8760d3655f6daea ---- -Make FindGettext compatible with the one provided by CMake - -This version will accept the old GETTEXT_PROCESS_PO_FILES() syntax (no -PO_FILES argument), but will also accept the new syntax required by -CMake's version of this file. It will also warn when PO_FILES is not -given. - -REVIEW: 119111 ---- - - ---- a/cmake/modules/FindGettext.cmake -+++ b/cmake/modules/FindGettext.cmake -@@ -212,7 +212,16 @@ - LIST(REMOVE_AT _args 0 1) - ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION") - --# message(STATUS "2 all ${_addToAll} dest ${_installDest} args: ${_args}") -+ LIST(GET _args 0 _tmp) -+ IF("${_tmp}" STREQUAL "PO_FILES") -+ LIST(REMOVE_AT _args 0) -+ ELSE() -+ SET(_deprecation_arg DEPRECATION) -+ IF(CMAKE_VERSION VERSION_LESS 3.0.0) -+ SET(_deprecation_arg AUTHOR_WARNING) -+ ENDIF() -+ MESSAGE(${_deprecation_arg} "GETTEXT_PROCESS_PO_FILES without a PO_FILES argument is deprecated") -+ ENDIF() - - FOREACH(_current_PO_FILE ${_args}) - GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME) diff --git a/kde/patch/kdenlive.patch b/kde/patch/kdenlive.patch deleted file mode 100644 index 9065c4d..0000000 --- a/kde/patch/kdenlive.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Fix compilation with gcc7. -# Should have been fixed in 17.04.2... -#cat $CWD/patch/kdenlive/kdenlive_gcc7.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdenlive/kdenlive_gcc7.patch b/kde/patch/kdenlive/kdenlive_gcc7.patch deleted file mode 100644 index a7ddb90..0000000 --- a/kde/patch/kdenlive/kdenlive_gcc7.patch +++ /dev/null @@ -1,32 +0,0 @@ -# Make kdenlive compile with gcc7 - ---- kdenlive-17.04.1/src/profiles/tree/profiletreemodel.cpp.orig 2017-05-08 19:52:35.000000000 +0200 -+++ kdenlive-17.04.1/src/profiles/tree/profiletreemodel.cpp 2017-05-19 08:09:04.986909338 +0200 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - - class ProfileItem ---- kdenlive-17.04.1/src/scopes/audioscopes/spectrogram.cpp.orig 2017-05-08 19:52:35.000000000 +0200 -+++ kdenlive-17.04.1/src/scopes/audioscopes/spectrogram.cpp 2017-05-19 08:09:04.993910503 +0200 -@@ -241,7 +241,7 @@ - x = leftDist + (m_innerScopeRect.width() - 1) * ((float)hz) / m_freqMax; - - // Hide text if it would overlap with the text drawn at the mouse position -- hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (leftDist + mouseX + 20)) < (int) minDistX + 16 -+ hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - ((int)leftDist + mouseX + 20)) < (int) minDistX + 16 - && mouseX < m_innerScopeRect.width() && mouseX >= 0; - - if (x <= rightBorder) { -@@ -268,7 +268,7 @@ - } - // Draw the line at the very right (maximum frequency) - x = leftDist + m_innerScopeRect.width() - 1; -- hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - (leftDist + mouseX + 30)) < (int) minDistX -+ hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x - ((int)leftDist + mouseX + 30)) < (int) minDistX - && mouseX < m_innerScopeRect.width() && mouseX >= 0; - davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height() + 6); - if (!hideText) { diff --git a/kde/patch/kdepim.patch b/kde/patch/kdepim.patch deleted file mode 100644 index c5aeb9c..0000000 --- a/kde/patch/kdepim.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Install Kleopatra headers, needed by kopete-cryptography: -# This used to be fixed? -#cat $CWD/patch/kdepim/kdepim-install_kleopatra_headers.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdepim/kdepim-install_kleopatra_headers.patch b/kde/patch/kdepim/kdepim-install_kleopatra_headers.patch deleted file mode 100644 index 18662fd..0000000 --- a/kde/patch/kdepim/kdepim-install_kleopatra_headers.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -uarN kdepim-15.08.0.orig/kleopatra/libkleopatraclient/CMakeLists.txt kdepim-15.08.0/kleopatra/libkleopatraclient/CMakeLists.txt ---- kdepim-15.08.0.orig/kleopatra/libkleopatraclient/CMakeLists.txt 2015-08-10 21:56:00.000000000 +0200 -+++ kdepim-15.08.0/kleopatra/libkleopatraclient/CMakeLists.txt 2015-08-24 23:05:07.650076668 +0200 -@@ -4,6 +4,11 @@ - add_subdirectory(core) - add_subdirectory(gui) - -+install( -+ FILES kleopatraclient_export.h -+ DESTINATION ${INCLUDE_INSTALL_DIR}/libkleopatraclient -+ ) -+ - if(BUILD_TESTING) - add_subdirectory(tests) - endif() -diff -uarN kdepim-15.08.0.orig/kleopatra/libkleopatraclient/core/CMakeLists.txt kdepim-15.08.0/kleopatra/libkleopatraclient/core/CMakeLists.txt ---- kdepim-15.08.0.orig/kleopatra/libkleopatraclient/core/CMakeLists.txt 2015-08-10 21:56:00.000000000 +0200 -+++ kdepim-15.08.0/kleopatra/libkleopatraclient/core/CMakeLists.txt 2015-08-24 22:52:15.613045160 +0200 -@@ -67,3 +67,13 @@ - target_link_libraries(kleopatraclientcore Qt5::Widgets KF5::I18n) - - install(TARGETS kleopatraclientcore ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -+ -+install( -+ FILES -+ initialization.h -+ command.h -+ selectcertificatecommand.h -+ signencryptfilescommand.h -+ decryptverifyfilescommand.h -+ DESTINATION ${INCLUDE_INSTALL_DIR}/libkleopatraclient/core -+ ) -diff -uarN kdepim-15.08.0.orig/kleopatra/libkleopatraclient/gui/CMakeLists.txt kdepim-15.08.0/kleopatra/libkleopatraclient/gui/CMakeLists.txt ---- kdepim-15.08.0.orig/kleopatra/libkleopatraclient/gui/CMakeLists.txt 2015-08-10 21:56:00.000000000 +0200 -+++ kdepim-15.08.0/kleopatra/libkleopatraclient/gui/CMakeLists.txt 2015-08-24 22:52:15.613045160 +0200 -@@ -16,3 +16,9 @@ - ) - - install(TARGETS kleopatraclientgui ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -+ -+install( -+ FILES -+ certificaterequester.h -+ DESTINATION ${INCLUDE_INSTALL_DIR}/libkleopatraclient/gui -+ ) -diff -uarN kdepim-15.08.0.orig/libkleo/CMakeLists.txt kdepim-15.08.0/libkleo/CMakeLists.txt ---- kdepim-15.08.0.orig/libkleo/CMakeLists.txt 2015-08-10 21:56:00.000000000 +0200 -+++ kdepim-15.08.0/libkleo/CMakeLists.txt 2015-08-24 22:52:15.613045160 +0200 -@@ -126,3 +126,61 @@ - else () - install ( FILES libkleopatrarc.desktop DESTINATION ${KDE_INSTALL_CONFDIR} RENAME libkleopatrarc ) - endif () -+ -+install( FILES -+ kleo/kleo_export.h -+ kleo/enum.h -+ kleo/oidmap.h -+ kleo/cryptobackend.h -+ kleo/cryptobackendfactory.h -+ kleo/cryptoconfig.h -+ kleo/dn.h -+ kleo/job.h -+ kleo/keylistjob.h -+ kleo/keygenerationjob.h -+ kleo/abstractimportjob.h -+ kleo/importjob.h -+ kleo/importfromkeyserverjob.h -+ kleo/exportjob.h -+ kleo/changeexpiryjob.h -+ kleo/changeownertrustjob.h -+ kleo/downloadjob.h -+ kleo/deletejob.h -+ kleo/encryptjob.h -+ kleo/decryptjob.h -+ kleo/signjob.h -+ kleo/specialjob.h -+ kleo/verifydetachedjob.h -+ kleo/verifyopaquejob.h -+ kleo/decryptverifyjob.h -+ kleo/signencryptjob.h -+ kleo/signkeyjob.h -+ kleo/adduseridjob.h -+ kleo/refreshkeysjob.h -+ kleo/multideletejob.h -+ kleo/hierarchicalkeylistjob.h -+ kleo/keyfilter.h -+ kleo/keyfiltermanager.h -+ kleo/changepasswdjob.h -+ kleo/checksumdefinition.h -+ kleo/exception.h -+ kleo/kconfigbasedkeyfilter.h -+ kleo/listallkeysjob.h -+ kleo/stl_util.h -+ DESTINATION ${INCLUDE_INSTALL_DIR}/kleo COMPONENT Devel) -+ -+install ( FILES -+ ui/kdhorizontalline.h -+ ui/messagebox.h -+ ui/progressbar.h -+ ui/progressdialog.h -+ ui/keylistview.h -+ ui/keyselectiondialog.h -+ ui/keyrequester.h -+ ui/keyapprovaldialog.h -+ ui/dnattributeorderconfigwidget.h -+ ui/cryptoconfigmodule.h -+ ui/cryptoconfigdialog.h -+ ui/directoryserviceswidget.h -+ ui/filenamerequester.h -+ DESTINATION ${INCLUDE_INSTALL_DIR}/kleo/ui COMPONENT Devel) -diff -uarN kdepim-15.08.0.orig/libkpgp/CMakeLists.txt kdepim-15.08.0/libkpgp/CMakeLists.txt ---- kdepim-15.08.0.orig/libkpgp/CMakeLists.txt 2015-08-10 21:56:00.000000000 +0200 -+++ kdepim-15.08.0/libkpgp/CMakeLists.txt 2015-08-24 23:04:02.505074051 +0200 -@@ -44,6 +44,15 @@ - set_target_properties(kpgp PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION}) - install(TARGETS kpgp ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) - -+install(FILES -+ kpgp.h -+ kpgpbase.h -+ kpgpblock.h -+ kpgpkey.h -+ kpgpui.h -+ libkpgp_export.h -+ DESTINATION ${INCLUDE_INSTALL_DIR}/kpgp COMPONENT Devel ) -+ - if(BUILD_TESTING) - add_subdirectory( tests ) - endif() diff --git a/kde/patch/kdepimlibs.patch b/kde/patch/kdepimlibs.patch deleted file mode 100644 index 05e5dfe..0000000 --- a/kde/patch/kdepimlibs.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix a crash in kmail (fixed in 15.12.1): -#cat $CWD/patch/kdepimlibs/kdepimlibs_kmail_crash.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdepimlibs/kdepimlibs_kmail_crash.patch b/kde/patch/kdepimlibs/kdepimlibs_kmail_crash.patch deleted file mode 100644 index 1614e07..0000000 --- a/kde/patch/kdepimlibs/kdepimlibs_kmail_crash.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Weng Xuetian -Date: Thu, 17 Dec 2015 16:19:36 +0000 -Subject: Fix possible crash upon application exits (e.g. kmail) -X-Git-Url: http://quickgit.kde.org/?p=kdepimlibs.git&a=commitdiff&h=c6bf33a9018587e96a350bfd0b2bffde1859db27 ---- -Fix possible crash upon application exits (e.g. kmail) - -Qt lambda connection will not automatically disconnect if no context -qobject is provided. Since SessionPrivate is not a qobject, disconnect -the connection in the destructor to prevent accessing deleted object. - -REVIEW: 126395 ---- - - ---- a/akonadi/src/core/session.cpp -+++ b/akonadi/src/core/session.cpp -@@ -301,15 +301,16 @@ - // Shutdown the thread before QApplication event loop quits - the - // thread()->wait() mechanism in ConnectionThread dtor crashes sometimes - // when called from QApplication destructor -- QObject::connect(qApp, &QCoreApplication::aboutToQuit, -- [this]() { -- delete connThread; -- connThread = Q_NULLPTR; -- }); -+ connThreadCleanUp = QObject::connect(qApp, &QCoreApplication::aboutToQuit, -+ [this]() { -+ delete connThread; -+ connThread = Q_NULLPTR; -+ }); - } - - SessionPrivate::~SessionPrivate() - { -+ QObject::disconnect(connThreadCleanUp); - delete connThread; - } - - ---- a/akonadi/src/core/session_p.h -+++ b/akonadi/src/core/session_p.h -@@ -29,6 +29,7 @@ - - #include - #include -+#include - #include - - class QIODevice; -@@ -125,6 +126,7 @@ - Session *mParent; - QThread *thread; - ConnectionThread *connThread; -+ QMetaObject::Connection connThreadCleanUp; - QByteArray sessionId; - bool connected; - qint64 theNextTag; - diff --git a/kde/patch/kdepimlibs4.patch b/kde/patch/kdepimlibs4.patch deleted file mode 100644 index 91a7d15..0000000 --- a/kde/patch/kdepimlibs4.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix a compilation issue with new libical: -cat $CWD/patch/kdepimlibs4/kdepimlibs.libical3.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdepimlibs4/kdepimlibs.libical3.diff b/kde/patch/kdepimlibs4/kdepimlibs.libical3.diff deleted file mode 100644 index c3b8caf..0000000 --- a/kde/patch/kdepimlibs4/kdepimlibs.libical3.diff +++ /dev/null @@ -1,184 +0,0 @@ ---- ./kcalcore/icalformat_p.cpp.orig 2015-06-24 07:43:14.000000000 -0500 -+++ ./kcalcore/icalformat_p.cpp 2017-12-05 23:03:44.742261940 -0600 -@@ -2301,7 +2301,6 @@ - t.second = 0; - - t.is_date = 1; -- t.is_utc = 0; - t.zone = 0; - - return t; -@@ -2322,8 +2321,7 @@ - t.minute = datetime.time().minute(); - t.second = datetime.time().second(); - } -- t.zone = 0; // zone is NOT set -- t.is_utc = datetime.isUtc() ? 1 : 0; -+ t.zone = datetime.isUtc() ? icaltimezone_get_utc_timezone() : 0; // zone is NOT set - - // _dumpIcaltime( t ); - -@@ -2398,7 +2396,7 @@ - } - - KTimeZone ktz; -- if (!t.is_utc) { -+ if (!icaltime_is_utc( t )) { - ktz = dt.timeZone(); - } - -@@ -2431,7 +2429,7 @@ - // _dumpIcaltime( t ); - - KDateTime::Spec timeSpec; -- if (t.is_utc || t.zone == icaltimezone_get_utc_timezone()) { -+ if (icaltime_is_utc( t ) || t.zone == icaltimezone_get_utc_timezone()) { - timeSpec = KDateTime::UTC; // the time zone is UTC - utc = false; // no need to convert to UTC - } else { ---- ./kcalcore/icaltimezones.cpp.orig 2015-06-24 07:43:14.000000000 -0500 -+++ ./kcalcore/icaltimezones.cpp 2017-12-05 23:03:55.482262829 -0600 -@@ -54,7 +54,7 @@ - { - return QDateTime(QDate(t.year, t.month, t.day), - QTime(t.hour, t.minute, t.second), -- (t.is_utc ? Qt::UTC : Qt::LocalTime)); -+ (icaltime_is_utc( t ) ? Qt::UTC : Qt::LocalTime)); - } - - // Maximum date for time zone data. -@@ -81,7 +81,6 @@ - t.second = local.time().second(); - t.is_date = 0; - t.zone = 0; -- t.is_utc = 0; - return t; - } - -@@ -886,7 +885,7 @@ - case ICAL_LASTMODIFIED_PROPERTY: - { - const icaltimetype t = icalproperty_get_lastmodified(p); -- if (t.is_utc) { -+ if (icaltime_is_utc( t )) { - data->d->lastModified = toQDateTime(t); - } else { - kDebug() << "LAST-MODIFIED not UTC"; -@@ -1259,7 +1258,7 @@ - // Convert DTSTART to QDateTime, and from local time to UTC - const QDateTime localStart = toQDateTime(dtstart); // local time - dtstart.second -= prevOffset; -- dtstart.is_utc = 1; -+ dtstart.zone = icaltimezone_get_utc_timezone(); - const QDateTime utcStart = toQDateTime(icaltime_normalize(dtstart)); // UTC - - transitions += utcStart; -@@ -1286,13 +1285,13 @@ - t.minute = dtstart.minute; - t.second = dtstart.second; - t.is_date = 0; -- t.is_utc = 0; // dtstart is in local time -+ t.zone = 0; // dtstart is in local time - } - // RFC2445 states that RDATE must be in local time, - // but we support UTC as well to be safe. -- if (!t.is_utc) { -+ if (!icaltime_is_utc( t )) { - t.second -= prevOffset; // convert to UTC -- t.is_utc = 1; -+ t.zone = icaltimezone_get_utc_timezone(); - t = icaltime_normalize(t); - } - transitions += toQDateTime(t); ---- ./kcal/icalformat_p.cpp.orig 2015-06-24 07:43:14.000000000 -0500 -+++ ./kcal/icalformat_p.cpp 2017-12-05 23:04:01.670263342 -0600 -@@ -2087,7 +2087,6 @@ - t.second = 0; - - t.is_date = 1; -- t.is_utc = 0; - t.zone = 0; - - return t; -@@ -2106,8 +2105,7 @@ - t.second = datetime.time().second(); - - t.is_date = 0; -- t.zone = 0; // zone is NOT set -- t.is_utc = datetime.isUtc() ? 1 : 0; -+ t.zone = datetime.isUtc() ? icaltimezone_get_utc_timezone() : 0; - - // _dumpIcaltime( t ); - -@@ -2174,7 +2172,7 @@ - } - - KTimeZone ktz; -- if ( !t.is_utc ) { -+ if ( !icaltime_is_utc( t ) ) { - ktz = dt.timeZone(); - } - -@@ -2207,7 +2205,7 @@ - // _dumpIcaltime( t ); - - KDateTime::Spec timeSpec; -- if ( t.is_utc || t.zone == icaltimezone_get_utc_timezone() ) { -+ if ( icaltime_is_utc( t ) || t.zone == icaltimezone_get_utc_timezone() ) { - timeSpec = KDateTime::UTC; // the time zone is UTC - utc = false; // no need to convert to UTC - } else { ---- ./kcal/icaltimezones.cpp.orig 2015-06-24 07:43:14.000000000 -0500 -+++ ./kcal/icaltimezones.cpp 2017-12-05 23:04:07.385263815 -0600 -@@ -50,7 +50,7 @@ - { - return QDateTime( QDate( t.year, t.month, t.day ), - QTime( t.hour, t.minute, t.second ), -- ( t.is_utc ? Qt::UTC : Qt::LocalTime ) ); -+ ( icaltime_is_utc( t ) ? Qt::UTC : Qt::LocalTime ) ); - } - - // Maximum date for time zone data. -@@ -77,7 +77,6 @@ - t.second = local.time().second(); - t.is_date = 0; - t.zone = 0; -- t.is_utc = 0; - return t; - } - -@@ -787,7 +786,7 @@ - case ICAL_LASTMODIFIED_PROPERTY: - { - icaltimetype t = icalproperty_get_lastmodified(p); -- if ( t.is_utc ) { -+ if ( icaltime_is_utc( t ) ) { - data->d->lastModified = toQDateTime( t ); - } else { - kDebug() << "LAST-MODIFIED not UTC"; -@@ -972,7 +971,7 @@ - // Convert DTSTART to QDateTime, and from local time to UTC - QDateTime localStart = toQDateTime( dtstart ); // local time - dtstart.second -= prevOffset; -- dtstart.is_utc = 1; -+ dtstart.zone = icaltimezone_get_utc_timezone(); - QDateTime utcStart = toQDateTime( icaltime_normalize( dtstart ) ); // UTC - - transitions += utcStart; -@@ -999,13 +998,13 @@ - t.minute = dtstart.minute; - t.second = dtstart.second; - t.is_date = 0; -- t.is_utc = 0; // dtstart is in local time -+ t.zone = 0; // dtstart is in local time - } - // RFC2445 states that RDATE must be in local time, - // but we support UTC as well to be safe. -- if ( !t.is_utc ) { -+ if ( !icaltime_is_utc( t ) ) { - t.second -= prevOffset; // convert to UTC -- t.is_utc = 1; -+ t.zone = icaltimezone_get_utc_timezone(); - t = icaltime_normalize( t ); - } - transitions += toQDateTime( t ); diff --git a/kde/patch/kdeplasma-addons.patch b/kde/patch/kdeplasma-addons.patch deleted file mode 100644 index 8c997b2..0000000 --- a/kde/patch/kdeplasma-addons.patch +++ /dev/null @@ -1,4 +0,0 @@ -# CVE 2013-2120: paste widget "password" generator uses insecure randomness: -# Fixed in KDE 4.11. -#cat $CWD/patch/kdeplasma-addons/random_generator_cve-2013-2120.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdeplasma-addons/random_generator_cve-2013-2120.patch b/kde/patch/kdeplasma-addons/random_generator_cve-2013-2120.patch deleted file mode 100644 index 7a394a5..0000000 --- a/kde/patch/kdeplasma-addons/random_generator_cve-2013-2120.patch +++ /dev/null @@ -1,76 +0,0 @@ -From: Aaron Seigo -Date: Mon, 03 Jun 2013 17:16:32 +0000 -Subject: use KRandom, avoid modulo bias -X-Git-Url: http://quickgit.kde.org/?p=kdeplasma-addons.git&a=commitdiff&h=36a1fe49cb70f717c4a6e9eeee2c9186503a8dce ---- -use KRandom, avoid modulo bias ---- - - ---- a/applets/paste/pastemacroexpander.cpp -+++ b/applets/paste/pastemacroexpander.cpp -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - class PasteMacroExpanderSingleton - { -@@ -142,35 +143,49 @@ - << "01234567890" - << "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; - -- int charCount; -+ int charCount = 8; - QString chars; - QString result; - - if (a.count() > 0) { -- charCount = qMax(a[0].trimmed().toInt(), 1); -- } else { -- charCount = 8; -+ charCount = qMax(a[0].trimmed().toInt(), 8); - } -+ - if (a.count() < 2) { - chars = characterSets.join(""); - } -+ - if (a.count() > 1) { - chars += (a[1].trimmed() == "true") ? characterSets[0] : ""; - } -+ - if (a.count() > 2) { - chars += (a[2].trimmed() == "true") ? characterSets[1] : ""; - } -+ - if (a.count() > 3) { - chars += (a[3].trimmed() == "true") ? characterSets[2] : ""; - } -+ - if (a.count() > 4) { - chars += (a[4].trimmed() == "true") ? characterSets[3] : ""; - } - -- QDateTime now = QDateTime::currentDateTime(); -- qsrand(now.toTime_t() / now.time().msec()); -+ const int setSize = chars.count(); -+ const int top = (RAND_MAX / setSize) * setSize; -+ kDebug() << "topping out at " << setSize << RAND_MAX << top; - for (int i = 0; i < charCount; ++i) { -- result += chars[qrand() % chars.count()]; -+ // to prevent modulo bias, discard random numbers at the -+ // 'top end' of INT_MAX -+ int rand = -1; -+ do { -+ if (rand > 0) { -+ kDebug() << "Ha!" << rand; -+ } -+ rand = KRandom::random(); -+ } while (rand >= top); -+ -+ result += chars[rand % setSize]; - } - //kDebug() << result; - return result; diff --git a/kde/patch/kdesdk-kioslaves.patch b/kde/patch/kdesdk-kioslaves.patch deleted file mode 100644 index da2f885..0000000 --- a/kde/patch/kdesdk-kioslaves.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix compilation against svn > 1.8. -#cat $CWD/patch/kdesdk-kioslaves/svn19.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdesdk-kioslaves/svn19.patch b/kde/patch/kdesdk-kioslaves/svn19.patch deleted file mode 100644 index dbd057d..0000000 --- a/kde/patch/kdesdk-kioslaves/svn19.patch +++ /dev/null @@ -1,87 +0,0 @@ -Subversion 1.9 and more recent versions have removed some interfaces, which -the Subversion developers consider to serve only svn-internal purposes, from -the header files installed by the package. - -The following patch (orignally from pkgsrc) provides an own sort mechanism -to replace the no longer available svn_sort__hash functionality. - ---- kdesdk-kioslaves-15.08.3/svn/svn.cpp.orig 2015-09-20 17:51:35.000000000 +0000 -+++ kdesdk-kioslaves-15.08.3/svn/svn.cpp -@@ -54,6 +54,8 @@ - #include "svn.h" - #include - -+#include -+ - using namespace KIO; - - typedef struct -@@ -107,11 +109,6 @@ static svn_error_t *write_to_string(void - return SVN_NO_ERROR; - } - --static int --compare_items_as_paths (const svn_sort__item_t*a, const svn_sort__item_t*b) { -- return svn_path_compare_paths ((const char *)a->key, (const char *)b->key); --} -- - kio_svnProtocol::kio_svnProtocol(const QByteArray &pool_socket, const QByteArray &app_socket) - : SlaveBase("kio_svn", pool_socket, app_socket) { - kDebug(7128) << "kio_svnProtocol::kio_svnProtocol()"; -@@ -515,6 +512,11 @@ void kio_svnProtocol::stat(const KUrl & - svn_pool_destroy( subpool ); - } - -+static bool -+sort_by_path(const std::pair &a, const std::pair &b) { -+ return svn_path_compare_paths(a.first, b.first) < 0; -+} -+ - void kio_svnProtocol::listDir(const KUrl& url) { - kDebug(7128) << "kio_svn::listDir(const KUrl& url) : " << url.url(); - -@@ -547,23 +549,23 @@ void kio_svnProtocol::listDir(const KUrl - return; - } - -- apr_array_header_t *array; -- int i; -- -- array = svn_sort__hash (dirents, compare_items_as_paths, subpool); -+ std::vector > array; -+ for (apr_hash_index_t *hi = apr_hash_first(subpool, dirents); hi; hi = apr_hash_next(hi)) { -+ const void *key; -+ void *data; -+ apr_hash_this(hi, &key, NULL, &data); -+ array.push_back(std::make_pair(reinterpret_cast(key), reinterpret_cast(data))); -+ } -+ std::sort(array.begin(), array.end(), sort_by_path); - -- UDSEntry entry; -- for (i = 0; i < array->nelts; ++i) { -+ UDSEntry entry; -+ for (size_t i = 0; i < array.size(); ++i) { - entry.clear(); - const char *utf8_entryname, *native_entryname; - svn_dirent_t *dirent; -- svn_sort__item_t *item; - -- item = &APR_ARRAY_IDX (array, i, svn_sort__item_t); -- -- utf8_entryname = (const char*)item->key; -- -- dirent = (svn_dirent_t*)apr_hash_get (dirents, utf8_entryname, item->klen); -+ utf8_entryname = array[i].first; -+ dirent = array[i].second; - - svn_utf_cstring_from_utf8 (&native_entryname, utf8_entryname, subpool); - const char *native_author = NULL; -@@ -577,7 +579,7 @@ void kio_svnProtocol::listDir(const KUrl - if ( createUDSEntry(QString( native_entryname ), QString( native_author ), dirent->size, - dirent->kind==svn_node_dir ? true : false, mtime, entry) ) - listEntry( entry, false ); -- } -+ } - listEntry( entry, true ); - - finished(); diff --git a/kde/patch/kdev-python.patch b/kde/patch/kdev-python.patch deleted file mode 100644 index a86d07a..0000000 --- a/kde/patch/kdev-python.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Fix compilation against Python 3.8. -# Fixed in 5.5.0. -#cat $CWD/patch/kdev-python/kdev-python-5.4.4_python38.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdev-python/kdev-python-5.4.4_python38.patch b/kde/patch/kdev-python/kdev-python-5.4.4_python38.patch deleted file mode 100644 index 572c9da..0000000 --- a/kde/patch/kdev-python/kdev-python-5.4.4_python38.patch +++ /dev/null @@ -1,560 +0,0 @@ -From e23fa8f15af89a8bd4bd84dd96b5fd7017457516 Mon Sep 17 00:00:00 2001 -From: Francis Herne -Date: Fri, 20 Sep 2019 00:41:29 +0100 -Subject: [PATCH] Initial Python 3.8 support. - -This allows kdev-python to be built and run against CPython 3.8, - and if so to parse files containing 3.8 syntax. - -BUG: 411956 -FIXED-IN: 5.5.0 ---- - CMakeLists.txt | 4 +- - duchain/declarationbuilder.cpp | 10 ++++- - duchain/declarationbuilder.h | 1 + - duchain/expressionvisitor.cpp | 4 ++ - duchain/expressionvisitor.h | 1 + - duchain/tests/pyduchaintest.cpp | 19 +++++++++ - parser/ast.cpp | 7 +++- - parser/ast.h | 9 ++++ - parser/astbuilder.cpp | 6 +++ - parser/astdefaultvisitor.cpp | 6 +++ - parser/astdefaultvisitor.h | 2 + - parser/astvisitor.cpp | 1 + - parser/astvisitor.h | 1 + - parser/conversionGenerator.py | 11 +++-- - parser/generated.h | 36 ++++++++++++++++ - parser/{python36.sdef => python38.sdef} | 55 ++++++++++++++++++++++--- - parser/tests/pyasttest.cpp | 5 +++ - 17 files changed, 164 insertions(+), 14 deletions(-) - rename parser/{python36.sdef => python38.sdef} (82%) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6f9e465b..09b089dd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -31,7 +31,7 @@ add_definitions( -DTRANSLATION_DOMAIN=\"kdevpython\" ) - - # CMake looks for exactly the specified version first and ignores newer versions. - # To avoid that, start looking for the newest supported version and work down. --set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4) -+set(Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 3.5 3.4) - foreach(_PYTHON_V ${Python_ADDITIONAL_VERSIONS}) - find_package(PythonInterp ${_PYTHON_V}) - if ( PYTHONINTERP_FOUND ) -@@ -49,7 +49,7 @@ if ( PYTHONINTERP_FOUND AND PYTHON_VERSION_STRING VERSION_GREATER "3.4" ) - endif() - - if ( NOT PYTHONLIBS_FOUND OR PYTHONLIBS_VERSION_STRING VERSION_LESS "3.4.3" ) -- message(FATAL_ERROR "Python >= 3.4.3 but < 3.8 with --enable-shared is required to build kdev-python") -+ message(FATAL_ERROR "Python >= 3.4.3 but < 3.9 with --enable-shared is required to build kdev-python") - endif() - - configure_file(kdevpythonversion.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/kdevpythonversion.h" @ONLY) -diff --git a/duchain/declarationbuilder.cpp b/duchain/declarationbuilder.cpp -index e3cb2b9c..61e144c5 100644 ---- a/duchain/declarationbuilder.cpp -+++ b/duchain/declarationbuilder.cpp -@@ -1354,6 +1354,14 @@ void DeclarationBuilder::visitAnnotationAssignment(AnnotationAssignmentAst* node - assignToUnknown(node->target, assignType); - } - -+void DeclarationBuilder::visitAssignmentExpression(AssignmentExpressionAst* node) { -+ AstDefaultVisitor::visitAssignmentExpression(node); -+ -+ ExpressionVisitor v(currentContext()); -+ v.visitNode(node->value); -+ assignToUnknown(node->target, v.lastType()); -+} -+ - void DeclarationBuilder::visitClassDefinition( ClassDefinitionAst* node ) - { - visitNodeList(node->decorators); -@@ -1745,7 +1753,7 @@ void DeclarationBuilder::visitArguments( ArgumentsAst* node ) - int parametersCount = node->arguments.length(); - int firstDefaultParameterOffset = parametersCount - defaultParametersCount; - int currentIndex = 0; -- foreach ( ArgAst* arg, node->arguments + node->kwonlyargs ) { -+ foreach ( ArgAst* arg, node->posonlyargs + node->arguments + node->kwonlyargs ) { - // Iterate over all the function's arguments, create declarations, and add the arguments - // to the functions FunctionType. - currentIndex += 1; -diff --git a/duchain/declarationbuilder.h b/duchain/declarationbuilder.h -index adee6d6d..1992b781 100644 ---- a/duchain/declarationbuilder.h -+++ b/duchain/declarationbuilder.h -@@ -90,6 +90,7 @@ class KDEVPYTHONDUCHAIN_EXPORT DeclarationBuilder: public DeclarationBuilderBase - void visitFunctionDefinition(FunctionDefinitionAst* node) override; - void visitAssignment(AssignmentAst* node) override; - void visitAnnotationAssignment(AnnotationAssignmentAst* node) override; -+ void visitAssignmentExpression(AssignmentExpressionAst* node) override; - void visitFor(ForAst* node) override; - void visitImport(ImportAst* node) override; - void visitImportFrom(ImportFromAst* node) override; -diff --git a/duchain/expressionvisitor.cpp b/duchain/expressionvisitor.cpp -index 5c5286ae..055c5b49 100644 ---- a/duchain/expressionvisitor.cpp -+++ b/duchain/expressionvisitor.cpp -@@ -757,5 +757,9 @@ void ExpressionVisitor::visitBooleanOperation(Python::BooleanOperationAst* node) - encounter(result); - } - -+void ExpressionVisitor::visitAssignmentExpression(Python::AssignmentExpressionAst* node) { -+ visitNode(node->value); -+} -+ - } - -diff --git a/duchain/expressionvisitor.h b/duchain/expressionvisitor.h -index 25ca2319..a56481ad 100644 ---- a/duchain/expressionvisitor.h -+++ b/duchain/expressionvisitor.h -@@ -81,6 +81,7 @@ class KDEVPYTHONDUCHAIN_EXPORT ExpressionVisitor : public AstDefaultVisitor, pub - void visitSetComprehension(SetComprehensionAst* node) override; - void visitIfExpression(IfExpressionAst* node) override; - void visitNameConstant(NameConstantAst* node) override; -+ void visitAssignmentExpression(AssignmentExpressionAst* node) override; - - /** - * @brief Checks for magic docstrings that override a call's return type. -diff --git a/duchain/tests/pyduchaintest.cpp b/duchain/tests/pyduchaintest.cpp -index 7142ed2b..17ba34e5 100644 ---- a/duchain/tests/pyduchaintest.cpp -+++ b/duchain/tests/pyduchaintest.cpp -@@ -838,6 +838,7 @@ void PyDUChainTest::testTypes() - QEXPECT_FAIL("init_class_no_decl", "aliasing info lost", Continue); - QEXPECT_FAIL("property_wrong", "visitCall uses declaration if no type", Continue); - QEXPECT_FAIL("property_setter", "very basic property support", Continue); -+ QEXPECT_FAIL("assignment_expr_context", "not implemented", Continue); - QCOMPARE(visitor->found, true); - } - -@@ -1302,6 +1303,21 @@ void PyDUChainTest::testTypes_data() - " def foo(self, ccc=aaa, ddd=bbb):\n" // self.bbb is visible here, Foo().aaa isn't. - " return ccc, ddd\n" - "checkme = Foo().Bar().foo()\n" << "tuple of (str, int)"; -+#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0) -+ QTest::newRow("assignment_expr_while") << -+ "file = open('foo.txt')\n" -+ "while q := file.readline():\n" -+ " checkme = q\n" << "str"; -+ QTest::newRow("assignment_expr_comprehension") << -+ "checkme = [z for q in (1, 2, 3) if (z := q % 2)]" << "list of int"; -+ QTest::newRow("assignment_expr_context") << -+ "a = [z for q in (1, 2, 3) if (z := q % 2)]\n" -+ "checkme = z" << "int"; -+ QTest::newRow("positional_params") << -+ "def foo(a, b, /, c, d):\n" -+ " return a, b, c, d\n" -+ "checkme = foo(10, 'x', 2.3, d='y')\n" << "tuple of (int, str, float, str)"; -+#endif - } - - typedef QPair pair; -@@ -1780,6 +1796,9 @@ void PyDUChainTest::testVariableCreation_data() - << QStringList{"int", "int", "float"}; - QTest::newRow("for_loop_tuple") << "for a in 1, 2: pass" << QStringList{"a"} << QStringList{"int"}; - QTest::newRow("for_loop_dict") << "for a in {'foo': 1}: pass" << QStringList{"a"} << QStringList{"str"}; -+#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0) -+ QTest::newRow("assignment_expr") << "a = (b := 10)" << QStringList{"a", "b"} << QStringList{"int", "int"}; -+#endif - } - - void PyDUChainTest::testCleanupMultiplePasses() -diff --git a/parser/ast.cpp b/parser/ast.cpp -index 9892b184..cd570d36 100644 ---- a/parser/ast.cpp -+++ b/parser/ast.cpp -@@ -163,6 +163,11 @@ ExpressionAst::ExpressionAst(Ast* parent, AstType type): Ast(parent, type), valu - - } - -+AssignmentExpressionAst::AssignmentExpressionAst(Ast* parent): ExpressionAst(parent, Ast::AssignmentExpressionAstType), value(nullptr) -+{ -+ -+} -+ - YieldFromAst::YieldFromAst(Ast* parent) : ExpressionAst(parent, Ast::YieldFromAstType) - { - -@@ -248,7 +253,7 @@ NameConstantAst::NameConstantAst(Ast* parent): ExpressionAst(parent, Ast::NameCo - - } - --NumberAst::NumberAst(Ast* parent): ExpressionAst(parent, Ast::NumberAstType), value(0) -+NumberAst::NumberAst(Ast* parent): ExpressionAst(parent, Ast::NumberAstType), value(0), isInt(false) - { - - } -diff --git a/parser/ast.h b/parser/ast.h -index 378af0bd..65fef1cd 100644 ---- a/parser/ast.h -+++ b/parser/ast.h -@@ -131,6 +131,7 @@ class KDEVPYTHONPARSER_EXPORT Ast - SliceAstType, - EllipsisAstType, - IndexAstType, -+ AssignmentExpressionAstType, - LastExpressionType, // keep this at the end of the expr ast list - - CodeAstType, -@@ -457,6 +458,13 @@ class KDEVPYTHONPARSER_EXPORT ExpressionAst : public Ast { - ExpressionAst* value; // WARNING this is not set in most cases! - }; - -+class KDEVPYTHONPARSER_EXPORT AssignmentExpressionAst : public ExpressionAst { -+public: -+ AssignmentExpressionAst(Ast* parent); -+ ExpressionAst* target; -+ ExpressionAst* value; -+}; -+ - class KDEVPYTHONPARSER_EXPORT AwaitAst : public ExpressionAst { - public: - AwaitAst(Ast* parent); -@@ -743,6 +751,7 @@ class KDEVPYTHONPARSER_EXPORT ArgumentsAst : public Ast { - ArgumentsAst(Ast* parent); - QList arguments; - QList kwonlyargs; -+ QList posonlyargs; - QList defaultValues; - ArgAst* vararg; - ArgAst* kwarg; -diff --git a/parser/astbuilder.cpp b/parser/astbuilder.cpp -index a1ccd68d..ad2e0dce 100644 ---- a/parser/astbuilder.cpp -+++ b/parser/astbuilder.cpp -@@ -101,7 +101,13 @@ CodeAst::Ptr AstBuilder::parse(const QUrl& filename, QString &contents) - PythonInitializer pyIniter(pyInitLock); - PyArena* arena = pyIniter.arena; - -+#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0) -+ PyCompilerFlags flags; -+ flags.cf_flags = PyCF_SOURCE_IS_UTF8 | PyCF_IGNORE_COOKIE | PyCF_ONLY_AST; -+ flags.cf_feature_version = 7; -+#else - PyCompilerFlags flags = {PyCF_SOURCE_IS_UTF8 | PyCF_IGNORE_COOKIE}; -+#endif - - CythonSyntaxRemover cythonSyntaxRemover; - -diff --git a/parser/astdefaultvisitor.cpp b/parser/astdefaultvisitor.cpp -index 5db1f6f1..cdd31bbf 100644 ---- a/parser/astdefaultvisitor.cpp -+++ b/parser/astdefaultvisitor.cpp -@@ -292,6 +292,12 @@ void AstDefaultVisitor::visitAnnotationAssignment(AnnotationAssignmentAst* node) - visitNode(node->value); - } - -+void AstDefaultVisitor::visitAssignmentExpression(AssignmentExpressionAst* node) -+{ -+ visitNode(node->target); -+ visitNode(node->value); -+} -+ - void AstDefaultVisitor::visitBinaryOperation(BinaryOperationAst* node) - { - visitNode(node->lhs); -diff --git a/parser/astdefaultvisitor.h b/parser/astdefaultvisitor.h -index e8e0d3de..aa1f540c 100644 ---- a/parser/astdefaultvisitor.h -+++ b/parser/astdefaultvisitor.h -@@ -49,6 +49,7 @@ class KDEVPYTHONPARSER_EXPORT AstDefaultVisitor : public AstVisitor - void visitAssignment(AssignmentAst* node) override; - void visitAugmentedAssignment(AugmentedAssignmentAst* node) override; - void visitAnnotationAssignment(AnnotationAssignmentAst* node) override; -+ void visitAssignmentExpression(AssignmentExpressionAst* node) override; - void visitFor(ForAst* node) override; - void visitWhile(WhileAst* node) override; - void visitIf(IfAst* node) override; -@@ -122,6 +123,7 @@ class KDEVPYTHONPARSER_EXPORT AstFreeVisitor : public AstDefaultVisitor { - void visitAssignment(AssignmentAst* node) override { AstDefaultVisitor::visitAssignment(node); delete node; } - void visitAugmentedAssignment(AugmentedAssignmentAst* node) override { AstDefaultVisitor::visitAugmentedAssignment(node); delete node; } - void visitAnnotationAssignment(AnnotationAssignmentAst* node) override { AstDefaultVisitor::visitAnnotationAssignment(node); delete node; } -+ void visitAssignmentExpression(AssignmentExpressionAst* node) override { AstDefaultVisitor::visitAssignmentExpression(node); delete node; } - void visitFor(ForAst* node) override { AstDefaultVisitor::visitFor(node); delete node; } - void visitWhile(WhileAst* node) override { AstDefaultVisitor::visitWhile(node); delete node; } - void visitIf(IfAst* node) override { AstDefaultVisitor::visitIf(node); delete node; } -diff --git a/parser/astvisitor.cpp b/parser/astvisitor.cpp -index ace7d619..51c5a1c5 100644 ---- a/parser/astvisitor.cpp -+++ b/parser/astvisitor.cpp -@@ -47,6 +47,7 @@ void AstVisitor::visitNode(Ast* node) - case Ast::AssignmentAstType: this->visitAssignment(static_cast(node)); break; - case Ast::AugmentedAssignmentAstType: this->visitAugmentedAssignment(static_cast(node)); break; - case Ast::AnnotationAssignmentAstType: this->visitAnnotationAssignment(static_cast(node)); break; -+ case Ast::AssignmentExpressionAstType: this->visitAssignmentExpression(static_cast(node)); break; - case Ast::ForAstType: this->visitFor(static_cast(node)); break; - case Ast::WhileAstType: this->visitWhile(static_cast(node)); break; - case Ast::IfAstType: this->visitIf(static_cast(node)); break; -diff --git a/parser/astvisitor.h b/parser/astvisitor.h -index 1908e9dd..51aa47b4 100644 ---- a/parser/astvisitor.h -+++ b/parser/astvisitor.h -@@ -61,6 +61,7 @@ class KDEVPYTHONPARSER_EXPORT AstVisitor - virtual void visitAssignment(AssignmentAst* node) { Q_UNUSED(node); }; - virtual void visitAugmentedAssignment(AugmentedAssignmentAst* node) { Q_UNUSED(node); }; - virtual void visitAnnotationAssignment(AnnotationAssignmentAst* node) { Q_UNUSED(node); }; -+ virtual void visitAssignmentExpression(AssignmentExpressionAst* node) { Q_UNUSED(node); }; - virtual void visitFor(ForAst* node) { Q_UNUSED(node); }; - virtual void visitWhile(WhileAst* node) { Q_UNUSED(node); }; - virtual void visitIf(IfAst* node) { Q_UNUSED(node); }; -diff --git a/parser/conversionGenerator.py b/parser/conversionGenerator.py -index 9d65cc0d..66055953 100644 ---- a/parser/conversionGenerator.py -+++ b/parser/conversionGenerator.py -@@ -9,7 +9,7 @@ - - import sys - --contents = open('python36.sdef').read().replace("\n", "").split(';;') -+contents = open('python38.sdef').read().replace("\n", "").split(';;') - - func_structure = ''' - Ast* visitNode(%{RULE_FOR}* node) { -@@ -45,7 +45,6 @@ - - switch_line = ''' case %{KIND}: { - %{ACTIONS} -- result = v; - break; - }''' - -@@ -139,6 +138,7 @@ def pluginAstToPythonAstType(plugintypestr): - results[rule_for] = list() - - current_actions = list() -+ created_v = False - for action in actions: - command = action.split('|')[0] - try: -@@ -204,14 +204,17 @@ def pluginAstToPythonAstType(plugintypestr): - elif command == 'create': - astType = arguments - current_actions.append(create_ast_line.replace('%{AST_TYPE}', astType)) -- -+ created_v = True -+ - if code: - current_actions.append(code); -- -+ - current_actions = "\n".join(current_actions) - if kind == 'any': - current_stmt = current_actions - else: -+ if created_v: -+ current_actions += "\n result = v;" - current_stmt = switch_line.replace('%{KIND}', kind).replace('%{ACTIONS}', current_actions) - if before_version: - version_cpp_if = ("#if PYTHON_VERSION < QT_VERSION_CHECK(%d, %d, 0)\n" -diff --git a/parser/generated.h b/parser/generated.h -index 9061deb0..e1136f84 100644 ---- a/parser/generated.h -+++ b/parser/generated.h -@@ -76,12 +76,23 @@ class PythonAstTransformer { - Ast* visitNode(_arguments* node) { - bool ranges_copied = false; Q_UNUSED(ranges_copied); - if ( ! node ) return nullptr; -+#if PYTHON_VERSION < QT_VERSION_CHECK(3, 8, 0) - ArgumentsAst* v = new ArgumentsAst(parent()); - nodeStack.push(v); v->vararg = static_cast(visitNode(node->vararg)); nodeStack.pop(); - nodeStack.push(v); v->kwarg = static_cast(visitNode(node->kwarg)); nodeStack.pop(); - nodeStack.push(v); v->arguments = visitNodeList<_arg, ArgAst>(node->args); nodeStack.pop(); - nodeStack.push(v); v->defaultValues = visitNodeList<_expr, ExpressionAst>(node->defaults); nodeStack.pop(); - nodeStack.push(v); v->kwonlyargs = visitNodeList<_arg, ArgAst>(node->kwonlyargs); nodeStack.pop(); -+#endif -+#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0) -+ ArgumentsAst* v = new ArgumentsAst(parent()); -+ nodeStack.push(v); v->vararg = static_cast(visitNode(node->vararg)); nodeStack.pop(); -+ nodeStack.push(v); v->kwarg = static_cast(visitNode(node->kwarg)); nodeStack.pop(); -+ nodeStack.push(v); v->arguments = visitNodeList<_arg, ArgAst>(node->args); nodeStack.pop(); -+ nodeStack.push(v); v->defaultValues = visitNodeList<_expr, ExpressionAst>(node->defaults); nodeStack.pop(); -+ nodeStack.push(v); v->kwonlyargs = visitNodeList<_arg, ArgAst>(node->kwonlyargs); nodeStack.pop(); -+ nodeStack.push(v); v->posonlyargs = visitNodeList<_arg, ArgAst>(node->posonlyargs); nodeStack.pop(); -+#endif - return v; - } - -@@ -280,18 +291,22 @@ class PythonAstTransformer { - break; - } - #endif -+#if PYTHON_VERSION < QT_VERSION_CHECK(3, 8, 0) - case Num_kind: { - NumberAst* v = new NumberAst(parent()); - v->isInt = PyLong_Check(node->v.Num.n); v->value = PyLong_AsLong(node->v.Num.n); - result = v; - break; - } -+#endif -+#if PYTHON_VERSION < QT_VERSION_CHECK(3, 8, 0) - case Str_kind: { - StringAst* v = new StringAst(parent()); - v->value = PyUnicodeObjectToQString(node->v.Str.s); - result = v; - break; - } -+#endif - #if PYTHON_VERSION >= QT_VERSION_CHECK(3, 6, 0) - case JoinedStr_kind: { - JoinedStringAst* v = new JoinedStringAst(parent()); -@@ -310,12 +325,14 @@ class PythonAstTransformer { - break; - } - #endif -+#if PYTHON_VERSION < QT_VERSION_CHECK(3, 8, 0) - case Bytes_kind: { - BytesAst* v = new BytesAst(parent()); - v->value = PyUnicodeObjectToQString(node->v.Bytes.s); - result = v; - break; - } -+#endif - case Attribute_kind: { - AttributeAst* v = new AttributeAst(parent()); - v->attribute = node->v.Attribute.attr ? new Python::Identifier(PyUnicodeObjectToQString(node->v.Attribute.attr)) : nullptr; -@@ -374,23 +391,42 @@ class PythonAstTransformer { - result = v; - break; - } -+#if PYTHON_VERSION < QT_VERSION_CHECK(3, 8, 0) - case Ellipsis_kind: { - EllipsisAst* v = new EllipsisAst(parent()); - result = v; - break; - } -+#endif -+#if PYTHON_VERSION < QT_VERSION_CHECK(3, 8, 0) - case NameConstant_kind: { - NameConstantAst* v = new NameConstantAst(parent()); - v->value = node->v.NameConstant.value == Py_None ? NameConstantAst::None : node->v.NameConstant.value == Py_False ? NameConstantAst::False : NameConstantAst::True; - result = v; - break; - } -+#endif - case YieldFrom_kind: { - YieldFromAst* v = new YieldFromAst(parent()); - nodeStack.push(v); v->value = static_cast(visitNode(node->v.YieldFrom.value)); nodeStack.pop(); - result = v; - break; - } -+#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0) -+ case Constant_kind: { -+PyObject *value = node->v.Constant.value;if (value == Py_None) { NameConstantAst* v = new NameConstantAst(parent()); v->value = NameConstantAst::None; result = v;}else if (value == Py_True) { NameConstantAst* v = new NameConstantAst(parent()); v->value = NameConstantAst::True; result = v;}else if (value == Py_False) { NameConstantAst* v = new NameConstantAst(parent()); v->value = NameConstantAst::False; result = v;}else if (value->ob_type == &PyLong_Type) { NumberAst* v = new NumberAst(parent()); v->isInt = true; v->value = PyLong_AsLong(value); result = v;}else if (value->ob_type == &PyFloat_Type || value->ob_type == &PyComplex_Type) { result = new NumberAst(parent());}else if (value->ob_type == &PyUnicode_Type) { StringAst* v = new StringAst(parent()); v->value = PyUnicodeObjectToQString(value); result = v;}else if (value->ob_type == &PyBytes_Type) { result = new BytesAst(parent());}else if (value->ob_type == &PyEllipsis_Type) { result = new EllipsisAst(parent());}else { qWarning() << "Unhandled constant type: " << value->ob_type->tp_name; Q_ASSERT(false);}; -+ break; -+ } -+#endif -+#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0) -+ case NamedExpr_kind: { -+ AssignmentExpressionAst* v = new AssignmentExpressionAst(parent()); -+ nodeStack.push(v); v->target = static_cast(visitNode(node->v.NamedExpr.target)); nodeStack.pop(); -+ nodeStack.push(v); v->value = static_cast(visitNode(node->v.NamedExpr.value)); nodeStack.pop(); -+ result = v; -+ break; -+ } -+#endif - default: - qWarning() << "Unsupported _expr AST type: " << node->kind; - Q_ASSERT(false); -diff --git a/parser/python36.sdef b/parser/python38.sdef -similarity index 82% -rename from parser/python36.sdef -rename to parser/python38.sdef -index f53ff1c7..30d9f95a 100644 ---- a/parser/python36.sdef -+++ b/parser/python38.sdef -@@ -73,20 +73,62 @@ if (node->v.Call.kwargs) { - v->keywords.append(kwargs); - nodeStack.pop(); - };; --RULE_FOR _expr;KIND Num_kind;ACTIONS create|NumberAst;CODE v->isInt = PyLong_Check(node->v.Num.n); v->value = PyLong_AsLong(node->v.Num.n);; --RULE_FOR _expr;KIND Str_kind;ACTIONS create|StringAst set|value$>s;; -+RULE_FOR _expr;KIND Num_kind;ACTIONS create|NumberAst;BEFORE 3.8;CODE v->isInt = PyLong_Check(node->v.Num.n); v->value = PyLong_AsLong(node->v.Num.n);; -+RULE_FOR _expr;KIND Str_kind;ACTIONS create|StringAst set|value$>s;BEFORE 3.8;; - RULE_FOR _expr;KIND JoinedStr_kind;ACTIONS create|JoinedStringAst set|values=>ExpressionAst,values;SINCE 3.6;; - RULE_FOR _expr;KIND FormattedValue_kind;ACTIONS create|FormattedValueAst set|value->ExpressionAst,value set|conversion:>conversion set|formatSpec->ExpressionAst,format_spec;SINCE 3.6;; --RULE_FOR _expr;KIND Bytes_kind;ACTIONS create|BytesAst set|value$>s;; -+RULE_FOR _expr;KIND Bytes_kind;ACTIONS create|BytesAst set|value$>s;BEFORE 3.8;; - RULE_FOR _expr;KIND Attribute_kind;ACTIONS create|AttributeAst set|attribute~>attr set|value->ExpressionAst,value set|context*>Context,ctx;; - RULE_FOR _expr;KIND Subscript_kind;ACTIONS create|SubscriptAst set|value->ExpressionAst,value set|slice->SliceAst,slice set|context*>Context,ctx;; - RULE_FOR _expr;KIND Starred_kind;ACTIONS create|StarredAst set|value->ExpressionAst,value set|context*>Context,ctx;; - RULE_FOR _expr;KIND Name_kind;ACTIONS create|NameAst set|identifier~>id set|context*>Context,ctx;; - RULE_FOR _expr;KIND List_kind;ACTIONS create|ListAst set|elements=>ExpressionAst,elts set|context*>Context,ctx;; - RULE_FOR _expr;KIND Tuple_kind;ACTIONS create|TupleAst set|elements=>ExpressionAst,elts set|context*>Context,ctx;; --RULE_FOR _expr;KIND Ellipsis_kind;ACTIONS create|EllipsisAst;; --RULE_FOR _expr;KIND NameConstant_kind;ACTIONS create|NameConstantAst set|value_>value;; -+RULE_FOR _expr;KIND Ellipsis_kind;ACTIONS create|EllipsisAst;BEFORE 3.8;; -+RULE_FOR _expr;KIND NameConstant_kind;ACTIONS create|NameConstantAst set|value_>value;BEFORE 3.8;; - RULE_FOR _expr;KIND YieldFrom_kind;ACTIONS create|YieldFromAst set|value->ExpressionAst,value;; -+RULE_FOR _expr;KIND Constant_kind;ACTIONS;SINCE 3.8;CODE -+PyObject *value = node->v.Constant.value; -+if (value == Py_None) { -+ NameConstantAst* v = new NameConstantAst(parent()); -+ v->value = NameConstantAst::None; -+ result = v; -+} -+else if (value == Py_True) { -+ NameConstantAst* v = new NameConstantAst(parent()); -+ v->value = NameConstantAst::True; -+ result = v; -+} -+else if (value == Py_False) { -+ NameConstantAst* v = new NameConstantAst(parent()); -+ v->value = NameConstantAst::False; -+ result = v; -+} -+else if (value->ob_type == &PyLong_Type) { -+ NumberAst* v = new NumberAst(parent()); -+ v->isInt = true; -+ v->value = PyLong_AsLong(value); -+ result = v; -+} -+else if (value->ob_type == &PyFloat_Type || value->ob_type == &PyComplex_Type) { -+ result = new NumberAst(parent()); -+} -+else if (value->ob_type == &PyUnicode_Type) { -+ StringAst* v = new StringAst(parent()); -+ v->value = PyUnicodeObjectToQString(value); -+ result = v; -+} -+else if (value->ob_type == &PyBytes_Type) { -+ result = new BytesAst(parent()); -+} -+else if (value->ob_type == &PyEllipsis_Type) { -+ result = new EllipsisAst(parent()); -+} -+else { -+ qWarning() << "Unhandled constant type: " << value->ob_type->tp_name; -+ Q_ASSERT(false); -+};; -+RULE_FOR _expr;KIND NamedExpr_kind;ACTIONS create|AssignmentExpressionAst set|target->ExpressionAst,target set|value->ExpressionAst,value;SINCE 3.8;; - - RULE_FOR _slice;KIND Slice_kind;ACTIONS create|SliceAst set|lower->ExpressionAst,lower set|upper->ExpressionAst,upper set|step->ExpressionAst,step;; - RULE_FOR _slice;KIND ExtSlice_kind;ACTIONS create|ExtendedSliceAst set|dims=>SliceAst,dims;; -@@ -95,7 +137,8 @@ RULE_FOR _slice;KIND Index_kind;ACTIONS create|IndexAst set|value->ExpressionAst - - RULE_FOR _comprehension;KIND any;ACTIONS create|ComprehensionAst set|target->ExpressionAst,target set|iterator->ExpressionAst,iter set|conditions=>ExpressionAst,ifs;; - RULE_FOR _excepthandler;KIND ExceptHandler_kind;ACTIONS create|ExceptionHandlerAst set|type->ExpressionAst,type set|name~>name set|body=>Ast,body;; --RULE_FOR _arguments;KIND any;ACTIONS create|ArgumentsAst set|vararg->ArgAst,vararg set|kwarg->ArgAst,kwarg set|arguments=>ArgAst,args set|defaultValues=>ExpressionAst,defaults set|kwonlyargs=>ArgAst,kwonlyargs;; -+RULE_FOR _arguments;KIND any;ACTIONS create|ArgumentsAst set|vararg->ArgAst,vararg set|kwarg->ArgAst,kwarg set|arguments=>ArgAst,args set|defaultValues=>ExpressionAst,defaults set|kwonlyargs=>ArgAst,kwonlyargs;BEFORE 3.8;; -+RULE_FOR _arguments;KIND any;ACTIONS create|ArgumentsAst set|vararg->ArgAst,vararg set|kwarg->ArgAst,kwarg set|arguments=>ArgAst,args set|defaultValues=>ExpressionAst,defaults set|kwonlyargs=>ArgAst,kwonlyargs set|posonlyargs=>ArgAst,posonlyargs;SINCE 3.8;; - RULE_FOR _arg;KIND any;ACTIONS create|ArgAst set|argumentName~>arg set|annotation->ExpressionAst,annotation;; - RULE_FOR _keyword;KIND any;ACTIONS create|KeywordAst set|argumentName~>arg set|value->ExpressionAst,value;; - RULE_FOR _alias;KIND any;ACTIONS create|AliasAst set|name~>name set|asName~>asname;; -diff --git a/parser/tests/pyasttest.cpp b/parser/tests/pyasttest.cpp -index 4fd5f4eb..c28f6fce 100644 ---- a/parser/tests/pyasttest.cpp -+++ b/parser/tests/pyasttest.cpp -@@ -238,6 +238,11 @@ void PyAstTest::testExpressions_data() - " **{ext: self.res_extension for ext in self._rc_extensions + self._mc_extensions},\n" - "}"; - #endif -+#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0) -+ QTest::newRow("assignment_expr_1") << "a = (b := 10)"; -+ QTest::newRow("assignment_expr_2") << "a = [q for z in (1, 2, 3) if (q := 2*z)]"; -+ QTest::newRow("positional_params") << "def foo(a, b, /, c, d, *, e): pass"; -+#endif - } - - void PyAstTest::testCorrectedFuncRanges() diff --git a/kde/patch/kdewebdev.patch b/kde/patch/kdewebdev.patch deleted file mode 100644 index 4bbe65b..0000000 --- a/kde/patch/kdewebdev.patch +++ /dev/null @@ -1,6 +0,0 @@ -# Make it find tidy: -cat $CWD/patch/kdewebdev/include-tidy.patch \ - | sed -e "s#/tmp/package-kdewebdev#${SLACK_KDE_BUILD_DIR}/$(echo ${module} |cut -f1 -d:)/package-kdewebdev#" \ - | patch -p0 --verbose \ - || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kdewebdev/include-tidy.patch b/kde/patch/kdewebdev/include-tidy.patch deleted file mode 100644 index fd4de94..0000000 --- a/kde/patch/kdewebdev/include-tidy.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- klinkstatus/src/tidy/tidyx.h.orig 2009-09-03 09:55:38.886267704 -0500 -+++ klinkstatus/src/tidy/tidyx.h 2009-09-03 09:57:29.032269520 -0500 -@@ -48,8 +48,8 @@ - Created 2002-07-11 by Charles Reitzel - */ - --#include --#include -+#include "/tmp/package-kdewebdev/usr/include/tidy/tidy.h" -+#include "/tmp/package-kdewebdev/usr/include/tidy/buffio.h" - - #include - diff --git a/kde/patch/kholidays.patch b/kde/patch/kholidays.patch deleted file mode 100644 index ec8ad80..0000000 --- a/kde/patch/kholidays.patch +++ /dev/null @@ -1,8 +0,0 @@ -# Fix for "error: isnan was not declared in this scope" -# Fixed post Plasma 5.5.5. -#cat $CWD/patch/kholidays/kholidays_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Revert depfreeze breaking merges (KF5_VERSION, cmake, PIM_VERSION). -# Should be fixed in Applications > 16.12.3. -#cat $CWD/patch/kholidays/kholidays_depfreeze_revert.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kholidays/kholidays_depfreeze_revert.patch b/kde/patch/kholidays/kholidays_depfreeze_revert.patch deleted file mode 100644 index 316403a..0000000 --- a/kde/patch/kholidays/kholidays_depfreeze_revert.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 506bd08a6faf61c776beecb05f1acbe04223827a Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Fri, 10 Mar 2017 13:33:10 +0100 -Subject: Revert depfreeze breaking merges (KF5_VERSION, cmake, PIM_VERSION) - ---- - CMakeLists.txt | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 05164db..e0b67b8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,28 +1,28 @@ --cmake_minimum_required(VERSION 3.0) --set(PIM_VERSION "5.4.40") -+cmake_minimum_required(VERSION 2.8.12) - --project(KHolidays VERSION ${PIM_VERSION}) -+project(KHolidays) - - # ECM setup --set(KF5_VERSION "5.31.0") -+set(KF5_VERSION "5.28.0") - find_package(ECM ${KF5_VERSION} CONFIG REQUIRED) - set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) - - include(GenerateExportHeader) - include(ECMGenerateHeaders) - include(ECMGeneratePriFile) --include(CMakePackageConfigHelpers) -+include(ECMPackageConfigHelpers) - include(ECMSetupVersion) - include(ECMPoQmTools) - include(FeatureSummary) - include(KDEInstallDirs) - include(KDECMakeSettings) - include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) --include(ECMCoverageOption) -+ -+set(PIM_VERSION "5.4.3") - - set(KHOLIDAYS_LIB_VERSION ${PIM_VERSION}) - --ecm_setup_version(PROJECT VARIABLE_PREFIX KHOLIDAYS -+ecm_setup_version(${KHOLIDAYS_LIB_VERSION} VARIABLE_PREFIX KHOLIDAYS - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kholidays_version.h" - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5HolidaysConfigVersion.cmake" - SOVERSION 5 -@@ -50,7 +50,7 @@ endif() - ########### CMake Config Files ########### - set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Holidays") - --configure_package_config_file( -+ecm_configure_package_config_file( - "${CMAKE_CURRENT_SOURCE_DIR}/KF5HolidaysConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/KF5HolidaysConfig.cmake" - INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} --- -cgit v0.11.2 - diff --git a/kde/patch/kholidays/kholidays_isnan.patch b/kde/patch/kholidays/kholidays_isnan.patch deleted file mode 100644 index 55e79aa..0000000 --- a/kde/patch/kholidays/kholidays_isnan.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Milian Wolff -Date: Mon, 07 Mar 2016 09:58:37 +0000 -Subject: Fix compile with clang: isnan is in the std namespace when including cmath. -X-Git-Url: http://quickgit.kde.org/?p=kholidays.git&a=commitdiff&h=488aa158f7a0a99604a13a897a11388c02f8d39e ---- -Fix compile with clang: isnan is in the std namespace when including cmath. ---- - - ---- a/src/sunriseset.cpp -+++ b/src/sunriseset.cpp -@@ -180,7 +180,7 @@ - double hourAngle = calcHourAngleSunrise(latitude, solarDec); - double delta = longitude + radToDeg(hourAngle); - QTime timeUTC(0, 0); -- if (isnan(delta)) -+ if (std::isnan(delta)) - return timeUTC; - timeUTC = timeUTC.addSecs((720 - (4.0 * delta) - eqTime) * 60); - return QTime(timeUTC.hour(), -@@ -199,7 +199,7 @@ - double hourAngle = -calcHourAngleSunrise(latitude, solarDec); - double delta = longitude + radToDeg(hourAngle); - QTime timeUTC(0, 0); -- if (isnan(delta)) -+ if (std::isnan(delta)) - return timeUTC; - timeUTC = timeUTC.addSecs((720 - (4.0 * delta) - eqTime) * 60); - return QTime(timeUTC.hour(), - diff --git a/kde/patch/kinfocenter.patch b/kde/patch/kinfocenter.patch index 5a65977..b57d434 100644 --- a/kde/patch/kinfocenter.patch +++ b/kde/patch/kinfocenter.patch @@ -1,3 +1,2 @@ # Fix linking error : cat $CWD/patch/kinfocenter/kinfocenter_libpci.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kio.patch b/kde/patch/kio.patch deleted file mode 100644 index e943096..0000000 --- a/kde/patch/kio.patch +++ /dev/null @@ -1,18 +0,0 @@ -# Add search paths for kdelibs4 documentation to khelpcenter. -# Patch taken from kubuntu: -#cat $CWD/patch/kio/kio_kdelibs4_docpatch.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# KDEBUG #350769 (fixed in Frameworks 5.16.0): -# Move konqpopupmenuplugin.desktop from kde-baseapps (kdelibs4 based) -# to kio (kf5 based) to make service menus visible in dolphin (kf5 based): -#cat $CWD/patch/kio/kio_dolphin_servicemenus.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Qt >= 5.9.3 breaks creation of folders in kio, which affects e.g. -# Dolphin and Plasma Folder View. -# Fixed in KIO 5.41: -#cat $CWD/patch/kio/kio_fix_url_setpath.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix crash when accessing help:// -# Fixed in KIO 5.52: -#cat $CWD/patch/kio/kio_KDEBUG_399709.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kio/kio_KDEBUG_399709.patch b/kde/patch/kio/kio_KDEBUG_399709.patch deleted file mode 100644 index 0a8cfdc..0000000 --- a/kde/patch/kio/kio_KDEBUG_399709.patch +++ /dev/null @@ -1,44 +0,0 @@ -From cf3b0d102855a4a90db3fb65a99e0009fcdd3755 Mon Sep 17 00:00:00 2001 -From: Michael Pyne -Date: Sat, 13 Oct 2018 19:09:50 -0400 -Subject: kio_help: Fix crash in QCoreApplication when accessing help://. - -A recent commit d428fc8e6447ede81f1e1911d0b66b39265672f3 removed old -custom crash handling code in favor of KCrash. But this actually adds a -dependency on there being a valid QCoreApplication object. - -I took from the example of the similar kio_file to simply create the -QCoreApplication here. - -BUG:399709 - -Differential Revision: https://phabricator.kde.org/D16189 ---- - src/ioslaves/help/main.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/ioslaves/help/main.cpp b/src/ioslaves/help/main.cpp -index f09987a..f800a9d 100644 ---- a/src/ioslaves/help/main.cpp -+++ b/src/ioslaves/help/main.cpp -@@ -10,6 +10,7 @@ extern "C" int xmlLoadExtDtdDefaultValue; - - #include - -+#include - #include - - #include -@@ -40,6 +41,9 @@ extern "C" - { - Q_DECL_EXPORT int kdemain(int argc, char **argv) - { -+ QCoreApplication app(argc, argv); // needed for KCrash -+ app.setApplicationName(QStringLiteral("kio_help")); -+ - KDocTools::setupStandardDirs(); - - //qDebug() << "Starting " << getpid(); --- -cgit v0.11.2 - diff --git a/kde/patch/kio/kio_dolphin_servicemenus.patch b/kde/patch/kio/kio_dolphin_servicemenus.patch deleted file mode 100644 index 811bfea..0000000 --- a/kde/patch/kio/kio_dolphin_servicemenus.patch +++ /dev/null @@ -1,126 +0,0 @@ -From: Frank Reininghaus -Date: Sat, 03 Oct 2015 07:26:33 +0000 -Subject: Move konqpopupmenuplugin.desktop from kde-baseapps to kio -X-Git-Url: http://quickgit.kde.org/?p=kio.git&a=commitdiff&h=4b24b70c93523c5bc56c90c04a5a666331e96a1b ---- -Move konqpopupmenuplugin.desktop from kde-baseapps to kio - -This ensures that service menu entries are shown if the unreleased -KF5-based version of lib/konq from kde-baseapps is not installed - -It would be great if the translations from lib/konq in kde-baseapps -could be merged. Thanks! - -BUG: 350769 -Change-Id: Id2c9a73ce95a6c8b704f3a1000c0292d1864a352 -REVIEW: 125425 -CCMAIL: luigi.toscano@tiscali.it ---- -Slightly modified by Eric Hameleers ---- -diff -uarN kio-5.15.0.orig/src/widgets/CMakeLists.txt kio-5.15.0/src/widgets/CMakeLists.txt ---- kio-5.15.0.orig/src/widgets/CMakeLists.txt 2015-10-05 10:11:41.000000000 +0200 -+++ kio-5.15.0/src/widgets/CMakeLists.txt 2015-10-18 14:14:15.461196097 +0200 -@@ -184,6 +184,7 @@ - kfileitemactionplugin.desktop - kpropertiesdialogplugin.desktop - kurifilterplugin.desktop -+ konqpopupmenuplugin.desktop - kiodndpopupmenuplugin.desktop - DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR} ) - -diff -uarN kio-5.15.0.orig/src/widgets/konqpopupmenuplugin.desktop kio-5.15.0/src/widgets/konqpopupmenuplugin.desktop ---- kio-5.15.0.orig/src/widgets/konqpopupmenuplugin.desktop 1970-01-01 01:00:00.000000000 +0100 -+++ kio-5.15.0/src/widgets/konqpopupmenuplugin.desktop 2015-10-18 14:17:09.078193339 +0200 -@@ -0,0 +1,89 @@ -+[Desktop Entry] -+Type=ServiceType -+X-KDE-ServiceType=KonqPopupMenu/Plugin -+Comment=Plugin for the Konqueror Popup Menu -+Comment[af]=Inplak vir die Konqueror Opspring Kieslys -+Comment[ar]=ملحق لقائمة كونكيورر المنبثقة -+Comment[as]=Konqueror প'প-আপ তালিকাৰ কাৰণে প্লাগ-ইন -+Comment[ast]=Complementu pal menú emerxente de Konqueror -+Comment[be]=Утулка для выплыўнага меню Konqueror -+Comment[be@latin]=Plugin dla vypłyŭnoha menu prahramy „Konqueror” -+Comment[bg]=Приставка за контекстното меню на браузъра -+Comment[bn]=কনকরার পপ-আপ মেনুর জন্য প্লাগ-ইন -+Comment[bn_IN]=Konqueror পপ-আপ মেনুর প্লাগ-ইন -+Comment[bs]=Priključak za K‑osvajačev iskačući meni -+Comment[ca]=Connector per al menú emergent del Konqueror -+Comment[ca@valencia]=Connector per al menú emergent del Konqueror -+Comment[cs]=Modul pro kontextovou nabídku Konqueroru -+Comment[csb]=Wtëkôcz do menu (òtmëkô knąpą mëszë) Konquerora -+Comment[cy]=Ategyn i Naidlen Konqueror -+Comment[da]=Plugin for Konquerors popop-menu -+Comment[de]=Erweiterung für das Aufklapp-Menü von Konqueror -+Comment[el]=Πρόσθετο για το αναδυόμενο μενού του Konqueror -+Comment[en_GB]=Plugin for the Konqueror Popup Menu -+Comment[eo]=Kromprogrameto por la spruĉmenuo de Konkeranto -+Comment[es]=Complemento para el menú emergente de Konqueror -+Comment[et]=Konquerori hüpikmenüü plugin -+Comment[eu]=Konquerorren laster-menuetarako plugina -+Comment[fa]=وصله برای گزینگان بالاپر Konqueror -+Comment[fi]=Konquerorin ponnahdusvalikkoliitännäinen -+Comment[fr]=Module externe pour le menu contextuel de Konqueror -+Comment[fy]=Plugin foar Konqueror's fluesmenu -+Comment[ga]=Breiseán le haghaidh Roghchláir Aníos Konqueror -+Comment[gl]=Complemento para o menú contextual de Konqueror -+Comment[gu]=કોન્કરર પોપઅપ મેનુ માટે પ્લગઇન -+Comment[he]=תוסף לתפריט המוקפץ של Konqueror -+Comment[hi]=कॉन्करर पॉपअप मेन्यू के लिए प्लगइन -+Comment[hne]=कान्करर पापअप मेन्यू बर प्लगइन -+Comment[hr]=Dodatak za Konqueror pop-up izbornik -+Comment[hsb]=zašćěpka za popup-meni w konqueroru -+Comment[hu]=Bővítőmodul a Konqueror felbukkanó menühöz -+Comment[ia]=Plugin pro le Menu de Popup de Konqueror -+Comment[id]=Plugin untuk Menu Popup Konqueror -+Comment[is]=Íforrit fyrir sprettvalmynd Konqueror Popup Menu -+Comment[it]=Estensione per il menu a comparsa di Konqueror -+Comment[ja]=Konqueror ポップアップメニューのプラグイン -+Comment[ka]=Konqueror-ის ჩამოშლადი მენიუს პლაგინი -+Comment[kk]=Konqueror баптау қалқымалы мәзір плагині -+Comment[km]=កម្មវិធី​ជំនួយ​សម្រាប់​ម៉ឺនុយ​លេច​ឡើង​របស់​ Konqueror -+Comment[kn]=ಕಾಂಕರ್ ಪುಟಿಕೆ (ಪಾಪಪ್) ಪರಿವಿಡಿಗೆ ಮಿಳಿತಾನ್ವಯ (ಪ್ಲಗಿನ್) -+Comment[ko]=Konqueror 팝업 메뉴 플러그인 -+Comment[ku]=Pêveka ji bo Pêşeka Hilpekîn a Konquerorê -+Comment[lt]=Priedas pasirodančiam Konqueror meniu -+Comment[lv]=Konqueror izlecošās izvēlnes spraudnis -+Comment[mai]=कान्करर पापअप मेनू क' लेल प्लगइन -+Comment[mk]=Приклучок за контекстното мени на Konqueror -+Comment[ml]=കോണ്‍ക്വററിന്റെ പൊങ്ങിവരുന്ന മെനുവിനുള്ള സംയോജകം -+Comment[mr]=कॉन्करर पॉपअप मेन्यू करिता प्लगइन -+Comment[ms]=Plugin untuk Menu Popuo Konqueror -+Comment[nds]=Plugin för dat Konqueror-Opdukmenü -+Comment[ne]=कन्क्वेरर पपअप मेनुका लागि प्लगइन -+Comment[nl]=Plugin voor Konqueror's contextmenu -+Comment[or]=Konqueror ପପଅପ ତାଲିକା ପାଇଁ ପ୍ଲଗଇନ -+Comment[pa]=ਕੋਨਕਿਉਰੋਰ ਪਾਪਅੱਪ ਮੇਨੂ ਲਈ ਪਲੱਗਇਨ -+Comment[pl]=Wtyczka do menu (otwieranego przyciskiem myszy) Konquerora -+Comment[pt]='Plugin' para o Menu do Konqueror -+Comment[pt_BR]=Plugin do Konqueror para menus de contexto -+Comment[ro]=Extensie pentru meniul popup Konqueror -+Comment[ru]=Расширение контекстного меню Konqueror -+Comment[si]=Konqueror පොප් අප් මෙනුව සඳහා ප්ලගිනය -+Comment[sk]=Modul pre kontextové menu Konquerora -+Comment[sl]=Vstavek za Konquerorjev pojavni meni -+Comment[sr]=Прикључак за К‑освајачев искачући мени -+Comment[sr@ijekavian]=Прикључак за К‑освајачев искачући мени -+Comment[sr@ijekavianlatin]=Priključak za K‑osvajačev iskačući meni -+Comment[sr@latin]=Priključak za K‑osvajačev iskačući meni -+Comment[sv]=Insticksprogram för Konquerors popupmeny -+Comment[ta]=கான்கொரர் தோன்றும் பட்டிக்கான செருகல்கள் -+Comment[te]=Konqueror పాప్అప్ మెనూకొరకు ప్లగ్ఇన్ -+Comment[tg]=Плагин барои менюи пайдошавии Konqueror -+Comment[th]=ส่วนเสริมการทำงานสำหรับเมนูผุดของคอนเควอร์เรอร์ -+Comment[tr]=Konqueror Açılabilir Menüsü İçin Eklenti -+Comment[ug]=Konqueror قاڭقىش تىزىملىكىنىڭ قىستۇرمىسى -+Comment[uk]=Додаток контекстного меню Konqueror -+Comment[vi]=Trình bổ sung cho Trình đơn Bật lên của Konqueror -+Comment[wa]=Tchôke-divins po l' aspitant menu di Konqueror -+Comment[xh]=Iplagi efakiweyo ye Konqueror ye Popup Menu -+Comment[x-test]=xxPlugin for the Konqueror Popup Menuxx -+Comment[zh_CN]=Konqueror 弹出菜单插件 -+Comment[zh_TW]=Konqueror 彈出式選單的外掛程式 - - diff --git a/kde/patch/kio/kio_fix_url_setpath.patch b/kde/patch/kio/kio_fix_url_setpath.patch deleted file mode 100644 index d9cf740..0000000 --- a/kde/patch/kio/kio_fix_url_setpath.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 2353119aae8f03565bc7779ed1d597d266f5afda Mon Sep 17 00:00:00 2001 -From: Elvis Angelaccio -Date: Thu, 16 Nov 2017 10:41:19 +0100 -Subject: Fix KIO::mkpath with qtbase 5.10 beta 4 - -Summary: -The latest Qt 5.10 beta includes [1] which breaks a bunch of unit tests, -since `url.setPath("//foo")` will now result in an invalid (empty) QUrl. - -This patch fixes the KIO::mkpath() case. - -[1]: http://code.qt.io/cgit/qt/qtbase.git/commit/?id=f62768d046528636789f901ac79e2cfa1843a7b7 - -Test Plan: - -* I can now create folders from dolphin and plasma. -* fileundomanagertest and mkpathjobtest no longer fail - -Reviewers: #frameworks, dfaure - -Tags: #frameworks - -Differential Revision: https://phabricator.kde.org/D8836 ---- - src/core/mkpathjob.cpp | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - -diff --git a/src/core/mkpathjob.cpp b/src/core/mkpathjob.cpp -index bff46ca..a177805 100644 ---- a/src/core/mkpathjob.cpp -+++ b/src/core/mkpathjob.cpp -@@ -43,8 +43,13 @@ public: - m_url.setPath(QStringLiteral("/")); - int i = 0; - for (; i < basePathComponents.count() && i < m_pathComponents.count(); ++i) { -- if (m_pathComponents.at(i) == basePathComponents.at(i)) { -- m_url.setPath(m_url.path() + '/' + m_pathComponents.at(i)); -+ const QString pathComponent = m_pathComponents.at(i); -+ if (pathComponent == basePathComponents.at(i)) { -+ if (m_url.path() == QLatin1Char('/')) { -+ m_url.setPath(m_url.path() + pathComponent); -+ } else { -+ m_url.setPath(m_url.path() + '/' + pathComponent); -+ } - } else { - break; - } -@@ -57,7 +62,13 @@ public: - if (m_url.isLocalFile()) { - i = 0; - for (; i < m_pathComponents.count(); ++i) { -- QString testDir = m_url.toLocalFile() + '/' + m_pathComponents.at(i); -+ const QString localFile = m_url.toLocalFile(); -+ QString testDir; -+ if (localFile == QLatin1Char('/')) { -+ testDir = localFile + m_pathComponents.at(i); -+ } else { -+ testDir = localFile + '/' + m_pathComponents.at(i); -+ } - if (QFileInfo(testDir).isDir()) { - m_url.setPath(testDir); - } else { --- -cgit v0.11.2 - diff --git a/kde/patch/kio/kio_kdelibs4_docpatch.patch b/kde/patch/kio/kio_kdelibs4_docpatch.patch deleted file mode 100644 index 9549d31..0000000 --- a/kde/patch/kio/kio_kdelibs4_docpatch.patch +++ /dev/null @@ -1,22 +0,0 @@ -Description: add search paths for kdelibs4 docs -Author: Jonathan Riddell -Origin: me -Forwarded: no, kdelibs4 path was set in debian/kubuntu packages -Applied-Upstream: nope -Reviewed-by: Jonathan Riddell -Last-Update: 2015-03-01 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- kio/src/ioslaves/help/kio_help.cpp 2015-03-07 15:45:21.000000000 +0100 -+++ kio/src/ioslaves/help/kio_help.cpp 2015-04-02 17:15:39.687828131 +0200 -@@ -49,7 +49,8 @@ - QStringList search; - - // assemble the local search paths -- const QStringList localDoc = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/HTML", QStandardPaths::LocateDirectory); -+ QStringList localDoc = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/HTML", QStandardPaths::LocateDirectory); -+ localDoc << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/kde/HTML", QStandardPaths::LocateDirectory); - - QStringList langs = QLocale().uiLanguages(); - langs.append("en"); - diff --git a/kde/patch/kirigami2.patch b/kde/patch/kirigami2.patch deleted file mode 100644 index 9a997b3..0000000 --- a/kde/patch/kirigami2.patch +++ /dev/null @@ -1,8 +0,0 @@ -# Fix crashes in systemsettings5 when visiting the second icon. -# Should be fixed post kirigami2 5.64.0): -#cat $CWD/patch/kirigami2/kirigami_iconview_crash.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Make headerParent correctly aligned when there is a scrollbar: -# Should be fixed post kirigami2 5.67.0): -#cat $CWD/patch/kirigami2/kirigami_scrollbar.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kirigami2/kirigami_iconview_crash.patch b/kde/patch/kirigami2/kirigami_iconview_crash.patch deleted file mode 100644 index 79a35ed..0000000 --- a/kde/patch/kirigami2/kirigami_iconview_crash.patch +++ /dev/null @@ -1,143 +0,0 @@ -diff --git a/src/columnview.cpp b/src/columnview.cpp ---- a/src/columnview.cpp -+++ b/src/columnview.cpp -@@ -37,23 +37,37 @@ - public: - QmlComponentsPoolSingleton() - {} -- -- QmlComponentsPool self; -+ static QmlComponentsPool *instance(QQmlEngine *engine); -+private: -+ QHash m_instances; - }; - - Q_GLOBAL_STATIC(QmlComponentsPoolSingleton, privateQmlComponentsPoolSelf) - - --QmlComponentsPool::QmlComponentsPool(QObject *parent) -- : QObject(parent) --{} -- --void QmlComponentsPool::initialize(QQmlEngine *engine) -+QmlComponentsPool *QmlComponentsPoolSingleton::instance(QQmlEngine *engine) - { -- if (!engine || m_instance) { -- return; -+ Q_ASSERT(engine); -+ auto componentPool = privateQmlComponentsPoolSelf->m_instances.value(engine); -+ -+ if (componentPool) { -+ return componentPool; - } - -+ componentPool = new QmlComponentsPool(engine); -+ -+ QObject::connect(componentPool, &QObject::destroyed, [engine]() { -+ if (privateQmlComponentsPoolSelf) { -+ privateQmlComponentsPoolSelf->m_instances.remove(engine); -+ } -+ }); -+ privateQmlComponentsPoolSelf->m_instances[engine] = componentPool; -+ return componentPool; -+} -+ -+QmlComponentsPool::QmlComponentsPool(QQmlEngine *engine) -+ : QObject(engine) -+{ - QQmlComponent *component = new QQmlComponent(engine, this); - - component->setData(QByteArrayLiteral("import QtQuick 2.7\n" -@@ -572,12 +586,12 @@ - QQuickItem *separatorItem = m_separators.value(item); - - if (!separatorItem) { -- separatorItem = qobject_cast(privateQmlComponentsPoolSelf->self.m_separatorComponent->beginCreate(QQmlEngine::contextForObject(item))); -+ separatorItem = qobject_cast(privateQmlComponentsPoolSelf->instance(qmlEngine(item))->m_separatorComponent->beginCreate(QQmlEngine::contextForObject(item))); - if (separatorItem) { - separatorItem->setParentItem(item); - separatorItem->setZ(9999); - separatorItem->setProperty("column", QVariant::fromValue(item)); -- privateQmlComponentsPoolSelf->self.m_separatorComponent->completeCreate(); -+ QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_separatorComponent->completeCreate(); - m_separators[item] = separatorItem; - } - } -@@ -590,12 +604,12 @@ - QQuickItem *separatorItem = m_rightSeparators.value(item); - - if (!separatorItem) { -- separatorItem = qobject_cast(privateQmlComponentsPoolSelf->self.m_rightSeparatorComponent->beginCreate(QQmlEngine::contextForObject(item))); -+ separatorItem = qobject_cast(QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_rightSeparatorComponent->beginCreate(QQmlEngine::contextForObject(item))); - if (separatorItem) { - separatorItem->setParentItem(item); - separatorItem->setZ(9999); - separatorItem->setProperty("column", QVariant::fromValue(item)); -- privateQmlComponentsPoolSelf->self.m_rightSeparatorComponent->completeCreate(); -+ QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_rightSeparatorComponent->completeCreate(); - m_rightSeparators[item] = separatorItem; - } - } -@@ -759,7 +773,7 @@ - void ColumnView::setColumnWidth(qreal width) - { - // Always forget the internal binding when the user sets anything, even the same value -- disconnect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::gridUnitChanged, this, nullptr); -+ disconnect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::gridUnitChanged, this, nullptr); - - if (m_contentItem->m_columnWidth == width) { - return; -@@ -902,7 +916,7 @@ - - void ColumnView::setScrollDuration(int duration) - { -- disconnect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::longDurationChanged, this, nullptr); -+ disconnect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::longDurationChanged, this, nullptr); - - if (m_contentItem->m_slideAnim->duration() == duration) { - return; -@@ -1392,22 +1406,20 @@ - - void ColumnView::classBegin() - { -- privateQmlComponentsPoolSelf->self.initialize(qmlEngine(this)); -- - auto syncColumnWidth = [this]() { -- m_contentItem->m_columnWidth = privateQmlComponentsPoolSelf->self.m_units->property("gridUnit").toInt() * 20; -+ m_contentItem->m_columnWidth = privateQmlComponentsPoolSelf->instance(qmlEngine(this))->m_units->property("gridUnit").toInt() * 20; - emit columnWidthChanged(); - }; - -- connect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::gridUnitChanged, this, syncColumnWidth); -+ connect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::gridUnitChanged, this, syncColumnWidth); - syncColumnWidth(); - - auto syncDuration = [this]() { -- m_contentItem->m_slideAnim->setDuration(privateQmlComponentsPoolSelf->self.m_units->property("longDuration").toInt()); -+ m_contentItem->m_slideAnim->setDuration(QmlComponentsPoolSingleton::instance(qmlEngine(this))->m_units->property("longDuration").toInt()); - emit scrollDurationChanged(); - }; - -- connect(&privateQmlComponentsPoolSelf->self, &QmlComponentsPool::longDurationChanged, this, syncDuration); -+ connect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::longDurationChanged, this, syncDuration); - syncDuration(); - - QQuickItem::classBegin(); -diff --git a/src/columnview_p.h b/src/columnview_p.h ---- a/src/columnview_p.h -+++ b/src/columnview_p.h -@@ -32,11 +32,9 @@ - Q_OBJECT - - public: -- QmlComponentsPool(QObject *parent = nullptr); -+ QmlComponentsPool(QQmlEngine *engine); - ~QmlComponentsPool(); - -- void initialize(QQmlEngine *engine); -- - QQmlComponent *m_separatorComponent = nullptr; - QQmlComponent *m_rightSeparatorComponent = nullptr; - QObject *m_units = nullptr; - - diff --git a/kde/patch/kirigami2/kirigami_scrollbar.patch b/kde/patch/kirigami2/kirigami_scrollbar.patch deleted file mode 100644 index e81bf0e..0000000 --- a/kde/patch/kirigami2/kirigami_scrollbar.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f695cde36a6829b8b92b2fd82deff16d9385fcb9 Mon Sep 17 00:00:00 2001 -From: Marco Martin -Date: Mon, 10 Feb 2020 11:48:50 +0100 -Subject: make headerParent correctly alignedwhen there is a scrollbar - ---- - src/controls/GlobalDrawer.qml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/controls/GlobalDrawer.qml b/src/controls/GlobalDrawer.qml -index 0e8e512..9166ad7 100644 ---- a/src/controls/GlobalDrawer.qml -+++ b/src/controls/GlobalDrawer.qml -@@ -301,6 +301,7 @@ OverlayDrawer { - anchors { - left: parent.left - right: parent.right -+ rightMargin: Math.min(0, -scrollView.width + mainFlickable.width) - } - spacing: 0 - y: bannerImage.visible ? Math.max(headerContainer.height, -mainFlickable.contentY) - height : 0 --- -cgit v1.1 - - diff --git a/kde/patch/kmail.patch b/kde/patch/kmail.patch deleted file mode 100644 index 0cbf394..0000000 --- a/kde/patch/kmail.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Fix kontact crash on logout (KDEBUG 404881). -# Fixed post 19.04.2. -#cat $CWD/patch/kmail/kmail_kontact_kdebug_404881.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kmail/kmail_kontact_kdebug_404881.patch b/kde/patch/kmail/kmail_kontact_kdebug_404881.patch deleted file mode 100644 index f2704aa..0000000 --- a/kde/patch/kmail/kmail_kontact_kdebug_404881.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 97e165dcf5a851ee10526631d24f9af7736da2e6 Mon Sep 17 00:00:00 2001 -From: David Faure -Date: Thu, 6 Jun 2019 18:10:42 +0200 -Subject: Fix kontact crash on logout. - -Summary: -KMail was creating new Akonadi jobs during mainwindow destruction, -due to not testing the bool in GuiActivateEvent. - -Same bt in bug 404881, apparently quitting from the akregator tray icon -[which quits all of kontact... separate issue...] gave the same crash. - -BUG: 404881 -FIXED-IN: 19.04.2 - -Test Plan: Run kontact, logout. Hello Drkonqi. - -Reviewers: mlaurent, winterz - -Reviewed By: mlaurent, winterz - -Subscribers: kde-pim - -Tags: #kde_pim - -Differential Revision: https://phabricator.kde.org/D21626 ---- - src/kmail_part.cpp | 23 ++++++++++++----------- - 1 file changed, 12 insertions(+), 11 deletions(-) - -diff --git a/src/kmail_part.cpp b/src/kmail_part.cpp -index 703a1ee..96c4c07 100644 ---- a/src/kmail_part.cpp -+++ b/src/kmail_part.cpp -@@ -33,6 +33,7 @@ - - #include - -+#include - #include - #include - #include -@@ -129,18 +130,18 @@ bool KMailPart::openFile() - void KMailPart::guiActivateEvent(KParts::GUIActivateEvent *e) - { - KParts::ReadOnlyPart::guiActivateEvent(e); -- mainWidget->initializeFilterActions(); -- mainWidget->tagActionManager()->createActions(); -- mainWidget->folderShortcutActionManager()->createActions(); -- mainWidget->populateMessageListStatusFilterCombo(); -- mainWidget->initializePluginActions(); -- /* -- FIXME it doesn't work when we switch component. -- const QString title = mainWidget->fullCollectionPath(); -- if (!title.isEmpty()) { -- Q_EMIT setWindowCaption(title); -+ if (e->activated()) { -+ mainWidget->initializeFilterActions(); -+ mainWidget->tagActionManager()->createActions(); -+ mainWidget->folderShortcutActionManager()->createActions(); -+ mainWidget->populateMessageListStatusFilterCombo(); -+ mainWidget->initializePluginActions(); -+ -+ const QString title = mainWidget->fullCollectionPath(); -+ if (!title.isEmpty()) { -+ Q_EMIT setWindowCaption(title); -+ } - } -- */ - } - - void KMailPart::exit() --- -cgit v1.1 - diff --git a/kde/patch/kmplot.patch b/kde/patch/kmplot.patch deleted file mode 100644 index aee60a5..0000000 --- a/kde/patch/kmplot.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix for "error: isnan was not declared in this scope" -#cat $CWD/patch/kmplot/kmplot_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kmplot/kmplot_isnan.patch b/kde/patch/kmplot/kmplot_isnan.patch deleted file mode 100644 index 691ff89..0000000 --- a/kde/patch/kmplot/kmplot_isnan.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- kmplot-15.12.3/kmplot/view.cpp.0 2016-03-11 21:19:48.011194225 +0000 -+++ kmplot-15.12.3/kmplot/view.cpp 2016-03-11 21:20:37.341056493 +0000 -@@ -476,7 +476,7 @@ - double x = pixel.x(); - double y = pixel.y(); - -- if ( isnan(x) ) -+ if ( std::isnan(x) ) - { - xclipflg = true; - x = pixelIfNaN.x(); -@@ -496,14 +496,14 @@ - } - else - { -- if ( isinf(x) == -1 ) -+ if ( std::isinf(x) == -1 ) - x = 0; - -- else if ( isinf(x) == 1 ) -+ else if ( std::isinf(x) == 1 ) - x = m_clipRect.right(); - } - -- if ( isnan(y) ) -+ if ( std::isnan(y) ) - { - yclipflg = true; - y = pixelIfNaN.y(); -@@ -523,10 +523,10 @@ - } - else - { -- if ( isinf(y) == -1 ) -+ if ( std::isinf(y) == -1 ) - y = 0; - -- else if ( isinf(y) == 1 ) -+ else if ( std::isinf(y) == 1 ) - y = m_clipRect.bottom(); - } - diff --git a/kde/patch/konsole.patch b/kde/patch/konsole.patch deleted file mode 100644 index b296ad1..0000000 --- a/kde/patch/konsole.patch +++ /dev/null @@ -1,16 +0,0 @@ -# Set TERM to 'konsole' instead of the default 'xterm-256color' -# to prevent garbled text under certain conditions: -# Reverted to default behaviour in 18.04.0 after Slackware did the same: -#cat $CWD/patch/konsole/konsole.term.is.konsole.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix rendering of cursor if non-default theme is selected -# (fixed post 18.12.3): -#cat $CWD/patch/konsole/konsole.cursor.antialias.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix crash when closing session in KonsolePart via menu: -# (fixed in 20.04.2) -#cat $CWD/patch/konsole/konsole.konsolepart.segfault.closing.session.via.menu.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix konsolepart segfault when closing after showing context menu: -# (fixed in 20.04.2) -#cat $CWD/patch/konsole/konsole.konsolepart.segfault.closing.after.contextmenu.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } diff --git a/kde/patch/konsole/konsole.cursor.antialias.patch b/kde/patch/konsole/konsole.cursor.antialias.patch deleted file mode 100644 index 596ccaa..0000000 --- a/kde/patch/konsole/konsole.cursor.antialias.patch +++ /dev/null @@ -1,83 +0,0 @@ -From eccfb1f62bbf67ebffee11e241bd05757b826ff1 Mon Sep 17 00:00:00 2001 -From: Wolfgang Bauer -Date: Mon, 4 Mar 2019 09:59:45 -0500 -Subject: [PATCH] Fix ibeam and underline cursor rendering - -Summary: -Since anti-aliasing was enabled in the painter, coordinates need to -be shifted half a pixel so that they align with the pixel grid, -otherwise the result gets "blurred" due to the anti-aliasing. -And as parts of the blurred shape leak outside the cursor rectangle, -this also leaves artifacts when the cursor moves or blinks as these -parts are not cleared. - -This is basically the same as commit -e7085310d6d594823d0ed491fa8bdbd99dec4932 for the -standard block cursor. - -BUG: 402589 - -Test Plan: -- Switch cursor shape to "I-Beam" or "Underline" in the "Advanced" -profile settings - -The cursors are a single line again now, before they were blurred by -anti-aliasing. - -Screenshots: -Before: -{F6656366} -{F6656370} - -After: -{F6656371} -{F6656373} - -Also, there are no more artifacts when the cursor is moved or -cursor blinking is enabled. - -Reviewers: #konsole, hindenburg - -Reviewed By: #konsole, hindenburg - -Subscribers: hindenburg, konsole-devel - -Tags: #konsole - -Differential Revision: https://phabricator.kde.org/D19513 ---- - src/TerminalDisplay.cpp | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - -diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp -index 543b8970..397422c4 100644 ---- a/src/TerminalDisplay.cpp -+++ b/src/TerminalDisplay.cpp -@@ -716,16 +716,18 @@ void TerminalDisplay::drawCursor(QPainter& painter, - } - } - } else if (_cursorShape == Enum::UnderlineCursor) { -- painter.drawLine(cursorRect.left(), -- cursorRect.bottom(), -- cursorRect.right(), -- cursorRect.bottom()); -+ QLineF line(cursorRect.left() + 0.5, -+ cursorRect.bottom() - 0.5, -+ cursorRect.right() - 0.5, -+ cursorRect.bottom() - 0.5); -+ painter.drawLine(line); - - } else if (_cursorShape == Enum::IBeamCursor) { -- painter.drawLine(cursorRect.left(), -- cursorRect.top(), -- cursorRect.left(), -- cursorRect.bottom()); -+ QLineF line(cursorRect.left() + 0.5, -+ cursorRect.top() + 0.5, -+ cursorRect.left() + 0.5, -+ cursorRect.bottom() - 0.5); -+ painter.drawLine(line); - } - } - - diff --git a/kde/patch/konsole/konsole.konsolepart.segfault.closing.after.contextmenu.patch b/kde/patch/konsole/konsole.konsolepart.segfault.closing.after.contextmenu.patch deleted file mode 100644 index fcdbb84..0000000 --- a/kde/patch/konsole/konsole.konsolepart.segfault.closing.after.contextmenu.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 1d7142ed24ef370ae984c0441d5b325b42656bd7 Mon Sep 17 00:00:00 2001 -From: Maximilian Schiller -Date: Fri, 29 May 2020 07:36:02 -0400 -Subject: Fix konsolepart segfault when closing after showing context menu - -Assign the _view as the parent to the KXMLGuiFactory because the -factory is referencing the view widget as its associated widget. Since -the TerminalDisplay gets destructed first this is now a dangling -pointer. If the view is set as the parent the factory gets cleaned up -correctly. Also cleanup the created clientBuilder after destruction -because it can't have a parent and would probably leak memory. - -BUG: 415762 -FIXED-IN: 20.08.0 -See also !87 ---- - src/SessionController.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/SessionController.cpp b/src/SessionController.cpp -index e72f342..542955d 100644 ---- a/src/SessionController.cpp -+++ b/src/SessionController.cpp -@@ -1732,11 +1732,13 @@ void SessionController::showDisplayContextMenu(const QPoint& position) - if (factory() == nullptr) { - if (clientBuilder() == nullptr) { - setClientBuilder(new KXMLGUIBuilder(_view)); -+ -+ // Client builder does not get deleted automatically -+ connect(this, &QObject::destroyed, this, [this]{ delete clientBuilder(); }); - } - -- auto factory = new KXMLGUIFactory(clientBuilder(), this); -+ auto factory = new KXMLGUIFactory(clientBuilder(), _view); - factory->addClient(this); -- ////qDebug() << "Created xmlgui factory" << factory; - } - - QPointer popup = qobject_cast(factory()->container(QStringLiteral("session-popup-menu"), this)); --- -cgit v1.1 - - diff --git a/kde/patch/konsole/konsole.konsolepart.segfault.closing.session.via.menu.patch b/kde/patch/konsole/konsole.konsolepart.segfault.closing.session.via.menu.patch deleted file mode 100644 index 914031b..0000000 --- a/kde/patch/konsole/konsole.konsolepart.segfault.closing.session.via.menu.patch +++ /dev/null @@ -1,58 +0,0 @@ -From fdfae25665731882687da8721e58c3c56a3babf8 Mon Sep 17 00:00:00 2001 -From: Nicolas Fella -Date: Thu, 28 May 2020 09:28:06 -0400 -Subject: Fix crash when closing session in KonsolePart via menu - -This close method is also used when closing a Konsole session -via the X on the tabbar and tabheader. - -FIXED-IN: 20.08.0 -BUG: 420817 -BUG: 420695 -BUG: 415762 - -See merge request !87 ---- - src/SessionController.cpp | 23 +++++++++++++++-------- - 1 file changed, 15 insertions(+), 8 deletions(-) - -diff --git a/src/SessionController.cpp b/src/SessionController.cpp -index 006ba8b..e72f342 100644 ---- a/src/SessionController.cpp -+++ b/src/SessionController.cpp -@@ -999,16 +999,23 @@ void SessionController::closeSession() - return; - } - -- if (confirmClose()) { -- if (_session->closeInNormalWay()) { -+ if (!confirmClose()) { -+ return; -+ } -+ -+ if (!_session->closeInNormalWay()) { -+ if (!confirmForceClose()) { - return; -- } else if (confirmForceClose()) { -- if (_session->closeInForceWay()) { -- return; -- } else { -- qCDebug(KonsoleDebug) << "Konsole failed to close a session in any way."; -- } - } -+ -+ if (!_session->closeInForceWay()) { -+ qCDebug(KonsoleDebug) << "Konsole failed to close a session in any way."; -+ return; -+ } -+ } -+ -+ if (factory()) { -+ factory()->removeClient(this); - } - } - --- -cgit v1.1 - - diff --git a/kde/patch/konsole/konsole.term.is.konsole.patch b/kde/patch/konsole/konsole.term.is.konsole.patch deleted file mode 100644 index 443b9f1..0000000 --- a/kde/patch/konsole/konsole.term.is.konsole.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -uar konsole-17.12.3.orig/src/Profile.cpp konsole-17.12.3/src/Profile.cpp ---- konsole-17.12.3.orig/src/Profile.cpp 2018-03-01 23:54:01.000000000 +0100 -+++ konsole-17.12.3/src/Profile.cpp 2018-04-03 21:17:11.897873304 +0200 -@@ -157,7 +157,7 @@ - // See Pty.cpp on why Arguments is populated - setProperty(Arguments, QStringList() << QString::fromUtf8(qgetenv("SHELL"))); - setProperty(Icon, QStringLiteral("utilities-terminal")); -- setProperty(Environment, QStringList() << QStringLiteral("TERM=xterm-256color") << QStringLiteral("COLORTERM=truecolor")); -+ setProperty(Environment, QStringList() << QStringLiteral("TERM=konsole") << QStringLiteral("COLORTERM=truecolor")); - setProperty(LocalTabTitleFormat, QStringLiteral("%d : %n")); - setProperty(RemoteTabTitleFormat, QStringLiteral("(%u) %H")); - setProperty(ShowTerminalSizeHint, true); -diff -uar konsole-17.12.3.orig/src/Pty.cpp konsole-17.12.3/src/Pty.cpp ---- konsole-17.12.3.orig/src/Pty.cpp 2018-03-01 23:54:01.000000000 +0100 -+++ konsole-17.12.3/src/Pty.cpp 2018-04-03 21:18:18.898007801 +0200 -@@ -229,7 +229,7 @@ - - // extra safeguard to make sure $TERM is always set - if (!isTermEnvAdded) { -- setEnv(QStringLiteral("TERM"), QStringLiteral("xterm-256color")); -+ setEnv(QStringLiteral("TERM"), QStringLiteral("konsole")); - } - } - diff --git a/kde/patch/kopete.patch b/kde/patch/kopete.patch deleted file mode 100644 index 64e8238..0000000 --- a/kde/patch/kopete.patch +++ /dev/null @@ -1,9 +0,0 @@ -# Fix for jabber protocol vulnerability in Kopete: CVE-2017-5593 -# (User Impersonation Vulnerability) -# Fixed in 16.12.3. -# cat $CWD/patch/kopete/kopete_kdebug376348.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Make 18.04.0 compile. -# Fixed in 18.04.1. -#cat $CWD/patch/kopete/kopete_kdebug393372.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kopete/kopete_kdebug376348.patch b/kde/patch/kopete/kopete_kdebug376348.patch deleted file mode 100644 index d9bb057..0000000 --- a/kde/patch/kopete/kopete_kdebug376348.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 6243764c4fd0985320d4a10b48051cc418d584ad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Sat, 11 Feb 2017 13:24:59 +0100 -Subject: Fix CVE 2017-5593 (User Impersonation Vulnerability) in jabber - protocol - -BUG: 376348 -FIXED-IN: 16.12.3 ---- - .../jabber/libiris/patches/01_cve_2017-5593.patch | 52 ++++++++++++++++++++++ - .../jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp | 14 +++--- - 2 files changed, 61 insertions(+), 5 deletions(-) - create mode 100644 protocols/jabber/libiris/patches/01_cve_2017-5593.patch - -diff --git a/protocols/jabber/libiris/patches/01_cve_2017-5593.patch b/protocols/jabber/libiris/patches/01_cve_2017-5593.patch -new file mode 100644 -index 0000000..573ca66 ---- /dev/null -+++ b/protocols/jabber/libiris/patches/01_cve_2017-5593.patch -@@ -0,0 +1,52 @@ -+diff --git a/src/xmpp/xmpp-im/xmpp_tasks.cpp b/src/xmpp/xmpp-im/xmpp_tasks.cpp -+index 0e74b71..0837548 100644 -+--- a/src/xmpp/xmpp-im/xmpp_tasks.cpp -++++ b/src/xmpp/xmpp-im/xmpp_tasks.cpp -+@@ -888,14 +888,18 @@ bool JT_PushMessage::take(const QDomElement &e) -+ QDomElement forward; -+ Message::CarbonDir cd = Message::NoCarbon; -+ -++ Jid fromJid = Jid(e1.attribute(QLatin1String("from"))); -+ // Check for Carbon -+ QDomNodeList list = e1.childNodes(); -+ for (int i = 0; i < list.size(); ++i) { -+ QDomElement el = list.at(i).toElement(); -+ -+- if (el.attribute("xmlns") == QLatin1String("urn:xmpp:carbons:2") && (el.tagName() == QLatin1String("received") || el.tagName() == QLatin1String("sent"))) { -++ if (el.attribute("xmlns") == QLatin1String("urn:xmpp:carbons:2") -++ && (el.tagName() == QLatin1String("received") || el.tagName() == QLatin1String("sent")) -++ && fromJid.compare(Jid(e1.attribute(QLatin1String("to"))), false)) { -+ QDomElement el1 = el.firstChildElement(); -+- if (el1.tagName() == QLatin1String("forwarded") && el1.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { -++ if (el1.tagName() == QLatin1String("forwarded") -++ && el1.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { -+ QDomElement el2 = el1.firstChildElement(QLatin1String("message")); -+ if (!el2.isNull()) { -+ forward = el2; -+@@ -904,7 +908,8 @@ bool JT_PushMessage::take(const QDomElement &e) -+ } -+ } -+ } -+- else if (el.tagName() == QLatin1String("forwarded") && el.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { -++ else if (el.tagName() == QLatin1String("forwarded") -++ && el.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { -+ forward = el.firstChildElement(QLatin1String("message")); // currently only messages are supportted -+ // TODO element support -+ if (!forward.isNull()) { -+@@ -913,7 +918,6 @@ bool JT_PushMessage::take(const QDomElement &e) -+ } -+ } -+ -+- QString from = e1.attribute(QLatin1String("from")); -+ Stanza s = client()->stream().createStanza(addCorrectNS(forward.isNull()? e1 : forward)); -+ if(s.isNull()) { -+ //printf("take: bad stanza??\n"); -+@@ -926,7 +930,7 @@ bool JT_PushMessage::take(const QDomElement &e) -+ return false; -+ } -+ if (!forward.isNull()) { -+- m.setForwardedFrom(Jid(from)); -++ m.setForwardedFrom(fromJid); -+ m.setCarbonDirection(cd); -+ } -+ -diff --git a/protocols/jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp b/protocols/jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp -index 0e74b71..0837548 100644 ---- a/protocols/jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp -+++ b/protocols/jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp -@@ -888,14 +888,18 @@ bool JT_PushMessage::take(const QDomElement &e) - QDomElement forward; - Message::CarbonDir cd = Message::NoCarbon; - -+ Jid fromJid = Jid(e1.attribute(QLatin1String("from"))); - // Check for Carbon - QDomNodeList list = e1.childNodes(); - for (int i = 0; i < list.size(); ++i) { - QDomElement el = list.at(i).toElement(); - -- if (el.attribute("xmlns") == QLatin1String("urn:xmpp:carbons:2") && (el.tagName() == QLatin1String("received") || el.tagName() == QLatin1String("sent"))) { -+ if (el.attribute("xmlns") == QLatin1String("urn:xmpp:carbons:2") -+ && (el.tagName() == QLatin1String("received") || el.tagName() == QLatin1String("sent")) -+ && fromJid.compare(Jid(e1.attribute(QLatin1String("to"))), false)) { - QDomElement el1 = el.firstChildElement(); -- if (el1.tagName() == QLatin1String("forwarded") && el1.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { -+ if (el1.tagName() == QLatin1String("forwarded") -+ && el1.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { - QDomElement el2 = el1.firstChildElement(QLatin1String("message")); - if (!el2.isNull()) { - forward = el2; -@@ -904,7 +908,8 @@ bool JT_PushMessage::take(const QDomElement &e) - } - } - } -- else if (el.tagName() == QLatin1String("forwarded") && el.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { -+ else if (el.tagName() == QLatin1String("forwarded") -+ && el.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) { - forward = el.firstChildElement(QLatin1String("message")); // currently only messages are supportted - // TODO element support - if (!forward.isNull()) { -@@ -913,7 +918,6 @@ bool JT_PushMessage::take(const QDomElement &e) - } - } - -- QString from = e1.attribute(QLatin1String("from")); - Stanza s = client()->stream().createStanza(addCorrectNS(forward.isNull()? e1 : forward)); - if(s.isNull()) { - //printf("take: bad stanza??\n"); -@@ -926,7 +930,7 @@ bool JT_PushMessage::take(const QDomElement &e) - return false; - } - if (!forward.isNull()) { -- m.setForwardedFrom(Jid(from)); -+ m.setForwardedFrom(fromJid); - m.setCarbonDirection(cd); - } - --- -cgit v0.11.2 - diff --git a/kde/patch/kopete/kopete_kdebug393372.patch b/kde/patch/kopete/kopete_kdebug393372.patch deleted file mode 100644 index 2d1b1f0..0000000 --- a/kde/patch/kopete/kopete_kdebug393372.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b1f4fa1401cba2e359e5a4b3ea2bafd119fca62b Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Tue, 24 Apr 2018 06:30:19 +0200 -Subject: oscar: include buffer.h - -This header uses Buffer as by-value parameter, so make sure it knows -about it. - -BUG: 393372 -FIXED-IN: 18.04.1 ---- - protocols/oscar/liboscar/tasks/messagereceivertask.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/protocols/oscar/liboscar/tasks/messagereceivertask.h b/protocols/oscar/liboscar/tasks/messagereceivertask.h -index 8f52cd7..908e903 100644 ---- a/protocols/oscar/liboscar/tasks/messagereceivertask.h -+++ b/protocols/oscar/liboscar/tasks/messagereceivertask.h -@@ -21,6 +21,7 @@ - #include - #include "oscarmessage.h" - #include "oscartypeclasses.h" -+#include "buffer.h" - - class QTextCodec; - --- -cgit v0.11.2 - - diff --git a/kde/patch/korundum.patch b/kde/patch/korundum.patch deleted file mode 100644 index 10deb29..0000000 --- a/kde/patch/korundum.patch +++ /dev/null @@ -1,5 +0,0 @@ -# Build against Ruby 1.9.3. -# See also https://bugs.kde.org/show_bug.cgi?id=287057 -# No longer needed in KDE 4.11. -#cat $CWD/patch/korundum/korundum_ruby19.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/korundum/korundum_ruby19.patch b/kde/patch/korundum/korundum_ruby19.patch deleted file mode 100644 index 561d8de..0000000 --- a/kde/patch/korundum/korundum_ruby19.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -up korundum-4.8.0/src/krubypluginfactory.cpp.ruby19 korundum-4.8.0/src/krubypluginfactory.cpp ---- korundum-4.8.0/src/krubypluginfactory.cpp.ruby19 2011-07-27 13:37:29.000000000 -0500 -+++ korundum-4.8.0/src/krubypluginfactory.cpp 2012-02-17 08:30:38.785635819 -0600 -@@ -39,7 +39,7 @@ - extern "C" { - extern VALUE rb_load_path; - extern VALUE qt_internal_module; --void Init_prelude(void); -+// void Init_prelude(void); - } - - // -@@ -165,7 +165,7 @@ QObject *KRubyPluginFactory::create(cons - #if RUBY_VERSION >= 0x10900 - VALUE gem = rb_define_module("Gem"); - rb_const_set(gem, rb_intern("Enable"), Qtrue); -- Init_prelude(); -+// Init_prelude(); - #endif - - ruby_incpush(QFile::encodeName(program.path())); -@@ -342,7 +342,7 @@ int kdemain(int argc, char **argv) - #if RUBY_VERSION >= 0x10900 - VALUE gem = rb_define_module("Gem"); - rb_const_set(gem, rb_intern("Enable"), Qtrue); -- Init_prelude(); -+// Init_prelude(); - #endif - - ruby_incpush(QFile::encodeName(program.path())); - diff --git a/kde/patch/kpat.patch b/kde/patch/kpat.patch deleted file mode 100644 index 5bda77a..0000000 --- a/kde/patch/kpat.patch +++ /dev/null @@ -1,6 +0,0 @@ -# Commit https://cgit.kde.org/kpat.git/patch/?id=fc1d54ced6a727382599d767e55879b6843c3456 -# Introduces a hard dependency on fc-solver which in turn has new dependencies -# So, we revert this commit to avoid dropping kpat altogether in 18.08.0. -# For 18.12.0 we will have to add freecell-solver anyway. -#cat $CWD/patch/kpat/kpat_no_freecell_solver_dep.patch | patch -p1 --reverse --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kpat/kpat_no_freecell_solver_dep.patch b/kde/patch/kpat/kpat_no_freecell_solver_dep.patch deleted file mode 100644 index 06aedca..0000000 --- a/kde/patch/kpat/kpat_no_freecell_solver_dep.patch +++ /dev/null @@ -1,1475 +0,0 @@ -Commit https://cgit.kde.org/kpat.git/patch/?id=fc1d54ced6a727382599d767e55879b6843c3456 -Introduces a hard dependency on fc-solver which in turn has new dependencies -So, we revert this commit to avoid dropping kpat altogether - -From ed0e53e0888da7123f4a0d2097f8da7fb105ca18 Mon Sep 17 00:00:00 2001 -From: Fabian Kosmale <0inkane@googlemail.com> -Date: Sun, 13 May 2018 15:14:53 +0200 -Subject: Use Freecell Solver for FreeCell and Simple Simon - -Summary: This uses http://fc-solve.shlomifish.org/ and prevents the looping in the existing solvers. - -Test Plan: Test that the solvers are working. - -Reviewers: #kde_games, fabiank - -Subscribers: kde-games-devel, aacid, #kde_games - -Tags: #kde_games - -Differential Revision: https://phabricator.kde.org/D12415 ---- - CMakeLists.txt | 6 +- - dealer.cpp | 4 + - freecell.cpp | 35 ++++ - freecell.h | 1 + - patsolve/abstract_fc_solve_solver.cpp | 239 ++++++++++++++++++++++++++ - patsolve/abstract_fc_solve_solver.h | 52 ++++++ - patsolve/freecellsolver.cpp | 310 +++++++++++++++++----------------- - patsolve/freecellsolver.h | 23 ++- - patsolve/patsolve.h | 12 +- - patsolve/simonsolver.cpp | 129 +++++++++++++- - patsolve/simonsolver.h | 20 ++- - patsolve/solverinterface.h | 2 + - pileutils.cpp | 61 +++++++ - pileutils.h | 4 + - simon.cpp | 56 +++++- - simon.h | 1 + - 16 files changed, 779 insertions(+), 176 deletions(-) - create mode 100644 patsolve/abstract_fc_solve_solver.cpp - create mode 100644 patsolve/abstract_fc_solve_solver.h - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8f738bf..c043c45 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,6 +4,8 @@ cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) - set (QT_MIN_VERSION "5.7.0") - set (KF5_MIN_VERSION "5.30.0") - -+include(FindPkgConfig) -+pkg_check_modules(FC_SOLVE REQUIRED libfreecell-solver) - find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) - -@@ -45,7 +47,7 @@ add_subdirectory(sounds) - add_subdirectory(themes) - add_subdirectory(doc) - --set(kpat_SRCS -+set(kpat_SRCS ${libfcs_SRCS} - main.cpp - dealer.cpp - dealerinfo.cpp -@@ -59,6 +61,7 @@ set(kpat_SRCS - soundengine.cpp - statisticsdialog.cpp - view.cpp -+ patsolve/abstract_fc_solve_solver.cpp - patsolve/memory.cpp - patsolve/patsolve.cpp - -@@ -101,6 +104,7 @@ target_link_libraries(kpat - KF5::KIOCore - KF5KDEGames - kcardgame -+ ${FC_SOLVE_LDFLAGS} - ) - - install(TARGETS kpat ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -diff --git a/dealer.cpp b/dealer.cpp -index 7c03ebf..a2558fc 100644 ---- a/dealer.cpp -+++ b/dealer.cpp -@@ -1724,6 +1724,10 @@ void DealerScene::startSolver() - - bool DealerScene::isGameLost() const - { -+ if (! m_winningMoves.isEmpty()) -+ { -+ return false; -+ } - if ( solver() ) - { - if ( m_solverThread && m_solverThread->isRunning() ) -diff --git a/freecell.cpp b/freecell.cpp -index f870cdb..9a7c278 100644 ---- a/freecell.cpp -+++ b/freecell.cpp -@@ -111,6 +111,41 @@ void Freecell::restart( const QList & cards ) - } - - -+QString Freecell::solverFormat() const -+{ -+ QString output; -+ QString tmp; -+ for (int i = 0; i < 4 ; i++) { -+ if (target[i]->isEmpty()) -+ continue; -+ tmp += suitToString(target[i]->topCard()->suit()) + '-' + rankToString(target[i]->topCard()->rank()) + ' '; -+ } -+ if (!tmp.isEmpty()) -+ output += QString::fromLatin1("Foundations: %1\n").arg(tmp); -+ -+ tmp.truncate(0); -+ for (int i = 0; i < 4 ; i++) { -+ if (freecell[i]->isEmpty()) -+ tmp += "- "; -+ else -+ tmp += rankToString(freecell[i]->topCard()->rank()) + suitToString(freecell[i]->topCard()->suit()) + ' '; -+ } -+ if (!tmp.isEmpty()) -+ { -+ QString a = QString::fromLatin1("Freecells: %1\n"); -+ output += a.arg(tmp); -+ } -+ -+ for (int i = 0; i < 8 ; i++) -+ { -+ QList cards = store[i]->cards(); -+ for (QList::ConstIterator it = cards.begin(); it != cards.end(); ++it) -+ output += rankToString((*it)->rank()) + suitToString((*it)->suit()) + ' '; -+ output += '\n'; -+ } -+ return output; -+} -+ - void Freecell::cardsDroppedOnPile( const QList & cards, KCardPile * pile ) - { - if ( cards.size() <= 1 ) -diff --git a/freecell.h b/freecell.h -index 7b0b2cb..9f7d84b 100644 ---- a/freecell.h -+++ b/freecell.h -@@ -62,6 +62,7 @@ protected slots: - private: - bool canPutStore( const KCardPile * pile, const QList & cards ) const; - -+ virtual QString solverFormat() const; - PatPile* store[8]; - PatPile* freecell[4]; - PatPile* target[4]; -diff --git a/patsolve/abstract_fc_solve_solver.cpp b/patsolve/abstract_fc_solve_solver.cpp -new file mode 100644 -index 0000000..11e5baa ---- /dev/null -+++ b/patsolve/abstract_fc_solve_solver.cpp -@@ -0,0 +1,239 @@ -+/* -+ * Copyright (C) 2006-2009 Stephan Kulow -+ * -+ * 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, see . -+ */ -+ -+#include -+#include -+ -+#include "freecell-solver/fcs_user.h" -+#include "freecell-solver/fcs_cl.h" -+ -+#include "abstract_fc_solve_solver.h" -+ -+const int CHUNKSIZE = 100; -+const long int MAX_ITERS_LIMIT = 200000; -+ -+#define PRINT 0 -+ -+/* These two routines make and unmake moves. */ -+ -+void FcSolveSolver::make_move(MOVE *) -+{ -+ return; -+} -+ -+void FcSolveSolver::undo_move(MOVE *) -+{ -+ return; -+} -+ -+/* Get the possible moves from a position, and store them in Possible[]. */ -+SolverInterface::ExitStatus FcSolveSolver::patsolve( int _max_positions ) -+{ -+ int current_iters_count; -+ max_positions = (_max_positions < 0) ? MAX_ITERS_LIMIT : _max_positions; -+ -+ init(); -+ -+ if (!solver_instance) -+ { -+ { -+ solver_instance = freecell_solver_user_alloc(); -+ -+ solver_ret = FCS_STATE_NOT_BEGAN_YET; -+ -+ char * error_string; -+ int error_arg; -+ const char * known_parameters[1] = {NULL}; -+ /* A "char *" copy instead of "const char *". */ -+ -+ int parse_args_ret_code = freecell_solver_user_cmd_line_parse_args( -+ solver_instance, -+ get_cmd_line_arg_count() , -+ get_cmd_line_args(), -+ 0, -+ known_parameters, -+ NULL, -+ NULL, -+ &error_string, -+ &error_arg -+ ); -+ -+ Q_ASSERT(!parse_args_ret_code); -+ } -+ -+ /* Not needed for Simple Simon because it's already specified in -+ * freecell_solver_cmd_line_args. TODO : abstract . -+ * -+ * Shlomi Fish -+ * */ -+ setFcSolverGameParams(); -+ -+ current_iters_count = CHUNKSIZE; -+ freecell_solver_user_limit_iterations(solver_instance, current_iters_count); -+ } -+ -+ if (solver_instance) -+ { -+ bool continue_loop = true; -+ while (continue_loop && -+ ( (solver_ret == FCS_STATE_NOT_BEGAN_YET) -+ || (solver_ret == FCS_STATE_SUSPEND_PROCESS)) -+ && -+ (current_iters_count < MAX_ITERS_LIMIT) -+ ) -+ { -+ current_iters_count += CHUNKSIZE; -+ freecell_solver_user_limit_iterations(solver_instance, current_iters_count); -+ -+ if (solver_ret == FCS_STATE_NOT_BEGAN_YET) -+ { -+ solver_ret = -+ freecell_solver_user_solve_board( -+ solver_instance, -+ board_as_string -+ ); -+ } -+ else -+ { -+ solver_ret = freecell_solver_user_resume_solution(solver_instance); -+ } -+ { -+ // QMutexLocker lock( &endMutex ); -+ if ( m_shouldEnd ) -+ { -+ continue_loop = false; -+ } -+ } -+ } -+ } -+ -+ switch (solver_ret) -+ { -+ case FCS_STATE_IS_NOT_SOLVEABLE: -+ if (solver_instance) -+ { -+ freecell_solver_user_free(solver_instance); -+ solver_instance = NULL; -+ } -+ return Solver::NoSolutionExists; -+ -+ case FCS_STATE_WAS_SOLVED: -+ { -+ if (solver_instance) -+ { -+ m_winMoves.clear(); -+ while (freecell_solver_user_get_moves_left(solver_instance)) -+ { -+ fcs_move_t move; -+ MOVE new_move; -+ const int verdict = !freecell_solver_user_get_next_move( -+ solver_instance, &move) -+ ; -+ -+ Q_ASSERT (verdict); -+ -+ new_move.fcs = move; -+ -+ m_winMoves.append( new_move ); -+ } -+ -+ freecell_solver_user_free(solver_instance); -+ solver_instance = NULL; -+ } -+ return Solver::SolutionExists; -+ } -+ -+ case FCS_STATE_SUSPEND_PROCESS: -+ return Solver::UnableToDetermineSolvability; -+ -+ default: -+ if (solver_instance) -+ { -+ freecell_solver_user_free(solver_instance); -+ solver_instance = NULL; -+ } -+ return Solver::NoSolutionExists; -+ } -+} -+ -+/* Get the possible moves from a position, and store them in Possible[]. */ -+ -+int FcSolveSolver::get_possible_moves(int *, int *) -+{ -+ return 0; -+} -+ -+bool FcSolveSolver::isWon() -+{ -+ return true; -+} -+ -+int FcSolveSolver::getOuts() -+{ -+ return 0; -+} -+ -+FcSolveSolver::FcSolveSolver() -+ : Solver() -+ , solver_instance(NULL) -+ , solver_ret(FCS_STATE_NOT_BEGAN_YET) -+ , board_as_string("") -+{ -+} -+ -+unsigned int FcSolveSolver::getClusterNumber() -+{ -+ return 0; -+} -+ -+void FcSolveSolver::print_layout() -+{ -+#if 0 -+ int i, w, o; -+ -+ fprintf(stderr, "print-layout-begin\n"); -+ for (w = 0; w < 10; ++w) { -+ Q_ASSERT( Wp[w] == &W[w][Wlen[w]-1] ); -+ fprintf( stderr, "Play%d: ", w ); -+ for (i = 0; i < Wlen[w]; ++i) { -+ printcard(W[w][i], stderr); -+ } -+ fputc('\n', stderr); -+ } -+ fprintf( stderr, "Off: " ); -+ for (o = 0; o < 4; ++o) { -+ if ( O[o] != -1 ) -+ printcard( O[o] + PS_KING, stderr); -+ } -+ fprintf(stderr, "\nprint-layout-end\n"); -+#endif -+} -+ -+void FcSolveSolver::unpack_cluster( unsigned int) -+{ -+ return; -+} -+ -+FcSolveSolver::~FcSolveSolver() -+{ -+ if (solver_instance) -+ { -+ freecell_solver_user_free(solver_instance); -+ solver_instance = NULL; -+ } -+} -+ -diff --git a/patsolve/abstract_fc_solve_solver.h b/patsolve/abstract_fc_solve_solver.h -new file mode 100644 -index 0000000..d2d072d ---- /dev/null -+++ b/patsolve/abstract_fc_solve_solver.h -@@ -0,0 +1,52 @@ -+/* -+ * Copyright (C) 2006-2009 Stephan Kulow -+ * -+ * 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, see . -+ */ -+ -+#ifndef ABSTRACT_FC_SOLVE_SOLVER_H -+#define ABSTRACT_FC_SOLVE_SOLVER_H -+ -+#include "patsolve.h" -+ -+struct FcSolveSolver : public Solver<10> -+{ -+public: -+ FcSolveSolver(); -+ virtual ~FcSolveSolver(); -+ virtual int get_possible_moves(int *a, int *numout); -+ virtual bool isWon(); -+ virtual void make_move(MOVE *m); -+ virtual void undo_move(MOVE *m); -+ virtual int getOuts(); -+ virtual unsigned int getClusterNumber(); -+ virtual void translate_layout() = 0; -+ virtual void unpack_cluster( unsigned int k ); -+ virtual MoveHint translateMove(const MOVE &m) = 0; -+ virtual SolverInterface::ExitStatus patsolve( int _max_positions = -1); -+ virtual void setFcSolverGameParams() = 0; -+ -+ virtual void print_layout(); -+ -+ virtual int get_cmd_line_arg_count() = 0; -+ virtual const char * * get_cmd_line_args() = 0; -+/* Names of the cards. The ordering is defined in pat.h. */ -+ -+ void * solver_instance; -+ int solver_ret; -+ // More than enough space for two decks. -+ char board_as_string[4 * 13 * 2 * 4 * 3]; -+}; -+ -+#endif // ABSTRACT_FC_SOLVE_SOLVER_H -diff --git a/patsolve/freecellsolver.cpp b/patsolve/freecellsolver.cpp -index 39eff50..e92000f 100644 ---- a/patsolve/freecellsolver.cpp -+++ b/patsolve/freecellsolver.cpp -@@ -16,12 +16,18 @@ - * along with this program. If not, see . - */ - -+#include -+#include -+ -+#include "freecell-solver/fcs_user.h" -+#include "freecell-solver/fcs_cl.h" -+ - #include "freecellsolver.h" - - #include "../freecell.h" - -- --/* Some macros used in get_possible_moves(). */ -+const int CHUNKSIZE = 100; -+const long int MAX_ITERS_LIMIT = 200000; - - /* The following function implements - (Same_suit ? (suit(a) == suit(b)) : (color(a) != color(b))) -@@ -32,10 +38,13 @@ namespace { - - /* Statistics. */ - -+#if 0 - int FreecellSolver::Xparam[] = { 4, 1, 8, -1, 7, 11, 4, 2, 2, 1, 2 }; -+#endif - - /* These two routines make and unmake moves. */ - -+#if 0 - void FreecellSolver::make_move(MOVE *m) - { - int from, to; -@@ -85,7 +94,9 @@ void FreecellSolver::undo_move(MOVE *m) - Wlen[from]++; - hashpile(from); - } -+#endif - -+#if 0 - /* Move prioritization. Given legal, pruned moves, there are still some - that are a waste of time, especially in the endgame where there are lots of - possible moves, but few productive ones. Note that we also prioritize -@@ -178,9 +189,11 @@ void FreecellSolver::prioritize(MOVE *mp0, int n) - } - } - } -+#endif - - /* Automove logic. Freecell games must avoid certain types of automoves. */ - -+#if 0 - int FreecellSolver::good_automove(int o, int r) - { - int i; -@@ -220,148 +233,43 @@ int FreecellSolver::good_automove(int o, int r) - - return true; - } -+#endif - --/* Get the possible moves from a position, and store them in Possible[]. */ -+#define CMD_LINE_ARGS_NUM 2 - --int FreecellSolver::get_possible_moves(int *a, int *numout) -+static const char * freecell_solver_cmd_line_args[CMD_LINE_ARGS_NUM] = - { -- int i, n, t, w, o, empty, emptyw; -- card_t card; -- MOVE *mp; -- -- /* Check for moves from W to O. */ -- -- n = 0; -- mp = Possible; -- for (w = 0; w < Nwpiles + Ntpiles; ++w) { -- if (Wlen[w] > 0) { -- card = *Wp[w]; -- o = SUIT(card); -- empty = (O[o] == NONE); -- if ((empty && (RANK(card) == PS_ACE)) || -- (!empty && (RANK(card) == O[o] + 1))) { -- mp->card_index = 0; -- mp->from = w; -- mp->to = o; -- mp->totype = O_Type; -- mp->turn_index = -1; -- mp->pri = 0; /* unused */ -- n++; -- mp++; -- -- /* If it's an automove, just do it. */ -- -- if (good_automove(o, RANK(card))) { -- *a = true; -- mp[-1].pri = 127; -- if (n != 1) { -- Possible[0] = mp[-1]; -- return 1; -- } -- return n; -- } -- } -- } -- } -- -- /* No more automoves, but remember if there were any moves out. */ -- -- *a = false; -- *numout = n; -- -- /* Check for moves from non-singleton W cells to one of any -- empty W cells. */ -+ "--load-config", "video-editing" -+}; - -- emptyw = -1; -- for (w = 0; w < Nwpiles; ++w) { -- if (Wlen[w] == 0) { -- emptyw = w; -- break; -- } -- } -- if (emptyw >= 0) { -- for (i = 0; i < Nwpiles + Ntpiles; ++i) { -- if (i == emptyw || Wlen[i] == 0) { -- continue; -- } -- bool allowed = false; -- if ( i < Nwpiles) -- allowed = true; -- if ( i >= Nwpiles ) -- allowed = true; -- if ( allowed ) { -- card = *Wp[i]; -- mp->card_index = 0; -- mp->from = i; -- mp->to = emptyw; -- mp->totype = W_Type; -- mp->turn_index = -1; -- if ( i >= Nwpiles ) -- mp->pri = Xparam[6]; -- else -- mp->pri = Xparam[3]; -- n++; -- mp++; -- } -- } -- } -- -- /* Check for moves from W to non-empty W cells. */ -- -- for (i = 0; i < Nwpiles + Ntpiles; ++i) { -- if (Wlen[i] > 0) { -- card = *Wp[i]; -- for (w = 0; w < Nwpiles; ++w) { -- if (i == w) { -- continue; -- } -- if (Wlen[w] > 0 && -- (RANK(card) == RANK(*Wp[w]) - 1 && -- suitable(card, *Wp[w]))) { -- mp->card_index = 0; -- mp->from = i; -- mp->to = w; -- mp->totype = W_Type; -- mp->turn_index = -1; -- if ( i >= Nwpiles ) -- mp->pri = Xparam[5]; -- else -- mp->pri = Xparam[4]; -- n++; -- mp++; -- } -- } -- } -- } -- -- /* Check for moves from W to one of any empty T cells. */ -- -- for (t = 0; t < Ntpiles; ++t) { -- if (!Wlen[t+Nwpiles]) { -- break; -- } -- } -+int FreecellSolver::get_cmd_line_arg_count() -+{ -+ return CMD_LINE_ARGS_NUM; -+} - -- if (t < Ntpiles) { -- for (w = 0; w < Nwpiles; ++w) { -- if (Wlen[w] > 0) { -- card = *Wp[w]; -- mp->card_index = 0; -- mp->from = w; -- mp->turn_index = -1; -- mp->to = t+Nwpiles; -- mp->totype = W_Type; -- mp->pri = Xparam[7]; -- n++; -- mp++; -- } -- } -- } -+const char * * FreecellSolver::get_cmd_line_args() -+{ -+ return freecell_solver_cmd_line_args; -+} - - -- return n; -+void FreecellSolver::setFcSolverGameParams() -+{ -+ /* -+ * I'm using the more standard interface instead of the depracated -+ * user_set_game one. I'd like that each function will have its -+ * own dedicated purpose. -+ * -+ * Shlomi Fish -+ * */ -+ freecell_solver_user_set_num_freecells(solver_instance,4); -+ freecell_solver_user_set_num_stacks(solver_instance,8); -+ freecell_solver_user_set_num_decks(solver_instance,1); -+ freecell_solver_user_set_sequences_are_built_by_type(solver_instance, FCS_SEQ_BUILT_BY_ALTERNATE_COLOR); -+ freecell_solver_user_set_sequence_move(solver_instance, 0); -+ freecell_solver_user_set_empty_stacks_filled_by(solver_instance, FCS_ES_FILLED_BY_ANY_CARD); - } -- -+#if 0 - void FreecellSolver::unpack_cluster( unsigned int k ) - { - /* Get the Out cells from the cluster number. */ -@@ -373,27 +281,13 @@ void FreecellSolver::unpack_cluster( unsigned int k ) - k >>= 4; - O[3] = k & 0xF; - } -+#endif - --bool FreecellSolver::isWon() --{ -- // maybe won? -- for (int o = 0; o < 4; ++o) { -- if (O[o] != PS_KING) { -- return false; -- } -- } -- -- return true; --} -- --int FreecellSolver::getOuts() --{ -- return O[0] + O[1] + O[2] + O[3]; --} - - FreecellSolver::FreecellSolver(const Freecell *dealer) -- : Solver() -+ : FcSolveSolver() - { -+#if 0 - Osuit[0] = PS_DIAMOND; - Osuit[1] = PS_CLUB; - Osuit[2] = PS_HEART; -@@ -402,12 +296,15 @@ FreecellSolver::FreecellSolver(const Freecell *dealer) - Nwpiles = 8; - Ntpiles = 4; - -+#endif -+ - deal = dealer; - } - - /* Read a layout file. Format is one pile per line, bottom to top (visible - card). Temp cells and Out on the last two lines, if any. */ - -+#if 0 - void FreecellSolver::translate_layout() - { - /* Read the workspace. */ -@@ -447,9 +344,78 @@ void FreecellSolver::translate_layout() - } - } - } -+#endif - - MoveHint FreecellSolver::translateMove( const MOVE &m ) - { -+ fcs_move_t move = m.fcs; -+ int cards = fcs_move_get_num_cards_in_seq(move); -+ PatPile *from = 0; -+ PatPile *to = 0; -+ -+ switch(fcs_move_get_type(move)) -+ { -+ case FCS_MOVE_TYPE_STACK_TO_STACK: -+ from = deal->store[fcs_move_get_src_stack(move)]; -+ to = deal->store[fcs_move_get_dest_stack(move)]; -+ break; -+ -+ case FCS_MOVE_TYPE_FREECELL_TO_STACK: -+ from = deal->freecell[fcs_move_get_src_freecell(move)]; -+ to = deal->store[fcs_move_get_dest_stack(move)]; -+ cards = 1; -+ break; -+ -+ case FCS_MOVE_TYPE_FREECELL_TO_FREECELL: -+ from = deal->freecell[fcs_move_get_src_freecell(move)]; -+ to = deal->freecell[fcs_move_get_dest_freecell(move)]; -+ cards = 1; -+ break; -+ -+ case FCS_MOVE_TYPE_STACK_TO_FREECELL: -+ from = deal->store[fcs_move_get_src_stack(move)]; -+ to = deal->freecell[fcs_move_get_dest_freecell(move)]; -+ cards = 1; -+ break; -+ -+ case FCS_MOVE_TYPE_STACK_TO_FOUNDATION: -+ from = deal->store[fcs_move_get_src_stack(move)]; -+ cards = 1; -+ to = 0; -+ break; -+ -+ case FCS_MOVE_TYPE_FREECELL_TO_FOUNDATION: -+ from = deal->freecell[fcs_move_get_src_freecell(move)]; -+ cards = 1; -+ to = 0; -+ } -+ Q_ASSERT(from); -+ Q_ASSERT(cards <= from->cards().count()); -+ Q_ASSERT(to || cards == 1); -+ KCard *card = from->cards()[from->cards().count() - cards]; -+ -+ if (!to) -+ { -+ PatPile *target = 0; -+ PatPile *empty = 0; -+ for (int i = 0; i < 4; ++i) { -+ KCard *c = deal->target[i]->topCard(); -+ if (c) { -+ if ( c->suit() == card->suit() ) -+ { -+ target = deal->target[i]; -+ break; -+ } -+ } else if ( !empty ) -+ empty = deal->target[i]; -+ } -+ to = target ? target : empty; -+ } -+ Q_ASSERT(to); -+ -+ return MoveHint(card, to, 0); -+ -+#if 0 - // this is tricky as we need to want to build the "meta moves" - - PatPile *frompile = nullptr; -@@ -486,8 +452,43 @@ MoveHint FreecellSolver::translateMove( const MOVE &m ) - - return MoveHint( card, target, m.pri ); - } -+#endif - } - -+void FreecellSolver::translate_layout() -+{ -+ strcpy(board_as_string, deal->solverFormat().toLatin1()); -+ -+ if (solver_instance) -+ { -+ freecell_solver_user_recycle(solver_instance); -+ solver_ret = FCS_STATE_NOT_BEGAN_YET; -+ } -+#if 0 -+ /* Read the workspace. */ -+ int total = 0; -+ -+ for ( int w = 0; w < 10; ++w ) { -+ int i = translate_pile(deal->store[w], W[w], 52); -+ Wp[w] = &W[w][i - 1]; -+ Wlen[w] = i; -+ total += i; -+ } -+ -+ for (int i = 0; i < 4; ++i) { -+ O[i] = -1; -+ KCard *c = deal->target[i]->top(); -+ if (c) { -+ total += 13; -+ O[i] = translateSuit( c->suit() ); -+ } -+ } -+#endif -+} -+ -+ -+ -+#if 0 - unsigned int FreecellSolver::getClusterNumber() - { - int i = O[0] + (O[1] << 4); -@@ -496,7 +497,9 @@ unsigned int FreecellSolver::getClusterNumber() - k |= i << 8; - return k; - } -+#endif - -+#if 0 - void FreecellSolver::print_layout() - { - int i, t, w, o; -@@ -519,3 +522,4 @@ void FreecellSolver::print_layout() - } - fprintf(stderr, "\nprint-layout-end\n"); - } -+#endif -diff --git a/patsolve/freecellsolver.h b/patsolve/freecellsolver.h -index 45ca063..99d1dbb 100644 ---- a/patsolve/freecellsolver.h -+++ b/patsolve/freecellsolver.h -@@ -19,16 +19,17 @@ - #ifndef FREECELLSOLVER_H - #define FREECELLSOLVER_H - --class Freecell; --#include "patsolve.h" -+#include "abstract_fc_solve_solver.h" - - constexpr auto Nwpiles = 8; - constexpr auto Ntpiles = 4; -+class Freecell; - --class FreecellSolver : public Solver -+class FreecellSolver : public FcSolveSolver - { - public: - explicit FreecellSolver(const Freecell *dealer); -+#if 0 - int good_automove(int o, int r); - int get_possible_moves(int *a, int *numout) Q_DECL_OVERRIDE; - bool isWon() Q_DECL_OVERRIDE; -@@ -40,8 +41,17 @@ public: - void translate_layout() Q_DECL_OVERRIDE; - void unpack_cluster( unsigned int k ) Q_DECL_OVERRIDE; - MoveHint translateMove(const MOVE &m) Q_DECL_OVERRIDE; -- -- void print_layout() Q_DECL_OVERRIDE; -+#endif -+ virtual void translate_layout(); -+#if 0 -+ virtual void unpack_cluster( unsigned int k ); -+#endif -+ virtual MoveHint translateMove(const MOVE &m); -+ virtual void setFcSolverGameParams(); -+ virtual int get_cmd_line_arg_count(); -+ virtual const char * * get_cmd_line_args(); -+#if 0 -+ virtual void print_layout(); - - int Nwpiles; /* the numbers we're actually using */ - int Ntpiles; -@@ -51,10 +61,11 @@ public: - card_t O[4]; /* output piles store only the rank or NONE */ - card_t Osuit[4]; - -- const Freecell *deal; - - static int Xparam[]; -+#endif - -+ const Freecell *deal; - }; - - #endif // FREECELLSOLVER_H -diff --git a/patsolve/patsolve.h b/patsolve/patsolve.h -index 03285d4..1c3a7c6 100644 ---- a/patsolve/patsolve.h -+++ b/patsolve/patsolve.h -@@ -33,6 +33,10 @@ - - #include - -+/* A card is represented as ( down << 6 ) + (suit << 4) + rank. */ -+ -+typedef quint8 card_t; -+ - struct POSITION { - POSITION *queue; /* next position in the queue */ - POSITION *parent; /* point back up the move stack */ -@@ -48,14 +52,15 @@ class MemoryManager; - template - class Solver : public SolverInterface - { -+ - public: - - Solver(); - virtual ~Solver(); -- ExitStatus patsolve( int max_positions = -1) final; -+ virtual ExitStatus patsolve( int max_positions = -1); -+ bool recursive(POSITION *pos = nullptr); - virtual void translate_layout() = 0; - virtual MoveHint translateMove(const MOVE &m ) = 0; -- - void stopExecution() final; - QList firstMoves() const final; - QList winMoves() const final; -@@ -126,8 +131,7 @@ protected: - POSITION *Stack = nullptr; - QMap recu_pos; - int max_positions; -- --private: -+protected: - QList m_firstMoves; - QList m_winMoves; - std::atomic_bool m_shouldEnd; -diff --git a/patsolve/simonsolver.cpp b/patsolve/simonsolver.cpp -index a9d640c..e75dcaa 100644 ---- a/patsolve/simonsolver.cpp -+++ b/patsolve/simonsolver.cpp -@@ -15,17 +15,26 @@ - * along with this program. If not, see . - */ - -+#include -+#include -+ -+#include "freecell-solver/fcs_user.h" -+#include "freecell-solver/fcs_cl.h" -+ - #include "simonsolver.h" - - #include "../simon.h" - - #include - -+const int CHUNKSIZE = 100; -+const long int MAX_ITERS_LIMIT = 200000; - - #define PRINT 0 - - /* These two routines make and unmake moves. */ - -+#if 0 - void SimonSolver::make_move(MOVE *m) - { - #if PRINT -@@ -136,13 +145,62 @@ void SimonSolver::undo_move(MOVE *m) - print_layout(); - #endif - } -+#endif -+ -+#define CMD_LINE_ARGS_NUM 4 -+static const char * freecell_solver_cmd_line_args[CMD_LINE_ARGS_NUM] = -+{ -+ "-g", "simple_simon", "--load-config", "the-last-mohican" -+}; -+ -+int SimonSolver::get_cmd_line_arg_count() -+{ -+ return CMD_LINE_ARGS_NUM; -+} -+ -+const char * * SimonSolver::get_cmd_line_args() -+{ -+ return freecell_solver_cmd_line_args; -+} -+ -+void SimonSolver::setFcSolverGameParams() -+{ -+ freecell_solver_user_apply_preset(solver_instance, "simple_simon"); -+} - -+#if 0 - /* Get the possible moves from a position, and store them in Possible[]. */ - - int SimonSolver::get_possible_moves(int *a, int *numout) - { - MOVE *mp; -+ int n; -+ -+ mp = Possible; -+ n = 0; -+ *a = 1; -+ -+ while (freecell_solver_user_get_moves_left(solver_instance)) -+ { -+ fcs_move_t move; -+ fcs_move_t * move_ptr; -+ if (!freecell_solver_user_get_next_move(solver_instance, &move)) { -+ move_ptr = new fcs_move_t; -+ *move_ptr = move; -+ mp->ptr = (void *)move_ptr; -+ mp++; -+ n++; -+ } -+ else -+ { -+ Q_ASSERT(0); -+ } -+ } -+ -+ *numout = n; -+ return n; - -+#if 0 - /* Check for moves from W to O. */ - - int n = 0; -@@ -301,8 +359,11 @@ int SimonSolver::get_possible_moves(int *a, int *numout) - } - - return n; -+#endif - } -+#endif - -+#if 0 - void SimonSolver::unpack_cluster( unsigned int k ) - { - // TODO: this only works for easy -@@ -314,7 +375,9 @@ void SimonSolver::unpack_cluster( unsigned int k ) - O[i] = -1; - } - } -+#endif - -+#if 0 - bool SimonSolver::isWon() - { - // maybe won? -@@ -324,7 +387,9 @@ bool SimonSolver::isWon() - - return true; - } -+#endif - -+#if 0 - int SimonSolver::getOuts() - { - int k = 0; -@@ -334,9 +399,10 @@ int SimonSolver::getOuts() - - return k; - } -+#endif - - SimonSolver::SimonSolver(const Simon *dealer) -- : Solver() -+ : FcSolveSolver() - { - deal = dealer; - } -@@ -346,6 +412,14 @@ card). Temp cells and Out on the last two lines, if any. */ - - void SimonSolver::translate_layout() - { -+ strcpy(board_as_string, deal->solverFormat().toLatin1()); -+ -+ if (solver_instance) -+ { -+ freecell_solver_user_recycle(solver_instance); -+ solver_ret = FCS_STATE_NOT_BEGAN_YET; -+ } -+#if 0 - /* Read the workspace. */ - int total = 0; - -@@ -364,8 +438,10 @@ void SimonSolver::translate_layout() - O[i] = translateSuit( c->suit() ); - } - } -+#endif - } - -+#if 0 - unsigned int SimonSolver::getClusterNumber() - { - unsigned int k = 0; -@@ -376,7 +452,9 @@ unsigned int SimonSolver::getClusterNumber() - } - return k; - } -+#endif - -+#if 0 - void SimonSolver::print_layout() - { - int i, w, o; -@@ -397,9 +475,57 @@ void SimonSolver::print_layout() - } - fprintf(stderr, "\nprint-layout-end\n"); - } -+#endif - - MoveHint SimonSolver::translateMove( const MOVE &m ) - { -+ fcs_move_t move = m.fcs; -+ int cards = fcs_move_get_num_cards_in_seq(move); -+ PatPile *from = 0; -+ PatPile *to = 0; -+ -+ switch(fcs_move_get_type(move)) -+ { -+ case FCS_MOVE_TYPE_STACK_TO_STACK: -+ from = deal->store[fcs_move_get_src_stack(move)]; -+ to = deal->store[fcs_move_get_dest_stack(move)]; -+ break; -+ -+ case FCS_MOVE_TYPE_SEQ_TO_FOUNDATION: -+ from = deal->store[fcs_move_get_src_stack(move)]; -+ cards = 13; -+ to = deal->target[fcs_move_get_foundation(move)]; -+ break; -+ -+ } -+ Q_ASSERT(from); -+ Q_ASSERT(cards <= from->cards().count()); -+ Q_ASSERT(to || cards == 1); -+ KCard *card = from->cards()[from->cards().count() - cards]; -+ -+ if (!to) -+ { -+ PatPile *target = 0; -+ PatPile *empty = 0; -+ for (int i = 0; i < 4; ++i) { -+ KCard *c = deal->target[i]->topCard(); -+ if (c) { -+ if ( c->suit() == card->suit() ) -+ { -+ target = deal->target[i]; -+ break; -+ } -+ } else if ( !empty ) -+ empty = deal->target[i]; -+ } -+ to = target ? target : empty; -+ } -+ -+ Q_ASSERT(to); -+ -+ return MoveHint(card, to, 0); -+ -+#if 0 - Q_ASSERT( m.from < 10 && m.to < 10 ); - - PatPile *frompile = deal->store[m.from]; -@@ -414,4 +540,5 @@ MoveHint SimonSolver::translateMove( const MOVE &m ) - - Q_ASSERT( m.to < 10 ); - return MoveHint( card, deal->store[m.to], m.pri ); -+#endif - } -diff --git a/patsolve/simonsolver.h b/patsolve/simonsolver.h -index 2d57dda..4a417b1 100644 ---- a/patsolve/simonsolver.h -+++ b/patsolve/simonsolver.h -@@ -18,29 +18,37 @@ - #ifndef SIMONSOLVER_H - #define SIMONSOLVER_H - --#include "patsolve.h" -+#include "abstract_fc_solve_solver.h" -+#include "simon.h" - class Simon; - - --class SimonSolver : public Solver<10> -+class SimonSolver : public FcSolveSolver - { - public: - explicit SimonSolver(const Simon *dealer); -+#if 0 - int get_possible_moves(int *a, int *numout) Q_DECL_OVERRIDE; - bool isWon() Q_DECL_OVERRIDE; - void make_move(MOVE *m) Q_DECL_OVERRIDE; - void undo_move(MOVE *m) Q_DECL_OVERRIDE; - int getOuts() Q_DECL_OVERRIDE; - unsigned int getClusterNumber() Q_DECL_OVERRIDE; -- void translate_layout() Q_DECL_OVERRIDE; -+#endif -+ virtual void translate_layout() Q_DECL_OVERRIDE; -+ virtual MoveHint translateMove(const MOVE &m) Q_DECL_OVERRIDE; -+#if 0 - void unpack_cluster( unsigned int k ) Q_DECL_OVERRIDE; -- MoveHint translateMove(const MOVE &m) Q_DECL_OVERRIDE; -- - void print_layout() Q_DECL_OVERRIDE; -+#endif -+ virtual void setFcSolverGameParams(); - -+ virtual int get_cmd_line_arg_count(); -+ virtual const char * * get_cmd_line_args(); -+#if 0 - /* Names of the cards. The ordering is defined in pat.h. */ -- - int O[4]; -+#endif - const Simon *deal; - }; - -diff --git a/patsolve/solverinterface.h b/patsolve/solverinterface.h -index d99d3b8..77fd410 100644 ---- a/patsolve/solverinterface.h -+++ b/patsolve/solverinterface.h -@@ -4,6 +4,7 @@ - #include - - #include "../hint.h" -+#include "freecell-solver/fcs_user.h" - - - /* A card is represented as ( down << 6 ) + (suit << 4) + rank. */ -@@ -22,6 +23,7 @@ public: - PileType totype; - signed char pri; /* move priority (low priority == low value) */ - int turn_index; /* turn the card index */ -+ fcs_move_t fcs; /* A Freecell Solver move. */ - - bool operator<( const MOVE &m) const - { -diff --git a/pileutils.cpp b/pileutils.cpp -index 1e3da3e..609c716 100644 ---- a/pileutils.cpp -+++ b/pileutils.cpp -@@ -48,6 +48,33 @@ bool isSameSuitAscending( const QList & cards ) - return true; - } - -+int countSameSuitDescendingSequences( const QList & cards ) -+{ -+ if ( cards.size() <= 1 ) -+ return 0; -+ -+ int suit = cards.first()->suit(); -+ int lastRank = cards.first()->rank(); -+ -+ int count = 1; -+ -+ for( int i = 1; i < cards.size(); ++i ) -+ { -+ --lastRank; -+ -+ if ( cards[i]->rank() != lastRank ) -+ return -1; -+ -+ if ( cards[i]->suit() != suit ) -+ { -+ count++; -+ suit = cards[i]->suit(); -+ } -+ } -+ return count; -+} -+ -+ - - bool isSameSuitDescending( const QList & cards ) - { -@@ -121,3 +148,37 @@ bool checkAddAlternateColorDescendingFromKing( const QList & oldCards, c - && newCards.first()->rank() == oldCards.last()->rank() - 1; - } - -+QString suitToString(int s) { -+ switch (s) { -+ case KCardDeck::Clubs: -+ return "C"; -+ case KCardDeck::Hearts: -+ return "H"; -+ case KCardDeck::Diamonds: -+ return "D"; -+ case KCardDeck::Spades: -+ return "S"; -+ default: -+ exit(-1); -+ } -+ return QString(); -+} -+ -+QString rankToString(int r) -+{ -+ switch (r) { -+ case KCardDeck::King: -+ return "K"; -+ case KCardDeck::Ace: -+ return "A"; -+ case KCardDeck::Jack: -+ return "J"; -+ case KCardDeck::Queen: -+ return "Q"; -+ case KCardDeck::Ten: -+ return "T"; -+ default: -+ return QString::number(r); -+ } -+} -+ -diff --git a/pileutils.h b/pileutils.h -index 2fa1657..faa8c40 100644 ---- a/pileutils.h -+++ b/pileutils.h -@@ -26,9 +26,13 @@ class KCard; - bool isSameSuitAscending( const QList & cards ); - bool isSameSuitDescending( const QList & cards ); - bool isAlternateColorDescending( const QList & cards ); -+int countSameSuitDescendingSequences( const QList & cards ); - - bool checkAddSameSuitAscendingFromAce( const QList & oldCards, const QList & newCards ); - bool checkAddAlternateColorDescending( const QList & oldCards, const QList & newCards ); - bool checkAddAlternateColorDescendingFromKing( const QList & oldCards, const QList & newCards ); - -+extern QString suitToString(int s); -+extern QString rankToString(int r); -+ - #endif -diff --git a/simon.cpp b/simon.cpp -index 8e3ef10..834dd55 100644 ---- a/simon.cpp -+++ b/simon.cpp -@@ -111,24 +111,70 @@ bool Simon::checkAdd(const PatPile * pile, const QList & oldCards, const - { - if (pile->pileRole() == PatPile::Tableau) - { -- return oldCards.isEmpty() -- || oldCards.last()->rank() == newCards.first()->rank() + 1; -+ if (! (oldCards.isEmpty() -+ || oldCards.last()->rank() == newCards.first()->rank() + 1 )) -+ { -+ return false; -+ } -+ -+ int seqs_count = countSameSuitDescendingSequences(newCards); -+ -+ if (seqs_count < 0) -+ return false; -+ -+ // This is similar to the supermoves of Freecell - we can use empty -+ // columns to temporarily hold intermediate sub-sequences which are -+ // not the same suit - only a "false" parent. -+ // Shlomi Fish -+ -+ int empty_piles_count = 0; -+ -+ for (int i = 0; i < 10; ++i ) -+ if (store[i]->isEmpty() && ( store[i]->index() != pile->index() )) -+ empty_piles_count++; -+ -+ return (seqs_count <= (1 << empty_piles_count)); - } - else - { - return oldCards.isEmpty() - && newCards.first()->rank() == KCardDeck::King -- && newCards.last()->rank() == KCardDeck::Ace; -+ && newCards.last()->rank() == KCardDeck::Ace -+ && isSameSuitDescending(newCards); - } - } - - bool Simon::checkRemove(const PatPile * pile, const QList & cards) const - { -- return pile->pileRole() == PatPile::Tableau -- && isSameSuitDescending(cards); -+ if (pile->pileRole() != PatPile::Tableau) -+ return false; -+ -+ int seqs_count = countSameSuitDescendingSequences(cards); -+ -+ return (seqs_count >= 0); - } - -+QString Simon::solverFormat() const -+{ -+ QString output; -+ QString tmp; -+ for (int i = 0; i < 4 ; i++) { -+ if (target[i]->isEmpty()) -+ continue; -+ tmp += suitToString(target[i]->topCard()->suit()) + "-K "; -+ } -+ if (!tmp.isEmpty()) -+ output += QString::fromLatin1("Foundations: %1\n").arg(tmp); - -+ for (int i = 0; i < 10 ; i++) -+ { -+ QList cards = store[i]->cards(); -+ for (QList::ConstIterator it = cards.begin(); it != cards.end(); ++it) -+ output += rankToString((*it)->rank()) + suitToString((*it)->suit()) + ' '; -+ output += '\n'; -+ } -+ return output; -+} - - static class SimonDealerInfo : public DealerInfo - { -diff --git a/simon.h b/simon.h -index 83d10ab..d816f27 100644 ---- a/simon.h -+++ b/simon.h -@@ -57,6 +57,7 @@ private: - PatPile* store[10]; - PatPile* target[4]; - -+ virtual QString solverFormat() const; - friend class SimonSolver; - }; - --- -cgit v0.11.2 - diff --git a/kde/patch/krita.patch b/kde/patch/krita.patch deleted file mode 100644 index 247bbd7..0000000 --- a/kde/patch/krita.patch +++ /dev/null @@ -1,7 +0,0 @@ -# Fix compilation of Krita against Qt 5.9: -#cat $CWD/patch/krita/krita_qt59.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Hack around tablet issues with un-patched Qt 5.12: -#cat $CWD/patch/krita/krita_qtabletevents.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - - diff --git a/kde/patch/krita/krita_qt512.patch b/kde/patch/krita/krita_qt512.patch deleted file mode 100644 index 765d232..0000000 --- a/kde/patch/krita/krita_qt512.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 98aab8f2942cdc78dda8cfeba3580bd9d57e00a2 Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Fri, 5 Oct 2018 11:16:26 +0200 -Subject: [PATCH] Add a cmake option to disable our own tablet support - -Off by default, this makes it easier to check whether bugs are -caused by our fork of Qt's classes or to check whether Qt's tablet -support has improved. - -CCBUG:399379 ---- - CMakeLists.txt | 4 ++++ - config_use_qt_xcb.h.cmake | 6 ++++++ - krita/main.cc | 8 +++++++- - libs/ui/CMakeLists.txt | 12 ++++++++---- - libs/ui/input/wintab/qxcbconnection.cpp | 1 - - 5 files changed, 25 insertions(+), 6 deletions(-) - create mode 100644 config_use_qt_xcb.h.cmake - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 17c9cd2d7..3199ae4da 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -168,6 +168,10 @@ if (WIN32) - endif (MINGW) - endif () - -+option(USE_QT_XCB "Do not use Krita's forked XCB connection and tablet support on X11, but leave everything to Qt." OFF) -+configure_file(config_use_qt_xcb.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_use_qt_xcb.h) -+add_feature_info("Use Qt's XCB and Tablet support on X11" USE_QT_XCB "Do not use Krita's forked XCB connection and tablet support on X11, but leave everything to Qt.") -+ - option(HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just ignore them automatically and dump a message to the terminal." ON) - configure_file(config-hide-safe-asserts.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-hide-safe-asserts.h) - add_feature_info("Hide Safe Asserts" HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just ignore them automatically and dump a message to the terminal.") -diff --git a/config_use_qt_xcb.h.cmake b/config_use_qt_xcb.h.cmake -new file mode 100644 -index 000000000..9fe3360cc ---- /dev/null -+++ b/config_use_qt_xcb.h.cmake -@@ -0,0 +1,6 @@ -+/* config_use_qt_xcb.h. Generated from config_use_qt_xcb.h.cmake */ -+ -+#cmakedefine USE_QT_XCB 1 -+ -+ -+ -diff --git a/krita/main.cc b/krita/main.cc -index dca2ee170..398fa3384 100644 ---- a/krita/main.cc -+++ b/krita/main.cc -@@ -63,8 +63,11 @@ - #include - - #elif defined HAVE_X11 -+#include "config_use_qt_xcb.h" -+#ifndef USE_QT_XCB - #include - #endif -+#endif - - #if defined HAVE_KCRASH - #include -@@ -336,8 +339,11 @@ extern "C" int main(int argc, char **argv) - } - - #if defined HAVE_X11 -- app.installNativeEventFilter(KisXi2EventFilter::instance()); -+ #ifndef USE_QT_XCB -+ app.installNativeEventFilter(KisXi2EventFilter::instance()); -+ #endif - #endif -+ - app.installEventFilter(KisQtWidgetsTweaker::instance()); - - -diff --git a/libs/ui/CMakeLists.txt b/libs/ui/CMakeLists.txt -index 2909398ab..b4673ca92 100644 ---- a/libs/ui/CMakeLists.txt -+++ b/libs/ui/CMakeLists.txt -@@ -425,14 +425,18 @@ endif() - input/wintab/drawpile_tablettester/tablettest.cpp - ) - --if(UNIX) -+if (UNIX) - set(kritaui_LIB_SRCS - ${kritaui_LIB_SRCS} -- input/kis_tablet_event.cpp -- input/wintab/kis_tablet_support.cpp - qtlockedfile/qtlockedfile_unix.cpp - ) -- if(NOT APPLE) -+ if(NOT USE_QT_XCB) -+ set(kritaui_LIB_SRCS -+ ${kritaui_LIB_SRCS} -+ input/wintab/kis_tablet_support.cpp -+ ) -+ endif() -+ if(NOT APPLE AND NOT USE_QT_XCB) - set(kritaui_LIB_SRCS - ${kritaui_LIB_SRCS} - input/wintab/qxcbconnection_xi2.cpp -diff --git a/libs/ui/input/wintab/qxcbconnection.cpp b/libs/ui/input/wintab/qxcbconnection.cpp -index 5991bc187..c062d05e0 100644 ---- a/libs/ui/input/wintab/qxcbconnection.cpp -+++ b/libs/ui/input/wintab/qxcbconnection.cpp -@@ -41,7 +41,6 @@ - #include - #include - -- - #include - #include - --- -2.17.1 - diff --git a/kde/patch/krita/krita_qt59.patch b/kde/patch/krita/krita_qt59.patch deleted file mode 100644 index f517995..0000000 --- a/kde/patch/krita/krita_qt59.patch +++ /dev/null @@ -1,26 +0,0 @@ -Source: https://github.com/KDE/krita/commit/2f59d0d1.patch - -From 2f59d0d1d91e3f79342c20d0df68aa9a51817e8d Mon Sep 17 00:00:00 2001 -From: Luca Beltrame -Date: Sat, 6 May 2017 16:00:21 +0200 -Subject: [PATCH] Drop QForeachContainer include and fix Qt 5.9 build - -It's not used anywhere. - -Acked by boud. ---- - libs/ui/KisResourceBundleManifest.cpp | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/libs/ui/KisResourceBundleManifest.cpp b/libs/ui/KisResourceBundleManifest.cpp -index e4f94ca788..83761657d8 100644 ---- a/libs/ui/KisResourceBundleManifest.cpp -+++ b/libs/ui/KisResourceBundleManifest.cpp -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - - #include - #include diff --git a/kde/patch/krita/krita_qtabletevents.patch b/kde/patch/krita/krita_qtabletevents.patch deleted file mode 100644 index a1d3869..0000000 --- a/kde/patch/krita/krita_qtabletevents.patch +++ /dev/null @@ -1,67 +0,0 @@ -# NOTE: original patch: https://cgit.kde.org/krita.git/commit/?id=a3193fe2 -# But first part (patch to ext_qt)) has been removed due to failure to apply. -# -- Eric Hameleers - -From a3193fe273c3f2c3b5493f77724a4bc099ae5e36 Mon Sep 17 00:00:00 2001 -From: Dmitry Kazakov -Date: Mon, 11 Mar 2019 16:49:31 +0300 -Subject: Add a hacky patch that ensures QTabletEvents to be ignored in - distribution builds - -If we ensure that all the tablet events are ignored, then Qt -will always generate synthesized mouse events, avoiding the -problem of lost Enter/Leave events. - -We also mark our own build of Qt about the presence of the fix -(therefore, it doesn't need this hack). ---- - libs/ui/input/kis_input_manager.cpp | 20 ++++++++++++++++ - -index 30a4677..d173543 100644 ---- a/libs/ui/input/kis_input_manager.cpp -+++ b/libs/ui/input/kis_input_manager.cpp -@@ -496,6 +496,13 @@ bool KisInputManager::eventFilterImpl(QEvent * event) - //Reset signal compressor to prevent processing events before press late - d->resetCompressor(); - d->eatOneMousePress(); -+ -+#if defined Q_OS_LINUX && !defined QT_HAS_ENTER_LEAVE_PATCH -+ // remove this hack when this patch is integrated: -+ // https://codereview.qt-project.org/#/c/255384/ -+ event->setAccepted(false); -+#endif -+ - break; - } - case QEvent::TabletMove: { -@@ -517,6 +524,12 @@ bool KisInputManager::eventFilterImpl(QEvent * event) - */ - d->blockMouseEvents(); - -+#if defined Q_OS_LINUX && !defined QT_HAS_ENTER_LEAVE_PATCH -+ // remove this hack when this patch is integrated: -+ // https://codereview.qt-project.org/#/c/255384/ -+ event->setAccepted(false); -+#endif -+ - break; - } - case QEvent::TabletRelease: { -@@ -529,6 +542,13 @@ bool KisInputManager::eventFilterImpl(QEvent * event) - retval = d->matcher.buttonReleased(tabletEvent->button(), tabletEvent); - retval = true; - event->setAccepted(true); -+ -+#if defined Q_OS_LINUX && !defined QT_HAS_ENTER_LEAVE_PATCH -+ // remove this hack when this patch is integrated: -+ // https://codereview.qt-project.org/#/c/255384/ -+ event->setAccepted(false); -+#endif -+ - break; - } - --- -cgit v1.1 - - diff --git a/kde/patch/kscreenlocker.patch b/kde/patch/kscreenlocker.patch deleted file mode 100644 index d1b51ea..0000000 --- a/kde/patch/kscreenlocker.patch +++ /dev/null @@ -1,13 +0,0 @@ -# KDEBUG #358125, also CVE-2016-2312 (fixed in Plasma 5.5.5): -# Dont quit the Greeter when last window closes. -#cat $CWD/patch/kscreenlocker/kscreenlocker_CVE-2016-2312.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Backport two important stability fixes from 5.14 - -# Force software rendering when greeter crashed: -#cat $CWD/patch/kscreenlocker/kscreenlocker_crash_force_softrender.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } -# Load QtQuickSettings for software rendering (KDEBUG #347772): -# Applied in Plasma 5.13.5: -#cat $CWD/patch/kscreenlocker/kscreenlocker_rendersettings.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - - - diff --git a/kde/patch/kscreenlocker/kscreenlocker_CVE-2016-2312.patch b/kde/patch/kscreenlocker/kscreenlocker_CVE-2016-2312.patch deleted file mode 100644 index 492ef80..0000000 --- a/kde/patch/kscreenlocker/kscreenlocker_CVE-2016-2312.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Martin Gräßlin -Date: Fri, 05 Feb 2016 09:30:19 +0000 -Subject: [greeter] Dont quit when last window closes -X-Git-Url: http://quickgit.kde.org/?p=kscreenlocker.git&a=commitdiff&h=fae65f1cdd6446042b31ccd0eafd7a4c0b6623e3 ---- -[greeter] Dont quit when last window closes - -Qt allows to have no screens. If all XRandR screens are disconnected -there are also no QScreens. This is from an X11 perspective wrong, but -we have to deal with it. No QScreens means that all views are destroyed -and no new ones are created. Thus all windows close and the greeter -exited successfully which in turn unlocked the screen. - -This change ensures that the greeter doesn't exit when all windows close. - -Funnily this was not a problem with the well known issue of Qt -crashing when all screens are disconnected. The lock screen handles -crashes gracefully and just restarts or more likely Qt also crashes -the application using KSld and thus taking down the complete session. - -BUG: 358125 -FIXED-IN: 5.5.5 ---- - - ---- a/greeter/main.cpp -+++ b/greeter/main.cpp -@@ -59,6 +59,7 @@ - qputenv("QT_IM_MODULE", QByteArrayLiteral("compose")); - } - ScreenLocker::UnlockApp app(argc, argv); -+ app.setQuitOnLastWindowClosed(false); - QCoreApplication::setApplicationName(QStringLiteral("kscreenlocker_greet")); - QCoreApplication::setApplicationVersion(QStringLiteral("0.1")); - QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org")); - diff --git a/kde/patch/kscreenlocker/kscreenlocker_crash_force_softrender.patch b/kde/patch/kscreenlocker/kscreenlocker_crash_force_softrender.patch deleted file mode 100644 index 06045d7..0000000 --- a/kde/patch/kscreenlocker/kscreenlocker_crash_force_softrender.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 875e44f56d4597ba3b65f5bf4ff2b315376c05a4 Mon Sep 17 00:00:00 2001 -From: Kai Uwe Broulik -Date: Wed, 11 Jul 2018 18:01:41 +0200 -Subject: Force software rendering when greeter crashed - -We have a fallback QML theme for when the look and feel package is broken but when the -graphics driver is broken (e.g. proprietary graphics driver update) the lock screen would -stop working. When the greeter crashed, better play safe and force software rendering - -Reviewed-By: d_ed ---- - ksldapp.cpp | 13 +++++++++++-- - ksldapp.h | 9 +++++++++ - 2 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/ksldapp.cpp b/ksldapp.cpp -index 892826f..5fe28ea 100644 ---- a/ksldapp.cpp -+++ b/ksldapp.cpp -@@ -66,6 +66,8 @@ along with this program. If not, see . - namespace ScreenLocker - { - -+static const QString s_qtQuickBackend = QStringLiteral("QT_QUICK_BACKEND"); -+ - static KSldApp * s_instance = nullptr; - - KSldApp* KSldApp::self() -@@ -226,6 +228,8 @@ void KSldApp::initialize() - // failure, restart lock process - m_greeterCrashedCounter++; - if (m_greeterCrashedCounter < 4) { -+ // Perhaps it crashed due to a graphics driver issue, force software rendering now -+ setForceSoftwareRendering(true); - startLockProcess(EstablishLock::Immediate); - } else if (m_lockWindow) { - m_lockWindow->emergencyShow(); -@@ -385,6 +389,7 @@ void KSldApp::lock(EstablishLock establishLock) - - m_lockState = AcquiringLock; - -+ setForceSoftwareRendering(false); - // start unlock screen process - startLockProcess(establishLock); - emit lockStateChanged(); -@@ -546,6 +551,8 @@ bool KSldApp::isFdoPowerInhibited() const - - void KSldApp::startLockProcess(EstablishLock establishLock) - { -+ QProcessEnvironment env = m_greeterEnv; -+ - if (m_isWayland && m_waylandDisplay) { - int sx[2]; - if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sx) < 0) { -@@ -566,9 +573,7 @@ void KSldApp::startLockProcess(EstablishLock establishLock) - emit greeterClientConnectionChanged(); - int socket = dup(sx[1]); - if (socket >= 0) { -- QProcessEnvironment env = m_greeterEnv; - env.insert("WAYLAND_SOCKET", QByteArray::number(socket)); -- m_lockProcess->setProcessEnvironment(env); - } - } - QStringList args; -@@ -587,6 +592,9 @@ void KSldApp::startLockProcess(EstablishLock establishLock) - if (m_lockGrace == -1) { - args << QStringLiteral("--nolock"); - } -+ if (m_forceSoftwareRendering) { -+ env.insert(s_qtQuickBackend, QStringLiteral("software")); -+ } - - // start the Wayland server - int fd = m_waylandServer->start(); -@@ -598,6 +606,7 @@ void KSldApp::startLockProcess(EstablishLock establishLock) - args << QStringLiteral("--ksldfd"); - args << QString::number(fd); - -+ m_lockProcess->setProcessEnvironment(env); - m_lockProcess->start(QStringLiteral(KSCREENLOCKER_GREET_BIN), args); - close(fd); - } -diff --git a/ksldapp.h b/ksldapp.h -index 4849588..b6d6703 100644 ---- a/ksldapp.h -+++ b/ksldapp.h -@@ -127,6 +127,14 @@ public: - m_lockGrace = msec; - } - -+ bool forceSoftwareRendering() const { -+ return m_forceSoftwareRendering; -+ } -+ -+ void setForceSoftwareRendering(bool force) { -+ m_forceSoftwareRendering = force; -+ } -+ - Q_SIGNALS: - void locked(); - void unlocked(); -@@ -179,6 +187,7 @@ private: - LogindIntegration *m_logind; - GlobalAccel *m_globalAccel = nullptr; - bool m_hasXInput2 = false; -+ bool m_forceSoftwareRendering = false; - - bool m_isX11; - bool m_isWayland; --- -cgit v0.11.2 - diff --git a/kde/patch/kscreenlocker/kscreenlocker_rendersettings.patch b/kde/patch/kscreenlocker/kscreenlocker_rendersettings.patch deleted file mode 100644 index 2802a1a..0000000 --- a/kde/patch/kscreenlocker/kscreenlocker_rendersettings.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 3f104cbb0a34024dc1aa45538d2ef2403a7a45f0 Mon Sep 17 00:00:00 2001 -From: David Edmundson -Date: Fri, 10 Aug 2018 01:18:42 +0200 -Subject: Load QtQuickSettings for software rendering - -We had support for falling back on errors yet somehow -the initial basic loading was missing. - -Summary: BUG: 347772 - -Test Plan: Compiles - -Reviewers: #plasma, broulik - -Reviewed By: #plasma, broulik - -Subscribers: plasma-devel - -Tags: #plasma - -Differential Revision: https://phabricator.kde.org/D14708 ---- - greeter/main.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/greeter/main.cpp b/greeter/main.cpp -index ff64a55..6db87e1 100644 ---- a/greeter/main.cpp -+++ b/greeter/main.cpp -@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License - along with this program. If not, see . - *********************************************************************/ - #include -+#include - - #include - #include -@@ -85,6 +86,8 @@ int main(int argc, char* argv[]) - QCoreApplication::setApplicationVersion(QStringLiteral("0.1")); - QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org")); - -+ KQuickAddons::QtQuickSettings::init(); -+ - // disable session management for the greeter - auto disableSessionManagement = [](QSessionManager &sm) { - sm.setRestartHint(QSessionManager::RestartNever); --- -cgit v0.11.2 - diff --git a/kde/patch/kstars.patch b/kde/patch/kstars.patch deleted file mode 100644 index 8367818..0000000 --- a/kde/patch/kstars.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix for "error: isnan was not declared in this scope" -#cat $CWD/patch/kstars/kstars_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kstars/kstars_isnan.patch b/kde/patch/kstars/kstars_isnan.patch deleted file mode 100644 index 1c4aef3..0000000 --- a/kde/patch/kstars/kstars_isnan.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: Christian Dersch -Date: Wed, 03 Feb 2016 10:19:55 +0000 -Subject: Fix compilation with gcc 6.x (namespace std has to be used explicitly in some cases, e.g. when ambiguous) -X-Git-Url: http://quickgit.kde.org/?p=kstars.git&a=commitdiff&h=7d34e52f4dd6e15b871596b3c64d4c7cdba599b4 ---- -Fix compilation with gcc 6.x (namespace std has to be used explicitly in some cases, e.g. when ambiguous) -REVIEW:126976 ---- - - ---- a/kstars/fitsviewer/fitsdata.cpp -+++ b/kstars/fitsviewer/fitsdata.cpp -@@ -548,7 +548,7 @@ - int diff_x=s1->x - s2->x; - int diff_y=s1->y - s2->y; - -- dis = abs( sqrt( diff_x*diff_x + diff_y*diff_y)); -+ dis = std::abs( sqrt( diff_x*diff_x + diff_y*diff_y)); - dis -= s1->width/2; - dis -= s2->width/2; - - ---- a/kstars/tools/horizonmanager.cpp -+++ b/kstars/tools/horizonmanager.cpp -@@ -192,7 +192,7 @@ - az = dms::fromString(regionItem->child(i, 1)->data(Qt::DisplayRole).toString(), true); - alt = dms::fromString(regionItem->child(i, 2)->data(Qt::DisplayRole).toString(), true); - -- if (isnan(az.Degrees()) || isnan(alt.Degrees())) -+ if (std::isnan(az.Degrees()) || std::isnan(alt.Degrees())) - return false; - - p.setAz(az); -@@ -534,9 +534,9 @@ - dms azAngle = dms::fromString(parent->child(item->row(),1)->data(Qt::DisplayRole).toString(), true); - dms altAngle = dms::fromString(parent->child(item->row(),2)->data(Qt::DisplayRole).toString(), true); - -- if (isnan(azAngle.Degrees())) -+ if (std::isnan(azAngle.Degrees())) - azOK = false; -- if (isnan(altAngle.Degrees())) -+ if (std::isnan(altAngle.Degrees())) - altOK = false; - - if ( (item->column() == 1 && azOK == false) || (item->column() == 2 && altOK == false) ) - diff --git a/kde/patch/ksudoku.patch b/kde/patch/ksudoku.patch deleted file mode 100644 index d379585..0000000 --- a/kde/patch/ksudoku.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Qt5 apps accept qwindowtitle, not caption. KDEBUG 381087, -# however ksudoku-17.04.x is still kdelibs4 based: -#cat $CWD/patch/ksudoku/ksudoku_qwindowtitle.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/ksudoku/ksudoku_qwindowtitle.patch b/kde/patch/ksudoku/ksudoku_qwindowtitle.patch deleted file mode 100644 index 3417b34..0000000 --- a/kde/patch/ksudoku/ksudoku_qwindowtitle.patch +++ /dev/null @@ -1,15 +0,0 @@ -Qt5 .desktop files for apps accept qwindowtitle, not caption. -However, the 17.04 branch of ksudoku is still kdelibs4 based, and the -patch applied to KDE BUG 381087 broke the launch of ksudoku here: - ---- a/src/gui/org.kde.ksudoku.desktop 2017-06-13 02:44:11.000000000 +0200 -+++ b/src/gui/org.kde.ksudoku.desktop 2017-07-15 11:58:32.027477614 +0200 -@@ -50,7 +50,7 @@ - Name[x-test]=xxKSudokuxx - Name[zh_CN]=KSudoku - Name[zh_TW]=KSudoku --Exec=ksudoku %i -qwindowtitle %c -+Exec=ksudoku %i -caption %c - Icon=ksudoku - Type=Application - X-DocPath=ksudoku/index.html diff --git a/kde/patch/ktexteditor.patch b/kde/patch/ktexteditor.patch deleted file mode 100644 index a4f0aad..0000000 --- a/kde/patch/ktexteditor.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Fix indentation for some languages (e.g. Python) in Kate and KDevelop: -#cat $CWD/patch/ktexteditor/ktexteditor_fix_indentation.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/ktexteditor/ktexteditor_fix_indentation.patch b/kde/patch/ktexteditor/ktexteditor_fix_indentation.patch deleted file mode 100644 index fc5d9d9..0000000 --- a/kde/patch/ktexteditor/ktexteditor_fix_indentation.patch +++ /dev/null @@ -1,32 +0,0 @@ -From aeebeadb5f5955995c17de56cf83ba7166a132dd Mon Sep 17 00:00:00 2001 -From: Sven Brauch -Date: Mon, 16 Oct 2017 18:35:50 +0200 -Subject: fix some indenters from indenting on random characters - -If triggerCharacters was not set, toString() would return "undefined", -making indenters trigger on u, n, d, e, f, i and n. - -Differential Revision: https://phabricator.kde.org/D8333 ---- - src/script/kateindentscript.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/script/kateindentscript.cpp b/src/script/kateindentscript.cpp -index 15ce387..380bd45 100644 ---- a/src/script/kateindentscript.cpp -+++ b/src/script/kateindentscript.cpp -@@ -46,7 +46,10 @@ const QString &KateIndentScript::triggerCharacters() - - m_triggerCharactersSet = true; - -- m_triggerCharacters = global(QStringLiteral("triggerCharacters")).toString(); -+ auto triggerCharacters = global(QStringLiteral("triggerCharacters")); -+ if ( !triggerCharacters.isUndefined() ) { -+ m_triggerCharacters = triggerCharacters.toString(); -+ } - - //qCDebug(LOG_KTE) << "trigger chars: '" << m_triggerCharacters << "'"; - --- -cgit v0.11.2 - diff --git a/kde/patch/ktp-accounts-kcm.patch b/kde/patch/ktp-accounts-kcm.patch deleted file mode 100644 index ea37b9e..0000000 --- a/kde/patch/ktp-accounts-kcm.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Fix a crash in KDE Telepathy which was supposed to be fixed in 15.08.2: -# See also https://bugs.kde.org/show_bug.cgi?id=351785 -#cat $CWD/patch/ktp-accounts-kcm/ktp-accounts-kcm_kdebug_351785.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/ktp-accounts-kcm/ktp-accounts-kcm_kdebug_351785.patch b/kde/patch/ktp-accounts-kcm/ktp-accounts-kcm_kdebug_351785.patch deleted file mode 100644 index aa77aae..0000000 --- a/kde/patch/ktp-accounts-kcm/ktp-accounts-kcm_kdebug_351785.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Martin Klapetek -Date: Thu, 17 Sep 2015 16:11:30 +0000 -Subject: [kaccounts] Emit configUiReady() when config UI is ready -X-Git-Url: http://quickgit.kde.org/?p=ktp-accounts-kcm.git&a=commitdiff&h=07c7cc5309e11171b2e552678d58257ccfc44e42 ---- -[kaccounts] Emit configUiReady() when config UI is ready - -Should prevent the crash when clicking the Configure button - -(requires kaccounts-integration 15.08.2) - -BUG: 351785 -FIXED-IN: 15.08.2 ---- - - ---- a/plugins/kaccounts/kaccounts-ui-provider.cpp -+++ b/plugins/kaccounts/kaccounts-ui-provider.cpp -@@ -106,10 +106,10 @@ - - if (d->type == KAccountsUiPlugin::ConfigureAccountDialog) { - if (d->accountManager->isReady()) { -- Q_EMIT uiReady(); -+ Q_EMIT configUiReady(); - } else { - // let's wait for AM to become ready first -- connect(d->accountManager->becomeReady(), &Tp::PendingOperation::finished, this, &KAccountsUiProvider::uiReady); -+ connect(d->accountManager->becomeReady(), &Tp::PendingOperation::finished, this, &KAccountsUiProvider::configUiReady); - } - } - } - diff --git a/kde/patch/kwin.patch b/kde/patch/kwin.patch deleted file mode 100644 index 9f05f30..0000000 --- a/kde/patch/kwin.patch +++ /dev/null @@ -1,11 +0,0 @@ -# Trivial patch for testing the CK2 session controller interface -# as a replacement for systemd-logind; -#cat $CWD/patch/kwin/kwin_replace_logind_with_ck2.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Workaround Qt regression no longer delivering events for the root window. -# Fixed in kwin 5.10.3. -#cat $CWD/patch/kwin/kwin_qt59_rootwindow_events.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix compilation with cmake 3.10 (fixed in 5.12.0): -#cat $CWD/patch/kwin/kwin_cmake310.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/kwin/kwin_cmake310.patch b/kde/patch/kwin/kwin_cmake310.patch deleted file mode 100644 index 5675ba5..0000000 --- a/kde/patch/kwin/kwin_cmake310.patch +++ /dev/null @@ -1,52 +0,0 @@ -Taken from: -https://gitweb.gentoo.org/repo/gentoo.git/tree/kde-plasma/kwin/files/kwin-5.11.5-cmake-3.10.patch - -From cd544890ced4192d07467c89e23adbb62d8cea5c Mon Sep 17 00:00:00 2001 -From: Milian Wolff -Date: Mon, 18 Dec 2017 11:40:35 +0100 -Subject: Fix build with CMake 3.10 - -Looks like a classic false-positive, but this makes the compile -pass for me without making the code harder to read: - -AutoMoc error -------------- - "/ssd/milian/projects/kf5/src/kde/workspace/kwin/kcmkwin/kwinscripts/main.cpp" -The file contains a K_PLUGIN_FACTORY macro, but does not include "main.moc"! -Consider to - - add #include "main.moc" - - enable SKIP_AUTOMOC for this file - -So we just add the include and then get rid of the duplicate -definition of the plugin factory and the problem is resolved. ---- - kcmkwin/kwinscripts/main.cpp | 2 ++ - kcmkwin/kwinscripts/module.cpp | 2 -- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/kcmkwin/kwinscripts/main.cpp b/kcmkwin/kwinscripts/main.cpp -index f5ee04b..baa5175 100644 ---- a/kcmkwin/kwinscripts/main.cpp -+++ b/kcmkwin/kwinscripts/main.cpp -@@ -22,3 +22,5 @@ - - K_PLUGIN_FACTORY(KcmKWinScriptsFactory, - registerPlugin("kwin-scripts");) -+ -+#include "main.moc" -diff --git a/kcmkwin/kwinscripts/module.cpp b/kcmkwin/kwinscripts/module.cpp -index a0d698e..ccf7d41 100644 ---- a/kcmkwin/kwinscripts/module.cpp -+++ b/kcmkwin/kwinscripts/module.cpp -@@ -40,8 +40,6 @@ - - #include "version.h" - --K_PLUGIN_FACTORY_DECLARATION(KcmKWinScriptsFactory) -- - Module::Module(QWidget *parent, const QVariantList &args) : - KCModule(parent, args), - ui(new Ui::Module), --- -cgit v0.11.2 - diff --git a/kde/patch/kwin/kwin_qt59_rootwindow_events.patch b/kde/patch/kwin/kwin_qt59_rootwindow_events.patch deleted file mode 100644 index 178d081..0000000 --- a/kde/patch/kwin/kwin_qt59_rootwindow_events.patch +++ /dev/null @@ -1,63 +0,0 @@ -From a6dee74ee455d1da47dd5c9d55a84adbb5e1426a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= -Date: Sun, 18 Jun 2017 14:23:33 +0200 -Subject: Workaround Qt regression of no longer delivering events for the root - window - -Summary: -With qtbase 2b34aefcf02f09253473b096eb4faffd3e62b5f4 we do no longer get -events reported for the X11 root window. Our keyboard handling in effects -like PresentWindows and DesktopGrid relied on that. - -This change works around the regression by calling winId() on -qApp->desktop() as suggested in the change. This is a short term solution -for the 5.10 branch. - -This needs to be addressed properly by no longer relying on Qt in this -area. KWin already does not rely on Qt for Wayland in that area and is -able to compose the QKeyEvents. This should also be done on X11. It just -needs some more hook up code for xkb, but that's needed anyway to improve -modifier only shortcuts and friends. - -BUG: 360841 -FIXED-IN: 5.10.3 - -Reviewers: #kwin, #plasma - -Subscribers: plasma-devel, kwin - -Tags: #kwin - -Differential Revision: https://phabricator.kde.org/D6258 ---- - effects.cpp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/effects.cpp b/effects.cpp -index d2c4768..8155de6 100644 ---- a/effects.cpp -+++ b/effects.cpp -@@ -48,6 +48,7 @@ along with this program. If not, see . - #include "kwinglutils.h" - - #include -+#include - - #include - -@@ -599,6 +600,11 @@ bool EffectsHandlerImpl::grabKeyboard(Effect* effect) - bool ret = grabXKeyboard(); - if (!ret) - return false; -+ // Workaround for Qt 5.9 regression introduced with 2b34aefcf02f09253473b096eb4faffd3e62b5f4 -+ // we no longer get any events for the root window, one needs to call winId() on the desktop window -+ // TODO: change effects event handling to create the appropriate QKeyEvent without relying on Qt -+ // as it's done already in the Wayland case. -+ qApp->desktop()->winId(); - } - keyboard_grab_effect = effect; - return true; --- -cgit v0.11.2 - - diff --git a/kde/patch/kwin/kwin_replace_logind_with_ck2.patch b/kde/patch/kwin/kwin_replace_logind_with_ck2.patch deleted file mode 100644 index 294a691..0000000 --- a/kde/patch/kwin/kwin_replace_logind_with_ck2.patch +++ /dev/null @@ -1,85 +0,0 @@ -From: Eric Koegel -Date: Sun, 24 Jul 2016 14:37:26 +0300 - -Trivial patch for testing the CK2 session controller interface -as a replacement for systemd-logind; -Eric Koegel's original patch was rebased to kwin-5.10.2 by Eric Hameleers - -diff -uar kwin-5.10.2.orig/logind.cpp kwin-5.10.2/logind.cpp ---- kwin-5.10.2.orig/logind.cpp 2017-06-13 20:19:37.000000000 +0200 -+++ kwin-5.10.2/logind.cpp 2017-06-18 20:49:56.018661568 +0200 -@@ -58,10 +58,10 @@ - namespace KWin - { - --const static QString s_login1Service = QStringLiteral("org.freedesktop.login1"); --const static QString s_login1Path = QStringLiteral("/org/freedesktop/login1"); --const static QString s_login1ManagerInterface = QStringLiteral("org.freedesktop.login1.Manager"); --const static QString s_login1SessionInterface = QStringLiteral("org.freedesktop.login1.Session"); -+const static QString s_login1Service = QStringLiteral("org.freedesktop.ConsoleKit"); -+const static QString s_login1Path = QStringLiteral("/org/freedesktop/ConsoleKit/Manager"); -+const static QString s_login1ManagerInterface = QStringLiteral("org.freedesktop.ConsoleKit.Manager"); -+const static QString s_login1SessionInterface = QStringLiteral("org.freedesktop.ConsoleKit.Session"); - const static QString s_dbusPropertiesInterface = QStringLiteral("org.freedesktop.DBus.Properties"); - - LogindIntegration *LogindIntegration::s_self = nullptr; -@@ -151,7 +151,7 @@ - return; - } - if (!reply.isValid()) { -- qCDebug(KWIN_CORE) << "The session is not registered with logind" << reply.error().message(); -+ qCDebug(KWIN_CORE) << "The session is not registered with ConsoleKit2" << reply.error().message(); - return; - } - m_sessionPath = reply.value().path(); -@@ -199,7 +199,7 @@ - m_sessionPath, - s_dbusPropertiesInterface, - QStringLiteral("Get")); -- message.setArguments(QVariantList({s_login1SessionInterface, QStringLiteral("Active")})); -+ message.setArguments(QVariantList({s_login1SessionInterface, QStringLiteral("active")})); - QDBusPendingReply reply = m_bus.asyncCall(message); - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); - connect(watcher, &QDBusPendingCallWatcher::finished, this, -@@ -207,7 +207,7 @@ - QDBusPendingReply reply = *self; - self->deleteLater(); - if (!reply.isValid()) { -- qCDebug(KWIN_CORE) << "Failed to get Active Property of logind session:" << reply.error().message(); -+ qCDebug(KWIN_CORE) << "Failed to get Active Property of ConsoleKit2 session:" << reply.error().message(); - return; - } - const bool active = reply.value().toBool(); -@@ -236,7 +236,7 @@ - QDBusPendingReply reply = *self; - self->deleteLater(); - if (!reply.isValid()) { -- qCDebug(KWIN_CORE) << "Failed to get VTNr Property of logind session:" << reply.error().message(); -+ qCDebug(KWIN_CORE) << "Failed to get VTNr Property of ConsoleKit2 session:" << reply.error().message(); - return; - } - const int vt = reply.value().toUInt(); -@@ -365,12 +365,12 @@ - QDBusPendingReply reply = *self; - self->deleteLater(); - if (!reply.isValid()) { -- qCDebug(KWIN_CORE) << "Failed to get Seat Property of logind session:" << reply.error().message(); -+ qCDebug(KWIN_CORE) << "Failed to get Seat Property of ConsoleKit2 session:" << reply.error().message(); - return; - } - DBusLogindSeat seat = qdbus_cast(reply.value().value()); - const QString seatPath = seat.path.path(); -- qCDebug(KWIN_CORE) << "Logind seat:" << seat.name << "/" << seatPath; -+ qCDebug(KWIN_CORE) << "ConsoleKit2 seat:" << seat.name << "/" << seatPath; - if (m_seatPath != seatPath) { - m_seatPath = seatPath; - } -@@ -385,7 +385,7 @@ - } - QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service, - m_seatPath, -- QStringLiteral("org.freedesktop.login1.Seat"), -+ QStringLiteral("org.freedesktop.ConsoleKit.Seat"), - QStringLiteral("SwitchTo")); - message.setArguments(QVariantList{vtNr}); - m_bus.asyncCall(message); diff --git a/kde/patch/libkdcraw.patch b/kde/patch/libkdcraw.patch deleted file mode 100644 index fd8cf51..0000000 --- a/kde/patch/libkdcraw.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Backport a patch from git to support our newer cmake: -#cat $CWD/patch/libkdcraw/libkdcraw_cmake_minver.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/libkdcraw/libkdcraw_cmake_minver.patch b/kde/patch/libkdcraw/libkdcraw_cmake_minver.patch deleted file mode 100644 index 3446a19..0000000 --- a/kde/patch/libkdcraw/libkdcraw_cmake_minver.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- libkdcraw-15.08.0.orig/CMakeLists.txt 2015-05-14 22:54:16.000000000 +0200 -+++ libkdcraw-15.08.0/CMakeLists.txt 2015-08-25 13:37:50.880746449 +0200 -@@ -1,3 +1,4 @@ -+cmake_minimum_required(VERSION 2.8.9) - # - # Copyright (c) 2010-2014, Gilles Caulier, - # diff --git a/kde/patch/libkexiv2.patch b/kde/patch/libkexiv2.patch deleted file mode 100644 index 5a61c23..0000000 --- a/kde/patch/libkexiv2.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Backport a patch from git to support our newer cmake: -#cat $CWD/patch/libkexiv2/libkexiv2_cmake_minver.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/libkexiv2/libkexiv2_cmake_minver.patch b/kde/patch/libkexiv2/libkexiv2_cmake_minver.patch deleted file mode 100644 index a83861c..0000000 --- a/kde/patch/libkexiv2/libkexiv2_cmake_minver.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- libkexiv2-15.08.0.orig/CMakeLists.txt 2015-04-30 21:04:22.000000000 +0200 -+++ libkexiv2-15.08.0/CMakeLists.txt 2015-08-25 13:14:34.093738317 +0200 -@@ -1,3 +1,4 @@ -+cmake_minimum_required(VERSION 2.8.9) - # - # Copyright (c) 2010-2014, Gilles Caulier, - # diff --git a/kde/patch/libkface.patch b/kde/patch/libkface.patch index 9775e82..f488cf6 100644 --- a/kde/patch/libkface.patch +++ b/kde/patch/libkface.patch @@ -1,3 +1,2 @@ # Compile libkface against opencv 3.2: cat $CWD/patch/libkface/libkface_opencv3.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/libkleo.patch b/kde/patch/libkleo.patch deleted file mode 100644 index 9c1cef3..0000000 --- a/kde/patch/libkleo.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Compile libkleo with gcc7: -# Fixed in Applications 17.04.2: -#cat $CWD/patch/libkleo/libkleo_gcc7.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/libkleo/libkleo_gcc7.patch b/kde/patch/libkleo/libkleo_gcc7.patch deleted file mode 100644 index 40e0616..0000000 --- a/kde/patch/libkleo/libkleo_gcc7.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 675ce908a33d16f3b78d3fc741b0ff45790e4770 Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -Date: Wed, 17 May 2017 17:05:41 +0200 -Subject: Fix compilation with GCC 7 - -std::bind is part of functional, and GCC 7 requires an explicit include. ---- - src/kleo/enum.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/kleo/enum.cpp b/src/kleo/enum.cpp -index 15ea1fd..829d4fd 100644 ---- a/src/kleo/enum.cpp -+++ b/src/kleo/enum.cpp -@@ -33,6 +33,9 @@ - #include "enum.h" - #include "libkleo_debug.h" - #include "models/keycache.h" -+ -+#include -+ - #include - - #include --- -cgit v0.11.2 - diff --git a/kde/patch/libksysguard.patch b/kde/patch/libksysguard.patch deleted file mode 100644 index d45baac..0000000 --- a/kde/patch/libksysguard.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Fix for "error: isnan was not declared in this scope" -# Fixed post Plasma 5.5.5. -#cat $CWD/patch/libksysguard/libksysguard_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/libksysguard/libksysguard_isnan.patch b/kde/patch/libksysguard/libksysguard_isnan.patch deleted file mode 100644 index c6ce1e9..0000000 --- a/kde/patch/libksysguard/libksysguard_isnan.patch +++ /dev/null @@ -1,176 +0,0 @@ -From: David Rosca -Date: Tue, 23 Feb 2016 16:32:35 +0000 -Subject: signalplotter: Use std namespaced isnan and isinf -X-Git-Tag: v5.5.95 -X-Git-Url: http://quickgit.kde.org/?p=libksysguard.git&a=commitdiff&h=b0578798eb3f5bdad0a25ea9b4a52c53ebcfc020 ---- -signalplotter: Use std namespaced isnan and isinf - -Test Plan: Fixes build for me. - -Reviewers: #plasma, ivan - -Reviewed By: ivan - -Subscribers: ivan, plasma-devel - -Projects: #plasma - -Differential Revision: https://phabricator.kde.org/D1010 ---- - - ---- a/signalplotter/ksignalplotter.cpp -+++ b/signalplotter/ksignalplotter.cpp -@@ -32,8 +32,6 @@ - #include "ksignalplotter_p.h" - #include "processcore/processcore_debug.h" - --#include //For floor, ceil, log10 etc for calculating ranges -- - #include - #include - #include -@@ -49,7 +47,7 @@ - - #include - #include --#include -+#include - #include - - #ifdef SVG_SUPPORT -@@ -485,20 +483,20 @@ - qreal value=0; - for(int i = sampleBuf.count()-1; i>= 0; i--) { - qreal newValue = sampleBuf[i]; -- if( !isinf(newValue) && !isnan(newValue) ) -+ if( !std::isinf(newValue) && !std::isnan(newValue) ) - value += newValue; - } -- if(isnan(mMinValue) || mMinValue > value) mMinValue = value; -- if(isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; -+ if(std::isnan(mMinValue) || mMinValue > value) mMinValue = value; -+ if(std::isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; - if(value > 0.7*mMaxValue) - mRescaleTime = time; - } else { - qreal value; - for(int i = sampleBuf.count()-1; i>= 0; i--) { - value = sampleBuf[i]; -- if( !isinf(value) && !isnan(value) ) { -- if(isnan(mMinValue) || mMinValue > value) mMinValue = value; -- if(isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; -+ if( !std::isinf(value) && !std::isnan(value) ) { -+ if(std::isnan(mMinValue) || mMinValue > value) mMinValue = value; -+ if(std::isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; - if(value > 0.7*mMaxValue) - mRescaleTime = time; - } -@@ -789,9 +787,9 @@ - qreal max = mUserMaxValue; - qreal min = mUserMinValue; - if( mUseAutoRange ) { -- if(!isnan(mMaxValue) && mMaxValue * 0.99 > max) //Allow max value to go very slightly over the given max, for rounding reasons -+ if(!std::isnan(mMaxValue) && mMaxValue * 0.99 > max) //Allow max value to go very slightly over the given max, for rounding reasons - max = mMaxValue; -- if(!isnan(mMinValue) && mMinValue * 0.99 < min) { -+ if(!std::isnan(mMinValue) && mMinValue * 0.99 < min) { - min = mMinValue; - } - } -@@ -920,23 +918,23 @@ - bool firstLine = true; - for (int j = 0; j < count; ++j) { - qreal point0 = datapoints[j]; -- if( isnan(point0) ) -+ if( std::isnan(point0) ) - continue; //Just do not draw points with nans. skip them - - qreal point1 = prev_datapoints[j]; - qreal point2 = prev_prev_datapoints[j]; - -- if(isnan(point1)) -+ if(std::isnan(point1)) - point1 = point0; -- else if(mSmoothGraph && !isinf(point1)) { -+ else if(mSmoothGraph && !std::isinf(point1)) { - // Apply a weighted average just to smooth the graph out a bit - // Do not try to smooth infinities or nans - point0 = (2*point0 + point1)/3; -- if(!isnan(point2) && !isinf(point2)) -+ if(!std::isnan(point2) && !std::isinf(point2)) - point1 = (2*point1 + point2)/3; - // We don't bother to average out y2. This will introduce slight inaccuracies in the gradients, but they aren't really noticeable. - } -- if(isnan(point2)) -+ if(std::isnan(point2)) - point2 = point1; - - if (mStackBeams) { -@@ -1046,12 +1044,12 @@ - } - QString KSignalPlotter::lastValueAsString( int i, int precision) const - { -- if(d->mBeamData.isEmpty() || d->mBeamData.first().size() <= i || isnan(d->mBeamData.first().at(i))) return QString(); -+ if(d->mBeamData.isEmpty() || d->mBeamData.first().size() <= i || std::isnan(d->mBeamData.first().at(i))) return QString(); - return valueAsString(d->mBeamData.first().at(i), precision); //retrieve the newest value for this beam - } - QString KSignalPlotter::valueAsString( qreal value, int precision) const - { -- if(isnan(value)) -+ if(std::isnan(value)) - return QString(); - value = value / d->mScaleDownBy; // scale the value. E.g. from Bytes to KiB - return d->scaledValueAsString(value, precision); - ---- a/tests/signalplottertest.cpp -+++ b/tests/signalplottertest.cpp -@@ -56,8 +56,8 @@ - s->addBeam(Qt::blue); - s->addBeam(Qt::red); - -- QVERIFY( isnan(s->lastValue(0)) ); //unset, so should default to NaN -- QVERIFY( isnan(s->lastValue(1)) ); //unset, so should default to NaN -+ QVERIFY( std::isnan(s->lastValue(0)) ); //unset, so should default to NaN -+ QVERIFY( std::isnan(s->lastValue(1)) ); //unset, so should default to NaN - QCOMPARE(s->numBeams(), 2); - QVERIFY(s->beamColor(0) == Qt::blue); - QVERIFY(s->beamColor(1) == Qt::red); -@@ -92,7 +92,7 @@ - QVERIFY(s->beamColor(0) == Qt::blue); - QVERIFY(s->beamColor(1) == Qt::red); - QCOMPARE(s->lastValue(0), 1.0); -- QVERIFY( isnan(s->lastValue(1)) ); //unset, so should default to NaN -+ QVERIFY( std::isnan(s->lastValue(1)) ); //unset, so should default to NaN - } - - void TestSignalPlotter::testReorderBeams() -@@ -153,8 +153,8 @@ - s->addBeam(Qt::blue); - s->addBeam(Qt::red); - QCOMPARE(s->numBeams(), 2); -- QVERIFY(isnan(s->lastValue(0))); //unset, so should default to NaN -- QVERIFY(isnan(s->lastValue(1))); //unset, so should default to NaN -+ QVERIFY(std::isnan(s->lastValue(0))); //unset, so should default to NaN -+ QVERIFY(std::isnan(s->lastValue(1))); //unset, so should default to NaN - //Add some data - QList data; - data << 1.0 << 2.0; -@@ -189,13 +189,13 @@ - QCOMPARE(s->numBeams(), 3); - QCOMPARE(s->lastValue(0), 2.0); - QCOMPARE(s->lastValue(1), 1.0); -- QVERIFY(isnan(s->lastValue(2))); //unset, so should default to NaN -+ QVERIFY(std::isnan(s->lastValue(2))); //unset, so should default to NaN - - newOrder.clear(); - newOrder << 2 << 0 << 1; - s->reorderBeams(newOrder); - QCOMPARE(s->numBeams(), 3); -- QVERIFY(isnan(s->lastValue(0))); //unset, so should default to NaN -+ QVERIFY(std::isnan(s->lastValue(0))); //unset, so should default to NaN - QCOMPARE(s->lastValue(1), 2.0); - QCOMPARE(s->lastValue(2), 1.0); - } - diff --git a/kde/patch/marble.patch b/kde/patch/marble.patch deleted file mode 100644 index eb2b7fc..0000000 --- a/kde/patch/marble.patch +++ /dev/null @@ -1,4 +0,0 @@ -# Ensure marble bindings for Qt4 get compiled: -# No longer needed in Applications 15.12.0, libkface was ported to KF5. -#cat $CWD/patch/marble/marble_qt4.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/marble/marble_qt4.patch b/kde/patch/marble/marble_qt4.patch deleted file mode 100644 index e497023..0000000 --- a/kde/patch/marble/marble_qt4.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- marble-15.08.0.orig/CMakeLists.txt 2015-08-12 13:14:02.000000000 +0200 -+++ marble-15.08.0/CMakeLists.txt 2015-08-29 00:24:00.767298683 +0200 -@@ -45,6 +45,8 @@ - #################################################### - # Specific options for building with Qt 4 vs 5 - -+option(QT5BUILD "Build for Qt5" ON) -+ - if(ANDROID) - if (NOT DEFINED ENV{Qt5_host}) - message(FATAL_ERROR "Configure the env variable Qt5_host to point to your host Qt5 installation.") -@@ -79,6 +81,7 @@ - include_directories(SYSTEM "$ENV{ANDROID_NDK}/platforms/$ENV{ANDROID_PLATFORM}/arch-arm/usr/include") - message(STATUS "Include directories: " "$ENV{ANDROID_NDK}/platforms/$ENV{ANDROID_PLATFORM}/arch-arm/usr/include") - else() -+ if(QT5BUILD) - find_package(Qt5WebKit) - find_package(Qt5WebKitWidgets) - find_package(Qt5DBus) -@@ -86,8 +89,10 @@ - if ( NOT Qt5WebKit_FOUND ) - set ( MARBLE_NO_WEBKIT TRUE ) - endif() -+ endif() - endif() - -+if(QT5BUILD) - find_package(Qt5Core) - find_package(Qt5Xml) - find_package(Qt5Network) -@@ -100,6 +105,7 @@ - find_package(Qt5Quick) - find_package(Qt5OpenGL) - find_package(Qt5PrintSupport) -+endif() - - if(QTONLY) - # Forward the old QTONLY=TRUE option to the new WITH_KDE=FALSE -@@ -111,8 +117,6 @@ - unset(QTONLY) - endif() - --option(QT5BUILD "Build for Qt5" ON) -- - if(QT5BUILD AND Qt5Core_FOUND) - cmake_minimum_required(VERSION 2.8.12) - set(QT4BUILD FALSE) diff --git a/kde/patch/messagelib.patch b/kde/patch/messagelib.patch deleted file mode 100644 index a76851e..0000000 --- a/kde/patch/messagelib.patch +++ /dev/null @@ -1,4 +0,0 @@ -# CVE-2018-19516: HTML email can open browser window automatically. -# Fixed in messagelib of KDE Applications 18.12.0. -#cat $CWD/patch/messagelib/messagelib_CVE-2018-19516.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/messagelib/messagelib_CVE-2018-19516.patch b/kde/patch/messagelib/messagelib_CVE-2018-19516.patch deleted file mode 100644 index 599dd39..0000000 --- a/kde/patch/messagelib/messagelib_CVE-2018-19516.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 34765909cdf8e55402a8567b48fb288839c61612 Mon Sep 17 00:00:00 2001 -From: Laurent Montel -Date: Fri, 23 Nov 2018 07:37:02 +0100 -Subject: Exclude Refresh from MetaData (Not necessary) - -diff -uar messagelib-18.08.3.orig/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp messagelib-18.08.3/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp ---- messagelib-18.08.3.orig/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp 2018-10-31 07:56:07.000000000 +0100 -+++ messagelib-18.08.3/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp 2018-12-09 23:38:11.009130622 +0100 -@@ -308,6 +308,11 @@ - return htmlSource; - } - extraHead = s.mid(startIndex + 6 , endIndex - startIndex - 6); -+ //Don't authorize to refresh content. -+ if (s.contains(QStringLiteral("http-equiv=\"REFRESH\""), Qt::CaseInsensitive)) { -+ extraHead.clear(); -+ } -+ - s = s.mid(endIndex + 7).trimmed(); - } - diff --git a/kde/patch/okular.patch b/kde/patch/okular.patch deleted file mode 100644 index 0875170..0000000 --- a/kde/patch/okular.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Address CVE-2020-9359 (repaired in 20.04.0): -#cat $CWD/patch/okular/cve-2020-9359.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/okular/cve-2020-9359.patch b/kde/patch/okular/cve-2020-9359.patch deleted file mode 100644 index d82c91c..0000000 --- a/kde/patch/okular/cve-2020-9359.patch +++ /dev/null @@ -1,32 +0,0 @@ -Okular: Local binary execution via action links -CVE: CVE-2020-9359 - -Okular can be tricked into executing local binaries via specially crafted -PDF files. -This binary execution can require almost no user interaction. -No parameters can be passed to those local binaries. -We have not been able to identify any binary that will cause actual damage, -be it in the hardware or software level, when run without parameters. - -We remain relatively confident that for this issue to do any actual damage, -it has to run a binary specially crafted. That binary must have been deployed -to the user system via another method, be it the user downloading it directly -as an email attachment, webpage download, etc. or by the system being -already compromised. - - -diff --git a/core/document.cpp b/core/document.cpp -index 3215a1abce6292a6cc25c5f8b645232c92d75ec5..0aa5b698019a2660f2d6baabd54cef1e82002b0e 100644 ---- a/core/document.cpp -+++ b/core/document.cpp -@@ -4388,7 +4388,8 @@ void Document::processAction( const Action * action ) - { - const QUrl realUrl = KIO::upUrl(d->m_url).resolved(url); - // KRun autodeletes -- new KRun( realUrl, d->m_widget ); -+ KRun *r = new KRun( realUrl, d->m_widget ); -+ r->setRunExecutables(false); - } - } - } break; - diff --git a/kde/patch/oxygen-gtk2.patch b/kde/patch/oxygen-gtk2.patch index 4ca11e9..a2dd03e 100644 --- a/kde/patch/oxygen-gtk2.patch +++ b/kde/patch/oxygen-gtk2.patch @@ -1,3 +1,2 @@ # Add more firefox-derived browsers as supported by the theme: cat $CWD/patch/oxygen-gtk2/oxygen-gtk2_KDEBUG_341181.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/oxygen-gtk3.patch b/kde/patch/oxygen-gtk3.patch deleted file mode 100644 index 1f0f0aa..0000000 --- a/kde/patch/oxygen-gtk3.patch +++ /dev/null @@ -1,3 +0,0 @@ -# Compile against Slackware's older version of gtk+3: -cat $CWD/patch/oxygen-gtk3/oxygen-gtk3-1.3.1_gtk3.8.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/oxygen-gtk3/oxygen-gtk3-1.3.1_gtk3.8.patch b/kde/patch/oxygen-gtk3/oxygen-gtk3-1.3.1_gtk3.8.patch deleted file mode 100644 index 075cd08..0000000 --- a/kde/patch/oxygen-gtk3/oxygen-gtk3-1.3.1_gtk3.8.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -urN oxygen-gtk3-1.3.1/src/oxygenthemingengine.cpp oxygen-gtk3-1.3.1-patched/src/oxygenthemingengine.cpp ---- oxygen-gtk3-1.3.1/src/oxygenthemingengine.cpp 2013-12-11 23:38:20.000000000 +1100 -+++ oxygen-gtk3-1.3.1-patched/src/oxygenthemingengine.cpp 2013-12-17 23:11:11.684864006 +1100 -@@ -493,13 +493,6 @@ - - } - -- } else if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_LIST_ROW ) ) { -- -- GtkStateFlags state( gtk_theming_engine_get_state( engine ) ); -- StyleOptions options( widget, state ); -- if( options & (Selected|Hover) ) -- { Style::instance().renderSelection( context, x, y, w, h, TileSet::Horizontal, options ); } -- - } else if( - gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_SPINBUTTON ) && - !gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_ENTRY ) ) -@@ -507,10 +500,7 @@ - - return; - -- } else if( -- gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_TOOLBAR ) || -- gtk_widget_path_is_type( path, GTK_TYPE_HEADER_BAR ) ) -- { -+ } else if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_TOOLBAR ) ) { - - // render background - if( !Gtk::gtk_widget_is_applet( widget ) ) diff --git a/kde/patch/perlqt.patch b/kde/patch/perlqt.patch index 1cdd7db..669a723 100644 --- a/kde/patch/perlqt.patch +++ b/kde/patch/perlqt.patch @@ -1,3 +1,2 @@ # Fix build: cat $CWD/patch/perlqt/perlqt.gcc6.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/plasma-browser-integration.patch b/kde/patch/plasma-browser-integration.patch index c82fee9..38642df 100644 --- a/kde/patch/plasma-browser-integration.patch +++ b/kde/patch/plasma-browser-integration.patch @@ -1,3 +1,2 @@ # Fix hardcoded mozilla 'lib' libdir: cat $CWD/patch/plasma-browser-integration/plasma-browser-integration_KDEBUG-113461.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/plasma-desktop.patch b/kde/patch/plasma-desktop.patch deleted file mode 100644 index 8a69d4c..0000000 --- a/kde/patch/plasma-desktop.patch +++ /dev/null @@ -1,20 +0,0 @@ -# Fix errors in translation strings for bs and sr: -#cat $CWD/patch/plasma-desktop/plasma-desktop-4.99.0_kfontinst_po.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Forgotten includes: -#cat $CWD/patch/plasma-desktop/plasma-desktop_kdelibs4support.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix for Plasma 5.5.0 (KDEBUG #356398): -#cat $CWD/patch/plasma-desktop//plasma-desktop_kickoff_kdebug_356398.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix for Plasma 5.14.4 (KDEBUG #401508): -#cat $CWD/patch/plasma-desktop/plasma-desktop_kdebug_401508.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# KDEBUG #401508): unlock widgets. -# Fixed in Plasma 5.18.1: -#cat $CWD/patch/plasma-desktop/plasma-desktop_kdebug_417424.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# KDEBUG #416358): Cannot apply font changes (button remains inactive). -# Fixed in Plasma 5.18.1: -#cat $CWD/patch/plasma-desktop/plasma-desktop_kdebug_416358.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/plasma-desktop/plasma-desktop-4.99.0_kfontinst_po.diff b/kde/patch/plasma-desktop/plasma-desktop-4.99.0_kfontinst_po.diff deleted file mode 100755 index 3b96d54..0000000 --- a/kde/patch/plasma-desktop/plasma-desktop-4.99.0_kfontinst_po.diff +++ /dev/null @@ -1,60 +0,0 @@ -diff -U 3 -H -d -p -r -N -x .svn -x .git -- a/po/bs/kfontinst.po b/po/bs/kfontinst.po ---- a/po/bs/kfontinst.po 2014-05-09 17:23:01.000000000 +0200 -+++ b/po/bs/kfontinst.po 2014-05-18 18:38:26.513853094 +0200 -@@ -1169,7 +1169,7 @@ msgstr "abcčćdđefghijklmnoprsštuvzž - #: lib/FcEngine.cpp:1004 - msgctxt "Numbers and characters" - msgid "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" --msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@ -+msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" - - #: lib/FcEngine.cpp:1401 - msgid "ERROR: Could not determine font's name." -diff -U 3 -H -d -p -r -N -x .svn -x .git -- a/po/sr/kfontinst.po b/po/sr/kfontinst.po ---- a/po/sr/kfontinst.po 2014-05-09 17:27:16.000000000 +0200 -+++ b/po/sr/kfontinst.po 2014-05-18 18:38:40.837414520 +0200 -@@ -1221,7 +1221,7 @@ msgstr "абвгдђежзијклљмн - #: lib/FcEngine.cpp:1004 - msgctxt "Numbers and characters" - msgid "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" --msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@ -+msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" - - #: lib/FcEngine.cpp:1401 - msgid "ERROR: Could not determine font's name." -diff -U 3 -H -d -p -r -N -x .svn -x .git -- a/po/sr@ijekavian/kfontinst.po b/po/sr@ijekavian/kfontinst.po ---- a/po/sr@ijekavian/kfontinst.po 2014-05-09 17:27:20.000000000 +0200 -+++ b/po/sr@ijekavian/kfontinst.po 2014-05-18 18:38:54.049932456 +0200 -@@ -1221,7 +1221,7 @@ msgstr "абвгдђежзијклљмн - #: lib/FcEngine.cpp:1004 - msgctxt "Numbers and characters" - msgid "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" --msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@ -+msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" - - #: lib/FcEngine.cpp:1401 - msgid "ERROR: Could not determine font's name." -diff -U 3 -H -d -p -r -N -x .svn -x .git -- a/po/sr@ijekavianlatin/kfontinst.po b/po/sr@ijekavianlatin/kfontinst.po ---- a/po/sr@ijekavianlatin/kfontinst.po 2014-05-09 17:27:24.000000000 +0200 -+++ b/po/sr@ijekavianlatin/kfontinst.po 2014-05-18 18:39:09.884553255 +0200 -@@ -1224,7 +1224,7 @@ msgstr "abcčćdđefghijklmnoprsštuvzž - #: lib/FcEngine.cpp:1004 - msgctxt "Numbers and characters" - msgid "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" --msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@ -+msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" - - #: lib/FcEngine.cpp:1401 - msgid "ERROR: Could not determine font's name." -diff -U 3 -H -d -p -r -N -x .svn -x .git -- a/po/sr@latin/kfontinst.po b/po/sr@latin/kfontinst.po ---- a/po/sr@latin/kfontinst.po 2014-05-09 17:27:27.000000000 +0200 -+++ b/po/sr@latin/kfontinst.po 2014-05-18 18:39:21.351002849 +0200 -@@ -1223,7 +1223,7 @@ msgstr "abcčćdđefghijklmnoprsštuvzž - #: lib/FcEngine.cpp:1004 - msgctxt "Numbers and characters" - msgid "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" --msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@ -+msgstr "0123456789.:,;(*!?'/\\\")£$€%^&-+@~#<>{}[]" - - #: lib/FcEngine.cpp:1401 - msgid "ERROR: Could not determine font's name." \ No newline at end of file diff --git a/kde/patch/plasma-desktop/plasma-desktop_kdebug_401508.patch b/kde/patch/plasma-desktop/plasma-desktop_kdebug_401508.patch deleted file mode 100644 index 2e4a099..0000000 --- a/kde/patch/plasma-desktop/plasma-desktop_kdebug_401508.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ed34cc5f181e61d1fc98872866c5d7300a90af86 Mon Sep 17 00:00:00 2001 -From: Eike Hein -Date: Thu, 29 Nov 2018 00:22:17 +0900 -Subject: Fix group popup dialog - -Summary: -Fixes regression introduced with ab26ebb18b74: That diff contained -a change unrelated to the original submission, swapping a || out for -&& in response to a review note. This turns out to have broken things. - -BUG:401508 - -Reviewers: davidedmundson - -Subscribers: plasma-devel - -Tags: #plasma - -Differential Revision: https://phabricator.kde.org/D17219 ---- - applets/taskmanager/package/contents/ui/GroupDialog.qml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/applets/taskmanager/package/contents/ui/GroupDialog.qml b/applets/taskmanager/package/contents/ui/GroupDialog.qml -index 6f59275..28238dc 100644 ---- a/applets/taskmanager/package/contents/ui/GroupDialog.qml -+++ b/applets/taskmanager/package/contents/ui/GroupDialog.qml -@@ -262,7 +262,7 @@ PlasmaCore.Dialog { - // Setting VisualDataModel.rootIndex drops groupRepeater.count to 0 - // before the actual row count. updateSize is therefore invoked twice; - // only update size once the repeater count matches the model role. -- } else if (!groupRepeater.aboutToPopulate && visualParent.childCount == groupRepeater.count) { -+ } else if (!groupRepeater.aboutToPopulate || visualParent.childCount == groupRepeater.count) { - var task; - var maxWidth = 0; - var maxHeight = 0; --- -cgit v1.1 - diff --git a/kde/patch/plasma-desktop/plasma-desktop_kdebug_416358.patch b/kde/patch/plasma-desktop/plasma-desktop_kdebug_416358.patch deleted file mode 100644 index 34ca670..0000000 --- a/kde/patch/plasma-desktop/plasma-desktop_kdebug_416358.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/kcms/fonts/fonts.cpp b/kcms/fonts/fonts.cpp ---- a/kcms/fonts/fonts.cpp -+++ b/kcms/fonts/fonts.cpp -@@ -572,8 +572,8 @@ - // previews - engine()->addImageProvider("preview", new PreviewImageProvider(m_settings->font())); - -- // reload state after loading by emiting a settings signal -- emit m_settings->activeFontChanged(); -+ // KCM expect save state to be false at this point (can be true because of setNearestExistingFonts -+ setNeedsSave(false); - } - - void KFonts::save() - - diff --git a/kde/patch/plasma-desktop/plasma-desktop_kdebug_417424.patch b/kde/patch/plasma-desktop/plasma-desktop_kdebug_417424.patch deleted file mode 100644 index a840d6e..0000000 --- a/kde/patch/plasma-desktop/plasma-desktop_kdebug_417424.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2bc3c5e92d4789146548e8de4d520cd191994e1c Mon Sep 17 00:00:00 2001 -From: Marco Martin -Date: Tue, 11 Feb 2020 16:41:26 +0100 -Subject: unlock widgets - -5.18 doesn't offer a way anymore from the gui -so unlock them if they're locked -BUG:417424 ---- - desktoppackage/contents/updates/unlock_widgets.js | 2 ++ - 1 file changed, 2 insertions(+) - create mode 100644 desktoppackage/contents/updates/unlock_widgets.js - -diff --git a/desktoppackage/contents/updates/unlock_widgets.js b/desktoppackage/contents/updates/unlock_widgets.js -new file mode 100644 -index 0000000..c332270 ---- /dev/null -+++ b/desktoppackage/contents/updates/unlock_widgets.js -@@ -0,0 +1,2 @@ -+ -+__AppInterface.locked = false; --- -cgit v1.1 - - diff --git a/kde/patch/plasma-desktop/plasma-desktop_kdelibs4support.diff b/kde/patch/plasma-desktop/plasma-desktop_kdelibs4support.diff deleted file mode 100644 index 74d541c..0000000 --- a/kde/patch/plasma-desktop/plasma-desktop_kdelibs4support.diff +++ /dev/null @@ -1,88 +0,0 @@ ---- plasma-desktop-20140602git/kcms/kfontinst/lib/CMakeLists.txt.orig 2014-06-03 16:08:19.294297273 +0200 -+++ plasma-desktop-20140602git/kcms/kfontinst/lib/CMakeLists.txt 2014-06-03 16:09:12.420293700 +0200 -@@ -15,6 +15,6 @@ - set_target_properties(kfontinst PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION 5 ) - - add_library(kfontinstui SHARED ${kfontinstui_LIB_SRCS}) --target_link_libraries(kfontinstui Qt5::X11Extras KF5::KIOCore KF5::KIOWidgets ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${X11_X11_LIB} ${X11_Xft_LIB} kfontinst ) -+target_link_libraries(kfontinstui Qt5::X11Extras KF5::KIOCore KF5::KIOWidgets KF5::KDELibs4Support XCB::XCB XCB::IMAGE ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${X11_X11_LIB} ${X11_Xft_LIB} kfontinst ) - set_target_properties(kfontinstui PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION 5 ) - install(TARGETS kfontinst kfontinstui ${INSTALL_TARGETS_DEFAULT_ARGS} ) ---- plasma-desktop-20140602git/kcms/kfontinst/dbus/CMakeLists.txt.orig 2014-06-02 13:47:27.000000000 +0200 -+++ plasma-desktop-20140602git/kcms/kfontinst/dbus/CMakeLists.txt 2014-06-03 17:17:01.382378586 +0200 -@@ -14,11 +14,11 @@ - - set_target_properties(fontinst_bin PROPERTIES OUTPUT_NAME fontinst) - target_link_libraries(fontinst_bin -- Qt5::DBus Qt5::Xml ${FONTCONFIG_LIBRARIES} kfontinst) -+ Qt5::DBus Qt5::Xml Qt5::X11Extras KF5::KDELibs4Support XCB::XCB XCB::IMAGE ${FONTCONFIG_LIBRARIES} kfontinst) - - set_target_properties(fontinst_helper PROPERTIES OUTPUT_NAME fontinst_helper) - target_link_libraries(fontinst_helper -- Qt5::DBus Qt5::Xml ${FONTCONFIG_LIBRARIES} kfontinst) -+ Qt5::DBus Qt5::Xml Qt5::X11Extras KF5::KDELibs4Support XCB::XCB XCB::IMAGE ${FONTCONFIG_LIBRARIES} kfontinst) - - install(TARGETS fontinst_bin DESTINATION ${LIBEXEC_INSTALL_DIR} ) - install(TARGETS fontinst_helper DESTINATION ${LIBEXEC_INSTALL_DIR} ) ---- plasma-desktop-20140602git/kcms/kfontinst/kcmfontinst/CMakeLists.txt.orig 2014-06-02 13:47:27.000000000 +0200 -+++ plasma-desktop-20140602git/kcms/kfontinst/kcmfontinst/CMakeLists.txt 2014-06-03 19:19:00.376164975 +0200 -@@ -10,6 +10,7 @@ - add_library(kcm_fontinst MODULE ${kcm_fontinst_PART_SRCS}) - - target_link_libraries(kcm_fontinst -+ Qt5::X11Extras - KF5::Archive - KF5::KCMUtils - KF5::Su ---- plasma-desktop-20140602git/kcms/kfontinst/apps/CMakeLists.txt.orig 2014-06-02 13:47:27.000000000 +0200 -+++ plasma-desktop-20140602git/kcms/kfontinst/apps/CMakeLists.txt 2014-06-03 19:27:47.209175028 +0200 -@@ -31,6 +31,7 @@ - ) - target_link_libraries(kfontprint_bin - Qt5::PrintSupport -+ Qt5::X11Extras - KF5::IconThemes - KF5::KDELibs4Support - ${X11_X11_LIB} -@@ -38,7 +39,7 @@ - kfontinstui - kfontinst - ) --target_link_libraries(kfontview_bin KF5::Parts KF5::XmlGui kfontinstui kfontinst ) -+target_link_libraries(kfontview_bin KF5::Parts KF5::XmlGui KF5::KDELibs4Support kfontinstui kfontinst ) - - install(TARGETS kfontinst_bin ${INSTALL_TARGETS_DEFAULT_ARGS} ) - install(TARGETS kfontprint_bin DESTINATION ${LIBEXEC_INSTALL_DIR} ) ---- plasma-desktop-20140602git/kcms/kfontinst/kio/CMakeLists.txt.orig 2014-06-02 13:47:27.000000000 +0200 -+++ plasma-desktop-20140602git/kcms/kfontinst/kio/CMakeLists.txt 2014-06-03 19:31:34.379189708 +0200 -@@ -5,7 +5,7 @@ - set(kio_fonts_PART_SRCS FontInstInterface.cpp KioFonts.cpp ${libkfontinstdbusiface_SRCS}) - # qt5_add_dbus_interface(kio_fonts_PART_SRCS ../dbus/org.kde.fontinst.xml FontinstIface) - add_library(kio_fonts MODULE ${kio_fonts_PART_SRCS} ${KFI_FONTINST_AUTH_SRC} ) --target_link_libraries(kio_fonts Qt5::DBus Qt5::X11Extras Qt5::Xml KF5::Archive KF5::KIOCore KF5::KIOWidgets kfontinst ) -+target_link_libraries(kio_fonts Qt5::DBus Qt5::X11Extras Qt5::Xml KF5::Archive KF5::KIOCore KF5::KIOWidgets KF5::KDELibs4Support kfontinst ) - install(TARGETS kio_fonts DESTINATION ${PLUGIN_INSTALL_DIR} ) - install( FILES fonts.desktop DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/virtual_folders/services ) - install( FILES fonts.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) ---- plasma-desktop-20140602git/kcms/kfontinst/thumbnail/CMakeLists.txt.orig 2014-06-02 13:47:27.000000000 +0200 -+++ plasma-desktop-20140602git/kcms/kfontinst/thumbnail/CMakeLists.txt 2014-06-03 19:34:23.357198688 +0200 -@@ -7,7 +7,7 @@ - - add_library(fontthumbnail MODULE ${fontthumbnail_PART_SRCS}) - --target_link_libraries(fontthumbnail KF5::Archive KF5::KIOCore KF5::KIOWidgets kfontinstui kfontinst ) -+target_link_libraries(fontthumbnail KF5::Archive KF5::KIOCore KF5::KIOWidgets KF5::KDELibs4Support kfontinstui kfontinst ) - - install(TARGETS fontthumbnail DESTINATION ${PLUGIN_INSTALL_DIR} ) - install( FILES fontthumbnail.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) ---- plasma-desktop-20140602git/kcms/kfontinst/viewpart/CMakeLists.txt.orig 2014-06-02 13:47:27.000000000 +0200 -+++ plasma-desktop-20140602git/kcms/kfontinst/viewpart/CMakeLists.txt 2014-06-03 19:42:35.590219674 +0200 -@@ -8,7 +8,7 @@ - - add_library(kfontviewpart MODULE ${kfontviewpart_PART_SRCS}) - --target_link_libraries(kfontviewpart KF5::Archive KF5::Parts KF5::XmlGui ${FONTCONFIG_LIBRARIES} kfontinstui kfontinst ) -+target_link_libraries(kfontviewpart KF5::Archive KF5::Parts KF5::XmlGui KF5::KDELibs4Support ${FONTCONFIG_LIBRARIES} kfontinstui kfontinst ) - - install(TARGETS kfontviewpart DESTINATION ${PLUGIN_INSTALL_DIR} ) - install( FILES kfontviewpart.rc DESTINATION ${DATA_INSTALL_DIR}/kfontinst ) diff --git a/kde/patch/plasma-desktop/plasma-desktop_kickoff_kdebug_356398.patch b/kde/patch/plasma-desktop/plasma-desktop_kickoff_kdebug_356398.patch deleted file mode 100644 index a4d8d9f..0000000 --- a/kde/patch/plasma-desktop/plasma-desktop_kickoff_kdebug_356398.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Eike Hein -Date: Tue, 08 Dec 2015 19:26:26 +0000 -Subject: Fix migration of multiple favorites. -X-Git-Url: http://quickgit.kde.org/?p=plasma-desktop.git&a=commitdiff&h=97ced66da372737ae5d36d86c9bc0c6fe684d842 ---- -Fix migration of multiple favorites. - -BUG:356398 ---- - - ---- a/desktoppackage/contents/updates/obsolete_kickoffrc.js -+++ b/desktoppackage/contents/updates/obsolete_kickoffrc.js -@@ -1,7 +1,7 @@ - var kickoffConfig = ConfigFile("kickoffrc"); - - kickoffConfig.group = "Favorites"; --var favorites = kickoffConfig.readEntry("FavoriteURLs"); -+var favorites = kickoffConfig.readEntry("FavoriteURLs").split(','); - - kickoffConfig.group = "SystemApplications"; - var systemApplications = kickoffConfig.readEntry("DesktopFiles").split(','); - - diff --git a/kde/patch/plasma-framework.patch b/kde/patch/plasma-framework.patch index 601f16c..cca9a13 100644 --- a/kde/patch/plasma-framework.patch +++ b/kde/patch/plasma-framework.patch @@ -1,12 +1,3 @@ -# KDE Plasma with KF 5.18 crash, if mouse repeatedly hovers over TaskManager -# KDEBUG 357895; fixed in Frameworks 5.20. -#cat $CWD/patch/plasma-framework/plasma-framework_KDEBUG_357895.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Icons for SNI Qt apps not appearing -# KDEBUG 359388; fixed in Frameworks 5.20. -#cat $CWD/patch/plasma-framework/plasma-framework_KDEBUG_359388.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - # Password is asked twice when connecting to a new WiFi network, # KDEBUG 423093; fixed in Frameworks 5.72 and Plasma 5.20. -cat $CWD/patch/plasma-framework/plasma-framework_KDEBUG_423093.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - +#cat $CWD/patch/plasma-framework/plasma-framework_KDEBUG_423093.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } diff --git a/kde/patch/plasma-framework/plasma-framework_KDEBUG_357895.patch b/kde/patch/plasma-framework/plasma-framework_KDEBUG_357895.patch deleted file mode 100644 index 9480314..0000000 --- a/kde/patch/plasma-framework/plasma-framework_KDEBUG_357895.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: David Rosca -Date: Mon, 15 Feb 2016 18:05:26 +0000 -Subject: WindowThumbnail: Discard glx pixmap in stopRedirecting() -X-Git-Url: http://quickgit.kde.org/?p=plasma-framework.git&a=commitdiff&h=1e196fdfb2a6eaf1664e1155c086616d55c6712b ---- -WindowThumbnail: Discard glx pixmap in stopRedirecting() - -BUG: 357895 -FIXED-IN: 5.20 -REVIEW: 127072 ---- - - ---- a/src/declarativeimports/core/windowthumbnail.cpp -+++ b/src/declarativeimports/core/windowthumbnail.cpp -@@ -584,6 +584,7 @@ - return; - } - xcb_composite_unredirect_window(c, m_winId, XCB_COMPOSITE_REDIRECT_AUTOMATIC); -+ discardPixmap(); - if (m_damage == XCB_NONE) { - return; - } - diff --git a/kde/patch/plasma-framework/plasma-framework_KDEBUG_359388.patch b/kde/patch/plasma-framework/plasma-framework_KDEBUG_359388.patch deleted file mode 100644 index 078dbfd..0000000 --- a/kde/patch/plasma-framework/plasma-framework_KDEBUG_359388.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Dan Vrátil -Date: Tue, 16 Feb 2016 16:59:32 +0000 -Subject: Fix IconItem not loading non-theme icons with name -X-Git-Url: http://quickgit.kde.org/?p=plasma-framework.git&a=commitdiff&h=525bf2d377c21b41971a72d694a507bf2af0ada6 ---- -Fix IconItem not loading non-theme icons with name - -Commit 5184ac introduced a small regression that caused IconItem -to no longer load non-theme icons with name set, for instance icons -coming from sni-qt, causing sni-qt apps to not show in systray. - -BUG: 359388 -FIXED-IN: 5.20 -REVIEW: 127091 ---- - - ---- a/src/declarativeimports/core/iconitem.cpp -+++ b/src/declarativeimports/core/iconitem.cpp -@@ -148,6 +148,10 @@ - //fail, use QIcon - } else { - m_icon = QIcon::fromTheme(sourceString); -+ if (m_icon.isNull()) { -+ // fallback for non-theme icons -+ m_icon = source.value(); -+ } - delete m_svgIcon; - m_svgIcon = 0; - m_imageIcon = QImage(); - diff --git a/kde/patch/plasma-pa.patch b/kde/patch/plasma-pa.patch deleted file mode 100644 index 2349f09..0000000 --- a/kde/patch/plasma-pa.patch +++ /dev/null @@ -1,5 +0,0 @@ -# Port from gconf to gsettings (wait until post 5.13.4) -# because PA 12 dropped support for gconf and this broke the advanced settings -# in the PA audio configuration: -#cat $CWD/patch/plasma-pa/plasma-pa_enable_gsettings.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/plasma-pa/plasma-pa_enable_gsettings.patch b/kde/patch/plasma-pa/plasma-pa_enable_gsettings.patch deleted file mode 100644 index ef212d5..0000000 --- a/kde/patch/plasma-pa/plasma-pa_enable_gsettings.patch +++ /dev/null @@ -1,583 +0,0 @@ -# https://phabricator.kde.org/D14147 -# Port from gconf to gsettings -# Step 1 was to make gconf optional in 5.13.4 -# ---------------------------------- - -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -22,9 +22,6 @@ - include(FindPkgConfig) - pkg_check_modules(GCONF gconf-2.0) - pkg_check_modules(GOBJECT gobject-2.0) --if (GCONF_FOUND AND GOBJECT_FOUND) -- set(HAVE_GCONF TRUE) --endif() - - find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS - Core -@@ -44,6 +41,21 @@ - find_package(PulseAudio 5.0.0 REQUIRED) - find_package(Canberra REQUIRED) - find_package(GLIB2 REQUIRED) -+find_package(GIO) -+ -+if(USE_GCONF AND USE_GSETTINGS) -+ message(FATAL_ERROR "USE_GCONF and USE_GSETTINGS cannot be used at the same time") -+endif() -+ -+# if GSetting is available and user does not force GConf build use GSettings -+if(GIO_FOUND AND GLIB2_FOUND AND NOT USE_GCONF) -+ set(USE_GSETTINGS TRUE) -+endif() -+ -+# don't use GConf if not availabe -+if (NOT GCONF_FOUND OR NOT GOBJECT_FOUND) -+ set(USE_GCONF FALSE) -+endif() - - configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) - -diff --git a/cmake/FindGIO.cmake b/cmake/FindGIO.cmake -new file mode 100644 ---- /dev/null -+++ b/cmake/FindGIO.cmake -@@ -0,0 +1,72 @@ -+# - Try to find the GIO libraries -+# Once done this will define -+# -+# GIO_FOUND - system has GIO -+# GIO_INCLUDE_DIR - the GIO include directory -+# GIO_LIBRARIES - GIO library -+# -+# Copyright (c) 2010 Dario Freddi -+# -+# Redistribution and use is allowed according to the terms of the BSD license. -+# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -+ -+if(GIO_INCLUDE_DIR AND GIO_LIBRARIES) -+ # Already in cache, be silent -+ set(GIO_FIND_QUIETLY TRUE) -+endif(GIO_INCLUDE_DIR AND GIO_LIBRARIES) -+ -+if (NOT WIN32) -+ include(UsePkgConfig) -+ pkgconfig(gio-2.0 _LibGIOIncDir _LibGIOLinkDir _LibGIOLinkFlags _LibGIOCflags) -+endif(NOT WIN32) -+ -+MESSAGE(STATUS "gio include dir: ${_LibGIOIncDir}") -+ -+# first try without default paths to respect PKG_CONFIG_PATH -+ -+find_path(GIO_MAIN_INCLUDE_DIR glib.h -+ PATH_SUFFIXES glib-2.0 -+ PATHS ${_LibGIOIncDir} -+ NO_DEFAULT_PATH) -+ -+find_path(GIO_MAIN_INCLUDE_DIR glib.h -+ PATH_SUFFIXES glib-2.0 -+ PATHS ${_LibGIOIncDir} ) -+ -+MESSAGE(STATUS "found gio main include dir: ${GIO_MAIN_INCLUDE_DIR}") -+ -+# search the glibconfig.h include dir under the same root where the library is found -+find_library(GIO_LIBRARIES -+ NAMES gio-2.0 -+ PATHS ${_LibGIOLinkDir} -+ NO_DEFAULT_PATH) -+ -+find_library(GIO_LIBRARIES -+ NAMES gio-2.0 -+ PATHS ${_LibGIOLinkDir}) -+ -+ -+get_filename_component(GIOLibDir "${GIO_LIBRARIES}" PATH) -+ -+find_path(GIO_INTERNAL_INCLUDE_DIR glibconfig.h -+ PATH_SUFFIXES glib-2.0/include -+ PATHS ${_LibGIOIncDir} "${GIOLibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH} -+ NO_DEFAULT_PATH) -+ -+find_path(GIO_INTERNAL_INCLUDE_DIR glibconfig.h -+ PATH_SUFFIXES glib-2.0/include -+ PATHS ${_LibGIOIncDir} "${GIOLibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}) -+ -+set(GIO_INCLUDE_DIR "${GIO_MAIN_INCLUDE_DIR}") -+ -+# not sure if this include dir is optional or required -+# for now it is optional -+if(GIO_INTERNAL_INCLUDE_DIR) -+ set(GIO_INCLUDE_DIR ${GIO_INCLUDE_DIR} "${GIO_INTERNAL_INCLUDE_DIR}") -+endif(GIO_INTERNAL_INCLUDE_DIR) -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args(GIO DEFAULT_MSG GIO_LIBRARIES GIO_MAIN_INCLUDE_DIR) -+ -+mark_as_advanced(GIO_INCLUDE_DIR GIO_LIBRARIES) -+ -diff --git a/config.h.cmake b/config.h.cmake ---- a/config.h.cmake -+++ b/config.h.cmake -@@ -1,3 +1,4 @@ - /* config.h. Generated by cmake from config.h.cmake */ - --#cmakedefine01 HAVE_GCONF -+#cmakedefine01 USE_GSETTINGS -+#cmakedefine01 USE_GCONF -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -37,11 +37,16 @@ - set_property(SOURCE qml/dbus/osdService.xml APPEND PROPERTY CLASSNAME OsdServiceInterface) - qt5_add_dbus_interface(dbus_SRCS qml/dbus/osdService.xml osdservice) - --if (HAVE_GCONF) -+if (USE_GCONF) - include_directories(${GCONF_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS}) - set(cpp_SRCS ${cpp_SRCS} gconfitem.cpp) - endif() - -+if (USE_GSETTINGS) -+ include_directories(${GIO_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS}) -+ set(cpp_SRCS ${cpp_SRCS} gsettingsitem.cpp) -+endif() -+ - add_library(plasma-volume-declarative SHARED ${dbus_SRCS} ${cpp_SRCS} ${qml_SRCS}) - target_link_libraries(plasma-volume-declarative - Qt5::Core -@@ -52,12 +57,18 @@ - ${PULSEAUDIO_LIBRARY} - ${PULSEAUDIO_MAINLOOP_LIBRARY} - ${CANBERRA_LIBRARIES} -+ ${GOBJECT_LIBRARIES} - ) - --if (HAVE_GCONF) -+if (USE_GCONF) - target_link_libraries(plasma-volume-declarative - ${GCONF_LDFLAGS} -- ${GOBJECT_LDFLAGS} -+ ) -+endif() -+ -+if (USE_GSETTINGS) -+ target_link_libraries(plasma-volume-declarative -+ ${GIO_LIBRARIES} - ) - endif() - -diff --git a/src/gsettingsitem.h b/src/gsettingsitem.h -new file mode 100644 ---- /dev/null -+++ b/src/gsettingsitem.h -@@ -0,0 +1,59 @@ -+/* -+ * Copyright (C) 2018 Nicolas Fella -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public License -+ * version 2.1 as published by the Free Software Foundation. -+ * -+ * 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 St, Fifth Floor, Boston, MA -+ * 02110-1301 USA -+ * -+ */ -+ -+#ifndef GSETTINGSITEM_H -+#define GSETTINGSITEM_H -+ -+#include -+#include -+#include -+ -+#include -+ -+class GSettingsItem : public QObject -+{ -+ Q_OBJECT -+ -+ public: -+ -+ explicit GSettingsItem(const QString &key, QObject *parent = nullptr); -+ virtual ~GSettingsItem() override; -+ -+ QVariant value(const QString &key) const; -+ void set(const QString &key, const QVariant &val); -+ -+ -+Q_SIGNALS: -+ void subtreeChanged(); -+ -+private: -+ GSettings *m_settings; -+ -+static void settingChanged(GSettings *settings, const gchar *key, gpointer data) -+{ -+ Q_UNUSED(settings) -+ Q_UNUSED(key) -+ -+ GSettingsItem *self = static_cast(data); -+ Q_EMIT self->subtreeChanged(); -+} -+ -+}; -+ -+#endif // GCONFITEM_H -diff --git a/src/gsettingsitem.cpp b/src/gsettingsitem.cpp -new file mode 100644 ---- /dev/null -+++ b/src/gsettingsitem.cpp -@@ -0,0 +1,93 @@ -+/* -+ * Copyright (C) 2018 Nicolas Fella -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public License -+ * version 2.1 as published by the Free Software Foundation. -+ * -+ * 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 St, Fifth Floor, Boston, MA -+ * 02110-1301 USA -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#include -+ -+#include "gsettingsitem.h" -+#include "debug.h" -+ -+QVariant GSettingsItem::value(const QString &key) const -+{ -+ GVariant *gvalue = g_settings_get_value(m_settings, key.toLatin1().data()); -+ -+ QVariant toReturn; -+ -+ switch (g_variant_classify(gvalue)) { -+ case G_VARIANT_CLASS_BOOLEAN: -+ toReturn = QVariant((bool)g_variant_get_boolean(gvalue)); -+ break; -+ case G_VARIANT_CLASS_STRING: -+ toReturn = QVariant(QString::fromUtf8(g_variant_get_string(gvalue, NULL))); -+ break; -+ default: -+ qCDebug(PLASMAPA()) << "Unhandled variant type in value()"; -+ } -+ -+ g_variant_unref(gvalue); -+ -+ return toReturn; -+} -+ -+void GSettingsItem::set(const QString &key, const QVariant &val) -+{ -+ -+ // It might be hard to detect the right GVariant type from -+ // complext QVariant types such as string lists or more detailed -+ // types such as integers (GVariant has different sizes), -+ // therefore we get the current value for the key and convert -+ // to QVariant using the GVariant type -+ GVariant *oldValue = g_settings_get_value(m_settings, key.toLatin1().data()); -+ GVariant *newValue; -+ -+ switch (g_variant_type_peek_string(g_variant_get_type(oldValue))[0]) { -+ case G_VARIANT_CLASS_BOOLEAN: -+ newValue = g_variant_new_boolean(val.toBool()); -+ break; -+ case G_VARIANT_CLASS_STRING: -+ newValue = g_variant_new_string(val.toString().toUtf8().constData()); -+ break; -+ default: -+ qCDebug(PLASMAPA()) << "Unhandled variant type in set()"; -+ } -+ -+ if (newValue) -+ g_settings_set_value(m_settings, key.toLatin1().data(), newValue); -+ -+ g_variant_unref(oldValue); -+} -+ -+GSettingsItem::GSettingsItem(const QString &key, QObject *parent) -+ : QObject (parent) -+{ -+ -+ m_settings = g_settings_new_with_path("org.freedesktop.pulseaudio.module-group", key.toLatin1().data()); -+ -+ g_signal_connect(m_settings, "changed", G_CALLBACK(GSettingsItem::settingChanged), this); -+} -+ -+GSettingsItem::~GSettingsItem() -+{ -+ g_settings_sync(); -+ if (m_settings) -+ g_object_unref(m_settings); -+} -diff --git a/src/kcm/package/contents/ui/Advanced.qml b/src/kcm/package/contents/ui/Advanced.qml ---- a/src/kcm/package/contents/ui/Advanced.qml -+++ b/src/kcm/package/contents/ui/Advanced.qml -@@ -73,7 +73,7 @@ - text: i18n("Add virtual output device for simultaneous output on all local sound cards") - checked: moduleManager.combineSinks - onCheckedChanged: moduleManager.combineSinks = checked; -- enabled: moduleManager.loadedModules.indexOf("module-gconf") != -1 -+ enabled: moduleManager.configModuleLoaded - visible: moduleManager.settingsSupported - } - -@@ -84,16 +84,16 @@ - text: i18n("Automatically switch all running streams when a new output becomes available") - checked: moduleManager.switchOnConnect - onCheckedChanged: moduleManager.switchOnConnect = checked; -- enabled: moduleManager.loadedModules.indexOf("module-gconf") != -1 -+ enabled: moduleManager.configModuleLoaded - visible: moduleManager.settingsSupported - } - - Label { - Layout.alignment: Qt.AlignHCenter - enabled: false - font.italic: true -- text: i18n("Requires 'module-gconf' PulseAudio module") -- visible: moduleManager.settingsSupported && moduleManager.loadedModules.indexOf("module-gconf") == -1 -+ text: i18n("Requires %1 PulseAudio module", moduleManager.configModuleName) -+ visible: moduleManager.settingsSupported && !moduleManager.configModuleLoaded - } - - Header { -diff --git a/src/modulemanager.h b/src/modulemanager.h ---- a/src/modulemanager.h -+++ b/src/modulemanager.h -@@ -29,18 +29,18 @@ - // Properties need fully qualified classes even with pointers. - #include "client.h" - --class GConfItem; -- - namespace QPulseAudio - { --class GConfModule; -+class ConfigModule; - - class ModuleManager : public QObject - { - Q_OBJECT - Q_PROPERTY(bool settingsSupported READ settingsSupported CONSTANT) - Q_PROPERTY(bool combineSinks READ combineSinks WRITE setCombineSinks NOTIFY combineSinksChanged) - Q_PROPERTY(bool switchOnConnect READ switchOnConnect WRITE setSwitchOnConnect NOTIFY switchOnConnectChanged) -+ Q_PROPERTY(bool configModuleLoaded READ configModuleLoaded NOTIFY loadedModulesChanged) -+ Q_PROPERTY(QString configModuleName READ configModuleName CONSTANT) - Q_PROPERTY(QStringList loadedModules READ loadedModules NOTIFY loadedModulesChanged) - public: - explicit ModuleManager(QObject *parent = nullptr); -@@ -52,6 +52,8 @@ - bool switchOnConnect() const; - void setSwitchOnConnect(bool switchOnConnect); - QStringList loadedModules() const; -+ bool configModuleLoaded() const; -+ QString configModuleName() const; - - Q_SIGNALS: - void combineSinksChanged(); -@@ -61,9 +63,9 @@ - private: - void updateLoadedModules(); - -- GConfModule *m_combineSinks; -- GConfModule *m_switchOnConnect; -- GConfModule *m_deviceManager; -+ ConfigModule *m_combineSinks; -+ ConfigModule *m_switchOnConnect; -+ ConfigModule *m_deviceManager; - QStringList m_loadedModules; - }; - -diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp ---- a/src/modulemanager.cpp -+++ b/src/modulemanager.cpp -@@ -23,40 +23,54 @@ - #include "module.h" - #include "../config.h" - --#if HAVE_GCONF -+#if USE_GSETTINGS -+#include "gsettingsitem.h" -+ -+#define PA_SETTINGS_PATH_MODULES "/org/freedesktop/pulseaudio/module-groups" -+#endif -+ -+#if USE_GCONF - #include "gconfitem.h" --#define PA_GCONF_ROOT "/system/pulseaudio" --#define PA_GCONF_PATH_MODULES PA_GCONF_ROOT"/modules" -+#define PA_SETTINGS_PATH_MODULES "/system/pulseaudio/modules" - #endif - - #include - - namespace QPulseAudio - { - --#if HAVE_GCONF --class GConfModule : public GConfItem -+#if USE_GCONF || USE_GSETTINGS -+ -+#if USE_GSETTINGS -+class ConfigModule : public GSettingsItem -+#elif USE_GCONF -+class ConfigModule : public GConfItem -+#endif - { - public: -- GConfModule(const QString &configName, const QString &moduleName, QObject *parent); -+ ConfigModule(const QString &configName, const QString &moduleName, QObject *parent); - bool isEnabled() const; - void setEnabled(bool enabled, const QVariant &args=QVariant()); - private: - QString m_moduleName; - }; - --GConfModule::GConfModule(const QString &configName, const QString &moduleName, QObject *parent) : -- GConfItem(QStringLiteral(PA_GCONF_PATH_MODULES"/") + configName, parent), -+ConfigModule::ConfigModule(const QString &configName, const QString &moduleName, QObject *parent) : -+#if USE_GSETTINGS -+ GSettingsItem(QStringLiteral(PA_SETTINGS_PATH_MODULES"/") + configName + QStringLiteral("/"), parent), -+#elif USE_GCONF -+ GConfItem(QStringLiteral(PA_SETTINGS_PATH_MODULES"/") + configName, parent), -+#endif - m_moduleName(moduleName) - { - } - --bool GConfModule::isEnabled() const -+bool ConfigModule::isEnabled() const - { - return value(QStringLiteral("enabled")).toBool(); - } - --void GConfModule::setEnabled(bool enabled, const QVariant &args) -+void ConfigModule::setEnabled(bool enabled, const QVariant &args) - { - set(QStringLiteral("locked"), true); - -@@ -69,20 +83,21 @@ - } - set(QStringLiteral("locked"), false); - } --#endif - -+#endif - - ModuleManager::ModuleManager(QObject *parent) : - QObject(parent) - { --#if HAVE_GCONF -- m_combineSinks = new GConfModule(QStringLiteral("combine"), QStringLiteral("module-combine"), this); -- m_switchOnConnect = new GConfModule(QStringLiteral("switch-on-connect"), QStringLiteral("module-switch-on-connect"), this); -- m_deviceManager = new GConfModule(QStringLiteral("device-manager"), QStringLiteral("module-device-manager"), this); -+#if USE_GCONF || USE_GSETTINGS - -- connect(m_combineSinks, &GConfItem::subtreeChanged, this, &ModuleManager::combineSinksChanged); -- connect(m_switchOnConnect, &GConfItem::subtreeChanged, this, &ModuleManager::switchOnConnectChanged); -- connect(m_deviceManager, &GConfItem::subtreeChanged, this, &ModuleManager::switchOnConnectChanged); -+ m_combineSinks = new ConfigModule(QStringLiteral("combine"), QStringLiteral("module-combine"), this); -+ m_switchOnConnect = new ConfigModule(QStringLiteral("switch-on-connect"), QStringLiteral("module-switch-on-connect"), this); -+ m_deviceManager = new ConfigModule(QStringLiteral("device-manager"), QStringLiteral("module-device-manager"), this); -+ -+ connect(m_combineSinks, &ConfigModule::subtreeChanged, this, &ModuleManager::combineSinksChanged); -+ connect(m_switchOnConnect, &ConfigModule::subtreeChanged, this, &ModuleManager::switchOnConnectChanged); -+ connect(m_deviceManager, &ConfigModule::subtreeChanged, this, &ModuleManager::switchOnConnectChanged); - #endif - - QTimer *updateModulesTimer = new QTimer(this); -@@ -100,48 +115,48 @@ - - bool ModuleManager::settingsSupported() const - { --#if HAVE_GCONF -+#if USE_GCONF || USE_GSETTINGS - return true; - #else - return false; - #endif - } - - bool ModuleManager::combineSinks() const - { --#if HAVE_GCONF -+#if USE_GCONF || USE_GSETTINGS - return m_combineSinks->isEnabled(); - #else - return false; - #endif - } - - void ModuleManager::setCombineSinks(bool combineSinks) - { --#if HAVE_GCONF -+#if USE_GCONF || USE_GSETTINGS - m_combineSinks->setEnabled(combineSinks); - #else -- Q_UNUSED(combineSinks) -+ Q_UNUSED(combineSinks() - #endif - } - - bool ModuleManager::switchOnConnect() const - { -+#if USE_GCONF || USE_GSETTINGS - //switch on connect and device-manager do the same task. Only one should be enabled - - //Note on the first run m_deviceManager will appear to be disabled even though it's actually running - //because there is no gconf entry, however m_switchOnConnect will only exist if set by Plasma PA - //hence only check this entry --#if HAVE_GCONF - return m_switchOnConnect->isEnabled() ; - #else - return false; - #endif - } - - void ModuleManager::setSwitchOnConnect(bool switchOnConnect) - { --#if HAVE_GCONF -+#if USE_GCONF || USE_GSETTINGS - m_deviceManager->setEnabled(!switchOnConnect); - m_switchOnConnect->setEnabled(switchOnConnect); - #else -@@ -164,4 +179,19 @@ - Q_EMIT loadedModulesChanged(); - } - -+bool ModuleManager::configModuleLoaded() const -+{ -+ return m_loadedModules.contains(configModuleName()); -+} -+ -+QString ModuleManager::configModuleName() const -+{ -+#if USE_GCONF -+ return QStringLiteral("module-gconf"); -+#elif USE_GSETTINGS -+ return QStringLiteral("module-gsettings"); -+#else -+ return QString(); -+#endif -+} - } - diff --git a/kde/patch/plasma-workspace.patch b/kde/patch/plasma-workspace.patch deleted file mode 100644 index 8671c65..0000000 --- a/kde/patch/plasma-workspace.patch +++ /dev/null @@ -1,17 +0,0 @@ -# Add ConsoleKit2 support for screenlocker (ConsoleKit2 has implemented the -# systemd-logind API for Lock, Unlock, PrepareForSleep and Inhibit. -# This functionality has been incorporated into kscreenlocker-5.5.0. -#cat $CWD/patch/plasma-workspace/plasma-workspace_consolekit2.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Apply commit that fixes compilation of 5.6.5: -#cat $CWD/patch/plasma-workspace/plasma-workspace_apply_767aa57.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Systray: Move all icon resolution to dataengine, preventing high CPU usage, -# see https://phabricator.kde.org/D2986 : -# Fixed in 5.9.0 -#cat $CWD/patch/plasma-workspace/plasma-workspace.systray_cpubug.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix vulnerability (CVE-2018-6791 - KDEBUG_389815) -# (already fixed in Plasma 5.12.0): -#cat $CWD/patch/plasma-workspace/plasma-workspace_kdebug389815.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/plasma-workspace/plasma-workspace.systray_cpubug.patch b/kde/patch/plasma-workspace/plasma-workspace.systray_cpubug.patch deleted file mode 100644 index 4ad3c07..0000000 --- a/kde/patch/plasma-workspace/plasma-workspace.systray_cpubug.patch +++ /dev/null @@ -1,152 +0,0 @@ -https://phabricator.kde.org/D2986 -Systray: Move all icon resolution to dataengine - -diff --git a/applets/systemtray/package/contents/ui/ConfigEntries.qml b/applets/systemtray/package/contents/ui/ConfigEntries.qml ---- a/applets/systemtray/package/contents/ui/ConfigEntries.qml -+++ b/applets/systemtray/package/contents/ui/ConfigEntries.qml -@@ -75,7 +75,7 @@ - "index": i, - "taskId": item.Id, - "name": item.Title, -- "iconName": plasmoid.nativeInterface.resolveIcon(item.IconName, item.IconThemePath), -+ "iconName": item.IconName, - "icon": item.Icon - }); - } -diff --git a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml ---- a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml -+++ b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml -@@ -28,7 +28,7 @@ - text: Title - mainText: ToolTipTitle != "" ? ToolTipTitle : Title - subText: ToolTipSubTitle -- icon: ToolTipIcon != "" ? ToolTipIcon : plasmoid.nativeInterface.resolveIcon(IconName != "" ? IconName : Icon, IconThemePath) -+ icon: ToolTipIcon != "" ? ToolTipIcon : Icon ? Icon : IconName - textFormat: Text.AutoText - category: Category - -@@ -48,7 +48,7 @@ - - PlasmaCore.IconItem { - id: iconItem -- source: plasmoid.nativeInterface.resolveIcon(IconName != "" ? IconName : Icon, IconThemePath) -+ source: Icon ? Icon : IconName - width: Math.min(parent.width, parent.height) - height: width - active: taskIcon.containsMouse -diff --git a/applets/systemtray/systemtray.h b/applets/systemtray/systemtray.h ---- a/applets/systemtray/systemtray.h -+++ b/applets/systemtray/systemtray.h -@@ -60,12 +60,6 @@ - - //Invokable utilities - /** -- * returns either a simple icon name or a custom path if the app is -- * using a custom theme -- */ -- Q_INVOKABLE QVariant resolveIcon(const QVariant &variant, const QString &iconThemePath); -- -- /** - * Given an AppletInterface pointer, shows a proper context menu for it - */ - Q_INVOKABLE void showPlasmoidMenu(QQuickItem *appletInterface, int x, int y); -diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp ---- a/applets/systemtray/systemtray.cpp -+++ b/applets/systemtray/systemtray.cpp -@@ -37,37 +37,11 @@ - #include - #include - --#include --#include - #include - #include - - #include - --/* -- * An app may also load icons from their own directories, so we need a new iconloader that takes this into account -- * This is wrapped into a subclass of iconengine so the iconloader lifespan matches the icon object -- */ --class AppIconEngine : public KIconEngine --{ --public: -- AppIconEngine(const QString &variant, const QString &path, const QString &appName); -- ~AppIconEngine(); --private: -- KIconLoader* m_loader; --}; -- --AppIconEngine::AppIconEngine(const QString &variant, const QString &path, const QString &appName) : -- KIconEngine(variant, m_loader = new KIconLoader(appName, QStringList())) --{ -- m_loader->addAppDir(appName, path); --} -- --AppIconEngine::~AppIconEngine() --{ -- delete m_loader; --} -- - class PlasmoidModel: public QStandardItemModel - { - public: -@@ -169,32 +143,6 @@ - } - } - --QVariant SystemTray::resolveIcon(const QVariant &variant, const QString &iconThemePath) --{ -- if (variant.canConvert()) { -- if (!iconThemePath.isEmpty()) { -- const QString path = iconThemePath; -- if (!path.isEmpty()) { -- // FIXME: If last part of path is not "icons", this won't work! -- auto tokens = path.splitRef('/', QString::SkipEmptyParts); -- if (tokens.length() >= 3 && tokens.takeLast() == QLatin1String("icons")) { -- const QString appName = tokens.takeLast().toString(); -- -- return QVariant(QIcon(new AppIconEngine(variant.toString(), path, appName))); -- } else { -- qCWarning(SYSTEM_TRAY) << "Wrong IconThemePath" << path << ": too short or does not end with 'icons'"; -- } -- } -- -- //return just the string hoping that IconItem will know how to interpret it anyways as either a normal icon or a SVG from the theme -- return variant; -- } -- } -- -- // Most importantly QIcons. Nothing to do for those. -- return variant; --} -- - void SystemTray::showPlasmoidMenu(QQuickItem *appletInterface, int x, int y) - { - if (!appletInterface) { -diff --git a/dataengines/statusnotifieritem/statusnotifieritemsource.cpp b/dataengines/statusnotifieritem/statusnotifieritemsource.cpp ---- a/dataengines/statusnotifieritem/statusnotifieritemsource.cpp -+++ b/dataengines/statusnotifieritem/statusnotifieritemsource.cpp -@@ -240,14 +240,19 @@ - if (!m_customIconLoader) { - m_customIconLoader = new KIconLoader(QString(), QStringList(), this); - } -+ // FIXME: If last part of path is not "icons", this won't work! -+ QString appName; -+ auto tokens = path.splitRef('/', QString::SkipEmptyParts); -+ if (tokens.length() >= 3 && tokens.takeLast() == QLatin1String("icons")) -+ appName = tokens.takeLast().toString(); - - //icons may be either in the root directory of the passed path or in a appdir format - //i.e hicolor/32x32/iconname.png - -- m_customIconLoader->reconfigure(QString(), QStringList(path)); -+ m_customIconLoader->reconfigure(appName, QStringList(path)); - - //add app dir requires an app name, though this is completely unused in this context -- m_customIconLoader->addAppDir(QStringLiteral("unused"), path); -+ m_customIconLoader->addAppDir(appName.size() ? appName : QStringLiteral("unused"), path); - } - setData(QStringLiteral("IconThemePath"), path); - - diff --git a/kde/patch/plasma-workspace/plasma-workspace_apply_767aa57.patch b/kde/patch/plasma-workspace/plasma-workspace_apply_767aa57.patch deleted file mode 100644 index 4f22b8e..0000000 --- a/kde/patch/plasma-workspace/plasma-workspace_apply_767aa57.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Kai Uwe Broulik -Date: Mon, 13 Jun 2016 18:36:17 +0000 -Subject: [PanelView] Fix build... -X-Git-Url: http://quickgit.kde.org/?p=plasma-workspace.git&a=commitdiff&h=767aa574400276b872aa0495f9af096784a8ed66 ---- -[PanelView] Fix build... - -CCMAIL: notmart@gmail.com ---- - - ---- a/shell/panelview.cpp -+++ b/shell/panelview.cpp -@@ -995,7 +995,7 @@ - { - if (status == Plasma::Types::NeedsAttentionStatus) { - showTemporarily(); -- } else if (status == Plasma::AcceptingInputStatus) { -+ } else if (status == Plasma::Types::AcceptingInputStatus) { - KWindowSystem::forceActiveWindow(winId()); - } else { - restoreAutoHide(); - diff --git a/kde/patch/plasma-workspace/plasma-workspace_consolekit2.patch b/kde/patch/plasma-workspace/plasma-workspace_consolekit2.patch deleted file mode 100644 index 6131c90..0000000 --- a/kde/patch/plasma-workspace/plasma-workspace_consolekit2.patch +++ /dev/null @@ -1,189 +0,0 @@ -From: Eric Koegel -Date: Wed, 12 Aug 2015 08:33:39 +0000 -Subject: ConsoleKit2 support for screenlocker -X-Git-Url: http://quickgit.kde.org/?p=plasma-workspace.git&a=commitdiff&h=72578284a1fda5f012cafcaccad6069fadbf9a25 ---- -ConsoleKit2 support for screenlocker - -ConsoleKit2 has the same API as systemd-logind for Lock, Unlock, -PrepareForSleep, and Inhibit. This patch adds the functionality -for ConsoleKit2 while attempting to minimize code duplication. - -REVIEW: 124469 ---- - - ---- a/ksmserver/screenlocker/logind.cpp -+++ b/ksmserver/screenlocker/logind.cpp -@@ -25,13 +25,17 @@ - #include - #include - #include --#include - #include - - const static QString s_login1Service = QStringLiteral("org.freedesktop.login1"); - const static QString s_login1Path = QStringLiteral("/org/freedesktop/login1"); - const static QString s_login1ManagerInterface = QStringLiteral("org.freedesktop.login1.Manager"); - const static QString s_login1SessionInterface = QStringLiteral("org.freedesktop.login1.Session"); -+ -+const static QString s_consolekitService = QStringLiteral("org.freedesktop.ConsoleKit"); -+const static QString s_consolekitPath = QStringLiteral("/org/freedesktop/ConsoleKit/Manager"); -+const static QString s_consolekitManagerInterface = QStringLiteral("org.freedesktop.ConsoleKit.Manager"); -+const static QString s_consolekitSessionInterface = QStringLiteral("org.freedesktop.ConsoleKit.Session"); - - LogindIntegration::LogindIntegration(const QDBusConnection &connection, QObject *parent) - : QObject(parent) -@@ -42,6 +46,10 @@ - this)) - , m_connected(false) - , m_inhibitFileDescriptor() -+ , m_service(nullptr) -+ , m_path(nullptr) -+ , m_managerInterface(nullptr) -+ , m_sessionInterface(nullptr) - { - connect(m_logindServiceWatcher, &QDBusServiceWatcher::serviceRegistered, this, &LogindIntegration::logindServiceRegistered); - connect(m_logindServiceWatcher, &QDBusServiceWatcher::serviceUnregistered, this, -@@ -67,6 +75,11 @@ - } - if (reply.value().contains(s_login1Service)) { - logindServiceRegistered(); -+ // Don't register ck if we have logind -+ return; -+ } -+ if (reply.value().contains(s_consolekitService)) { -+ consolekitServiceRegistered(); - } - } - ); -@@ -89,6 +102,40 @@ - message.setArguments(QVariantList() << (quint32) QCoreApplication::applicationPid()); - QDBusPendingReply session = m_bus.asyncCall(message); - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this); -+ -+ m_service = &s_login1Service; -+ m_path = &s_login1Path; -+ m_managerInterface = &s_login1ManagerInterface; -+ m_sessionInterface = &s_login1SessionInterface; -+ -+ commonServiceRegistered(watcher); -+} -+ -+void LogindIntegration::consolekitServiceRegistered() -+{ -+ // Don't try to register with ck if we have logind -+ if (m_connected) { -+ return; -+ } -+ -+ // get the current session -+ QDBusMessage message = QDBusMessage::createMethodCall(s_consolekitService, -+ s_consolekitPath, -+ s_consolekitManagerInterface, -+ QStringLiteral("GetCurrentSession")); -+ QDBusPendingReply session = m_bus.asyncCall(message); -+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this); -+ -+ m_service = &s_consolekitService; -+ m_path = &s_consolekitPath; -+ m_managerInterface = &s_consolekitManagerInterface; -+ m_sessionInterface = &s_consolekitSessionInterface; -+ -+ commonServiceRegistered(watcher); -+} -+ -+void LogindIntegration::commonServiceRegistered(QDBusPendingCallWatcher *watcher) -+{ - connect(watcher, &QDBusPendingCallWatcher::finished, this, - [this](QDBusPendingCallWatcher *self) { - QDBusPendingReply reply = *self; -@@ -97,7 +144,7 @@ - return; - } - if (!reply.isValid()) { -- qDebug() << "The session is not registered with logind" << reply.error().message(); -+ qDebug() << "The session is not registered: " << reply.error().message(); - return; - } - const QString sessionPath = reply.value().path(); -@@ -105,15 +152,15 @@ - - // connections need to be done this way as the object exposes both method and signal - // with name "Lock"/"Unlock". Qt is not able to automatically handle this. -- m_bus.connect(s_login1Service, -+ m_bus.connect(*m_service, - sessionPath, -- s_login1SessionInterface, -+ *m_sessionInterface, - QStringLiteral("Lock"), - this, - SIGNAL(requestLock())); -- m_bus.connect(s_login1Service, -+ m_bus.connect(*m_service, - sessionPath, -- s_login1SessionInterface, -+ *m_sessionInterface, - QStringLiteral("Unlock"), - this, - SIGNAL(requestUnlock())); -@@ -123,9 +170,9 @@ - ); - - // connect to manager object's signals we need -- m_bus.connect(s_login1Service, -- s_login1Path, -- s_login1ManagerInterface, -+ m_bus.connect(*m_service, -+ *m_path, -+ *m_managerInterface, - QStringLiteral("PrepareForSleep"), - this, - SIGNAL(prepareForSleep(bool))); -@@ -136,9 +183,14 @@ - if (m_inhibitFileDescriptor.isValid()) { - return; - } -- QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service, -- s_login1Path, -- s_login1ManagerInterface, -+ -+ if (!m_connected) { -+ return; -+ } -+ -+ QDBusMessage message = QDBusMessage::createMethodCall(*m_service, -+ *m_path, -+ *m_managerInterface, - QStringLiteral("Inhibit")); - message.setArguments(QVariantList({QStringLiteral("sleep"), - i18n("Screen Locker"), - ---- a/ksmserver/screenlocker/logind.h -+++ b/ksmserver/screenlocker/logind.h -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - class QDBusServiceWatcher; - -@@ -59,10 +60,16 @@ - **/ - explicit LogindIntegration(const QDBusConnection &connection, QObject *parent = nullptr); - void logindServiceRegistered(); -+ void consolekitServiceRegistered(); -+ void commonServiceRegistered(QDBusPendingCallWatcher *watcher); - QDBusConnection m_bus; - QDBusServiceWatcher *m_logindServiceWatcher; - bool m_connected; - QDBusUnixFileDescriptor m_inhibitFileDescriptor; -+ const QString *m_service; -+ const QString *m_path; -+ const QString *m_managerInterface; -+ const QString *m_sessionInterface; - }; - - #endif - diff --git a/kde/patch/plasma-workspace/plasma-workspace_kdebug389815.patch b/kde/patch/plasma-workspace/plasma-workspace_kdebug389815.patch deleted file mode 100644 index e2f1e48..0000000 --- a/kde/patch/plasma-workspace/plasma-workspace_kdebug389815.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f32002ce50edc3891f1fa41173132c820b917d57 Mon Sep 17 00:00:00 2001 -From: Marco Martin -Date: Mon, 5 Feb 2018 13:12:51 +0100 -Subject: Make sure device paths are quoted - -in the case a vfat removable device has $() or `` in its label, -such as $(touch foo) the quoted command may get executed, -leaving an attack vector. Use KMacroExpander::expandMacrosShellQuote -to make sure everything is quoted and not interpreted as a command - -BUG:389815 ---- - soliduiserver/deviceserviceaction.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/soliduiserver/deviceserviceaction.cpp b/soliduiserver/deviceserviceaction.cpp -index f49c967..738b27c 100644 ---- a/soliduiserver/deviceserviceaction.cpp -+++ b/soliduiserver/deviceserviceaction.cpp -@@ -158,7 +158,7 @@ void DelayedExecutor::delayedExecute(const QString &udi) - - QString exec = m_service.exec(); - MacroExpander mx(device); -- mx.expandMacros(exec); -+ mx.expandMacrosShellQuote(exec); - - KRun::runCommand(exec, QString(), m_service.icon(), 0); - deleteLater(); --- -cgit v0.11.2 - - diff --git a/kde/patch/plasma5-nm.patch b/kde/patch/plasma5-nm.patch deleted file mode 100644 index deb03e5..0000000 --- a/kde/patch/plasma5-nm.patch +++ /dev/null @@ -1,14 +0,0 @@ -# Patches that address reported bugs in plasma-nm 0.9.3.1: -#cat $CWD/patch/plasma-nm/plasma-nm-fixes.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# The plasma-nm-5.2.2 needs a patch to work with the new modemmanager-qt in -# frameworks 5.9.0. This patch is no longer needed for plasma-nm-5.3.0: -#cat $CWD/patch/plasma-nm/plasma-nm_modemmanager-qt_api.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix compilation against NetworkManager 1.0.6: -#cat $CWD/patch/plasma-nm/plasma-nm_networkmanager.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Password is asked twice when connecting to a new WiFi network, -# KDEBUG 423093; fixed in Frameworks 5.72 and Plasma 5.20. -cat $CWD/patch/plasma5-nm/plasma5-nm_KDEBUG_423093.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/plasma5-nm/plasma-nm-fixes.patch b/kde/patch/plasma5-nm/plasma-nm-fixes.patch deleted file mode 100644 index d98448d..0000000 --- a/kde/patch/plasma5-nm/plasma-nm-fixes.patch +++ /dev/null @@ -1,322 +0,0 @@ -diff --git a/applet/declarative/contents/ui/main.qml b/applet/declarative/contents/ui/main.qml -index 8ea88cc..aa81707 100644 ---- a/applet/declarative/contents/ui/main.qml -+++ b/applet/declarative/contents/ui/main.qml -@@ -19,6 +19,7 @@ - */ - - import QtQuick 1.1 -+import org.kde.plasma.extras 0.1 as PlasmaExtras - import org.kde.plasma.components 0.1 as PlasmaComponents - import org.kde.plasma.core 0.1 as PlasmaCore - import org.kde.networkmanagement 0.1 as PlasmaNM -@@ -77,16 +78,7 @@ Item { - anchors.fill: parent - } - -- ListView { -- id: connectionView; -- -- property bool expandedItem: false; -- property string previouslyExpandedItem: ""; -- -- property bool activeExpanded: true; -- property bool previousExpanded: true; -- property bool unknownExpanded: true; -- -+ PlasmaExtras.ScrollArea { - anchors { - left: parent.left; - right: parent.right; -@@ -95,50 +87,64 @@ Item { - topMargin: padding.margins.top; - bottomMargin: padding.margins.bottom - } -- clip: true -- model: connectionSortModel; -- currentIndex: -1; -- interactive: true; -- boundsBehavior: Flickable.StopAtBounds; -- section.property: "itemSection"; -- section.delegate: SectionHeader { -- onHideSection: { -- if (section == i18n("Active connections")) { -- connectionView.activeExpanded = false; -- } else if (section == i18n("Previous connections")) { -- connectionView.previousExpanded = false; -- } else { -- connectionView.unknownExpanded = false; -+ -+ ListView { -+ id: connectionView; -+ -+ property bool expandedItem: false; -+ property string previouslyExpandedItem: ""; -+ -+ property bool activeExpanded: true; -+ property bool previousExpanded: true; -+ property bool unknownExpanded: true; -+ -+ anchors.fill: parent; -+ -+ clip: true -+ model: connectionSortModel; -+ currentIndex: -1; -+ interactive: true; -+ boundsBehavior: Flickable.StopAtBounds; -+ section.property: "itemSection"; -+ section.delegate: SectionHeader { -+ onHideSection: { -+ if (section == i18n("Active connections")) { -+ connectionView.activeExpanded = false; -+ } else if (section == i18n("Previous connections")) { -+ connectionView.previousExpanded = false; -+ } else { -+ connectionView.unknownExpanded = false; -+ } - } -- } - -- onShowSection: { -- if (section == i18n("Active connections")) { -- connectionView.activeExpanded = true; -- } else if (section == i18n("Previous connections")) { -- connectionView.previousExpanded = true; -- } else { -- connectionView.unknownExpanded = true; -+ onShowSection: { -+ if (section == i18n("Active connections")) { -+ connectionView.activeExpanded = true; -+ } else if (section == i18n("Previous connections")) { -+ connectionView.previousExpanded = true; -+ } else { -+ connectionView.unknownExpanded = true; -+ } - } - } -- } - -- delegate: ConnectionItem { -- expanded: connectionView.expandedItem && connectionView.previouslyExpandedItem == itemUni; -- onItemExpanded: { -- if (itemExpanded) { -- connectionView.expandedItem = true; -- connectionView.previouslyExpandedItem = itemUni;; -- connectionView.currentIndex = index; -- } else { -- connectionView.expandedItem = false; -- connectionView.previouslyExpandedItem = ""; -+ delegate: ConnectionItem { -+ expanded: connectionView.expandedItem && connectionView.previouslyExpandedItem == itemUni; -+ onItemExpanded: { -+ if (itemExpanded) { -+ connectionView.expandedItem = true; -+ connectionView.previouslyExpandedItem = itemUni;; -+ connectionView.currentIndex = index; -+ } else { -+ connectionView.expandedItem = false; -+ connectionView.previouslyExpandedItem = ""; -+ } - } -- } - -- ListView.onRemove: { -- if (ListView.isCurrentItem) { -- connectionView.previouslyExpandedItem = ""; -+ ListView.onRemove: { -+ if (ListView.isCurrentItem) { -+ connectionView.previouslyExpandedItem = ""; -+ } - } - } - } -diff --git a/declarative-plugins/applet/connectionicon.cpp b/declarative-plugins/applet/connectionicon.cpp -index c3f8540..76bdca0 100644 ---- a/declarative-plugins/applet/connectionicon.cpp -+++ b/declarative-plugins/applet/connectionicon.cpp -@@ -166,12 +166,24 @@ void ConnectionIcon::setIcons() - - foreach (const NetworkManager::ActiveConnection::Ptr & active, actives) { - if (((active->default4() || active->default6()) && active->state() == NetworkManager::ActiveConnection::Activated) || !defaultRouteExists) { -+ NetworkManager::ActiveConnection::Ptr activeConnection; -+ if (active->vpn()) { -+ NetworkManager::ActiveConnection::Ptr activeTmp; -+ activeTmp = NetworkManager::findActiveConnection(active->specificObject()); -+ if (activeTmp) { -+ activeConnection = activeTmp; -+ } - -- if (active->vpn() || active->devices().isEmpty()) { -+ vpnFound = true; -+ NMAppletDebug() << "Emit signal setHoverIcon(object-locked)"; -+ Q_EMIT setHoverIcon("object-locked"); -+ } else { -+ activeConnection = active; -+ } -+ if (activeConnection->devices().isEmpty()) { - continue; - } -- -- NetworkManager::Device::Ptr device = NetworkManager::findNetworkInterface(active->devices().first()); -+ NetworkManager::Device::Ptr device = NetworkManager::findNetworkInterface(activeConnection->devices().first()); - if (device) { - NetworkManager::Device::Type type = device->type(); - -@@ -184,7 +196,7 @@ void ConnectionIcon::setIcons() - setWirelessIconForSignalStrength(100); - connectionFound = true; - } else { -- NetworkManager::AccessPoint::Ptr ap = wifiDevice->findAccessPoint(active->specificObject()); -+ NetworkManager::AccessPoint::Ptr ap = wifiDevice->findAccessPoint(activeConnection->specificObject()); - if (ap) { - setWirelessIcon(device, ap->ssid()); - connectionFound = true; -@@ -222,9 +234,7 @@ void ConnectionIcon::setIcons() - } - } - } -- } -- -- if (active->vpn() && active->state() == NetworkManager::ActiveConnection::Activated) { -+ } else if (active->vpn() && active->state() == NetworkManager::ActiveConnection::Activated) { - vpnFound = true; - NMAppletDebug() << "Emit signal setHoverIcon(object-locked)"; - Q_EMIT setHoverIcon("object-locked"); -diff --git a/declarative-plugins/applet/networkstatus.cpp b/declarative-plugins/applet/networkstatus.cpp -index d63066d..8149da9 100644 ---- a/declarative-plugins/applet/networkstatus.cpp -+++ b/declarative-plugins/applet/networkstatus.cpp -@@ -129,8 +129,8 @@ void NetworkStatus::changeTooltip() - } - - QString tooltip = ""; -- QString format = "%1 - %2
%3

"; -- QString formatDefault = "%1 - %2
%3

"; -+ const QString format = "%1 - %2
%3

"; -+ const QString formatDefault = "%1 - %2
%3

"; - - foreach (const NetworkManager::ActiveConnection::Ptr & active, NetworkManager::activeConnections()) { - if (!active->devices().isEmpty()) { -@@ -145,7 +145,6 @@ void NetworkStatus::changeTooltip() - } else { - devName = device->ipInterfaceName(); - } --// conType = NetworkManager::ConnectionSettings::typeAsString(active->connection()->settings()->connectionType()); - if (active->vpn()) { - conType = i18n("VPN Connection"); - } else { -diff --git a/declarative-plugins/model/model.cpp b/declarative-plugins/model/model.cpp -index 1b3f4c3..bb88362 100644 ---- a/declarative-plugins/model/model.cpp -+++ b/declarative-plugins/model/model.cpp -@@ -230,7 +230,7 @@ void Model::addConnection(const QString& connection, const QString& device) - { - NetworkManager::Connection::Ptr con = NetworkManager::findConnection(connection); - -- if (con->settings()->isSlave()) { -+ if (con->settings()->isSlave() || con->name().isEmpty() || con->uuid().isEmpty()) { - return; - } - -@@ -395,7 +395,11 @@ void Model::removeWirelessNetwork(const QString& ssid, const QString& device) - if (wirelessDevice) { - accessPoint = wirelessDevice->findAccessPoint(item->specificPath()); - } -- if (accessPoint && accessPoint->mode() == NetworkManager::AccessPoint::Adhoc && -+ -+ // When accesspoint in ad-hoc mode dissapears, we should remove the item only when there is no connection. Similar case is when -+ // a wireless device is in AP mode, but in this case there could be only one visible AP and this should always be associated with some connection. -+ if (accessPoint && ((accessPoint->mode() == NetworkManager::AccessPoint::Adhoc && !item->connectionPath().isEmpty()) || -+ wirelessDevice->mode() == NetworkManager::WirelessDevice::ApMode) && - NetworkManager::isWirelessEnabled() && NetworkManager::isWirelessHardwareEnabled()) { - item->setWirelessNetwork(QString()); - if (updateItem(item)) { -diff --git a/declarative-plugins/model/modelitem.cpp b/declarative-plugins/model/modelitem.cpp -index 9a5931f..58d5c42 100644 ---- a/declarative-plugins/model/modelitem.cpp -+++ b/declarative-plugins/model/modelitem.cpp -@@ -151,6 +151,17 @@ QString ModelItem::icon() const - break; - case NetworkManager::ConnectionSettings::Wireless: - if (m_signal == 0 ) { -+ if (!m_connectionPath.isEmpty()) { -+ NetworkManager::Connection::Ptr con = NetworkManager::findConnection(m_connectionPath); -+ if (con) { -+ NetworkManager::WirelessSetting::Ptr wirelessSetting; -+ wirelessSetting = con->settings()->setting(NetworkManager::Setting::Wireless).dynamicCast(); -+ if (wirelessSetting && (wirelessSetting->mode() == NetworkManager::WirelessSetting::Adhoc || -+ wirelessSetting->mode() == NetworkManager::WirelessSetting::Ap)) { -+ return "network-wireless-100"; -+ } -+ } -+ } - return "network-wireless-00"; - } else if (m_signal < 20) { - return "network-wireless-20"; -diff --git a/kded/bluetoothmonitor.cpp b/kded/bluetoothmonitor.cpp -index 2221d09..5d0218b 100644 ---- a/kded/bluetoothmonitor.cpp -+++ b/kded/bluetoothmonitor.cpp -@@ -220,6 +220,7 @@ void BluetoothMonitor::init() - - mDunDevice = reply.value(); - } -+ - #if WITH_MODEMMANAGER_SUPPORT - void BluetoothMonitor::modemAdded(const QString &udi) - { -diff --git a/lib/editor/bridgewidget.cpp b/lib/editor/bridgewidget.cpp -index 8815eb2..95344c4 100644 ---- a/lib/editor/bridgewidget.cpp -+++ b/lib/editor/bridgewidget.cpp -@@ -216,5 +216,5 @@ void BridgeWidget::populateBridges() - - bool BridgeWidget::isValid() const - { -- return !m_ui->ifaceName->text().isEmpty() && m_ui->bridges->count() > 0; -+ return !m_ui->ifaceName->text().isEmpty(); - } -diff --git a/vpn/vpnc/vpnc.cpp b/vpn/vpnc/vpnc.cpp -index d4a511d..645249d 100644 ---- a/vpn/vpnc/vpnc.cpp -+++ b/vpn/vpnc/vpnc.cpp -@@ -145,7 +145,6 @@ NMVariantMapMap VpncUiPlugin::importConnectionSettings(const QString &fileName) - KConfigGroup cg(config, "main"); // Keys&Values are stored under [main] - if (cg.exists()) { - // Setup cisco-decrypt binary to decrypt the passwords -- QStringList decrArgs; - const QString ciscoDecryptBinary = KStandardDirs::findExe("cisco-decrypt", QString::fromLocal8Bit(qgetenv("PATH")) + ":/usr/lib/vpnc"); - if (ciscoDecryptBinary.isEmpty()) { - mErrorMessage = i18n("Needed executable cisco-decrypt could not be found."); -@@ -174,11 +173,11 @@ NMVariantMapMap VpncUiPlugin::importConnectionSettings(const QString &fileName) - } - else if (!decrPlugin->readStringKeyValue(cg,"enc_UserPassword").isEmpty() && !ciscoDecryptBinary.isEmpty()) { - // Decrypt the password and insert into map -- decrArgs.clear(); -- decrArgs << decrPlugin->readStringKeyValue(cg,"enc_UserPassword"); -- decrPlugin->ciscoDecrypt->setProgram(ciscoDecryptBinary, decrArgs); -+ decrPlugin->ciscoDecrypt->setProgram(ciscoDecryptBinary); - decrPlugin->ciscoDecrypt->start(); -- if (decrPlugin->ciscoDecrypt->waitForStarted() && decrPlugin->ciscoDecrypt->waitForFinished()) { -+ decrPlugin->ciscoDecrypt->waitForStarted(); -+ decrPlugin->ciscoDecrypt->write(decrPlugin->readStringKeyValue(cg,"enc_UserPassword").toUtf8()); -+ if (decrPlugin->ciscoDecrypt->waitForFinished()) { - secretData.insert(NM_VPNC_KEY_XAUTH_PASSWORD, decrPlugin->decryptedPasswd); - } - } -@@ -203,11 +202,11 @@ NMVariantMapMap VpncUiPlugin::importConnectionSettings(const QString &fileName) - } - else if (!decrPlugin->readStringKeyValue(cg,"enc_GroupPwd").isEmpty() && !ciscoDecryptBinary.isEmpty()) { - //Decrypt the password and insert into map -- decrArgs.clear(); -- decrArgs << decrPlugin->readStringKeyValue(cg,"enc_GroupPwd"); -- decrPlugin->ciscoDecrypt->setProgram(ciscoDecryptBinary, decrArgs); -+ decrPlugin->ciscoDecrypt->setProgram(ciscoDecryptBinary); - decrPlugin->ciscoDecrypt->start(); -- if (decrPlugin->ciscoDecrypt->waitForStarted() && decrPlugin->ciscoDecrypt->waitForFinished()) { -+ decrPlugin->ciscoDecrypt->waitForStarted(); -+ decrPlugin->ciscoDecrypt->write(decrPlugin->readStringKeyValue(cg,"enc_GroupPwd").toUtf8()); -+ if (decrPlugin->ciscoDecrypt->waitForFinished()) { - secretData.insert(NM_VPNC_KEY_SECRET, decrPlugin->decryptedPasswd); - data.insert(NM_VPNC_KEY_SECRET"-flags", QString::number(NetworkManager::Setting::AgentOwned)); - } diff --git a/kde/patch/plasma5-nm/plasma-nm_modemmanager-qt_api.patch b/kde/patch/plasma5-nm/plasma-nm_modemmanager-qt_api.patch deleted file mode 100644 index 4c59f4c..0000000 --- a/kde/patch/plasma5-nm/plasma-nm_modemmanager-qt_api.patch +++ /dev/null @@ -1,73 +0,0 @@ -From: Jan Grulich -Date: Tue, 31 Mar 2015 12:37:16 +0000 -Subject: Adapt to modemmanager-qt API changes -X-Git-Url: http://quickgit.kde.org/?p=plasma-nm.git&a=commitdiff&h=4d72cb7966edda33bc72c77fc2a126844fc1f134 ---- -Adapt to modemmanager-qt API changes ---- - - ---- a/libs/models/networkmodel.cpp -+++ b/libs/models/networkmodel.cpp -@@ -246,10 +246,10 @@ - if (modem->hasInterface(ModemManager::ModemDevice::ModemInterface)) { - ModemManager::Modem::Ptr modemNetwork = modem->interface(ModemManager::ModemDevice::ModemInterface).objectCast(); - if (modemNetwork) { -- connect(modemNetwork.data(), SIGNAL(signalQualityChanged(uint)), -- SLOT(gsmNetworkSignalQualityChanged(uint)), Qt::UniqueConnection); -- connect(modemNetwork.data(), SIGNAL(accessTechnologyChanged(ModemManager::Modem::AccessTechnologies)), -- SLOT(gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies)), Qt::UniqueConnection); -+ connect(modemNetwork.data(), SIGNAL(signalQualityChanged(ModemManager::SignalQualityPair)), -+ SLOT(gsmNetworkSignalQualityChanged(ModemManager::SignalQualityPair)), Qt::UniqueConnection); -+ connect(modemNetwork.data(), SIGNAL(accessTechnologiesChanged(QFlags)), -+ SLOT(gsmNetworkAccessTechnologiesChanged(QFlags)), Qt::UniqueConnection); - connect(modemNetwork.data(), SIGNAL(currentModesChanged()), - SLOT(gsmNetworkCurrentModesChanged()), Qt::UniqueConnection); - } -@@ -847,9 +847,9 @@ - } - - #if WITH_MODEMMANAGER_SUPPORT --void NetworkModel::gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies technology) --{ -- Q_UNUSED(technology); -+void NetworkModel::gsmNetworkAccessTechnologiesChanged(QFlags accessTechnologies) -+{ -+ Q_UNUSED(accessTechnologies); - ModemManager::Modem * gsmNetwork = qobject_cast(sender()); - if (gsmNetwork) { - Q_FOREACH (const NetworkManager::Device::Ptr & dev, NetworkManager::networkInterfaces()) { -@@ -893,7 +893,7 @@ - } - } - --void NetworkModel::gsmNetworkSignalQualityChanged(uint signal) -+void NetworkModel::gsmNetworkSignalQualityChanged(const ModemManager::SignalQualityPair &signalQuality) - { - ModemManager::Modem * gsmNetwork = qobject_cast(sender()); - if (gsmNetwork) { -@@ -905,7 +905,7 @@ - ModemManager::Modem::Ptr modemNetwork = modem->interface(ModemManager::ModemDevice::ModemInterface).objectCast(); - if (modemNetwork && modemNetwork->device() == gsmNetwork->device()) { - Q_FOREACH (NetworkModelItem * item, m_list.returnItems(NetworkItemsList::Device, dev->uni())) { -- item->setSignal(signal); -+ item->setSignal(signalQuality.signal); - updateItem(item); - } - } - ---- a/libs/models/networkmodel.h -+++ b/libs/models/networkmodel.h -@@ -94,9 +94,9 @@ - void deviceRemoved(const QString& device); - void deviceStateChanged(NetworkManager::Device::State state, NetworkManager::Device::State oldState, NetworkManager::Device::StateChangeReason reason); - #if WITH_MODEMMANAGER_SUPPORT -- void gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies technology); -+ void gsmNetworkAccessTechnologiesChanged(QFlags accessTechnologies); - void gsmNetworkCurrentModesChanged(); -- void gsmNetworkSignalQualityChanged(uint signal); -+ void gsmNetworkSignalQualityChanged(const ModemManager::SignalQualityPair &signalQuality); - #endif - void ipConfigChanged(); - void ipInterfaceChanged(); - diff --git a/kde/patch/plasma5-nm/plasma-nm_networkmanager.patch b/kde/patch/plasma5-nm/plasma-nm_networkmanager.patch deleted file mode 100644 index e635954..0000000 --- a/kde/patch/plasma5-nm/plasma-nm_networkmanager.patch +++ /dev/null @@ -1,17 +0,0 @@ -Patch taken from gentoo: -https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd7dad9ddb35e1e3e68ad43176c5e48fbb25338d - -Fixes build with networkmanager-1.0.6. - -Triggered by http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-1-0&id=6f616d4c4b04d5478f60d0311317bc84c5459ea4. - ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -49,6 +49,7 @@ - ${CMAKE_CURRENT_SOURCE_DIR}/libs - ${CMAKE_CURRENT_SOURCE_DIR}/libs/editor/ - ${NETWORKMANAGER_INCLUDE_DIRS} -+ ${NM-UTIL_INCLUDE_DIRS} - ${NETWORKMANAGERQT_INCLUDE_DIRS} - ${KDE4_INCLUDES}) - diff --git a/kde/patch/plasma5-nm/plasma5-nm_KDEBUG_423093.patch b/kde/patch/plasma5-nm/plasma5-nm_KDEBUG_423093.patch deleted file mode 100644 index 53ea613..0000000 --- a/kde/patch/plasma5-nm/plasma5-nm_KDEBUG_423093.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 271332cfc19ede398854113d037abfb35503179f Mon Sep 17 00:00:00 2001 -From: Nate Graham -Date: Thu, 18 Jun 2020 15:34:40 +0000 -Subject: [PATCH] [WIP] [applet] Fix inline password field component not - working properly - -BUG: 423093 -FIXED-IN: 5.20 ---- - applet/contents/ui/ConnectionItem.qml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/applet/contents/ui/ConnectionItem.qml b/applet/contents/ui/ConnectionItem.qml -index 98240928..06c7ab25 100644 ---- a/applet/contents/ui/ConnectionItem.qml -+++ b/applet/contents/ui/ConnectionItem.qml -@@ -231,8 +231,8 @@ PlasmaExtras.ExpandableListItem { - if (!predictableWirelessPassword && !Uuid) { - handler.addAndActivateConnection(DevicePath, SpecificPath) - } else if (connectionItem.customExpandedViewContent == passwordDialogComponent) { -- if (passwordDialogComponent.password != "") { -- handler.addAndActivateConnection(DevicePath, SpecificPath, passwordDialogComponent.password) -+ if (connectionItem.customExpandedViewContentItem.password != "") { -+ handler.addAndActivateConnection(DevicePath, SpecificPath, connectionItem.customExpandedViewContentItem.password) - connectionItem.customExpandedViewContent = detailsComponent - connectionItem.collapse() - } else { --- -2.27.0 - - diff --git a/kde/patch/powerdevil.patch b/kde/patch/powerdevil.patch deleted file mode 100644 index b7e2bae..0000000 --- a/kde/patch/powerdevil.patch +++ /dev/null @@ -1,4 +0,0 @@ -# PowerDevil fails to setup power settings on a fresh install. -# Fixed in 5.12.5. -#cat $CWD/patch/powerdevil/powerdevil-5.12.4_firstrun.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/powerdevil/powerdevil-5.12.4_firstrun.patch b/kde/patch/powerdevil/powerdevil-5.12.4_firstrun.patch deleted file mode 100644 index 165e67b..0000000 --- a/kde/patch/powerdevil/powerdevil-5.12.4_firstrun.patch +++ /dev/null @@ -1,42 +0,0 @@ -From be91abe7fc8cc731b57bec4cf2c004c07b0fd79b Mon Sep 17 00:00:00 2001 -From: Kai Uwe Broulik -Date: Wed, 25 Apr 2018 10:56:16 +0200 -Subject: Ignore "migration" key for determining whether the config is empty - -Otherwise we would never generate the default power management configuration -leading to it not suspending on lid close, not handling power buttons etc etc - -CHANGELOG: Fixed bug that caused power management system to not work on a fresh install - -Reviewed-By: David Edmundson - -BUG: 391782 -FIXED-IN: 5.12.5 ---- - daemon/powerdevilcore.cpp | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp -index 2cf936e..53b7521 100644 ---- a/daemon/powerdevilcore.cpp -+++ b/daemon/powerdevilcore.cpp -@@ -108,9 +108,15 @@ void Core::onBackendReady() - - m_profilesConfig = KSharedConfig::openConfig("powermanagementprofilesrc", KConfig::CascadeConfig); - -+ QStringList groups = m_profilesConfig->groupList(); -+ // the "migration" key is for shortcuts migration in added by migratePre512KeyboardShortcuts -+ // and as such our configuration would never be considered empty, ignore it! -+ groups.removeOne(QStringLiteral("migration")); -+ - // Is it brand new? -- if (m_profilesConfig->groupList().isEmpty()) { -+ if (groups.isEmpty()) { - // Generate defaults -+ qCDebug(POWERDEVIL) << "Generating a default configuration"; - bool toRam = m_backend->supportedSuspendMethods() & PowerDevil::BackendInterface::ToRam; - bool toDisk = m_backend->supportedSuspendMethods() & PowerDevil::BackendInterface::ToDisk; - ProfileGenerator::generateProfiles(toRam, toDisk); --- -cgit v0.11.2 - diff --git a/kde/patch/pykde4.patch b/kde/patch/pykde4.patch index 48073d4..d5eb044 100644 --- a/kde/patch/pykde4.patch +++ b/kde/patch/pykde4.patch @@ -2,4 +2,3 @@ cat $CWD/patch/pykde4/0001-use-LIB_PYTHON-realpath.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } cat $CWD/patch/pykde4/0002-Add-some-missing-link-libraries.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } cat $CWD/patch/pykde4/0003-Fix-build-with-sip-4.19.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/qqc2-desktop-style.patch b/kde/patch/qqc2-desktop-style.patch deleted file mode 100644 index 36e0bb1..0000000 --- a/kde/patch/qqc2-desktop-style.patch +++ /dev/null @@ -1,5 +0,0 @@ -# Use scrollbar height as bottom padding, not width. -# Should be fixed post qqc2-desktop-style 5.67.0): -#cat $CWD/patch/qqc2-desktop-style/qqc2-desktop-style_scrollbar.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - - diff --git a/kde/patch/qqc2-desktop-style/qqc2-desktop-style_scrollbar.patch b/kde/patch/qqc2-desktop-style/qqc2-desktop-style_scrollbar.patch deleted file mode 100644 index 9f577e2..0000000 --- a/kde/patch/qqc2-desktop-style/qqc2-desktop-style_scrollbar.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 6995b4ae81a2f3ca3c24d2fa6d1560bfe0898737 Mon Sep 17 00:00:00 2001 -From: Arjen Hiemstra -Date: Mon, 10 Feb 2020 11:47:00 +0100 -Subject: ScrollView: Use scrollbar height as bottom padding, not width - -Summary: -Apparently I accidentally used the bottom scrollbar width instead of -height. Oops. - -Test Plan: ScrollView with horizontal scrollbar no longer hides content - -Reviewers: #plasma, davidedmundson - -Reviewed By: #plasma, davidedmundson - -Subscribers: plasma-devel - -Tags: #plasma - -Differential Revision: https://phabricator.kde.org/D27280 ---- - org.kde.desktop/ScrollView.qml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/org.kde.desktop/ScrollView.qml b/org.kde.desktop/ScrollView.qml -index 4bea5c7..38bc8ed 100644 ---- a/org.kde.desktop/ScrollView.qml -+++ b/org.kde.desktop/ScrollView.qml -@@ -45,7 +45,7 @@ T.ScrollView { - rightPadding: (internal.backgroundVisible && background.hasOwnProperty("rightPadding") ? background.rightPadding : 0) - + (!LayoutMirroring.enabled ? internal.verticalScrollBarWidth : 0) - bottomPadding: (internal.backgroundVisible && background.hasOwnProperty("bottomPadding") ? background.bottomPadding : 0) -- + internal.horizontalScrollBarWidth -+ + internal.horizontalScrollBarHeight - - //create a background only after Component.onCompleted, see on the component creation below for explanation - Component.onCompleted: { -@@ -97,7 +97,7 @@ T.ScrollView { - - readonly property bool backgroundVisible: controlRoot.background && controlRoot.background.visible - readonly property real verticalScrollBarWidth: controlRoot.ScrollBar.vertical.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.vertical.width : 0 -- readonly property real horizontalScrollBarWidth: controlRoot.ScrollBar.horizontal.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.horizontal.width : 0 -+ readonly property real horizontalScrollBarHeight: controlRoot.ScrollBar.horizontal.visible && !Kirigami.Settings.tabletMode ? controlRoot.ScrollBar.horizontal.height : 0 - } - ] - ScrollBar.vertical: ScrollBar { --- -cgit v1.1 - - - diff --git a/kde/patch/sddm-theme-breeze.patch b/kde/patch/sddm-theme-breeze.patch deleted file mode 100644 index c500dba..0000000 --- a/kde/patch/sddm-theme-breeze.patch +++ /dev/null @@ -1,2 +0,0 @@ -# SDDM changed its location for the themes: -#cat $CWD/patch/sddm-theme-breeze/sddm-theme-breeze_path.diff | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } diff --git a/kde/patch/sddm-theme-breeze/sddm-theme-breeze_path.diff b/kde/patch/sddm-theme-breeze/sddm-theme-breeze_path.diff deleted file mode 100644 index 96817ad..0000000 --- a/kde/patch/sddm-theme-breeze/sddm-theme-breeze_path.diff +++ /dev/null @@ -1,10 +0,0 @@ -diff -uar sddm-theme-breeze-20140601.orig/CMakeLists.txt sddm-theme-breeze-20140601/CMakeLists.txt ---- sddm-theme-breeze-20140601.orig/CMakeLists.txt 2014-06-01 05:19:59.000000000 +0200 -+++ sddm-theme-breeze-20140601/CMakeLists.txt 2014-09-15 14:08:36.883149093 +0200 -@@ -3,5 +3,5 @@ - message("This cmake file does some weird stuff for the neon ISO") - message("unless you are Rohan or Harold turn back now and revert this commit") - --INSTALL(DIRECTORY breeze DESTINATION ${CMAKE_INSTALL_PREFIX}/share/apps/sddm/themes/) -+INSTALL(DIRECTORY breeze DESTINATION ${CMAKE_INSTALL_PREFIX}/share/sddm/themes/) - INSTALL(FILES plasmarc DESTINATION /var/lib/sddm/.config) diff --git a/kde/patch/spectacle.patch b/kde/patch/spectacle.patch deleted file mode 100644 index 9ab4616..0000000 --- a/kde/patch/spectacle.patch +++ /dev/null @@ -1,7 +0,0 @@ -# Fix for broken HiDPI support. -# Fixed post Applications 16.04.0: -#cat $CWD/patch/spectacle/spectacle_hidpi.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } -# Fix for broken rectangular image capture on Nvidia GPU (KDEBUG 362241): -# Fixed post Applications 16.04.0: -#cat $CWD/patch/spectacle/spectacle_rect_capture.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/spectacle/spectacle_hidpi.patch b/kde/patch/spectacle/spectacle_hidpi.patch deleted file mode 100644 index 19cf923..0000000 --- a/kde/patch/spectacle/spectacle_hidpi.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/src/QuickEditor/EditorRoot.qml -+++ b/src/QuickEditor/EditorRoot.qml -@@ -36,10 +36,10 @@ - } - - selection = cropRectangle.createObject(parent, { -- "x": xx, -- "y": yy, -+ "x": xx, -+ "y": yy, - "height": hh, -- "width": ww -+ "width": ww - }); - - cropDisplayCanvas.requestPaint(); -@@ -73,8 +73,8 @@ - source: "image://snapshot/rawimage"; - cache: false; - -- height: Window.height; -- width: Window.width; -+ height: Window.height / Screen.devicePixelRatio; -+ width: Window.width / Screen.devicePixelRatio; - fillMode: Image.PreserveAspectFit; - } - - diff --git a/kde/patch/spectacle/spectacle_rect_capture.patch b/kde/patch/spectacle/spectacle_rect_capture.patch deleted file mode 100644 index 8556674..0000000 --- a/kde/patch/spectacle/spectacle_rect_capture.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Boudhayan Gupta -Date: Mon, 25 Apr 2016 18:27:49 +0000 -Subject: Unbreak rectangular image grabs for nvidia users. -X-Git-Url: http://quickgit.kde.org/?p=spectacle.git&a=commitdiff&h=abbbe6d13de870f9e9349acc2542cffc5d41b76d ---- -Unbreak rectangular image grabs for nvidia users. - -BUG: 362241 -FIXED-IN: 16.04.1 -Patch rebased for Slackware (did not apply cleanly) ---- - - -diff -uar spectacle-16.04.0.orig/src/QuickEditor/QuickEditor.cpp spectacle-16.04.0/src/QuickEditor/QuickEditor.cpp ---- spectacle-16.04.0.orig/src/QuickEditor/QuickEditor.cpp 2016-04-13 18:54:34.000000000 +0200 -+++ spectacle-16.04.0/src/QuickEditor/QuickEditor.cpp 2016-05-02 12:25:49.554524405 +0200 -@@ -138,23 +138,6 @@ - d->mGrabRect = QRect(x, y, width, height); - SpectacleConfig::instance()->setCropRegion(d->mGrabRect); - -- QQuickItem *target = d->mQuickView->rootObject()->findChild(QStringLiteral("imageBackground")); -- d->mCurrentGrabResult = target->grabToImage(); -- if (d->mCurrentGrabResult.isNull()) { -- emit grabCancelled(); -- return; -- } -- -- connect(d->mCurrentGrabResult.data(), &QQuickItemGrabResult::ready, this, &QuickEditor::grabReadyHandler); --} -- --void QuickEditor::grabReadyHandler() --{ -- Q_D(QuickEditor); -- -- QImage croppedImage = d->mCurrentGrabResult->image().copy(d->mGrabRect); -- QPixmap croppedPixmap = QPixmap::fromImage(croppedImage); -- - d->mQuickView->hide(); -- emit grabDone(croppedPixmap, d->mGrabRect); -+ emit grabDone(mImageStore->mPixmap.copy(d->mGrabRect), d->mGrabRect); - } -diff -uar spectacle-16.04.0.orig/src/QuickEditor/QuickEditor.h spectacle-16.04.0/src/QuickEditor/QuickEditor.h ---- spectacle-16.04.0.orig/src/QuickEditor/QuickEditor.h 2016-04-13 18:54:34.000000000 +0200 -+++ spectacle-16.04.0/src/QuickEditor/QuickEditor.h 2016-05-02 12:22:48.124516811 +0200 -@@ -39,7 +39,6 @@ - private slots: - - void acceptImageHandler(int x, int y, int width, int height); -- void grabReadyHandler(); - - private: - diff --git a/kde/patch/strigi-multimedia.patch b/kde/patch/strigi-multimedia.patch index aebad0d..77b9424 100644 --- a/kde/patch/strigi-multimedia.patch +++ b/kde/patch/strigi-multimedia.patch @@ -1,3 +1,2 @@ # Fix build: cat $CWD/patch/strigi-multimedia/strigi-multimedia_port.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/umbrello.patch b/kde/patch/umbrello.patch deleted file mode 100644 index 641688c..0000000 --- a/kde/patch/umbrello.patch +++ /dev/null @@ -1,10 +0,0 @@ -# Fix compilation error (undefined listitem in classifierlistpage.cpp) -# Fixed post KDE 4.11.4 in -# http://quickgit.kde.org/?p=umbrello.git&a=commit&h=5f9f6a68716a8aced2c5f962247d9b05b326fcf5 -#cat $CWD/patch/umbrello/umbrello-4.11.4_listitem.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - -# Fix compilation error "specialization of template struct QMetaTypeId in different namespace [-fpermissive]". -# Fixed in Applications 18.12.0 -# https://cgit.kde.org/umbrello.git/patch/?id=62a9e5e6afdd920779f1211afb0381857659e578 -#cat $CWD/patch/umbrello/umbrello_qt510_kaboutdata_h.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } - diff --git a/kde/patch/umbrello/umbrello-4.11.4_listitem.patch b/kde/patch/umbrello/umbrello-4.11.4_listitem.patch deleted file mode 100644 index f5cb615..0000000 --- a/kde/patch/umbrello/umbrello-4.11.4_listitem.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/umbrello/dialogs/classifierlistpage.cpp -+++ b/umbrello/dialogs/classifierlistpage.cpp -@@ -346,7 +346,7 @@ - } - - if (itemIndex >= 0 && (itemIndex < getItemList().size())) { -- listItem = getItemList().at( itemIndex ); -+ UMLClassifierListItem* listItem = getItemList().at( itemIndex ); - - //now update screen - m_docTE->setText( listItem->doc() ); - - diff --git a/kde/patch/umbrello/umbrello_qt510_kaboutdata_h.patch b/kde/patch/umbrello/umbrello_qt510_kaboutdata_h.patch deleted file mode 100644 index a27b0ed..0000000 --- a/kde/patch/umbrello/umbrello_qt510_kaboutdata_h.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 62a9e5e6afdd920779f1211afb0381857659e578 Mon Sep 17 00:00:00 2001 -From: Ralf Habacker -Date: Thu, 6 Dec 2018 13:36:34 +0100 -Subject: Fix KDE CI compile error with Qt 5.10 on linux - -The error was "specialization of template -struct QMetaTypeId in different namespace [-fpermissive]" - -The Qt 5.10 related issue is fixed by using another approach -to exclude KF5 class KAboutData. ---- - umbrello/main.cpp | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/umbrello/main.cpp b/umbrello/main.cpp -index e3315fa..9d2acd8 100644 ---- a/umbrello/main.cpp -+++ b/umbrello/main.cpp -@@ -19,9 +19,8 @@ - - // kde includes - #if QT_VERSION > 0x050000 --namespace dummy { --#include --} -+// prevent including of -+#define KABOUTDATA_H - #include - #define KAboutData K4AboutData - #include --- -cgit v0.11.2 - -- cgit v1.2.3