Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-17-2008, 07:05 PM
|
#1
|
|
Member
Registered: Feb 2004
Location: NY, USA
Distribution: openSUSE 11
Posts: 240
Rep:
|
Get file icon from extension, file type, or mime-type
Is there any way to get a file's icon from its extension? I'm currently making a FTP program in Qt and I want to be able to have the correct file type icons. I'd prefer some way is cross-DE and is capable of working on most linux systems.
Thanks.
|
|
|
|
04-18-2008, 03:47 PM
|
#2
|
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,471
Rep: 
|
You have /etc/mime.types to check for given mime type when you have extention. Icons, if connected with certain type, are usually DE-specific.
|
|
|
|
04-20-2008, 07:50 PM
|
#3
|
|
Member
Registered: Feb 2004
Location: NY, USA
Distribution: openSUSE 11
Posts: 240
Original Poster
Rep:
|
According to this site: http://standards.freedesktop.org/sha...html#s2_layout
I should have a <MIME>/icons folder that maps mime types to icons. I checked and I do not have this folder or the generic-icons folder. I do have the other ones. I tried running update-mime-database but it does not create those folders.
Any idea? This would be what I'm looking for. Is this not implemented yet?
Thanks
|
|
|
|
04-21-2008, 10:58 AM
|
#4
|
|
Member
Registered: Feb 2004
Location: NY, USA
Distribution: openSUSE 11
Posts: 240
Original Poster
Rep:
|
I have solved my problem. I made a bash script that when given the file name, greps the mime.types file for the mime type. Then the mimetype is formatted in the icon format, and is found with the find command. This works with DE's that are compliant with that mime standard.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:31 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|