-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Code Quality: Sync the jump list with Explorer #17564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
0x5bfa
wants to merge
21
commits into
files-community:main
Choose a base branch
from
0x5bfa:5bfa/CQ-JumpListManager
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,312
−482
Open
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a3e662e
Init
0x5bfa cda9bb6
Use custom destinations instead
0x5bfa bb62597
Use proper folder icons
0x5bfa 53713da
Open items in FIles
0x5bfa ea72a8e
Update
0x5bfa cced46b
Fixed a memory leak
0x5bfa 3674293
Correct the execution path
0x5bfa 49bfc78
Reimplement & fix all issues
0x5bfa 1a07680
Add a folder viewed to the Recent category
0x5bfa 1bddc4b
Req
0x5bfa 1e64430
Notify to the pin manager
0x5bfa e236a0d
Req
0x5bfa d57d690
Revert "Req"
0x5bfa a8c65d4
Revert "Notify to the pin manager"
0x5bfa 90b072a
Refactor PullJumpListFromExplorer logic
0x5bfa 2326930
Avoid race condition
0x5bfa 833bb6c
Fix quick access being idiot
0x5bfa cadfe93
Improved PullJumpListFromExplorer
0x5bfa 0359279
Improved PushJumpListToExplorer
0x5bfa 337d60a
Add an update event debounce to Quick Access widget
0x5bfa 7402495
Notify jump list update to the sidebar
0x5bfa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| // Copyright (c) Files Community | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace Windows.Win32 | ||
| { | ||
| /// <summary> | ||
| /// Contains a heap pointer allocated via <see cref="NativeMemory.Alloc"/> and a set of methods to work with the pointer safely. | ||
| /// </summary> | ||
| public unsafe struct HeapPtr<T> : IDisposable where T : unmanaged | ||
| { | ||
| private T* _ptr; | ||
|
|
||
| public readonly bool IsNull | ||
| { | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| get => _ptr is null; | ||
| } | ||
|
|
||
| public HeapPtr(T* ptr) | ||
| { | ||
| _ptr = ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public readonly T* Get() | ||
| { | ||
| return _ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public readonly T** GetAddressOf() | ||
| { | ||
| return (T**)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public void Attach(T* ptr) | ||
| { | ||
| Dispose(); | ||
| _ptr = ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public T* Detach() | ||
| { | ||
| T* ptr = _ptr; | ||
| _ptr = null; | ||
| return ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public bool Allocate(nuint cch) | ||
| { | ||
| _ptr = (T*)NativeMemory.Alloc(cch); // malloc() | ||
| return _ptr is not null; | ||
| } | ||
|
Comment on lines
+56
to
+60
This comment was marked as outdated.
Sorry, something went wrong. |
||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public bool Reallocate(nuint cch) | ||
| { | ||
| T* ptr = (T*)NativeMemory.Realloc(_ptr, cch); // realloc() | ||
0x5bfa marked this conversation as resolved.
Show resolved
Hide resolved
0x5bfa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (ptr is null) return false; | ||
| _ptr = ptr; | ||
| return true; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public void Dispose() | ||
| { | ||
| T* ptr = _ptr; | ||
| if (ptr is null) return; | ||
| _ptr = null; | ||
| NativeMemory.Free(ptr); // free() | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.