mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-02 22:29:01 +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,
|
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)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct DependencyCheckResult {
|
pub struct DependencyCheckResult {
|
||||||
pub dependency: Dependency,
|
pub dependency: Dependency,
|
||||||
|
|
|
@ -273,6 +273,8 @@ impl SimpleComponent for App {
|
||||||
}
|
}
|
||||||
runners.push(get_build_opencomposite_runner(profile.clone()));
|
runners.push(get_build_opencomposite_runner(profile.clone()));
|
||||||
if !missing_deps.is_empty() {
|
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(
|
self.dependencies_dialog.set_body(
|
||||||
missing_deps
|
missing_deps
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -462,7 +464,7 @@ impl SimpleComponent for App {
|
||||||
.sender()
|
.sender()
|
||||||
.emit(MainViewMsg::UpdateProfileNames(
|
.emit(MainViewMsg::UpdateProfileNames(
|
||||||
model.profiles.iter().map(|p| p.clone().name).collect(),
|
model.profiles.iter().map(|p| p.clone().name).collect(),
|
||||||
model.config.clone()
|
model.config.clone(),
|
||||||
));
|
));
|
||||||
|
|
||||||
let timer_sender = sender.clone();
|
let timer_sender = sender.clone();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue