Bug 497360 - Baloo Unable to Index contents in C Source File
Summary: Baloo Unable to Index contents in C Source File
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: Engine (show other bugs)
Version: 6.6.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-12 12:06 UTC by ybx332
Modified: 2024-12-13 02:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ybx332 2024-12-12 12:06:13 UTC
SUMMARY
As mentioned in the title, baloo cannot index C source file.

STEPS TO REPRODUCE
1. Enable Baloo.
2.  Waiting for indexing finishing
3.  Search for contents in source file within Dolphin.

OBSERVED RESULT
No result.

EXPECTED RESULT
Show result correctly.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 12
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.7.2
Kernel Version: 6.11.10-amd64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5500U with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
balooshow doesn't give any cached properties of that file. 

Here's one example:
174462d5d579c30 1566022704 24397357 Rand/main.c
        Mtime: 1732005994 2024-11-19T16:46:34
        Ctime: 1732005994 2024-11-19T16:46:34

For a text-only file, normally baloo will show this:

6a1f975d579c30 1566022704 6954903 Test/Test_tb.v
        Mtime: 1710849094 2024-03-19T19:51:34
        Ctime: 1710849094 2024-03-19T19:51:34
        Cached properties:
                Line Count: 16
Comment 1 tagwerk19 2024-12-12 18:29:22 UTC
(In reply to ybx332 from comment #0)
> As mentioned in the title, baloo cannot index C source file.
Baloo typically avoids indexing source code, it indexes the filenames but not the content.

Check the mimetype of your files with:
    $ kmimetypefinder test.c
it should come back with "text/x-csrc" . You can tell Baloo to index it with:
    $ balooctl config remove excludemimetypes text/x-csrc
which is really saying to drop the exclusion for it... (You might find you need balooctl6 rather than balooctl)

You can do the same for header files, text/x-chdr.

It may be that you need to purge and reindex to pick up the "new" content so think of which mimetypes you want indexed.

A useful additional option for balooshow is the "-x" which includes "everything" (well, lots) about the indexed content.
Comment 2 ybx332 2024-12-13 02:19:09 UTC
Thanks for your help. Now baloo can index C source files along with headers.