Commit bf0385ee authored by Alexandre Lision's avatar Alexandre Lision

smartlist: allow filtering

peopleProxy is a QSortProxyFilter we can use to filter our smartlist
based on user input from the searchbar

Issue: #81111
Change-Id: I0dab38670e4f5f64d924effc81405d663d90dfeb
parent ee098463
......@@ -19,6 +19,6 @@
#import <Cocoa/Cocoa.h>
@interface SmartViewVC : NSViewController
@interface SmartViewVC : NSViewController <NSTextFieldDelegate>
@end
......@@ -291,10 +291,13 @@ NSInteger const TXT_BUTTON_TAG = 500;
}
c << Call::Action::ACCEPT;
}
[searchField setStringValue:@""];
RecentModel::instance()->peopleProxy()->
setFilterRegExp(QRegExp(QString::fromNSString([searchField stringValue]), Qt::CaseInsensitive, QRegExp::FixedString));
}
#pragma NSTextField Delegate
#pragma NSTextFieldDelegate
- (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector
{
......@@ -308,4 +311,10 @@ NSInteger const TXT_BUTTON_TAG = 500;
return NO;
}
- (void)controlTextDidChange:(NSNotification *) notification
{
RecentModel::instance()->peopleProxy()->
setFilterRegExp(QRegExp(QString::fromNSString([searchField stringValue]), Qt::CaseInsensitive, QRegExp::FixedString));
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment