mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-15 12:55:36 +00:00
6a7fbf0b59
The CallsBestMatchView and CallsPhoneNumberQuery classes are written in Vala because they may be generally useful and to leave open the possibility of adding them to libfolks itself, which is written in Vala.
49 lines
1.3 KiB
Vala
49 lines
1.3 KiB
Vala
/*
|
|
* Copyright (C) 2019 Purism SPC
|
|
*
|
|
* This file is part of Calls.
|
|
*
|
|
* Calls is free software: you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Calls is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* Author: Bob Ham <bob.ham@puri.sm>
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
*/
|
|
|
|
|
|
public class Calls.BestMatchView : Folks.SearchView
|
|
{
|
|
public Folks.Individual? best_match
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
private void update ()
|
|
{
|
|
best_match =
|
|
individuals.is_empty ? null : individuals.first ();
|
|
}
|
|
|
|
public BestMatchView (Folks.IndividualAggregator aggregator,
|
|
Folks.Query query)
|
|
{
|
|
base (aggregator, query);
|
|
|
|
this.individuals_changed_detailed.connect
|
|
((sv, p) => { update (); });
|
|
update();
|
|
}
|
|
}
|