1
0
Fork 0
mirror of synced 2024-06-27 02:21:05 +12:00
Commit graph

295 commits

Author SHA1 Message Date
Thomas Jung 3476644497 Use one implementation for all hash calculations
All implementations are the same they only differ by hasher and the file read
limit.
2021-02-21 18:04:48 +01:00
Thomas Andreas Jung 0f12897687
Support the hash type parameter in the CLI (#267)
https://github.com/qarmin/czkawka/issues/266
2021-02-21 05:59:07 +01:00
Thomas Andreas Jung 1e94587de8
Ignore duplicates if those are hard links (#234)
This is a proof of concept.

```
$ echo a > hardlinks/a
$ cp hardlinks/{a,b}
$ ln hardlinks/{a,c}
$ cargo run --bin czkawka_cli dup -m 1 --directories $(pwd)/hardlinks -f /dev/stderr > /dev/null
-------------------------------------------------Files with same hashes-------------------------------------------------
Found 1 duplicated files which in 1 groups which takes 2 B.

---- Size 2 B (2) - 2 files
/home/thomas/Development/czkawka/hardlinks/a
/home/thomas/Development/czkawka/hardlinks/b
```

Open:
- Windows support
- Probably this should be a cli option
2021-02-20 12:28:06 +01:00
krzysdz 4c205ce098
Windows taskbar progress support (#264)
* Initial Windows taskbar progress support

* Changes to COM (un)init

It turns out winapi exposes IIDs through a `uuidof()` function of interfaces, so the copied one can be removed.

* Don't return error codes

Now the `TaskbarProgress` functions fail silently.
The `TaskbarProgress` struct now will always be created (even in case of errors in initialisation), but it won't do anything.

* Fix builds for other systems

* Formatted code

* Fix progress shown after the operation finished

A progress update was received after the stop event.
Also `as_ref()` was removed in many places (I don't even know why it was there).

* Remove redundant call to hide

It's already called by the `glib_stop_receiver` receiver.

* Release the ITaskbarList3 and call CoUninitialize at exit

Because objects moved to closures used as fallbacks in GTK have [static lifetimes](https://gtk-rs.org/docs-src/tutorial/closures#closures), the `TaskbarProgress` will never be dropped.
To workaround this problem a `release` function is called when the main window is closed. This function behaves like `drop`, but sets the struct in a valid "empty" state, so that calling `release`/`drop` again won't cause problems.

* Don't set the NORMAL state manually

Because only NOPROGRESS and INDETERMINATE states are used, there is no need to set the NORMAL state when changing the progress value.

Now `set_progress_value` will also change the `TaskbarProgress::current_state` if such situation occurs.

> Unless [SetProgressState](https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressstate)
> has set a blocking state (TBPF_ERROR or TBPF_PAUSED) for the window, a call to **SetProgressValue** assumes the TBPF_NORMAL
> state even if it is not explicitly set. A call to **SetProgressValue** overrides and clears the TBPF_INDETERMINATE state.

See the [SetProgressValue documentation](https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressvalue#how-the-taskbar-button-chooses-the-progress-indicator-for-a-group)
2021-02-20 12:24:36 +01:00
Dan Dascalescu db255a87d4
Improve English (#260) 2021-02-20 09:57:11 +01:00
Dan Dascalescu c035514a0e
Improve English for "Ask in future" button (#261) 2021-02-20 09:56:23 +01:00
krzysdz 2e7c5c2dcb
Fix Winows theme in CI (#265)
The admin-gtk3-dark-osx theme contains relative symlinks, which after copying only this theme are no longer valid.
The -L (--dereference) option makes cp always follow symbolic links, so that all of them are replaced with files they pointed to.
2021-02-20 09:55:36 +01:00
endolith 3ad1dfacbe
README: Fix a typo (#255) 2021-02-11 19:04:39 +01:00
Thomas Andreas Jung 03d41e173f
Keep original file if replacing duplicate with hardlink fails (#253)
If the user could not create a hard link (due to permissions or
different block devices) then czkawka lost the duplicate file.

```
$ mkdir hardlink
$ cd hardlink
$ echo a > a
$ cp a b
$ chown thetestuser:thetestuser a
$ ls -il .

25169246 -rw-rw-r-- 1 thetestuser thetestuser 2 Feb  7 11:18 a
25169641 -rw-rw-r-- 1 thomas      thomas      2 Feb  7 11:18 b

$ cargo run --bin czkawka_cli dup --directories $(pwd) -m 1 -f
test101.result --delete-method HARD

[...]
-------------------------------WARNINGS--------------------------------
Failed to link /home/thomas/Development/czkawka/hardlink/b ->
/home/thomas/Development/czkawka/hardlink/a
---------------------------END OF WARNINGS-----------------------------

$ ls -il .
25169246 -rw-rw-r-- 1 thetestuser thetestuser 2 Feb  7 11:18 a
```

Now czkawka keeps all files and the warning provides more information
why czkawka can't replace the duplicate with a hard link.

```
$ cargo run --bin czkawka_cli dup --directories $(pwd) -m 1 -f
test101.result --delete-method HARD

-------------------------------WARNINGS--------------------------------
Failed to link /home/thomas/Development/czkawka/hardlink/b ->
/home/thomas/Development/czkawka/hardlink/a (Operation not permitted (os
error 1))
---------------------------END OF WARNINGS-----------------------------
[...]

25169246 -rw-rw-r-- 1 thetestuser thetestuser 2 Feb  7 11:18 a
25169641 -rw-rw-r-- 1 thomas      thomas      2 Feb  7 11:18 b
```
2021-02-11 19:04:23 +01:00
Rafał Mikrut 10156ccfd3 Uncomment code about saving similar images result to file 2021-02-09 17:29:49 +01:00
Rafał Mikrut df44f9c342
Update list of checked images (#252) 2021-02-06 14:24:15 +01:00
Rafał Mikrut 9bb574235a
Add checking for broken music opt-in (#249) 2021-02-05 19:07:20 +01:00
Thomas Andreas Jung 3ffa55b008
Add delete method to replace duplicate files with hard links (#236)
This results in the same space saving but keeps the "deleted" files around.

$ mkdir hardlink
$ cd hardlink
$ echo a > a
$ cp a b
$ ln a c
$ touch -t 01010000 a
$ ls -il --time-style=full-iso .
25169323 -rw-rw-r-- 2 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 a
25169558 -rw-rw-r-- 1 thomas thomas 2 2021-01-31 18:11:08.298161098 +0100 b
25169323 -rw-rw-r-- 2 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 c

$ czkawka_cli dup --directories $(pwd)/hardlink -m 1 -f hardlink.result --delete-method HARD

$ ls --time-style=full-iso -li hardlink
25169323 -rw-rw-r-- 3 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 a
25169323 -rw-rw-r-- 3 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 b
25169323 -rw-rw-r-- 3 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 c
2021-02-05 17:59:34 +01:00
Sbgodin f490a1169c
Typos corrected in README.md (#248) 2021-02-05 17:00:24 +01:00
Rafał Mikrut ea474c2af0 Fix typo in window progress 2021-02-03 20:23:28 +01:00
Rafał Mikrut 9f3da0e70f
Add support for CRC32 and XXH3 hash (#243) 2021-02-03 19:59:06 +01:00
Rafał Mikrut 7d8334bb0c
Add template for multiple hashes (#240) 2021-02-03 18:11:04 +01:00
Alexis Lefebvre 2f09b6ce8f
README: Allow Snap to access to external drives (#218) 2021-02-03 16:04:36 +01:00
Rafał Mikrut 8dcb718843 Restore snap confinement 2021-02-03 16:03:52 +01:00
Rafał Mikrut 2c2004b316
Change progress dialog to progress window (#229) 2021-01-25 18:23:42 +01:00
Rafał Mikrut b8049efe62
Remove checking for ico in similar images (#227) 2021-01-25 11:32:10 +01:00
Rafał Mikrut 49ddc041ee
Add about dialog (#226) 2021-01-24 12:01:02 +01:00
Rafał Mikrut 052590d246 Update README and app metadata 2021-01-23 20:22:05 +01:00
Mek101 c46df07b11
Added the packages required to build the cli version on void linux to the README (#225)
Added the packages required to build the cli version on void linux to the README
2021-01-23 20:21:13 +01:00
Rafał Mikrut bb7bf12354 Release 2.3.2 2021-01-21 20:52:43 +01:00
Rafał Mikrut 42af724681
Add support for moving selection by keyboard to update similar image preview (#223) 2021-01-21 07:24:28 +01:00
Rafał Mikrut 69090755df Release 2.3.1 2021-01-20 15:41:44 +01:00
Proprietary Chrome-chan a5d37eba4e
Add Flatpak support (#203)
* Make a flatpak manifest, the permissions are not set properly.

* Move to separate flatpak dir

* Rewrite in yaml

* Update sources

* Update flatpak to 2.3.0

* Remove PulseAudio support

* Add metainfo file

* Use the right files

* Update metadata file

* Polish manifest and improve metadata

* Improve metadata

* Switch to metainfo

* Fix version number

Co-authored-by: Lionir <git@thelion.website>
2021-01-20 14:14:53 +01:00
bellrise 5751d8a723
Spicing up the markdown files (#222)
* Spicing up the README

- Making it more readable
- Better English, easier to read
- Hiding links
- Fixing the absolute hideous tables which were impossible to read in the raw readme

* Fixed some things, not a lot though.
2021-01-20 11:16:56 +01:00
Alexis Lefebvre 7fdc8ea3fc
README: Fix typo "dotation" to "donation" (#219) 2021-01-20 11:06:00 +01:00
Rafał Mikrut 13fbd9f7c6 Remove snap plugs 2021-01-16 16:59:24 +01:00
Rafał Mikrut 6bdd0cce7c Use snap classic confinement.
Czkawka needs to have access to all available for user data, but snap prevents from it when using sandbox.
2021-01-16 16:33:27 +01:00
Rafał Mikrut e8942609ff Use Gnome 3.28 instead 3.34 in snap build 2021-01-15 19:40:10 +01:00
Rafał Mikrut ea63f3e35d Fix snapcraft build 2021-01-15 17:35:53 +01:00
Rafał Mikrut 943f8f78f1 Release 2.3.0 2021-01-15 16:49:13 +01:00
Rafał Mikrut e1beaeed28
Decrease ram usage (#212) 2021-01-15 12:41:45 +01:00
Rafał Mikrut 390a570833 Update GIF in README 2021-01-15 11:07:22 +01:00
Rafał Mikrut cc8d42e0ff
Add support for finding broken zip and audio files (#210) 2021-01-15 11:04:52 +01:00
Rafał Mikrut 0c10a6a0ba
Sort Results by path where it is possible (#211) 2021-01-15 10:43:23 +01:00
Rafał Mikrut 56763846ac
Add missing popover info for invalid symlinks (#209) 2021-01-14 20:38:29 +01:00
Rafał Mikrut 6cb92871ff
Use the oldest available OS in Linux and Mac CI and the newest on Windows (#206) 2021-01-14 13:26:43 +01:00
Rafał Mikrut 7ec665ab7a
Add cache for duplicate (#205) 2021-01-14 12:17:15 +01:00
Rafał Mikrut 6e89bcb507
Add cache for broken files (#204) 2021-01-13 16:03:05 +01:00
Rafał Mikrut eeaaea20cc
Add broken files support (#202) 2021-01-12 20:06:12 +01:00
Rafał Mikrut 1a011644bf
Remove save workaround and fix crashes (#200) 2021-01-12 13:48:34 +01:00
Rafał Mikrut b41a22a021
Fix error when closing dialog progress by X (#199) 2021-01-12 11:51:54 +01:00
Rafał Mikrut da4bdd19e2 Release 2.2.0 2021-01-11 12:26:03 +01:00
Rafał Mikrut 80bbc9ba85
Move image cache to cache from config dir (#197) 2021-01-11 09:54:23 +01:00
Rafał Mikrut 7992ba30de
Fix included/excluded files which contains commas (#195) 2021-01-10 20:44:10 +01:00
Rafał Mikrut ff85453394
Split Gui code into multiple files (#194) 2021-01-10 20:12:08 +01:00