 import Cocoa
 
 @NSApplicationMain
-class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate {
+class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate, NSMetadataQueryDelegate {
     
     @IBOutlet var window: NSWindow?
     @IBOutlet var popover : NSPopover?

        if self.user.userId == nil {
            self.login(self)
        }
    }
    
    func applicationWillTerminate(aNotification: NSNotification) {
        // Insert code here to tear down your application
    }
    
    override func awakeFromNib() {

    
    let icon: IconView
    let item: NSStatusItem
    
    let query = NSMetadataQuery()
    
    override init() {
        let bar = NSStatusBar.systemStatusBar()
