Skip to content

Commit

Permalink
Update todo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Jun 30, 2024
1 parent efb64a9 commit 7dc2ec4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,7 @@ pub fn run(sub: Subcommand, no_manifest_update: bool, try_manifest_update: bool)
}

// Restore
//
// TODO.2023-07-12 detect if there are differences between backed up
// and actual saves and skip the question if there is none
// TODO: Detect if saves are unchanged and skip the question?
'restore: {
let Some(game_name) = game_name.as_ref() else {
break 'restore;
Expand Down Expand Up @@ -933,12 +931,10 @@ pub fn run(sub: Subcommand, no_manifest_update: bool, try_manifest_update: bool)
}

// Launch game
//
// TODO.2023-07-12 legendary returns immediately, handle this!
// TODO: Legendary returns immediately. Can we handle that?
let result = Command::new(&commands[0]).args(&commands[1..]).status();
match result {
Ok(status) => {
// TODO.2023-07-14 handle return status which indicate an error condition, e.g. != 0
log::debug!("WRAP::execute: Game command executed, returning status: {:#?}", status);
}
Err(err) => {
Expand Down
2 changes: 2 additions & 0 deletions src/gui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ impl App {
return (name, false);
};

// TODO: Add an option to validate all backups at once.
let valid = layout.validate(backup_id);
(name, valid)
},
Expand Down Expand Up @@ -1502,6 +1503,7 @@ impl Application for App {
Command::none()
}
Message::EditedRedirect(action, field) => {
// TODO: Automatically refresh redirected paths in the game list.
match action {
EditAction::Add => {
self.text_histories.redirects.push(Default::default());
Expand Down
1 change: 1 addition & 0 deletions src/scan/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ impl BackupError {

#[derive(Clone, Debug, Default)]
pub struct BackupInfo {
// TODO: Use `StrictPath` as key instead of whole `ScannedFile`?
pub failed_files: HashMap<ScannedFile, BackupError>,
pub failed_registry: HashMap<RegistryItem, BackupError>,
}
Expand Down
4 changes: 2 additions & 2 deletions src/scan/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,7 @@ impl GameLayout {
}

pub fn remove_irrelevant_backup_files(&self, backup: &str, relevant_files: &[StrictPath]) {
// TODO: Remove empty directories as well.
log::trace!(
"[{}] looking for irrelevant backup files in {}",
self.mapping.name,
Expand Down Expand Up @@ -1889,8 +1890,7 @@ impl GameLayout {
}
}

/// Checks the latest backup (full + diff) only.
/// Returns whether backup is valid.
/// Returns whether the backup is valid.
pub fn validate(&self, backup_id: BackupId) -> bool {
if let Some((backup, diff)) = self.find_by_id(&backup_id) {
match backup.format() {
Expand Down
1 change: 1 addition & 0 deletions src/scan/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ impl ScanInfo {
}

pub fn overall_change(&self) -> ScanChange {
// TODO: Disabled games can still be marked as new/updated. Should we suppress that?
if self.is_total_removal() {
ScanChange::Removed
} else if self.is_brand_new() {
Expand Down
1 change: 1 addition & 0 deletions src/scan/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ pub fn try_read_registry_key(hive_name: &str, key: &str) -> Option<Entries> {
fn read_registry_key(key: &winreg::RegKey) -> Entries {
let mut entries = Entries::default();
for (name, value) in key.enum_values().filter_map(|x| x.ok()) {
// TODO: The default value has an empty name. How should we represent it?
let entry = Entry::from(value);
if entry.is_set() {
entries.0.insert(name, entry);
Expand Down

0 comments on commit 7dc2ec4

Please sign in to comment.