Porting Applications to KDE 4.0

Note

All modules should build from /trunk/KDE/kdelibs; there is no snapshot branch any longer. Major changes happen on Mondays (in any timezone) so expect rapid changes during that time. Things should be generally stable otherwise, but this is the development area, so there are no guarantees.

Deprecated classed that have been renamed to e.g. K3Foo are in kde3support.

This document contains the changes you have to apply to programs written for KDE 3.x when you want to port them to KDE 4.0.

Table of Contents

Getting started

As a start you should have a look at doc/html/porting4.html in the Qt package, or this page online.

To start with the porting, you can run "qt3to4 -strict list_of_files" followed by kdesdk/scripts/qt4/adapt-to-qt4-api.pl and kdesdk/scripts/qt4/adapt-to-kde4-api.pl

Return to the Table of Contents

Global Changes

Return to the Table of Contents

Changes in kab

Return to the Table of Contents

Changes in kdefx

kdefx has been removed.

Return to the Table of Contents

Changes in kdecore

KAboutData

I18N_NOOPs in general replaced with KLocalizedString, produced by ki18n()/ki18nc() calls, or just KLocalizedString() if wanted empty. See also the I18N section below.

KAccel

Removed. Replaced by the new KAction/QAction framework. See KActionCollection::associateWidget() if you need the old KAccel widget-binding behavior.

KAccelAction

KAccelBase

Removed. Replaced by the new KAction/QAction framework.

KApplication

KAudioPlayer

Removed, use now Phonon::AudioPlayer

KCatalogue

Renamed to KCatalog. Method name parts with "catalogue" have been renamed to use "catalog" instead.

KCharsets

KCodecs

KConfigBackend

KSimpleConfig

This class was removed. It was a very thin wrapper around KConfig and should be replaced.

KConfig

KConfigBase

KConfigGroupSaver

The class KConfigGroupSaver has been removed, instead use KConfigGroup. The difference is a KConfigGroupSaver object directly affects the config object it is acting on, while a KConfigGroup object only ensures the entries read or written through it are in the correct group.

Instead of:
KConfig *config = KGlobal::config();
KConfigGroupSaver saver(config, "group name");
  ...
config->readXXX("entry name");
should be rewritten as:
KConfigGroup cg = KGlobal::config()->group("group name");
  ...
cg.readXXX("entry name");

KCmdLineArgs

KCmdLineOptions

Now a proper class, instead of statically initialized struct. Use add() method for adding options (option syntax same as before); add() returns object reference, so calls can be chained to avoid repeating variable name all the way.

KComponentData (was KInstance)

kdDebug/kdWarning/kdFatal

These functions have been renamed to kDebug, kWarning, kFatal, resp. They now print the function info, so printing the function name by hand, or using k_funcinfo is now deprecated. An endl is performed implicitly. The type of stream used is now QDebug.

Instead of repeating the debug area all over the place, define KDE_DEFAULT_DEBUG_AREA instead:

- kdDebug( 1234 ) << k_funcinfo << "entered" << endl;
+ kDebug() << "entered";

And, in your CMakeLists.txt:

+ add_definitions( -DKDE_DEFAULT_DEBUG_AREA=1234 )

KDesktopFile

KExtendedSocket

This class has been removed. See below on KNetwork::K*Socket.

KFilterDev

KGlobal

KIcon

Deprecated and renamed to K3Icon; replacement is KIcon in kdeui.

Note: at the moment you have to keep using K3Icon as a namespace for states, groups, and contexts though.

KInstance

Renamed to KComponentData

KIPC

Removed. Use KGlobalSettings::self()->emitChange() instead of KIPC::sendMessageAll().

KKey

Removed. Use plain ints as the Qt key code instead.

KKeyNative

Removed. Use plain ints as the Qt key code instead.

KKeySequence

Removed. Use QKeySequence instead. Note that QKeySequence expects multiple shortcuts to be separated by ", " (i.e. a comma then a space) in converting from text.

KLibLoader

KLibFactory

KGenericFactory

KLocale

See also the I18N section below.

KMacroExpander

KMimeSourceFactory

KMimeSourceFactory was automatically instanciated by KApplication which allowed the use of "icon:name" in Qt richtext. Q3MimeSourceFactory being in Qt3Support, and this feature being very rarely used, K3MimeSourceFactory isn't instanciated automatically anymore, you need to call K3MimeSourceFactory::install() in your main if you still depend on this feature.

KMultipleDrag

KMultipleDrag is obsolete, use QMimeData directly to provide contents in different mime formats.

To make porting more incremental, K3MultipleDrag is provided for code that needs to work with Q3DragObject until being fully ported.

KNetwork::KIpAddress

Removed. Use QHostAddress instead.

KNetwork::KResolver

Removed. If you need to resolve a hostname, use QHostInfo from QtNetwork.

KNetwork::KSocketAddress and KNetwork::KInetSocketAddress

Removed. Use QHostAddress and an integer (a quint16_t) to store the port number.

KNetwork::KUnixSocketAddress

Removed. Simply use a QString to represent the path or identifier. See the documentation on KLocalSocket.

KNetwork::K*Socket

KNotifyClient

Replaced by KNotification. The API is quite similar, but the config file need to be updated. See KNotification documentation, and the file kdelibs/knotify/PORTING.html

KProcess

The kde3 version was deprecated and renamed to K3Process, header is k3process.h. Its usage is discouraged as it will create problems when being used together with the new KProcess or QProcess in the same application, this is more of a problem in applications that use KParts or plugins and can't control what those plugins do.

KProcCtrl

Deprecated and renamed to K3ProcessController, header is k3processcontroller.h.

KProcIO

Deprecated and renamed to K3ProcIO, header is k3procio.h.

KRegExp

Removed. Use QRegExp instead.

KRFCDate

This class has been deprecated by KDateTime. It has been renamed K3RFCDate and moved to the libkde3support. The following method changes make porting easy:

KSaveFile

KShortcutDialog

Removed, see KKeySequenceWidget/KShortcutWidget.

KShortcutList and derivatives

Removed - no longer needed. Saving and loading of shortcuts is now performed in KActionCollection, KGlobalAccel, and KStandardShortcut.

KSortableValueList

KStandardDirs

KStandardShortcut (was KStdAccel)

KStaticDeleter

Either use K3StaticDeleter or port to the K_GLOBAL_STATIC macro.

KStdAccel

Renamed to KStandardShortcut

KStringHandler

KTempDir

KTempFile

Deprecated and renamed to K3TempFile. Use KTemporaryFile instead.

When porting old KTempFile calls to KTemporaryFile, you need to remember that KTempFile by default will not automatically remove the fileonce the object is destroyed, but KTemporaryFile will! You also need to call open() in order to actually create the file.

KURL

KURLDrag

This class has been moved to kde3support. Use KUrl::populateMimeData() and KUrl::List::populateMimeData() in the drag/copy side, and the static methods KUrl::List::canDecode() and KUrl::List::fromMimeData() in the drop/paste side.

KVMAllocator

Removed, as it was unused.

KWin

This class has been merged with KWinModule into class KWindowSystem (in kdeui).

KWinModule

This class has been merged with KWinModule into class KWindowSystem (in kdeui). Don't create instances, use static functions and KWindowSystem::self() for connecting to signals.

KWin::WindowInfo

This class has been renamed KWindowInfo and moved to its own header: KWindowInfo or kwindowinfo.h. This class is not to be confused with KWindowInfo in KDE3 which was a small utility class to display message in the window icon and title. KWindowInfo represents the windowing system information for a give window, such as its geometry, desktop positioning, type, name, etc.

locate

NETRootInfo

Return to the Table of Contents

Changes in kdeui

KAboutContainer

Deprecated and renamed to K3AboutContainer. Use KAboutApplicationDialog or KAboutKdeDialog directly.

KAboutContributor

Deprecated and renamed to K3AboutContributor. Use KAboutApplicationDialog or KAboutKdeDialog directly.

KAboutDialog

Deprecated and renamed to K3AboutDialog. Use KAboutApplicationDialog or KAboutKdeDialog directly.

KAboutWidget

Deprecated and renamed to K3AboutWidget. Use KAboutApplicationDialog or KAboutKdeDialog directly.

KAction

Making KAction a subclass of QAction (actually QWidgetAction) brings KDE more into line with the Qt way of creating user interfaces, improves accessibility, and removes code duplication.

QAction in Qt4 is a true first-class citizen - all QWidgets now have a list of associated actions, and QToolBar, QMenu etc. all use this list directly to show the graphical items (widgets, entries in the menu, etc). This has replaced all usage of integers as "id"s. There is also a new QEvent (QActionEvent), and the corresponding virtual protected function in QWidget, actionEvent().

KActionCollection

KActionSelector

KActionSeparator

Used to be renamed to KSeparatorAction. KSeparatorAction/KActionSeparator is dead now. Just create a QAction object and call setSeparator(true); on it.

Note: you need to create multiple separator actions if you want to insert multiple separators into a widget, unlike with KDE3.

KActiveLabel

Deprecated and renamed to K3ActiveLabel. Use QLabel instead.

KAnimatedButton (was KAnimWidget)

KAnimWidget

Renamed to KAnimatedButton

KAuthIcon

Removed since it was not used.

KBugReport

KButtonBox

Deprecated and renamed to K3ButtonBox. Use KDialogButtonBox instead. Add the role parameter to the addButton function. Or check if it can't be achieved using KDialog.

KCharSelectTable

Removed from public API. Use KCharSelect.

KCharSelect

KColorCells

KColorCollection (was KPalette)

KColorDrag

Deprecated and renamed to K3ColorDrag. Use QMimeData directly instead or KColorMimeData, which most closely resembles KColorDrag

KColorScheme

New class that provides access to system-wide, user configurable color roles. Like QPalette, the return type is now QBrush instead of QColor. As of 4.0 the brushes are solid colors, but this may change in the future.

Warning: KDE4 is trying really hard to abandon the notion that the active palette == the inactive palette (because this is really helpful for the oxygen windeco which does not use "traditional" windeco colors, and because for various reasons kwin can't be entirely responsible for the effect). When porting to KDE4, you will need to take this into consideration. The new class KStatefulBrush has been added to help with this, as well as the adjustForeground and adjustBackground methods of KColorScheme.

There are lots of bugs as a result of this; some in applications, and at least a few in Qt. Please report application bugs to the appropriate maintainer or list, and general (i.e. occurring in many/all applications) bugs to k-c-d.

See the KColorScheme documentation for further information.

KColorTable (was KPaletteTable)

KComboBox

KCommand

Deprecated and renamed to K3Command, header is k3command.h.

KCommandHistory

Deprecated and renamed to K3CommandHistory, header is k3command.h.

KCompletion

KConfigDialog

KContextMenuManager

KCursor

KDatePicker

KDateTable

KDateWidget

KDialog

KDialogBase

Deprecated. Use KDialog or KPageDialog instead.

KDockWindow

This class is obsolete and is provided for compatibility only. Use KSystemTrayIcon instead.

KDualColorButton

Removed since it was not used.

KEdit

KEditListBox

KEditToolbar

KEditToolbarWidget

KFind

KFontChooser

KFontDialog

KGlobalAccel

KGlobalSettings

KGradientSelector

KGuiItem

KHistoryCombo

Renamed to KHistoryComboBox.

KHSSelector

KIcon

KIconLoader

KInputDialog

KIntNumInput, KDoubleNumInput, KDoubleSpinBox

KDoubleSpinBox

KIntSpinBox

KJanusWidget

Deprecated. Use KPageWidget instead.

KKeyButton

Removed. Use either KKeySequenceWidget or KShortcutWidget. Use KShortcutWidget only if you really want two possible shortcuts. Both don't pop up a modal dialog.

KKeyChooser

Renamed to KShortcutsEditor.

KKeyDialog

Renamed to KShortcutsDialog.

KLed

KLineEdit

KLineEditDlg

Was deprecated, has been removed. Use KInputDialog instead.

KListAction

Removed; as per comments, did not add anything to KSelectAction.

KListBox

Deprecated and renamed to K3ListBox. Use KListWidget (based on the QListWidget class).

KListView

Deprecated and renamed to K3ListView.
There is no direct KDE replacement for this class yet.
Either use KListWidget for list-based widgets or QTreeWidget for tree-based widgets. Note that only QTreeWidget supports headers.

KListViewSearchLine

Deprecated and renamed to K3ListViewSearchLine.
You should port from K3ListView to QTreeWidget and then use KTreeWidgetSearchLine instead.

KMacroCommand

Deprecated and renamed to to K3MacroCommand, header is k3command.h.

KMainWindow

KMainWindowInterface

KMenu (was KPopupMenu)

KMessageBox

KNamedCommand

Deprecated and renamed to K3NamedCommand, header is k3command.h.

KPalette

KPaletteTable

KPassivePopup

KPasswordEdit

Deprecated and renamed to K3PasswordEdit. Use KLineEdit, with KLineEdit::setPasswordMode(true).

KPasswordDialog

Deprecated and renamed to K3PasswordDialog.

KPasswordDialog dlg(parent);
dlg.setPrompt( prompt );
dlg.setWindowTitle( caption );
if( dlg.exec() != QDialog::Accepted )
    return;
use( dlg.password() );

KPixmapIO

Removed. Use QPixmap.toImage() and QPixmap::fromImage().

KPixmapRegionSelecorDialog

KPopupMenu

Renamed to KMenu.

KPopupTitle

Removed; QMenu doesn't accept widgets, and QAction allows specification of font, icon etc... and gradients / background pixmaps weren't even working in KDE3. You can use KMenu::addTitle() instead, which creates QAction.

KProgress

Removed. Use QProgressBar instead.

KProgressDialog

KPushButton

KRadioAction

Removed. Use KAction (or KToggleAction if you need different text/icons for the selected state) instead, in combination with an exclusive QActionGroup

KRecentFilesAction

KRootPixmap

Removed since it was not used.

KSelectAction

KSeparator

KSessionManager

Moved from kdecore, renamed from KSessionManaged, and moved to it's own header: ksessionmanager.h or KSessionManager

KSharedPixmap

Removed since is was not used.

KShortcut

KShortcutsEditor (was KKeyChooser)

See also KShortcutsDialog.

KShortcutsDialog (was KKeyDialog)

KStatusBar

KStdAction

Renamed to KStandardAction, header is kstandardaction.h.

KStdGuiItem

Renamed to KStandardGuiItem, header is kstandardguiitem.h.

KSyntaxHighlighter

KSystemTray

Renamed to KSystemTrayIcon for consistency with its actual purpose and naming in Qt (QSystemTrayIcon).

KTabBar

KTabCtl

Removed. Use QTabWidget.

KTextBrowser

KTextEdit

KTimeWidget

Removed. Use QTimeEdit.

KTimezoneWidget

Renamed to KTimeZoneWidget.

KToggleAction

KToggleFullScreenAction

KToolBar

KToolBarButton

Removed. Done by QToolButton now.

KToolBarLabelAction

KToolBarRadioGroup

Removed. Done by QToolButton now.

KToolBarSeparator

Removed. Use QAction::setSeparator().

KUndoRedoAction

Deprecated and renamed to K3UndoRedoAction, header is k3command.h.

KURLLabel

KValueSelector

Renamed to KColorValueSelector, moved to kcolorvalueselector.h

KWidgetAction

Removed. Use KAction or QWidgetAction and utilise its widget-setting capabilities.

KWindowListMenu

Moved to libkworkspace in kdebase

KWizard

Deprecated and renamed to K3Wizard. Use KAssistantDialog.

Return to the Table of Contents

Changes in kio

KAbstractFileWidget

KArchive/KTar/KZip/KAr

KBookmark classes

KDEDesktopMimeType class

KDirLister class

KDiskFreeSp class

KDESasl class

KDirSelectDialog

KFileDialog,KDirSelectDialog,KUrlRequesterDlg,KCustomMenuEditor,KUrlBarItemDialog

KFileDialog, KDirOperator

KFileDialog

KFileIconView, KFileDetailView, KFileTreeView, KFileTreeViewItem

KFileItemList

KFileMetaInfo

KFileMetaInfo has a new API and a new implementation. The change moves the emphasis away from mimetypes and groups of metadata to individual properties of files. These properties are still called KFileMetaInfoItem. The no longer belong to a group; they belong to the KFileMetaInfo object. The class KFileMetaInfoGroup is only there to group the items. Each KFileMetaInfoItem now has a member called PredicateProperties. This term comes from RDF. It determines the type of the item. This type encompasses the key (a URI), a name in the current locale, a description in the current locale, a type and a QValidator.

KFileOpenWithHandler

KFilePlugin

This class has been replaced by Strigi analyzers and KFileWritePlugin. The Strigi analyzer should be installed in the directory lib/strigi to be picked up. Introspection provided by the factories that are defined in the plugin helps in determining when a particular analyzer will be used.

Strigi analyzer have the advantage that they are faster then KFilePlugins. In addition, having one mechanism for extracting metadata from files saves code and more importantly ensures consistency between the display of metadata and the ablility to search in it. Another advantage is that the way the metadata are described matches well with the methods employed in the semantic desktop, in particular Nepomuk.

How to convert a KFilePlugin?

If your KFilePlugin only reads from files, it is easiest. Then you have to write only a Strigi analyzer. Depending on the way you read the data from the file it is best to write either a StreamThroughAnalyzer or a StreamEndAnalyzer. How to make the decision is explained in the link above. When your analyzer is ready you have to decide where to put it. You can put it in the same place as the KFilePlugin was or, if there are little or no dependencies in your analyzer, you can put it in kdesupport/strigi/src/streamindexer. The latter option has the advantage that you do not have to add the code for loading a plugin.

When you have write functionality in your plugin, you must implement KFileWritePlugin and place the code for writing the file in there. The details of how to do this are not entirely clear at the moment as is explained in the entry for KFileWritePlugin.

KFileWritePlugin

The write functionality of the class KFilePlugin is now handled by KFileWritePlugin. A global instance of this class that is attached to a KFileMetaInfoItem can be used to write back changes that were made to a files' metadata.

The mechanism by which these global instances are tied to KFileMetaDataItems is not yet finished. The implementation of will go into kio/kio/kfilemetainfo.cpp.

KIconButton

KIconDialog

KImageIO classes

KIO:: global methods

KIO::Job

KIO::UDSEntry

KIO::RenameDialog

KIO::RenameDialogPlugin

KIO::PasswordDialog

KIO::PreviewJob

KIO::SkipDialog

KIO::Observer

KIO::SlaveBase

KIO::TCPSlaveBase

KMimeMagic

KMimeType

KMimeTypeResolver

KOpenWithDlg

KPropertiesDialog

KPropertiesDialogPlugin

KProtocolInfo

KRun

KURLBar

KURLComboBox

KURLCompletion

KURLPixmapProvider

KURLRequester

KService

KServiceType

KServiceTypeProfile

KTrader

PasswordDialog

UIServer

Return to the Table of Contents

Changes in kparts

BrowserExtension

BrowserHostExtension

BrowserRun

ComponentFactory

KParts::URLArgs

Return to the Table of Contents

Changes in kded

Return to the Table of Contents

Changes in kspell

KSpell

Return to the Table of Contents

Changes in kdnssd

DomainBrowser

ServiceBase

ServiceBrowser

RemoteService

PublicService

Query

Return to the Table of Contents

API-cleanups in KHTML

Return to the Table of Contents

Changes in kfile

KUrlRequesterDialog

KDirOperator

KFileView

KFileWidget

Return to the Table of Contents

Changes in kdesu

All classes of kdesu are now in the KDESu namespace

Return to the Table of Contents

Changes in KControl

Return to the Table of Contents

Panel Applets and Extensions

Return to the Table of Contents

libkmid

KScreensaver

libkscreensaver

Return to the Table of Contents

I18N

Messages.sh files

Instead of the "messages" target of the Makefile.am files, KDE4 uses now Bash scripts with Messages.sh file names. The Perl script branches/work/l10n-kde4/scripts/conversion/Makefile2Messages.pl can be used as an half-automatic conversion. (Please verify the result!)

rc.cpp file

The rc.cpp is now always generated. It is mandatory to have it as parameter of the $XGETTEXT if you are using the class KAboutData and if you are not explicitly setting KAboutData::setTranslator.

Gettext 0.16.1

Scripty uses xgettext 0.16.1 for extracting messages out of the source code. This is a huge step from the former xgettext 0.10.35-kde used in KDE3.

Important changes:

Translator Comments

Translator comments are a feature that already existed in KDE3, but which was seldom used.

// i18n: this is a test sentence
i18n("The quick brown fox jumps over the lazy dog");

i18n calls

The basic call, a message without arguments, context or plural, remains as is:

i18n("Just plain info");

If there are arguments, arg methods are no longer used to substitute the placeholders. Instead, arguments are added to the call:

i18n("%1 has scored %2", playerName, score);

Arguments can be of several integer types, double, QString, QChar (and perhaps more in the future).

Context call now has a different name, i18nc, and takes arguments in the same way:

i18nc("Player name - score", "%1 - %2", playerName, score);

Plural call is renamed to i18np and does away with %n placeholder, all being numbered instead:

i18np("One image in album %2", "%1 images in album %2", n, albumName);

The plural form is decided by first integer-valued argument.

There is one new call variant, the context-plural call:

i18ncp("Personal file", "One file", "%1 files", n);

i18n* calls are realized as templates, and so will take at most some finite number of arguments.

Notes on placeholder substitution:

Sometimes you might need old-style syntax for argument substitution. For example, when there are many arguments, or, more importantly, when it is convenient to defer substitution of arguments. This is possible using new ki18n call, with subs methods for argument substitution and toString method for finalization:

KLocalizedString ks = ki18n("The Foo-machine reported: %1");
case (fooErrCode) {
    ERR_OXI: ks.subs(i18n("Out of oxidizer")); break;
    ERR_HYD: ks.subs(i18n("Out of hydrazine")); break;
    ERR_PIL: ks.subs(i18n("Out of pilots")); break;
    default: ks.subs(i18n("Unknown catastrophe"));
}
QString scream = ks.toString();

Note that ki18n returns object of type KLocalizedString, hence the toString method for conversion to plain QString. The ki18n call should be used rarely; the previous example can as well be rewritten to:

QString problem;
case (fooErrCode) {
    ERR_OXI: problem = i18n("Out of oxidizer"); break;
    ...
}
QString scream = i18n("The Foo-machine reported: %1", problem);

Another case when you might want to use ki18n is if you want to format arguments. subs methods can take formatting arguments, similar to those of arg methods in QString. You should never use methods other than subs to format numbers in localized messages:

i18n("Rounds: %1", myNumberFormat(n, 8)); // bad, number not localized
ki18n("Rounds: %1").subs(n, 8).toString(); // good, number is localized

There is a context, plural and context-plural variant of ki18n as well:

ki18nc("No function", "None").toString();
ki18np("One file found", "%1 files found").subs(n).toString();
ki18ncp("Personal file", "One file", "%1 files").subs(n).toString();

If you need translation using locale (KLocale object) other than the default, you can use overloaded toString method which takes pointer to locale object (this replaces KLocale::translate(...) from KDE3):

KLocale *myLocale;
...
ki18n("Welcome").toString(myLocale);

There is a script for semi-automatic conversion of KDE 3 code, i18nk34conv.pl in branches/work/kde4-l10n/scripts/conversion/. It will convert most of the calls automatically, and mark the places that need manual review. There is also the script i18ncheckarg.pl in branches/work/kde4-l10n/scripts, which will check whether placeholders and arguments match. Use it to catch and correct deferred substitutions (like in the examples above). Both these scripts you can just run without any arguments in top directory of your sources (but you can also specify paths or filenames as arguments). Do not run conversion script twice on same sources!

Return to the Table of Contents

Changes in KSSL

KSSLCertDialog

KSSLInfoDialog

Return to the Table of Contents

Changes in mime types names

KDE 4 switched to the XDG mime types, thus the names for some mime types have changed.

The following list contains the renamings from the KDE mime types to the XDG ones.

Notes:

Old KDE mime type XDG mime type
application/chm application/x-chm
application/fits image/x-fits
application/java application/x-java
application/mathml+xml text/mathml
application/msexcel application/vnd.ms-excel (alias)
application/mspowerpoint application/vnd.ms-powerpoint (alias)
application/ms-tnef application/vnd.ms-tnef
application/pgp application/pgp-encrypted (alias)
application/vnd.ms-asf video/x-ms-asf
application/vnd.ms-word application/msword (alias)
application/vnd.palm application/x-palm-database (alias)
application/vnd.stardivision.writer-global application/vnd.stardivision.writer
application/vnd.sun.xml.base application/vnd.oasis.opendocument.database
application/vnd.sun.xml.writer.master application/vnd.sun.xml.writer.global
application/wordperfect application/vnd.wordperfect (alias)
application/x-7z application/x-7z-compressed
application/x-afm application/x-font-afm
application/x-applixgraphics image/x-applix-graphics
application/x-applixspread application/x-applix-spreadsheet
application/x-applixword application/x-applix-word
application/x-bz2dvi application/x-bzdvi
application/x-bzip2 application/x-bzip (alias)
application/x-dbase application/x-dbf (alias)
application/x-font-ghostscript application/x-font-type1
application/x-font-ttc application/x-font-ttf
application/x-gettext text/x-gettext-translation (*.po)
text/x-gettext-translation-template (*.pot)
application/x-hancomword application/x-hwp
application/x-iso application/x-cd-image
application/x-jar application/x-java-archive (alias)
application/x-javascript application/javascript (alias)
application/x-msaccess application/vnd.ms-access (alias)
application/x-msdos-program application/x-ms-dos-executable
application/x-msmetafile image/x-wmf
application/x-ogg application/ogg
application/x-perl-module application/x-perl
application/x-python text/x-python
application/x-rar-compressed application/x-rar
application/x-tbz application/x-bzip-compressed-tar
application/x-tgz application/x-compressed-tar
application/x-troff text/troff (alias)
application/x-zip application/zip
application/x-zip-compressed application/zip (alias)
application/xml-dtd text/x-dtd
audio/mpegurl audio/x-mpegurl (alias)
audio/x-midi audio/midi (alias)
audio/x-mp3 audio/mpeg (alias)
audio/x-oggflac audio/x-flac+ogg
audio/x-pn-realaudio audio/vnd.rn-realaudio (alias)
audio/x-speex audio/x-speex+ogg
audio/x-vorbis audio/x-vorbis+ogg
audio/vorbis audio/x-vorbis+ogg
image/fits image/x-fits
image/jp2 image/jpeg2000
image/jpg image/jpeg
image/pjpeg image/jpeg (alias)
image/svg-xml image/svg+xml
image/svg+xml image/svg+xml (*.svg)
image/svg+xml-compressed (*.svgz)
image/x-bmp image/bmp
image/x-djvu image/vnd.djvu (alias)
image/x-portable-greymap image/x-portable-graymap
image/x-raw image/x-dcraw (general mime type)

Specific mime types (all subclasses of image/x-dcraw):
image/x-panasonic-raw (*.raw)
image/x-kodak-dcr (*.dcr)
image/x-adobe-dng (*.dng)
image/x-canon-crw (*.crw *.cr2)
image/x-nikon-nef (*.nef)
image/x-minolta-mrw (*.mrw)
image/x-kodak-k25 (*.k25)
image/x-kodak-kdc (*.kdc)
image/x-olympus-orf (*.orf)
image/x-pentax-pef (*.pef)
image/x-fuji-raf (*.raf)
image/x-sony-sr2 (*.sr2)
image/x-sony-srf (*.srf)
image/x-sigma-x3f (*.x3f)
other extensions that were part of image/x-raw: image/x-kde-raw
image/x-targa image/x-tga
image/x-vnd.adobe.photoshop image/x-psd
image/x-xbm image/x-xbitmap
image/x-xcf-gimp image/x-xcf
image/x-xpm image/x-xpixmap
text/docbook application/docbook+xml
text/javascript application/javascript (alias)
text/rss application/rss+xml (alias)
text/rtf application/rtf
text/x-csv text/csv
text/x-diff text/x-patch
text/x-latex text/x-tex
text/xml application/xml (alias)
text/x-mswinurl application/x-mswinurl
text/x-vcalendar text/calendar (alias)
text/x-vcard text/directory (alias)
text/x-xslt application/xslt+xml
video/avi video/x-msvideo
video/x-ogm video/x-ogm+ogg
video/x-theora video/x-theora+ogg

Return to the Table of Contents

Changes in KNewStuff

General

KNewStuff is replaced with KNewStuff2. The API for applications has changed completely, as the library is a rewrite and not an update. Do not inherit from any class, use only KNS::Engine. All application-specific properties especially about what to do with downloaded files are configured in *.knsrc files; have a look at knewstuff/doc/porting.txt and knewstuff/doc/tutorial.txt.

Upload

Download

Return to the Table of Contents

DCOP

DCOP has been replaced with D-Bus.
Help with porting from DCOP to D-Bus can be found at http://techbase.kde.org/Development/Tutorials/Porting_to_D-Bus

Return to the Table of Contents

Printing

libkdeprint has been replaced by enhanced printing support in Qt 4. Qt 4.3 is still lacking in a print preview feature and a customisable print dialog. KPrintPreview (kutils) provides the former, and KdePrint::createPrintDialog() (kdeui) provides the latter, at least for Qt 4.3.2 onwards.

Porting involves the following

If the code uses addDialogPage, you need to change the KPrintDialogPage to a QWidget, and you can get rid of the getOptions and setOptions methods in favor of a method for each option (since QPrintDialog doesn't do anything with the widget except display it). Then the code that called KPrinter::addDialogPage and KPrinter::setup needs to use KdePrint::createPrintDialog instead and get the options directly from the widgets passed to createPrintDialog rather than from the QPrinter. The widgets should also use setWindowTitle() rather than setTitle().

For more details, see the following:

Return to the Table of Contents