Results 1 to 10 of 10

Thread: Assigning of File Icon fails / Cannot modify File Associations

  1. #1

    Default Assigning of File Icon fails / Cannot modify File Associations

    I am using Leap 42.1 with KDE. I noticed that in Dolphin *.sql files do not have any icon associated with them, just a blank space. Any attempt to change this and assign an icon fails in Dolphin (file > Properties > File Type Options), and also fails in System Settings > Applications > File Associations. Changes made and "applied" are being ignored. Even worse, any other modification in File Associations is also futile. What am I doing wrong, or is there a bug somewhere?

  2. #2

    Default AW: Assigning of File Icon fails / Cannot modify File Associations

    Quote Originally Posted by adelaidian View Post
    I am using Leap 42.1 with KDE. I noticed that in Dolphin *.sql files do not have any icon associated with them, just a blank space.
    That's https://bugs.kde.org/show_bug.cgi?id=361034 and https://bugs.kde.org/show_bug.cgi?id=358958, fixed in the latest dolphin version which will display the generic "unknown" icon in this case.

    The actual problem is that the .sql file type specifies a non-existent icon though.

    Any attempt to change this and assign an icon fails in Dolphin (file > Properties > File Type Options), and also fails in System Settings > Applications > File Associations. Changes made and "applied" are being ignored. Even worse, any other modification in File Associations is also futile.
    This should work though.
    Can you reproduce this on a fresh user account?

  3. #3

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Thanks, wolfi323.
    Yes, I have created a brand new user account, and again whatever I do in file associations, it is being ignored. I can find an application/sql entry which has a *.sql filename pattern but no icon assigned. Any attempt to assign an icon fails. Do I need an icon named application-sql ? It does not exist. Can I create one?
    I also wanted to create a new file association for *.wtv files (Windows media centre TV recordings) to run with VLC. These are mpeg2 videos. Creating a new file association and filename pattern seems to work, but it is all lost after returning to the main menu in the System Settings.
    It all seems straight forward but maybe I am not getting it. Is there some info somewhere which I have to read?
    Thanks

  4. #4

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Quote Originally Posted by adelaidian View Post
    Yes, I have created a brand new user account, and again whatever I do in file associations, it is being ignored.
    Hm. Then it's rather not a problem with some user files.

    Does running "sudo update-mime-database /usr/share/mime" help?
    Also try to run "kbuildsycoca5 --noincremental" as user and post the output. (use http://susepaste.org/ or similar and post a link if the text is too long)

    A similar problem has been reported here:
    http://bugzilla.opensuse.org/show_bug.cgi?id=980046

    But it works fine here (I just tried), and I'm pretty sure that it also works for other people...

    I can find an application/sql entry which has a *.sql filename pattern but no icon assigned.
    As indicated, the default icon theme doesn't contain an icon for application/sql.

    Any attempt to assign an icon fails. Do I need an icon named application-sql ? It does not exist. Can I create one?
    You can, just copy an image file named application-sql.xxx (where xxx depends on the image format of course) to the corresponding folders in /usr/share/icons/youricontheme/ (or ~/.local/share/icons/youricontheme/).
    If you are using the default "breeze" theme, you can copy the existing one for text/x-sql:
    Code:
    sudo cp /usr/share/icons/breeze/mimetypes/16/text-x-sql.svg /usr/share/icons/breeze/mimetypes/16/application-sql.png
    And the same for the other sizes, 32, 64, and 128.
    Then remove the icon cache, ~/.cache/icon-cache.kcache, I think that's necessary (but I'm not sure).

    Should be similar for other icon themes.

    But this shouldn't be necessary, you should be able to select/assign any icon.
    This is stored in ~/.local/share/mime/icons btw.
    Does this file get created? What's its content?

    And just to rule out the obvious: you did click on OK or Apply before "returning to the main menu in the System Settings", right?
    Otherwise the changes do not get applied of course, though you should get a warning in this case.
    Last edited by wolfi323; 26-May-2016 at 08:03.

  5. #5

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Does running "sudo update-mime-database /usr/share/mime" help?
    The output from this was:
    Unknown media type in type 'all/all'
    Unknown media type in type 'all/allfiles'
    and no, it did not help.

    Also try to run "kbuildsycoca5 --noincremental" as user and post the output.
    The output from this was rather short:
    kbuildsycoca5 running...
    Recreating ksycoca file ("/home/holger/.cache/ksycoca5_wbp_Ymj1S_cL9jLVJeUxaO4QWbLV_F4=", version 303)
    Menu "applications-kmenuedit.menu" not found.
    Saving
    It did not help either.

    A similar problem has been reported here:
    http://bugzilla.opensuse.org/show_bug.cgi?id=980046
    This is a bit different as any changes are reversed immediately on "Apply", whereas in my case the changes seem to be accepted upon "Apply" but are lost when revisiting them.

    I have not tried creating a new icon yet.

    But this shouldn't be necessary, you should be able to select/assign any icon.
    This is stored in ~/.local/share/mime/icons btw.
    Does this file get created? What's its content?
    There is no mime folder in ~/.local/share/ and hence no file.

    And just to rule out the obvious: you did click on OK or Apply before "returning to the main menu in the System Settings", right?
    Yes, I did. I recall vaguely that in one instance a progress bar appeared for a second or two.

  6. #6

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Quote Originally Posted by adelaidian View Post
    The output from this was:
    Unknown media type in type 'all/all'
    Unknown media type in type 'all/allfiles'
    and no, it did not help.
    That's more or less "normal" and shouldn't cause a problem.

    The output from this was rather short:
    kbuildsycoca5 running...
    Recreating ksycoca file ("/home/holger/.cache/ksycoca5_wbp_Ymj1S_cL9jLVJeUxaO4QWbLV_F4=", version 303)
    Menu "applications-kmenuedit.menu" not found.
    Saving
    Again, nothing wrong there.

    There is no mime folder in ~/.local/share/ and hence no file.
    Well, maybe that's what causes your problem? I.e. maybe the file associations cannot be written because the folder doesn't exist...

    Create it manually, including a packages sub folder:
    Code:
    mkdir -p ~/.local/share/mime/packages
    (as user of course, you can also use a file manager if you prefer)

    Then run "update-mime-database ~/.local/share/mime" (again, as user), to recreate the cache and the file association settings should work.

    I just tried to delete that folder here, and do indeed see the same problem then. Above steps fixed it again.

  7. #7
    Join Date
    Sep 2013
    Location
    Norfolk, UK
    Posts
    1,216

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Quote Originally Posted by wolfi323 View Post
    ... I just tried to delete that folder here, and do indeed see the same problem then. Above steps fixed it again.
    I reported this bug late last year... https://bugs.kde.org/show_bug.cgi?id=356237
    Regards, Paul

    Tumbleweed (Snapshot: 20190918) KDE Plasma 5
    Non-Tumbling Tumblweed (20150508) KDE 4 - Resurrected
    2x Leap 15.1 KDE Plasma 5

  8. #8

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Quote Originally Posted by tannington View Post
    I reported this bug late last year... https://bugs.kde.org/show_bug.cgi?id=356237
    Oh, nice.
    I just started writing a bug report myself...

    Though the actual file type editor is actually keditfiletype5 and is part of kde-cli-tools in Plasma5, IOW it's probably not a bug in kcm_filetypes...

    This is a porting bug apparently, it works fine in the KDE4 version.
    There have been similar problems in other parts. IIRC it's caused by a change of behavior in KF5, the Qt5 functions that are being used now instead of KDE's own custom versions in kdelibs4 do not create directories automatically, the application has to take care of that.
    I fixed one of those myself even:
    https://bugzilla.opensuse.org/show_bug.cgi?id=948289
    https://quickgit.kde.org/?p=kpat.git...57ca339f498fd9

    I'll probably take a look at it this weekend and see if I can fix it...
    Last edited by wolfi323; 27-May-2016 at 05:15.

  9. #9

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Quote Originally Posted by wolfi323 View Post
    Well, maybe that's what causes your problem? I.e. maybe the file associations cannot be written because the folder doesn't exist...

    Create it manually, including a packages sub folder:
    Code:
    mkdir -p ~/.local/share/mime/packages
    (as user of course, you can also use a file manager if you prefer)

    Then run "update-mime-database ~/.local/share/mime" (again, as user), to recreate the cache and the file association settings should work.

    I just tried to delete that folder here, and do indeed see the same problem then. Above steps fixed it again.
    I did all that and it worked !!!!

    Thanks a lot.

  10. #10

    Default Re: Assigning of File Icon fails / Cannot modify File Associations

    Quote Originally Posted by adelaidian View Post
    I did all that and it worked !!!!
    Great!

    Btw, running "update-mime-database" wouldn't actually have been necessary (though it doesn't harm), only creating the folder should be enough (keditfiletype does run "update-mime-database" anyway).

    And I have a fix ready and will propose it to KDE upstream...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •