Commit 0fb1ddd6 authored by Jenkins's avatar Jenkins

New upstream version 0.0+git20190126

parent 1aa0eea4
{
"phabricator.uri": "https://phabricator.kde.org"
}
project(Koko)
cmake_minimum_required(VERSION 2.8.12)
find_package(ECM 0.0.9 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH})
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Widgets Test Sql Positioning)
find_package(KF5 5.5 REQUIRED COMPONENTS I18n Declarative Config DBusAddons KIO GuiAddons CoreAddons Notifications IconThemes)
find_package(Exiv2 0.21 REQUIRED)
include(FeatureSummary)
include(ECMAddTests)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(GenerateExportHeader)
include(ECMInstallIcons)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/src
${EXIV2_INCLUDE_DIR}
)
kde_enable_exceptions()
add_subdirectory(src)
add_subdirectory(autotests)
add_subdirectory(qml)
add_subdirectory(icons)
install(FILES org.kde.koko.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
This diff is collapsed.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed.
ecm_add_test(reversegeocodertest.cpp ../src/reversegeocoder.cpp ../src/kdtree.c
TEST_NAME "reversegeocodertest"
LINK_LIBRARIES Qt5::Test
)
/*
* Copyright (C) 2015 Vishesh Handa <vhanda@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <QTest>
#include <QSignalSpy>
#include <QDebug>
#include <QCoreApplication>
#include <QTime>
#include "reversegeocoder.h"
class ReverseGeoCoderTest : public QObject
{
Q_OBJECT
private slots:
void testSimple();
};
using namespace Koko;
void ReverseGeoCoderTest::testSimple()
{
QCoreApplication::instance()->setApplicationName("koko");
ReverseGeoCoder coder;
QCOMPARE(coder.initialized(), false);
coder.init();
QCOMPARE(coder.initialized(), true);
double lat = 52.54877605;
double lon = -1.81627023283164;
QVariantMap data = coder.lookup(lat, lon);
QCOMPARE(data.value("country").toString(), QString("United Kingdom"));
QCOMPARE(data.value("admin1").toString(), QString("England"));
QCOMPARE(data.value("admin2").toString(), QString("City and Borough of Birmingham"));
}
QTEST_MAIN(ReverseGeoCoderTest)
#include "reversegeocodertest.moc"
# - Try to find the Exiv2 library
#
# EXIV2_MIN_VERSION - You can set this variable to the minimum version you need
# before doing FIND_PACKAGE(Exiv2). The default is 0.12.
#
# Once done this will define
#
# EXIV2_FOUND - system has libexiv2
# EXIV2_INCLUDE_DIR - the libexiv2 include directory
# EXIV2_LIBRARIES - Link these to use libexiv2
# EXIV2_DEFINITIONS - Compiler switches required for using libexiv2
#
# The minimum required version of Exiv2 can be specified using the
# standard syntax, e.g. find_package(Exiv2 0.17)
#
# For compatibility, also the variable EXIV2_MIN_VERSION can be set to the minimum version
# you need before doing FIND_PACKAGE(Exiv2). The default is 0.12.
# Copyright (c) 2010, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Support EXIV2_MIN_VERSION for compatibility:
if(NOT Exiv2_FIND_VERSION)
set(Exiv2_FIND_VERSION "${EXIV2_MIN_VERSION}")
endif(NOT Exiv2_FIND_VERSION)
# the minimum version of exiv2 we require
if(NOT Exiv2_FIND_VERSION)
set(Exiv2_FIND_VERSION "0.12")
endif(NOT Exiv2_FIND_VERSION)
if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_EXIV2 QUIET exiv2)
set(EXIV2_DEFINITIONS ${PC_EXIV2_CFLAGS_OTHER})
endif (NOT WIN32)
find_path(EXIV2_INCLUDE_DIR NAMES exiv2/exif.hpp
HINTS
${PC_EXIV2_INCLUDEDIR}
${PC_EXIV2_INCLUDE_DIRS}
)
find_library(EXIV2_LIBRARY NAMES exiv2 libexiv2
HINTS
${PC_EXIV2_LIBDIR}
${PC_EXIV2_LIBRARY_DIRS}
)
# Get the version number from exiv2/version.hpp and store it in the cache:
if(EXIV2_INCLUDE_DIR AND NOT EXIV2_VERSION)
file(READ ${EXIV2_INCLUDE_DIR}/exiv2/version.hpp EXIV2_VERSION_CONTENT)
string(REGEX MATCH "#define EXIV2_MAJOR_VERSION +\\( *([0-9]+) *\\)" _dummy "${EXIV2_VERSION_CONTENT}")
set(EXIV2_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define EXIV2_MINOR_VERSION +\\( *([0-9]+) *\\)" _dummy "${EXIV2_VERSION_CONTENT}")
set(EXIV2_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define EXIV2_PATCH_VERSION +\\( *([0-9]+) *\\)" _dummy "${EXIV2_VERSION_CONTENT}")
set(EXIV2_VERSION_PATCH "${CMAKE_MATCH_1}")
set(EXIV2_VERSION "${EXIV2_VERSION_MAJOR}.${EXIV2_VERSION_MINOR}.${EXIV2_VERSION_PATCH}" CACHE STRING "Version number of Exiv2" FORCE)
endif(EXIV2_INCLUDE_DIR AND NOT EXIV2_VERSION)
set(EXIV2_LIBRARIES "${EXIV2_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Exiv2 REQUIRED_VARS EXIV2_LIBRARY EXIV2_INCLUDE_DIR
VERSION_VAR EXIV2_VERSION)
mark_as_advanced(EXIV2_INCLUDE_DIR EXIV2_LIBRARY)
include: 'https://gitlab.com/debian-pm/tools/build/raw/master/docker/gitlab-ci-base.yml'
image: jbbgameich/build
koko (0.0+git20190126-1) UNRELEASED; urgency=medium
[ Harald Sitter ]
* Initial release.
[ Jonah Brüchert ]
* New snapshot.
-- Jonah Brüchert <jbb@kaidan.im> Sat, 26 Jan 2019 19:06:14 +0100
Source: koko
Section: kde
Priority: optional
Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
XSBC-Original-Maintainer: Debian/Kubuntu KDE Extras Team <pkg-kde-extras@lists.alioth.debian.org>
Build-Depends: baloo-kf5-dev,
cmake (>= 2.6.2),
debhelper (>= 11),
extra-cmake-modules,
libexiv2-dev (>= 0.21),
libkf5config-dev,
libkf5declarative-dev,
libkf5filemetadata-dev,
libkf5i18n-dev,
libkf5notifications-dev,
libkf5plasma-dev,
pkg-config,
pkg-kde-tools (>= 0.12),
qtbase5-dev,
qtdeclarative5-dev,
qtpositioning5-dev,
wget
Standards-Version: 4.1.4
XS-Testsuite: autopkgtest
Vcs-Browser: https://gitlab.com/debian-pm/apps/koko
Vcs-Git: https://gitlab.com/debian-pm/apps/koko.git
Package: koko
Architecture: any
Depends: plasma-framework,
qml-module-org-kde-kirigami2,
qml-module-org-kde-purpose,
qml-module-qtgraphicaleffects,
${misc:Depends},
${shlibs:Depends}
Description: KDE Image Gallery
A KDE Image Gallery.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: koko
Source: https://projects.kde.org/koko
Files: *
Copyright: 2012-2015, Vishesh Handa <vhanda@kde.org>
License: LGPL-2.1+
Files: debian/*
Copyright: 2015, Harald Sitter <sitter@kde.org>
License: LGPL-2.1+
Files: src/filesystemtracker.cpp
src/filesystemtracker.h
src/imagetimemodel.h
Copyright: 2017, Atul Sharma <atulsharma406@gmail.com>
2014, Vishesh Handa <me@vhanda.in>
License: LGPL-2.1+
Files: src/imagedocument.cpp
src/imagedocument.h
src/imagelistmodel.cpp
src/imagelistmodel.h
src/notificationmanager.cpp
src/notificationmanager.h
src/roles.cpp
src/roles.h
src/types.cpp
src/types.h
Copyright: 2017, Atul Sharma <atulsharma406@gmail.com>
License: LGPL-2+
Files: src/imagefoldermodel.cpp
src/imagefoldermodel.h
Copyright: 2017, Marco Martin <mart@kde.org>
2017, Atul Sharma <atulsharma406@gmail.com>
License: LGPL-2+
Files: src/imagelocationmodel.cpp
src/imagelocationmodel.h
src/imagestorage.cpp
src/imagetimemodel.cpp
src/main.cpp
src/sortmodel.cpp
src/sortmodel.h
Copyright: 2017, Atul Sharma <atulsharma406@gmail.com>
2014, Vishesh Handa <vhanda@kde.org>
License: LGPL-2.1+
Files: src/kdtree.c
src/kdtree.h
Copyright: 2007-2011, John Tsiombikas <nuclear@member.fsf.org>
License: BSD-3-clause
Files: src/processor.cpp
src/processor.h
src/tagmodel.cpp
src/tagmodel.h
Copyright: 2014, Vishesh Handa <me@vhanda.in>
License: LGPL-2.1+
Files: src/qmlplugins.cpp
src/qmlplugins.h
Copyright: 2013, 2014, Vishesh Handa <vhanda@kde.org>
License: LGPL-2.1 or LGPL-3
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
License: LGPL-2+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by the
Free Software Foundation; version 2 of the License, or (at
your option) any later version.
.
On Debian systems, the complete text of version 2 of the GNU Library
General Public License can be found in `/usr/share/common-licenses/LGPL-2'.
License: LGPL-2.1
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; version 2.1 of the License.
.
On Debian systems, the complete text of version 2.1 of the GNU Lesser
General Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
License: LGPL-2.1+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General Lesser
Public License version 2 can be found in "/usr/share/common-licenses/LGPL-2".
License: LGPL-3
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; version 3 of the License.
.
On Debian systems, the complete text of version 3 of the GNU Lesser
General Public License can be found in `/usr/share/common-licenses/LGPL-3'.
koko: package-name-doesnt-match-sonames libkokocommon
koko: shlib-without-versioned-soname usr/lib/*/libkokocommon.so libkokocommon.so
koko: postinst-must-call-ldconfig usr/lib/*/libkokocommon.so
#!/usr/bin/make -f
include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk
GEONAME_DATA_FILES := cities1000.zip admin1CodesASCII.txt admin2Codes.txt
GEONAME_DUMPS := $(addprefix debian/geonames/, $(GEONAME_DATA_FILES))
GEONAME_SRCS := $(addprefix src/, $(GEONAME_DATA_FILES))
debian/geonames/%:
mkdir -p debian/geonames/
cd debian/geonames/ && wget -q http://download.geonames.org/export/dump/$*
geonames_deploy: $(GEONAME_DUMPS)
cp -v $(GEONAME_DUMPS) src/
geonames_undeploy: $(GEONAME_DUMPS)
rm -rf $(GEONAME_SRCS)
override_dh_clean: geonames_undeploy
$(overridden_command)
override_dh_auto_configure: geonames_deploy
$(overridden_command)
.PHONY: geonames_deploy geonames_undeploy override_dh_clean override_dh_auto_configure override_dh_auto_test
debian/geonames/cities1000.zip
abort-on-upstream-changes
unapply-patches
Tests: testsuite
Depends: @builddeps@, build-essential,
Restrictions: rw-build-tree isolation-container
#!/bin/sh
if [ -d /usr/lib/ccache ]; then
export PATH="/usr/lib/ccache:$PATH"
fi
debian/rules clean 2>&1
dpkg-source --before-build .
debian/rules build 2>&1
debian/tests/testsuite.xsession
#!/bin/sh
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
[ -e debian/tests.home ] || mkdir debian/tests.home
HOME=debian/tests.home dh_auto_test
rm -rf debian/home/tests.home
ecm_install_icons(ICONS hi128-apps-koko.png DESTINATION ${ICON_INSTALL_DIR})
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>org.kde.koko.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Koko</name>
<name xml:lang="ca">Koko</name>
<name xml:lang="ca-valencia">Koko</name>
<name xml:lang="cs">Koko</name>
<name xml:lang="de">Koko</name>
<name xml:lang="en-GB">Koko</name>
<name xml:lang="es">Koko</name>
<name xml:lang="fr">Koko</name>
<name xml:lang="gl">Koko</name>
<name xml:lang="id">Koko</name>
<name xml:lang="it">Koko</name>
<name xml:lang="nl">Koko</name>
<name xml:lang="pt">Koko</name>
<name xml:lang="pt-BR">Koko</name>
<name xml:lang="sk">Koko</name>
<name xml:lang="sv">Koko</name>
<name xml:lang="uk">Koko</name>
<name xml:lang="x-test">xxKokoxx</name>
<name xml:lang="zh-CN">Koko</name>
<name xml:lang="zh-TW">Koko</name>
<summary>Image Gallery</summary>
<summary xml:lang="ca">Galeria d'imatges</summary>
<summary xml:lang="ca-valencia">Galeria d'imatges</summary>
<summary xml:lang="cs">Galerie obrázků</summary>
<summary xml:lang="de">Bildergalerie</summary>
<summary xml:lang="en-GB">Image Gallery</summary>
<summary xml:lang="es">Galería de imágenes</summary>
<summary xml:lang="fr">Galerie d'images</summary>
<summary xml:lang="gl">Galería de imaxes</summary>
<summary xml:lang="id">Galeri Image</summary>
<summary xml:lang="it">Galleria di immagini</summary>
<summary xml:lang="nl">Galerij van afbeeldingen</summary>
<summary xml:lang="pt">Galeria de Imagens</summary>
<summary xml:lang="pt-BR">Galeria de imagens</summary>
<summary xml:lang="sk">Galéria obrázkov</summary>
<summary xml:lang="sv">Bildgalleri</summary>
<summary xml:lang="uk">Галерея зображень</summary>
<summary xml:lang="x-test">xxImage Galleryxx</summary>
<summary xml:lang="zh-CN">图片库</summary>
<summary xml:lang="zh-TW">圖片庫</summary>
<description>
<p>An Image gallery application</p>
<p xml:lang="ca">Una aplicació de galeria d'imatges</p>
<p xml:lang="ca-valencia">Una aplicació de galeria d'imatges</p>
<p xml:lang="cs">Aplikace s galerií obrázků</p>
<p xml:lang="de">Ein Bildergalerie-Programm</p>
<p xml:lang="en-GB">An Image gallery application</p>
<p xml:lang="es">Aplicación para galerías de imágenes</p>
<p xml:lang="fr">Une application de galerie d'images</p>
<p xml:lang="gl">Aplicativo de galería de imaxes.</p>
<p xml:lang="id">Sebuah aplikasi galeri Image</p>
<p xml:lang="it">Un'applicazione per gallerie di immagini</p>
<p xml:lang="nl">Toepassing voor afbeeldingsgalerij</p>
<p xml:lang="pt">Uma aplicação de galeria de imagens</p>
<p xml:lang="pt-BR">Aplicativo de galeria de imagens</p>
<p xml:lang="sk">Aplikácia na galériu obrázkov</p>
<p xml:lang="sv">Ett bildgalleriprogram</p>
<p xml:lang="uk">Програма для роботи з галереями зображень</p>
<p xml:lang="x-test">xxAn Image gallery applicationxx</p>
<p xml:lang="zh-CN">一个图片库应用程序</p>
<p xml:lang="zh-TW">提供圖片庫功能的應用程式</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://userbase.kde.org/images.userbase/thumb/6/69/Koko-normal.png/380px-Koko-normal.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://userbase.kde.org/Koko</url>
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&amp;product=koko</url>
<url type="help">https://docs.kde.org/?application=koko</url>
<url type="donation">https://www.kde.org/donate.php?app=org.kde.koko</url>
<project_group>KDE</project_group>
<provides>
<binary>koko</binary>
</provides>
</component>
/*
* Copyright (C) 2017 Atul Sharma <atulsharma406@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* 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, see <http://www.gnu.org/licenses/>.
*
*/
import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls
import org.kde.kquickcontrolsaddons 2.0 as KQA
import org.kde.kirigami 2.1 as Kirigami
import org.kde.koko 0.1 as Koko
Item {
id: albumDelegate
width: gridView.cellWidth
height: gridView.cellHeight
Rectangle {
anchors {
fill: image
margins: -1
}
radius: 2
color: Kirigami.Theme.textColor
opacity: 0.2
visible: model.itemType != Koko.Types.Folder
}
KQA.QImageItem {
id: image
anchors.centerIn: parent
width: kokoConfig.iconSize
height: width
smooth: true
image: model.thumbnail
fillMode: KQA.QImageItem.PreserveAspectCrop
}
Rectangle {
anchors {
top: image.top
left: image.left
right: image.right
}
visible: textLabel.visible
width: image.width
height: textLabel.contentHeight + (Kirigami.Units.smallSpacing * 2)
color: Kirigami.Theme.viewBackgroundColor
opacity: 0.8
}
Controls.Label {
id: textLabel
anchors {
left: image.left
right: image.right
top: image.top
bottom: countRect.visible ? countRect.top : image.bottom
}
visible: model.itemType == Koko.Types.Folder || model.itemType == Koko.Types.Album
verticalAlignment: Text.AlignTop
padding: Kirigami.Units.smallSpacing
elide: Text.ElideRight
maximumLineCount: 4
wrapMode: Text.WordWrap
color: Kirigami.Theme.textColor
text: model.display
}
Rectangle {
id: countRect
anchors {
bottom: image.bottom
left: image.left
right: image.right
}
visible: model.fileCount && model.itemType == Koko.Types.Folder || model.itemType == Koko.Types.Album
height: countLabel.contentHeight + (Kirigami.Units.smallSpacing * 2)
color: Kirigami.Theme.viewBackgroundColor
opacity: 0.8
Controls.Label {
id: countLabel
padding: Kirigami.Units.smallSpacing
elide: Text.ElideRight
maximumLineCount: 4
wrapMode: Text.WordWrap
color: Kirigami.Theme.textColor
text: i18np("1 Image", "%1 Images", model.fileCount)
}
}
SelectionButton {
id: selectionButton
opacity: ( albumThumbnailMouseArea.containsMouse || iconMouseArea.containsMouse || page.state == "selecting") && !(model.itemType == Koko.Types.Folder || model.itemType == Koko.Types.Album)
Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
}
SelectionDelegateHighlight {
id: selectionHighlight
visible: model.selected
}
MouseArea {
id: albumThumbnailMouseArea
anchors.fill: parent
hoverEnabled: true
onPressAndHold: {
gridView.model.toggleSelected(model.index)
}
onClicked: {
if (page.state == "selecting" || (mouse.modifiers & Qt.ControlModifier ) && (model.itemType == Koko.Types.Image)) {
gridView.model.toggleSelected(model.index)
} else {
activate();
}
}
}
Keys.onPressed: {
switch (event.key) {
case Qt.Key_Enter:
case Qt.Key_Return:
case Qt.Key_Space:
activate();
break;
default:
break;
}
}
function activate( ) {
gridView.model.clearSelections()
gridView.currentIndex = model.index;
switch( model.itemType) {
case Koko.Types.Album: {
imageListModel.query = imageListModel.queryForIndex( model.sourceIndex)
sortedListModel.sourceModel = imageListModel
collectionSelected( sortedListModel, model.display)
break;
}
case Koko.Types.Folder: {
imageFolderModel.url = model.imageurl
sortedListModel.sourceModel = imageFolderModel
folderSelected( sortedListModel, model.display)
break;
}
case Koko.Types.Image: {
imageSelected( model.sourceIndex)
break;