Commit e479e5f3 authored by Carlos Garnacho's avatar Carlos Garnacho

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.
parent d4a8d6e4
......@@ -405,16 +405,6 @@ PKG_CHECK_MODULES(TRACKER_MINER_RSS, [$TRACKER_MINER_RSS_REQUIRED],
[have_tracker_miner_rss=yes],
[have_tracker_miner_rss=no])
# Check requirements for tracker-needle
TRACKER_NEEDLE_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
gio-unix-2.0 >= $GLIB_REQUIRED
gmodule-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED"
PKG_CHECK_MODULES(TRACKER_NEEDLE, [$TRACKER_NEEDLE_REQUIRED],
[have_tracker_needle=yes],
[have_tracker_needle=no])
# Check we have Vala valac command we need
VALA_MIN_VERSION=0.18.0
AM_PROG_VALAC([$VALA_MIN_VERSION])
......@@ -507,7 +497,6 @@ if test "x$enable_minimal" = "xyes"; then
enable_miner_fs=no
enable_miner_apps=no
enable_miner_rss=no
enable_tracker_needle=no
fi
####################################################################
......@@ -1231,34 +1220,6 @@ fi
AM_CONDITIONAL(HAVE_TAGLIB, test "x$have_taglib" = "xyes")
##################################################################
# Check for tracker-needle
##################################################################
AC_ARG_ENABLE([tracker-needle],
AS_HELP_STRING([--enable-tracker-needle],
[enable GTK+ UI to search for content [[default=auto]]]),
[enable_tracker_needle=$enableval],
[enable_tracker_needle=auto])
if test "x$enable_tracker_needle" = "xyes" ; then
if test "x$have_tracker_needle" != "xyes"; then
AC_MSG_ERROR([Could not find tracker-needle dependencies ($TRACKER_NEEDLE_REQUIRED).])
fi
else
if test "x$enable_tracker_needle" = "xno"; then
have_tracker_needle="no (disabled)"
fi
fi
if test "x$have_tracker_needle" = "xyes"; then
AC_DEFINE(HAVE_TRACKER_NEEDLE, [1], [Define to 1 if tracker-needle is compiled])
else
AC_DEFINE(HAVE_TRACKER_NEEDLE, [0], [Define to 0 if tracker-needle is not compiled])
fi
AM_CONDITIONAL(HAVE_TRACKER_NEEDLE, test "$have_tracker_needle" = "yes")
##################################################################
# Check for tracker-resdump
##################################################################
......@@ -2224,14 +2185,6 @@ AC_CONFIG_FILES([
src/tracker-store/Makefile
src/tracker/Makefile
src/tracker-extract/Makefile
src/tracker-needle/Makefile
src/tracker-needle/icons/Makefile
src/tracker-needle/icons/16x16/Makefile
src/tracker-needle/icons/22x22/Makefile
src/tracker-needle/icons/24x24/Makefile
src/tracker-needle/icons/32x32/Makefile
src/tracker-needle/icons/48x48/Makefile
src/tracker-needle/icons/scalable/Makefile
src/tracker-writeback/Makefile
src/plugins/Makefile
tests/common/Makefile
......@@ -2392,10 +2345,6 @@ Writeback Formats:
fi
echo "
Applications:
Build tracker-needle: $have_tracker_needle
Frameworks / Options:
Support Guaranteed Metadata $enable_guarantee_metadata (e.g. guess nie:title from files)
......
tn = tracker-needle.1
tmrss = tracker-miner-rss.1
common = \
......@@ -19,10 +18,6 @@ common = \
# Require only common and enabled manpages
man_MANS = $(common)
if HAVE_TRACKER_NEEDLE
man_MANS += $(tn)
endif
if HAVE_TRACKER_MINER_RSS
man_MANS += $(tmrss)
endif
......
......@@ -30,15 +30,6 @@ src/tracker-extract/org.freedesktop.Tracker.Extract.gschema.xml.in
src/tracker-extract/tracker-extract.c
src/tracker-extract/tracker-main.c
src/tracker-extract/tracker-extract.desktop.in.in
src/tracker-needle/org.freedesktop.Tracker.Needle.gschema.xml.in
src/tracker-needle/tracker-needle.desktop.in.in
[type: gettext/glade]src/tracker-needle/tracker-needle.ui
src/tracker-needle/tracker-needle.vala
src/tracker-needle/tracker-query.vala
src/tracker-needle/tracker-stats.vala
src/tracker-needle/tracker-tags-view.vala
src/tracker-needle/tracker-utils.vala
src/tracker-needle/tracker-view.vala
src/tracker-store/tracker-main.vala
src/tracker-store/tracker-store.desktop.in.in
src/tracker-store/org.freedesktop.Tracker.Store.gschema.xml.in
......
......@@ -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 \
......
......@@ -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)
tracker-needle
*.c
*.desktop.in
org.freedesktop.Tracker.Needle.gschema.valid
org.freedesktop.Tracker.Needle.gschema.xml
org.freedesktop.Tracker.enums.xml
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
// 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;
}
icondir = $(datadir)/icons/hicolor/16x16/apps
icon_DATA = # Empty
if HAVE_ARTWORK
icon_DATA += tracker.png
endif
EXTRA_DIST = $(icon_DATA)
icondir = $(datadir)/icons/hicolor/22x22/apps
icon_DATA = # Empty
if HAVE_ARTWORK
icon_DATA += tracker.png
endif
EXTRA_DIST = $(icon_DATA)
icondir = $(datadir)/icons/hicolor/24x24/apps
icon_DATA = # Empty
if HAVE_ARTWORK
icon_DATA += tracker.png
endif
EXTRA_DIST = $(icon_DATA)
icondir = $(datadir)/icons/hicolor/32x32/apps
icon_DATA = # Empty
if HAVE_ARTWORK
icon_DATA += tracker.png
endif
EXTRA_DIST = $(icon_DATA)
icondir = $(datadir)/icons/hicolor/48x48/apps
icon_DATA = # Empty
if HAVE_ARTWORK
icon_DATA += tracker.png
endif
EXTRA_DIST = $(icon_DATA)
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
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)
This diff is collapsed.
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'))
<?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>
//
// 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;
}
}
<?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>
[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@
This diff is collapsed.
This diff is collapsed.
//
// 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