Commit Graph

11 Commits

Author SHA1 Message Date
Aaron J. Seigo
2954087e8d * eliminate the three search lists and have just one
* remove add*Match since they broke the pattern of usage (who owns the match? do you have to add it again? etc..)
* add addMatch to compliment addMatches for those runners that just ever have one match
* make the default SearchMatch type Possible rather than Exact (making Exact and Informational the exceptions, which matches usage patterns)
* const'ify the API a bit better

generally more performant, lower memory usage and clearer API having seen what is beign done in the runners. also makes it a bit easier to turn the Matches into a qt model

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=776931
2008-02-19 03:59:21 +00:00
Aaron J. Seigo
022875b1d5 let the world know our matches have changed when they, well, change. always.
(neat when optimizations reveal bugs: previously when we were always setting the match lists even when we got empty lists, this was masking the fact that we were never updating the matches when the search context was reset ... so there was always a period of time when there were stale matches pointing off into outerspace in the UI. and of course, if no engines returned anything .. booM! but once we were not responding to empty match lists this problem became very visible.)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=775180
2008-02-15 03:57:54 +00:00
Aaron J. Seigo
123623d675 We make a thread-local copy of the SearchContext for each Runner. As such, there is no need to do locking on the thread-local copy. This patch also adds assertions on the non-thread safe methods (e.g. addExactMatch) which are used from thread-local copies, but which should never be used in the shared version.
Also adds a addMatchesTo(SearchContext) which encapsulates this code and makes it safe to delete matches on object deletion, preventing possible memory leaks on SearchContext destruction.

Finally, don't copy all the SearchMatches already registered for each thread-local copy as that's just unused and unecessary overhead.

BIC, though SC.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=773473
2008-02-11 06:04:20 +00:00
Aaron J. Seigo
293a4dc07d save a write lock and return false (as we don't actually add anything) on addMatches with null items
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=772448
2008-02-08 19:10:20 +00:00
Aaron J. Seigo
2f479c7084 * require a SearchContext in exec since the context may have shifted during matching due to multithreading
* differentiate between resetSearchTerm and just setSearchTerm (to be used with the above)
* remove the SearchContext ptr from SearchMatch's dptr as it isn't used; don't want to mislead people or waste memory
* more const correctness

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=764593
2008-01-22 04:38:03 +00:00
Aaron J. Seigo
86ccea46b6 do tilde expansion
BUG:153326

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=750316
2007-12-19 07:01:16 +00:00
Aaron J. Seigo
cfd3bfac48 * SearchAction becomes SearchMatch; fall out of the refactoring
* add camel case headers for those classes now that they've settled in

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=744452
2007-12-03 17:18:28 +00:00
Ryan P. Bitanga
eff8326f80 Say hello to multithreaded krunner ;)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=743865
2007-12-02 07:11:50 +00:00
Aaron J. Seigo
ac1d1b0cdf replace the rather expensive (but exact and thorough) KUriFilter based analysis of the search term with inexact but fast and good enough to not be annoying
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=734739
2007-11-09 19:14:15 +00:00
Jeremy Paul Whiting
1370f1153f return after checking each runner for matches, so krunner is much more responsive, also disable much of SearchContext::setSearchTerm because its very slow (with aseigos blessing
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=734512
2007-11-09 05:01:18 +00:00
Aaron J. Seigo
0a6f2af7f3 * move SearchAction and SearchContext to their own files
* term -> searchTerm
* add a completion object to SearchContext

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=731848
2007-11-02 02:34:46 +00:00