Bug 440752

Summary: Wishlist: xdg-mime/baloo should recognise user.mime_type extended attributes
Product: [Frameworks and Libraries] frameworks-kfilemetadata Reporter: tagwerk19
Component: generalAssignee: Pinak Ahuja <pinak.ahuja>
Status: REPORTED ---    
Severity: wishlist    
Priority: NOR    
Version: 5.84.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:

Description tagwerk19 2021-08-08 18:42:49 UTC
SUMMARY:

    xdg-mime (and baloo) does not seem to recognise user.mime_type
    extended attributes. These are referenced as a "MAY" in:

        https://www.freedesktop.org/wiki/CommonExtendedAttributes/#generalattributesincurrentuse 

    so request flagged as "wishlist" 

STEPS TO REPRODUCE:

    Create a test file with no recognised file extension, check the
    mime type with xdg-mime

        $ echo "Hello Penguin" > testfile.zzz
        $ xdg-mime query filetype testfile.zzz
        text/plain 

    Assign a "preferred" mime_type with setfattr:

        $ setfattr -n user.mime_type -v "text/log" testfile.zzz 

    Check with xdg-mime and balooshow -x

OBSERVED RESULTS

    $ xdg-mime query filetype testfile.zzz
    text/plain

    $ balooshow -x testfile.zzz
    13f8960000fc01 64513 1308822 testfile.zzz [/home/test/testfile.zzz]
            Mtime: 1628337068 2021-08-07T13:51:08
            Ctime: 1628337804 2021-08-07T14:03:24
            Cached properties:
                    Line Count: 1

    Internal Info
    Terms: Mplain Mtext T5 T8 X20-1 hello penguin
    File Name Terms: Ftestfile Fzzz
    XAttr Terms:
    lineCount: 1 

EXPECTED RESULTS

    The mimetype is shown as  "text/log"

SOFTWARE/OS VERSIONS

    Neon Testing
     
    Plasma : 5.22.4
    Frameworks : 5.85.0
    Qt : 5.15.5 

 ADDITIONAL INFORMATION

    This would be a way to override "misidentified" mimetypes as seen in
    Bug 440631 and Bug 440632