Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@
"The folder may contain files. Try another name or category.": "The folder may contain files. Try another name or category.",
"Files from the selected folder will appear here.": "Files from the selected folder will appear here.",
"Clear filters": "Clear filters",
"Preview layout": "Preview layout",
"List": "List",
"By folder": "By folder",
"Not selected": "Not selected",
"Destination folders": "Destination folders",
"Search the history": "Search the history",
"Where did a file go? Search by name": "Where did a file go? Search by name",
"No moved file has this name.": "No moved file has this name.",
"Files found in the history": "Files found in the history",
"Showing the 50 most recent matches. Type more of the name to narrow them.": "Showing the 50 most recent matches. Type more of the name to narrow them.",
"Never organize this file": "Never organize this file",
"Show in folder": "Show in folder",
"This file is no longer at the destination.": "This file is no longer at the destination.",
"View conflicts": "View conflicts",
"Open destination folder": "Open destination folder",
"This folder doesn't exist yet. It's created when files are organized.": "This folder doesn't exist yet. It's created when files are organized.",
"Could not open the folder.": "Could not open the folder.",
"Clear search": "Clear search",
"Sort files": "Sort files",
"Name (A–Z)": "Name (A–Z)",
"Newest first": "Newest first",
"Largest first": "Largest first",
"Preview files scroll area": "Preview files scroll area",
"Files scroll area": "Files scroll area",
"Use the scroll keys to review the files and destinations.": "Use the scroll keys to review the files and destinations.",
Expand Down Expand Up @@ -115,7 +137,6 @@
"operation loaded": "operation loaded",
"operations loaded": "operations loaded",
", newest first": ", newest first",
"New operations — refresh the list": "New operations — refresh the list",
"Recorded operations": "Recorded operations",
"Operation": "Operation",
"Preparing restore…": "Preparing restore…",
Expand Down Expand Up @@ -546,5 +567,6 @@
"Checking for updates…": "Checking for updates…",
"You have the latest version": "You have the latest version",
"Couldn't check for updates": "Couldn't check for updates",
"Check your connection and try again.": "Check your connection and try again."
"Check your connection and try again.": "Check your connection and try again.",
"Settings sections": "Settings sections"
}
26 changes: 24 additions & 2 deletions i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@
"The folder may contain files. Try another name or category.": "La carpeta puede contener archivos. Prueba con otro nombre o categoría.",
"Files from the selected folder will appear here.": "Los archivos de la carpeta seleccionada aparecerán aquí.",
"Clear filters": "Borrar filtros",
"Preview layout": "Formato de la vista previa",
"List": "Lista",
"By folder": "Por carpeta",
"Not selected": "No seleccionado",
"Destination folders": "Carpetas de destino",
"Search the history": "Buscar en el historial",
"Where did a file go? Search by name": "¿Adónde fue un archivo? Busca por nombre",
"No moved file has this name.": "Ningún archivo movido tiene este nombre.",
"Files found in the history": "Archivos encontrados en el historial",
"Showing the 50 most recent matches. Type more of the name to narrow them.": "Se muestran las 50 coincidencias más recientes. Escribe más del nombre para acotarlas.",
"Never organize this file": "No organizar nunca este archivo",
"Show in folder": "Mostrar en la carpeta",
"This file is no longer at the destination.": "Este archivo ya no está en el destino.",
"View conflicts": "Ver conflictos",
"Open destination folder": "Abrir carpeta de destino",
"This folder doesn't exist yet. It's created when files are organized.": "Esta carpeta aún no existe. Se crea cuando se organizan los archivos.",
"Could not open the folder.": "No se pudo abrir la carpeta.",
"Clear search": "Borrar búsqueda",
"Sort files": "Ordenar archivos",
"Name (A–Z)": "Nombre (A–Z)",
"Newest first": "Más recientes",
"Largest first": "Más grandes",
"Preview files scroll area": "Área de desplazamiento de los archivos de la vista previa",
"Files scroll area": "Área de desplazamiento de los archivos",
"Use the scroll keys to review the files and destinations.": "Usa las teclas de desplazamiento para revisar los archivos y destinos.",
Expand Down Expand Up @@ -115,7 +137,6 @@
"operation loaded": "operación cargada",
"operations loaded": "operaciones cargadas",
", newest first": ", de la más reciente a la más antigua",
"New operations — refresh the list": "Nuevas operaciones — actualizar lista",
"Recorded operations": "Operaciones registradas",
"Operation": "Operación",
"Preparing restore…": "Preparando restauración…",
Expand Down Expand Up @@ -546,5 +567,6 @@
"Checking for updates…": "Buscando actualizaciones…",
"You have the latest version": "Tienes la versión más reciente",
"Couldn't check for updates": "No se pudieron buscar actualizaciones",
"Check your connection and try again.": "Revisa tu conexión e inténtalo de nuevo."
"Check your connection and try again.": "Revisa tu conexión e inténtalo de nuevo.",
"Settings sections": "Secciones de los ajustes"
}
26 changes: 24 additions & 2 deletions i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@
"The folder may contain files. Try another name or category.": "Le dossier peut contenir des fichiers. Essayez un autre nom ou une autre catégorie.",
"Files from the selected folder will appear here.": "Les fichiers du dossier sélectionné apparaîtront ici.",
"Clear filters": "Effacer les filtres",
"Preview layout": "Présentation de l'aperçu",
"List": "Liste",
"By folder": "Par dossier",
"Not selected": "Non sélectionné",
"Destination folders": "Dossiers de destination",
"Search the history": "Rechercher dans l'historique",
"Where did a file go? Search by name": "Où est passé un fichier ? Cherchez par nom",
"No moved file has this name.": "Aucun fichier déplacé ne porte ce nom.",
"Files found in the history": "Fichiers trouvés dans l'historique",
"Showing the 50 most recent matches. Type more of the name to narrow them.": "Affichage des 50 résultats les plus récents. Tapez plus du nom pour les affiner.",
"Never organize this file": "Ne jamais organiser ce fichier",
"Show in folder": "Afficher dans le dossier",
"This file is no longer at the destination.": "Ce fichier n'est plus dans la destination.",
"View conflicts": "Voir les conflits",
"Open destination folder": "Ouvrir le dossier de destination",
"This folder doesn't exist yet. It's created when files are organized.": "Ce dossier n'existe pas encore. Il est créé quand les fichiers sont organisés.",
"Could not open the folder.": "Impossible d'ouvrir le dossier.",
"Clear search": "Effacer la recherche",
"Sort files": "Trier les fichiers",
"Name (A–Z)": "Nom (A–Z)",
"Newest first": "Plus récents",
"Largest first": "Plus volumineux",
"Preview files scroll area": "Zone de défilement des fichiers de l'aperçu",
"Files scroll area": "Zone de défilement des fichiers",
"Use the scroll keys to review the files and destinations.": "Utilisez les touches de défilement pour vérifier les fichiers et destinations.",
Expand Down Expand Up @@ -115,7 +137,6 @@
"operation loaded": "opération chargée",
"operations loaded": "opérations chargées",
", newest first": ", de la plus récente à la plus ancienne",
"New operations — refresh the list": "Nouvelles opérations — actualiser la liste",
"Recorded operations": "Opérations enregistrées",
"Operation": "Opération",
"Preparing restore…": "Préparation de la restauration…",
Expand Down Expand Up @@ -546,5 +567,6 @@
"Checking for updates…": "Recherche de mises à jour…",
"You have the latest version": "Vous avez la version la plus récente",
"Couldn't check for updates": "Impossible de rechercher des mises à jour",
"Check your connection and try again.": "Vérifiez votre connexion et réessayez."
"Check your connection and try again.": "Vérifiez votre connexion et réessayez.",
"Settings sections": "Sections des paramètres"
}
26 changes: 24 additions & 2 deletions i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@
"The folder may contain files. Try another name or category.": "La cartella può contenere file. Prova un altro nome o un'altra categoria.",
"Files from the selected folder will appear here.": "I file della cartella selezionata appariranno qui.",
"Clear filters": "Cancella i filtri",
"Preview layout": "Formato dell'anteprima",
"List": "Elenco",
"By folder": "Per cartella",
"Not selected": "Non selezionato",
"Destination folders": "Cartelle di destinazione",
"Search the history": "Cerca nella cronologia",
"Where did a file go? Search by name": "Dove è finito un file? Cerca per nome",
"No moved file has this name.": "Nessun file spostato ha questo nome.",
"Files found in the history": "File trovati nella cronologia",
"Showing the 50 most recent matches. Type more of the name to narrow them.": "Sono mostrati i 50 risultati più recenti. Scrivi più del nome per restringerli.",
"Never organize this file": "Non organizzare mai questo file",
"Show in folder": "Mostra nella cartella",
"This file is no longer at the destination.": "Questo file non è più nella destinazione.",
"View conflicts": "Vedi i conflitti",
"Open destination folder": "Apri la cartella di destinazione",
"This folder doesn't exist yet. It's created when files are organized.": "Questa cartella non esiste ancora. Viene creata quando i file vengono organizzati.",
"Could not open the folder.": "Impossibile aprire la cartella.",
"Clear search": "Cancella ricerca",
"Sort files": "Ordina i file",
"Name (A–Z)": "Nome (A–Z)",
"Newest first": "Più recenti",
"Largest first": "Più grandi",
"Preview files scroll area": "Area di scorrimento dei file dell'anteprima",
"Files scroll area": "Area di scorrimento dei file",
"Use the scroll keys to review the files and destinations.": "Usa i tasti di scorrimento per controllare file e destinazioni.",
Expand Down Expand Up @@ -115,7 +137,6 @@
"operation loaded": "operazione caricata",
"operations loaded": "operazioni caricate",
", newest first": ", dalla più recente alla meno recente",
"New operations — refresh the list": "Nuove operazioni — aggiorna l'elenco",
"Recorded operations": "Operazioni registrate",
"Operation": "Operazione",
"Preparing restore…": "Preparazione del ripristino…",
Expand Down Expand Up @@ -546,5 +567,6 @@
"Checking for updates…": "Ricerca aggiornamenti…",
"You have the latest version": "Hai la versione più recente",
"Couldn't check for updates": "Impossibile cercare aggiornamenti",
"Check your connection and try again.": "Controlla la connessione e riprova."
"Check your connection and try again.": "Controlla la connessione e riprova.",
"Settings sections": "Sezioni delle impostazioni"
}
26 changes: 24 additions & 2 deletions i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@
"The folder may contain files. Try another name or category.": "A pasta pode conter arquivos. Tente outro nome ou categoria.",
"Files from the selected folder will appear here.": "Os arquivos da pasta selecionada aparecerão aqui.",
"Clear filters": "Limpar filtros",
"Preview layout": "Formato da prévia",
"List": "Lista",
"By folder": "Por pasta",
"Not selected": "Não selecionado",
"Destination folders": "Pastas de destino",
"Search the history": "Buscar no histórico",
"Where did a file go? Search by name": "Para onde foi um arquivo? Busque pelo nome",
"No moved file has this name.": "Nenhum arquivo movido tem esse nome.",
"Files found in the history": "Arquivos encontrados no histórico",
"Showing the 50 most recent matches. Type more of the name to narrow them.": "Mostrando os 50 resultados mais recentes. Digite mais do nome para filtrar.",
"Never organize this file": "Nunca organizar este arquivo",
"Show in folder": "Mostrar na pasta",
"This file is no longer at the destination.": "Este arquivo não está mais no destino.",
"View conflicts": "Ver conflitos",
"Open destination folder": "Abrir pasta de destino",
"This folder doesn't exist yet. It's created when files are organized.": "Esta pasta ainda não existe. Ela é criada quando os arquivos são organizados.",
"Could not open the folder.": "Não foi possível abrir a pasta.",
"Clear search": "Limpar busca",
"Sort files": "Ordenar arquivos",
"Name (A–Z)": "Nome (A–Z)",
"Newest first": "Mais recentes",
"Largest first": "Maiores",
"Preview files scroll area": "Área de rolagem dos arquivos da prévia",
"Files scroll area": "Área de rolagem dos arquivos",
"Use the scroll keys to review the files and destinations.": "Use as teclas de rolagem para conferir os arquivos e destinos.",
Expand Down Expand Up @@ -115,7 +137,6 @@
"operation loaded": "operação carregada",
"operations loaded": "operações carregadas",
", newest first": ", da mais recente para a mais antiga",
"New operations — refresh the list": "Novas operações — atualizar lista",
"Recorded operations": "Operações registradas",
"Operation": "Operação",
"Preparing restore…": "Preparando restauração…",
Expand Down Expand Up @@ -546,5 +567,6 @@
"Checking for updates…": "Verificando atualizações…",
"You have the latest version": "Você está na versão mais recente",
"Couldn't check for updates": "Não foi possível verificar atualizações",
"Check your connection and try again.": "Confira sua conexão e tente de novo."
"Check your connection and try again.": "Confira sua conexão e tente de novo.",
"Settings sections": "Seções das configurações"
}
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ getrandom = "0.4"
tauri-plugin-updater = "2"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Wdk_Foundation", "Wdk_Storage_FileSystem", "Win32_Security", "Win32_System_IO", "Win32_System_Registry", "Win32_UI_WindowsAndMessaging", "Win32_Globalization"] }
windows-sys = { version = "0.61", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Wdk_Foundation", "Wdk_Storage_FileSystem", "Win32_Security", "Win32_System_IO", "Win32_System_Registry", "Win32_UI_WindowsAndMessaging", "Win32_UI_Shell", "Win32_Globalization"] }

[dev-dependencies]
tempfile = "3"
Expand Down
18 changes: 10 additions & 8 deletions src-tauri/src/file_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ pub(super) fn identity(file: &File) -> Result<Identity> {
))
}

/// A path without the \\?\ prefix, the form people and Explorer read.
pub(crate) fn plain_path(name: &str) -> String {
if let Some(tail) = name.strip_prefix(r"\\?\UNC\") {
format!(r"\\{tail}")
} else {
name.strip_prefix(r"\\?\").unwrap_or(name).to_owned()
}
}

fn verify_physical_path(file: &File, expected: &Path) -> Result<()> {
use std::os::windows::io::AsRawHandle;
use windows_sys::Win32::Storage::FileSystem::GetFinalPathNameByHandleW;
Expand All @@ -95,15 +104,8 @@ fn verify_physical_path(file: &File, expected: &Path) -> Result<()> {
return Err(t("Could not confirm the file's safe path.").into());
}
let actual = String::from_utf16(&buffer[..length]).map_err(|_| changed())?;
let normalize = |name: &str| {
if let Some(tail) = name.strip_prefix(r"\\?\UNC\") {
format!(r"\\{tail}")
} else {
name.strip_prefix(r"\\?\").unwrap_or(name).to_owned()
}
};
// Compare the resolved handle, never canonicalize the requested path after opening.
if normalize(&actual) != normalize(expected.to_str().ok_or(changed())?) {
if plain_path(&actual) != plain_path(expected.to_str().ok_or(changed())?) {
return Err(changed().into());
}
Ok(())
Expand Down
Loading
Loading