File Associations
Keywords: KDE, KControl, files association, association

The KDE Control Center
Prev | Chapter 5. Modules | Next

# 5.17. File Associations

## 5.17.1. Introduction

One of the most convenient aspects of KDE, is its ability to automatically match a data file, with its application. As an example, when you click on your favorite KWord document in konqueror, KDE automatically starts KWord, and automatically loads that file into KWord so you can begin working on it.

In the example above, the KWord Data file, is associated with KWord (the application). These file associations are crucial to the functioning of KDE.

When KDE is installed, it automatically creates hundreds of file associations to many of the most common data types. These initial associations are based on the most commonly included software, and the most common user preferences.

Unfortunately, KDE can not:

- predict every possible combination of software and data files

- prepare for file formats not yet invented

- or predict everyone's favorite application for certain file formats

You can change your current file associations or add new file associations using this module.

Each file association is recorded as a mime type. MIME stands for "Multipurpose Internet Mail Extensions". It allows a computer to determine the type of file, without opening and analyzing the format of each and every file.

## 5.17.2. How to use this module

The file associations are organized into 7 categories:

1. Applications

2. Audio

3. Images

4. Inode

5. Messages

6. Text

7. Videos

All of the file associations are sorted into one of these categories.

| There is no functional difference between any of the categories. These categories are designed to help organize your file associations, but they do not alter the associations in any way.

The categories are listed in the box labeled "Known Types".

You can explore each of these categories, and see the file associations contained within each one, by simply double clicking on the category name. You will be presented with a list of the associated mime-types under that category.

| You can also search for a particular mime-type by using the search box. The search box is labeled "Find filename pattern" and is located above the category list. Simply type the first letter of the mime-type you are interested in. The categories are automatically expanded, and only the mime-types that include that letter are displayed. You can then enter a second character and the mime-types will be further limited to mime types containing those two characters.

### 5.17.2.1. Adding a new mime type.

If you want to add a new mime type to your file associations, you can click on the "Add" button. A small dialog box will appear. You select the category from the drop down box, and type the mime name in the blank labeled "Type name". Click "OK" to add the new mime type, or click "Cancel" to not add any new mime-types.

### 5.17.2.2. Removing a mime type.

If you want to remove a mime type, simply select the mime type you want to delete by clicking once with the mouse on the mime type name. Then click the button labeled "Remove". The mime type will be deleted immediately.

### 5.17.2.3. Editing a mime types properties.

Before you can edit a mime types property, you must first specify which mime type. Simply browse through the categories until you find the mime type you want to edit, then click once on it with the mouse.

As soon as you have selected the mime type, the current values of the mime type will appear in the module window.

You will notice the current values are split into two tabs: General and Embedding

General Tab

There are 4 properties for each mime type in this tab:

1. Mime Type Icon: This is the icon that will be visible when using Konqueror as a file manager.

2. Filename Patterns: This is a search pattern which KDE will use to determine the mime type.

3. Description: This is a short description of the file type. This is for your benefit only.

4. Application Preference Order: This determines which applications will be associated with the specified mime-type.

Embedding Tab

The Embedding tab allows you to determine if an file will be viewed within a konqueror window, or by starting the application.

### 5.17.2.4. Changing the Icon

To change the icon, simply click on the Icon button. A dialog box will appear, which will show you all available icons. Simply click once with the mouse on the icon of your choice, and click "OK".

### 5.17.2.5. Editing the mime-type patterns

The box labeled "Filename Patterns", determines what files will be included within this mime-type.

Usually, files are selected based on their suffix. (Examples: Files that end with ".wav" are sound files, using the WAV format and files that end in ".c" are program files written in C).

You should enter your filename mask in this combo box.

The asterisk (*) is a wildcard character that will be used with nearly every mime type mask. A complete discussion of wildcards is beyond the scope of this manual, but it is important to understand that the asterisk (in this context), "matches" any number of characters. As an example: "*.pdf" will match "Datafile.pdf", "Graphics.pdf" and "User.pdf", but not "PDF", "Datafile.PDF", or ".pdf".

| It is very beneficial to have multiple masks. One for lower case, one for upper case, etc. This will help ensure that KDE can determine the file type more accurately.

### 5.17.2.6. Editing a mime types description.

You can type a short description of the mime type in the text box labeled "Description". This lable is to help you, it does not affect the function of the mime type.

### 5.17.2.7. Editing the application associations

There are four buttons (Move Up, Move Down, Add and Remove) and a combo box (which lists the applications) which are used to configure the applications.

The combo box lists all of the applications associated with a specific mime-type. The list is in a specific order. The top application is the first application tried. The next application down the list is the second, etc.

| What do you mean there is more than one application per mime-type? Why is this necessary? We started out by saying that KDE comes preconfigured with hundreds of file associations. The reality is, each system that KDE is installed on has a different selection of applications. By allowing multiple associations per mime-type, KDE can continue to operate when a certain application is not installed on the system. As an example: For the mime type "pdf", there are two applications associated with this file type. The first program is called "PS Viewer". If your system does not have "PS Viewer" installed, then KDE automatically starts the second application "Adobe Acrobat Reader". As you can see, this will help keep KDE running strong as you add and subtract applications.

We have established that the order is important. You can change the order of the applications by clicking once with the mouse on the application you want to move, and then clicking either "Move Up" or "Move Down". This will shift the currently selected application up or down the list of applications.

You can add new applications to the list by clicking the button labeled "Add". A dialog box will appear. Using the dialog box, you can select the application you want to use for this mime type. Click "OK" when you are done, and the application will be added to the current list.

You can remove an application (thereby ensuring that the application will never run with this mime-type by clicking once on the name of the application, and clicking the "Remove" button.

| It is a good idea to use the "Move Up" and "Move Down" buttons to adjust the unwanted application to a lower position in the list, rather than deleting the application from the list entirely. Once you have deleted an application, if your preferred application should become compromised, there will not be an application to view the data document.

### 5.17.2.8. Embedding

By clicking on the Embedding tab, you are presented with:

Three radio buttons labeled Left click action. This determines how konqueror views the selected mimetype.

Show file in embedded viewer

  If this is selected, the file will be shown within the konqueror window.

Show file in seperate viewer

  This will cause a seperate window to be created when showing this mime-type.

Use group settings.

  This will cause the mime-type to use the settings for the mime-type group. (if you are editing an audio mime type, then the settings for the audio group are used).

Below this, is a listbox labled Services Preference Order

When you are in konqueror, you can right mouse click, and a menu will with an entry labled Preview with... will appear. This box lists the applications that will appear, in the order they will appear, under this menu.

You can use the Move Up and Move Down buttons to change the order.

### 5.17.2.9. Making changes permanent

When you are done making any changes to mime types, you can click "Apply" to make your changes permanent, but keep you in this module.

You can click "OK" to make your changes permanent and return you to the main screen of the control center.

You can click "Cancel" to abort any changes and return you to the main screen of the control center.

## 5.17.3. Section Author

Mike McBride `<mpmcbride7@yahoo.com>`

Prev | Home | Next
Enhanced Browsing | Up | File Manager