summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-07-02 16:57:25 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-07-03 15:17:02 +0200
commite479e5f393e4b7292ab4ac8088ec22e4ed30aa3c (patch)
treea44f837fb8930ac5a9809af13a7e80067d3b00b3 /src
parentd4a8d6e45e991758440276b4ca3ad6e821dfdab2 (diff)
downloadtracker-e479e5f393e4b7292ab4ac8088ec22e4ed30aa3c.tar.gz
Delete tracker-needle
It was cool when Tracker search was barely integrated anywhere. Nowadays, it's nothing but an aging showcase app (eg. was conceived in the gtk2 days and barely ported to gtk3, and it shows everywhere). If you want a modern and capable search UI, try Nautilus. If you are outraged that tracker-needle is gone and ended up here, by all means be my guest, reset to the parent of this commit and take it out of tree. If you join #tracker I'll gladly give you advise on how could it be brought up-to-date. But our hands are full, sorry, we leave cool UIs to others.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/meson.build3
-rw-r--r--src/tracker-needle/.gitignore6
-rw-r--r--src/tracker-needle/Makefile.am80
-rw-r--r--src/tracker-needle/config.vapi31
-rw-r--r--src/tracker-needle/icons/16x16/Makefile.am8
-rw-r--r--src/tracker-needle/icons/16x16/tracker.pngbin997 -> 0 bytes
-rw-r--r--src/tracker-needle/icons/22x22/Makefile.am8
-rw-r--r--src/tracker-needle/icons/22x22/tracker.pngbin1334 -> 0 bytes
-rw-r--r--src/tracker-needle/icons/24x24/Makefile.am8
-rw-r--r--src/tracker-needle/icons/24x24/tracker.pngbin1484 -> 0 bytes
-rw-r--r--src/tracker-needle/icons/32x32/Makefile.am8
-rw-r--r--src/tracker-needle/icons/32x32/tracker.pngbin2242 -> 0 bytes
-rw-r--r--src/tracker-needle/icons/48x48/Makefile.am8
-rw-r--r--src/tracker-needle/icons/48x48/tracker.pngbin4145 -> 0 bytes
-rw-r--r--src/tracker-needle/icons/Makefile.am14
-rw-r--r--src/tracker-needle/icons/scalable/Makefile.am11
-rw-r--r--src/tracker-needle/icons/scalable/tracker.svg1347
-rw-r--r--src/tracker-needle/meson.build46
-rw-r--r--src/tracker-needle/org.freedesktop.Tracker.Needle.gschema.xml.in19
-rw-r--r--src/tracker-needle/tracker-history.vala93
-rw-r--r--src/tracker-needle/tracker-needle.appdata.xml24
-rw-r--r--src/tracker-needle/tracker-needle.desktop.in.in14
-rw-r--r--src/tracker-needle/tracker-needle.ui469
-rw-r--r--src/tracker-needle/tracker-needle.vala858
-rw-r--r--src/tracker-needle/tracker-query.vala410
-rw-r--r--src/tracker-needle/tracker-result-store.vala890
-rw-r--r--src/tracker-needle/tracker-stats.vala191
-rw-r--r--src/tracker-needle/tracker-tags-view.vala834
-rw-r--r--src/tracker-needle/tracker-utils.vala238
-rw-r--r--src/tracker-needle/tracker-view.vala561
31 files changed, 0 insertions, 6183 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 131f1dd64..3ff5e7cf5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,10 +28,6 @@ if HAVE_TRACKER_WRITEBACK
SUBDIRS += tracker-writeback
endif
-if HAVE_TRACKER_NEEDLE
-SUBDIRS += tracker-needle
-endif
-
EXTRA_DIST = \
meson.build \
create-miner-symlinks.sh \
diff --git a/src/meson.build b/src/meson.build
index 1ea96192e..f18903bfc 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -41,7 +41,4 @@ subdir('tracker')
# Public shared database
subdir('tracker-store')
-# Example search application
-subdir('tracker-needle')
-
meson.add_install_script('create-miner-symlinks.sh', dbus_services_dir, tracker_miner_services_dir)
diff --git a/src/tracker-needle/.gitignore b/src/tracker-needle/.gitignore
deleted file mode 100644
index ef6283577..000000000
--- a/src/tracker-needle/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-tracker-needle
-*.c
-*.desktop.in
-org.freedesktop.Tracker.Needle.gschema.valid
-org.freedesktop.Tracker.Needle.gschema.xml
-org.freedesktop.Tracker.enums.xml
diff --git a/src/tracker-needle/Makefile.am b/src/tracker-needle/Makefile.am
deleted file mode 100644
index 1b19cdfbb..000000000
--- a/src/tracker-needle/Makefile.am
+++ /dev/null
@@ -1,80 +0,0 @@
-SUBDIRS = icons
-
-bin_PROGRAMS = tracker-needle
-
-AM_VALAFLAGS = \
- --pkg gtk+-3.0 --pkg gio-2.0 \
- $(BUILD_VALAFLAGS) \
- $(top_srcdir)/src/libtracker-sparql/tracker-sparql-$(TRACKER_API_VERSION).vapi \
- config.vapi
-
-AM_CPPFLAGS = \
- $(BUILD_VALACFLAGS) \
- -D_XOPEN_SOURCE \
- -D_XOPEN_SOURCE_EXTENDED \
- -I$(top_srcdir)/src \
- -I$(top_builddir)/src \
- -DTRACKER_UI_DIR=\"$(datadir)/tracker/\" \
- -DLOCALEDIR=\""$(localedir)"\" \
- $(TRACKER_NEEDLE_CFLAGS) \
- -include config.h
-
-LDADD = \
- $(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql-$(TRACKER_API_VERSION).la \
- $(BUILD_LIBS) \
- $(TRACKER_NEEDLE_LIBS)
-
-tracker_needle_SOURCES = \
- tracker-history.vala \
- tracker-query.vala \
- tracker-result-store.vala \
- tracker-stats.vala \
- tracker-tags-view.vala \
- tracker-utils.vala \
- tracker-needle.vala \
- tracker-view.vala
-
-@INTLTOOL_DESKTOP_RULE@
-
-uidir = $(datadir)/tracker
-ui_DATA = tracker-needle.ui
-
-desktopdir = $(datadir)/applications
-desktop_DATA = tracker-needle.desktop
-
-appdatadir = $(datadir)/appdata
-appdata_DATA = tracker-needle.appdata.xml
-
-BUILT_SOURCES = \
- tracker_needle_vala.stamp
-
-#Desktop files
-%.desktop.in: %.desktop.in.in
- @sed -e "s|@VERSION[@]|${VERSION}|" $< > $@
-
-#GSettings
-gsettings_ENUM_NAMESPACE = org.freedesktop.Tracker
-gsettings_ENUM_FILES = $(top_srcdir)/src/libtracker-common/tracker-enums.h
-
-gsettings_SCHEMAS = $(schemalist)
-
-schemalist = org.freedesktop.Tracker.Needle.gschema.xml
-
-@INTLTOOL_XML_NOMERGE_RULE@
-
-@GSETTINGS_RULES@
-
-# Dist / Clean rules for all data
-CLEANFILES = \
- $(desktop_DATA:.desktop=.desktop.in) \
- $(desktop_DATA) \
- $(gsettings_SCHEMAS)
-
-EXTRA_DIST = \
- $(desktop_DATA:.desktop=.desktop.in.in) \
- $(ui_DATA) \
- $(desktop_DATA) \
- $(appdata_DATA) \
- config.vapi \
- $(gsettings_SCHEMAS:.xml=.xml.in) \
- meson.build
diff --git a/src/tracker-needle/config.vapi b/src/tracker-needle/config.vapi
deleted file mode 100644
index e9b856c25..000000000
--- a/src/tracker-needle/config.vapi
+++ /dev/null
@@ -1,31 +0,0 @@
-// config.vapi
-//
-// Copyright (C) 2010 Martyn Russell <martyn@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
-namespace Config
-{
- public const string GETTEXT_PACKAGE;
- public const string PACKAGE_NAME;
- public const string PACKAGE_VERSION;
- public const string APP_PATH;
- public const string LOCALEDIR;
-}
-
-
diff --git a/src/tracker-needle/icons/16x16/Makefile.am b/src/tracker-needle/icons/16x16/Makefile.am
deleted file mode 100644
index 52782da46..000000000
--- a/src/tracker-needle/icons/16x16/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-icondir = $(datadir)/icons/hicolor/16x16/apps
-icon_DATA = # Empty
-
-if HAVE_ARTWORK
-icon_DATA += tracker.png
-endif
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/src/tracker-needle/icons/16x16/tracker.png b/src/tracker-needle/icons/16x16/tracker.png
deleted file mode 100644
index 0048e022b..000000000
--- a/src/tracker-needle/icons/16x16/tracker.png
+++ /dev/null
Binary files differ
diff --git a/src/tracker-needle/icons/22x22/Makefile.am b/src/tracker-needle/icons/22x22/Makefile.am
deleted file mode 100644
index 60ba12bf6..000000000
--- a/src/tracker-needle/icons/22x22/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-icondir = $(datadir)/icons/hicolor/22x22/apps
-icon_DATA = # Empty
-
-if HAVE_ARTWORK
-icon_DATA += tracker.png
-endif
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/src/tracker-needle/icons/22x22/tracker.png b/src/tracker-needle/icons/22x22/tracker.png
deleted file mode 100644
index ea038072d..000000000
--- a/src/tracker-needle/icons/22x22/tracker.png
+++ /dev/null
Binary files differ
diff --git a/src/tracker-needle/icons/24x24/Makefile.am b/src/tracker-needle/icons/24x24/Makefile.am
deleted file mode 100644
index 573bf12e5..000000000
--- a/src/tracker-needle/icons/24x24/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-icondir = $(datadir)/icons/hicolor/24x24/apps
-icon_DATA = # Empty
-
-if HAVE_ARTWORK
-icon_DATA += tracker.png
-endif
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/src/tracker-needle/icons/24x24/tracker.png b/src/tracker-needle/icons/24x24/tracker.png
deleted file mode 100644
index 4de00ab31..000000000
--- a/src/tracker-needle/icons/24x24/tracker.png
+++ /dev/null
Binary files differ
diff --git a/src/tracker-needle/icons/32x32/Makefile.am b/src/tracker-needle/icons/32x32/Makefile.am
deleted file mode 100644
index 19b2311ef..000000000
--- a/src/tracker-needle/icons/32x32/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-icondir = $(datadir)/icons/hicolor/32x32/apps
-icon_DATA = # Empty
-
-if HAVE_ARTWORK
-icon_DATA += tracker.png
-endif
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/src/tracker-needle/icons/32x32/tracker.png b/src/tracker-needle/icons/32x32/tracker.png
deleted file mode 100644
index 96089db9f..000000000
--- a/src/tracker-needle/icons/32x32/tracker.png
+++ /dev/null
Binary files differ
diff --git a/src/tracker-needle/icons/48x48/Makefile.am b/src/tracker-needle/icons/48x48/Makefile.am
deleted file mode 100644
index 239df51ab..000000000
--- a/src/tracker-needle/icons/48x48/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-icondir = $(datadir)/icons/hicolor/48x48/apps
-icon_DATA = # Empty
-
-if HAVE_ARTWORK
-icon_DATA += tracker.png
-endif
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/src/tracker-needle/icons/48x48/tracker.png b/src/tracker-needle/icons/48x48/tracker.png
deleted file mode 100644
index 497f2a2a3..000000000
--- a/src/tracker-needle/icons/48x48/tracker.png
+++ /dev/null
Binary files differ
diff --git a/src/tracker-needle/icons/Makefile.am b/src/tracker-needle/icons/Makefile.am
deleted file mode 100644
index 2d5974d2c..000000000
--- a/src/tracker-needle/icons/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-SUBDIRS = 16x16 22x22 24x24 32x32 48x48 scalable
-
-gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
-
-install-data-hook: update-icon-cache
-uninstall-hook: update-icon-cache
-update-icon-cache:
- @-if test -z "$(DESTDIR)"; then \
- echo "Updating Gtk icon cache."; \
- $(gtk_update_icon_cache); \
- else \
- echo "*** Icon cache not updated. After (un)install, run this:"; \
- echo "*** $(gtk_update_icon_cache)"; \
- fi
diff --git a/src/tracker-needle/icons/scalable/Makefile.am b/src/tracker-needle/icons/scalable/Makefile.am
deleted file mode 100644
index bb3899cfd..000000000
--- a/src/tracker-needle/icons/scalable/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-icondir = $(datadir)/icons/hicolor/scalable/apps
-icon_DATA = # Empty
-
-if HAVE_ARTWORK
-icon_DATA += tracker.svg
-endif
-
-minericonsdir = $(datadir)/tracker/icons
-minericons_DATA =
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/src/tracker-needle/icons/scalable/tracker.svg b/src/tracker-needle/icons/scalable/tracker.svg
deleted file mode 100644
index 7655d24ac..000000000
--- a/src/tracker-needle/icons/scalable/tracker.svg
+++ /dev/null
@@ -1,1347 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="48"
- height="48"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44.1"
- version="1.0"
- sodipodi:docbase="/home/baze"
- sodipodi:docname="tracker.svg"
- inkscape:export-filename="/home/baze/tracker.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs4">
- <radialGradient
- r="45"
- fy="106.49996"
- fx="-25"
- cy="106.49996"
- cx="-25"
- gradientTransform="matrix(3.466166,-6.346783e-2,7.070491e-2,3.695342,32.7241,-321.4409)"
- gradientUnits="userSpaceOnUse"
- id="radialGradient3293"
- xlink:href="#linearGradient3075"
- inkscape:collect="always" />
- <radialGradient
- r="46"
- fy="99.774971"
- fx="-24.85253"
- cy="99.774971"
- cx="-24.85253"
- gradientTransform="matrix(0.934777,-0.846006,0.891541,0.985091,-120.2744,-50.59553)"
- gradientUnits="userSpaceOnUse"
- id="radialGradient3290"
- xlink:href="#linearGradient3139"
- inkscape:collect="always" />
- <linearGradient
- gradientTransform="matrix(1.2,0,0,1.2,-18.8,-66.7005)"
- y2="97.761848"
- x2="-44.159863"
- y1="103.68449"
- x1="-39.098888"
- gradientUnits="userSpaceOnUse"
- id="linearGradient3287"
- xlink:href="#linearGradient3149"
- inkscape:collect="always" />
- <linearGradient
- y2="97.761848"
- x2="-44.159863"
- y1="103.68449"
- x1="-39.098888"
- gradientUnits="userSpaceOnUse"
- id="linearGradient3283"
- xlink:href="#linearGradient3149"
- inkscape:collect="always" />
- <radialGradient
- r="46"
- fy="99.774971"
- fx="-24.85253"
- cy="99.774971"
- cx="-24.85253"
- gradientTransform="matrix(0.778981,-0.705005,0.742951,0.820909,-84.56197,13.42081)"
- gradientUnits="userSpaceOnUse"
- id="radialGradient3281"
- xlink:href="#linearGradient3139"
- inkscape:collect="always" />
- <radialGradient
- r="45"
- fy="106.49996"
- fx="-25"
- cy="106.49996"
- cx="-25"
- gradientTransform="matrix(2.888472,-5.288986e-2,5.892076e-2,3.079452,42.93675,-212.2837)"
- gradientUnits="userSpaceOnUse"
- id="radialGradient3279"
- xlink:href="#linearGradient3075"
- inkscape:collect="always" />
- <radialGradient
- r="64.122231"
- fy="123.41074"
- fx="31.487459"
- cy="123.41074"
- cx="64.37719"
- gradientTransform="matrix(1,0,0,8.747514e-2,0,112.6154)"
- gradientUnits="userSpaceOnUse"
- id="radialGradient2348"
- xlink:href="#linearGradient2345"
- inkscape:collect="always" />
- <linearGradient
- id="linearGradient2215">
- <stop
- style="stop-color:#8e8e8e;stop-opacity:1;"
- offset="0"
- id="stop2217" />
- <stop
- style="stop-color:#f8f8f8;stop-opacity:1;"
- offset="1"
- id="stop2219" />
- </linearGradient>
- <linearGradient
- id="linearGradient2221">
- <stop
- style="stop-color:#000000;stop-opacity:1;"
- offset="0"
- id="stop2223" />
- <stop
- id="stop2225"
- offset="0.40659341"
- style="stop-color:#000000;stop-opacity:0.68235294;" />
- <stop
- style="stop-color:#000000;stop-opacity:0.48736462;"
- offset="0.45329672"
- id="stop2227" />
- <stop
- id="stop2229"
- offset="0.5"
- style="stop-color:#000000;stop-opacity:0.36101082;" />
- <stop
- style="stop-color:#000000;stop-opacity:0.15162455;"
- offset="0.70604396"
- id="stop2231" />
- <stop
- style="stop-color:#000000;stop-opacity:0;"
- offset="1"
- id="stop2233" />
- </linearGradient>
- <linearGradient
- id="linearGradient2235">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop2237" />
- <stop
- id="stop2239"
- offset="0.42597079"
- style="stop-color:#ffffff;stop-opacity:1;" />
- <stop
- id="stop2241"
- offset="0.5892781"
- style="stop-color:#f1f1f1;stop-opacity:1;" />
- <stop
- style="stop-color:#eaeaea;stop-opacity:1;"
- offset="0.80219781"
- id="stop2243" />
- <stop
- style="stop-color:#dfdfdf;stop-opacity:1;"
- offset="1"
- id="stop2245" />
- </linearGradient>
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3075"
- id="radialGradient1458"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(2.888472,-5.288986e-2,5.892076e-2,3.079452,42.93675,-212.2837)"
- cx="-25"
- cy="106.49996"
- fx="-25"
- fy="106.49996"
- r="45" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3139"
- id="radialGradient1460"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.778981,-0.705005,0.742951,0.820909,-84.56197,13.42081)"
- cx="-24.85253"
- cy="99.774971"
- fx="-24.85253"
- fy="99.774971"
- r="46" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3149"
- id="linearGradient1462"
- gradientUnits="userSpaceOnUse"
- x1="-39.098888"
- y1="103.68449"
- x2="-44.159863"
- y2="97.761848" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient2345"
- id="radialGradient2250"
- cx="64.37719"
- cy="123.41074"
- fx="31.487459"
- fy="123.41074"
- r="64.122231"
- gradientTransform="matrix(1,0,0,8.747514e-2,0,112.6154)"
- gradientUnits="userSpaceOnUse" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient2257"
- id="radialGradient1495"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.520175,8.839467e-2,-0.843351,13.788,109.1206,-1545.323)"
- cx="42.617531"
- cy="120.64188"
- fx="42.617531"
- fy="120.64188"
- r="3.406888" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3311"
- id="radialGradient1497"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(6.228741e-2,-3.825032e-4,4.90218e-3,0.798611,68.90433,5.49306)"
- cx="95.505852"
- cy="59.591507"
- fx="95.505852"
- fy="59.591507"
- r="47.746403" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3225"
- id="radialGradient1499"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.297068,-1.880044e-3,7.085819e-4,0.48867,6.806484,-3.45491)"
- cx="49.009884"
- cy="8.4953117"
- fx="47.370888"
- fy="6.7701697"
- r="3.9750404" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3217"
- id="linearGradient1501"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.29707,0,0,1.29707,6.81152,-10.31269)"
- x1="48.914677"
- y1="2.9719031"
- x2="48.913002"
- y2="2.5548496" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3207"
- id="radialGradient1503"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.29707,0,0,0.1578,6.81152,-7.300115)"
- cx="49.011971"
- cy="2.6743078"
- fx="49.011971"
- fy="2.6743078"
- r="1.7246193" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3235"
- id="linearGradient1505"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.297068,-1.880044e-3,1.880044e-3,1.297068,6.796523,-10.3225)"
- x1="48.498562"
- y1="0.81150496"
- x2="48.732723"
- y2="2.3657269" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3251"
- id="linearGradient1507"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.28993,0,0,1.29707,7.14915,-10.31269)"
- x1="46.051746"
- y1="3.0999987"
- x2="46.051746"
- y2="2.395859" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3273"
- id="radialGradient1509"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.860164,0,0,0.1578,24.50481,-7.300115)"
- cx="49.011971"
- cy="2.6743078"
- fx="49.011971"
- fy="2.6743078"
- r="1.7246193" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3251"
- id="linearGradient1511"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.279856,0,0,1.29707,-133.1341,-10.31269)"
- x1="46.051746"
- y1="3.0999987"
- x2="46.051746"
- y2="2.395859" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3259"
- id="radialGradient1513"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.853446,0,0,0.1578,-115.9141,-7.300115)"
- cx="49.011971"
- cy="2.6743078"
- fx="49.011971"
- fy="2.6743078"
- r="1.7246193" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3303"
- id="radialGradient1515"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,2.608014e-2,0,7.26766)"
- cx="34.677639"
- cy="7.4622769"
- fx="34.677639"
- fy="7.4622769"
- r="47.595196" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3325"
- id="radialGradient1517"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(-1.511766,-6.865741e-3,4.187271e-5,-9.110636e-3,87.10184,7.76835)"
- cx="34.677639"
- cy="7.4622769"
- fx="34.677639"
- fy="7.4622769"
- r="47.595196" />
- <linearGradient
- id="linearGradient3325">
- <stop
- id="stop3327"
- offset="0"
- style="stop-color:#ffffff;stop-opacity:1;" />
- <stop
- id="stop3329"
- offset="1"
- style="stop-color:#ffffff;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient3311">
- <stop
- style="stop-color:#2d2d2d;stop-opacity:1;"
- offset="0"
- id="stop3313" />
- <stop
- id="stop3319"
- offset="0.5"
- style="stop-color:#000000;stop-opacity:1;" />
- <stop
- style="stop-color:#000000;stop-opacity:1;"
- offset="1"
- id="stop3315" />
- </linearGradient>
- <linearGradient
- id="linearGradient3303">
- <stop
- style="stop-color:#ffffff;stop-opacity:0.68345326;"
- offset="0"
- id="stop3305" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop3307" />
- </linearGradient>
- <linearGradient
- id="linearGradient3273">
- <stop
- style="stop-color:#ffffff;stop-opacity:0.55035973;"
- offset="0"
- id="stop3275" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop3277" />
- </linearGradient>
- <linearGradient
- id="linearGradient3259">
- <stop
- id="stop3261"
- offset="0"
- style="stop-color:#ffffff;stop-opacity:0.55035973;" />
- <stop
- id="stop3263"
- offset="1"
- style="stop-color:#000000;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient2280">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop2282" />
- <stop
- style="stop-color:#aeaeae;stop-opacity:1;"
- offset="1"
- id="stop2284" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient3217">
- <stop
- style="stop-color:#252525;stop-opacity:1;"
- offset="0"
- id="stop3219" />
- <stop
- style="stop-color:#252525;stop-opacity:0;"
- offset="1"
- id="stop3221" />
- </linearGradient>
- <linearGradient
- id="linearGradient3207">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop3209" />
- <stop
- style="stop-color:#252525;stop-opacity:0;"
- offset="1"
- id="stop3211" />
- </linearGradient>
- <linearGradient
- id="linearGradient2257">
- <stop
- style="stop-color:#b4942a;stop-opacity:1;"
- offset="0"
- id="stop2259" />
- <stop
- style="stop-color:#e4dcc9;stop-opacity:1"
- offset="1"
- id="stop2261" />
- </linearGradient>
- <linearGradient
- id="linearGradient3235"
- inkscape:collect="always">
- <stop
- id="stop3237"
- offset="0"
- style="stop-color:#ffffff;stop-opacity:1;" />
- <stop
- id="stop3239"
- offset="1"
- style="stop-color:#ffffff;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient3251">
- <stop
- id="stop3253"
- offset="0"
- style="stop-color:#000000;stop-opacity:1;" />
- <stop
- style="stop-color:#090909;stop-opacity:0.67870039;"
- offset="0.7087912"
- id="stop14161" />
- <stop
- id="stop3255"
- offset="1"
- style="stop-color:#131313;stop-opacity:0;" />
- </linearGradient>
- <foreignObject
- requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/"
- x="0"
- y="0"
- width="1"
- height="1"
- id="foreignObject1939">
- <i:pgfRef
- xlink:href="#adobe_illustrator_pgf" />
- </foreignObject>
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3291"
- id="radialGradient1566"
- cx="63.912209"
- cy="115.70919"
- fx="98.520187"
- fy="119.62119"
- r="63.912209"
- gradientTransform="matrix(1,0,0,0.197802,0,92.82166)"
- gradientUnits="userSpaceOnUse" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3291"
- id="radialGradient1739"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.197802,0,92.82166)"
- cx="63.912209"
- cy="115.7093"
- fx="63.912209"
- fy="115.7093"
- r="63.912209" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3291"
- id="radialGradient2096"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.197802,0,92.82166)"
- cx="63.912209"
- cy="115.70919"
- fx="98.520187"
- fy="119.62119"
- r="63.912209" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3291"
- id="radialGradient2098"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.197802,0,92.82166)"
- cx="63.912209"
- cy="115.7093"
- fx="63.912209"
- fy="115.7093"
- r="63.912209" />
- <linearGradient
- inkscape:collect="always"
- id="linearGradient4171">
- <stop
- style="stop-color:#000000;stop-opacity:1;"
- offset="0"
- id="stop4173" />
- <stop
- style="stop-color:#000000;stop-opacity:0;"
- offset="1"
- id="stop4175" />
- </linearGradient>
- <linearGradient
- id="linearGradient5176">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop5178" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop5180" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient5142">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop5144" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop5146" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient5111">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop5113" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop5115" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient4206">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop4208" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop4210" />
- </linearGradient>
- <linearGradient
- id="linearGradient3319">
- <stop
- style="stop-color:#000000;stop-opacity:0;"
- offset="0"
- id="stop3321" />
- <stop
- id="stop2287"
- offset="0.86263734"
- style="stop-color:#000000;stop-opacity:0;" />
- <stop
- style="stop-color:#000000;stop-opacity:0.27797833;"
- offset="1"
- id="stop3323" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient3201">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop3203" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop3205" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient2288">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop2290" />
- <stop
- style="stop-color:#ffffff;stop-opacity:0;"
- offset="1"
- id="stop2292" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient3291">
- <stop
- style="stop-color:#000000;stop-opacity:1;"
- offset="0"
- id="stop3293" />
- <stop
- style="stop-color:#000000;stop-opacity:0;"
- offset="1"
- id="stop3295" />
- </linearGradient>
- <linearGradient
- id="linearGradient3225">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop3227" />
- <stop
- style="stop-color:#aeaeae;stop-opacity:1;"
- offset="1"
- id="stop3229" />
- </linearGradient>
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3291"
- id="radialGradient3297"
- cx="63.912209"
- cy="115.70919"
- fx="98.520187"
- fy="119.62119"
- r="63.912209"
- gradientTransform="matrix(1,0,0,0.197802,0,92.82166)"
- gradientUnits="userSpaceOnUse" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3201"
- id="radialGradient4208"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.350763,0,33.62806)"
- cx="53.82272"
- cy="51.796238"
- fx="53.363365"
- fy="53.704475"
- r="5.2844129" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3201"
- id="radialGradient4210"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.350763,0,33.62806)"
- cx="53.82272"
- cy="51.796238"
- fx="53.363365"
- fy="53.704475"
- r="5.2844129" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4206"
- id="radialGradient4214"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,1.008658,0,-0.322745)"
- cx="36.920532"
- cy="37.277058"
- fx="28.846222"
- fy="20.466549"
- r="31.704992" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5142"
- id="linearGradient4216"
- gradientUnits="userSpaceOnUse"
- x1="67.70639"
- y1="137.9411"
- x2="60.432804"
- y2="42.427299" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5111"
- id="linearGradient4218"
- gradientUnits="userSpaceOnUse"
- x1="34.841892"
- y1="-7.142458"
- x2="35.561386"
- y2="11.415728" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5111"
- id="linearGradient4220"
- gradientUnits="userSpaceOnUse"
- x1="34.841892"
- y1="-7.142458"
- x2="35.561386"
- y2="11.415728" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5111"
- id="linearGradient4222"
- gradientUnits="userSpaceOnUse"
- x1="34.841892"
- y1="-7.142458"
- x2="35.561386"
- y2="11.415728" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5176"
- id="radialGradient4224"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.743822,4.610586e-7,-4.175093e-7,0.670083,-30.109,9.1749)"
- cx="40.478767"
- cy="27.809845"
- fx="40.478779"
- fy="42.86652"
- r="30.543081" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5111"
- id="linearGradient4226"
- gradientUnits="userSpaceOnUse"
- x1="34.841892"
- y1="-7.142458"
- x2="35.561386"
- y2="11.415728" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5111"
- id="linearGradient4229"
- gradientUnits="userSpaceOnUse"
- x1="34.841892"
- y1="-7.142458"
- x2="35.561386"
- y2="11.415728" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5111"
- id="linearGradient4231"
- gradientUnits="userSpaceOnUse"
- x1="34.841892"
- y1="-7.142458"
- x2="35.561386"
- y2="11.415728" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4171"
- id="linearGradient1380"
- gradientUnits="userSpaceOnUse"
- x1="67.515175"
- y1="86.706062"
- x2="63.401665"
- y2="61.357201"
- gradientTransform="matrix(1.004983,0,0,1.005797,-3.514071e-3,-9.765696e-2)" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3225"
- id="linearGradient1395"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(-0.342816,0.414732,0.409438,0.344388,68.74377,42.51885)"
- spreadMethod="reflect"
- x1="28.071711"
- y1="20.204628"
- x2="40.198689"
- y2="20.20463" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient2288"
- id="radialGradient1401"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.599945,-0.725801,7.847448,6.600672,-444.8151,-313.0422)"
- cx="32.489605"
- cy="69.225014"
- fx="29.738691"
- fy="69.225014"
- r="8.3332367" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient2288"
- id="radialGradient1404"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.599945,-0.725801,7.847448,6.600672,-444.8151,-313.0422)"
- cx="49.157429"
- cy="62.380642"
- fx="45.900455"
- fy="62.298256"
- r="8.3332367" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3319"
- id="radialGradient1412"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.993088,2.250037e-2,-2.180165e-2,0.952313,1.715624,0.815028)"
- cx="39.126225"
- cy="44.269405"
- fx="39.12624"
- fy="44.269413"
- r="34.469494" />
- <linearGradient
- gradientUnits="userSpaceOnUse"
- y2="97.761848"
- x2="-44.159863"
- y1="103.68449"
- x1="-39.098888"
- id="linearGradient3155"
- xlink:href="#linearGradient3149"
- inkscape:collect="always" />
- <radialGradient
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.778981,-0.705005,0.742951,0.820909,-84.56197,13.42081)"
- r="46"
- fy="99.774971"
- fx="-24.85253"
- cy="99.774971"
- cx="-24.85253"
- id="radialGradient3145"
- xlink:href="#linearGradient3139"
- inkscape:collect="always" />
- <radialGradient
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(2.888472,-5.288986e-2,5.892076e-2,3.079452,42.93675,-212.2837)"
- r="45"
- fy="106.49996"
- fx="-25"
- cy="106.49996"
- cx="-25"
- id="radialGradient3083"
- xlink:href="#linearGradient3075"
- inkscape:collect="always" />
- <linearGradient
- id="linearGradient3075">
- <stop
- id="stop3077"
- offset="0"
- style="stop-color:#ffffff;stop-opacity:1;" />
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0.42597079"
- id="stop3093" />
- <stop
- style="stop-color:#f1f1f1;stop-opacity:1;"
- offset="0.5892781"
- id="stop3085" />
- <stop
- id="stop3087"
- offset="0.80219781"
- style="stop-color:#eaeaea;stop-opacity:1;" />
- <stop
- id="stop3079"
- offset="1"
- style="stop-color:#dfdfdf;stop-opacity:1;" />
- </linearGradient>
- <linearGradient
- id="linearGradient3139">
- <stop
- id="stop3141"
- offset="0"
- style="stop-color:#000000;stop-opacity:1;" />
- <stop
- style="stop-color:#000000;stop-opacity:0.68235294;"
- offset="0.40659341"
- id="stop3162" />
- <stop
- id="stop3164"
- offset="0.45329672"
- style="stop-color:#000000;stop-opacity:0.48736462;" />
- <stop
- style="stop-color:#000000;stop-opacity:0.36101082;"
- offset="0.5"
- id="stop3158" />
- <stop
- id="stop3160"
- offset="0.70604396"
- style="stop-color:#000000;stop-opacity:0.15162455;" />
- <stop
- id="stop3143"
- offset="1"
- style="stop-color:#000000;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient3149">
- <stop
- id="stop3151"
- offset="0"
- style="stop-color:#8e8e8e;stop-opacity:1;" />
- <stop
- id="stop3153"
- offset="1"
- style="stop-color:#f8f8f8;stop-opacity:1;" />
- </linearGradient>
- <linearGradient
- id="linearGradient3461">
- <stop
- id="stop3463"
- offset="0"
- style="stop-color:#bbbbbb;stop-opacity:1;" />
- <stop
- id="stop3465"
- offset="1"
- style="stop-color:#bbbbbb;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient3471">
- <stop
- id="stop3473"
- offset="0"
- style="stop-color:#000000;stop-opacity:0.48736462;" />
- <stop
- id="stop3475"
- offset="1"
- style="stop-color:#000000;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient2345"
- inkscape:collect="always">
- <stop
- id="stop2347"
- offset="0"
- style="stop-color:#000000;stop-opacity:1;" />
- <stop
- id="stop2349"
- offset="1"
- style="stop-color:#000000;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient4440">
- <stop
- id="stop4442"
- offset="0"
- style="stop-color:#7d7d7d;stop-opacity:1;" />
- <stop
- style="stop-color:#b1b1b1;stop-opacity:1.0000000;"
- offset="0.50000000"
- id="stop4448" />
- <stop
- id="stop4444"
- offset="1.0000000"
- style="stop-color:#686868;stop-opacity:1.0000000;" />
- </linearGradient>
- <linearGradient
- id="linearGradient4454">
- <stop
- id="stop4456"
- offset="0.0000000"
- style="stop-color:#ce5c00;stop-opacity:0.20784314" />
- <stop
- id="stop4458"
- offset="1.0000000"
- style="stop-color:#f57900;stop-opacity:0.67619050" />
- </linearGradient>
- <linearGradient
- id="linearGradient4467">
- <stop
- id="stop4469"
- offset="0"
- style="stop-color:#ffffff;stop-opacity:1;" />
- <stop
- id="stop4471"
- offset="1.0000000"
- style="stop-color:#ffffff;stop-opacity:0.24761905;" />
- </linearGradient>
- <linearGradient
- id="linearGradient4477"
- inkscape:collect="always">
- <stop
- id="stop4479"
- offset="0"
- style="stop-color:#000000;stop-opacity:1;" />
- <stop
- id="stop4481"
- offset="1"
- style="stop-color:#000000;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient4487"
- inkscape:collect="always">
- <stop
- id="stop4489"
- offset="0"
- style="stop-color:#ffffff;stop-opacity:1;" />
- <stop
- id="stop4491"
- offset="1"
- style="stop-color:#ffffff;stop-opacity:0;" />
- </linearGradient>
- <linearGradient
- id="linearGradient2366">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop2368" />
- <stop
- id="stop2374"
- offset="0.50000000"
- style="stop-color:#ffffff;stop-opacity:0.21904762;" />
- <stop
- style="stop-color:#ffffff;stop-opacity:1.0000000;"
- offset="1.0000000"
- id="stop2370" />
- </linearGradient>
- <linearGradient
- id="linearGradient2846">
- <stop
- style="stop-color:#8a8a8a;stop-opacity:1.0000000;"
- offset="0.0000000"
- id="stop2848" />
- <stop
- style="stop-color:#484848;stop-opacity:1.0000000;"
- offset="1.0000000"
- id="stop2850" />
- </linearGradient>
- <linearGradient
- id="linearGradient2997">
- <stop
- id="stop2999"
- offset="0"
- style="stop-color:#7d7d7d;stop-opacity:1;" />
- <stop
- style="stop-color:#b1b1b1;stop-opacity:1.0000000;"
- offset="0.50000000"
- id="stop3001" />
- <stop
- id="stop3003"
- offset="1.0000000"
- style="stop-color:#686868;stop-opacity:1.0000000;" />
- </linearGradient>
- <linearGradient
- id="linearGradient2991">
- <stop
- id="stop2993"
- offset="0.0000000"
- style="stop-color:#729fcf;stop-opacity:0.20784314;" />
- <stop
- id="stop2995"
- offset="1.0000000"
- style="stop-color:#729fcf;stop-opacity:0.67619050;" />
- </linearGradient>
- <linearGradient
- id="linearGradient2985">
- <stop
- id="stop2987"
- offset="0"
- style="stop-color:#ffffff;stop-opacity:1;" />
- <stop
- id="stop2989"
- offset="1.0000000"
- style="stop-color:#ffffff;stop-opacity:0.24761905;" />
- </linearGradient>
- <linearGradient
- id="linearGradient2965">
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="0"
- id="stop2967" />
- <stop
- id="stop2969"
- offset="0.50000000"
- style="stop-color:#ffffff;stop-opacity:0.21904762;" />
- <stop
- style="stop-color:#ffffff;stop-opacity:1.0000000;"
- offset="1.0000000"
- id="stop2971" />
- </linearGradient>
- <linearGradient
- id="linearGradient2959">
- <stop
- style="stop-color:#8a8a8a;stop-opacity:1.0000000;"
- offset="0.0000000"
- id="stop2961" />
- <stop
- style="stop-color:#484848;stop-opacity:1.0000000;"
- offset="1.0000000"
- id="stop2963" />
- </linearGradient>
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4477"
- id="radialGradient3034"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.237968,0,28.93278)"
- cx="24.130018"
- cy="37.967922"
- fx="24.130018"
- fy="37.967922"
- r="16.528622" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient2366"
- id="linearGradient3040"
- gradientUnits="userSpaceOnUse"
- x1="18.292673"
- y1="13.602121"
- x2="17.500893"
- y2="25.743469" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4487"
- id="radialGradient3042"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1,0,0,0.237968,0,28.93278)"
- cx="24.130018"
- cy="37.967922"
- fx="24.130018"
- fy="37.967922"
- r="16.528622" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4454"
- id="radialGradient3044"
- gradientUnits="userSpaceOnUse"
- cx="18.240929"
- cy="21.817987"
- fx="18.240929"
- fy="21.817987"
- r="8.3085051" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4467"
- id="radialGradient3049"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(2.592963,0,0,2.252104,-24.89514,-18.08455)"
- cx="15.414371"
- cy="13.078408"
- fx="15.414371"
- fy="13.078408"
- r="6.6562500" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4440"
- id="linearGradient3056"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.334593,0,0,1.291292,-6.809229,-6.604212)"
- x1="30.656250"
- y1="34.000000"
- x2="33.218750"
- y2="31.062500" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient2846"
- id="linearGradient3060"
- gradientUnits="userSpaceOnUse"
- x1="27.366341"
- y1="26.580296"
- x2="31.335964"
- y2="30.557772"
- gradientTransform="translate(0.164613,0.856446)" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="50"
- guidetolerance="50"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="31.998886"
- inkscape:cx="22.841726"
- inkscape:cy="24.537509"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- width="48px"
- height="48px"
- inkscape:window-width="987"
- inkscape:window-height="859"
- inkscape:window-x="97"
- inkscape:window-y="114"
- showguides="true"
- inkscape:guide-bbox="true"
- inkscape:guide-points="false"
- inkscape:grid-points="true"
- showgrid="true"
- gridspacingx="0.5px"
- gridspacingy="0.5px">
- <sodipodi:guide
- orientation="horizontal"
- position="69.953064"
- id="guide2827" />
- <sodipodi:guide
- orientation="vertical"
- position="-33.082496"
- id="guide2829" />
- <sodipodi:guide
- orientation="vertical"
- position="84.852814"
- id="guide2831" />
- <sodipodi:guide
- orientation="horizontal"
- position="-46.214479"
- id="guide2835" />
- </sodipodi:namedview>
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <rect
- style="opacity:0.57786889;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.63199997;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
- id="rect1327"
- width="1"
- height="0"
- x="101.96484"
- y="50.58419" />
- <rect
- style="opacity:0.57786889;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.63199997;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
- id="rect2306"
- width="1"
- height="0"
- x="-155.40515"
- y="7.1223102" />
- <path
- sodipodi:nodetypes="ccc"
- id="path2318"
- d="M -314.34258,-66.093757 L -314.34258,-68.888466 L -314.34258,-66.093757 z "
- style="fill:white;fill-opacity:0.75688076;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1" />
- <g
- style="opacity:0.40163933"
- transform="matrix(-0.782995,0,0,0.650879,-2637.201,620.4239)"
- id="g4640" />
- <g
- id="g4646"
- transform="matrix(-0.782995,0,0,0.650879,-2637.201,620.4239)"
- style="opacity:0.40163933" />
- <g
- id="g4730"
- transform="matrix(1,0,0,0.650879,563.7618,627.7517)"
- style="opacity:0.40163933" />
- <g
- style="opacity:0.40163933"
- transform="matrix(1,0,0,0.650879,563.7618,627.7517)"
- id="g4748" />
- <path
- transform="matrix(1.446431,0,0,1.51999,-10.80992,-16.89523)"
- d="M 40.65864 37.967922 A 16.528622 3.9332814 0 1 1 7.6013966,37.967922 A 16.528622 3.9332814 0 1 1 40.65864 37.967922 z"
- sodipodi:ry="3.9332814"
- sodipodi:rx="16.528622"
- sodipodi:cy="37.967922"
- sodipodi:cx="24.130018"
- id="path4475"
- style="opacity:0.17112301;color:black;fill:url(#radialGradient3034);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
- sodipodi:type="arc" />
- <path
- style="color:black;fill:#dcdcdc;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3060);stroke-width:2.00000095;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
- d="M 18.792182,4.0000008 C 10.653052,4.0000008 4.0473812,10.605672 4.0473812,18.744802 C 4.0473812,26.883932 10.653052,33.489604 18.792182,33.489604 C 22.271737,33.489604 25.343183,32.105211 27.865905,30.086957 C 27.660528,31.093838 27.78787,32.122325 28.622049,32.846882 L 39.586133,42.374292 C 40.819549,43.445621 42.673595,43.305252 43.744923,42.071835 C 44.816251,40.838417 44.675882,38.984373 43.442466,37.913045 L 32.478382,28.385634 C 31.806855,27.802355 30.985504,27.629665 30.172144,27.742912 C 32.158844,25.23049 33.536983,22.194109 33.536983,18.744802 C 33.536983,10.605672 26.931312,4.0000008 18.792182,4.0000008 z M 18.716567,5.2261841 C 26.356026,5.2261841 32.008342,10.015135 32.008342,18.517959 C 32.008342,27.193072 26.191652,31.809734 18.716567,31.809734 C 11.413618,31.809734 5.4247936,26.331642 5.4247936,18.517959 C 5.4247936,10.533852 11.249432,5.226184 18.716567,5.2261841 z "
- id="path2844"
- sodipodi:nodetypes="csscccscccscczzzz" />
- <path
- id="path4430"
- d="M 18.767518,3.9368011 C 10.602078,3.9368011 3.9750538,10.563825 3.9750538,18.729265 C 3.9750538,26.894705 10.602078,33.521729 18.767518,33.521729 C 22.258321,33.521729 25.339695,32.132862 27.870573,30.108084 C 27.664532,31.11822 27.792285,32.150031 28.62916,32.87693 L 39.628686,42.435137 C 40.866089,43.509929 42.726128,43.369107 43.800919,42.131702 C 44.87571,40.894298 44.734887,39.03426 43.497484,37.959469 L 32.497959,28.401261 C 31.824261,27.816097 31.000255,27.642848 30.184266,27.756462 C 32.177388,25.235918 33.559982,22.189722 33.559982,18.729265 C 33.559982,10.563825 26.932958,3.9368011 18.767518,3.9368011 z M 18.691659,7.1228703 C 24.972767,7.1228705 30.070477,12.220581 30.070477,18.501689 C 30.070477,24.782797 24.972767,29.880507 18.691659,29.880507 C 12.410551,29.880507 7.3128406,24.782797 7.3128406,18.501689 C 7.3128408,12.220581 12.410551,7.1228703 18.691659,7.1228703 z "
- style="color:black;fill:#dcdcdc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.00000036;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
- <path
- sodipodi:nodetypes="ccccc"
- id="path4438"
- d="M 39.671617,42.434136 C 39.192945,40.160949 41.068947,37.622714 43.25567,37.645761 C 43.25567,37.645761 32.495303,28.38765 32.495303,28.38765 C 29.550512,28.330944 28.225801,30.660266 28.718489,32.987572 L 39.671617,42.434136 z "
- style="color:black;fill:url(#linearGradient3056);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
- <path
- transform="matrix(1.245743,0,0,1.245743,-3.260733,-5.320587)"
- d="M 28.549437 18.920233 A 11.048544 11.048544 0 1 1 6.4523487,18.920233 A 11.048544 11.048544 0 1 1 28.549437 18.920233 z"
- sodipodi:ry="11.048544"
- sodipodi:rx="11.048544"
- sodipodi:cy="18.920233"
- sodipodi:cx="17.500893"
- id="path4450"
- style="color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3040);stroke-width:0.8027336;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
- sodipodi:type="arc" />
- <path
- sodipodi:type="arc"
- style="color:black;fill:url(#radialGradient3042);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
- id="path4485"
- sodipodi:cx="24.130018"
- sodipodi:cy="37.967922"
- sodipodi:rx="16.528622"
- sodipodi:ry="3.9332814"
- d="M 40.65864 37.967922 A 16.528622 3.9332814 0 1 1 7.6013966,37.967922 A 16.528622 3.9332814 0 1 1 40.65864 37.967922 z"
- transform="matrix(0.497764,0,0,0.609621,9.138139,16.47574)" />
- <rect
- transform="matrix(0.752986,0.658037,-0.648902,0.760872,0,0)"
- ry="1.8879365"
- rx="2.1366615"
- y="0.67746985"
- x="41.054398"
- height="4.4404783"
- width="19.048445"
- id="rect4495"
- style="opacity:0.43315507;color:black;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:white;stroke-width:1.00003123;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
- <path
- transform="matrix(1.398614,0,0,1.398614,-6.059725,-7.442512)"
- d="M 25.897786 18.478292 A 8.3085051 8.3085051 0 1 1 9.280776,18.478292 A 8.3085051 8.3085051 0 1 1 25.897786 18.478292 z"
- sodipodi:ry="8.3085051"
- sodipodi:rx="8.3085051"
- sodipodi:cy="18.478292"
- sodipodi:cx="17.589281"
- id="path4452"
- style="color:black;fill:url(#radialGradient3044);fill-opacity:1;fill-rule:evenodd;stroke:#ce5c00;stroke-width:0.71499395;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dashoffset:0;stroke-opacity:1;visibility:visible"
- sodipodi:type="arc" />
- <path
- style="fill:#272c2e;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.98407042px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 27.166932,14.788887 C 25.733227,13.44292 20.883226,16.995107 23.033784,19.014059 C 25.184342,21.033011 28.600636,16.134854 27.166932,14.788887 z "
- id="path2116"
- sodipodi:nodetypes="css" />
- <path
- style="fill:#272c2e;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.92405277px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 23.925869,25.433801 C 24.573186,26.022493 28.163554,24.011307 27.442852,22.036782 C 26.722156,20.062255 21.98392,23.667724 23.925869,25.433801 z "
- id="path2118"
- sodipodi:nodetypes="css" />
- <path
- style="fill:#272c2e;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.98604864px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 21.003845,9.7167316 C 22.487885,11.022282 20.43569,17.078901 18.209632,15.120575 C 15.983573,13.162251 19.519806,8.4111821 21.003845,9.7167316 z "
- id="path3032"
- sodipodi:nodetypes="css" />
- <path
- style="fill:#272c2e;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.92799336px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 11.656901,15.199887 C 11.023082,14.593518 12.003308,10.096465 13.832909,10.488128 C 15.66251,10.879786 13.558353,17.018991 11.656901,15.199887 z "
- id="path3034"
- sodipodi:nodetypes="css" />
- <path
- style="fill:#272c2e;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.03811264px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 10.974025,18.60242 C 8.430812,22.619158 17.228659,29.979463 20.571676,26.631844 C 21.35606,25.846381 20.807635,25.293693 20.607132,23.247952 C 20.388463,21.016882 21.240785,20.040808 18.58725,19.186273 C 17.241764,16.695215 16.389441,17.671288 14.208696,17.895002 C 12.13379,18.10786 11.570746,17.659961 10.974025,18.60242 z "
- id="path2097"
- sodipodi:nodetypes="csscss" />
- <path
- id="path4462"
- d="M 18.321528,8.2531398 C 13.113938,8.2531398 8.8969811,12.470097 8.8969811,17.677687 C 8.8969811,19.181662 9.3172883,20.56546 9.944153,21.82759 C 11.196533,22.289203 12.52691,22.603273 13.93892,22.603273 C 20.109875,22.603273 25.038202,17.741636 25.419026,11.666144 C 23.688062,9.6206128 21.208987,8.2531398 18.321528,8.2531398 z "
- style="opacity:0.6011236;color:black;fill:url(#radialGradient3049);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
- </g>
-</svg>
diff --git a/src/tracker-needle/meson.build b/src/tracker-needle/meson.build
deleted file mode 100644
index 211940601..000000000
--- a/src/tracker-needle/meson.build
+++ /dev/null
@@ -1,46 +0,0 @@
-executable(
- 'tracker-needle',
- 'config.vapi',
- 'tracker-needle.vala',
- 'tracker-history.vala',
- 'tracker-needle.vala',
- 'tracker-query.vala',
- 'tracker-result-store.vala',
- 'tracker-stats.vala',
- 'tracker-tags-view.vala',
- 'tracker-utils.vala',
- 'tracker-view.vala',
- dependencies: [tracker_common_dep, tracker_sparql_dep, gtk3],
- c_args: [
- '-D_XOPEN_SOURCE',
- '-D_XOPEN_SOURCE_EXTENDED',
- '-include', 'config.h'
- ],
- install: true,
- install_rpath: tracker_internal_libs_dir
-)
-
-custom_target('tracker-needle-settings-schema',
- input: 'org.freedesktop.Tracker.Needle.gschema.xml.in',
- output: 'org.freedesktop.Tracker.Needle.gschema.xml',
- command: ['intltool-merge', '--quiet', '--xml-style', '--utf8', join_paths(meson.source_root(), 'po'), '@INPUT@', '@OUTPUT@'],
- install: true,
- install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas'))
-
-install_data('tracker-needle.ui',
- install_dir: join_paths(get_option('datadir'), 'tracker'))
-
-desktop_file_untranslated = configure_file(
- input: 'tracker-needle.desktop.in.in',
- output: 'tracker-needle.desktop.in',
- configuration: conf)
-
-desktop_file = custom_target('tracker-needle-desktop-file',
- input: desktop_file_untranslated,
- output: 'tracker-needle.desktop',
- command: ['intltool-merge', '--quiet', '--desktop-style', '--utf8', join_paths(meson.source_root(), 'po'), '@INPUT@', '@OUTPUT@'],
- install: true,
- install_dir: join_paths(get_option('datadir'), 'applications'))
-
-install_data('tracker-needle.appdata.xml',
- install_dir: join_paths(get_option('datadir'), 'tracker-needle.appdata.xml'))
diff --git a/src/tracker-needle/org.freedesktop.Tracker.Needle.gschema.xml.in b/src/tracker-needle/org.freedesktop.Tracker.Needle.gschema.xml.in
deleted file mode 100644
index d22b30423..000000000
--- a/src/tracker-needle/org.freedesktop.Tracker.Needle.gschema.xml.in
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Author: Kunaal Jain <kunaalus@gmail.com>
--->
-
-<schemalist>
- <schema id="org.freedesktop.Tracker.Needle" path="/org/freedesktop/tracker/needle/" gettext-domain="tracker">
- <key name="default-view" type="i">
- <range min="0" max="2"/>
- <default>1</default>
- <_summary>Default View</_summary>
- <_description>
- When 0, default view of tracker-needle will be Icons view.
- When 1, default view of tracker-needle will be Categories view.
- When 2, default view of tracker-needle will be Files view.
- </_description>
- </key>
- </schema>
-</schemalist>
diff --git a/src/tracker-needle/tracker-history.vala b/src/tracker-needle/tracker-history.vala
deleted file mode 100644
index 888133208..000000000
--- a/src/tracker-needle/tracker-history.vala
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// Copyright 2010, Martyn Russell <martyn@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-public class Tracker.History {
- private KeyFile data;
- private string filename;
- private string[] history;
-
- public History () {
- debug ("Loading history");
-
- data = new KeyFile ();
- filename = Path.build_filename (Environment.get_user_data_dir (), "tracker", "tracker-needle.txt", null);
-
- try {
- data.load_from_file (filename, KeyFileFlags.KEEP_COMMENTS | KeyFileFlags.KEEP_TRANSLATIONS);
- } catch (KeyFileError e1) {
- warning ("Could not load history from file:'%s': %s", filename, e1.message);
- return;
- } catch (FileError e2) {
- if (e2.code == 4)
- message ("Creating new history file:'%s'", filename);
- else
- warning ("Could not load history from file:'%s': %s", filename, e2.message);
- return;
- }
-
- if (data.has_group ("History") == false) {
- debug (" No history found");
- return;
- }
-
- try {
- history = data.get_string_list ("History", "criteria");
- } catch (KeyFileError e1) {
- warning ("Could not load history from file:'%s': %s", filename, e1.message);
- return;
- }
-
- debug (" Found %d previous search histories", history.length);
-
- debug (" Done");
- }
-
- ~History () {
- debug ("Saving history");
-
- data.set_string_list ("History", "criteria", history);
-
- try {
- string output = data.to_data ();
-
- FileUtils.set_contents (filename, output, -1);
- } catch (GLib.FileError e1) {
- warning ("Could not save history to file:'%s': %s", filename, e1.message);
- }
-
- debug (" Done");
- }
-
- public void add (string criteria)
- requires (criteria != null && criteria.length > 0) {
- // Don't add the same item more than once
- foreach (string check in history) {
- if (check == criteria) {
- return;
- }
- }
-
- history += criteria;
- }
-
- public string[] get () {
- return history;
- }
-
-}
diff --git a/src/tracker-needle/tracker-needle.appdata.xml b/src/tracker-needle/tracker-needle.appdata.xml
deleted file mode 100644
index 58cb2d791..000000000
--- a/src/tracker-needle/tracker-needle.appdata.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright 2014 Martyn Russell <martyn@lanedo.com> -->
-<application>
- <id type="desktop">tracker-needle.desktop</id>
- <metadata_license>CC0-1.0</metadata_license>
- <project_license>GPL-2.0+</project_license>
- <name>Desktop Search</name>
- <summary>Find what you're looking for on this computer</summary>
- <description>
- <p>Find what you're looking for on this computer by name or
- content.</p>
- <p>The Desktop Search application is a show case and great
- application for searching for your content. You can perform powerful
- queries using globbing, AND/OR key words to conjugate hits and
- snippets are shown in the resulting hits.</p>
- <p>This is the equivalent to Spotlight on Mac, for GNOME.</p>
- </description>
- <screenshots>
- <screenshot type="default" width="707" height="612">https://wiki.gnome.org/Projects/Tracker?action=AttachFile&amp;do=get&amp;target=tracker-needle.png</screenshot>
- </screenshots>
- <url type="homepage">https://wiki.gnome.org/Projects/Tracker</url>
- <updatecontact>tracker-list@gnome.org</updatecontact>
- <project_group>GNOME</project_group>
-</application>
diff --git a/src/tracker-needle/tracker-needle.desktop.in.in b/src/tracker-needle/tracker-needle.desktop.in.in
deleted file mode 100644
index d0b31d739..000000000
--- a/src/tracker-needle/tracker-needle.desktop.in.in
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-_Name=Desktop Search
-_Comment=Find what you’re looking for on this computer by name or content using Tracker
-Exec=tracker-needle
-Icon=system-search
-Terminal=false
-Type=Application
-Categories=GTK;Utility;
-StartupNotify=true
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=tracker
-X-GNOME-Bugzilla-Component=Tracker Needle
-X-GNOME-Bugzilla-Version=@VERSION@
-
diff --git a/src/tracker-needle/tracker-needle.ui b/src/tracker-needle/tracker-needle.ui
deleted file mode 100644
index 05b68d1ff..000000000
--- a/src/tracker-needle/tracker-needle.ui
+++ /dev/null
@@ -1,469 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <!-- interface-requires gtk+ 3.0 -->
- <object class="GtkListStore" id="liststore_search">
- <columns>
- <!-- column-name text -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkWindow" id="window_needle">
- <property name="can_focus">False</property>
- <property name="title" translatable="yes">Desktop Search</property>
- <property name="default_width">720</property>
- <property name="default_height">480</property>
- <property name="icon_name">system-search</property>
- <child>
- <object class="GtkVBox" id="vbox_main">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkToolbar" id="toolbar_main">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkRadioToolButton" id="toolbutton_view_categories">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Display results by category, for example, Music, Videos, Applications, etc. This includes searching the contents of files where applicable.</property>
- <property name="use_action_appearance">False</property>
- <property name="is_important">True</property>
- <property name="use_underline">True</property>
- <property name="icon_name">help-faq</property>
- <property name="active">True</property>
- <property name="group">toolbutton_view_icons</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioToolButton" id="toolbutton_view_filelist">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Display results by files found in a list</property>
- <property name="use_action_appearance">False</property>
- <property name="is_important">True</property>
- <property name="use_underline">True</property>
- <property name="icon_name">document-open</property>
- <property name="active">True</property>
- <property name="group">toolbutton_view_icons</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioToolButton" id="toolbutton_view_icons">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Display found images</property>
- <property name="use_action_appearance">False</property>
- <property name="is_important">True</property>
- <property name="use_underline">True</property>
- <property name="icon_name">emblem-photos</property>
- <property name="active">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparatorToolItem" id="separator_secondary">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioToolButton" id="toolbutton_find_in_contents">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Find search criteria inside files</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-find</property>
- <property name="active">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioToolButton" id="toolbutton_find_in_titles">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Find search criteria in file titles</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-bold</property>
- <property name="group">toolbutton_find_in_contents</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioToolButton" id="toolbutton_find_in_tags">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Find search criteria in file tags only (separated by comma)</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-index</property>
- <property name="group">toolbutton_find_in_contents</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioToolButton" id="toolbutton_find_in_all">
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-select-all</property>
- <property name="active">True</property>
- <property name="group">toolbutton_find_in_titles</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparatorToolItem" id="&lt;separator&gt;">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolItem" id="toolitem_search_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- <property name="is_important">True</property>
- <child>
- <object class="GtkLabel" id="label_search">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Search:</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolItem" id="toolitem_search_entry">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- <property name="is_important">True</property>
- <child>
- <object class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="yscale">0</property>
- <property name="left_padding">6</property>
- <property name="right_padding">6</property>
- <child>
- <object class="GtkComboBox" id="combobox_search">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_focus">True</property>
- <property name="model">liststore_search</property>
- <property name="has_entry">True</property>
- <property name="entry_text_column">0</property>
- <child internal-child="entry">
- <object class="GtkEntry" id="combobox-entry">
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolItem" id="toolcustom_spinner">
- <property name="can_focus">False</property>
- <property name="border_width">8</property>
- <property name="use_action_appearance">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparatorToolItem" id="&lt;separator&gt;1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToggleToolButton" id="toolbutton_show_tags">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Show tagging panel which allows editing tags of selected results</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="icon_name">emblem-favorite</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="toolbutton_show_stats">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Show statistics about the data stored</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-info</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkInfoBar" id="info_bar">
- <property name="visible">False</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="info_bar_content_area">
- <child>
- <object class="GtkLabel" id="info_bar_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="wrap">True</property>
- </object>
- </child>
- </object>
- </child>
- <child internal-child="action_area">
- <object class="GtkBox" id="info_bar_action_area">
- <child>
- <object class="GtkButton" id="info_bar_button">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHPaned" id="hpaned">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="position">500</property>
- <child>
- <object class="GtkHBox" id="hbox_view">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">False</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkWindow" id="window_tags">
- <property name="can_focus">False</property>
- <child>
- <object class="GtkVBox" id="vbox_tags">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkLabel" id="label_tag">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Set the tags you want to associate with the %d selected items:</property>
- <property name="use_underline">True</property>
- <property name="justify">fill</property>
- <property name="wrap">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkEntry" id="entry_tag">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="activates_default">True</property>
- <property name="width_chars">5</property>
- <property name="invisible_char_set">True</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <signal name="activate" handler="tracker_tags_view_entry_tag_activate_cb" swapped="no"/>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="button_add">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Add tag</property>
- <property name="use_action_appearance">False</property>
- <property name="relief">none</property>
- <child>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-add</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_remove">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Remove selected tag</property>
- <property name="use_action_appearance">False</property>
- <property name="relief">none</property>
- <child>
- <object class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-remove</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow_tags">
- <property name="width_request">200</property>
- <property name="height_request">300</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTreeView" id="treeview_tags">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="enable_search">False</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview_tags_selection"/>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
-</interface>
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
deleted file mode 100644
index 4c3434652..000000000
--- a/src/tracker-needle/tracker-needle.vala
+++ /dev/null
@@ -1,858 +0,0 @@
-//
-// Copyright 2010, Martyn Russell <martyn@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-using Gtk;
-using Atk;
-
-[CCode (cname = "TRACKER_UI_DIR")]
-extern const string UIDIR;
-
-public class Tracker.Needle {
- private GLib.Settings settings_needle = null;
- private const string UI_FILE = "tracker-needle.ui";
- private History history;
- private Gtk.Window window;
- private ToggleToolButton view_categories;
- private ToggleToolButton view_filelist;
- private ToggleToolButton view_icons;
- private SeparatorToolItem separator_secondary;
- private ToggleToolButton find_in_contents;
- private ToggleToolButton find_in_titles;
- private ToggleToolButton find_in_tags;
- private ToggleToolButton find_in_all;
- private ToolItem search_entry;
- private ComboBox search_list;
- private Entry search;
- private Spinner spinner;
- private ToolItem spinner_shell;
- private ToggleToolButton show_tags;
- private ToolButton show_stats;
- private Box view;
- private Tracker.View sw_noresults;
- private Tracker.View sw_categories;
- private Tracker.View sw_filelist;
- private Tracker.View sw_icons;
- private InfoBar info_bar;
- private Label info_bar_label;
- private TrackerTagsView tags_view;
- private uint last_search_id = 0;
- private int size_small = 0;
- private int size_medium = 0;
- private int size_big = 0;
- private uint limit = 500;
- private int default_view = 1;
- static bool current_find_in_filelist = true;
- static bool current_find_in_icons = true;
- private Widget current_view;
-
- private ResultStore categories_model;
- private ResultStore files_model;
- private ResultStore files_in_tags_model;
- private ResultStore files_in_title_model;
- private ResultStore images_model;
- private ResultStore images_in_title_model;
-
- private void result_overflow () {
- string str = "%s\n<small>%s</small>".printf (_("Search criteria was too generic"),
- _("Only the first 500 items will be displayed"));
- show_info_message (str, MessageType.INFO);
- }
-
- private void create_models () {
- // Categories model
- categories_model = new ResultStore (6);
- categories_model.limit = limit;
- categories_model.result_overflow.connect (result_overflow);
- categories_model.add_query (Tracker.Query.Type.APPLICATIONS,
- Tracker.Query.Match.FTS,
- "?urn",
- "tracker:coalesce(nfo:softwareCmdLine(?urn), ?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "nie:comment(?urn)",
- "\"\"",
- "\"\"");
-
- categories_model.add_query (Tracker.Query.Type.IMAGES,
- Tracker.Query.Match.FTS,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "fn:string-join((nfo:height(?urn), nfo:width(?urn)), \" x \")",
- "nfo:fileSize(?urn)",
- "nie:url(?urn)");
- categories_model.add_query (Tracker.Query.Type.MUSIC,
- Tracker.Query.Match.FTS_INDIRECT,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "fn:string-join((?performer, ?album), \" - \")",
- "nfo:duration(?urn)",
- "nie:url(?urn)");
- categories_model.add_query (Tracker.Query.Type.VIDEOS,
- Tracker.Query.Match.FTS,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(fts:snippet(?urn),nie:title(?urn), nfo:fileName(?urn))",
- "\"\"",
- "nfo:duration(?urn)",
- "nie:url(?urn)");
- categories_model.add_query (Tracker.Query.Type.DOCUMENTS,
- Tracker.Query.Match.FTS_INDIRECT,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "tracker:coalesce(fts:snippet(?urn),nco:fullname(?creator), nco:fullname(?publisher))",
- "nfo:pageCount(?urn)",
- "nie:url(?urn)");
- categories_model.add_query (Tracker.Query.Type.MAIL,
- Tracker.Query.Match.FTS,
- "?urn",
- "nie:url(?urn)",
- "nmo:messageSubject(?urn)",
- "tracker:coalesce(fts:snippet(?urn),nco:fullname(?sender), nco:nickname(?sender), nco:emailAddress(?sender))",
- "nmo:receivedDate(?urn)",
- "fn:concat(\"To: \", tracker:coalesce(nco:fullname(?to), nco:nickname(?to), nco:emailAddress(?to)))");
- categories_model.add_query (Tracker.Query.Type.FOLDERS,
- Tracker.Query.Match.FTS,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(fts:snippet(?urn),nie:title(?urn), nfo:fileName(?urn))",
- "nie:url(?parent)",
- "nfo:fileLastModified(?urn)",
- "?tooltip");
- categories_model.add_query (Tracker.Query.Type.BOOKMARKS,
- Tracker.Query.Match.FTS,
- "?urn",
- "nie:url(?bookmark)",
- "nie:title(?urn)",
- "nie:url(?bookmark)",
- "nie:contentLastModified(?urn)",
- "nie:url(?bookmark)");
-
- // Files model
- files_model = new ResultStore (7);
- files_model.limit = limit;
- files_model.result_overflow.connect (result_overflow);
- files_model.add_query (Tracker.Query.Type.ALL,
- Tracker.Query.Match.FTS,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "nie:url(?urn)",
- "nfo:fileSize(?urn)",
- "nfo:fileLastModified(?urn)",
- "nie:url(?urn)");
-
- files_in_title_model = new ResultStore (7);
- files_in_title_model.limit = limit;
- files_in_title_model.result_overflow.connect (result_overflow);
- files_in_title_model.add_query (Tracker.Query.Type.ALL,
- Tracker.Query.Match.TITLES,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "nie:url(?urn)",
- "nfo:fileSize(?urn)",
- "nfo:fileLastModified(?urn)",
- "nie:url(?urn)");
-
- files_in_tags_model = new ResultStore(7);
- files_in_tags_model.limit = limit;
- files_in_tags_model.result_overflow.connect (result_overflow);
- files_in_tags_model.add_query (Tracker.Query.Type.ALL,
- Tracker.Query.Match.TAGS_ONLY,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "nie:url(?urn)",
- "nfo:fileSize(?urn)",
- "nfo:fileLastModified(?urn)",
- "nie:url(?urn)");
-
- // Images model
- images_model = new ResultStore (6);
- images_model.limit = limit;
- images_model.result_overflow.connect (result_overflow);
- images_model.icon_size = 128;
- images_model.add_query (Tracker.Query.Type.IMAGES,
- Tracker.Query.Match.NONE,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
-// "nie:url(?urn)",
- "nfo:fileSize(?urn)",
- "nfo:fileLastModified(?urn)",
- "nie:url(?urn)");
-
- images_in_title_model = new ResultStore (6);
- images_in_title_model.limit = limit;
- images_in_title_model.result_overflow.connect (result_overflow);
- images_in_title_model.icon_size = 128;
- images_in_title_model.add_query (Tracker.Query.Type.IMAGES,
- Tracker.Query.Match.TITLES,
- "?urn",
- "nie:url(?urn)",
- "tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
- "nfo:fileSize(?urn)",
- "nfo:fileLastModified(?urn)",
- "nie:url(?urn)");
- }
-
- public Needle () {
- create_models ();
- history = new Tracker.History ();
-
- // Load Gsettings
- settings_needle = new GLib.Settings ("org.freedesktop.Tracker.Needle");
-
- settings_needle.changed.connect ((key) => {
- debug ("tracker-needle: Key %s changed\n", key);
- });
- }
-
- public void show () {
- setup_ui ();
-
- window.show ();
- }
-
- public void set_search (string[]? args) {
- if (args != null) {
- string text = "";
-
- foreach (string s in args) {
- if (text.length > 1)
- text += " ";
-
- text += s;
- }
-
- debug ("Setting search criteria to: '%s'\n", text);
- search.set_text (text);
- }
- }
-
- private void store_state_changed (GLib.Object object,
- ParamSpec p) {
- ResultStore store = (ResultStore) object;
-
- if (store.active) {
- spinner_shell.show_all ();
- spinner.start ();
- } else {
- spinner_shell.hide ();
- spinner.stop ();
- }
- }
-
- private void setup_ui () {
- var builder = new Gtk.Builder ();
- Button info_bar_button;
- Toolbar toolbar;
- Paned paned;
-
- try {
- builder.add_from_file (UIDIR + UI_FILE);
- } catch (GLib.Error e) {
- var msg = new MessageDialog (null,
- DialogFlags.MODAL,
- MessageType.ERROR,
- ButtonsType.CANCEL,
- "Failed to load UI file, %s\n",
- e.message);
- msg.run ();
- Gtk.main_quit();
- }
-
- Gtk.icon_size_lookup (Gtk.IconSize.MENU, out size_small, null);
- Gtk.icon_size_lookup (Gtk.IconSize.DND, out size_medium, null);
- Gtk.icon_size_lookup (Gtk.IconSize.DIALOG, out size_big, null);
-
- window = builder.get_object ("window_needle") as Gtk.Window;
- window.destroy.connect (window_closed);
- window.key_press_event.connect (window_key_press_event);
-
- toolbar = builder.get_object ("toolbar_main") as Toolbar;
- toolbar.get_style_context().add_class (STYLE_CLASS_PRIMARY_TOOLBAR);
-
- info_bar = builder.get_object ("info_bar") as InfoBar;
- info_bar_label = builder.get_object ("info_bar_label") as Label;
- info_bar_button = builder.get_object ("info_bar_button") as Button;
- info_bar_button.clicked.connect (info_bar_closed);
-
- view_filelist = builder.get_object ("toolbutton_view_filelist") as ToggleToolButton;
- view_filelist.toggled.connect (view_toggled);
- view_filelist.get_accessible().set_name("View File List");
- view_filelist.get_child().get_accessible().set_name("View File List RadioButton");
-
- view_icons = builder.get_object ("toolbutton_view_icons") as ToggleToolButton;
- view_icons.toggled.connect (view_toggled);
- view_icons.get_accessible().set_name("View Icons");
- view_icons.get_child().get_accessible().set_name("View Icons RadioButton");
-
- view_categories = builder.get_object ("toolbutton_view_categories") as ToggleToolButton;
- view_categories.toggled.connect (view_toggled);
- view_categories.get_accessible().set_name("View Categories");
- view_categories.get_child().get_accessible().set_name("View Categories RadioButton");
-
- separator_secondary = builder.get_object ("separator_secondary") as SeparatorToolItem;
-
- find_in_contents = builder.get_object ("toolbutton_find_in_contents") as ToggleToolButton;
- find_in_contents.toggled.connect (find_in_toggled);
- find_in_contents.get_accessible().set_name("Find in Contents");
- find_in_contents.get_child().get_accessible().set_name("Find in Contents");
-
- find_in_titles = builder.get_object ("toolbutton_find_in_titles") as ToggleToolButton;
- find_in_titles.toggled.connect (find_in_toggled);
- find_in_titles.get_accessible().set_name("Find in Titles");
- find_in_titles.get_child().get_accessible().set_name("Find in Titles");
-
- find_in_tags = builder.get_object ("toolbutton_find_in_tags") as ToggleToolButton;
- find_in_tags.toggled.connect (find_in_toggled);
- find_in_tags.get_accessible().set_name("Find in Tags");
- find_in_tags.get_child().get_accessible().set_name("Find in Tags");
-
- find_in_all = builder.get_object ("toolbutton_find_in_all") as ToggleToolButton;
- find_in_all.toggled.connect (find_in_toggled);
- find_in_all.get_accessible().set_name("Find in All");
- find_in_all.get_child().get_accessible().set_name("Find in All");
-
- search_entry = builder.get_object ("toolitem_search_entry") as ToolItem;
- search_entry.get_accessible().set_name("Search Entry");
-
- search_list = builder.get_object ("combobox_search") as ComboBox;
- search_list.get_accessible().set_name("Search List");
-
- search = search_list.get_child () as Entry;
- search.changed.connect (search_changed);
- search.activate.connect (search_activated);
- search.key_press_event.connect (search_key_press_event);
- search_history_insert (history.get ());
-
- spinner = new Spinner ();
- spinner_shell = builder.get_object ("toolcustom_spinner") as ToolItem;
- spinner_shell.add (spinner);
-
- show_tags = builder.get_object ("toolbutton_show_tags") as ToggleToolButton;
- show_tags.clicked.connect (show_tags_clicked);
- show_tags.get_accessible().set_name("Show Tags");
- show_tags.get_child().get_accessible().set_name("Show Tags");
-
- show_stats = builder.get_object ("toolbutton_show_stats") as ToolButton;
- show_stats.clicked.connect (show_stats_clicked);
- show_stats.get_accessible().set_name("Show Stats");
- show_stats.get_child().get_accessible().set_name("Show Stats");
-
- view = builder.get_object ("hbox_view") as Box;
-
- // Set up views
- TreeView treeview;
- IconView iconview;
- TreeSelection treeselection;
-
- sw_noresults = new Tracker.View (Tracker.View.Display.NO_RESULTS, null);
- view.pack_start (sw_noresults, true, true, 0);
-
- sw_categories = new Tracker.View (Tracker.View.Display.CATEGORIES, categories_model);
- sw_categories.store.notify["active"].connect (store_state_changed);
- treeview = (TreeView) sw_categories.get_child ();
- treeview.row_activated.connect (view_row_activated);
- treeselection = treeview.get_selection ();
- treeselection.changed.connect (view_row_selected);
- view.pack_start (sw_categories, true, true, 0);
-
- sw_filelist = new Tracker.View (Tracker.View.Display.FILE_LIST, null);
- treeview = (TreeView) sw_filelist.get_child ();
- treeview.row_activated.connect (view_row_activated);
- treeselection = treeview.get_selection ();
- treeselection.changed.connect (view_row_selected);
- view.pack_start (sw_filelist, true, true, 0);
-
- sw_icons = new Tracker.View (Tracker.View.Display.FILE_ICONS, null);
- iconview = (IconView) sw_icons.get_child ();
- iconview.item_activated.connect (icon_item_activated);
- iconview.selection_changed.connect (icon_view_selection_changed);
- view.pack_start (sw_icons, true, true, 0);
-
- // Set up tags widget
- paned = builder.get_object ("hpaned") as Paned;
- tags_view = new TrackerTagsView (null);
- tags_view.hide ();
- tags_view.hide_label ();
- paned.pack2 (tags_view, false, false);
-
- //Set up the default view
- view_categories.active = false;
- view_icons.active = false;
- view_filelist.active = false;
-
- //By default we assume Categories view
- default_view = settings_needle.get_int ("default-view");
-
- if (default_view == 0) {
- view_icons.active = true;
- } else if (default_view == 2) {
- view_filelist.active = true;
- } else {
- view_categories.active = true;
- }
- }
-
- private bool window_key_press_event (Gtk.Widget widget, Gdk.EventKey event) {
- // Add Ctrl+W close window semantics
- if (Gdk.ModifierType.CONTROL_MASK in event.state && Gdk.keyval_name (event.keyval) == "w") {
- widget.destroy();
- }
-
- return false;
- }
-
- private bool search_key_press_event (Gtk.Widget widget, Gdk.EventKey event) {
- if (Gdk.keyval_name (event.keyval) == "Down" ||
- Gdk.keyval_name (event.keyval) == "KP_Down") {
- var child = ((ScrolledWindow) current_view).get_child ();
-
- if (child != null) {
- child.grab_focus();
- }
- }
-
- return false;
- }
-
- private void search_changed (Editable editable) {
- if (last_search_id != 0) {
- Source.remove (last_search_id);
- }
-
- last_search_id = Timeout.add_seconds (1, search_run);
- }
-
- private void search_activated (Entry entry) {
- if (last_search_id != 0) {
- Source.remove (last_search_id);
- last_search_id = 0;
- }
-
- search_run ();
- }
-
- private void search_finished (ResultStore? store) {
- // Check if we have any results, if we don't change the view
- if (store == null || !store.has_results ()) {
- sw_noresults.show ();
- sw_icons.hide ();
- sw_categories.hide ();
- sw_filelist.hide ();
- }
- }
-
- private TreeIter? search_history_find_or_insert (string criteria, bool? add_to_model = false) {
- if (criteria.length < 1) {
- return null;
- }
-
- ComboBox combo = search_list as ComboBox;
- TreeModel model = combo.get_model ();
- string criteria_folded = criteria.casefold ();
-
- TreeIter iter;
- bool valid = model.iter_children (out iter, null);
-
- while (valid) {
- string text;
-
- model.get (iter, 0, out text, -1);
-
- string text_folded = text.casefold ();
-
- if (text_folded == criteria_folded) {
- return iter;
- }
-
- valid = model.iter_next (ref iter);
- }
-
- if (add_to_model) {
- TreeIter new_iter;
-
- Gtk.ListStore store = (Gtk.ListStore) model;
- store.prepend (out new_iter);
- store.set (new_iter, 0, criteria, -1);
-
- history.add (criteria);
- }
-
- return null;
- }
-
- private void search_history_insert (string[] history) {
- foreach (string criteria in history) {
- search_history_find_or_insert (criteria, true);
- }
- }
-
- private bool search_run () {
- last_search_id = 0;
-
- string str = search.get_text ();
- string criteria = str.strip ();
- ResultStore store = null;
-
- if (!show_tags.active) {
- if (criteria.length < 3) {
- // Allow empty search criteria for finding all
- if (!view_icons.active || !find_in_all.active) {
- search_finished (store);
- return false;
- }
- }
-
- search_history_find_or_insert (criteria, true);
- }
-
- // Show correct window
- sw_noresults.hide ();
- current_view = sw_noresults;
-
- if (view_icons.active) {
- sw_icons.show ();
- current_view = sw_icons;
-
- if (find_in_all.active) {
- store = images_model;
- } else {
- store = images_in_title_model;
- }
-
- sw_icons.store = store;
- } else {
- sw_icons.hide ();
- }
-
- if (view_categories.active) {
- sw_categories.show ();
- current_view = sw_categories;
- store = categories_model;
- } else {
- sw_categories.hide ();
- }
-
- if (view_filelist.active) {
- sw_filelist.show ();
- current_view = sw_filelist;
-
- if (find_in_tags.active) {
- store = files_in_tags_model;
- store.search_tags = search_tags();
- debug("Tags to look for: %s", string.joinv("; ", store.search_tags.data));
- } else if (find_in_contents.active) {
- store = files_model;
- } else {
- store = files_in_title_model;
- }
-
- sw_filelist.store = store;
- } else {
- sw_filelist.hide ();
- }
-
- if (store != null) {
- // We can set tags to search by but we don't anymore
- // except if user want explecitly search by tags only.
- if (!find_in_tags.active) {
- store.search_tags = null;
- }
- store.search_term = search.get_text ();
- }
-
- return false;
- }
-
- private void window_closed() {
- // Before exiting save the current view
- // By default, we assume categories view
- if (view_icons.active) {
- settings_needle.set_int ("default-view", 0);
- } else if (view_filelist.active) {
- settings_needle.set_int ("default-view", 2);
- } else {
- settings_needle.set_int ("default-view", 1);
- }
- Gtk.main_quit();
- }
-
- private void view_toggled () {
- if (!view_icons.active &&
- !view_filelist.active &&
- !view_categories.active) {
- return;
- }
-
- if (view_categories.active || view_filelist.active) {
- if (current_find_in_filelist) {
- find_in_contents.active = true;
- } else {
- find_in_titles.active = true;
- }
- } else if (view_icons.active) {
- if (current_find_in_icons) {
- find_in_titles.active = true;
- } else {
- find_in_all.active = true;
- }
- }
-
- // Show no results Window when switching
- sw_noresults.show ();
- sw_icons.hide ();
- sw_filelist.hide ();
- sw_categories.hide ();
-
- // Show/Hide secondary widgets
- separator_secondary.visible = view_filelist.active || view_icons.active;
- find_in_contents.visible = view_filelist.active;
- find_in_titles.visible = view_filelist.active || view_icons.active;
- find_in_tags.visible = view_filelist.active;
- find_in_all.visible = view_icons.active; // only show this in one view
-
- search_run ();
- //current_view = rows;
- }
-
- private void find_in_toggled () {
- if (!find_in_contents.active &&
- !find_in_titles.active &&
- !find_in_tags.active &&
- !find_in_all.active) {
- return;
- }
-
- if (find_in_contents.active) {
- debug ("Find in toggled to 'contents'");
-
- if (show_tags.active != true) {
- search_entry.sensitive = true;
- }
-
- search_run ();
- } else if (find_in_tags.active){
- debug ("Find in toggled to 'tags'");
-
- search_entry.sensitive = true;
- search_run();
- } else if (find_in_titles.active) {
- debug ("Find in toggled to 'titles'");
-
- if (show_tags.active != true) {
- search_entry.sensitive = true;
- }
-
- search_run ();
- } else if (find_in_all.active) {
- debug ("Find in toggled to 'all'");
-
- // We hide the entry in this case, which is special
- search_entry.sensitive = false;
-
- search_run ();
- }
-
- if (view_filelist.active) {
- current_find_in_filelist = find_in_contents.active;
- } else if (view_icons.active) {
- current_find_in_icons = find_in_titles.active;
- }
- }
-
- private void view_row_activated (TreeView view, TreePath path, TreeViewColumn column) {
- var model = view.get_model ();
- tracker_model_launch_selected (model, path, 1);
- }
-
- private void icon_item_activated (IconView view, TreePath path) {
- var model = view.get_model ();
- tracker_model_launch_selected (model, path, 1);
- }
-
- private void view_row_selected (TreeSelection selection) {
- TreeIter iter;
- TreeModel model = null;
- debug ("Row selection changed");
-
- List<TreePath> rows = selection.get_selected_rows (out model);
- List<string> uris = null;
-
- if (rows == null) {
- return;
- }
-
- foreach (TreePath path in rows) {
- if (model.get_iter (out iter, path)) {
- string uri;
-
- model.get (iter, 1, out uri, -1);
- debug ("--> %s", uri);
-
- if (uri != null) {
- uris.prepend (uri);
- }
- }
- }
-
- tags_view.set_files (uris);
- }
-
- private void icon_view_selection_changed () {
- IconView iconview;
- TreeModel model = null;
- debug ("Icon selection changed");
-
- iconview = (IconView) sw_icons.get_child ();
- model = iconview.get_model ();
- List<string> uris = null;
-
- iconview.selected_foreach ((iconview, path) => {
- TreeIter iter;
-
- if (model.get_iter (out iter, path)) {
- string uri;
-
- model.get (iter, 1, out uri, -1);
- debug ("--> %s", uri);
-
- if (uri != null) {
- uris.prepend (uri);
- }
- }
- });
-
- tags_view.set_files (uris);
- }
-
- private void show_tags_clicked () {
- if (show_tags.active) {
- debug ("Showing tags");
- tags_view.show ();
- //search_entry.sensitive = false;
- } else {
- debug ("Hiding tags");
- tags_view.hide ();
- //search_entry.sensitive = true;
- }
-
- // Re-run search to filter with or without tags
- // search_run ();
- }
-
- private void show_stats_clicked () {
- debug ("Showing stats dialog");
- Tracker.Stats s = new Tracker.Stats ();
- s.show ();
- }
-
- public void show_info_message (string message,
- Gtk.MessageType type) {
- info_bar.set_message_type (type);
- info_bar_label.set_markup (message);
- info_bar.show ();
- }
-
- private void info_bar_closed (Button source) {
- info_bar.hide ();
- }
-
- private GLib.GenericArray<string> search_tags(){
- GLib.GenericArray<string> tagArray = new GLib.GenericArray<string>();
-
- foreach (string tag in search.get_text ().split(",")){
- tagArray.add(tag) ;
- }
-
- return tagArray;
- }
-}
-
-static bool print_version = false;
-[CCode (array_length = false, array_null_terminated = true)]
-static string[] search_criteria = null;
-
-const OptionEntry[] options = {
- { "version",
- 'V',
- 0,
- OptionArg.NONE,
- ref print_version,
- N_("Print version"),
- null },
- { "", // G_OPTION_REMAINING
- 0,
- 0,
- OptionArg.STRING_ARRAY,
- ref search_criteria,
- N_("[SEARCH-CRITERIA]"),
- N_("[SEARCH-CRITERIA]") },
- { null }
-};
-
-static int main (string[] args) {
- OptionContext context = new OptionContext (_("Desktop Search user interface using Tracker"));
-
- try {
- context.set_help_enabled (true);
- context.add_main_entries (options, null);
- context.add_group (Gtk.get_option_group (true));
- context.parse (ref args);
- } catch (Error e) {
- printerr (e.message + "\n\n");
- printerr (context.get_help (true, null));
- return 1;
- }
-
- if (print_version) {
- string about = "";
- string license = "";
-
- about += "Tracker " + Config.PACKAGE_VERSION + "\n";
-
- license += "This program is free software and comes without any warranty.\n";
- license += "It is licensed under version 2 or later of the General Public ";
- license += "License which can be viewed at:\n";
- license += "\n";
- license += " http://www.gnu.org/licenses/gpl.txt\n";
-
- print ("\n" + about + "\n" + license + "\n");
- return 0;
- }
-
- Gtk.init (ref args);
-
- Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
- Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
- Intl.textdomain (Config.GETTEXT_PACKAGE);
-
- Tracker.Needle n = new Tracker.Needle ();
- n.show();
-
- n.set_search (search_criteria);
-
- Gtk.main ();
-
- return 0;
-}
diff --git a/src/tracker-needle/tracker-query.vala b/src/tracker-needle/tracker-query.vala
deleted file mode 100644
index 0a03e800c..000000000
--- a/src/tracker-needle/tracker-query.vala
+++ /dev/null
@@ -1,410 +0,0 @@
-//
-// Copyright 2010, Martyn Russell <martyn@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-using Tracker.Sparql;
-
-public class Tracker.Query {
- public enum Type {
- ALL,
- CONTACTS,
- APPLICATIONS,
- MUSIC,
- IMAGES,
- VIDEOS,
- DOCUMENTS,
- MAIL,
- CALENDAR,
- FOLDERS,
- BOOKMARKS
- }
-
- public enum Match {
- NONE,
- FTS,
- FTS_INDIRECT,
- TITLES,
- TITLES_INDIRECT,
- TAGS_ONLY,
- TAGS_ONLY_INDIRECT
- }
-
- private string [] match_clauses = {
- // NONE (i.e. just show all)
- "",
-
- // FTS
- "{
- ?urn fts:match \"%s\"
- } UNION {
- ?urn nao:hasTag ?tag .
- FILTER (fn:contains (fn:lower-case (nao:prefLabel(?tag)), \"%s\"))
- }",
-
- // FTS_INDIRECT (with sub-matching)
- "{
- ?match fts:match \"%s\"
- } UNION {
- ?match nao:hasTag ?tag .
- FILTER (fn:contains (fn:lower-case (nao:prefLabel(?tag)), \"%s\"))
- }",
-
- // TITLES
- "FILTER (fn:contains (fn:lower-case (nfo:fileName(?urn)), \"%s\"))",
-
- // TITLES_INDIRECT (with sub-matching)
- "FILTER (fn:contains (fn:lower-case (nie:title(?match)), \"%s\"))",
-
- // TAGS_ONLY (no fts:match, just nao:prefLabel matching, %s is filled in by get_tags_filter()
- "?urn nao:hasTag ?tag .
- FILTER (nao:prefLabel(?tag) IN (%s))",
-
- // TAGS_ONLY_INDIRECT (same as TAGS_ONLY for ?match)
- "?match nao:hasTag ?tag .
- FILTER (nao:prefLabel(?tag) IN (%s))"
- };
-
- private string [] where_clauses = {
- // ALL
- "WHERE {
- %s .
- ?urn nfo:belongsToContainer ?parent ;
- tracker:available true .
- }",
-
- // CONTACTS
- "",
-
- // APPLICATIONS
- "WHERE {
- ?urn a nfo:Software .
- %s
- }",
-
- // MUSIC
- "WHERE {
- {
- ?urn nmm:musicAlbum ?match
- } UNION {
- ?urn nmm:performer ?match
- } UNION {
- ?urn a nfo:Audio .
- ?match a nfo:Audio
- FILTER (?urn = ?match)
- }
- %s .
- ?urn nmm:performer [ nmm:artistName ?performer ] ;
- nmm:musicAlbum [ nie:title ?album ] ;
- nie:url ?tooltip .
- }",
-
- // IMAGES
- "WHERE {
- ?urn a nfo:Image ;
- nie:url ?tooltip .
- %s
- }",
-
- // VIDEOS
- "WHERE {
- ?urn a nfo:Video ;
- nie:url ?tooltip .
- %s
- }",
-
- // DOCUMENTS
- "WHERE {
- {
- ?urn nco:creator ?match
- } UNION {
- ?urn nco:publisher ?match
- } UNION {
- ?urn a nfo:Document .
- FILTER (! EXISTS { ?urn a nmo:Email } )
- ?match a nfo:Document
- FILTER (?urn = ?match)
- }
- %s .
- ?urn nie:url ?tooltip .
- OPTIONAL {
- ?urn nco:creator ?creator .
- }
- OPTIONAL {
- ?urn nco:publisher ?publisher .
- }
- }",
-
- // MAIL
- "WHERE {
- ?urn a nmo:Email ;
- nmo:from ?sender ;
- nmo:to ?to .
- %s
- }",
-
- // CALENDAR
- "",
-
- // FOLDERS
- "WHERE {
- ?urn a nfo:Folder ;
- nie:url ?tooltip .
- %s
- OPTIONAL {
- ?urn nfo:belongsToContainer ?parent .
- }
- }",
-
- // BOOKMARKS
- "WHERE {
- ?urn a nfo:Bookmark ;
- nfo:bookmarks ?bookmark .
- %s
- }"
- };
-
- private string [] sort_clauses = {
- // ALL
- "DESC(nfo:fileLastModified(?urn)) DESC(nie:contentCreated(?urn)) ASC(nie:title(?urn))",
-
- // CONTACTS
- "ASC(nco:fullname(?urn))",
-
- // APPLICATIONS
- "ASC(nie:title(?urn)) ASC(nie:comment(?urn))",
-
- // MUSIC
- "DESC(nfo:fileLastModified(?urn)) ASC(nie:title(?urn))",
-
- // IMAGES
- "DESC(nfo:fileLastModified(?urn)) ASC(nie:title(?urn))",
-
- // VIDEOS
- "DESC(nfo:fileLastModified(?urn)) ASC(nie:title(?urn))",
-
- // DOCUMENTS
- "DESC(nfo:fileLastModified(?urn)) ASC(nie:title(?urn))",
-
- // MAIL
- "DESC(nmo:receivedDate(?urn)) ASC(nmo:messageSubject(?urn))",
-
- // CALENDAR
- "DESC(nie:contentCreated(?urn))",
-
- // FOLDERS
- "DESC(nfo:fileLastModified(?urn)) ASC(nie:title(?urn))",
-
- // BOOKMARKS
- "DESC(nie:contentLastModified(?urn)) ASC(nie:title(?urn))"
- };
-
- public string criteria { get; set; }
- public uint offset { get; set; }
- public uint limit { get; set; }
- public string query { get; private set; }
-
- public GenericArray<string> tags { get; set; }
-
- private static Sparql.Connection connection;
-
- public Query () {
- try {
- connection = Sparql.Connection.get ();
- } catch (GLib.Error e) {
- warning ("Could not get Sparql connection: %s", e.message);
- }
-
- tags = null;
- }
-
- private string get_tags_filter () {
- string filter = "";
-
- if (tags != null && tags.length > 0) {
- for (int i = 0; i < tags.length; i++) {
- string escaped = Tracker.Sparql.escape_string (tags[i]);
-
- if (filter.length > 1)
- filter += ", ";
-
- filter += "\"%s\"".printf (escaped);
- }
- }
-
- return filter;
- }
-
- private bool check_query_and_match_type (Type query_type, Match match_type) {
- if (query_type != Type.IMAGES && match_type == Match.NONE) {
- critical ("You can not use a non-IMAGES query (%d) with NONE matching", query_type);
- return false;
- }
-
- if (query_type == Type.MUSIC && !(match_type == Match.FTS_INDIRECT ||
- match_type == Match.TITLES_INDIRECT)) {
- critical ("You can not use a MUSIC query with match TITLES or FTS, INDIRECT required");
- return false;
- }
-
- if ((query_type != Type.MUSIC && query_type != Type.DOCUMENTS) &&
- !(match_type == Match.NONE ||
- match_type == Match.FTS ||
- match_type == Match.TITLES ||
- match_type == Match.TAGS_ONLY)) {
- critical ("You can not use a non-MUSIC or non-DOCUMENTS query (%d) with INDIRECT matching (%d)", query_type, match_type);
- return false;
- }
-
- return true;
- }
-
- public async uint get_count_async (Type query_type, Match match_type, Cancellable? cancellable = null) throws IOError
- requires (connection != null) {
- Sparql.Cursor cursor = null;
-
- if (!check_query_and_match_type (query_type, match_type)) {
- return 0;
- }
-
- // If we have tags supplied, we ONLY show files from those tags
- if (tags != null && tags.length > 0) {
- if (match_type == Match.FTS_INDIRECT ||
- match_type == Match.TITLES_INDIRECT) {
- match_type = Match.TAGS_ONLY_INDIRECT;
- } else {
- match_type = Match.TAGS_ONLY;
- }
- }
- debug ("match_type:%d", match_type);
- if (match_type != Match.NONE &&
- match_type != Match.TAGS_ONLY &&
- match_type != Match.TAGS_ONLY_INDIRECT &&
- (criteria == null || criteria.length < 1)) {
- warning ("Criteria was NULL or an empty string no query performed");
- return 0;
- }
-
- string match;
-
- if (match_type == Match.TAGS_ONLY ||
- match_type == Match.TAGS_ONLY_INDIRECT) {
- match = match_clauses[match_type].printf (get_tags_filter ());
- } else {
- string criteria_escaped = Tracker.Sparql.escape_string (criteria);
-
- // FTS queries take 2 arguments for tags and fts:match
- if (match_type == Match.FTS ||
- match_type == Match.FTS_INDIRECT) {
- match = match_clauses[match_type].printf (criteria_escaped, criteria_escaped);
- } else {
- match = match_clauses[match_type].printf (criteria_escaped);
- }
- }
-
- query = "SELECT count(?urn)";
-
- if (where_clauses[query_type].length > 0) {
- query += " " + where_clauses[query_type].printf (match);
- }
-
- if (sort_clauses[query_type].length > 0) {
- query += " ORDER BY " + sort_clauses[query_type];
- }
-
- try {
- cursor = yield connection.query_async (query, null);
- yield cursor.next_async ();
- } catch (GLib.Error e) {
- warning ("Could not run Sparql count query: %s", e.message);
- }
-
- return (uint) cursor.get_integer (0);
- }
-
- public async Sparql.Cursor? perform_async (Type query_type, Match match_type, string[] ?args, Cancellable? cancellable = null) throws IOError
- requires (connection != null) {
- Sparql.Cursor cursor = null;
-
- if (!check_query_and_match_type (query_type, match_type)) {
- return null;
- }
-
- // If we have tags supplied, we ONLY show files from those tags
- if (tags != null && tags.length > 0) {
- if (match_type == Match.FTS_INDIRECT ||
- match_type == Match.TITLES_INDIRECT) {
- match_type = Match.TAGS_ONLY_INDIRECT;
- } else {
- match_type = Match.TAGS_ONLY;
- }
- }
-
- if (match_type != Match.NONE &&
- match_type != Match.TAGS_ONLY &&
- match_type != Match.TAGS_ONLY_INDIRECT &&
- (criteria == null || criteria.length < 1)) {
- warning ("Criteria was NULL or an empty string no query performed");
- return null;
- }
-
- if (limit < 1) {
- warning ("Limit was < 1, no query performed");
- return null;
- }
-
- string match;
-
- if (match_type == Match.TAGS_ONLY ||
- match_type == Match.TAGS_ONLY_INDIRECT) {
- match = match_clauses[match_type].printf (get_tags_filter ());
- } else {
- string criteria_escaped = Tracker.Sparql.escape_string (criteria);
-
- // FTS queries take 2 arguments for tags and fts:match
- if (match_type == Match.FTS ||
- match_type == Match.FTS_INDIRECT) {
- match = match_clauses[match_type].printf (criteria_escaped, criteria_escaped);
- } else {
- match = match_clauses[match_type].printf (criteria_escaped);
- }
- }
-
- query = "SELECT " + string.joinv (" ", args);
- if (where_clauses[query_type].length > 0) {
- query += " " + where_clauses[query_type].printf (match);
- }
-
- if (sort_clauses[query_type].length > 0) {
- query += " ORDER BY " + sort_clauses[query_type];
- }
-
- query += " OFFSET %u LIMIT %u".printf (offset, limit);
-
- debug ("Running query: '%s'", query);
-
- try {
- cursor = yield connection.query_async (query, null);
- } catch (GLib.Error e) {
- warning ("Could not run Sparql query: %s", e.message);
- }
-
- debug ("Done");
-
- return cursor;
- }
-}
diff --git a/src/tracker-needle/tracker-result-store.vala b/src/tracker-needle/tracker-result-store.vala
deleted file mode 100644
index 32192b3c5..000000000
--- a/src/tracker-needle/tracker-result-store.vala
+++ /dev/null
@@ -1,890 +0,0 @@
-//
-// Copyright 2010, Carlos Garnacho <carlos@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-using Gtk;
-
-public class Tracker.ResultStore : Gtk.TreeModel, GLib.Object {
- private GLib.Cancellable cancellable;
-
- private struct ResultNode {
- string [] values;
- Gdk.Pixbuf pixbuf;
- }
-
- private class CategoryNode {
- public Tracker.Query.Type type;
- public QueryData *query;
- public ResultNode [] results;
- public Gdk.Pixbuf pixbuf;
- public int count;
- }
-
- private struct QueryData {
- Tracker.Query.Type type;
- Tracker.Query.Match match;
- string [] args;
- }
-
- private QueryData [] queries;
- private GenericArray<CategoryNode> categories;
-
- private class Operation : GLib.Object {
- public CategoryNode node;
- public int offset;
- }
-
- private GenericArray<Operation> running_operations;
- private GenericArray<Operation> delayed_operations;
-
- private int n_extra_columns = 2; // Pixbuf and query type
- private int n_columns;
- private int timestamp;
-
- public int icon_size {
- get;
- set;
- }
-
- public uint limit {
- get;
- set;
- }
-
- public signal void result_overflow ();
-
- private Operation? find_operation (GenericArray<Operation> array, CategoryNode node, int offset) {
- Operation op;
- int i;
-
- for (i = 0; i < array.length; i++) {
- op = array[i];
-
- if (op.node == node &&
- op.offset == offset) {
- return op;
- }
- }
-
- return null;
- }
-
- async void load_operation (Operation op, Cancellable? cancellable) {
- Tracker.Query query;
- Sparql.Cursor cursor = null;
- int i;
-
- try {
- cancellable.set_error_if_cancelled ();
-
- query = new Tracker.Query ();
- query.criteria = _search_term;
- query.tags = search_tags;
- query.limit = limit;
- query.offset = op.offset;
-
- cursor = yield query.perform_async (op.node.query.type, op.node.query.match, op.node.query.args, cancellable);
-
- cancellable.set_error_if_cancelled ();
-
- if (cursor != null) {
- for (i = op.offset; i < op.offset + 100; i++) {
- ResultNode *result;
- TreeIter iter;
- TreePath path;
- bool b = false;
- int j;
-
- try {
- b = yield cursor.next_async (cancellable);
- } catch (GLib.Error ge) {
- if (!cancellable.is_cancelled ()) {
- warning ("Could not fetch row: %s\n", ge.message);
- }
- }
-
- if (!b) {
- break;
- }
-
- result = &op.node.results[i];
-
- for (j = 0; j < n_columns; j++) {
- if (j == n_columns - 1) {
- // FIXME: Set markup for tooltip column in a nicer way
- string s = cursor.get_string (j);
-
- if (s != null)
- result.values[j] = Markup.escape_text (s);
- else
- result.values[j] = null;
- } else {
- result.values[j] = cursor.get_string (j);
- }
- }
-
- // Emit row-changed
- iter = TreeIter ();
- iter.stamp = this.timestamp;
- iter.user_data = op.node;
- iter.user_data2 = result;
- iter.user_data3 = i.to_pointer ();
-
- path = this.get_path (iter);
- row_changed (path, iter);
- }
- }
-
- running_operations.remove (op);
- } catch (GLib.IOError ie) {
- if (!cancellable.is_cancelled ()) {
- warning ("Could not load items: %s\n", ie.message);
- }
- return;
- }
-
- if (delayed_operations.length > 0) {
- Operation next_to_start;
-
- // Take last added task from delayed queue and start it
- next_to_start = delayed_operations[delayed_operations.length - 1];
- delayed_operations.remove (next_to_start);
- running_operations.add (next_to_start);
-
- load_operation.begin (next_to_start, cancellable);
- } else if (running_operations.length == 0) {
- // finished processing
- this.active = false;
- }
- }
-
- private void add_operation (CategoryNode cat, int offset) {
- Operation op = new Operation ();
- Operation old;
-
- op.node = cat;
- op.offset = offset;
-
- if (find_operation (running_operations, cat, offset) != null) {
- // Operation already running
- return;
- }
-
- // If the task is delayed, it will be either pushed
- // to the running queue, or reordered to be processed
- // next in the delayed queue.
- old = find_operation (delayed_operations, cat, offset);
-
- if (old != null) {
- delayed_operations.remove (old);
- }
-
- this.active = true;
-
- // Running queue is limited to 2 simultaneous queries,
- // anything after that will be added to a different queue.
- if (running_operations.length < 2) {
- running_operations.add (op);
-
- // Start the operation right away
- load_operation.begin (op, cancellable);
- } else {
- // Reorder the operation if it was already there, else just add
- delayed_operations.add (op);
- }
- }
-
- async void load_category (QueryData *query_data, Cancellable? cancellable) {
- uint count = 0;
-
- try {
- cancellable.set_error_if_cancelled ();
-
- Tracker.Query query = new Tracker.Query ();
- query.criteria = _search_term;
- query.tags = search_tags;
-
- count = yield query.get_count_async (query_data.type, query_data.match, cancellable);
- cancellable.set_error_if_cancelled ();
- } catch (GLib.IOError ie) {
- if (!cancellable.is_cancelled ()) {
- warning ("Could not get count: %s\n", ie.message);
- }
- return;
- }
-
- if (count != 0) {
- CategoryNode cat;
- ResultNode *res;
- int i;
-
- if (count > limit) {
- result_overflow ();
- count = limit;
- }
-
- Gtk.TreeIter iter;
- Gtk.TreePath path;
-
- cat = new CategoryNode ();
- cat.type = query_data.type;
- cat.query = query_data;
- cat.results.resize ((int) count);
- categories.add (cat);
-
- iter = TreeIter ();
- iter.stamp = this.timestamp;
- iter.user_data = cat;
-
- if (queries.length > 1) {
- path = this.get_path (iter);
- row_inserted (path, iter);
- }
-
- for (i = 0; i < count; i++) {
- res = &cat.results[i];
- res.values = new string[n_columns];
-
- iter.user_data2 = res;
- iter.user_data3 = i.to_pointer ();
- path = this.get_path (iter);
-
- cat.count++;
- row_inserted (path, iter);
- }
-
- if (queries.length > 1) {
- iter.user_data2 = null;
- iter.user_data3 = null;
- path = get_path (iter);
-
- row_changed (path, iter);
- }
- }
-
- if (running_operations.length == 0) {
- this.active = false;
- }
- }
-
- private void clear_results () {
- int j;
-
- while (categories.length > 0) {
- CategoryNode cat = categories[0];
- TreeIter iter;
- TreePath path;
-
- if (cat.results.length == 0) {
- continue;
- }
-
- iter = TreeIter ();
- iter.stamp = this.timestamp;
- iter.user_data = cat;
-
- for (j = cat.count - 1; j >= 0; j--) {
- iter.user_data2 = &cat.results[j];
- iter.user_data3 = j.to_pointer ();
- path = get_path (iter);
-
- row_deleted (path);
- cat.count--;
- }
-
- if (queries.length > 1) {
- iter.user_data2 = null;
- iter.user_data3 = null;
- path = get_path (iter);
-
- row_deleted (path);
- }
-
- categories.remove (cat);
- }
- }
-
- private string _search_term;
- public string search_term {
- get {
- return _search_term;
- }
- set {
- int i;
-
- cancel_search ();
- _search_term = value;
-
- cancellable = new Cancellable ();
-
- this.active = true;
-
- categories = new GenericArray<CategoryNode> ();
- running_operations = new GenericArray<Operation?> ();
- delayed_operations = new GenericArray<Operation?> ();
- this.timestamp++;
-
- for (i = 0; i < queries.length; i++) {
- load_category.begin (&queries[i], cancellable);
- }
- }
- }
-
- public GenericArray<string> search_tags { get; set; }
-
- public bool active {
- get;
- private set;
- }
-
- private int find_nth_category_index (CategoryNode? node, int n) {
- int i;
-
- if (node == null) {
- // Count from the first one
- return n;
- }
-
- for (i = 0; i < categories.length; i++) {
- CategoryNode cat;
-
- cat = categories[i];
-
- if (cat == node) {
- return i + n;
- }
- }
-
- return -1;
- }
-
- private int filled_categories_count () {
- int i, n = 0;
-
- for (i = 0; i < categories.length; i++) {
- CategoryNode cat;
-
- cat = categories[i];
-
- if (cat.count > 0) {
- n++;
- }
- }
-
- return n;
- }
-
- public GLib.Type get_column_type (int index_) {
- if (index_ == n_columns) {
- return typeof (Gdk.Pixbuf);
- } else if (index_ == n_columns + 1) {
- return typeof (Tracker.Query.Type);
- } else {
- return typeof (string);
- }
- }
-
- public Gtk.TreeModelFlags get_flags () {
- Gtk.TreeModelFlags flags;
-
- flags = Gtk.TreeModelFlags.ITERS_PERSIST;
-
- if (queries.length == 1) {
- flags |= Gtk.TreeModelFlags.LIST_ONLY;
- }
-
- return flags;
- }
-
- public bool get_iter (out Gtk.TreeIter iter, Gtk.TreePath path) {
- unowned int [] indices = path.get_indices ();
- CategoryNode cat;
- int i = 0;
-
- iter = TreeIter ();
-
- if (queries.length > 1) {
- if (indices[i] >= categories.length) {
- iter.stamp = 0;
- return false;
- }
-
- cat = categories[indices[i]];
- i++;
- } else {
- if (categories.length == 0) {
- iter.stamp = 0;
- return false;
- }
-
- cat = categories[0];
- }
-
- iter.stamp = this.timestamp;
- iter.user_data = cat;
-
- if (path.get_depth () == i + 1) {
- // it's a result
- if (indices[i] >= cat.count) {
- iter.stamp = 0;
- return false;
- }
-
- iter.user_data2 = &cat.results[indices[i]];
- iter.user_data3 = indices[i].to_pointer ();
- }
-
- return true;
- }
-
- public int get_n_columns () {
- return n_columns + n_extra_columns;
- }
-
-#if VALA_0_14
- public Gtk.TreePath? get_path (Gtk.TreeIter iter) {
-#else
- public Gtk.TreePath get_path (Gtk.TreeIter iter) {
-#endif
- TreePath path = new TreePath ();
- CategoryNode cat;
- int i;
-
- if (queries.length > 1) {
- for (i = 0; i < categories.length; i++) {
- cat = categories[i];
-
- if (cat == iter.user_data) {
- path.append_index (i);
- break;
- }
- }
- }
-
- if (iter.user_data2 != null) {
- path.append_index ((int) (long) iter.user_data3);
- }
-
- return path;
- }
-
- private async void fetch_thumbnail (TreeIter iter) {
- GLib.File file;
- GLib.FileInfo info;
- ResultNode *result;
- string thumb_path;
- Gdk.Pixbuf pixbuf = null;
-
- result = iter.user_data2;
-
- // Query thumbnail to GIO
- file = GLib.File.new_for_uri (result.values[1]);
-
- try {
- info = yield file.query_info_async ("thumbnail::path,standard::icon",
- GLib.FileQueryInfoFlags.NONE,
- GLib.Priority.DEFAULT,
- cancellable);
- } catch (GLib.Error ie) {
- if (!cancellable.is_cancelled ()) {
- warning ("Could not get thumbnail: %s", ie.message);
- }
- return;
- }
-
- thumb_path = info.get_attribute_byte_string ("thumbnail::path");
-
- try {
- if (thumb_path != null) {
- pixbuf = new Gdk.Pixbuf.from_file_at_size (thumb_path, icon_size, icon_size);
- } else {
- GLib.Icon icon;
- Gtk.IconInfo icon_info;
-
- icon = (GLib.Icon) info.get_attribute_object ("standard::icon");
-
- if (icon == null) {
- return;
- }
-
- var theme = IconTheme.get_for_screen (Gdk.Screen.get_default ());
- icon_info = theme.lookup_by_gicon (icon, icon_size, 0); // Gtk.IconLookupFlags.FORCE_SIZE
-
- if (icon_info == null) {
- return;
- }
-
- pixbuf = icon_info.load_icon ();
- }
- } catch (GLib.Error e) {
- warning ("Could not get icon pixbuf: %s\n", e.message);
- }
-
- if (pixbuf != null) {
- TreePath path;
-
- result.pixbuf = pixbuf;
- path = get_path (iter);
- row_changed (path, iter);
- }
- }
-
- public void get_value (Gtk.TreeIter iter, int column, out GLib.Value value) {
- CategoryNode cat;
-
- value = GLib.Value (this.get_column_type (column));
-
- if (column >= n_columns + n_extra_columns) {
- return;
- }
-
- cat = (CategoryNode) iter.user_data;
-
- if (column == n_columns + 1) {
- // Type column
- value.set_enum (cat.type);
- return;
- }
-
- if (iter.user_data2 == null) {
- if (column == n_columns) {
- Gdk.Pixbuf pixbuf;
-
- pixbuf = cat.pixbuf;
-
- if (pixbuf == null) {
- var theme = IconTheme.get_for_screen (Gdk.Screen.get_default ());
- int size = icon_size;
-
- switch (cat.type) {
- case Tracker.Query.Type.APPLICATIONS:
- pixbuf = tracker_pixbuf_new_from_name (theme, "package-x-generic", size);
- break;
- case Tracker.Query.Type.MUSIC:
- pixbuf = tracker_pixbuf_new_from_name (theme, "audio-x-generic", size);
- break;
- case Tracker.Query.Type.IMAGES:
- pixbuf = tracker_pixbuf_new_from_name (theme, "image-x-generic", size);
- break;
- case Tracker.Query.Type.VIDEOS:
- pixbuf = tracker_pixbuf_new_from_name (theme, "video-x-generic", size);
- break;
- case Tracker.Query.Type.DOCUMENTS:
- pixbuf = tracker_pixbuf_new_from_name (theme, "x-office-presentation", size);
- break;
- case Tracker.Query.Type.MAIL:
- pixbuf = tracker_pixbuf_new_from_name (theme, "emblem-mail", size);
- break;
- case Tracker.Query.Type.FOLDERS:
- pixbuf = tracker_pixbuf_new_from_name (theme, "folder", size);
- break;
- case Tracker.Query.Type.BOOKMARKS:
- pixbuf = tracker_pixbuf_new_from_name (theme, "web-browser", size);
- break;
- }
- }
-
- value.set_object (pixbuf);
- }
- } else {
- ResultNode *result;
- int n_node;
-
- result = iter.user_data2;
- n_node = (int) (long) iter.user_data3;
-
- if (result.values[0] != null) {
- if (column == n_columns ) {
- if (result.pixbuf != null) {
- value.set_object (result.pixbuf);
- } else if (queries.length == 1) {
- fetch_thumbnail.begin (iter);
- }
- } else {
- value.set_string (result.values[column]);
- }
- } else {
- n_node /= 100;
- n_node *= 100;
-
- add_operation (cat, n_node);
- }
- }
- }
-
- public bool iter_children (out Gtk.TreeIter iter, Gtk.TreeIter? parent) {
- CategoryNode cat;
-
- iter = TreeIter ();
-
- if (parent == null) {
- if (categories.length == 0) {
- iter.stamp = 0;
- return false;
- }
-
- if (queries.length > 1) {
- int i;
-
- i = find_nth_category_index (null, 0);
- cat = categories[i];
- iter.stamp = this.timestamp;
- iter.user_data = cat;
- return true;
- } else {
- iter.stamp = this.timestamp;
- iter.user_data = categories[0];
- iter.user_data2 = &cat.results[0];
- iter.user_data3 = 0.to_pointer ();
- return true;
- }
- }
-
- if (parent.user_data2 != null) {
- iter.stamp = 0;
- return false;
- }
-
- cat = (CategoryNode) parent.user_data;
-
- if (cat.results.length <= 0) {
- iter.stamp = 0;
- return false;
- }
-
- iter.stamp = this.timestamp;
- iter.user_data = cat;
- iter.user_data2 = &cat.results[0];
- iter.user_data3 = 0.to_pointer ();
-
- return true;
- }
-
- public bool iter_has_child (Gtk.TreeIter iter) {
- if (iter.user_data2 == null) {
- CategoryNode cat;
-
- cat = (CategoryNode) iter.user_data;
- return (cat.count > 0);
- }
-
- return false;
- }
-
- public int iter_n_children (Gtk.TreeIter? iter) {
- if (iter == null) {
- if (queries.length > 1) {
- return categories.length - 1;
- } else if (categories.length > 0) {
- return categories[0].count;
- } else {
- return -1;
- }
- }
-
- if (iter.user_data2 != null) {
- // a result doesn't have children
- return -1;
- }
-
- CategoryNode cat = (CategoryNode) iter.user_data;
-
- return cat.count;
- }
-
- public bool iter_next (ref Gtk.TreeIter iter) {
- CategoryNode cat;
- int i;
-
- cat = (CategoryNode) iter.user_data;
-
- if (iter.user_data2 == null) {
- i = find_nth_category_index (cat, 1);
-
- if (i < 0 || i >= categories.length) {
- iter.stamp = 0;
- return false;
- }
-
- iter.stamp = this.timestamp;
- iter.user_data = categories[i];
-
- return true;
- } else {
- // Result node
- i = (int) (long) iter.user_data3;
- i++;
-
- if (i >= cat.count) {
- iter.stamp = 0;
- return false;
- }
-
- iter.user_data2 = &cat.results[i];
- iter.user_data3 = i.to_pointer ();
-
- return true;
- }
- }
-
- public bool iter_nth_child (out Gtk.TreeIter iter, Gtk.TreeIter? parent, int n) {
- CategoryNode cat;
-
- iter = TreeIter ();
-
- if (parent != null) {
- cat = (CategoryNode) parent.user_data;
-
- if (n >= cat.count) {
- iter.stamp = 0;
- return false;
- }
-
- iter.stamp = this.timestamp;
- iter.user_data = cat;
- iter.user_data2 = &cat.results[n];
- iter.user_data3 = n.to_pointer ();
- return true;
- } else {
- int index;
-
- if (queries.length > 1) {
- index = find_nth_category_index (null, n);
-
- if (index < 0 || index >= categories.length) {
- iter.stamp = 0;
- return false;
- }
- } else {
- index = 0;
- }
-
- cat = categories[index];
- iter.stamp = this.timestamp;
- iter.user_data = cat;
-
- if (queries.length > 1) {
- iter.user_data2 = &cat.results[0];
- iter.user_data3 = 0.to_pointer ();
- }
-
- return true;
- }
- }
-
- public bool iter_parent (out Gtk.TreeIter iter, Gtk.TreeIter child) {
- iter = TreeIter ();
-
- if (queries.length > 1 &&
- child.user_data2 != null) {
- // child within a category
- iter.stamp = this.timestamp;
- iter.user_data = child.user_data;
- iter.user_data2 = null;
- iter.user_data3 = null;
- return true;
- }
-
- iter.stamp = 0;
- return false;
- }
-
- public void ref_node (Gtk.TreeIter iter) {
- }
-
- public void unref_node (Gtk.TreeIter iter) {
- }
-
- private void theme_changed (IconTheme theme) {
- TreeIter iter;
- int i, j;
-
- iter = TreeIter ();
- iter.stamp = this.timestamp;
-
- for (i = 0; i < categories.length; i++) {
- CategoryNode cat = categories[i];
-
- iter.user_data = cat;
-
- for (j = cat.count - 1; j >= 0; j--) {
- var result = cat.results[j];
-
- iter.user_data2 = &cat.results[j];
- iter.user_data3 = j.to_pointer ();
-
- if (result.pixbuf != null) {
- fetch_thumbnail.begin (iter);
- }
- }
- }
- }
-
- public ResultStore (int _n_columns) {
- categories = new GenericArray<CategoryNode> ();
- running_operations = new GenericArray<Operation?> ();
- delayed_operations = new GenericArray<Operation?> ();
-
- n_columns = _n_columns;
- timestamp = 1;
- icon_size = 24; // Default value, overridden by tracker-needle.vala
-
- var theme = IconTheme.get_for_screen (Gdk.Screen.get_default ());
- theme.changed.connect (theme_changed);
- }
-
- public void add_query (Tracker.Query.Type type, Tracker.Query.Match match, ...) {
- var l = va_list ();
- string str = null;
- string [] args = null;
- QueryData query_data;
-
- do {
- str = l.arg ();
-
- if (str != null) {
- args += str;
- }
- } while (str != null);
-
- if (args.length != n_columns ) {
- warning ("Arguments and number of columns doesn't match");
- return;
- }
-
- query_data = QueryData ();
- query_data.type = type;
- query_data.match = match;
- query_data.args = args;
-
- queries += query_data;
- }
-
- public bool has_results () {
- return filled_categories_count () > 0;
- }
-
- public void cancel_search () {
- if (cancellable != null) {
- cancellable.cancel ();
- cancellable = null;
- }
-
- clear_results ();
- }
-}
diff --git a/src/tracker-needle/tracker-stats.vala b/src/tracker-needle/tracker-stats.vala
deleted file mode 100644
index f86714e97..000000000
--- a/src/tracker-needle/tracker-stats.vala
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// Copyright 2010, Martyn Russell <martyn@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-using Gtk;
-
-// Added to fix #error for GETTEXT_PACKAGE
-private const string b = Config.PACKAGE_NAME;
-
-[DBus (name = "org.freedesktop.Tracker1.Statistics")]
-interface Statistics : DBusProxy {
- public abstract string[,] Get () throws DBusError;
-}
-
-public class Tracker.Stats : Dialog {
- private Statistics tracker;
-
- public Stats () {
- this.title = "Statistics";
- this.border_width = 12;
- this.resizable = false;
-
- setup_dbus ();
- setup_ui ();
- }
-
- private void setup_dbus () {
- debug ("Setting up statistics D-Bus connection");
-
- try {
- tracker = GLib.Bus.get_proxy_sync (BusType.SESSION,
- "org.freedesktop.Tracker1",
- "/org/freedesktop/Tracker1/Statistics",
- DBusProxyFlags.DO_NOT_LOAD_PROPERTIES | DBusProxyFlags.DO_NOT_CONNECT_SIGNALS);
- } catch (GLib.IOError e) {
- var msg = new MessageDialog (null,
- DialogFlags.MODAL,
- MessageType.ERROR,
- ButtonsType.CANCEL,
- "Error connecting to D-Bus session bus, %s",
- e.message);
- msg.run ();
- Gtk.main_quit ();
- }
- }
-
- private void setup_ui () {
- debug ("Setting up statistics UI");
-
- // Spacing between major units
- var vbox = this.get_content_area() as Box;
- vbox.set_spacing (18);
- vbox.set_border_width (0);
-
- // Label for dialog
- var label = new Label (_("The statistics represented here do not reflect their availability, rather the total data stored:"));
- label.set_line_wrap (true);
- label.set_max_width_chars (50);
- label.set_alignment (0.0f, 0.5f);
-
- // NOTE: We can't use this NEW API because it doesn't work, GTK+ doesn't have a fix yet.
- // label.set_halign (Gtk.Align.START);
- // label.set_valign (Gtk.Align.CENTER);
- // label.set_justify (Gtk.Justification.LEFT);
- vbox.pack_start (label, true, true, 0);
-
- // Size group to line up labels
- var sizegroup = new SizeGroup (Gtk.SizeGroupMode.HORIZONTAL);
-
- try {
- var result = tracker.Get ();
-
- for (int i = 0; i < result.length[0]; i++) {
- var key = result[i,0];
- var val = result[i,1];
- string key_used;
-
- debug ("--> %s = %s", key, val);
-
- switch (key) {
- case "nao:Tag":
- key_used = ngettext ("Tag", "Tags", int.parse (val));
- break;
- case "nco:Contact":
- key_used = ngettext ("Contact", "Contacts", int.parse (val));
- break;
- case "nfo:Audio":
- key_used = ngettext ("Audio", "Audios", int.parse (val));
- break;
- case "nfo:Document":
- key_used = ngettext ("Document", "Documents", int.parse (val));
- break;
- case "nfo:FileDataObject":
- key_used = ngettext ("File", "Files", int.parse (val));
- break;
- case "nfo:Folder":
- key_used = ngettext ("Folder", "Folders", int.parse (val));
- break;
- case "nfo:Image":
- key_used = ngettext ("Image", "Images", int.parse (val));
- break;
- case "nfo:SoftwareApplication":
- key_used = ngettext ("Application", "Applications", int.parse (val));
- break;
- case "nfo:Video":
- //case "nmm:Video":
- key_used = ngettext ("Video", "Videos", int.parse (val));
- break;
- case "nmm:MusicAlbum":
- key_used = ngettext ("Album", "Albums", int.parse (val));
- break;
- case "nmm:MusicPiece":
- key_used = ngettext ("Music Track", "Music Tracks", int.parse (val));
- break;
- case "nmm:Photo":
- key_used = ngettext ("Photo", "Photos", int.parse (val));
- break;
- case "nmm:Playlist":
- key_used = ngettext ("Playlist", "Playlists", int.parse (val));
- break;
- case "nmo:Email":
- key_used = ngettext ("Email", "Emails", int.parse (val));
- break;
- case "nfo:Bookmark":
- key_used = ngettext ("Bookmark", "Bookmarks", int.parse (val));
- break;
-
- default:
- continue;
- }
-
- var box = new Box (Gtk.Orientation.HORIZONTAL, 12);
- var label_key = new Label (key_used);
- var label_val = new Label (val);
-
- // NOTE: We can't use this NEW API because it doesn't work, GTK+ doesn't have a fix yet.
- // label_key.set_justify (Gtk.Justification.LEFT);
- // label_key.set_halign (Gtk.Align.START);
- // label_key.set_valign (Gtk.Align.CENTER);
- // label_val.set_justify (Gtk.Justification.LEFT);
- // label_val.set_halign (Gtk.Align.START);
- // label_val.set_valign (Gtk.Align.CENTER);
- label_key.set_alignment (0.0f, 0.5f);
- label_val.set_alignment (0.0f, 0.5f);
-
- box.pack_start (label_key, true, true, 0);
- box.pack_start (label_val, false, true, 0);
-
- sizegroup.add_widget (label_key);
-
- vbox.pack_start (box, true, true, 0);
- }
- } catch (DBusError e) {
- warning ("Could not get Tracker statistics: " + e.message);
- }
-
- // Layout widgets
- vbox.set_spacing (10);
-
- // Add buttons to button area at the bottom
- add_button ("_Close", ResponseType.CLOSE);
-
- // Connect signals
- this.response.connect (on_response);
-
- show_all ();
- }
-
- private void on_response (Dialog source, int response_id) {
- switch (response_id) {
- case ResponseType.CLOSE:
- destroy ();
- break;
- }
- }
-}
diff --git a/src/tracker-needle/tracker-tags-view.vala b/src/tracker-needle/tracker-tags-view.vala
deleted file mode 100644
index 565bb5e39..000000000
--- a/src/tracker-needle/tracker-tags-view.vala
+++ /dev/null
@@ -1,834 +0,0 @@
-/*
- * Copyright (C) 2011, Martyn Russell <martyn@lanedo.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-using Gtk;
-using Tracker;
-
-private class TagData {
- public TrackerTagsView tv;
- public Cancellable cancellable;
- public string tag_id;
- public TreeIter iter;
- public int items;
- public bool update;
- public bool selected;
-
- public TagData (string? _tag_id, TreeIter? _iter, bool _update, bool _selected, int _items, TrackerTagsView _tv) {
- debug ("Creating tag data");
-
- tv = _tv;
- cancellable = new Cancellable ();
- tag_id = _tag_id;
-
- if (_iter != null) {
- iter = _iter;
- }
-
- items = _items;
- update = _update;
- selected = _selected;
- }
-
- ~TagData () {
- if (cancellable != null) {
- cancellable.cancel ();
- cancellable = null;
- }
- }
-}
-
-public class TrackerTagsView : Box {
- private Sparql.Connection connection;
- private Cancellable cancellable;
-
- private List<TagData> tag_data_requests;
- private List<string> files;
-
- private Gtk.ListStore store;
-
- private const string UI_FILE = "tracker-needle.ui";
-
- private Box vbox;
- private Label label;
- private Entry entry;
- private Button button_add;
- private Button button_remove;
- private ScrolledWindow scrolled_window;
- private TreeView view;
-
- enum Col {
- SELECTION,
- TAG_ID,
- TAG_NAME,
- TAG_COUNT,
- TAG_COUNT_VALUE,
- N_COLUMNS
- }
-
- enum Selection {
- INCONSISTENT = -1,
- FALSE = 0,
- TRUE = 1
- }
-
- public TrackerTagsView (owned List<string>? _files) {
- try {
- connection = Sparql.Connection.get ();
- } catch (GLib.Error e) {
- warning ("Could not get Sparql connection: %s", e.message);
- }
-
- files = (owned) _files;
-
- cancellable = new Cancellable ();
-
- store = new Gtk.ListStore (Col.N_COLUMNS,
- typeof (int), /* Selection type */
- typeof (string), /* Tag ID */
- typeof (string), /* Tag Name */
- typeof (string), /* Tag Count String */
- typeof (int)); /* Tag Count */
-
- create_ui ();
- }
-
- ~TrackerTagsView () {
- if (cancellable != null) {
- cancellable.cancel ();
- cancellable = null;
- }
-
- if (files != null) {
- foreach (string url in files) {
- url = null;
- }
-
- files = null;
- }
-
- if (tag_data_requests != null) {
- foreach (TagData td in tag_data_requests) {
- td = null;
- };
-
- tag_data_requests = null;
- }
- }
-
- public void hide_label () {
- label.hide ();
- }
-
- public void set_files (List<string>? _files) {
- if (files != null) {
- foreach (string url in files) {
- url = null;
- }
-
- files = null;
- }
-
- if (_files != null) {
- foreach (string url in _files) {
- files.prepend (url);
- }
-
- files.reverse ();
- }
-
- update_for_files ();
- }
-
- private void show_error_dialog (string action, Error e) {
- string str = e.message != null ? e.message : _("No error given");
-
- var msg = new MessageDialog (null,
- DialogFlags.MODAL,
- MessageType.ERROR,
- ButtonsType.CLOSE,
- "%s",
- action);
- msg.format_secondary_text (str);
- msg.response.connect (() => {
- msg.destroy ();
- });
-
- msg.run ();
- }
-
- [CCode (instance_pos = -1)]
- public void button_remove_clicked_cb (Button source) {
- debug ("Remove clicked");
-
- TreeIter iter;
- TreeModel model;
-
- TreeSelection selection = view.get_selection ();
-
- if (selection.get_selected (out model, out iter)) {
- string id;
-
- model.get (iter, Col.TAG_ID, out id, -1);
-
- TagData td = new TagData (id, iter, false, true, 1, this);
- tag_data_requests.prepend (td);
-
- remove_tag.begin (td);
- }
- }
-
- [CCode (instance_pos = -1)]
- public void button_add_clicked_cb (Button source) {
- debug ("Add clicked");
- unowned string tag = entry.get_text ();
- add_tag.begin (tag);
- }
-
- [CCode (instance_pos = -1)]
- public void entry_tag_activated_cb (Entry source) {
- debug ("Entry activated");
- ((Widget) button_add).activate ();
- }
-
- [CCode (instance_pos = -1)]
- public void entry_tag_changed_cb (Editable source) {
- debug ("Entry changed");
-
- unowned string tag = entry.get_text ();
- TreeIter iter;
-
- if (find_tag (tag, out iter)) {
- ((Widget) button_add).set_sensitive (false);
- } else {
- ((Widget) button_add).set_sensitive ((tag != null && tag != ""));
- }
- }
-
- [CCode (instance_pos = -1)]
- public void treeview_tags_cell_toggled_cb (CellRendererToggle source, string path_string) {
- debug ("Treeview row cell toggled");
- TreePath path = new TreePath.from_string (path_string);
- model_toggle_row.begin (path);
- }
-
- [CCode (instance_pos = -1)]
- public void treeview_tags_row_selected_cb (TreeSelection selection) {
- debug ("Treeview row selected");
-
- TreeIter iter;
- TreeModel model;
-
- if (selection.get_selected (out model, out iter)) {
- button_remove.set_sensitive (true);
- } else {
- button_remove.set_sensitive (false);
- }
- }
-
- [CCode (instance_pos = -1)]
- public void treeview_tags_row_activated_cb (TreeView source, TreePath path, TreeViewColumn column) {
- debug ("Treeview row activated");
- model_toggle_row.begin (path);
- }
-
- [CCode (instance_pos = -1)]
- private void treeview_tags_toggle_cell_data_func (Gtk.CellLayout layout, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
- int selection;
-
- model.get (iter, Col.SELECTION, out selection, -1);
- ((Gtk.CellRendererToggle) cell).set_active (selection == Selection.TRUE);
- ((Gtk.CellRendererToggle) cell).inconsistent = (selection == Selection.INCONSISTENT);
- }
-
- private void create_ui () {
- var builder = new Gtk.Builder ();
-
- try {
- debug ("Trying to use UI file:'%s'", UIDIR + UI_FILE);
- builder.add_from_file (UIDIR + UI_FILE);
- } catch (GLib.Error e) {
- var msg = new MessageDialog (null,
- DialogFlags.MODAL,
- MessageType.ERROR,
- ButtonsType.CANCEL,
- "Failed to load UI file, %s\n",
- e.message);
- msg.run ();
- Gtk.main_quit ();
- }
-
- // Get widgets from .ui file
- vbox = builder.get_object ("vbox_tags") as Box;
- label = builder.get_object ("label_tag") as Label;
- entry = builder.get_object ("entry_tag") as Entry;
- button_add = builder.get_object ("button_add") as Button;
- button_remove = builder.get_object ("button_remove") as Button;
- scrolled_window = builder.get_object ("scrolled_window_tags") as ScrolledWindow;
- view = builder.get_object ("treeview_tags") as TreeView;
-
- // Set up signal handlers (didn't work from glade)
- ((Editable) entry).changed.connect (entry_tag_changed_cb);
- button_add.clicked.connect (button_add_clicked_cb);
- button_remove.clicked.connect (button_remove_clicked_cb);
-
- // Set up treeview
- Gtk.TreeViewColumn col;
- Gtk.CellRenderer renderer;
-
- // List column: Tag
- renderer = new CellRendererToggle ();
- renderer.xpad = 5;
- renderer.ypad = 5;
- ((CellRendererToggle) renderer).toggled.connect (treeview_tags_cell_toggled_cb);
- ((CellRendererToggle) renderer).set_radio (false);
-
- col = new Gtk.TreeViewColumn ();
- col.set_title ("-");
- col.set_resizable (false);
- col.set_sizing (Gtk.TreeViewColumnSizing.FIXED);
- col.set_fixed_width (25);
- col.pack_start (renderer, false);
- col.set_cell_data_func (renderer, treeview_tags_toggle_cell_data_func);
- view.append_column (col);
-
- // List column: Name
- renderer = new CellRendererText ();
- renderer.xpad = 5;
- renderer.ypad = 5;
- ((CellRendererText) renderer).ellipsize = Pango.EllipsizeMode.END;
- ((CellRendererText) renderer).ellipsize_set = true;
-
- col = new Gtk.TreeViewColumn ();
- col.set_title (_("Name"));
- col.set_resizable (true);
- col.set_sizing (Gtk.TreeViewColumnSizing.AUTOSIZE);
- col.set_expand (true);
- col.pack_start (renderer, true);
- col.add_attribute (renderer, "text", Col.TAG_NAME);
-
- view.append_column (col);
-
- // List coumnn: Count
- renderer = new CellRendererText ();
- renderer.xpad = 5;
- renderer.ypad = 5;
-
- col = new Gtk.TreeViewColumn ();
- col.set_title ("-");
- col.set_resizable (false);
- col.set_sizing (Gtk.TreeViewColumnSizing.FIXED);
- col.set_fixed_width (50);
- col.pack_end (renderer, false);
- col.add_attribute (renderer, "text", Col.TAG_COUNT);
-
- view.append_column (col);
-
- // Selection signals
- var selection = view.get_selection ();
- selection.changed.connect (treeview_tags_row_selected_cb);
-
- // Model details
- TreeModel model = store as TreeModel;
- TreeSortable sortable = model as TreeSortable;
-
- view.set_model (model);
- view.row_activated.connect (treeview_tags_row_activated_cb);
- sortable.set_sort_column_id (2, SortType.ASCENDING);
-
- // Add vbox to this widget's vbox
- vbox.unparent ();
- base.pack_start (vbox, true, true, 0);
-
- // Set controls up based on selected file(s)
- // NOTE: This can't occur before the view is created
- update_for_files ();
-
- query_tags.begin ();
- }
-
- private void update_for_files () {
- if (files != null) {
- string str = dngettext (null,
- "_Set the tags you want to associate with the %d selected item:",
- "_Set the tags you want to associate with the %d selected items:",
- files.length ()).printf ((int) files.length ());
- label.set_text_with_mnemonic (str);
- vbox.sensitive = true;
- } else {
- label.set_text (_("No items currently selected"));
- vbox.sensitive = false;
- }
-
- query_tags_for_files.begin ();
- }
-
- private async void model_toggle_row (TreePath path) {
- TreeModel model;
- TreeIter iter;
- string id, tag;
- int selection;
-
- model = view.get_model ();
-
- if (model.get_iter (out iter, path) == false) {
- return;
- }
-
- model.get (iter,
- Col.SELECTION, out selection,
- Col.TAG_ID, out id,
- Col.TAG_NAME, out tag,
- -1);
-
- int new_value = selection == Selection.FALSE ? Selection.TRUE : Selection.FALSE;
-
- string tag_escaped = sparql_get_escaped_string (tag);
- string filter = sparql_get_filter_string (null);
- string query = null;
-
- TagData td;
-
- // NOTE: Was if (selection) ...
- if (new_value != Selection.FALSE) {
- // NB: ?f is used in filter.
- query = "INSERT {
- ?urn nao:hasTag ?label
- } WHERE {
- ?urn nie:url ?f .
- ?label nao:prefLabel %s .
- %s
- }".printf (tag_escaped, filter);
- } else {
- // NB: ?f is used in filter.
- query = "DELETE {
- ?urn nao:hasTag ?label
- } WHERE {
- ?urn nie:url ?f .
- ?label nao:prefLabel %s .
- %s
- }".printf (tag_escaped, filter);
-
- /* Check if there are any files left with this tag and
- * remove tag if not.
- */
- td = new TagData (id, iter, false, true, 1, this);
- tag_data_requests.prepend (td);
-
- query_files_for_tag_id.begin (td);
- }
-
- filter = null;
- tag_escaped = null;
-
- if (connection == null) {
- warning ("Can't update tags, no SPARQL connection available");
- return;
- }
-
- debug ("Updating tags for uris");
-
- entry.set_sensitive (false);
-
- td = new TagData (id, iter, true, (new_value != Selection.FALSE), 1, this);
- tag_data_requests.prepend (td);
-
- try {
- yield connection.update_async (query, Priority.DEFAULT, td.cancellable);
-
- debug ("Updated tags");
- update_tag_data (td);
-
- entry.set_text ("");
- } catch (GLib.Error e) {
- warning ("Could not run Sparql update query: %s", e.message);
- show_error_dialog (_("Could not update tags"), e);
- }
-
- tag_data_requests.remove (td);
- td = null;
-
- entry.set_sensitive (true);
- }
-
- private bool find_tag (string tag, out TreeIter iter) {
- TreeIter found_iter = { 0 };
-
- iter = found_iter;
-
- if (tag == null || tag == "") {
- return false;
- }
-
- TreeModel model = view.get_model ();
- bool found = false;
-
- model.foreach ((model, path, foreach_iter) => {
- string foreach_tag;
-
- model.get (foreach_iter, Col.TAG_NAME, out foreach_tag, -1);
-
- if (foreach_tag != null && foreach_tag == tag) {
- found = true;
- found_iter = foreach_iter;
- return true;
- }
-
- return false;
- });
-
- if (found == true) {
- iter = found_iter;
- return true;
- }
-
- return false;
- }
-
- private async void remove_tag (TagData td) {
- if (connection == null) {
- warning ("Can't remove tag '%s', no SPARQL connection available", td.tag_id);
- tag_data_requests.remove (td);
- td = null;
- return;
- }
-
- string query = "DELETE { <%s> a rdfs:Resource }".printf (td.tag_id);
-
- try {
- yield connection.update_async (query, Priority.DEFAULT, td.cancellable);
-
- debug ("Tag removed");
- #if VALA_0_36
- store.remove (ref td.iter);
- #else
- store.remove (td.iter);
- #endif
- } catch (GLib.Error e) {
- warning ("Could not run Sparql update query: %s", e.message);
- show_error_dialog (_("Could not remove tag"), e);
- }
-
- tag_data_requests.remove (td);
- td = null;
- }
-
- private async void add_tag (string tag) {
- string query = null;
-
- if (connection == null) {
- warning ("Can't add tag '%s', no SPARQL connection available", tag);
- return;
- }
-
- entry.set_sensitive (false);
-
- if (files != null && files.length () > 0) {
- query = "";
-
- string filter = sparql_get_filter_string (null);
- string tag_escaped = sparql_get_escaped_string (tag);
-
- foreach (string url in files) {
- query += "INSERT {
- _:file a nie:DataObject ;
- nie:url '%s'
- } WHERE {
- OPTIONAL {
- ?file a nie:DataObject ;
- nie:url '%s'
- } .
- FILTER (!bound(?file))
- }".printf (url, url);
- }
-
- query += "INSERT {
- _:tag a nao:Tag;
- nao:prefLabel %s .
- } WHERE {
- OPTIONAL {
- ?tag a nao:Tag ;
- nao:prefLabel %s
- } .
- FILTER (!bound(?tag))
- }
- INSERT {
- ?urn nao:hasTag ?label
- } WHERE {
- ?urn nie:url ?f .
- ?label nao:prefLabel %s
- %s
- }".printf (tag_escaped, tag_escaped, tag_escaped, filter);
- } else {
- string tag_label_escaped = sparql_get_escaped_string (tag);
-
- query = "INSERT {
- _:tag a nao:Tag ;
- nao:prefLabel %s .
- } WHERE {
- OPTIONAL {
- ?tag a nao:Tag ;
- nao:prefLabel %s
- } .
- FILTER (!bound(?tag))
- }".printf (tag_label_escaped, tag_label_escaped);
- }
-
- TagData td = new TagData (null, null, false, true, (int) files.length (), this);
- tag_data_requests.prepend (td);
-
- try {
- yield connection.update_async (query, Priority.DEFAULT, td.cancellable);
-
- debug ("Updated tags");
- update_tag_data (td);
-
- // Only do this on success
- entry.set_text ("");
- } catch (GLib.Error e) {
- warning ("Could not run Sparql update query: %s", e.message);
- show_error_dialog (_("Could not update tags"), e);
- }
-
- tag_data_requests.remove (td);
- td = null;
-
- entry.set_sensitive (true);
- }
-
- private void update_tag_data (TagData td) {
- unowned string tag = entry.get_text ();
-
- if (td.update == false) {
- TreeIter iter;
-
- debug ("Setting tag selection state to ON (new)");
-
- store.append (out iter);
- store.set (iter,
- Col.TAG_ID, td.tag_id,
- Col.TAG_NAME, tag,
- Col.TAG_COUNT, "%d".printf (td.items),
- Col.TAG_COUNT_VALUE, td.items,
- Col.SELECTION, Selection.TRUE,
- -1);
- } else if (td.selected == true) {
- debug ("Setting tag selection state to ON");
-
- store.set (td.iter, Col.SELECTION, Selection.TRUE, -1);
-
- tag_data_requests.prepend (td);
- query_files_for_tag_id.begin (td);
- } else {
- debug ("Setting tag selection state to FALSE");
-
- store.set (td.iter, Col.SELECTION, Selection.FALSE, -1);
-
- tag_data_requests.prepend (td);
- query_files_for_tag_id.begin (td);
- }
- }
-
- private void untoggle_all () {
- TreeModel model = view.get_model ();
- Gtk.ListStore store = (Gtk.ListStore) model;
-
- model.foreach ((model, path, foreach_iter) => {
- store.set (foreach_iter, Col.SELECTION, Selection.FALSE, -1);
- return false;
- });
- }
-
- private async void query_tags_for_files () {
- untoggle_all ();
-
- if (files == null) {
- return;
- }
-
- // Get tags for files only and make sure we toggle the list
- string files_filter = "";
-
- foreach (string url in files) {
- if (files_filter.length > 0) {
- files_filter += ",";
- }
-
- files_filter += "'%s'".printf (url);
- }
-
- string query = "select ?tag nao:prefLabel(?tag) WHERE { ?urn nao:hasTag ?tag . FILTER(nie:url(?urn) IN (%s)) } ORDER BY (?tag)".printf (files_filter);
-
- debug ("Getting tags for files selected...");
-
- try {
- Sparql.Cursor cursor = yield connection.query_async (query, null);
-
- while (yield cursor.next_async ()) {
- debug ("Toggling tags...");
-
- unowned string id = cursor.get_string (0);
- unowned string label = cursor.get_string (1);
-
- debug (" Enabling tag:'%s', label:'%s'", id, label);
-
- TreeIter iter;
- if (find_tag (label, out iter)) {
- store.set (iter,
- Col.SELECTION, Selection.TRUE,
- -1);
- }
- }
- } catch (GLib.Error e) {
- warning ("Could not run Sparql query: %s", e.message);
- show_error_dialog (_("Could not retrieve tags for the current selection"), e);
- }
- }
-
- private async void query_tags () {
- // Get all tags
- string query = "SELECT ?urn ?label WHERE { ?urn a nao:Tag ; nao:prefLabel ?label . } ORDER BY ?label";
-
- debug ("Clearing tags in store");
- store.clear ();
-
- try {
- Sparql.Cursor cursor = yield connection.query_async (query, null);
-
- while (yield cursor.next_async ()) {
-
- debug ("Adding all tags...");
-
- unowned string id = cursor.get_string (0);
- unowned string label = cursor.get_string (1);
-
- debug (" Adding tag id:'%s' with label:'%s' to store", id, label);
-
- TreeIter iter;
- store.append (out iter);
-
- store.set (iter,
- Col.TAG_ID, id,
- Col.TAG_NAME, label,
- Col.SELECTION, Selection.FALSE,
- -1);
-
- TagData td = new TagData (id, iter, false, true, 1, this);
- tag_data_requests.prepend (td);
-
- query_files_for_tag_id.begin (td);
- }
- } catch (GLib.Error e) {
- warning ("Could not run Sparql query: %s", e.message);
- show_error_dialog (_("Could not add tag"), e);
- }
- }
-
- private async void query_files_for_tag_id (TagData td) {
- if (connection == null) {
- warning ("Can't query files for tag id '%s', no SPARQL connection available", td.tag_id);
- tag_data_requests.remove (td);
- td = null;
- return;
- }
-
- string query = "SELECT ?url WHERE { ?urn a rdfs:Resource ; nie:url ?url ; nao:hasTag <%s> . }".printf (td.tag_id);
-
- try {
- Sparql.Cursor cursor = yield connection.query_async (query, td.cancellable);
-
- uint has_tag_in_selection = 0;
- uint files_with_tag = 0;
- uint files_selected = files.length ();
-
- while (yield cursor.next_async ()) {
- files_with_tag++;
-
- foreach (string url in files) {
- unowned string url_returned = cursor.get_string (0);
-
- debug ("--> '%s' vs '%s'", url, url_returned);
-
- if (url_returned == null) {
- continue;
- }
-
- if (url_returned == url) {
- has_tag_in_selection++;
- break;
- }
- }
- }
-
- debug ("Querying files with tag, in selection:%ld, in total:%ld, selected:%ld",
- has_tag_in_selection, files_with_tag, files_selected);
-
- if (has_tag_in_selection == 0) {
- store.set (td.iter, Col.SELECTION, Selection.FALSE, -1);
- } else if (files_selected != has_tag_in_selection) {
- store.set (td.iter, Col.SELECTION, Selection.INCONSISTENT, -1);
- } else {
- store.set (td.iter, Col.SELECTION, Selection.TRUE, -1);
- }
-
- string str = "%ld".printf (files_with_tag);
- store.set (td.iter, Col.TAG_COUNT, str, Col.TAG_COUNT_VALUE, files_with_tag, -1);
-
- debug ("Tags for file updated");
- } catch (GLib.Error e) {
- warning ("Could not run Sparql query: %s", e.message);
- show_error_dialog (_("Could not update tags for file"), e);
- }
-
- tag_data_requests.remove (td);
- td = null;
- }
-
- private string sparql_get_filter_string (string? tag) requires (files != null && files.length () > 0) {
- string filter = "FILTER (";
-
- if (tag != null && tag != "") {
- filter += "(";
- }
-
- bool first = true;
-
- foreach (string url in files) {
- if (!first) {
- filter += " || ";
- }
-
- filter += "?f = \"%s\"".printf (url);
- first = false;
- }
-
- if (tag != null && tag != "") {
- filter += ") && ?t = <%s>".printf (tag);
- }
-
- filter += ")";
-
- return filter;
- }
-
- private string sparql_get_escaped_string (string str) {
- string escaped = Sparql.escape_string (str);
- return "\"%s\"".printf (escaped);
- }
-}
-
diff --git a/src/tracker-needle/tracker-utils.vala b/src/tracker-needle/tracker-utils.vala
deleted file mode 100644
index 54826113e..000000000
--- a/src/tracker-needle/tracker-utils.vala
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// Copyright 2010, Martyn Russell <martyn@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-using Gtk;
-
-private const int secs_per_day = 60 * 60 * 24;
-
-private string? uri_get_selected (TreeModel model, TreePath path, int col) {
- TreeIter iter;
- model.get_iter (out iter, path);
-
- weak string uri;
- model.get (iter, col, out uri);
-
- return uri;
-}
-
-private void uri_launch (string uri) {
- // Bit of a hack for now if there is no URI scheme, we assume that
- // the uri is actually a command line to launch.
- if (uri.index_of ("://") < 1) {
- var command = uri.split (" ");
- debug ("Attempting to spawn_async() '%s'", command[0]);
-
- Pid child_pid;
- string[] argv = new string[1];
- argv[0] = command[0];
-
- try {
- Process.spawn_async ("/usr/bin",
- argv,
- null, // environment
- SpawnFlags.SEARCH_PATH,
- null, // child_setup
- out child_pid);
- } catch (Error e) {
- warning ("Could not launch '%s', %d->%s", command[0], e.code, GLib.strerror (e.code));
- return;
- }
-
- debug ("Launched application with PID:%d", child_pid);
- return;
- }
-
- try {
- debug ("Attempting to launch application for uri:'%s'", uri);
- AppInfo.launch_default_for_uri (uri, null);
- } catch (GLib.Error e) {
- warning ("Could not launch application: " + e.message);
- }
-}
-
-public void tracker_model_launch_selected (TreeModel model, TreePath path, int col) {
- string uri = uri_get_selected (model, path, col);
- debug ("Selected uri:'%s'", uri);
-
- uri_launch (uri);
-}
-
-public void tracker_model_launch_selected_parent_dir (TreeModel model, TreePath path, int col) {
- string uri = uri_get_selected (model, path, col);
- debug ("Selected uri:'%s'", uri);
-
- File f = File.new_for_uri (uri);
- File p = f.get_parent ();
- string parent_uri = p.get_uri ();
-
- debug ("Parent uri:'%s'", parent_uri);
- uri_launch (parent_uri);
-}
-
-public string tracker_time_format_from_iso8601 (string s) {
- GLib.Time t = GLib.Time ();
- t.strptime (s, "%FT%T");
-
- var tv_now = GLib.TimeVal ();
- tv_now.get_current_time ();
-
- var tv_then = GLib.TimeVal ();
- tv_then.from_iso8601 (s);
-
- var diff_sec = tv_now.tv_sec - tv_then.tv_sec;
- var diff_days = diff_sec / secs_per_day;
- var diff_days_abs = diff_days.abs ();
-
- // stdout.printf ("timeval now:%ld, then:%ld, diff secs:%ld, diff days:%ld, abs: %ld, seconds per day:%d\n", tv_now.tv_sec, tv_then.tv_sec, diff_sec, diff_days, diff_days_abs, secs_per_day);
-
- // if it's more than a week, use the default date format
- if (diff_days_abs > 7) {
- /* Translators: This is a strftime(3) date format string, read its man page to fit your locale better */
- /*xgettext:no-c-format*/
- return t.format (_("%x"));
- }
-
- if (diff_days_abs == 0) {
- return _("Today");
- } else {
- bool future = false;
-
- if (diff_days < 0)
- future = true;
-
- if (diff_days <= 1) {
- if (future)
- return _("Tomorrow");
- else
- return _("Yesterday");
- } else {
- if (future) {
- /* Translators: %d is replaced with a number of days. It's always greater than 1 */
- return ngettext ("%ld day from now", "%ld days from now", diff_days_abs).printf (diff_days_abs);
- } else {
- /* Translators: %d is replaced with a number of days. It's always greater than 1 */
- return ngettext ("%ld day ago", "%ld days ago", diff_days_abs).printf (diff_days_abs);
- }
- }
- }
-}
-
-public string tracker_time_format_from_seconds (string seconds_str) {
- double seconds = int.parse (seconds_str);
- double total;
- int d, h, m, s;
-
- if (seconds == 0.0) {
- return _("Less than one second");
- }
-
- total = seconds;
- s = (int) total % 60;
- total /= 60;
- m = (int) total % 60;
- total /= 60;
- h = (int) total % 24;
- d = (int) total / 24;
-
- var output = new StringBuilder ("");
-
- if (d > 0) {
- output.append (" %dd".printf (d));
- }
-
- if (h > 0) {
- output.append (" %.2d".printf (h));
- }
-
- if (m > 0) {
- output.append ("%s%.2d".printf (h > 0 ? ":" : "", m));
- }
-
- // Always show seconds
- output.append ("%s%.2d".printf (m > 0 ? ":" : "0:", s));
-
- if (output.len < 1) {
- return _("Less than one second");
- }
-
- string str = output.str;
-
- return str._chug ();
-}
-
-public Gdk.Pixbuf tracker_pixbuf_new_from_file (IconTheme theme, string filename, int size, bool is_image) {
- // Get Icon
- var file = File.new_for_uri (filename);
- var pixbuf = null as Gdk.Pixbuf;
-
- if (is_image) {
- try {
- pixbuf = new Gdk.Pixbuf.from_file_at_size (file.get_path (), size, size);
- } catch (GLib.Error e) {
- warning ("Error loading icon pixbuf: " + e.message);
- }
-
- if (pixbuf != null) {
- return pixbuf;
- }
- }
-
- if (file.query_exists (null)) {
- try {
- var file_info = file.query_info ("standard::icon",
- FileQueryInfoFlags.NONE,
- null);
-
- if (file_info != null) {
- var icon = file_info.get_icon ();
-
- try {
- if (icon is FileIcon) {
- pixbuf = new Gdk.Pixbuf.from_file (((FileIcon) icon).get_file ().get_path ());
- } else if (icon is ThemedIcon) {
- pixbuf = theme.load_icon (((ThemedIcon) icon).get_names ()[0], size, Gtk.IconLookupFlags.USE_BUILTIN);
- }
- } catch (GLib.Error e) {
- warning ("Error loading icon pixbuf: " + e.message);
- }
- }
- } catch (GLib.Error e) {
- warning ("Error looking up file for pixbuf: " + e.message);
- }
- }
-
- if (pixbuf != null) {
- return pixbuf;
- }
-
- return tracker_pixbuf_new_from_name (theme, "text-x-generic", size);
-}
-
-public Gdk.Pixbuf tracker_pixbuf_new_from_name (IconTheme theme, string name, int size) {
- // Get Icon
- var pixbuf = null as Gdk.Pixbuf;
-
- try {
- pixbuf = theme.load_icon (name, size, IconLookupFlags.USE_BUILTIN);
- } catch (GLib.Error e) {
- warning ("Could not load default icon pixbuf from theme for '%s': %s", name, e.message);
- }
-
- return pixbuf;
-}
diff --git a/src/tracker-needle/tracker-view.vala b/src/tracker-needle/tracker-view.vala
deleted file mode 100644
index 58fa28674..000000000
--- a/src/tracker-needle/tracker-view.vala
+++ /dev/null
@@ -1,561 +0,0 @@
-//
-// Copyright 2010, Martyn Russell <martyn@lanedo.com>
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
-//
-
-using Gtk;
-
-public class Tracker.View : ScrolledWindow {
- public enum Display {
- NO_RESULTS,
- CATEGORIES,
- FILE_LIST,
- FILE_ICONS
- }
-
- public Display display {
- get;
- private set;
- }
-
- private ResultStore _store;
- public ResultStore store {
- get {
- return _store;
- }
- set {
- if (_store != null) {
- _store.row_changed.disconnect (store_row_changed);
- }
-
- _store = value;
-
- if (_store != null) {
- debug ("using store:%p", _store);
- _store.row_changed.connect (store_row_changed);
- }
-
- if (display != Display.FILE_ICONS) {
- ((TreeView) view).model = _store;
- } else {
- ((IconView) view).model = _store;
- }
- }
- }
-
- private Widget view = null;
- private Gtk.Menu context_menu;
-
- private void store_row_changed (TreeModel model,
- TreePath path,
- TreeIter iter) {
- int n_children = model.iter_n_children (iter);
-
- if (n_children > 0) {
- ((TreeView) view).expand_row (path, false);
- }
- }
-
- private bool row_selection_func (TreeSelection selection,
- TreeModel model,
- TreePath path,
- bool path_selected) {
- if (path.get_depth () == 1) {
- // Category row, not selectable
- return false;
- }
-
- return true;
- }
-
- public override void unmap () {
- if (store != null) {
- store.cancel_search ();
- }
-
- base.unmap ();
- }
-
- public View (Display? _display = Display.NO_RESULTS, ResultStore? store) {
- set_policy (PolicyType.NEVER, PolicyType.AUTOMATIC);
-
- display = _display;
-
- if (store != null) {
- _store = store;
- store.row_changed.connect (store_row_changed);
- debug ("using store:%p", store);
- }
-
- switch (display) {
- case Display.NO_RESULTS:
- Label l;
-
- l = new Label ("");
- l.set_justify (Justification.CENTER);
-
- string results = _("No Search Results");
- string help_views = _("Select the view on the toolbar for the content you want, e.g. everything, files or just images");
- string help_search = _("Start to search using the entry box above");
- string markup = @"<big>$results</big>\n\n$help_views\n\n$help_search";
-
- l.set_use_markup (true);
- l.set_markup (markup);
-
- view = l;
- break;
-
- case Display.CATEGORIES:
- case Display.FILE_LIST:
- view = new TreeView ();
- break;
-
- case Display.FILE_ICONS:
- view = new IconView ();
- break;
- }
-
- if (display == Display.NO_RESULTS) {
- add (view);
- } else {
- add (view);
- setup_model ();
- setup_menus ();
- }
-
- base.show_all ();
- }
-
- private void setup_model () {
- switch (display) {
- case Display.FILE_ICONS: {
- IconView iv = (IconView) view;
-
- iv.set_model (store);
- iv.set_item_width (128);
- iv.set_item_padding (1);
- iv.set_row_spacing (2);
- iv.set_column_spacing (2);
- iv.set_selection_mode (SelectionMode.SINGLE);
- iv.set_pixbuf_column (6);
- iv.set_text_column (-1); // was 2, -1 is for no text
- iv.set_tooltip_column (5);
-
- break;
- }
-
- case Display.FILE_LIST: {
- TreeViewColumn col;
- TreeView tv = (TreeView) view;
-
- tv.set_model (store);
- tv.set_tooltip_column (6);
- tv.set_rules_hint (false);
- tv.set_grid_lines (TreeViewGridLines.VERTICAL);
- tv.set_headers_visible (true);
-
- var renderer1 = new CellRendererPixbuf ();
- var renderer2 = new Gtk.CellRendererText ();
-
- col = new TreeViewColumn ();
- col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
- col.pack_start (renderer1, false);
- col.add_attribute (renderer1, "pixbuf", 7);
- renderer1.xpad = 5;
- renderer1.ypad = 5;
-
- col.pack_start (renderer2, true);
- renderer2.set_fixed_height_from_font (2);
- renderer2.ellipsize = Pango.EllipsizeMode.MIDDLE;
-
- col.set_title (_("File"));
- col.set_resizable (true);
- col.set_expand (true);
- col.set_cell_data_func (renderer1, background_renderer_func);
- col.set_cell_data_func (renderer2, text_renderer_func);
- tv.append_column (col);
-
- var renderer3 = new Gtk.CellRendererText ();
- renderer3.set_fixed_height_from_font (2);
- col = new TreeViewColumn ();
- col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
- col.pack_start (renderer3, true);
- col.set_title (_("Last Changed"));
- col.set_cell_data_func (renderer3, file_date_renderer_func);
- tv.append_column (col);
-
- var renderer4 = new Gtk.CellRendererText ();
- renderer4.set_fixed_height_from_font (2);
- col = new TreeViewColumn ();
- col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
- col.pack_start (renderer4, true);
- col.set_title (_("Size"));
- col.set_cell_data_func (renderer4, file_size_renderer_func);
- tv.append_column (col);
-
- break;
- }
-
- case Display.CATEGORIES: {
- TreeViewColumn col;
- TreeView tv = (TreeView) view;
- TreeSelection selection;
-
- tv.set_model (store);
- tv.set_tooltip_column (5);
- tv.set_rules_hint (false);
- tv.set_grid_lines (TreeViewGridLines.NONE);
- tv.set_headers_visible (false);
- tv.set_show_expanders (false);
-
- selection = tv.get_selection ();
- selection.set_select_function (row_selection_func);
-
- col = new TreeViewColumn ();
- col.set_sizing (TreeViewColumnSizing.FIXED);
- col.set_expand (true);
-
- var renderer1 = new CellRendererPixbuf ();
- col.pack_start (renderer1, false);
- col.add_attribute (renderer1, "pixbuf", 6);
- col.set_cell_data_func (renderer1, background_renderer_func);
- renderer1.xpad = 5;
- renderer1.ypad = 5;
-
- var renderer2 = new Gtk.CellRendererText ();
- col.pack_start (renderer2, true);
- col.set_cell_data_func (renderer2, text_renderer_func);
- renderer2.set_fixed_height_from_font (2);
- renderer2.ellipsize = Pango.EllipsizeMode.MIDDLE;
-
- //col.set_resizable (true);
- //col.set_sizing (TreeViewColumnSizing.AUTOSIZE);
- tv.append_column (col);
-
-// var renderer3 = new Gtk.CellRendererText ();
-// col = new TreeViewColumn ();
-// col.pack_start (renderer3, true);
-// col.add_attribute (renderer3, "text", 3);
-// col.set_title (_("Item Detail"));
-// col.set_cell_data_func (renderer3, cell_renderer_func);
-// tv.append_column (col);
-
- var renderer4 = new Gtk.CellRendererText ();
- renderer4.set_fixed_height_from_font (2);
- renderer4.alignment = Pango.Alignment.RIGHT;
- renderer4.xalign = 1;
-
- col = new TreeViewColumn ();
- col.set_min_width (80);
- col.set_sizing (TreeViewColumnSizing.FIXED);
- col.pack_start (renderer4, true);
- col.set_cell_data_func (renderer4, category_detail_renderer_func);
- tv.append_column (col);
-
- break;
- }
- }
- }
-
- private void background_renderer_func (CellLayout cell_layout,
- CellRenderer cell,
- TreeModel tree_model,
- TreeIter iter) {
- Gdk.Color color;
- Style style;
- TreePath path;
-
- style = view.get_style ();
-
- color = style.base[StateType.SELECTED];
- int sum_normal = color.red + color.green + color.blue;
- color = style.base[StateType.NORMAL];
- int sum_selected = color.red + color.green + color.blue;
- color = style.text_aa[StateType.INSENSITIVE];
-
- if (sum_normal < sum_selected) {
- /* Found a light theme */
- color.red = (color.red + (style.white).red) / 2;
- color.green = (color.green + (style.white).green) / 2;
- color.blue = (color.blue + (style.white).blue) / 2;
- } else {
- /* Found a dark theme */
- color.red = (color.red + (style.black).red) / 2;
- color.green = (color.green + (style.black).green) / 2;
- color.blue = (color.blue + (style.black).blue) / 2;
- }
-
- path = tree_model.get_path (iter);
-
- // Set odd/even colours
- if (path.get_indices()[0] % 2 != 0) {
- cell.set ("cell-background-gdk", color);
- } else {
- cell.set ("cell-background-gdk", null);
- }
- }
-
- private void text_renderer_func (CellLayout cell_layout,
- CellRenderer cell,
- TreeModel tree_model,
- TreeIter iter) {
- string text, subtext;
- string markup = null;
- int n_children;
-
- background_renderer_func (cell_layout, cell, tree_model, iter);
- n_children = tree_model.iter_n_children (iter);
-
- if (n_children > 0) {
- // Category row
- Tracker.Query.Type type;
- string cat = null;
-
- tree_model.get (iter, 7, out type, -1);
- switch (type) {
- case Tracker.Query.Type.APPLICATIONS:
- cat = _("Applications");
- break;
- case Tracker.Query.Type.MUSIC:
- cat = _("Music");
- break;
- case Tracker.Query.Type.IMAGES:
- cat = _("Images");
- break;
- case Tracker.Query.Type.VIDEOS:
- cat = _("Videos");
- break;
- case Tracker.Query.Type.DOCUMENTS:
- cat = _("Documents");
- break;
- case Tracker.Query.Type.MAIL:
- cat = _("Mail");
- break;
- case Tracker.Query.Type.FOLDERS:
- cat = _("Folders");
- break;
- case Tracker.Query.Type.BOOKMARKS:
- cat = _("Bookmarks");
- break;
- }
-
- markup = "<b><big>%s</big></b> <small>(%d %s)</small>".printf (cat, n_children, _("Items"));
- } else {
- // Result row
- tree_model.get (iter, 2, out text, 3, out subtext, -1);
-
- if (text != null) {
- markup = Markup.escape_text (text);
-
- if (subtext != null) {
- subtext = subtext.replace ("\n", " ");
- markup += "\n<small><span color='grey'>%s</span></small>".printf (Markup.escape_text (subtext));
- }
- } else {
- markup = "<span color='grey'>%s</span>\n".printf (_("Loading…"));
- }
- }
-
- cell.set ("markup", markup);
- }
-
- private void file_size_renderer_func (CellLayout cell_layout,
- CellRenderer cell,
- TreeModel tree_model,
- TreeIter iter) {
- string size;
-
- background_renderer_func (cell_layout, cell, tree_model, iter);
- tree_model.get (iter, 4, out size, -1);
-
- if (size != null) {
- size = GLib.format_size (int.parse (size));
- }
-
- cell.set ("text", size);
- }
-
- private void file_date_renderer_func (CellLayout cell_layout,
- CellRenderer cell,
- TreeModel tree_model,
- TreeIter iter) {
- string date;
-
- background_renderer_func (cell_layout, cell, tree_model, iter);
- tree_model.get (iter, 5, out date, -1);
-
- if (date != null) {
- date = tracker_time_format_from_iso8601 (date);
- }
-
- cell.set ("text", date);
- }
-
- private void category_detail_renderer_func (CellLayout cell_layout,
- CellRenderer cell,
- TreeModel tree_model,
- TreeIter iter) {
- Tracker.Query.Type category;
- string markup = null;
- string detail;
-
- background_renderer_func (cell_layout, cell, tree_model, iter);
- tree_model.get (iter, 4, out detail, 7, out category, -1);
-
- if (detail == null) {
- cell.set ("markup", null);
- return;
- }
-
- switch (category) {
- case Tracker.Query.Type.FOLDERS:
- case Tracker.Query.Type.MAIL:
- case Tracker.Query.Type.BOOKMARKS:
- detail = tracker_time_format_from_iso8601 (detail);
- break;
- case Tracker.Query.Type.MUSIC:
- case Tracker.Query.Type.VIDEOS:
- detail = tracker_time_format_from_seconds (detail);
- break;
- case Tracker.Query.Type.DOCUMENTS:
- detail = ngettext ("%d Page", "%d Pages", int.parse (detail)).printf (int.parse (detail));
- break;
- case Tracker.Query.Type.IMAGES:
- detail = GLib.format_size (int.parse (detail));
- break;
- }
-
- markup = "<span color='grey'><small>%s</small></span>".printf (Markup.escape_text (detail));
- cell.set ("markup", markup);
- }
-
- private void setup_menus () {
- // Set up context menu
- view.button_press_event.connect (view_button_press_event);
-
- context_menu = new Gtk.Menu ();
-
- var item = new Gtk.MenuItem.with_mnemonic (_("_Show Parent Directory"));
- item.activate.connect (context_menu_directory_clicked);
- context_menu.append (item);
-
- var separator = new SeparatorMenuItem ();
- context_menu.append (separator);
-
- item = new Gtk.MenuItem.with_mnemonic (_("_Tags…"));
- item.activate.connect (context_menu_tags_clicked);
- context_menu.append (item);
-
- context_menu.show_all ();
- }
-
- private bool view_button_press_event (Gtk.Widget widget, Gdk.EventButton event) {
- if (event.button == 3) {
- if (get_selected_path () != null) {
- context_menu.popup (null, null, null, event.button, event.time);
- }
- }
-
- return false;
- }
-
- private TreeModel? get_model () {
- switch (display) {
- case Display.CATEGORIES:
- case Display.FILE_LIST:
- TreeView v = (TreeView) view;
- return v.get_model ();
-
- case Display.FILE_ICONS:
- IconView v = (IconView) view;
- return v.get_model ();
- default:
- break;
- }
-
- return null;
- }
-
- private TreePath? get_selected_path () {
- switch (display) {
- case Display.CATEGORIES:
- case Display.FILE_LIST:
- TreeView v = (TreeView) view;
- TreeSelection s = v.get_selection ();
- List<TreePath> selected = s.get_selected_rows (null);
-
- return selected.nth_data (0);
-
- case Display.FILE_ICONS:
- IconView v = (IconView) view;
- List<TreePath> selected = v.get_selected_items ();
-
- return selected.nth_data (0);
-
- default:
- break;
- }
-
- return null;
- }
-
- private void context_menu_directory_clicked () {
- TreeModel model = get_model ();
- TreePath path = get_selected_path ();
-
- tracker_model_launch_selected_parent_dir (model, path, 1);
- }
-
- private void context_menu_tags_clicked () {
- TreeModel model = get_model ();
- TreePath path = get_selected_path ();
- TreeIter iter;
- model.get_iter (out iter, path);
-
- weak string uri;
- model.get (iter, 1, out uri);
-
- if (uri == null) {
- return;
- }
-
- debug ("Showing tags dialog for uri:'%s'", uri);
-
- // Create dialog and embed vbox.
- Dialog dialog = new Dialog.with_buttons (_("Tags"),
- (Window) this.get_toplevel (),
- DialogFlags.MODAL | DialogFlags.DESTROY_WITH_PARENT,
- "_Close", ResponseType.CLOSE,
- null);
- dialog.set_default_size (400, 300);
- dialog.border_width = 12;
- dialog.response.connect (() => {
- dialog.destroy ();
- });
-
- List<string> files = null;
- files.prepend (uri);
- Box vbox = new TrackerTagsView ((owned) files);
-
- var content = dialog.get_content_area () as Box;
- content.pack_start (vbox, true, true, 6);
- content.spacing = 10;
-
- ((Widget) dialog).show_all ();
- dialog.run ();
- }
-}