KubuntuFileSearch
Download and Install
md5sums of all files:
http://home.casema.nl/vollebregt/soc/deb/md5sums.txt BR
Debian binary package:
http://home.casema.nl/vollebregt/soc/deb/kio-locate_0.4.2tvo0.1_i386.deb BR http://home.casema.nl/vollebregt/soc/deb/kio-locate_0.4.2tvo0.1_i386.changes BR
Debian source package:
http://home.casema.nl/vollebregt/soc/deb/kio-locate_0.4.2tvo0.1.diff.gz BR http://home.casema.nl/vollebregt/soc/deb/kio-locate_0.4.2tvo0.1.orig.tar.gz BR http://home.casema.nl/vollebregt/soc/deb/kio-locate_0.4.2tvo0.1.dsc BR
Source tarball:
http://home.casema.nl/vollebregt/soc/deb/kio-locate-0.4.2tvo0.1.tar.bz2 BR
Arch/bazaar source package:
Current version: kio-locate--tvo--0.1--patch-29
kio-locate is now on the supermirror. To check it out use:
$ cd workingdirectory $ ARCHIVE=http://mirrors.sourcecontrol.net/tobivollebregt@gmail.com--2005-kio-locate/kio-locate--tvo--0.1 $ baz get $ARCHIVE kio-locate
This creates a directory kio-locate inside workingdirectory. This directory contains the entire source. The archive is automagically registered. To install, do (presuming you're still in workingdirectory):
$ cd kio-locate $ scons configure $ scons $ sudo scons install
Instead of scons configure you might want to use scons configure debug=1 to enable debugging.
Use scons -c install to uninstall.
Type locater:config in konqueror for configuration. It might appear as if the first configuration dialog tab doesn't fit into the window. I've been told this is a bug in KDE 3.4.0 and has been fixed in later versions.
NOTE TO SELF: baz archive-mirror to update
Notes to packagers (in particular: self)
Note: This package uses scons and bksys for building.
First I made sure all debian/* files were OK. I made debian/rules always use mini-scons, and as such added a python (>= 2.4) build-depend in debian/control. The 2.4 is arbitrary. It might also work with 2.3 or even 2.2 but I didn't feel like testing that. I didn't add python (<< 2.5) as with scons. I was told this is needed with depends because the python script in a package is compiled into bytecode. In my case, however, the python script is just used for building, so I reasoned the << 2.5 requirement was useles and I removed it.
WARNING: never just copy-paste a script and execute it!! Certainly not my scripts
I used this script as root to regenerate the package, after making sure all files in debian/ were OK. It assumes you have scons installed and a modified version of bksys admin/generic.py which can generate a *.orig.tar.gz file if you issue `scons deb'.
ARCHIVE=kio-locate--tvo--0.1 FOLDER=kio-locate-0.4.2tvo0.1 DEB=kio-locate_0.4.2tvo0.1_i386.deb DSC=kio-locate_0.4.2tvo0.1.dsc DIFF=kio-locate_0.4.2tvo0.1.diff ORIG=kio-locate_0.4.2tvo0.1.orig # Retrieve source from versioning system baz get $ARCHIVE $FOLDER ## GNU Arch cleanup find $FOLDER -name "{arch}" | xargs rm -rf find $FOLDER -name ".arch-i*" | xargs rm -rf cd $FOLDER # Make the orig. scons deb scons distclean # Build the package. dpkg-buildpackage -rfakeroot cd ..
After that I did:
$ lintian *.deb $ lintian *.dsc $ linda *.deb
Then:
sudo pbuilder build *.dsc
Note: I set up pbuilder for hoary using PbuilderHowto.
Then in /var/cache/pbuilder/result:
$ lintian *.deb $ lintian *.dsc $ linda *.deb
I installed and purged the package a few times comparing directory hierarchy before and after:
$ ls -R /usr/ > before $ sudo dpkg -i *.deb $ ls -R /usr/ > mid $ sudo dpkg --purge kio-locate $ ls -R /usr/ > after $ diff -u before after
No changes in between before and after, so everything's fine.
Then I uploaded it, downloaded it, generated md5sums before up and after download and compared them. They were equal so everything's fine.
Another check, run in project directory ($FOLDER in script):
sudo fakeroot debian/rules clean
and examine project directory. If there are any files left from the build process you should modify the clean rule debian/rules to delete them.
Issues
Results
I can think of three ways to list results on typing, for example, "locate:openlayer" in konqueror. Compare the following images:
[http://home.casema.nl/vollebregt/soc/1.png 1.] [http://home.casema.nl/vollebregt/soc/2.png 2.] [http://home.casema.nl/vollebregt/soc/3.png 3.]
Of course, since 3 is just 2 with some extra links, 2 and 3 could be combined (with 3 optionally configurable).
Status: Resolved: currently 1 (optional), 2 and 3 are implemented.
Hidden files
Konqueror only hides files starting with a dot, and not files like "/home/ubuntu/.local/trash/foo". Question is, should we hide hits containing "/." in kio_locate, or modify konqueror to do this (or file a bug). The first option is easiest to implement, but the second is more intuitive (only one location to change display of hidden files).
Status: Almost Resolved: sent the following patch to kde-core-devel list. Issue is resolved if accepted, otherwise I'll try to retrieve the setting from konqueror and hide /. files accordingly. Currently it is possible to change the setting in the configuration dialog.
--- kfileitem.cpp 2005-03-04 13:34:42.000000000 +0100 +++ kfileitem--tvo.cpp 2005-07-10 14:12:32.177853440 +0200 @@ -587,7 +587,7 @@ bool KFileItem::isHidden() const { if ( !m_url.isEmpty() ) - return m_url.fileName()[0] == '.'; + return m_url.fileName()[0] == '.' || m_url.fileName().find("/.") >= 0; else // should never happen return m_strName[0] == '.'; }
Canceled the e-mail (wasn't moderated). See Todo for reason.
RegExp
Are we sure we don't want regexp searches? Just shell wildcards?
Most important arguments to leave out regexp:
- Passing regular expressions through the konqueror address bar can be tricky with all these escape characters.
The casual user doesn't know regexps. They'll probably just confuse him/her. A more advanded user who knows regexps isn't afraid of CLI too, so he/she just opens an xterm and manually invokes locate -r .
rpath
enable or disable it? it's disabled as of patch-22, since that seems to be debian policy.
Done
http://home.casema.nl/vollebregt/soc/changelog-kio-locate--tvo--0.1.html
Todo
Short term
(no particular order)
(kde-apps.org) I downloaded the sources and, after spotting a "debian" subdirectory, proceeded to do dpkg-buildpackage. I run Debian/Unstable. I thought this was more of a (K)Ubuntu package, but I gave it a go anyway...BRIt complains about a dependency with python2.4; however, python 2.4.1 is there. You might want to fix that for regular, not-Ubuntu debian users. Ignoring the dependency with -d works fine, and it looks like the DEB package was installed fine. Great tool, extremely useful Needs investigation
(kde-apps.org) As suggested I used locate as my default search engine but if multiple entries are searched for nothing is returned as the actual search goes from "kat home" to "locate:kat+home". I can't confirm this. On Kubuntu it works fine. It goes from "kat home" to "locater:search?q=kat+home" which is perfectly right.
Fix the invalid date in ChangeLog (oops)
- Look at the hit counting again. Armin prefers the old way. Maybe make it configurable. (Note to self: grep for m_fullCount and m_itemsCount in old/new source)
- Maybe add config item to disable config either entirely, or disable just locate tab or just white/blacklist tab (for sysadmins). Combined with filters tab they can then blacklist system folders for example. Or whitelist home folders.
Add search bar to about:konqueror ( JavaScript allowed?) (Note to self: /usr/share/apps/konqueror/about/launch.html)
- Integrate locate:/ with Konqueror's search bar (is already included in kio-locate_0.4.2 by Armin Straub isn't it?). Also includes figuring out how to set default search plugin per profile.
- Look at Kat(done) and Kat source
- Look at Tenor and Tenor source
- Look at Katapult(done) and Katapult source
- Look at Kfind(done) and Kfind source
- Look at kio-clucene and kio-clucene source (talk to trollichon)
- Look at beagle and beagle source (requested)
Look at indexlib (the 2 links in my bookmarks )
Additionally, these two extra items are found when grepping through the kio-locate_0.4.2 source tree. Both are to do status, but pretty low priority in my opinion.
kio_locate.cpp: /// \todo Is UDS_NAME used for anything in stat? If so we should kio_locate.cpp- /// at least strip of the protocol part. kio_locate.cpp- UDSEntry entry; kio_locate.cpp- addAtom(entry, KIO::UDS_NAME, url.decode_string(url.url()));
kio_locate.cpp: /// \todo Somehow locate: and locate:/ is thought to be a directory kio_locate.cpp- /// by konqueror anyway. How to change this? kio_locate.cpp- } else { kio_locate.cpp- // What's this?
Long term
(no particular order)
Patch KDE to different behaviour regarding hidden files -> let IOSlave specify if a file has hidden attrib. This might fix hidden files in fat filesystems of someone changes the IOSlave, and it will at least fix the hidden files in kio-locate.
- Patch KDE to use default search engine in open dialog if path doesn't start with ~ or / (it now reverts to home directory)
- (August) Finally decide which of above projects (Kat, Tenor, Katapult, Kfind, kio-clucene, inotify locate) to help, take over or start.
(August) Add project to KDE extragear, http://extragear.kde.org, suggested by Armin Straub.
Other ideas:
- (August, first week?) update locate database with inotify, or FAM API (through gamin). FAM isn't possible, it can only monitor directories non-recursively.
- Integrate locate:/ with katapult
- Make kfind or Kat better
Links
http://lists.kde.org/?l=kde-devel&m=111328905108759&w=2 BR http://extragear.kde.org BR http://arminstraub.de/browse.php?page=programs_kiolocate&lang=en BR http://udu.wiki.ubuntu.com/KubuntuFileSearch BR