Bug 419547 - Krusader shows negative percent values while searching the text with the excepted folder
Summary: Krusader shows negative percent values while searching the text with the exce...
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: search (show other bugs)
Version: Git
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-02 15:46 UTC by pveax
Modified: 2021-10-17 20:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
search criteria (59.00 KB, image/png)
2020-04-02 15:48 UTC, pveax
Details
negative value (33.21 KB, image/png)
2020-04-02 15:48 UTC, pveax
Details
Confirmed (1) - negative percentage. (35.28 KB, image/png)
2021-09-19 11:47 UTC, Toni Asensi Esteve
Details
Confirmed (2) - positive but incorrect percentage. (34.62 KB, image/png)
2021-09-19 11:48 UTC, Toni Asensi Esteve
Details
on the 2.8.0.dev.r6378.gae1bf6b9-1 version (53.84 KB, image/png)
2021-09-23 03:28 UTC, pveax
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pveax 2020-04-02 15:46:56 UTC
SUMMARY
Krusader shows negative percent values while searching the text with the excepted folder

STEPS TO REPRODUCE
1. Open Krusader
2. Go to the root in one panel
3. Ctrl+S
4. Make all settings as on screenshot: all default, but:
a) search text is "temp unit: " (w/ space, w/o quotes)
b) exception folder: "/home" (w/o quotes)
5. Press Search btn. After several seconds Krusader starts to show negative percentage values near currently searching file.

OBSERVED RESULT
negative value of percentage while search procedure

EXPECTED RESULT
0 or positive value of percentage while search procedure

SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: Manjaro Linux 19.0.2 (stable branch, currently up-to-date)
(available in About System)
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
-
Comment 1 pveax 2020-04-02 15:48:05 UTC
Created attachment 127206 [details]
search criteria
Comment 2 pveax 2020-04-02 15:48:25 UTC
Created attachment 127207 [details]
negative value
Comment 3 pveax 2020-12-12 21:04:14 UTC
Can reproduce just the same in Krusader v2.7.2 on
```
Operating System: Manjaro Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Kernel Version: 5.10.0-1-MANJARO
OS Type: 64-bit
```
Comment 4 pveax 2021-08-15 23:04:44 UTC
Too old. Current Krusader and Plasma went into future.
Comment 5 Toni Asensi Esteve 2021-08-16 22:38:12 UTC
> [From https://bugs.kde.org/show_bug.cgi?id=419539]
>   Now Krusader and Plasma got updates, so the bug is old.
>   Will looking into newer Krusader version (git).        
Thanks, pveax. Please, feel free to reopen this bug report if you still find that problem.
Comment 6 Toni Asensi Esteve 2021-09-19 11:47:23 UTC
Created attachment 141698 [details]
Confirmed (1) - negative percentage.
Comment 7 Toni Asensi Esteve 2021-09-19 11:48:00 UTC
Created attachment 141699 [details]
Confirmed (2) - positive but incorrect percentage.
Comment 8 Toni Asensi Esteve 2021-09-19 11:49:46 UTC
After some investigation, it's seen that there's a problem when the contents of a big symlinked file are read, because then the variable `totalBytes` is very small (it's the size of a symlink) but much more bytes bytes are read. That causes huge unreal percentages and sometimes negative values (I attached some screenshots).
Comment 9 Toni Asensi Esteve 2021-09-19 14:36:53 UTC
There's a proposal on https://invent.kde.org/utilities/krusader/-/merge_requests/71
Comment 10 pveax 2021-09-23 03:28:13 UTC
Created attachment 141810 [details]
on the 2.8.0.dev.r6378.gae1bf6b9-1 version

OK, I switched into git version (and that report also):

```
$ pacman -Qi krusader | grep Version
Version         : 2.8.0.dev.r6378.gae1bf6b9-1
```

I still see positive percentage.
Comment 11 pveax 2021-09-23 03:30:32 UTC
I switched Krusader version in the ticket into the `Git` value, as I see the lack on it also.

```
Operating System: Manjaro Linux
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Kernel Version: 5.15.0-1-MANJARO (64-bit)
Graphics Platform: Wayland
```
Comment 12 Toni Asensi Esteve 2021-09-23 21:34:57 UTC
> I still see [...]
Just in case any reader is wondering: The https://invent.kde.org/utilities/krusader/-/merge_requests/71 proposal still has not been accepted, so it still has not been applied to the git version of Krusader :-)
Comment 13 Toni Asensi Esteve 2021-10-17 18:45:34 UTC
Git commit 04e6286f952703a23672989ce14255488f47a064 by Toni Asensi Esteve.
Committed on 17/10/2021 at 18:44.
Pushed by asensi into branch 'master'.

Correct percentages when searching text inside files

Solve some problems showing percentages when the contents of a big symlinked
file were read because then the variable `totalBytes` was very small (it was
the size of a symlink) but much more bytes bytes were read. That caused huge
unreal percentages and sometimes negative values.

FIXED: [ 419547 ] Krusader shows negative percent values while searching the text with the excepted folder

Revision: https://invent.kde.org/utilities/krusader/-/merge_requests/71

M  +12   -4    krusader/FileSystem/krquery.cpp

https://invent.kde.org/utilities/krusader/commit/04e6286f952703a23672989ce14255488f47a064
Comment 14 pveax 2021-10-17 20:48:18 UTC
"Correct percentages when searching text inside files"

Tested. Indeed: it's done! Values of billions of percentages in the past.

> Reported:	2020-04-02 15:46 UTC
> Modified:	2021-10-17 18:45 UTC

Hooray! That's the point there the life starts! :)
Beer to all!

Toni, Thank yoooouuuuu!!!