mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-20 11:35:48 +00:00
feat: deduplicate missing deps
This commit is contained in:
parent
5b4f4ab085
commit
e905fa7569
2 changed files with 15 additions and 1 deletions
|
@ -15,6 +15,18 @@ pub struct Dependency {
|
|||
pub filename: String,
|
||||
}
|
||||
|
||||
impl Ord for Dependency {
|
||||
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
|
||||
self.name.cmp(&other.name)
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for Dependency {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct DependencyCheckResult {
|
||||
pub dependency: Dependency,
|
||||
|
|
|
@ -273,6 +273,8 @@ impl SimpleComponent for App {
|
|||
}
|
||||
runners.push(get_build_opencomposite_runner(profile.clone()));
|
||||
if !missing_deps.is_empty() {
|
||||
missing_deps.sort_unstable();
|
||||
missing_deps.dedup(); // dedup only works if sorted, hence the above
|
||||
self.dependencies_dialog.set_body(
|
||||
missing_deps
|
||||
.iter()
|
||||
|
@ -462,7 +464,7 @@ impl SimpleComponent for App {
|
|||
.sender()
|
||||
.emit(MainViewMsg::UpdateProfileNames(
|
||||
model.profiles.iter().map(|p| p.clone().name).collect(),
|
||||
model.config.clone()
|
||||
model.config.clone(),
|
||||
));
|
||||
|
||||
let timer_sender = sender.clone();
|
||||
|
|
Loading…
Add table
Reference in a new issue