Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using the quickly unity lens template here http://developer.ubuntu.com/2012/04/how-to-create-a-wikipedia-unity-lens-for-ubuntu/ It works quite all right, but even though i have set search_in_global to true the global search calls my lens's search function without the entered search parameter, thus it returns everything it can find:

class Meta:
    name = 'myLens'
    description = 'My Lens'
    search_hint = 'Search My Lens'
    icon = 'mylens.svg'
    search_on_blank=True
    search_in_global=True #doesn't seem to work

When i type in a global search my search function is not called with the entered phrases but with a blank string/null:

def search(self, search, results):
    print "searching for %s" % search
    #...

Can anyone help me out here?


Thanks for the quick reply! i added the proposed method like so:

def global_search(self, search, results):
    print "searching globally for %s" % search
    self.search(search, results)

unfortunally the output when i type anything in the global dash doesn't change a lot:

leopard2a5@Spieleknecht:~/Desktop/mylens$ quickly run
searching globally for 
searching for
share|improve this question
    
search_in_global isn't actually a setting, where did you get that from? –  mhall119 Apr 25 '12 at 21:54
    
Let me correct that, search_in_global isn't a setting in Singlet, it does exist if you're using GObject to build your lens/scope –  mhall119 Apr 25 '12 at 22:15
    
Ok, this is sounding like a bug now, can you file it against bugs.launchpad.net/hello-unity along with the source files for your lens (if possible, it'll help me debug it) –  mhall119 May 14 '12 at 16:50
    
Sorry, should be filed against bugs.launchpad.net/singlet not hello-unity, wrong project –  mhall119 May 14 '12 at 19:39

1 Answer 1

If you define a function called global_search(self, phrase, results), that will be called on global searches instead of the default search(self, phrase, results). See if that gets the correct search phrase.

share|improve this answer
    
See my answer below :) –  Leopard2A5 Apr 27 '12 at 13:57
    
No idea what the problem might be? –  Leopard2A5 Apr 30 '12 at 11:42
    
Please file it as a bug against Singlet, and attach the sourcecode for your project so I can test it. Thanks. –  mhall119 May 21 '12 at 0:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.