Skip to content

Commit

Permalink
Upgrade windows crate (#51)
Browse files Browse the repository at this point in the history
* WIP upgrade windows crate

* More Windows upgrade work - compiles now but tests fail

* WIP push forward

* WIP this is so painful

* Tests passing! Still need to make sure I'm not leaking memory

* test bin

* delete test bin

* clean up dev code, fix clippy

* whoops let's be consistent about IShellItem vs IShellItem2

* remove unused windows crate features

* Update TrashItem.id documentation

* remove anyhow dependency

* clean up imports

* Upgrade to new latest version of the windows crate

* Clean up casts, imports, comments

* cargo fmt

* replace panic with error

* Fix clippy
  • Loading branch information
rgwood committed May 25, 2022
1 parent f98bc45 commit d18f9d4
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 391 deletions.
13 changes: 5 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ rand = "0.8.3"
once_cell = "1.7.2"
env_logger = "0.9"

[target.'cfg(windows)'.build-dependencies]
windows = "0.9.0"

[target.'cfg(target_os = "macos")'.dependencies]
objc = "0.2.7"
Expand All @@ -46,10 +44,9 @@ once_cell = "1.7.2"
once_cell = "1.7.2"

[target.'cfg(windows)'.dependencies]
windows = { version = "0.37.0", features = [ "alloc",
"Win32_Foundation",
"Win32_System_Com_StructuredStorage",
"Win32_UI_Shell_PropertiesSystem",
] }
scopeguard = "1.0.0"

# Can't update to the latest version because there was a limitation
# introduced that affects this library as well
# https://github.com/microsoft/windows-rs/pull/909#issuecomment-869595631
windows = "0.9.0"

52 changes: 0 additions & 52 deletions build.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ where
pub struct TrashItem {
/// A system specific identifier of the item in the trash.
///
/// On Windows it is the string returned by `IShellFolder::GetDisplayNameOf`
/// with the `SHGDN_FORPARSING` flag.
/// On Windows it is the string returned by `IShellItem::GetDisplayName`
/// with the `SIGDN_DESKTOPABSOLUTEPARSING` flag.
///
/// On Linux it is an absolute path to the `.trashinfo` file associated with
/// the item.
Expand Down

0 comments on commit d18f9d4

Please sign in to comment.