rev 7646 - in branches/kde4/packages/kdelibs/debian: . patches

Fathi Boudra fboudra-guest at alioth.debian.org
Thu Oct 25 13:27:56 UTC 2007


Author: fboudra-guest
Date: 2007-10-25 13:27:56 +0000 (Thu, 25 Oct 2007)
New Revision: 7646

Added:
   branches/kde4/packages/kdelibs/debian/patches/01_kdelibs_branch_r729265.diff
Removed:
   branches/kde4/packages/kdelibs/debian/patches/01_kdelibs_branch_r726725.diff
Modified:
   branches/kde4/packages/kdelibs/debian/changelog
   branches/kde4/packages/kdelibs/debian/patches/series
Log:
* Pull SVN branch to r729265.


Modified: branches/kde4/packages/kdelibs/debian/changelog
===================================================================
--- branches/kde4/packages/kdelibs/debian/changelog	2007-10-25 12:48:52 UTC (rev 7645)
+++ branches/kde4/packages/kdelibs/debian/changelog	2007-10-25 13:27:56 UTC (rev 7646)
@@ -1,11 +1,18 @@
 kde4libs (4:3.94.0-3) experimental; urgency=low
 
+
+  +++ Changes by Fathi Boudra:
+
+  * Pull SVN branch to r729265.
+
+  +++ Changes by Armin Berres:
+
   * Lower the dependency on kde-icons-oxygen to a recommends. Otherwise we
     have a circular dependency when building the packages.
-  
+
   * Update *.install files for the branch pull.
 
- -- Armin Berres <trigger+debian at space-based.de>  Thu, 25 Oct 2007 14:47:24 +0200
+ -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Thu, 25 Oct 2007 14:47:24 +0200
 
 kde4libs (4:3.94.0-2) experimental; urgency=low
 

Deleted: branches/kde4/packages/kdelibs/debian/patches/01_kdelibs_branch_r726725.diff

Added: branches/kde4/packages/kdelibs/debian/patches/01_kdelibs_branch_r729265.diff
===================================================================
--- branches/kde4/packages/kdelibs/debian/patches/01_kdelibs_branch_r729265.diff	                        (rev 0)
+++ branches/kde4/packages/kdelibs/debian/patches/01_kdelibs_branch_r729265.diff	2007-10-25 13:27:56 UTC (rev 7646)
@@ -0,0 +1,52167 @@
+--- a/khtml/domtreeview.cpp
++++ /dev/null
+@@ -1,99 +0,0 @@
+-/***************************************************************************
+-                               domtreeview.cpp
+-                             -------------------
+-
+-    copyright            : (C) 2001 - The Kafka Team
+-    email                : kde-kafka at master.kde.org
+- ***************************************************************************/
+-
+-//krazy:excludeall=license (only used in test executable)
+-
+-/***************************************************************************
+- *                                                                         *
+- *   This program is free software; you can redistribute it and/or modify  *
+- *   it under the terms of the GNU General Public License as published by  *
+- *   the Free Software Foundation; either version 2 of the License, or     *
+- *   (at your option) any later version.                                   *
+- *                                                                         *
+- ***************************************************************************/
+-
+-#include "khtml_part.h"
+-#include "domtreeview.moc"
+-#include "xml/dom_nodeimpl.h"
+-
+-DOMTreeView::DOMTreeView(QWidget *parent, KHTMLPart *currentpart, const char * name) : K3ListView(parent)
+-{
+-    setWindowTitle(name);
+-    setRootIsDecorated(true);
+-    addColumn("Name");
+-    addColumn("Value");
+-    addColumn("Renderer");
+-    setSorting(-1);
+-    part = currentpart;
+-    connect(part, SIGNAL(nodeActivated(const DOM::Node &)), this, SLOT(showTree(const DOM::Node &)));
+-    connect(this, SIGNAL(clicked(Q3ListViewItem *)), this, SLOT(slotItemClicked(Q3ListViewItem *)));
+-}
+-
+-DOMTreeView::~DOMTreeView()
+-{
+-    disconnect(part);
+-}
+-
+-void DOMTreeView::showTree(const DOM::Node &pNode)
+-{
+-    if(pNode.isNull() || document != pNode.ownerDocument())
+-    {
+-	clear();
+-	m_itemdict.clear();
+-  qDeleteAll(m_nodedict);
+-	m_nodedict.clear();
+-	if(pNode.isNull())
+-	    return;
+-	else if(pNode.ownerDocument().isNull())
+-	    recursive(0, pNode);
+-	else
+-	    recursive(0, pNode.ownerDocument());
+-    }
+-    setCurrentItem(m_itemdict[pNode.handle()]);
+-    ensureItemVisible(m_itemdict[pNode.handle()]);
+-}
+-
+-void DOMTreeView::recursive(const DOM::Node &pNode, const DOM::Node &node)
+-{
+-    Q3ListViewItem *cur_item;
+-    if(pNode.ownerDocument() != document)
+-    {
+-	QString val = node.nodeValue().string();
+-	if ( val.length() > 20 )
+-	    val.truncate( 20 );
+-	cur_item = new Q3ListViewItem(static_cast<Q3ListView *>(this), node.nodeName().string(), val );
+-	document = pNode.ownerDocument();
+-    }
+-    else {
+-	QString val = node.nodeValue().string();
+-	if ( val.length() > 20 )
+-	    val.truncate( 20 );
+-	cur_item = new Q3ListViewItem(m_itemdict[pNode.handle()], node.nodeName().string(), val);
+-    }
+-
+-    if(node.handle())
+-    {
+-	m_itemdict.insert(node.handle(), cur_item);
+-	m_nodedict.insert(cur_item, new DOM::Node(node));
+-    }
+-
+-    DOM::Node cur_child = node.lastChild();
+-    while(!cur_child.isNull())
+-    {
+-	recursive(node, cur_child);
+-	cur_child = cur_child.previousSibling();
+-    }
+-}
+-
+-void DOMTreeView::slotItemClicked(Q3ListViewItem *cur_item)
+-{
+-    DOM::Node *handle = m_nodedict[cur_item];
+-    if(handle) {
+-	emit part->setActiveNode(*handle);
+-    }
+-}
+--- a/khtml/domtreeview.h
++++ /dev/null
+@@ -1,56 +0,0 @@
+-/***************************************************************************
+-                               domtreeview.cpp
+-                             -------------------
+-
+-    copyright            : (C) 2001 - The Kafka Team
+-    email                : kde-kafka at master.kde.org
+- ***************************************************************************/
+-
+-//krazy:excludeall=license (only used in test executable)
+-
+-/***************************************************************************
+- *                                                                         *
+- *   This program is free software; you can redistribute it and/or modify  *
+- *   it under the terms of the GNU General Public License as published by  *
+- *   the Free Software Foundation; either version 2 of the License, or     *
+- *   (at your option) any later version.                                   *
+- *                                                                         *
+- ***************************************************************************/
+-
+-#ifndef DOMTREEVIEW_H
+-#define DOMTREEVIEW_H
+-
+-#include <k3listview.h>
+-#include <kdebug.h>
+-#include <Qt3Support/Q3ListView>
+-#include <QtCore/QHash>
+-#include "dom/dom_core.h"
+-
+-class DOMTreeView : public K3ListView
+-{
+-    Q_OBJECT
+-    public: 
+-	DOMTreeView(QWidget *parent, KHTMLPart *part, const char * name = 0);
+-	~DOMTreeView();
+-
+-	void recursive(const DOM::Node &pNode, const DOM::Node &node);
+-
+-    Q_SIGNALS:
+-	void sigNodeClicked(const DOM::Node &);
+-	
+-    public Q_SLOTS:
+-	void showTree(const DOM::Node &pNode);
+-
+-    protected Q_SLOTS:
+-	void slotItemClicked(Q3ListViewItem *);
+-
+-    private:
+-        QHash<void*, Q3ListViewItem*> m_itemdict;
+-        QHash<void*, DOM::Node*> m_nodedict;
+-	DOM::Node document;
+-
+-	KHTMLPart *part;
+-
+-};
+-
+-#endif
+--- a/khtml/khtml_settings.cc
++++ b/khtml/khtml_settings.cc
+@@ -288,7 +288,7 @@
+ 
+ void KHTMLSettings::init()
+ {
+-  KConfig global( "khtmlrc", KConfig::CascadeConfig );
++  KConfig global( "khtmlrc", KConfig::NoGlobals );
+   init( &global, true );
+ 
+   KSharedConfig::Ptr local = KGlobal::config();
+@@ -741,7 +741,7 @@
+ 
+ void KHTMLSettings::addAdFilter( const QString &url )
+ {
+-    KConfigGroup config = KSharedConfig::openConfig( "khtmlrc", KConfig::CascadeConfig )->group( "Filter Settings" );
++    KConfigGroup config = KSharedConfig::openConfig( "khtmlrc", KConfig::NoGlobals )->group( "Filter Settings" );
+ 
+     QRegExp rx;
+     if (url.length()>2 && url[0]=='/' && url[url.length()-1] == '/')
+--- /dev/null
++++ b/khtml/khtmladaptorpart.desktop
+@@ -0,0 +1,8 @@
++[Desktop Entry]
++Encoding=UTF-8
++Name=KHTML Extension Adaptor
++X-KDE-Library=khtmladaptorpart
++MimeType=application/x-kde-widget-container;
++ServiceTypes=KParts/ReadOnlyPart,Browser/View
++Type=Service
++InitialPreference=4
+--- a/khtml/khtmlview.cpp
++++ b/khtml/khtmlview.cpp
+@@ -73,7 +73,7 @@
+ #include <kiconloader.h>
+ #include <klocale.h>
+ #include <knotification.h>
+-#include <kprinter.h>
++#include <kdeprintdialog.h>
+ #include <kconfig.h>
+ #include <kstandarddirs.h>
+ #include <kstandardshortcut.h>
+@@ -92,6 +92,8 @@
+ #include <QtCore/QAbstractEventDispatcher>
+ #include <QtCore/QVector>
+ #include <QtGui/QAbstractScrollArea>
++#include <QtGui/QPrinter>
++#include <QtGui/QPrintDialog>
+ 
+ //#define DEBUG_FLICKER
+ 
+@@ -250,6 +252,7 @@
+ 
+         emitCompletedAfterRepaint = CSNone;
+         m_mouseEventsTarget = 0;
++        m_clipHolder = 0;
+     }
+     void newScrollTimer(QWidget *view, int tid)
+     {
+@@ -382,6 +385,7 @@
+     QTimer *m_mouseScrollTimer;
+     QWidget *m_mouseScrollIndicator;
+     QPointer<QWidget> m_mouseEventsTarget;
++    QStack<QRegion>* m_clipHolder;
+ };
+ 
+ #ifndef QT_NO_TOOLTIP
+@@ -514,13 +518,8 @@
+         setWidget( new QWidget(this) );
+     widget()->setAttribute( Qt::WA_NoSystemBackground );
+ 
+-    // ### we'll enable redirection of khtmlview
+-    //     when event issues have been thoroughly worked out
+-
+-    bool redirect = false; // m_part->parentPart() && !isFrame() ...
+-
++    bool redirect = m_part->parentPart();
+     m_kwp->setIsRedirected( redirect );
+-    d->staticWidget = redirect;
+ }
+ 
+ void KHTMLView::delayedInit()
+@@ -551,6 +550,13 @@
+     QScrollArea::setVerticalScrollBarPolicy(d->vpolicy);
+     verticalScrollBar()->setEnabled( false );
+     horizontalScrollBar()->setEnabled( false );
++
++    bool redirect = m_part->parentPart() && m_kwp->renderWidget() && m_kwp->renderWidget()->element() && 
++                    m_kwp->renderWidget()->element()->id() != ID_FRAME; 
++
++    m_kwp->setIsRedirected( redirect );
++    if (redirect)
++        setHasStaticBackground();
+ }
+ 
+ void KHTMLView::hideEvent(QHideEvent* e)
+@@ -577,6 +583,16 @@
+     return d->m_mouseEventsTarget;
+ }
+ 
++void KHTMLView::setClipHolder( QStack<QRegion>* ch )
++{
++    d->m_clipHolder = ch;
++}
++
++QStack<QRegion>* KHTMLView::clipHolder() const
++{
++    return d->m_clipHolder;
++}
++
+ int KHTMLView::contentsWidth() const
+ {
+     return widget() ? widget()->width() : 0;
+@@ -1207,6 +1223,14 @@
+     m_part->executeScheduledScript();
+ 
+     khtml::RenderObject* r = target ? target->renderer() : 0;
++    bool setCursor = true;
++    if (r && r->isWidget()) {
++        RenderWidget* rw = static_cast<RenderWidget*>(r);
++        KHTMLWidget* kw = qobject_cast<KHTMLView*>(rw->widget())? dynamic_cast<KHTMLWidget*>(rw->widget()) : 0;
++        if (kw && kw->m_kwp->isRedirected())
++            setCursor = false;
++        kDebug() << "setCursor is " << setCursor << "for khmtlview" << this;
++    }
+     khtml::RenderStyle* style = (r && r->style()) ? r->style() : 0;
+     QCursor c;
+     LinkCursor linkCursor = LINK_NORMAL;
+@@ -1272,14 +1296,21 @@
+     case CURSOR_DEFAULT:
+         break;
+     }
+-
+-    if ( viewport()->cursor().handle() != c.handle() ) {
+-        if( c.handle() == QCursor(Qt::ArrowCursor).handle()) {
++    
++    if (!setCursor && style && style->cursor() != CURSOR_AUTO)
++        setCursor = true;
++
++    QWidget* vp = viewport();
++    for (KHTMLPart* p = m_part; p; p = p->parentPart())
++        if (!p->parentPart())
++            vp = p->view()->viewport();
++    if ( setCursor && vp->cursor().handle() != c.handle() ) {
++        if( c.shape() == Qt::ArrowCursor) {
+             for (KHTMLPart* p = m_part; p; p = p->parentPart())
+                 p->view()->viewport()->unsetCursor();
+         }
+         else {
+-            viewport()->setCursor( c );
++            vp->setCursor( c );
+         }
+     }
+ 
+@@ -1293,6 +1324,8 @@
+           default:              cursorIcon = "error";      break;
+ 	}
+         QPixmap icon_pixmap = KHTMLFactory::iconLoader()->loadIcon( cursorIcon, KIconLoader::Small, 0, KIconLoader::DefaultState, QStringList(), 0, true );
++
++#if 0
+ 	if (d->cursor_icon_widget)
+ 	{
+ 	    const QPixmap *pm = d->cursor_icon_widget->backgroundPixmap();
+@@ -1302,10 +1335,11 @@
+ 		d->cursor_icon_widget = NULL;
+ 	    }
+ 	}
++#endif
+ 
+         if( !d->cursor_icon_widget ) {
+ #ifdef Q_WS_X11
+-            d->cursor_icon_widget = new QWidget( 0, Qt::WX11BypassWM );
++            d->cursor_icon_widget = new QWidget( 0, Qt::X11BypassWindowManagerHint );
+             XSetWindowAttributes attr;
+             attr.save_under = True;
+             XChangeWindowAttributes( QX11Info::display(), d->cursor_icon_widget->winId(), CWSaveUnder, &attr );
+@@ -1321,7 +1355,7 @@
+             QPalette palette;
+             palette.setBrush( d->cursor_icon_widget->backgroundRole(), QBrush( icon_pixmap ) );
+             d->cursor_icon_widget->setPalette( palette );
+-            d->cursor_icon_widget->erase();
++            d->cursor_icon_widget->update();
+         }
+         QPoint c_pos = QCursor::pos();
+         d->cursor_icon_widget->move( c_pos.x() + 15, c_pos.y() + 15 );
+@@ -1868,7 +1902,7 @@
+ 
+ static void handleWidget(QWidget* w, KHTMLView* view)
+ {
+-    if (w->isTopLevel())
++    if (w->isWindow())
+         return;
+ 
+     if (!qobject_cast<QFrame*>(w))
+@@ -1930,7 +1964,8 @@
+ {
+       w->setAttribute(Qt::WA_WState_InPaintEvent, b);
+       foreach(QObject* cw, w->children()) {
+-          if (cw->isWidgetType()) {
++          if (cw->isWidgetType() && !(static_cast<QWidget*>(cw)->windowFlags() & Qt::Window) 
++                                 &&  !(static_cast<QWidget*>(cw)->windowModality() & Qt::ApplicationModal)) {
+               static_cast<QWidget*>(cw)->setAttribute(Qt::WA_WState_InPaintEvent, false);
+               setInPaintEventFlag(static_cast<QWidget*>(cw), b);
+           }
+@@ -2085,7 +2120,6 @@
+     return QScrollArea::eventFilter(o, e);
+ }
+ 
+-
+ bool KHTMLView::widgetEvent(QEvent* e)
+ {
+     switch (e->type()) {
+@@ -2103,14 +2137,14 @@
+       case QEvent::DragLeave:
+       case QEvent::Drop:
+         return QFrame::event(e);
+-      case QEvent::ChildInserted: {
++      case QEvent::ChildPolished: {
+         // we need to install an event filter on all children of the widget() to
+         // be able to get correct stacking of children within the document.
+         QObject *c = static_cast<QChildEvent *>(e)->child();
+         if (c->isWidgetType()) {
+             QWidget *w = static_cast<QWidget *>(c);
+ 	    // don't install the event filter on toplevels
+-	    if (w->parentWidget() == widget()) {
++	    if (!(w->windowFlags() & Qt::Window) && !(w->windowModality() & Qt::ApplicationModal)) {
+ 	        KHTMLWidget* k = dynamic_cast<KHTMLWidget*>(w);
+ 	        if (k && k->m_kwp->isRedirected()) {
+ 	            w->unsetCursor();
+@@ -2401,7 +2435,8 @@
+             }
+             if( !accesskey.isNull()) {
+ 	        QRect rec=en->getRect();
+-	        QLabel *lab=new QLabel(accesskey,viewport(),Qt::WDestructiveClose);
++	        QLabel *lab=new QLabel(accesskey,viewport());
++	        lab->setAttribute(Qt::WA_DeleteOnClose);
+ 	        connect( origview, SIGNAL(hideAccessKeys()), lab, SLOT(close()) );
+ 	        connect( this, SIGNAL(repaintAccessKeys()), lab, SLOT(repaint()));
+ 	        lab->setPalette(QToolTip::palette());
+@@ -2892,29 +2927,32 @@
+     khtml::RenderCanvas *root = static_cast<khtml::RenderCanvas *>(m_part->xmlDocImpl()->renderer());
+     if(!root) return;
+ 
+-    KPrinter *printer = new KPrinter(true, QPrinter::ScreenResolution);
+-    printer->addDialogPage(new KHTMLPrintSettings());
++    KHTMLPrintSettings printSettings; //XXX: doesn't save settings between prints like this
++    QPrinter printer;
++    QPrintDialog *dialog = KdePrint::createPrintDialog(&printer, QList<QWidget*>() << &printSettings, this);
++
+     QString docname = m_part->xmlDocImpl()->URL().prettyUrl();
+     if ( !docname.isEmpty() )
+         docname = KStringHandler::csqueeze(docname, 80);
+-    if(quick || printer->setup(this, i18n("Print %1", docname))) {
++
++    if(quick || dialog->exec()) {
+         viewport()->setCursor( Qt::WaitCursor ); // only viewport(), no QApplication::, otherwise we get the busy cursor in kdeprint's dialogs
+         // set up KPrinter
+-        printer->setFullPage(false);
+-        printer->setCreator(QString("KDE %1.%2.%3 HTML Library").arg(KDE_VERSION_MAJOR).arg(KDE_VERSION_MINOR).arg(KDE_VERSION_RELEASE));
+-        printer->setDocName(docname);
++        printer.setFullPage(false);
++        printer.setCreator(QString("KDE %1.%2.%3 HTML Library").arg(KDE_VERSION_MAJOR).arg(KDE_VERSION_MINOR).arg(KDE_VERSION_RELEASE));
++        printer.setDocName(docname);
+ 
+         QPainter *p = new QPainter;
+-        p->begin( printer );
++        p->begin( &printer );
+         khtml::setPrintPainter( p );
+ 
+-        m_part->xmlDocImpl()->setPaintDevice( printer );
++        m_part->xmlDocImpl()->setPaintDevice( &printer );
+         QString oldMediaType = mediaType();
+         setMediaType( "print" );
+         // We ignore margin settings for html and body when printing
+         // and use the default margins from the print-system
+         // (In Qt 3.0.x the default margins are hardcoded in Qt)
+-        m_part->xmlDocImpl()->setPrintStyleSheet( printer->option("app-khtml-printfriendly") == "true" ?
++        m_part->xmlDocImpl()->setPrintStyleSheet( printSettings.printFriendly() ?
+                                                   "* { background-image: none !important;"
+                                                   "    background-color: white !important;"
+                                                   "    color: black !important; }"
+@@ -2924,19 +2962,19 @@
+ 						  "html { margin: 0px !important; }"
+ 						  );
+ 
+-        kDebug(6000) << "printing: physical page width = " << printer->width()
+-                      << " height = " << printer->height() << endl;
++        kDebug(6000) << "printing: physical page width = " << printer.width()
++                      << " height = " << printer.height() << endl;
+         root->setStaticMode(true);
+         root->setPagedMode(true);
+-        root->setWidth(printer->width());
+-//         root->setHeight(printer->height());
++        root->setWidth(printer.width());
++//         root->setHeight(printer.height());
+         root->setPageTop(0);
+         root->setPageBottom(0);
+         d->paged = true;
+ 
+-        m_part->xmlDocImpl()->styleSelector()->computeFontSizes(printer->logicalDpiY(), 100);
++        m_part->xmlDocImpl()->styleSelector()->computeFontSizes(printer.logicalDpiY(), 100);
+         m_part->xmlDocImpl()->updateStyleSelector();
+-        root->setPrintImages( printer->option("app-khtml-printimages") == "true");
++        root->setPrintImages(printSettings.printImages());
+         root->makePageBreakAvoidBlocks();
+ 
+         root->setNeedsLayoutAndMinMaxRecalc();
+@@ -2945,7 +2983,7 @@
+ 
+         // check sizes ask for action.. (scale or clip)
+ 
+-        bool printHeader = (printer->option("app-khtml-printheader") == "true");
++        bool printHeader = printSettings.printHeader();
+ 
+         int headerHeight = 0;
+         QFont headerFont("Sans Serif", 8);
+@@ -2963,14 +3001,14 @@
+         // ok. now print the pages.
+         kDebug(6000) << "printing: html page width = " << root->docWidth()
+                       << " height = " << root->docHeight() << endl;
+-        kDebug(6000) << "printing: margins left = " << printer->margins().width()
+-                      << " top = " << printer->margins().height() << endl;
+-        kDebug(6000) << "printing: paper width = " << printer->width()
+-                      << " height = " << printer->height() << endl;
++        kDebug(6000) << "printing: margins left = " << printer.pageRect().left() - printer.paperRect().left()
++                      << " top = " << printer.pageRect().top() - printer.paperRect().top() << endl;
++        kDebug(6000) << "printing: paper width = " << printer.width()
++                      << " height = " << printer.height() << endl;
+         // if the width is too large to fit on the paper we just scale
+         // the whole thing.
+-        int pageWidth = printer->width();
+-        int pageHeight = printer->height();
++        int pageWidth = printer.width();
++        int pageHeight = printer.height();
+         p->setClipRect(0,0, pageWidth, pageHeight);
+ 
+         pageHeight -= headerHeight;
+@@ -2978,9 +3016,9 @@
+         bool scalePage = false;
+         double scale = 0.0;
+ #ifndef QT_NO_TRANSFORMATIONS
+-        if(root->docWidth() > printer->width()) {
++        if(root->docWidth() > printer.width()) {
+             scalePage = true;
+-            scale = ((double) printer->width())/((double) root->docWidth());
++            scale = ((double) printer.width())/((double) root->docWidth());
+             pageHeight = (int) (pageHeight/scale);
+             pageWidth = (int) (pageWidth/scale);
+             headerHeight = (int) (headerHeight/scale);
+@@ -2998,16 +3036,16 @@
+         // Squeeze header to make it it on the page.
+         if (printHeader)
+         {
+-            int available_width = printer->width() - 10 -
+-                2 * qMax(p->boundingRect(0, 0, printer->width(), p->fontMetrics().lineSpacing(), Qt::AlignLeft, headerLeft).width(),
+-                         p->boundingRect(0, 0, printer->width(), p->fontMetrics().lineSpacing(), Qt::AlignLeft, headerRight).width());
++            int available_width = printer.width() - 10 -
++                2 * qMax(p->boundingRect(0, 0, printer.width(), p->fontMetrics().lineSpacing(), Qt::AlignLeft, headerLeft).width(),
++                         p->boundingRect(0, 0, printer.width(), p->fontMetrics().lineSpacing(), Qt::AlignLeft, headerRight).width());
+             if (available_width < 150)
+                available_width = 150;
+             int mid_width;
+             int squeeze = 120;
+             do {
+                 headerMid = KStringHandler::csqueeze(docname, squeeze);
+-                mid_width = p->boundingRect(0, 0, printer->width(), p->fontMetrics().lineSpacing(), Qt::AlignLeft, headerMid).width();
++                mid_width = p->boundingRect(0, 0, printer.width(), p->fontMetrics().lineSpacing(), Qt::AlignLeft, headerMid).width();
+                 squeeze -= 10;
+             } while (mid_width > available_width);
+         }
+@@ -3016,7 +3054,7 @@
+         int bottom = 0;
+         int page = 1;
+         while(top < root->docHeight()) {
+-            if(top > 0) printer->newPage();
++            if(top > 0) printer.newPage();
+ #ifdef __GNUC__
+ #warning "This could not be tested when merge was done, suspect"
+ #endif
+@@ -3029,9 +3067,9 @@
+ 
+                 headerRight = QString("#%1").arg(page);
+ 
+-                p->drawText(0, 0, printer->width(), dy, Qt::AlignLeft, headerLeft);
+-                p->drawText(0, 0, printer->width(), dy, Qt::AlignHCenter, headerMid);
+-                p->drawText(0, 0, printer->width(), dy, Qt::AlignRight, headerRight);
++                p->drawText(0, 0, printer.width(), dy, Qt::AlignLeft, headerLeft);
++                p->drawText(0, 0, printer.width(), dy, Qt::AlignHCenter, headerMid);
++                p->drawText(0, 0, printer.width(), dy, Qt::AlignRight, headerRight);
+             }
+ 
+ 
+@@ -3077,7 +3115,6 @@
+         m_part->xmlDocImpl()->updateStyleSelector();
+         viewport()->unsetCursor();
+     }
+-    delete printer;
+ }
+ 
+ void KHTMLView::slotPaletteChanged()
+@@ -3562,9 +3599,7 @@
+     d->contentsY = verticalScrollBar()->value();
+ 
+     if ( d->staticWidget ) {
+-        qDebug() << "attr: "<< widget()->testAttribute(Qt::WA_WState_InPaintEvent)<< viewport()->testAttribute(Qt::WA_WState_InPaintEvent);
+         widget()->update();
+-        qDebug() << "after: "<< widget()->testAttribute(Qt::WA_WState_InPaintEvent)<< viewport()->testAttribute(Qt::WA_WState_InPaintEvent);
+         return;
+     }
+     QScrollArea::scrollContentsBy(dx, dy);
+--- a/khtml/kmultipart/kmultipart.desktop
++++ b/khtml/kmultipart/kmultipart.desktop
+@@ -50,8 +50,8 @@
+ Name[ru]=Встраиваемый компонент для вложений
+ Name[se]=Vuojuhanláhkái oassi multipart/mixed:a várás
+ Name[sl]=Vgradljiva komponenta za multipart/mixed
+-Name[sr]=Уградива компонента за „multipart/mixed“
+-Name[sr at latin]=Ugradiva komponenta za „multipart/mixed“
++Name[sr]=Угњездива компонента за вишеделни МИМЕ
++Name[sr at latin]=Ugnjezdiva komponenta za višedelni MIME
+ Name[sv]=Inbyggbar komponent för multipart/mixed
+ Name[ta]=பலப்பகுதி/கலக்கப்பட்ட பகுதிக்குரிய உட்பொதிந்த பகுதி
+ Name[te]=మల్టిపార్ట్/మిక్స్డ్ కొరకు పొదిగిన అంశం
+--- a/khtml/kmultipart/kmultipart.cpp
++++ b/khtml/kmultipart/kmultipart.cpp
+@@ -162,8 +162,8 @@
+     // Hmm, args.reload is set to true when reloading, but this doesn't seem to be enough...
+     // I get "HOLD: Reusing held slave for <url>", and the old data
+ 
+-    m_job = KIO::get( url, 
+-                      arguments().reload() ? KIO::Reload : KIO::NoReload, 
++    m_job = KIO::get( url,
++                      arguments().reload() ? KIO::Reload : KIO::NoReload,
+                       KIO::HideProgressInfo );
+ 
+     emit started( 0 /*m_job*/ ); // don't pass the job, it would interfere with our own infoMessage
+@@ -347,19 +347,10 @@
+                  m_extension, SIGNAL( createNewWindow( const KUrl &, const KParts::OpenUrlArguments&, const KParts::BrowserArguments& , const KParts::WindowArgs &, KParts::ReadOnlyPart**) ) );
+ 
+         // Keep in sync with khtml_part.cpp
+-        connect( childExtension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ),
+-                 m_extension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ) );
+-        connect( childExtension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ),
+-                 m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ) );
+-        connect( childExtension, SIGNAL( popupMenu(KXMLGUIClient *, const QPoint &, const KFileItemList &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, KParts::BrowserExtension::PopupFlags) ),
+-                 m_extension, SIGNAL( popupMenu(KXMLGUIClient *, const QPoint &, const KFileItemList &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, KParts::BrowserExtension::PopupFlags) ) );
+-        connect( childExtension, SIGNAL( popupMenu( const QPoint &, const KUrl &, const QString &, mode_t ) ),
+-                 m_extension, SIGNAL( popupMenu( const QPoint &, const KUrl &, const QString &, mode_t ) ) );
+-        connect( childExtension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KUrl &, const QString &, mode_t ) ),
+-                 m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KUrl &, const QString &, mode_t ) ) );
+-        connect( childExtension, SIGNAL( popupMenu(KXMLGUIClient *, const QPoint &, const KUrl &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, KParts::BrowserExtension::PopupFlags, mode_t) ),
+-                 m_extension, SIGNAL( popupMenu(KXMLGUIClient *, const QPoint &, const KUrl &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, KParts::BrowserExtension::PopupFlags, mode_t) ) );
+-
++        connect( childExtension, SIGNAL(popupMenu(QPoint,KFileItemList,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)),
++             m_extension, SIGNAL(popupMenu(QPoint,KFileItemList,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)) );
++        connect( childExtension, SIGNAL(popupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)),
++             m_extension, SIGNAL(popupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)) );
+ 
+         if ( m_isHTMLPart )
+             connect( childExtension, SIGNAL( infoMessage( const QString & ) ),
+--- a/khtml/testkhtml.cpp
++++ b/khtml/testkhtml.cpp
+@@ -31,7 +31,6 @@
+ #include <ktoggleaction.h>
+ #include <kactioncollection.h>
+ #include <kicon.h>
+-#include "domtreeview.h"
+ #include "kxmlguifactory.h"
+ 
+ int main(int argc, char *argv[])
+@@ -69,14 +68,9 @@
+ 
+     doc->openUrl( args->url(0) );
+ 
+-//     DOMTreeView * dtv = new DOMTreeView(0, doc, "DomTreeView");
+-//     dtv->show();
+-
+     toplevel->setCentralWidget( doc->widget() );
+     toplevel->resize( 800, 600);
+ 
+-//     dtv->resize(toplevel->width()/2, toplevel->height());
+-
+     QDomDocument d = doc->domDocument();
+     QDomElement viewMenu = d.documentElement().firstChild().childNodes().item( 2 ).toElement();
+     QDomElement e = d.createElement( "action" );
+--- a/khtml/khtml_printsettings.h
++++ b/khtml/khtml_printsettings.h
+@@ -20,19 +20,20 @@
+ #ifndef KHTML_PRINTSETTINGS_H
+ #define KHTML_PRINTSETTINGS_H
+ 
+-#include <kdeprint/kprintdialogpage.h>
++#include <QtGui/QWidget>
+ 
+ class QCheckBox;
+ 
+-class KHTMLPrintSettings : public KPrintDialogPage
++class KHTMLPrintSettings : public QWidget
+ {
+ 	Q_OBJECT
+ public:
+ 	KHTMLPrintSettings(QWidget *parent = 0);
+ 	~KHTMLPrintSettings();
+ 
+-	void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+-	void setOptions(const QMap<QString,QString>& opts);
++        bool printFriendly();
++        bool printImages();
++        bool printHeader();
+ 
+ private:
+ 	QCheckBox	*m_printfriendly;
+--- a/khtml/Mainpage.dox
++++ b/khtml/Mainpage.dox
+@@ -17,10 +17,6 @@
+ and unnecessary bloat to your application.  Qt's text widgets are
+ rich-text capable, and will interpret a limited subset of HTML.
+ 
+-KHTML is likely to be superseded by <a href="http://webkit.org">WebKit</a>
+-in %KDE 4.1 / Qt 4.4.
+-
+-
+ @authors
+ Torben Weis \<weis at stud.uni-frankfurt.de\><br>
+ Josip A. Gracin \<grac at fly.cc.fer.hr\><br>
+@@ -29,12 +25,16 @@
+ Lars Knoll \<knoll at kde.org\><br>
+ Antti Koivisto \<koivisto at iki.fi\><br>
+ Dirk Mueller \<mueller at kde.org\><br>
+-Peter Kelly \<pmk at post.com\>
+-
++Peter Kelly \<pmk at post.com\><br>
++George Staikos \<staikos at kde.org\><br>
++Allan Sandfeld Jensen \<kde at carewolf.com\><br>
++Germain Garand \<germain at ebooksfrance.org\><br>
++Maksim Orlovich \<maksim at kde.org\><br>
++KHTML has also heavily benefited from the work of Apple Computer, Inc.
+ @maintainers
+-Lars Knoll<br>
+-Dirk Mueller<br>
+-Antti Koivisto
++Allan Sandfeld Jensen <br>
++Germain Garand<br>
++Maksim Orlovich
+ 
+ @licenses
+ @lgpl
+--- a/khtml/dom/dom_exception.h
++++ b/khtml/dom/dom_exception.h
+@@ -83,7 +83,9 @@
+         SYNTAX_ERR = 12,
+         INVALID_MODIFICATION_ERR = 13,
+         NAMESPACE_ERR = 14,
+-        INVALID_ACCESS_ERR = 15
++        INVALID_ACCESS_ERR = 15,
++        VALIDATION_ERR = 16,
++        TYPE_MISMATCH_ERR = 17
+     };
+     unsigned short code;
+ };
+--- a/khtml/ChangeLog
++++ b/khtml/ChangeLog
+@@ -1,3 +1,11 @@
++2007-10-13  Allan Sandfeld Jensen <kde at carewolf.com>
++
++        Update HTML-Parser to parse more HTML5 like, and allow custom HTML tags.
++
++        * html/dtd.{h,cpp}: Make all block elements more equal, treat custom tags like <SPAN>
++        * html/htmlparser.{h,cpp}: Treat actual close-tags differently than implicit close.
++        * html/htmltokenizer.cpp: Parse custom HTML tag
++
+ 2007-10-09  Allan Sandfeld Jensen <kde at carewolf.com>
+ 
+         Optimize the case of double descendant selectors "a b c",
+--- /dev/null
++++ b/khtml/misc/translator.h
+@@ -0,0 +1,75 @@
++/**
++ * This file is part of the KHTML renderer for KDE.
++ *
++ * Copyright (C) 2006, 2007 Maksim Orlovich (maksim at kde.org)
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Library General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Library General Public License for more details.
++ *
++ * You should have received a copy of the GNU Library General Public License
++ * along with this library; see the file COPYING.LIB.  If not, write to
++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ * Boston, MA 02110-1301, USA.
++ */
++
++#ifndef KHTML_MISC_TRANSLATOR_H
++#define KHTML_MISC_TRANSLATOR_H
++
++#include <QtCore/QMap>
++
++//---------------------------------------------------------------------------------------------
++/* This class is used to do remapping between different encodings reasonably compactly.
++   It stores things as (L,R) tables, but reads left-side from memory as MemL */
++template<typename L, typename R, typename MemL>
++class IDTranslator
++{
++public:
++    struct Info {
++        MemL l;
++        R    r;
++    };
++
++    IDTranslator(const Info* table) {
++        for (const Info* cursor = table; cursor->l; ++cursor) {
++            m_lToR.insert(cursor->l,  cursor->r);
++            m_rToL.insert(cursor->r,  cursor->l);
++        }
++    }
++
++    bool hasLeft(L l) {
++        typename QMap<L,R>::iterator i = m_lToR.find(l);
++        return i != m_lToR.end();
++    }
++
++    L toLeft(R r) {
++        typename QMap<R,L>::iterator i( m_rToL.find(r) );
++        if (i != m_rToL.end())
++            return *i;
++        return L();
++    }
++
++    R toRight(L l) {
++        typename QMap<L,R>::iterator i = m_lToR.find(l);
++        if (i != m_lToR.end())
++            return *i;
++        return R();
++    }
++
++private:
++    QMap<L, R> m_lToR;
++    QMap<R, L> m_rToL;
++};
++
++#define MAKE_TRANSLATOR(name,L,R,MR,table) static IDTranslator<L,R,MR>* s_##name; \
++    static IDTranslator<L,R,MR>* name() { if (!s_##name) s_##name = new IDTranslator<L,R,MR>(table); \
++        return s_##name; }
++
++
++#endif
+--- a/khtml/misc/loader.cpp
++++ b/khtml/misc/loader.cpp
+@@ -139,7 +139,8 @@
+     // unfortunately we can be ref'ed multiple times from the
+     // same object,  because it uses e.g. the same foreground
+     // and the same background picture. so deal with it.
+-    m_clients.insert(c,c);
++    // Hence the use of a QHash rather than of a QSet.
++    m_clients.insertMulti(c,c);
+     Cache::removeFromLRUList(this);
+     m_accessCount++;
+ }
+@@ -149,11 +150,11 @@
+     assert( c );
+     assert( m_clients.count() );
+     assert( !canDelete() );
+-    assert( m_clients.find( c ) );
++    assert( m_clients.contains( c ) );
+ 
+     Cache::flush();
+ 
+-    m_clients.remove(c);
++    m_clients.take(c);
+ 
+     if (allowInLRUList())
+         Cache::insertInLRUList(this);
+@@ -282,10 +283,8 @@
+ 
+     CDEBUG << "CachedCSSStyleSheet:: finishedLoading " << m_url.string() << endl;
+ 
+-    // it() first increments, then returnes the current item.
+-    // this avoids skipping an item when setStyleSheet deletes the "current" one.
+-    for (Q3PtrDictIterator<CachedObjectClient> it( m_clients ); it.current();)
+-        it()->setStyleSheet( m_url, m_sheet, m_charset );
++    for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
++        it.next().value()->setStyleSheet( m_url, m_sheet, m_charset );
+ }
+ 
+ 
+@@ -296,10 +295,8 @@
+     m_errText = text;
+     m_loading = false;
+ 
+-    // it() first increments, then returnes the current item.
+-    // this avoids skipping an item when setStyleSheet deletes the "current" one.
+-    for (Q3PtrDictIterator<CachedObjectClient> it( m_clients ); it.current();)
+-        it()->error( m_err, m_errText );
++    for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
++        it.next().value()->error( m_err, m_errText );
+ }
+ 
+ #if 0
+@@ -370,8 +367,8 @@
+ {
+     if(m_loading) return;
+ 
+-    for (Q3PtrDictIterator<CachedObjectClient> it( m_clients); it.current();)
+-        it()->notifyFinished(this);
++    for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
++        it.next().value()->notifyFinished(this);
+ }
+ 
+ void CachedScript::error( int /*err*/, const char* /*text*/ )
+@@ -399,7 +396,7 @@
+     //pixPart = 0;
+     bg = 0;
+     scaled = 0;
+-    bgColor = qRgba( 0, 0, 0, 0xFF );
++    bgColor = qRgba( 0, 0, 0, 0 );
+     typeChecked = false;
+     isFullyTransparent = false;
+     monochrome = false;
+@@ -466,7 +463,7 @@
+ #warning "Needs some additional performance work"
+ #endif
+ 
+-    static QRgb bgTransparent = qRgba( 0, 0, 0, 0xFF );
++    static QRgb bgTransparent = qRgba( 0, 0, 0, 0 );
+ 
+     QSize s(pixmap_size());
+     int w = xWidth;
+@@ -597,14 +594,24 @@
+ 
+     int w = i->size().width();
+     int h = i->size().height();
+-    QImage im(w, h, QImage::Format_ARGB32_Premultiplied);
+ 
+-    QPainter paint(&im);
+-    paint.setCompositionMode(QPainter::CompositionMode_Source);
+-    ImagePainter pi(i);
+-    pi.paint(0, 0, &paint);
+-    paint.end();
+-    return QPixmap::fromImage( im );
++    if (i->hasAlpha()) {
++        QImage im(w, h, QImage::Format_ARGB32_Premultiplied);
++        
++        QPainter paint(&im);
++        paint.setCompositionMode(QPainter::CompositionMode_Source);
++        ImagePainter pi(i);
++        pi.paint(0, 0, &paint);
++        paint.end();
++        return QPixmap::fromImage( im );
++    } else {
++        QPixmap pm(w, h);
++        QPainter paint(&pm);
++        ImagePainter pi(i);
++        pi.paint(0, 0, &paint);
++        paint.end();
++        return pm;
++    }
+ }
+ 
+ 
+@@ -641,9 +648,9 @@
+ 
+ void CachedImage::doNotifyFinished()
+ {
+-    for (Q3PtrDictIterator<CachedObjectClient> it( m_clients); it.current();)
++    for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
+     {
+-        it()->notifyFinished(this);
++        it.next().value()->notifyFinished(this);
+     }
+ }
+ 
+@@ -671,12 +678,12 @@
+ 
+ void CachedImage::do_notify(const QRect& r)
+ {
+-    for (Q3PtrDictIterator<CachedObjectClient> it( m_clients ); it.current();)
++    for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
+     {
+ #ifdef LOADER_DEBUG
+-        kDebug(6060) << " image "<<this<<" notify of geom client " << it.current() << "\n";
++        kDebug(6060) << " image "<<this<<" notify of geom client " << it.peekNext() << "\n";
+ #endif
+-        it()->updatePixmap( r, this);
++        it.next().value()->updatePixmap( r, this);
+     }
+ }
+ 
+@@ -756,8 +763,8 @@
+                 monochrome = false;
+             }
+         }
+-        for (Q3PtrDictIterator<CachedObjectClient> it( m_clients ); it.current();)
+-            it()->notifyFinished( this );
++        for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
++            it.next().value()->notifyFinished( this );
+ 	m_status = Cached; //all done
+     }
+ 
+@@ -913,8 +920,8 @@
+             else
+                 do_notify(*p, p->rect());
+ 
+-            for (Q3PtrDictIterator<CachedObjectClient> it( m_clients ); it.current();)
+-                it()->notifyFinished( this );
++            for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
++                it.next().value()->notifyFinished( this );
+             m_status = Cached; //all done
+         }
+ #endif
+@@ -941,8 +948,8 @@
+     m_hadError = true;
+     m_loading = false;
+     do_notify(QRect(0, 0, 16, 16));
+-    for (Q3PtrDictIterator<CachedObjectClient> it( m_clients ); it.current();)
+-        it()->notifyFinished(this);
++    for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
++        it.next().value()->notifyFinished(this);
+ }
+ 
+ // -------------------------------------------------------------------------------------------
+@@ -977,8 +984,8 @@
+ {
+     if(m_loading) return;
+ 
+-    for (Q3PtrDictIterator<CachedObjectClient> it( m_clients); it.current();)
+-        it()->notifyFinished(this);
++    for (QHashIterator<CachedObjectClient*,CachedObjectClient*> it( m_clients ); it.hasNext();)
++        it.next().value()->notifyFinished(this);
+ }
+ 
+ void CachedSound::error( int /*err*/, const char* /*text*/ )
+@@ -1044,11 +1051,7 @@
+ 
+ void DocLoader::insertCachedObject( CachedObject* o ) const
+ {
+-    if ( m_docObjects.find(o) )
+-        return;
+-    m_docObjects.insert( o, o );
+-    if ( m_docObjects.count() > 3 * m_docObjects.size() )
+-        m_docObjects.resize(khtml::nextSeed( m_docObjects.size() ) );
++    m_docObjects.insert( o );
+ }
+ 
+ bool DocLoader::needReload(CachedObject *existing, const QString& fullURL)
+@@ -1143,10 +1146,12 @@
+ 
+     if ( !m_bautoloadImages ) return;
+ 
+-    for ( Q3PtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it )
+-        if ( it.current()->type() == CachedObject::Image )
++    for ( QSetIterator<CachedObject*> it( m_docObjects ); it.hasNext(); )
++    {
++        CachedObject* cur = it.next();
++        if ( cur->type() == CachedObject::Image )
+         {
+-            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current()) );
++            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>(cur) );
+ 
+             CachedObject::Status status = img->status();
+             if ( status != CachedObject::Unknown )
+@@ -1154,6 +1159,7 @@
+ 
+             Cache::loader()->load(this, img, true);
+         }
++    }
+ }
+ 
+ void DocLoader::setShowAnimations( KHTMLSettings::KAnimationAdvice showAnimations )
+@@ -1161,48 +1167,57 @@
+     if ( showAnimations == m_showAnimations ) return;
+     m_showAnimations = showAnimations;
+ 
+-    for ( Q3PtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it )
+-        if ( it.current()->type() == CachedObject::Image )
++    for ( QSetIterator<CachedObject*> it( m_docObjects ); it.hasNext(); )
++    {
++        CachedObject* cur = it.next();
++        if ( cur->type() == CachedObject::Image )
+         {
+-            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current() ) );
++            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( cur ) );
+ 
+             img->setShowAnimations( m_showAnimations );
+         }
++    }
+ }
+ 
+ void DocLoader::pauseAnimations()
+ {
+-    for ( Q3PtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it )
+-        if ( it.current()->type() == CachedObject::Image )
++    for ( QSetIterator<CachedObject*> it( m_docObjects ); it.hasNext(); )
++    {
++        CachedObject* cur = it.next();
++        if ( cur->type() == CachedObject::Image )
+         {
+-            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current() ) );
++            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( cur ) );
+ 
+             img->pauseAnimations();
+         }
++    }
+ }
+ 
+ void DocLoader::resumeAnimations()
+ {
+-    for ( Q3PtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it )
+-        if ( it.current()->type() == CachedObject::Image )
++    for ( QSetIterator<CachedObject*> it( m_docObjects ); it.hasNext(); )
++    {
++        CachedObject* cur = it.next();
++        if ( cur->type() == CachedObject::Image )
+         {
+-            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current() ) );
++            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( cur ) );
+ 
+             img->resumeAnimations();
+         }
++    }
+ }
+ 
+ // ------------------------------------------------------------------------------------------
+ 
+ Loader::Loader() : QObject()
+ {
+-    m_requestsLoading.setAutoDelete( true );
+     connect(&m_timer, SIGNAL(timeout()), this, SLOT( servePendingRequests() ) );
+ }
+ 
+ Loader::~Loader()
+ {
+     qDeleteAll(m_requestsPending);
++    qDeleteAll(m_requestsLoading);
+ }
+ 
+ void Loader::load(DocLoader* dl, CachedObject *object, bool incremental)
+@@ -1253,14 +1268,14 @@
+         if ( req->object->schedule() )
+             KIO::Scheduler::scheduleJob( job );
+ 
+-        m_requestsLoading.insert(job, req);
++        m_requestsLoading.insertMulti(job, req);
+     }
+ }
+ 
+ void Loader::slotFinished( KJob* job )
+ {
+-  Request *r = m_requestsLoading.take( job );
+   KIO::TransferJob* j = static_cast<KIO::TransferJob*>(job);
++  Request *r = m_requestsLoading.take( j );
+ 
+   if ( !r )
+     return;
+@@ -1349,9 +1364,8 @@
+         if ( req->m_docLoader == dl )
+             res++;
+ 
+-    Q3PtrDictIterator<Request> lIt( m_requestsLoading );
+-    for (; lIt.current(); ++lIt )
+-        if ( lIt.current()->m_docLoader == dl )
++    foreach( Request* req, m_requestsLoading)
++        if ( req->m_docLoader == dl )
+             res++;
+ 
+     return res;
+@@ -1373,33 +1387,30 @@
+ 
+     //kDebug( 6060 ) << "got " << m_requestsLoading.count() << "loading requests";
+ 
+-    Q3PtrDictIterator<Request> lIt( m_requestsLoading );
+-    while ( lIt.current() )
++    QMutableHashIterator<KIO::Job*,Request*> lIt( m_requestsLoading );
++    while ( lIt.hasNext() )
+     {
+-        if ( lIt.current()->m_docLoader == dl )
++        lIt.next();
++        if ( lIt.value()->m_docLoader == dl )
+         {
+             //kDebug( 6060 ) << "canceling loading request for " << lIt.current()->object->url().string();
+-            KIO::Job *job = static_cast<KIO::Job *>( lIt.currentKey() );
+-            Cache::removeCacheEntry( lIt.current()->object );
+-            m_requestsLoading.remove( lIt.currentKey() );
++            KIO::Job *job = static_cast<KIO::Job *>( lIt.key() );
++            Cache::removeCacheEntry( lIt.value()->object );
++            delete lIt.value();
++            lIt.remove();
+             job->kill();
+-            //emit requestFailed( dl, pIt.current()->object );
+         }
+-        else
+-            ++lIt;
+     }
+ }
+ 
+ KIO::Job *Loader::jobForRequest( const DOM::DOMString &url ) const
+ {
+-    Q3PtrDictIterator<Request> it( m_requestsLoading );
+-
+-    for (; it.current(); ++it )
++    QHashIterator<KIO::Job*,Request*> it( m_requestsLoading );
++    while (it.hasNext())
+     {
+-        CachedObject *obj = it.current()->object;
+-
+-        if ( obj && obj->url() == url )
+-            return static_cast<KIO::Job *>( it.currentKey() );
++        it.next();
++        if ( it.value()->object && it.value()->object->url() == url )
++            return static_cast<KIO::Job *>( it.key() );
+     }
+ 
+     return 0;
+@@ -1408,7 +1419,7 @@
+ // ----------------------------------------------------------------------------
+ 
+ 
+-Q3Dict<CachedObject> *Cache::cache;
++QHash<QString,CachedObject*> *Cache::cache;
+ QLinkedList<DocLoader*>    *Cache::docloader;
+ QLinkedList<CachedObject*> *Cache::freeList;
+ Loader *Cache::m_loader;
+@@ -1423,7 +1434,7 @@
+ void Cache::init()
+ {
+     if ( !cache )
+-        cache = new Q3Dict<CachedObject>(401, true);
++        cache = new QHash<QString,CachedObject*>();
+ 
+     if ( !docloader )
+         docloader = new QLinkedList<DocLoader*>;
+@@ -1432,7 +1443,7 @@
+         nullPixmap = new QPixmap;
+ 
+     if ( !brokenPixmap )
+-        brokenPixmap = new QPixmap(KHTMLFactory::iconLoader()->loadIcon("file-broken", KIconLoader::Desktop, 16, KIconLoader::DisabledState));
++        brokenPixmap = new QPixmap(KHTMLFactory::iconLoader()->loadIcon("image-missing", KIconLoader::Desktop, 16, KIconLoader::DisabledState));
+ 
+     if ( !blockedPixmap ) {
+         blockedPixmap = new QPixmap();
+@@ -1453,17 +1464,16 @@
+     kDebug( 6060 ) << "Cache: CLEAR!";
+     statistics();
+ #endif
+-    cache->setAutoDelete( true );
+ 
+ #ifndef NDEBUG
+     bool crash = false;
+-    for (Q3DictIterator<CachedObject> it(*cache); it.current(); ++it) {
+-        if (!it.current()->canDelete()) {
++    foreach (CachedObject* co, *cache) {
++        if (!co->canDelete()) {
+             kDebug( 6060 ) << " Object in cache still linked to";
+-            kDebug( 6060 ) << " -> URL: " << it.current()->url();
+-            kDebug( 6060 ) << " -> #clients: " << it.current()->count();
++            kDebug( 6060 ) << " -> URL: " << co->url();
++            kDebug( 6060 ) << " -> #clients: " << co->count();
+             crash = true;
+-//         assert(it.current()->canDelete());
++//         assert(co->canDelete());
+         }
+     }
+     foreach (CachedObject* co, *freeList) {
+@@ -1473,9 +1483,9 @@
+             kDebug( 6060 ) << " -> #clients: " << co->count();
+             crash = true;
+             /*
+-            QPtrDictIterator<CachedObjectClient> it(freeList->current()->m_clients);
+-            for(;it.current(); ++it) {
+-                if (dynamic_cast<RenderObject*>(it.current())) {
++            foreach (CachedObjectClient* cur, (*co->m_clients)))
++            {
++                if (dynamic_cast<RenderObject*>(cur)) {
+                     kDebug( 6060 ) << " --> RenderObject";
+                 } else
+                     kDebug( 6060 ) << " --> Something else";
+@@ -1485,7 +1495,7 @@
+     }
+     assert(!crash);
+ #endif
+-
++    qDeleteAll(*cache);
+     delete cache; cache = 0;
+     delete nullPixmap; nullPixmap = 0;
+     delete brokenPixmap; brokenPixmap = 0;
+@@ -1502,7 +1512,7 @@
+     KIO::CacheControl cachePolicy = dl->cachePolicy();
+ 
+     QString url = kurl.url();
+-    CachedObject* o = cache->find(url);
++    CachedObject* o = cache->value(url);
+ 
+     if ( o && o->type() != CachedType ) {
+         removeCacheEntry( o );
+@@ -1511,7 +1521,7 @@
+ 
+     if ( o && dl->needReload( o, url ) ) {
+         o = 0;
+-        assert( cache->find( url ) == 0 );
++        assert( !cache->contains( url ) );
+     }
+ 
+     if(!o)
+@@ -1539,9 +1549,8 @@
+ 
+ void Cache::preloadStyleSheet( const QString &url, const QString &stylesheet_data)
+ {
+-    CachedObject *o = cache->find(url);
+-    if(o)
+-        removeCacheEntry(o);
++    if (cache->contains(url))
++        removeCacheEntry(cache->value(url));
+ 
+     CachedCSSStyleSheet *stylesheet = new CachedCSSStyleSheet(url, stylesheet_data);
+     cache->insert( url, stylesheet );
+@@ -1549,9 +1558,8 @@
+ 
+ void Cache::preloadScript( const QString &url, const QString &script_data)
+ {
+-    CachedObject *o = cache->find(url);
+-    if(o)
+-        removeCacheEntry(o);
++    if (cache->contains(url))
++        removeCacheEntry(cache->value(url));
+ 
+     CachedScript *script = new CachedScript(url, script_data);
+     cache->insert( url, script );
+@@ -1589,7 +1597,6 @@
+ 
+ void Cache::statistics()
+ {
+-    CachedObject *o;
+     // this function is for debugging purposes only
+     init();
+ 
+@@ -1600,10 +1607,8 @@
+     int scripts = 0;
+     int stylesheets = 0;
+     int sound = 0;
+-    Q3DictIterator<CachedObject> it(*cache);
+-    for(it.toFirst(); it.current(); ++it)
++    foreach (CachedObject* o, *cache)
+     {
+-        o = it.current();
+         switch(o->type()) {
+         case CachedObject::Image:
+         {
+--- a/khtml/misc/loader.h
++++ b/khtml/misc/loader.h
+@@ -36,8 +36,6 @@
+ 
+ #include <stdlib.h>
+ #include <QtCore/QObject>
+-#include <Qt3Support/Q3PtrDict>
+-#include <Qt3Support/Q3Dict>
+ #include <QtGui/QPixmap>
+ #include <QtCore/QBuffer>
+ #include <QtCore/QStringList>
+@@ -161,7 +159,7 @@
+ 
+     protected:
+         void setSize(int size);
+-        Q3PtrDict<CachedObjectClient> m_clients;
++        QHash<CachedObjectClient*,CachedObjectClient*> m_clients;
+ 	DOM::DOMString m_url;
+         QString m_accept;
+         Request *m_request;
+@@ -406,7 +404,7 @@
+         friend class ::KHTMLPart;
+ 
+         QStringList m_reloadedURLs;
+-        mutable Q3PtrDict<CachedObject> m_docObjects;
++        mutable QSet<CachedObject*> m_docObjects;
+ 	time_t m_expireDate;
+ 	time_t m_creationDate;
+ 	KIO::CacheControl m_cachePolicy;
+@@ -461,7 +459,7 @@
+ 
+     protected:
+ 	QLinkedList<Request*> m_requestsPending;
+-	Q3PtrDict<Request> m_requestsLoading;
++	QHash<KIO::Job*,Request*> m_requestsLoading;
+ #ifdef HAVE_LIBJPEG
+         // TODO KJPEGFormatType m_jpegloader;
+ #endif
+@@ -534,7 +532,7 @@
+ 
+         friend class CachedObject;
+ 
+-	static Q3Dict<CachedObject> *cache;
++	static QHash<QString,CachedObject*> *cache;
+         static QLinkedList<DocLoader*>* docloader;
+         static QLinkedList<CachedObject*> *freeList;
+         static void insertInLRUList(CachedObject*);
+--- a/khtml/misc/helper.cpp
++++ b/khtml/misc/helper.cpp
+@@ -171,7 +171,7 @@
+ 	else if ( css_value == CSS_VAL_INFOTEXT )
+ 	    return QToolTip::palette().color( QPalette::Inactive, QPalette::Foreground );
+ 	else if ( css_value == CSS_VAL_BACKGROUND ) {
+-	    KConfig bckgrConfig("kdesktoprc", KConfig::CascadeConfig);
++	    KConfig bckgrConfig("kdesktoprc", KConfig::NoGlobals);
+ 	    // Desktop background.
+ 	    return bckgrConfig.group( "Desktop0" ).readEntry("Color1", qApp->palette().color( QPalette::Disabled, QPalette::Background ) );
+ 	}
+--- a/khtml/khtml_part.h
++++ b/khtml/khtml_part.h
+@@ -402,17 +402,6 @@
+   bool javaEnabled() const;
+ 
+   /**
+-   * Returns the java context of the applets. If no applet exists, 0 is returned.
+-   */
+-  KJavaAppletContext *javaContext();
+-
+-  /**
+-   * Returns the java context of the applets. If no context exists yet, a
+-   * new one is created.
+-   */
+-  KJavaAppletContext *createJavaContext();
+-
+-  /**
+    * Enables or disables plugins, default is enabled
+    */
+   void setPluginsEnabled( bool enable );
+@@ -1045,6 +1034,8 @@
+ 
+   /**
+    * Emitted when the user clicks the right mouse button on the document.
++   * See KParts::BrowserExtension for two more popupMenu signals emitted by khtml,
++   * with much more information in the signal.
+    */
+   void popupMenu( const QString &url, const QPoint &point );
+ 
+@@ -1547,6 +1538,7 @@
+   bool restoreURL( const KUrl &url );
+   void resetFromScript();
+   void emitSelectionChanged();
++  void onFirstData(const QString& firstData);
+   // Returns whether callingHtmlPart may access this part
+   bool checkFrameAccess(KHTMLPart *callingHtmlPart);
+   bool openUrlInFrame(const KUrl &url, const KParts::OpenUrlArguments& arguments, const KParts::BrowserArguments &browserArguments);
+--- a/khtml/khtmlview.h
++++ b/khtml/khtmlview.h
+@@ -34,6 +34,7 @@
+ class QPainter;
+ class QRect;
+ template< typename T > class QVector;
++template <class T> class QStack;
+ 
+ namespace DOM {
+     class HTMLDocumentImpl;
+@@ -59,6 +60,7 @@
+         class RenderLineEdit;
+     class RenderPartObject;
+     class RenderWidget;
++    class RenderLayer;
+     class CSSStyleSelector;
+     class LineEditWidget;
+     class CaretBox;
+@@ -103,6 +105,7 @@
+     friend class khtml::RenderLineEdit;
+     friend class khtml::RenderPartObject;
+     friend class khtml::RenderWidget;
++    friend class khtml::RenderLayer;
+     friend class khtml::CSSStyleSelector;
+     friend class khtml::LineEditWidget;
+     friend class KJS::WindowFunc;
+@@ -364,6 +367,9 @@
+ 
+     void setMouseEventsTarget( QWidget* w );
+     QWidget* mouseEventsTarget() const;
++    
++    QStack<QRegion>* clipHolder() const;
++    void setClipHolder( QStack<QRegion>* ch );
+ 
+     /**
+      * Paints the HTML document to a QPainter.
+--- a/khtml/khtmlimage.cpp
++++ b/khtml/khtmlimage.cpp
+@@ -98,8 +98,8 @@
+     connect(m_khtml->browserExtension(), SIGNAL(openUrlRequestDelayed(const KUrl &, const KParts::OpenUrlArguments&, const KParts::BrowserArguments &)),
+     		be, SIGNAL(openUrlRequestDelayed(const KUrl &, const KParts::OpenUrlArguments&, const KParts::BrowserArguments &)));
+ 
+-    connect( m_khtml->browserExtension(), SIGNAL( popupMenu(KXMLGUIClient *, const QPoint &, const KUrl &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, KParts::BrowserExtension::PopupFlags, mode_t) ),
+-             m_ext, SIGNAL( popupMenu(KXMLGUIClient *, const QPoint &, const KUrl &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, KParts::BrowserExtension::PopupFlags, mode_t) ) );
++    connect(m_khtml->browserExtension(), SIGNAL(popupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)),
++	    m_ext, SIGNAL(popupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)));
+ 
+     connect( m_khtml->browserExtension(), SIGNAL( enableAction( const char *, bool ) ),
+              m_ext, SIGNAL( enableAction( const char *, bool ) ) );
+--- a/khtml/khtmlpart_p.h
++++ b/khtml/khtmlpart_p.h
+@@ -166,9 +166,6 @@
+     m_jsedlg = 0;
+     m_formNotification = KHTMLPart::NoNotification;
+ 
+-#ifndef Q_WS_QWS
+-    m_javaContext = 0;
+-#endif
+     m_cacheId = 0;
+     m_frameNameId = 1;
+ 
+@@ -297,10 +294,6 @@
+   bool m_urlSelectedOpenedURL; // KDE4: remove
+   int m_frameNameId;
+ 
+-#ifndef Q_WS_QWS
+-  KJavaAppletContext *m_javaContext;
+-#endif
+-
+   KHTMLSettings *m_settings;
+ 
+   KIO::TransferJob * m_job;
+--- a/khtml/khtml_ext.cpp
++++ b/khtml/khtml_ext.cpp
+@@ -959,8 +959,8 @@
+           bool downloadViaKIO = true;
+           if ( !url.isLocalFile() )
+           {
+-            KConfigGroup cfg = KSharedConfig::openConfig("konquerorrc", KConfig::CascadeConfig)->group("HTML Settings");
+-            QString downloadManger = cfg.readPathEntry("DownloadManager");
++            KConfigGroup cfg = KSharedConfig::openConfig("konquerorrc", KConfig::NoGlobals)->group("HTML Settings");
++            QString downloadManger = cfg.readPathEntry("DownloadManager", QString());
+             if (!downloadManger.isEmpty())
+             {
+                 // then find the download manager location
+--- a/khtml/test_regression_fontoverload.cpp
++++ b/khtml/test_regression_fontoverload.cpp
+@@ -180,21 +180,35 @@
+     QtFontDim m_ascent, m_descent, m_leading;
+     bool  ahem;
+     int   pixS;
+-#if 0
+-    virtual glyph_metrics_t boundingBox( const glyph_t *glyphs,
+-                                         const advance_t *advances, const qoffset_t *offsets, int numGlyphs );
+-    glyph_metrics_t boundingBox( glyph_t glyph );
+-
+-    QFontEngine::Error stringToCMap( const QChar *, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool ) const;
+-
+-    int ascent() const;
+-    int descent() const;
+-    int leading() const;
+-    int maxCharWidth() const;
+-    int minLeftBearing() const { return 0; }
+-    int minRightBearing() const { return 0; }
+-    int cmap() const;
+-#endif
++    XFontStruct* xfs;
++
++    bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
++    {
++        bool res = QFontEngineXLFD::stringToCMap(str, len, glyphs, nglyphs, flags);
++        if (!res)
++            return false;
++
++        // Go through the glyhs with glyph 0 and fix up their x advance
++        // to make sense (or at least match Qt3)
++        // ### set proper GPLv2 and Qt (c) when committed
++        QtFontDim fallBackWidth = xfs->min_bounds.width;
++        if (xfs->per_char) {
++            if (haveMetrics)
++                fallBackWidth = m_ascent; //### we really should get rid of these and regen..
++            else
++                fallBackWidth = xfs->ascent;
++        }
++
++        QGlyphLayout* g = glyphs + len;
++        while (g != glyphs) {
++            --g;
++            if (!g->glyph) {
++                g->advance.x = fallBackWidth;
++            }
++        }
++
++        return true;
++    }
+ 
+     Type type() const
+     {
+@@ -293,6 +307,7 @@
+ QFakeFontEngine::QFakeFontEngine( XFontStruct *fs, const char *name, int size )
+     : QFontEngineXLFD( fs,  name,  0)
+ {
++    xfs = fs;
+     pixS = size;
+     this->name = QLatin1String(name);
+     ahem = this->name.contains("ahem");
+@@ -312,69 +327,7 @@
+ QFakeFontEngine::~QFakeFontEngine()
+ {
+ }
+-#if 0
+-QFontEngine::Error QFakeFontEngine::stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored) const
+-{
+-    QFontEngine::Error ret = QFontEngineXLFD::stringToCMap( str, len, glyphs, advances, nglyphs, mirrored );
+-
+-    if ( ret != NoError )
+-        return ret;
+-
+-    *nglyphs = len;
+-
+-    if ( advances ) {
+-        for ( int i = 0; i < len; i++ )
+-            *(advances++) = _size;
+-    }
+-    return NoError;
+-}
+-
+-glyph_metrics_t QFakeFontEngine::boundingBox( const glyph_t *, const advance_t *, const qoffset_t *, int numGlyphs )
+-{
+-    glyph_metrics_t overall;
+-    overall.x = overall.y = 0;
+-    overall.width = _size*numGlyphs;
+-    overall.height = _size;
+-    overall.xoff = overall.width;
+-    overall.yoff = 0;
+-    return overall;
+-}
+-
+-glyph_metrics_t QFakeFontEngine::boundingBox( glyph_t )
+-{
+-    return glyph_metrics_t( 0, _size, _size, _size, _size, 0 );
+-}
+-
+-int QFakeFontEngine::ascent() const
+-{
+-    return _size;
+-}
+-
+-int QFakeFontEngine::descent() const
+-{
+-    return 0;
+-}
+-
+-int QFakeFontEngine::leading() const
+-{
+-    // the original uses double and creates quite random results depending
+-    // on the compiler flags
+-    int l = ( _size * 15 + 50) / 100;
+-    // only valid on i386 without -O2 assert(l == int(qRound(_size * 0.15)));
+-    return (l > 0) ? l : 1;
+-}
+-
+-int QFakeFontEngine::maxCharWidth() const
+-{
+-    return _size;
+-}
+-
+-int QFakeFontEngine::cmap() const
+-{
+-    return -1;
+-}
+ 
+-#endif
+ 
+ bool QFakeFontEngine::canRender( const QChar *, int )
+ {
+@@ -449,9 +402,6 @@
+     return fe;
+ }
+ 
+-#if QT_VERSION >= 0x040100 
+-/* Note: you may want the other path with earlier Qt4.1 snapshots */
+-
+ KDE_EXPORT
+ QFontEngine *QFontDatabase::loadXlfd(int /* screen */, int /* script */, 
+             const QFontDef &request, int /* force_encoding_id */)
+@@ -464,21 +414,6 @@
+     return 0;
+ }
+ 
+-#else
+-
+-
+-KDE_EXPORT
+-QFontEngine *
+-QFontDatabase::findFont( int script, const QFontPrivate *fp,
+-			 const QFontDef &request, int ) {
+-    QFontEngine* fe = loadFont(request);
+-    QFontCache::Key key( request, script, fp->screen );
+-    QFontCache::instance->insertEngine( key, fe );
+-    return fe;
+-}
+-
+-#endif
+-
+ KDE_EXPORT bool QFontDatabase::isBitmapScalable( const QString &,
+ 				      const QString &) const
+ {
+--- a/khtml/khtml_part.cpp
++++ b/khtml/khtml_part.cpp
+@@ -1103,7 +1103,7 @@
+     d->m_jsedlg = new KJSErrorDlg;
+     d->m_jsedlg->setURL(url().prettyUrl());
+     if (KGlobalSettings::showIconsOnPushButtons()) {
+-      d->m_jsedlg->_clear->setIcon(KIcon("locationbar-erase"));
++      d->m_jsedlg->_clear->setIcon(KIcon("edit-clear-locationbar"));
+       d->m_jsedlg->_close->setIcon(KIcon("window-close"));
+     }
+   }
+@@ -1136,8 +1136,8 @@
+ 
+ void KHTMLPart::jsErrorDialogContextMenu() {
+   KMenu *m = new KMenu(0L);
+-  m->insertItem(i18n("&Hide Errors"), this, SLOT(removeJSErrorExtension()));
+-  m->insertItem(i18n("&Disable Error Reporting"), this, SLOT(disableJSErrorExtension()));
++  m->addAction(i18n("&Hide Errors"), this, SLOT(removeJSErrorExtension()));
++  m->addAction(i18n("&Disable Error Reporting"), this, SLOT(disableJSErrorExtension()));
+   m->popup(QCursor::pos());
+ }
+ 
+@@ -1152,7 +1152,7 @@
+ void KHTMLPart::launchJSConfigDialog() {
+   QStringList args;
+   args << "khtml_java_js";
+-  KToolInvocation::kdeinitExec( "kcmshell", args );
++  KToolInvocation::kdeinitExec( "kcmshell4", args );
+ }
+ 
+ QVariant KHTMLPart::executeScript(const QString& filename, int baseLine, const DOM::Node& n, const QString& script)
+@@ -1283,16 +1283,6 @@
+ #endif
+ }
+ 
+-KJavaAppletContext *KHTMLPart::javaContext()
+-{
+-  return 0;
+-}
+-
+-KJavaAppletContext *KHTMLPart::createJavaContext()
+-{
+-  return 0;
+-}
+-
+ void KHTMLPart::setPluginsEnabled( bool enable )
+ {
+   d->m_bPluginsForce = enable;
+@@ -1914,6 +1904,7 @@
+ 
+   d->m_doc->ref();
+   d->m_doc->setURL( this->url().url() );
++  d->m_doc->open( );
+   if (!d->m_doc->attached())
+     d->m_doc->attach( );
+   d->m_doc->setBaseURL( KUrl() );
+@@ -1929,7 +1920,6 @@
+     setUserStyleSheet( KUrl( userStyleSheet ) );
+ 
+   d->m_doc->setRestoreState(d->m_extension->browserArguments().docState);
+-  d->m_doc->open();
+   connect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing()));
+ 
+   emit d->m_extension->enableAction( "print", true );
+@@ -1954,19 +1944,7 @@
+       return;
+ 
+   if(d->m_bFirstData)
+-  {
+-      // determine the parse mode
+-      d->m_doc->determineParseMode( decoded );
+-      d->m_bFirstData = false;
+-
+-  //kDebug(6050) << "KHTMLPart::write haveEnc = " << d->m_haveEncoding;
+-      // ### this is still quite hacky, but should work a lot better than the old solution
+-      if(d->m_decoder->visuallyOrdered()) d->m_doc->setVisuallyOrdered();
+-#if 0
+-      d->m_doc->setDecoderCodec(d->m_decoder->codec());
+-#endif
+-      d->m_doc->recalcStyle( NodeImpl::Force );
+-  }
++      onFirstData( decoded );
+ 
+   khtml::Tokenizer* t = d->m_doc->tokenizer();
+   if(t)
+@@ -1995,10 +1973,7 @@
+         {
+             QString decoded=d->m_decoder->flush();
+             if (d->m_bFirstData)
+-            {
+-                d->m_bFirstData = false;
+-                d->m_doc->determineParseMode(decoded);
+-            }
++                onFirstData( decoded );
+             if (!decoded.isEmpty())
+                 write(decoded);
+         }
+@@ -2006,6 +1981,20 @@
+     }
+ }
+ 
++void KHTMLPart::onFirstData( const QString& firstData )
++{
++      assert( d->m_bFirstData );
++
++      // determine the parse mode
++      d->m_doc->determineParseMode( firstData );
++      d->m_bFirstData = false;
++
++      // ### this is still quite hacky, but should work a lot better than the old solution
++      if (d->m_decoder->visuallyOrdered())
++          d->m_doc->setVisuallyOrdered();
++      d->m_doc->recalcStyle( NodeImpl::Force );
++}
++
+ bool KHTMLPart::doOpenStream( const QString& mimeType )
+ {
+     KMimeType::Ptr mime = KMimeType::mimeType(mimeType);
+@@ -4018,7 +4007,8 @@
+ {
+   Ui_KHTMLInfoDlg ui;
+ 
+-  QDialog *dlg = new QDialog(0, Qt::WDestructiveClose);
++  QDialog *dlg = new QDialog(0);
++  dlg->setAttribute(Qt::WA_DeleteOnClose);
+   dlg->setObjectName("KHTML Page Info Dialog");
+   ui.setupUi(dlg);
+ 
+@@ -4065,7 +4055,9 @@
+     const QStringList header = (*it).split(QRegExp(":[ ]+"));
+     if (header.count() != 2)
+        continue;
+-    new Q3ListViewItem(ui._headers, header[0], header[1]);
++    QTreeWidgetItem *item = new QTreeWidgetItem(ui._headers);
++    item->setText(0, header[0]);
++    item->setText(1, header[1]);
+   }
+ 
+   dlg->show();
+@@ -4439,7 +4431,7 @@
+           emit d->m_extension->openUrlNotify();
+   }
+ 
+-  if ( child->m_serviceType != mimetype || !child->m_part )
++  if ( child->m_serviceType != mimetype || !child->m_part || (child->m_run && child->m_run->serverSuggestsSave()))
+   {
+     // Before attempting to load a part, check if the user wants that.
+     // Many don't like getting ZIP files embedded.
+@@ -4447,11 +4439,14 @@
+     if ( child->m_type != khtml::ChildFrame::Object )
+     {
+       QString suggestedFileName;
+-      if ( child->m_run )
++      int disposition = 0;
++      if ( child->m_run ) {
+         suggestedFileName = child->m_run->suggestedFileName();
++        disposition = (child->m_run->serverSuggestsSave()) ? KParts::BrowserRun::AttachmentDisposition : KParts::BrowserRun::InlineDisposition;
++      }
+ 
+       KParts::BrowserRun::AskSaveResult res = KParts::BrowserRun::askEmbedOrSave(
+-        url, mimetype, suggestedFileName  );
++        url, mimetype, suggestedFileName, disposition );
+       switch( res ) {
+       case KParts::BrowserRun::Save:
+         KHTMLPopupGUIClient::saveURL( widget(), i18n( "Save As" ), url, child->m_args.metaData(), QString(), 0, suggestedFileName );
+@@ -4661,7 +4656,7 @@
+   {
+     KService::Ptr service = (*it);
+ 
+-    KLibFactory* const factory = KLibLoader::self()->factory( QFile::encodeName(service->library()) );
++    KLibFactory* const factory = KLibLoader::self()->factory( service->library() );
+     if ( factory ) {
+       KParts::ReadOnlyPart *res = 0L;
+ 
+@@ -5137,7 +5132,7 @@
+   if ( child && child->m_type != khtml::ChildFrame::Object ) {
+       // Inform someone that we are about to show something else.
+       child->m_bNotify = true;
+-      requestObject( child, url, args );
++      requestObject( child, url, args, browserArgs );
+   }  else if ( frameName== "_self" ) // this is for embedded objects (via <object>) which want to replace the current document
+   {
+       KParts::BrowserArguments newBrowserArgs( browserArgs );
+@@ -5332,7 +5327,7 @@
+      if (childPart == this)
+         return childFrame;
+ 
+-     childPart->requestObject( childFrame, url, args );
++     childPart->requestObject( childFrame, url, args, browserArgs );
+      return 0;
+   }
+ 
+@@ -5341,7 +5336,7 @@
+      khtml::ChildFrame *res = parentPart()->recursiveFrameRequest( callingHtmlPart, url, args, browserArgs, callParent );
+ 
+      if ( res )
+-       parentPart()->requestObject( res, url, args );
++       parentPart()->requestObject( res, url, args, browserArgs );
+   }
+ 
+   return 0L;
+@@ -6733,15 +6728,18 @@
+     if ( !d->m_doc )
+         return;
+ 
+-    Q3PtrDictIterator<khtml::CachedObject> it( d->m_doc->docLoader()->m_docObjects );
+-    for ( ; it.current(); ++it )
+-        if ( it.current()->type() == khtml::CachedObject::Image ) {
+-            khtml::CachedImage *image = static_cast<khtml::CachedImage *>(it.current());
++    QSetIterator<khtml::CachedObject*> it( d->m_doc->docLoader()->m_docObjects );
++    while (it.hasNext())
++    {
++        khtml::CachedObject* obj = it.next();
++        if ( obj->type() == khtml::CachedObject::Image ) {
++            khtml::CachedImage *image = static_cast<khtml::CachedImage *>(obj);
+             bool wasBlocked = image->m_wasBlocked;
+-            image->m_wasBlocked = KHTMLFactory::defaultHTMLSettings()->isAdFiltered( d->m_doc->completeURL( (*it).url().string() ) );
++            image->m_wasBlocked = KHTMLFactory::defaultHTMLSettings()->isAdFiltered( d->m_doc->completeURL( image->url().string() ) );
+             if ( image->m_wasBlocked != wasBlocked )
+                 image->do_notify(QRect(QPoint(0,0), image->pixmap_size()));
+         }
++    }
+ 
+     if ( KHTMLFactory::defaultHTMLSettings()->isHideAdsEnabled() ) {
+         for ( NodeImpl *nextNode, *node = d->m_doc; node; node = nextNode ) {
+@@ -7266,7 +7264,7 @@
+ {
+ #ifndef KHTML_NO_WALLET
+   KMenu *m = new KMenu(0L);
+-  m->insertItem(i18n("&Close Wallet"), this, SLOT(slotWalletClosed()));
++  m->addAction(i18n("&Close Wallet"), this, SLOT(slotWalletClosed()));
+   m->popup(QCursor::pos());
+ #endif // KHTML_NO_WALLET
+ }
+@@ -7366,10 +7364,10 @@
+ void KHTMLPart::suppressedPopupMenu() {
+   KMenu *m = new KMenu(0L);
+   if ( d->m_openableSuppressedPopups )
+-      m->insertItem(i18np("&Show Blocked Popup Window","Show %1 Blocked Popup Windows", d->m_openableSuppressedPopups), this, SLOT(showSuppressedPopups()));
+-  m->insertItem(i18n("Show Blocked Window Passive Popup &Notification"), this, SLOT(togglePopupPassivePopup()),0,57);
+-  m->setItemChecked(57,d->m_settings->jsPopupBlockerPassivePopup());
+-  m->insertItem(i18n("&Configure JavaScript New Window Policies..."), this, SLOT(launchJSConfigDialog()));
++      m->addAction(i18np("&Show Blocked Popup Window","Show %1 Blocked Popup Windows", d->m_openableSuppressedPopups), this, SLOT(showSuppressedPopups()));
++  QAction *a = m->addAction(i18n("Show Blocked Window Passive Popup &Notification"), this, SLOT(togglePopupPassivePopup()));
++  a->setChecked(d->m_settings->jsPopupBlockerPassivePopup());
++  m->addAction(i18n("&Configure JavaScript New Window Policies..."), this, SLOT(launchJSConfigDialog()));
+   m->popup(QCursor::pos());
+ }
+ 
+--- /dev/null
++++ b/khtml/kcookiejar_interface.h
+@@ -0,0 +1,149 @@
++/*
++ * This file was generated by dbusxml2cpp version 0.6
++ * Command line was: dbusxml2cpp -i kcookiejar_include.h -m -p kcookiejar_interface ../kioslave/http/kcookiejar/org.kde.KCookieServer.xml
++ *
++ * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved.
++ *
++ * This is an auto-generated file.
++ * Do not edit! All changes made to it will be lost.
++ */
++
++#ifndef KCOOKIEJAR_INTERFACE_H_1193243623
++#define KCOOKIEJAR_INTERFACE_H_1193243623
++
++#include <QtCore/QObject>
++#include <QtCore/QByteArray>
++#include <QtCore/QList>
++#include <QtCore/QMap>
++#include <QtCore/QString>
++#include <QtCore/QStringList>
++#include <QtCore/QVariant>
++#include <QtDBus/QtDBus>
++#include "kcookiejar_include.h"
++
++/*
++ * Proxy class for interface org.kde.KCookieServer
++ */
++class OrgKdeKCookieServerInterface: public QDBusAbstractInterface
++{
++    Q_OBJECT
++public:
++    static inline const char *staticInterfaceName()
++    { return "org.kde.KCookieServer"; }
++
++public:
++    OrgKdeKCookieServerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
++
++    ~OrgKdeKCookieServerInterface();
++
++public Q_SLOTS: // METHODS
++    inline QDBusReply<void> addCookies(const QString &url, const QByteArray &cookieHeader, qlonglong windowId)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(url) << qVariantFromValue(cookieHeader) << qVariantFromValue(windowId);
++        return callWithArgumentList(QDBus::Block, QLatin1String("addCookies"), argumentList);
++    }
++
++    inline QDBusReply<void> addDOMCookies(const QString &url, const QByteArray &cookieHeader, qlonglong windowId)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(url) << qVariantFromValue(cookieHeader) << qVariantFromValue(windowId);
++        return callWithArgumentList(QDBus::Block, QLatin1String("addDOMCookies"), argumentList);
++    }
++
++    inline QDBusReply<void> deleteAllCookies()
++    {
++        QList<QVariant> argumentList;
++        return callWithArgumentList(QDBus::Block, QLatin1String("deleteAllCookies"), argumentList);
++    }
++
++    inline QDBusReply<void> deleteCookie(const QString &domain, const QString &fqdn, const QString &path, const QString &name)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(domain) << qVariantFromValue(fqdn) << qVariantFromValue(path) << qVariantFromValue(name);
++        return callWithArgumentList(QDBus::Block, QLatin1String("deleteCookie"), argumentList);
++    }
++
++    inline QDBusReply<void> deleteCookiesFromDomain(const QString &domain)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(domain);
++        return callWithArgumentList(QDBus::Block, QLatin1String("deleteCookiesFromDomain"), argumentList);
++    }
++
++    inline QDBusReply<void> deleteSessionCookies(qlonglong windowId)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(windowId);
++        return callWithArgumentList(QDBus::Block, QLatin1String("deleteSessionCookies"), argumentList);
++    }
++
++    inline QDBusReply<void> deleteSessionCookiesFor(const QString &fqdn, qlonglong windowId)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(fqdn) << qVariantFromValue(windowId);
++        return callWithArgumentList(QDBus::Block, QLatin1String("deleteSessionCookiesFor"), argumentList);
++    }
++
++    inline QDBusReply<QStringList> findCookies(const QList<int> &fields, const QString &domain, const QString &fqdn, const QString &path, const QString &name)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(fields) << qVariantFromValue(domain) << qVariantFromValue(fqdn) << qVariantFromValue(path) << qVariantFromValue(name);
++        return callWithArgumentList(QDBus::Block, QLatin1String("findCookies"), argumentList);
++    }
++
++    inline QDBusReply<QString> findCookies(const QString &url, qlonglong windowId)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(url) << qVariantFromValue(windowId);
++        return callWithArgumentList(QDBus::Block, QLatin1String("findCookies"), argumentList);
++    }
++
++    inline QDBusReply<QString> findDOMCookies(const QString &url, qlonglong windowId)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(url) << qVariantFromValue(windowId);
++        return callWithArgumentList(QDBus::Block, QLatin1String("findDOMCookies"), argumentList);
++    }
++
++    inline QDBusReply<QStringList> findDomains()
++    {
++        QList<QVariant> argumentList;
++        return callWithArgumentList(QDBus::Block, QLatin1String("findDomains"), argumentList);
++    }
++
++    inline QDBusReply<QString> getDomainAdvice(const QString &url)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(url);
++        return callWithArgumentList(QDBus::Block, QLatin1String("getDomainAdvice"), argumentList);
++    }
++
++    inline QDBusReply<void> reloadPolicy()
++    {
++        QList<QVariant> argumentList;
++        return callWithArgumentList(QDBus::Block, QLatin1String("reloadPolicy"), argumentList);
++    }
++
++    inline QDBusReply<void> setDomainAdvice(const QString &url, const QString &advice)
++    {
++        QList<QVariant> argumentList;
++        argumentList << qVariantFromValue(url) << qVariantFromValue(advice);
++        return callWithArgumentList(QDBus::Block, QLatin1String("setDomainAdvice"), argumentList);
++    }
++
++    inline QDBusReply<void> shutdown()
++    {
++        QList<QVariant> argumentList;
++        return callWithArgumentList(QDBus::Block, QLatin1String("shutdown"), argumentList);
++    }
++
++Q_SIGNALS: // SIGNALS
++};
++
++namespace org {
++  namespace kde {
++    typedef ::OrgKdeKCookieServerInterface KCookieServer;
++  }
++}
++#endif
+--- a/khtml/khtml.desktop
++++ b/khtml/khtml.desktop
+@@ -51,8 +51,8 @@
+ Comment[ru]=Встраиваемый компонент просмотра HTML
+ Comment[se]=Vuojuhanláhkái HTML-čájehanoassi
+ Comment[sl]=Integrirani pregled besedila HTML
+-Comment[sr]=Уградива компонента за преглед HTML-а
+-Comment[sr at latin]=Ugradiva komponenta za pregled HTML-a
++Comment[sr]=Угњездива компонента за приказ ХТМЛ-а
++Comment[sr at latin]=Ugnjezdiva komponenta za prikaz HTML-a
+ Comment[sv]=Inbäddningsbar HTML-visande komponent
+ Comment[ta]=உட்பொதிக்கவல்ல HTML காட்சிக் கூறு
+ Comment[te]=పొదగదగ్గ HTML విక్షణాంశం
+@@ -72,6 +72,8 @@
+ Icon=konqueror
+ Name=KHTML
+ Name[kn]=ಕೆಹೆಚ್ ಟಿ ಎಮ್ ಎಲ್
++Name[sr]=КХТМЛ
++Name[sr at latin]=KTHML
+ Name[te]=కెహెచ్ టి ఎమ్ ఎల్
+ Name[x-test]=xxKHTMLxx
+ ServiceTypes=KParts/ReadOnlyPart,Browser/View
+--- a/khtml/htmlpageinfo.ui
++++ b/khtml/htmlpageinfo.ui
+@@ -1,7 +1,6 @@
+ <ui version="4.0" >
+  <author>George Staikos &lt;staikos at kde.org></author>
+  <comment>A dialog to display the HTTP headers for a given page.</comment>
+- <exportmacro></exportmacro>
+  <class>KHTMLInfoDlg</class>
+  <widget class="QDialog" name="KHTMLInfoDlg" >
+   <property name="geometry" >
+@@ -13,9 +12,7 @@
+    </rect>
+   </property>
+   <property name="sizePolicy" >
+-   <sizepolicy>
+-    <hsizetype>7</hsizetype>
+-    <vsizetype>5</vsizetype>
++   <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+@@ -24,41 +21,69 @@
+    <string>Document Information</string>
+   </property>
+   <layout class="QGridLayout" >
+-   <property name="margin" >
++   <property name="leftMargin" >
+     <number>11</number>
+    </property>
+-   <property name="spacing" >
++   <property name="topMargin" >
++    <number>11</number>
++   </property>
++   <property name="rightMargin" >
++    <number>11</number>
++   </property>
++   <property name="bottomMargin" >
++    <number>11</number>
++   </property>
++   <property name="horizontalSpacing" >
++    <number>6</number>
++   </property>
++   <property name="verticalSpacing" >
+     <number>6</number>
+    </property>
+    <item row="0" column="0" colspan="2" >
+-    <widget class="Q3GroupBox" name="groupBox2" >
++    <widget class="QGroupBox" name="groupBox2" >
+      <property name="title" >
+       <string>General</string>
+      </property>
+-     <property name="orientation" >
+-      <enum>Qt::Vertical</enum>
+-     </property>
+      <layout class="QHBoxLayout" >
+-      <property name="margin" >
+-       <number>11</number>
+-      </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
++      <property name="leftMargin" >
++       <number>11</number>
++      </property>
++      <property name="topMargin" >
++       <number>11</number>
++      </property>
++      <property name="rightMargin" >
++       <number>11</number>
++      </property>
++      <property name="bottomMargin" >
++       <number>11</number>
++      </property>
+       <item>
+        <layout class="QGridLayout" >
+-        <property name="margin" >
++        <property name="leftMargin" >
++         <number>0</number>
++        </property>
++        <property name="topMargin" >
++         <number>0</number>
++        </property>
++        <property name="rightMargin" >
+          <number>0</number>
+         </property>
+-        <property name="spacing" >
++        <property name="bottomMargin" >
++         <number>0</number>
++        </property>
++        <property name="horizontalSpacing" >
++         <number>6</number>
++        </property>
++        <property name="verticalSpacing" >
+          <number>6</number>
+         </property>
+         <item row="1" column="0" >
+          <widget class="QLabel" name="urlLabel" >
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>0</hsizetype>
+-            <vsizetype>0</vsizetype>
++           <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -74,9 +99,7 @@
+         <item row="0" column="1" >
+          <widget class="QLabel" name="_title" >
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>7</hsizetype>
+-            <vsizetype>5</vsizetype>
++           <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+             <horstretch>1</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -85,13 +108,8 @@
+         </item>
+         <item row="1" column="1" >
+          <widget class="QLabel" name="_url" >
+-          <property name="openExternalLinks" >
+-           <bool>true</bool>
+-          </property>
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>7</hsizetype>
+-            <vsizetype>5</vsizetype>
++           <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+             <horstretch>1</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -101,9 +119,7 @@
+         <item row="2" column="1" >
+          <widget class="QLabel" name="_lastModified" >
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>7</hsizetype>
+-            <vsizetype>5</vsizetype>
++           <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+             <horstretch>1</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -113,9 +129,7 @@
+         <item row="0" column="0" >
+          <widget class="QLabel" name="titleLabel" >
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>0</hsizetype>
+-            <vsizetype>0</vsizetype>
++           <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -131,9 +145,7 @@
+         <item row="2" column="0" >
+          <widget class="QLabel" name="_lmLabel" >
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>0</hsizetype>
+-            <vsizetype>0</vsizetype>
++           <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -149,9 +161,7 @@
+         <item row="3" column="0" >
+          <widget class="QLabel" name="_eLabel" >
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>0</hsizetype>
+-            <vsizetype>0</vsizetype>
++           <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -167,9 +177,7 @@
+         <item row="3" column="1" >
+          <widget class="QLabel" name="_encoding" >
+           <property name="sizePolicy" >
+-           <sizepolicy>
+-            <hsizetype>7</hsizetype>
+-            <vsizetype>5</vsizetype>
++           <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+             <horstretch>1</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+@@ -182,35 +190,42 @@
+     </widget>
+    </item>
+    <item row="1" column="0" colspan="2" >
+-    <widget class="Q3GroupBox" name="groupBox1" >
++    <widget class="QGroupBox" name="groupBox1" >
+      <property name="title" >
+       <string>HTTP Headers</string>
+      </property>
+-     <property name="orientation" >
+-      <enum>Qt::Vertical</enum>
+-     </property>
+      <layout class="QVBoxLayout" >
+-      <property name="margin" >
+-       <number>11</number>
+-      </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
++      <property name="leftMargin" >
++       <number>11</number>
++      </property>
++      <property name="topMargin" >
++       <number>11</number>
++      </property>
++      <property name="rightMargin" >
++       <number>11</number>
++      </property>
++      <property name="bottomMargin" >
++       <number>11</number>
++      </property>
+       <item>
+-       <widget class="Q3ListView" name="_headers" >
++       <widget class="QTreeWidget" name="_headers" >
+         <property name="sizePolicy" >
+-         <sizepolicy>
+-          <hsizetype>7</hsizetype>
+-          <vsizetype>7</vsizetype>
++         <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+           <horstretch>1</horstretch>
+           <verstretch>1</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="selectionMode" >
+-         <enum>Q3ListView::NoSelection</enum>
++         <enum>QAbstractItemView::NoSelection</enum>
++        </property>
++        <property name="rootIsDecorated" >
++         <bool>false</bool>
+         </property>
+-        <property name="resizeMode" >
+-         <enum>Q3ListView::LastColumn</enum>
++        <property name="allColumnsShowFocus" >
++         <bool>true</bool>
+         </property>
+         <column>
+          <property name="text" >
+@@ -228,11 +243,9 @@
+     </widget>
+    </item>
+    <item row="2" column="1" >
+-    <widget class="KPushButton" name="_close" >
++    <widget class="KPushButton" native="1" name="_close" >
+      <property name="sizePolicy" >
+-      <sizepolicy>
+-       <hsizetype>0</hsizetype>
+-       <vsizetype>5</vsizetype>
++      <sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+@@ -262,25 +275,10 @@
+  <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+  <customwidgets>
+   <customwidget>
+-   <class>Q3GroupBox</class>
+-   <extends></extends>
+-   <header>Qt3Support/Q3GroupBox</header>
+-   <container>1</container>
+-   <pixmap></pixmap>
+-  </customwidget>
+-  <customwidget>
+-   <class>Q3ListView</class>
+-   <extends></extends>
+-   <header>q3listview.h</header>
+-   <container>0</container>
+-   <pixmap></pixmap>
+-  </customwidget>
+-  <customwidget>
+    <class>KPushButton</class>
+    <extends>QWidget</extends>
+    <header>kpushbutton.h</header>
+    <container>1</container>
+-   <pixmap></pixmap>
+   </customwidget>
+  </customwidgets>
+  <tabstops>
+@@ -290,8 +288,6 @@
+  </tabstops>
+  <includes>
+   <include location="global" >kpushbutton.h</include>
+-  <include location="global" >qlabel.h</include>
+-  <include location="global" >q3listview.h</include>
+  </includes>
+  <resources/>
+  <connections/>
+--- a/khtml/khtmlimage.desktop
++++ b/khtml/khtmlimage.desktop
+@@ -51,8 +51,8 @@
+ Comment[ru]=Встраиваемый модуль просмотра изображений
+ Comment[se]=Vuojuhanláhkái govvačájehanoassi
+ Comment[sl]=Integrirana komponenta za ogledovanje slik
+-Comment[sr]=Уградива компонента за приказивање слика
+-Comment[sr at latin]=Ugradiva komponenta za prikazivanje slika
++Comment[sr]=Угњездива компонента за приказ слика
++Comment[sr at latin]=Ugnjezdiva komponenta za prikaz slika
+ Comment[sv]=Inbäddningsbar bildvisande komponent
+ Comment[ta]=உட்பொதிந்த பிம்பக் காட்டிக் பகுதி
+ Comment[te]=పొదగదగ్గ ప్రతిబింబాల విక్షణాంశం
+@@ -106,7 +106,7 @@
+ Name[lv]=Iegultais attēlu skatītājs
+ Name[mk]=Вгнездлив гледач на слики
+ Name[ms]=Pelihat Imej Boleh-serta
+-Name[nb]=Bildeviser for innebyggbare bilder
++Name[nb]=Innebyggbar bildeviser
+ Name[nds]=Inbettbor Bildkieker
+ Name[ne]=सम्मिलित गर्न सकिने छवि दर्शक
+ Name[nl]=Ingebedde afbeeldingenweergave
+@@ -119,8 +119,8 @@
+ Name[ru]=Встраиваемый модуль просмотра изображений
+ Name[se]=Vuojuhanláhkái govvačájeheaddji
+ Name[sl]=Vgrajeni pregledovalnik slik
+-Name[sr]=Уградиви приказивач слика
+-Name[sr at latin]=Ugradivi prikazivač slika
++Name[sr]=Угњездиви приказивач слика
++Name[sr at latin]=Ugnjezdivi prikazivač slika
+ Name[sv]=Inbäddningsbar bildvisare
+ Name[ta]=உட்பொதிந்த பிம்பக் காட்டி
+ Name[te]=పొదిగిన ప్రతిబింబ చూపరి
+--- a/khtml/test_regression_gui_window.cpp
++++ b/khtml/test_regression_gui_window.cpp
+@@ -79,8 +79,8 @@
+ 	KConfig config("testregressiongui", KConfig::SimpleConfig);
+ 	KConfigGroup grp = config.group("<default>");
+ 
+-	m_testsUrl = KUrl::fromPath(grp.readPathEntry("TestsDirectory"));
+-	m_khtmlUrl = KUrl::fromPath(grp.readPathEntry("KHTMLDirectory"));
++	m_testsUrl = KUrl::fromPath(grp.readPathEntry("TestsDirectory", QString()));
++	m_khtmlUrl = KUrl::fromPath(grp.readPathEntry("KHTMLDirectory", QString()));
+ 
+ 	initTestsDirectory();
+ 
+--- a/khtml/tests/testkhtmlnew.cpp
++++ b/khtml/tests/testkhtmlnew.cpp
+@@ -39,7 +39,6 @@
+ #include "rendering/render_style.h"
+ 
+ #include "khtml_part.h"
+-#include "domtreeview.h"
+ 
+ // to be able to delete a static protected member pointer in kbrowser...
+ // just for memory debugging
+@@ -276,10 +275,6 @@
+     test->openUrl(args->url(0));
+     test->show();
+ 
+-//     DOMTreeView * dtv = new DOMTreeView(0, doc, "DomTreeView");
+-//     dtv->show();
+-//     dtv->resize(toplevel->width()/2, toplevel->height());
+-
+     return app.exec();
+ }
+ 
+--- a/khtml/tests/CMakeLists.txt
++++ b/khtml/tests/CMakeLists.txt
+@@ -9,7 +9,6 @@
+     ########### next target ###############
+     set(khtmltest_SRCS
+         testkhtmlnew.cpp
+-        ${CMAKE_CURRENT_SOURCE_DIR}/../domtreeview.cpp
+     )
+ 
+     qt4_add_resources( khtmltest_SRCS testkhtml.qrc )
+--- a/khtml/html/htmltokenizer.cpp
++++ b/khtml/html/htmltokenizer.cpp
+@@ -29,7 +29,7 @@
+ //
+ // KDE HTML Widget - Tokenizers
+ 
+-//#define TOKEN_DEBUG 1
++// #define TOKEN_DEBUG 1
+ //#define TOKEN_DEBUG 2
+ 
+ #include "htmltokenizer.h"
+@@ -843,21 +843,23 @@
+ 
+                 uint tagID = khtml::getTagID(ptr, len);
+                 if (!tagID) {
++                    DOMString tagName(ptr);
++                    DocumentImpl *doc = parser->docPtr();
++                    if (Element::khtmlValidQualifiedName(tagName))
++                        tagID = doc->getId(NodeImpl::ElementId, tagName.implementation(), false, false);
+ #ifdef TOKEN_DEBUG
+                     QByteArray tmp(ptr, len+1);
+                     kDebug( 6036 ) << "Unknown tag: \"" << tmp.data() << "\"";
+ #endif
+-                    dest = buffer;
+                 }
+-                else
+-                {
++                if (tagID) {
+ #ifdef TOKEN_DEBUG
+                     QByteArray tmp(ptr, len+1);
+                     kDebug( 6036 ) << "found tag id=" << tagID << ": " << tmp.data();
+ #endif
+                     currToken.tid = beginTag ? tagID : tagID + ID_CLOSE_TAG;
+-                    dest = buffer;
+                 }
++                dest = buffer;
+                 tag = SearchAttribute;
+                 cBufferPos = 0;
+             }
+@@ -1106,7 +1108,7 @@
+             // unless we are using the HTML parser to parse XHTML
+             // The only exception is SCRIPT and priority 0 tokens.
+             if (tagID < ID_CLOSE_TAG && tagID != ID_SCRIPT &&
+-                DOM::endTag[tagID] == DOM::REQUIRED &&
++                DOM::endTagRequirement(tagID) == DOM::REQUIRED &&
+                 parser->doc()->htmlMode() != DocumentImpl::XHtml)
+                 currToken.flat = false;
+ 
+--- a/khtml/html/html_miscimpl.cpp
++++ b/khtml/html/html_miscimpl.cpp
+@@ -54,17 +54,14 @@
+ {
+     static Cache* make() { return new CollectionCache; }
+ 
+-    Q3Dict<QList<NodeImpl*> > nameCache;
++    QHash<QString,QList<NodeImpl*>* > nameCache;
+ 
+-    CollectionCache(): nameCache(127)
+-    {
+-        nameCache.setAutoDelete(true);
+-    }
++    CollectionCache(): nameCache(){}
+ 
+     virtual void clear(DocumentImpl* doc)
+     {
+         Cache::clear(doc);
+-        //qDeleteAll here in Qt4 when fully ported
++        qDeleteAll(nameCache);
+         nameCache.clear();
+     }
+ };
+@@ -284,13 +281,15 @@
+ 
+ QList<NodeImpl*> HTMLCollectionImpl::namedItems( const DOMString &name ) const
+ {
++    if (name.isEmpty())
++        return QList<NodeImpl*>();
+     QString key = name.string();
+ 
+     //We use a work-conserving design for the name cache presently -- only
+     //remember stuff about elements we were asked for.
+     m_cache->updateNodeListInfo(m_refNode->getDocument());
+     CollectionCache* cache = static_cast<CollectionCache*>(m_cache);
+-    if (QList<NodeImpl*>* info = cache->nameCache.find(key)) {
++    if (QList<NodeImpl*>* info = cache->nameCache.value(key)) {
+         return *info;
+     }
+     else {
+@@ -302,7 +301,7 @@
+             match = nextNamedItem(name);
+         }
+ 
+-        cache->nameCache.insert(key, newInfo);
++        cache->nameCache.insertMulti(key, newInfo);
+         return *newInfo;
+     }
+ }
+@@ -325,8 +324,8 @@
+         strt = m_cache->current.index;
+     }
+ 
+-    Q3PtrList<HTMLGenericFormElementImpl>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements;
+-    for (unsigned i = strt; i < l.count(); i++)
++    QList<HTMLGenericFormElementImpl*>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements;
++    for (unsigned i = strt; i < (unsigned)l.count(); i++)
+     {
+         if (l.at( i )->isEnumeratable())
+         {
+@@ -346,9 +345,10 @@
+ 
+ unsigned long HTMLFormCollectionImpl::calcLength(NodeImpl *start) const
+ {
++    Q_UNUSED(start);
+     unsigned length = 0;
+-    Q3PtrList<HTMLGenericFormElementImpl> l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements;
+-    for ( unsigned i = 0; i < l.count(); i++ )
++    QList<HTMLGenericFormElementImpl*> l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements;
++    for ( unsigned i = 0; i < (unsigned)l.count(); i++ )
+         if ( l.at( i )->isEnumeratable() )
+             ++length;
+     return length;
+@@ -364,10 +364,10 @@
+ 
+ NodeImpl *HTMLFormCollectionImpl::nextNamedItem( const DOMString &name ) const
+ {
+-    Q3PtrList<HTMLGenericFormElementImpl>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements;
++    QList<HTMLGenericFormElementImpl*>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements;
+ 
+     //Go through the list, trying to find the appropriate named form element.
+-    for ( ; currentNamePos < l.count(); ++currentNamePos )
++    for ( ; currentNamePos < (unsigned)l.count(); ++currentNamePos )
+     {
+         HTMLGenericFormElementImpl* el = l.at(currentNamePos);
+         if (el->isEnumeratable() &&
+@@ -384,8 +384,8 @@
+     //but only if no input tags were matched
+     if (foundInput) return 0;
+ 
+-    Q3PtrList<HTMLImageElementImpl>& il = static_cast<HTMLFormElementImpl*>( m_refNode )->imgElements;
+-    for ( ; currentNameImgPos < il.count(); ++currentNameImgPos )
++    QList<HTMLImageElementImpl*>& il = static_cast<HTMLFormElementImpl*>( m_refNode )->imgElements;
++    for ( ; currentNameImgPos < (unsigned)il.count(); ++currentNameImgPos )
+     {
+         HTMLImageElementImpl* el = il.at(currentNameImgPos);
+         if ((el->getAttribute(ATTR_ID)   == name) ||
+--- a/khtml/html/html_formimpl.cpp
++++ b/khtml/html/html_formimpl.cpp
+@@ -94,12 +94,12 @@
+     if (getDocument() && getDocument()->view() && getDocument()->view()->part()) {
+         getDocument()->view()->part()->dequeueWallet(this);
+     }
+-    Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements);
+-    for (; it.current(); ++it)
+-        it.current()->m_form = 0;
+-    Q3PtrListIterator<HTMLImageElementImpl> it2(imgElements);
+-    for (; it2.current(); ++it2)
+-        it2.current()->m_form = 0;
++    QListIterator<HTMLGenericFormElementImpl*> it(formElements);
++    while (it.hasNext())
++        it.next()->m_form = 0;
++    QListIterator<HTMLImageElementImpl*> it2(imgElements);
++    while (it2.hasNext())
++        it2.next()->m_form = 0;
+ }
+ 
+ NodeImpl::Id HTMLFormElementImpl::id() const
+@@ -126,9 +126,9 @@
+ long HTMLFormElementImpl::length() const
+ {
+     int len = 0;
+-    Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements);
+-    for (; it.current(); ++it)
+-	if (it.current()->isEnumeratable())
++    QListIterator<HTMLGenericFormElementImpl*> it(formElements);
++    while (it.hasNext())
++	if (it.next()->isEnumeratable())
+ 	    ++len;
+ 
+     return len;
+@@ -274,8 +274,8 @@
+ 
+     QStringList fileUploads, fileNotUploads;
+ 
+-    for (Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) {
+-        HTMLGenericFormElementImpl* const current = it.current();
++    for (QListIterator<HTMLGenericFormElementImpl*> it(formElements); it.hasNext();) {
++        HTMLGenericFormElementImpl* const current = it.next();
+         khtml::encodingList lst;
+ 
+         if (!current->disabled() && current->encoding(codec, lst, m_multipart))
+@@ -468,9 +468,10 @@
+     if (w->readMap(key, map))
+         return; // failed, abort
+ 
+-    for (Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) {
+-        if (it.current()->id() == ID_INPUT) {
+-            HTMLInputElementImpl* const current = static_cast<HTMLInputElementImpl*>(it.current());
++    for (QListIterator<HTMLGenericFormElementImpl*> it(formElements); it.hasNext();) {
++        HTMLGenericFormElementImpl* const cur = it.next();
++        if (cur->id() == ID_INPUT) {
++            HTMLInputElementImpl* const current = static_cast<HTMLInputElementImpl*>(cur);
+             if ((current->inputType() == HTMLInputElementImpl::PASSWORD ||
+                     current->inputType() == HTMLInputElementImpl::TEXT) &&
+                     !current->readOnly() &&
+@@ -489,15 +490,16 @@
+     // if there is none, do a submit anyway if not more
+     // than one <input type=text> or <input type=password>
+     unsigned int inputtext = 0;
+-    for (Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) {
+-        if (it.current()->id() == ID_BUTTON) {
+-            HTMLButtonElementImpl* const current = static_cast<HTMLButtonElementImpl *>(it.current());
++    for (QListIterator<HTMLGenericFormElementImpl*> it(formElements); it.hasNext();) {
++        HTMLGenericFormElementImpl* const cur = it.next();
++        if (cur->id() == ID_BUTTON) {
++            HTMLButtonElementImpl* const current = static_cast<HTMLButtonElementImpl *>(cur);
+             if (current->buttonType() == HTMLButtonElementImpl::SUBMIT && !current->disabled()) {
+                 current->click();
+                 return;
+             }
+-        } else if (it.current()->id() == ID_INPUT) {
+-            HTMLInputElementImpl* const current = static_cast<HTMLInputElementImpl *>(it.current());
++        } else if (cur->id() == ID_INPUT) {
++            HTMLInputElementImpl* const current = static_cast<HTMLInputElementImpl *>(cur);
+             switch(current->inputType())  {
+             case HTMLInputElementImpl::SUBMIT:
+             case HTMLInputElementImpl::IMAGE:
+@@ -530,9 +532,10 @@
+     m_haveTextarea = false;
+     const KUrl formUrl(getDocument()->URL());
+     if (view && !view->nonPasswordStorableSite(formUrl.host())) {
+-        for (Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) {
+-            if (it.current()->id() == ID_INPUT)  {
+-                HTMLInputElementImpl* const c = static_cast<HTMLInputElementImpl*> (it.current());
++        for (QListIterator<HTMLGenericFormElementImpl*> it(formElements); it.hasNext();) {
++            HTMLGenericFormElementImpl* const cur = it.next();
++            if (cur->id() == ID_INPUT)  {
++                HTMLInputElementImpl* const c = static_cast<HTMLInputElementImpl*> (cur);
+                 if ((c->inputType() == HTMLInputElementImpl::TEXT ||
+                         c->inputType() == HTMLInputElementImpl::PASSWORD) &&
+                         !c->readOnly())  {
+@@ -542,7 +545,7 @@
+                         m_havePassword = true;
+                 }
+             }
+-            else if (it.current()->id() == ID_TEXTAREA)
++            else if (cur->id() == ID_TEXTAREA)
+                 m_haveTextarea = true;
+         }
+     }
+@@ -701,8 +704,8 @@
+         return;
+     }
+ 
+-    for (Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it)
+-        it.current()->reset();
++    for (QListIterator<HTMLGenericFormElementImpl*> it(formElements); it.hasNext();)
++        it.next()->reset();
+ 
+     m_inreset = false;
+ }
+@@ -780,8 +783,8 @@
+ 
+ void HTMLFormElementImpl::radioClicked( HTMLGenericFormElementImpl *caller )
+ {
+-    for (Q3PtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) {
+-        HTMLGenericFormElementImpl* const current = it.current();
++    for (QListIterator<HTMLGenericFormElementImpl*> it(formElements); it.hasNext();) {
++        HTMLGenericFormElementImpl* const current = it.next();
+         if (current->id() == ID_INPUT &&
+             static_cast<HTMLInputElementImpl*>(current)->inputType() == HTMLInputElementImpl::RADIO &&
+             current != caller && current->form() == caller->form() && current->name() == caller->name())
+@@ -796,7 +799,9 @@
+ 
+ void HTMLFormElementImpl::removeFormElement(HTMLGenericFormElementImpl *e)
+ {
+-    formElements.remove(e);
++    int i = formElements.indexOf(e); 
++    if (i != -1)
++        formElements.removeAt(i);
+ }
+ 
+ void HTMLFormElementImpl::registerImgElement(HTMLImageElementImpl *e)
+@@ -806,7 +811,9 @@
+ 
+ void HTMLFormElementImpl::removeImgElement(HTMLImageElementImpl *e)
+ {
+-    imgElements.remove(e);
++    int i = imgElements.indexOf(e); 
++    if (i != -1)
++        imgElements.removeAt(i);
+ }
+ 
+ // -------------------------------------------------------------------------
+@@ -1056,7 +1063,7 @@
+ 	    // handle tabbing out, either from a single or repeated key event.
+ 	    if ( evt->id() == EventImpl::KEYPRESS_EVENT && evt->isKeyRelatedEvent() ) {
+ 	        QKeyEvent* const k = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent();
+-	        if ( k && (k->key() == Qt::Key_Tab || k->key() == Qt::Key_BackTab) ) {
++	        if ( k && (k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) ) {
+ 		    QWidget* const widget = static_cast<RenderWidget*>(m_render)->widget();
+ 		    if (widget)
+ 			{
+@@ -2379,7 +2386,7 @@
+ 
+     //See if we're asked for the very last item, and check whether it's an <option>
+     //to fastpath clear
+-    if (optionIndex == (m_length - 1) && items[itemsSize - 1]->id() == ID_OPTION)
++    if ((unsigned)optionIndex == (m_length - 1) && items[itemsSize - 1]->id() == ID_OPTION)
+         return itemsSize - 1;
+ 
+     int listIndex = 0;
+@@ -2910,15 +2917,15 @@
+ void HTMLTextAreaElementImpl::setDefaultValue(DOMString _defaultValue)
+ {
+     // there may be comments - remove all the text nodes and replace them with one
+-    Q3PtrList<NodeImpl> toRemove;
++    QList<NodeImpl*> toRemove;
+     NodeImpl *n;
+     for (n = firstChild(); n; n = n->nextSibling())
+         if (n->isTextNode())
+             toRemove.append(n);
+-    Q3PtrListIterator<NodeImpl> it(toRemove);
++    QListIterator<NodeImpl*> it(toRemove);
+     int exceptioncode = 0;
+-    for (; it.current(); ++it) {
+-        removeChild(it.current(), exceptioncode);
++    while (it.hasNext()) {
++        removeChild(it.next(), exceptioncode);
+     }
+     insertBefore(getDocument()->createTextNode(_defaultValue.implementation()),firstChild(), exceptioncode);
+     setValue(_defaultValue);
+--- a/khtml/html/html_objectimpl.cpp
++++ b/khtml/html/html_objectimpl.cpp
+@@ -40,7 +40,6 @@
+ #include "css/csshelper.h"
+ #include "css/cssproperties.h"
+ #include "css/cssvalues.h"
+-#include "rendering/render_applet.h"
+ #include "rendering/render_frames.h"
+ #include "rendering/render_image.h"
+ #include "xml/dom2_eventsimpl.h"
+@@ -100,6 +99,35 @@
+     }
+ }
+ 
++
++void HTMLObjectBaseElementImpl::defaultEventHandler(EventImpl *e)
++{
++    // ### duplicated in HTMLIFrameElementImpl
++     if ( e->target() == this && m_render && m_render->isWidget() 
++                                    && static_cast<RenderWidget*>(m_render)->isRedirectedWidget() 
++                                    && qobject_cast<KHTMLView*>(static_cast<RenderWidget*>(m_render)->widget())) {
++        switch(e->id())  {
++        case EventImpl::MOUSEDOWN_EVENT:
++        case EventImpl::MOUSEUP_EVENT:
++        case EventImpl::MOUSEMOVE_EVENT:
++        case EventImpl::MOUSEOUT_EVENT:
++        case EventImpl::MOUSEOVER_EVENT:
++        case EventImpl::KHTML_MOUSEWHEEL_EVENT:
++        case EventImpl::KEYDOWN_EVENT:
++        case EventImpl::KEYUP_EVENT:
++        case EventImpl::KEYPRESS_EVENT:
++        case EventImpl::DOMFOCUSIN_EVENT:
++        case EventImpl::DOMFOCUSOUT_EVENT:
++            if (static_cast<RenderWidget*>(m_render)->handleEvent(*e))
++                e->setDefaultHandled();
++        default:
++            break;
++        }
++    }
++    HTMLElementImpl::defaultEventHandler(e);
++}
++
++
+ void HTMLObjectBaseElementImpl::removedFromDocument()
+ {
+     getDocument()->underDocNamedCache().remove(m_name.string(), this);
+--- a/khtml/html/dtd.h
++++ b/khtml/html/dtd.h
+@@ -23,6 +23,7 @@
+ #define _DOM_dtd_h_
+ 
+ #include "dom/dom_string.h"
++#include "misc/htmlhashes.h"
+ 
+ #undef OPTIONAL
+ 
+@@ -36,8 +37,24 @@
+ 
+ bool checkChild(ushort tagID, ushort childID, bool strict = false);
+ 
+-extern const unsigned short tagPriority[];
+-extern const tagStatus endTag[];
++extern const unsigned short tagPriorityArray[];
++extern const tagStatus endTagArray[];
++
++inline unsigned short tagPriority(quint32 tagId)
++{
++    // Treat custom elements the same as <span>; also don't read past the end of the array.
++    if (tagId > ID_LAST_TAG)
++        return tagPriorityArray[ID_SPAN];
++    return tagPriorityArray[tagId];
++}
++
++inline tagStatus endTagRequirement(quint32 tagId)
++{
++    // Treat custom elements the same as <span>; also don't read past the end of the array.
++    if (tagId > ID_LAST_TAG)
++        return endTagArray[ID_SPAN];
++    return endTagArray[tagId];
++}
+ 
+ } //namespace DOM
+ #endif
+--- a/khtml/html/html_baseimpl.cpp
++++ b/khtml/html/html_baseimpl.cpp
+@@ -663,6 +663,33 @@
+     return ID_IFRAME;
+ }
+ 
++void HTMLIFrameElementImpl::defaultEventHandler(EventImpl *e)
++{
++     // ### duplicated in HTMLObjectBaseElementImpl
++     if ( e->target() == this && m_render && m_render->isWidget() 
++                                    && static_cast<RenderWidget*>(m_render)->isRedirectedWidget() 
++                                    && qobject_cast<KHTMLView*>(static_cast<RenderWidget*>(m_render)->widget())) {
++        switch(e->id())  {
++        case EventImpl::MOUSEDOWN_EVENT:
++        case EventImpl::MOUSEUP_EVENT:
++        case EventImpl::MOUSEMOVE_EVENT:
++        case EventImpl::MOUSEOUT_EVENT:
++        case EventImpl::MOUSEOVER_EVENT:
++        case EventImpl::KHTML_MOUSEWHEEL_EVENT:
++        case EventImpl::KEYDOWN_EVENT:
++        case EventImpl::KEYUP_EVENT:
++        case EventImpl::KEYPRESS_EVENT:
++        case EventImpl::DOMFOCUSIN_EVENT:
++        case EventImpl::DOMFOCUSOUT_EVENT:
++            if (static_cast<RenderWidget*>(m_render)->handleEvent(*e))
++                e->setDefaultHandled();
++        default:
++            break;
++        }
++    }
++    HTMLFrameElementImpl::defaultEventHandler(e);
++}
++
+ void HTMLIFrameElementImpl::parseAttribute(AttributeImpl *attr )
+ {
+     switch (  attr->id() )
+--- a/khtml/html/html_canvasimpl.cpp
++++ b/khtml/html/html_canvasimpl.cpp
+@@ -1,5 +1,7 @@
+ /*
+  * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
++ *  Copyright (C) 2005 Zack Rusin <zack at kde.org>
++ *  Copyright (C) 2007 Maksim Orlovich <maksim at kde.org>
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+@@ -33,32 +35,83 @@
+ 
+ #include <kdebug.h>
+ 
++#include <dom/dom_exception.h>
+ #include <rendering/render_canvasimage.h>
+ #include <rendering/render_flow.h>
+ #include <css/cssstyleselector.h>
+ #include <css/cssproperties.h>
++#include <css/cssparser.h>
+ #include <css/cssvalues.h>
+ #include <css/csshelper.h>
+ #include <xml/dom2_eventsimpl.h>
++#include <html/html_imageimpl.h>
+ #include <misc/htmltags.h>
++#include <misc/htmlattrs.h>
++#include <misc/translator.h>
++#include <imload/canvasimage.h>
++#include <kjs/global.h>
++#include <kjs/operations.h> //uglyyy: needs for inf/NaN tests
+ 
++#include <QtAlgorithms>
+ #include <QtCore/QCharRef>
+ #include <QtCore/QPoint>
++#include <QtCore/QLocale>
+ #include <QtGui/QRegion>
+ #include <QtGui/QImage>
++#include <QDebug>
++#include <cmath>
+ 
+ using namespace DOM;
+ using namespace khtml;
++using namespace std;
+ 
+ // -------------------------------------------------------------------------
+ 
+ HTMLCanvasElementImpl::HTMLCanvasElementImpl(DocumentImpl *doc)
+-    : HTMLImageElementImpl(doc)
++    : HTMLElementImpl(doc)
+ {
++    w = 300;
++    h = 150;
+ }
+ 
+ HTMLCanvasElementImpl::~HTMLCanvasElementImpl()
+ {
++    if (context)
++        context->canvasElement = 0;
++}
++
++void HTMLCanvasElementImpl::parseAttribute(AttributeImpl* attr)
++{
++    bool ok = false;
++    int  val;
++    switch (attr->id())
++    {
++    // ### TODO: making them reflect w/h -- how?
++    case ATTR_WIDTH:
++        val = attr->val() ? attr->val()->toInt(&ok) : -1;
++        if (!ok || val <= 0)
++            w = 300;
++        else
++            w = val;
++
++        if (context)
++            context->resetContext(w, h);
++        setChanged();
++        break;
++    case ATTR_HEIGHT:
++        val = attr->val() ? attr->val()->toInt(&ok) : -1;
++        if (!ok || val <= 0)
++            h = 150;
++        else
++            h = val;
++
++        if (context)
++            context->resetContext(w, h);
++        setChanged();
++        break;
++    default:
++        HTMLElementImpl::parseAttribute(attr);
++    }
+ }
+ 
+ NodeImpl::Id HTMLCanvasElementImpl::id() const
+@@ -88,7 +141,843 @@
+         m_render->updateFromElement();
+ }
+ 
+-void HTMLCanvasElementImpl::detach()
++CanvasContext2DImpl* HTMLCanvasElementImpl::getContext2D()
++{
++    if (!context)
++        context = new CanvasContext2DImpl(this, w, h);;
++    return context.get();
++}
++
++khtmlImLoad::CanvasImage* HTMLCanvasElementImpl::getCanvasImage()
++{
++    return getContext2D()->canvasImage;
++}
++
++// -------------------------------------------------------------------------
++CanvasContext2DImpl::CanvasContext2DImpl(HTMLCanvasElementImpl* element, int width, int height):
++    canvasElement(element), canvasImage(0)
++{
++    resetContext(width, height);
++}
++
++CanvasContext2DImpl::~CanvasContext2DImpl()
++{
++    if (workPainter.isActive())
++        workPainter.end(); // Make sure to stop it before blowing the image away!
++    delete canvasImage;
++}
++
++// Basic infrastructure.. 
++void CanvasContext2DImpl::resetContext(int width, int height)
++{
++    // ### FIXME FIXME: use khtmlImLoad's limit policy
++    // for physical canvas and transform painter to match logical resolution
++    if (workPainter.isActive())
++        workPainter.end();
++
++    if (canvasImage)
++        canvasImage->resizeImage(width, height);
++    else
++        canvasImage = new khtmlImLoad::CanvasImage(width, height);
++    canvasImage->qimage()->fill(0x00000000); // transparent black is the initial state
++
++    stateStack.clear();
++
++    PaintState defaultState;
++    beginPath();
++    defaultState.infinityTransform = false;
++    defaultState.clipPath.addRect(0, 0, width, height);
++    defaultState.clipPath.setFillRule(Qt::WindingFill);
++    
++    defaultState.globalAlpha = 1.0f;
++    defaultState.globalCompositeOperation = QPainter::CompositionMode_SourceOver;
++
++    defaultState.strokeStyle = new CanvasColorImpl(QColor(Qt::black));
++    defaultState.fillStyle   = new CanvasColorImpl(QColor(Qt::black));
++    
++    defaultState.lineWidth  = 1.0f;
++    defaultState.lineCap    = Qt::FlatCap;
++    defaultState.lineJoin   = Qt::MiterJoin;
++    defaultState.miterLimit = 10.0f;
++    
++    stateStack.push(defaultState);
++
++    dirty = DrtAll;
++    needRendererUpdate();
++}
++
++void CanvasContext2DImpl::save()
++{
++    stateStack.push(stateStack.top());
++}
++
++void CanvasContext2DImpl::restore()
++{
++    if (stateStack.size() <= 1)
++        return;
++
++    stateStack.pop();
++    dirty = DrtAll;
++}
++
++QPainter* CanvasContext2DImpl::acquirePainter()
++{
++    if (!workPainter.isActive()) {
++        workPainter.begin(canvasImage->qimage());
++        workPainter.setRenderHint(QPainter::Antialiasing);
++        dirty = DrtAll;
++    }
++
++    PaintState& state = activeState();
++
++    if (dirty & DrtClip) {
++        // Reset the transform so the clip path is in the
++        // right coordinate system
++        workPainter.resetTransform();
++        workPainter.setClipPath(state.clipPath);
++
++        // Restore the transform..
++        dirty |= DrtTransform;
++    }
++    
++    if (dirty & DrtTransform) {
++        if (state.infinityTransform) {
++            // Make stuff disappear. Cliprect should avoid this ever showing..
++            state.transform.reset();
++            state.transform.translate(-canvasImage->size().width() * 2, -canvasImage->size().height() * 2);
++        }
++
++        workPainter.setTransform(state.transform);
++    }
++
++    if (dirty & DrtAlpha)
++        workPainter.setOpacity(state.globalAlpha);
++    if (dirty & DrtCompOp)
++        workPainter.setCompositionMode(state.globalCompositeOperation);
++    if (dirty & DrtStroke) {
++        QPen pen;
++        pen.setWidth(state.lineWidth);
++        pen.setCapStyle (state.lineCap);
++        pen.setJoinStyle(state.lineJoin);
++        pen.setMiterLimit(state.miterLimit);
++
++        CanvasStyleBaseImpl* style = state.strokeStyle.get();
++        if (style->type() == CanvasStyleBaseImpl::Color)
++            pen.setColor(static_cast<CanvasColorImpl*>(style)->color);
++        else
++            pen.setBrush(style->toBrush());
++        workPainter.setPen(pen); // ### should I even do this?
++                                 // I have a feeling I am mixing up path and
++                                 // non-path ops
++    }
++    if (dirty & DrtFill)
++        workPainter.setBrush(state.fillStyle->toBrush());
++
++    dirty = 0;
++
++    needRendererUpdate();
++    return &workPainter;
++}
++
++QImage CanvasContext2DImpl::extractImage(ElementImpl* el, int& exceptionCode) const
++{
++    QImage pic;
++    
++    exceptionCode = 0;
++    if (el->id() == ID_CANVAS) {
++        CanvasContext2DImpl* other = static_cast<HTMLCanvasElementImpl*>(el)->getContext2D();
++        if (other->workPainter.isActive())
++            other->workPainter.end();
++        pic = *other->canvasImage->qimage();
++    } else if (el->id() == ID_IMG) {
++        HTMLImageElementImpl* img = static_cast<HTMLImageElementImpl*>(el);
++        if (img->complete())
++            pic = img->currentImage();
++        else
++            exceptionCode = DOMException::INVALID_STATE_ERR;
++    } else {
++        exceptionCode = DOMException::TYPE_MISMATCH_ERR;
++    }
++
++    return pic;
++}
++
++void CanvasContext2DImpl::needRendererUpdate()
++{
++    needsCommit = true;
++    if (canvasElement)
++        canvasElement->setChanged();
++}
++
++void CanvasContext2DImpl::commit()
++{
++    // If painter is active, end it.
++    if (workPainter.isActive())
++        workPainter.end();
++
++    // Flush caches if we have changes.
++    if (needsCommit) {
++        canvasImage->contentUpdated();
++        needsCommit = false;
++    }
++}
++
++HTMLCanvasElementImpl* CanvasContext2DImpl::canvas() const
++{
++    return canvasElement;
++}
++
++// Transformation ops
++//
++
++static inline float degrees(float radians)
++{
++    return radians * 180.0 / M_PI;
++}
++
++static inline bool isInfArg(float x)
++{
++    return KJS::isInf(x) || KJS::isNaN(x);
++}
++
++void CanvasContext2DImpl::scale(float x, float y)
++{
++    dirty |= DrtTransform;
++    
++    bool& infinityTransform = activeState().infinityTransform;
++    infinityTransform |= isInfArg(x) | isInfArg(y);
++    if (infinityTransform) return;
++
++    activeState().transform.scale(x, y);
++}
++
++void CanvasContext2DImpl::rotate(float angle)
++{
++    dirty |= DrtTransform;
++
++    bool& infinityTransform = activeState().infinityTransform;
++    infinityTransform |= isInfArg(angle);
++    if (infinityTransform) return;
++
++    activeState().transform.rotate(degrees(angle));
++}
++
++void CanvasContext2DImpl::translate(float x, float y)
++{
++    dirty |= DrtTransform;
++
++    bool& infinityTransform = activeState().infinityTransform;
++    infinityTransform |= isInfArg(x) | isInfArg(y);
++    if (infinityTransform) return;
++
++    activeState().transform.translate(x, y);
++}
++
++void CanvasContext2DImpl::transform(float m11, float m12, float m21, float m22, float dx, float dy)
++{
++    dirty |= DrtTransform;
++    
++    bool& infinityTransform = activeState().infinityTransform;
++    infinityTransform |= isInfArg(m11) | isInfArg(m12) | isInfArg(m21) | isInfArg(m22) |
++                         isInfArg(dx)  | isInfArg(dy);
++    if (infinityTransform) return;
++
++    activeState().transform *= QTransform(m11, m12, 0.0f, m21, m22, 0.0f, dx, dy, 1.0f);
++}
++
++void CanvasContext2DImpl::setTransform(float m11, float m12, float m21, float m22, float dx, float dy)
++{
++    activeState().transform.reset();
++    activeState().infinityTransform = false; // As cleared the matrix..
++    transform(m11, m12, m21, m22, dx, dy);
++}
++
++// Composition state setting
++//
++
++float CanvasContext2DImpl::globalAlpha() const
++{
++    return activeState().globalAlpha;
++}
++
++void CanvasContext2DImpl::setGlobalAlpha(float a)
++{
++    if (a < 0.0f || a > 1.0f)
++        return;
++
++    activeState().globalAlpha = a;
++    dirty |= DrtAlpha;
++}
++
++static const IDTranslator<QString, QPainter::CompositionMode, const char*>::Info compModeTranslatorTable[] = {
++    {"source-over", QPainter::CompositionMode_SourceOver},
++    {"source-out",  QPainter::CompositionMode_SourceOut},
++    {"source-in",   QPainter::CompositionMode_SourceIn},
++    {"source-atop", QPainter::CompositionMode_SourceAtop},
++    {"destination-atop", QPainter::CompositionMode_DestinationAtop},
++    {"destination-in",   QPainter::CompositionMode_DestinationIn},
++    {"destination-out",  QPainter::CompositionMode_DestinationOut},
++    {"destination-over", QPainter::CompositionMode_DestinationOver},
++    {"darker",  QPainter::CompositionMode_Darken},
++    {"lighter", QPainter::CompositionMode_Lighten},
++    {"copy",    QPainter::CompositionMode_Source},
++    {"xor",     QPainter::CompositionMode_Xor},
++    {0, (QPainter::CompositionMode)0}
++};
++
++MAKE_TRANSLATOR(compModeTranslator, QString, QPainter::CompositionMode, const char*, compModeTranslatorTable)
++
++DOM::DOMString CanvasContext2DImpl::globalCompositeOperation() const
++{
++    return compModeTranslator()->toLeft(activeState().globalCompositeOperation);
++}
++
++void CanvasContext2DImpl::setGlobalCompositeOperation(const DOM::DOMString& op)
++{
++    QString opStr = op.string();
++    if (!compModeTranslator()->hasLeft(opStr))
++        return; // Ignore unknown
++    activeState().globalCompositeOperation = compModeTranslator()->toRight(opStr);
++    dirty |= DrtCompOp;
++}
++
++// Colors and styles.
++//
++
++static QList<qreal> parseNumbersList(QString::const_iterator &itr)
++{
++    QList<qreal> points;
++    QLocale c(QLocale::C);
++    QString temp;
++    bool percent = false;
++    while ((*itr).isSpace())
++        ++itr;
++    while ((*itr).isNumber() ||
++           (*itr) == '-' || (*itr) == '+' || (*itr) == '.') {
++        temp = QString();
++
++        if ((*itr) == '-')
++            temp += *itr++;
++        else if ((*itr) == '+')
++            temp += *itr++;
++        while ((*itr).isDigit())
++            temp += *itr++;
++        if ((*itr) == '.')
++            temp += *itr++;
++        while ((*itr).isDigit())
++            temp += *itr++;
++        while ((*itr).isSpace())
++            ++itr;
++        if ((*itr) == '%')
++            ++itr, percent = true;
++        while ((*itr).isSpace())
++            ++itr;
++        if ((*itr) == ',')
++            ++itr;
++        points.append(c.toDouble(temp) * (percent ? 2.55 : 1));
++        //eat spaces
++        while ((*itr).isSpace())
++            ++itr;
++        percent = false;
++    }
++
++    return points;
++}
++
++static QColor colorFromValue(DOM::DOMString domStr)
++{
++    QString name = domStr.string().trimmed();
++    QString::const_iterator itr = name.constBegin();
++    QList<qreal> compo;
++    if ( name.startsWith( "rgba(" ) || name.startsWith( "hsva(" ) ) {
++        ++itr; ++itr; ++itr; ++itr; ++itr;
++        compo = parseNumbersList(itr);
++        if ( compo.size() != 4 ) {
++            return QColor();
++        }
++        return name.startsWith('h') ?
++            QColor::fromHsvF( compo[0]/255, compo[1]/255, compo[2]/255, compo[3] ) :
++            QColor::fromRgbF( compo[0]/255, compo[1]/255, compo[2]/255, compo[3] );
++    } else if ( name.startsWith( "rgb(" ) ||  name.startsWith( "hsv(" ) ) {
++        ++itr; ++itr; ++itr; ++itr;
++        compo = parseNumbersList(itr);
++        if ( compo.size() != 3 ) {
++            return QColor();
++        }
++        return name.startsWith('h') ?
++            QColor::fromHsv( compo[0], compo[1], compo[2] ) :
++            QColor::fromRgb( compo[0], compo[1], compo[2] );
++    } else {
++        QRgb color;
++        DOM::CSSParser::parseColor(name, color);
++        return QColor(color);
++    }
++}
++
++//-------
++
++DOM::DOMString CanvasColorImpl::toString() const
++{
++    QString str;
++    if (color.alpha() == 255)
++        str.sprintf("#%02x%02x%02x", color.red(), color.green(), color.blue());
++    else
++        str.sprintf("rgba(%d, %d, %d, %f)", color.red(), color.green(), color.blue(), color.alphaF());
++        // ### CHECKME: risk of locale messing up . ?
++    return str;
++}
++
++CanvasColorImpl* CanvasColorImpl::fromString(const DOM::DOMString& str)
++{
++    QColor cl = colorFromValue(str);
++    if (!cl.isValid())
++        return 0;
++    return new CanvasColorImpl(cl);
++}
++
++//-------
++
++CanvasGradientImpl::CanvasGradientImpl(QGradient* newGradient): gradient(newGradient)
++{}
++
++
++static qreal adjustPosition( qreal pos, const QGradientStops &stops )
++{
++    QGradientStops::const_iterator itr = stops.constBegin();
++    const qreal smallDiff = 0.00001;
++    while ( itr != stops.constEnd() ) {
++        const QGradientStop &stop = *itr;
++        ++itr;
++        bool atEnd = ( itr != stops.constEnd() );
++        if ( qFuzzyCompare( pos, stop.first ) ) {
++            if ( atEnd || !qFuzzyCompare( pos + smallDiff, ( *itr ).first ) ) {
++                return pos + smallDiff;
++            }
++        }
++    }
++    return pos;
++}
++
++void CanvasGradientImpl::addColorStop(float offset, const DOM::DOMString& color, int& exceptionCode)
++{
++    // ### we may have to handle the "currentColor" KW here. ouch.
++
++    exceptionCode = 0;
++    //### fuzzy compare (also for alpha)
++    if (offset < 0 || offset > 1) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return;
++    }
++
++    QColor qcolor = colorFromValue(color);
++    if (!qcolor.isValid()) {
++        exceptionCode = DOMException::SYNTAX_ERR;
++        return;
++    }
++
++    //<canvas> says that gradient can have two stops at the same position
++    //Qt doesn't handle that. We hack around that by creating a fake position
++    //stop.
++    offset = adjustPosition(offset, gradient->stops());
++
++    gradient->setColorAt(offset, qcolor);
++}
++
++CanvasGradientImpl::~CanvasGradientImpl()
++{
++    delete gradient;
++}
++
++QBrush CanvasGradientImpl::toBrush() const
++{
++    return QBrush(*gradient);
++}
++
++//-------
++
++CanvasPatternImpl::CanvasPatternImpl(const QImage& inImg, bool rx, bool ry):
++        img(inImg), repeatX(rx), repeatY(ry)
++{}
++
++
++QBrush CanvasPatternImpl::toBrush() const
++{
++    //### how do we do repetition?
++    return QBrush(img);
++}
++
++//-------
++
++void CanvasContext2DImpl::setStrokeStyle(CanvasStyleBaseImpl* strokeStyle)
++{
++    if (!strokeStyle)
++        return;
++    activeState().strokeStyle = strokeStyle;
++    dirty |= DrtStroke;
++}
++
++CanvasStyleBaseImpl* CanvasContext2DImpl::strokeStyle() const
++{
++    return activeState().strokeStyle.get();
++}
++
++void CanvasContext2DImpl::setFillStyle(CanvasStyleBaseImpl* fillStyle)
++{
++    if (!fillStyle)
++        return;
++    activeState().fillStyle = fillStyle;
++    dirty |= DrtFill;
++}
++
++CanvasStyleBaseImpl* CanvasContext2DImpl::fillStyle() const
++{
++    return activeState().fillStyle.get();
++}
++
++CanvasGradientImpl* CanvasContext2DImpl::createLinearGradient(float x0, float y0, float x1, float y1) const
++{
++    QLinearGradient* grad = new QLinearGradient(x0, y0, x1, y1);
++    return new CanvasGradientImpl(grad);
++}
++
++CanvasGradientImpl* CanvasContext2DImpl::createRadialGradient(float x0, float y0, float r0,
++                                                              float x1, float y1, float r1,
++                                                              int& exceptionCode) const
++{
++    exceptionCode = 0;
++    //### fuzzy
++    if (r0 < 0.0f || r1 < 0.0f) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return 0;
++    }
++
++    // ### What the heck? Ask FredrikH. For now copy the 1-radius code from old
++    return new CanvasGradientImpl(new QRadialGradient(x0, y0, r0, x1, y1));
++}
++
++CanvasPatternImpl* CanvasContext2DImpl::createPattern(ElementImpl* pat, const DOMString& rpt,
++                                                      int& exceptionCode) const
++{
++    exceptionCode = 0;
++
++    // Decode repetition..
++    bool repeatX;
++    bool repeatY;
++    if (rpt == "repeat") {
++        repeatX = true;
++        repeatY = true;
++    } else if (rpt == "repeat-y") {
++        repeatX = false;
++        repeatY = true;
++    } else if (rpt == "no-repeat") {
++        repeatX = false;
++        repeatY = false;
++    } else {
++        exceptionCode = DOMException::SYNTAX_ERR;
++        return 0;
++    }
++
++    QImage pic = extractImage(pat, exceptionCode);
++    if (exceptionCode)
++        return 0;
++
++    return new CanvasPatternImpl(pic, repeatX, repeatY);
++}
++
++// Pen style ops
++//
++float CanvasContext2DImpl::lineWidth() const
++{
++    return activeState().lineWidth;
++}
++
++void CanvasContext2DImpl::setLineWidth(float newLW)
++{
++    if (newLW <= 0.0)
++        return;
++    activeState().lineWidth = newLW;
++    dirty |= DrtStroke;
++}
++
++static const IDTranslator<QString, Qt::PenCapStyle, const char*>::Info penCapTranslatorTable[] = {
++    {"round", Qt::RoundCap},
++    {"square", Qt::SquareCap},
++    {"butt", Qt::FlatCap},
++    {0, (Qt::PenCapStyle)0}
++};
++
++MAKE_TRANSLATOR(penCapTranslator, QString, Qt::PenCapStyle, const char*, penCapTranslatorTable)
++
++DOMString CanvasContext2DImpl::lineCap() const
++{
++    return penCapTranslator()->toLeft(activeState().lineCap);
++}
++
++void CanvasContext2DImpl::setLineCap(const DOM::DOMString& cap)
+ {
+-    HTMLElementImpl::detach();
++    QString capStr = cap.string();
++    if (!penCapTranslator()->hasLeft(capStr))
++        return;
++    activeState().lineCap = penCapTranslator()->toRight(capStr);
++    dirty |= DrtStroke;
++}
++
++static const IDTranslator<QString, Qt::PenJoinStyle, const char*>::Info penJoinTranslatorTable[] = {
++    {"round", Qt::RoundJoin},
++    {"miter", Qt::MiterJoin},
++    {"bevel", Qt::BevelJoin},
++    {0, (Qt::PenJoinStyle)0}
++};
++
++MAKE_TRANSLATOR(penJoinTranslator, QString, Qt::PenJoinStyle, const char*, penJoinTranslatorTable)
++
++DOMString CanvasContext2DImpl::lineJoin() const
++{
++    return penJoinTranslator()->toLeft(activeState().lineJoin);
++}
++
++void CanvasContext2DImpl::setLineJoin(const DOM::DOMString& join)
++{
++    QString joinStr = join.string();
++    if (!penJoinTranslator()->hasLeft(joinStr))
++        return;
++    activeState().lineJoin = penJoinTranslator()->toRight(joinStr);
++    dirty |= DrtStroke;
++}
++
++float CanvasContext2DImpl::miterLimit() const
++{
++    return activeState().miterLimit;
++}
++
++void CanvasContext2DImpl::setMiterLimit(float newML)
++{
++    if (newML <= 0.0)
++        return;
++    activeState().miterLimit = newML;
++    dirty |= DrtStroke;
++}
++
++// Rectangle ops
++//
++void CanvasContext2DImpl::clearRect (float x, float y, float w, float h, int& exceptionCode)
++{
++    exceptionCode = 0;
++    if (w < 0.0f || h < 0.0f) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return;
++    }
++    
++    QPainter* p = acquirePainter();
++    p->setCompositionMode(QPainter::CompositionMode_Source);
++    dirty |= DrtCompOp; // We messed it up..
++
++    p->fillRect(QRectF(x, y, w, h), Qt::transparent);
++}
++
++void CanvasContext2DImpl::fillRect (float x, float y, float w, float h, int& exceptionCode)
++{
++    exceptionCode = 0;
++    if (w < 0.0f || h < 0.0f) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return;
++    }
++    
++    QPainter* p = acquirePainter();
++    p->fillRect(QRectF(x, y, w, h), p->brush());
+ }
++
++void CanvasContext2DImpl::strokeRect (float x, float y, float w, float h, int& exceptionCode)
++{
++    exceptionCode = 0;
++    if (w < 0.0f || h < 0.0f) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return;
++    }
++
++    QPainter* p = acquirePainter();
++
++    QPainterPath path;
++    path.addRect(x, y, w, h);
++    p->strokePath(path, p->pen());
++}
++
++// Path ops
++//
++void CanvasContext2DImpl::beginPath()
++{
++    path = QPainterPath();
++    path.setFillRule(Qt::WindingFill);
++}
++
++void CanvasContext2DImpl::closePath()
++{
++    path.closeSubpath();
++}
++
++void CanvasContext2DImpl::moveTo(float x, float y)
++{
++    path.moveTo(x, y);
++}
++
++void CanvasContext2DImpl::lineTo(float x, float y)
++{
++    path.lineTo(x, y);
++}
++
++void CanvasContext2DImpl::quadraticCurveTo(float cpx, float cpy, float x, float y)
++{
++    path.quadTo(cpx, cpy, x, y);
++}
++
++void CanvasContext2DImpl::bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y)
++{
++    path.cubicTo(cp1x, cp1y, cp2x, cp2y, x, y);
++}
++
++void CanvasContext2DImpl::rect(float x, float y, float w, float h, int& exceptionCode)
++{
++    exceptionCode = 0;
++    if (w < 0 || h < 0) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return;
++    }
++
++    path.addRect(x, y, w, h);
++}
++
++void CanvasContext2DImpl::fill()
++{
++    QPainter* p = acquirePainter();
++    p->fillPath(path, p->brush());
++}
++
++void CanvasContext2DImpl::stroke()
++{
++    QPainter* p = acquirePainter();
++    p->strokePath(path, p->pen());
++}
++
++
++static int cnt = 0;
++
++void CanvasContext2DImpl::clip()
++{
++    ++cnt;
++
++    PaintState& state = activeState();
++    QPainterPath pathCopy = path;
++    pathCopy.closeSubpath();
++
++    //### evil workaround for apparent Qt bug(?)
++/*    QTransform t;
++    t.translate(-0.0001*cnt, cnt*0.0001);
++    pathCopy = t.map(pathCopy);*/
++    
++    state.clipPath = state.clipPath.intersected(state.transform.map(pathCopy));
++    state.clipPath.setFillRule(Qt::WindingFill);
++    dirty |= DrtClip;
++}
++
++void CanvasContext2DImpl::arcTo(float x1, float y1, float x2, float y2, float radius, int& exceptionCode)
++{
++    exceptionCode = 0;
++
++    if (radius <= 0) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return;
++    }
++
++    //### FIXME busted
++    //me no feely like doing math to convert this correctly, yo
++    path.arcTo(x1, y1, x2-x1, y2-y1, radius, 90);
++}
++
++void CanvasContext2DImpl::arc(float xc, float yc, float radius, float sar, float ear,
++                              bool counterClockWise, int& exceptionCode)
++{
++    exceptionCode = 0;
++
++    if (radius <= 0) {
++        exceptionCode = DOMException::INDEX_SIZE_ERR;
++        return;
++    }
++    
++    //### HACK
++    // In Qt we don't switch the coordinate system for degrees
++    // and still use the 0,0 as bottom left for degrees so we need
++    // to switch
++    sar = -sar;
++    ear = -ear;
++    counterClockWise = !counterClockWise;
++    //end hack
++
++    float sa = degrees( sar );
++    float ea = degrees( ear );
++
++    double span = 0;
++
++    double xs     = xc - radius;
++    double ys     = yc - radius;
++    double width  = radius*2;
++    double height = radius*2;
++
++    if ( !counterClockWise && ( ea < sa ) ) {
++        span += 360;
++    } else if ( counterClockWise && ( sa < ea ) ) {
++        span -= 360;
++    }
++
++    //### this is also due to switched coordinate system
++    // we would end up with a 0 span instead of 360
++    if ( !( qFuzzyCompare( span + ( ea - sa ), 0.0 ) &&
++            qFuzzyCompare( fabs( span ), 360.0 ) ) ) {
++        span   += ea - sa;
++    }
++
++    path.moveTo( QPointF( xc + radius  * cos( sar ),
++                          yc - radius  * sin( sar ) ) );
++    path.arcTo(xs, ys, width, height, sa, span);
++}
++
++// Image stuff
++void CanvasContext2DImpl::drawImage(ElementImpl* image, float dx, float dy, int& exceptionCode)
++{
++    exceptionCode = 0;
++    QImage img = extractImage(image, exceptionCode);
++    if (exceptionCode)
++        return;
++
++    QPainter* p = acquirePainter();
++    p->drawImage(QPointF(dx, dy), img);
++}
++
++void CanvasContext2DImpl::drawImage(ElementImpl* image, float dx, float dy, float dw, float dh,
++                                    int& exceptionCode)
++{
++    //### do we need DoS protection here?
++    exceptionCode = 0;
++    QImage img = extractImage(image, exceptionCode);
++    if (exceptionCode)
++        return;
++
++    QPainter* p = acquirePainter();
++    p->drawImage(QRectF(dx, dy, dw, dh), img);
++}
++
++void CanvasContext2DImpl::drawImage(ElementImpl* image,
++                                    float sx, float sy, float sw, float sh,
++                                    float dx, float dy, float dw, float dh,
++                                    int& exceptionCode)
++{
++    //### do we need DoS protection here?
++    exceptionCode = 0;
++    QImage img = extractImage(image, exceptionCode);
++    if (exceptionCode)
++        return;
++
++    QPainter* p = acquirePainter();
++    p->drawImage(QRectF(dx, dy, dw, dh), img, QRectF(sx, sy, sw, sh));
++}
++
++// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- a/khtml/html/htmlparser.h
++++ b/khtml/html/htmlparser.h
+@@ -119,6 +119,8 @@
+ 
+     void pushBlock( int _id, int _level);
+ 
++    void generateImpliedEndTags( int _id );
++    void popOptionalBlock( int _id );
+     void popBlock( int _id );
+     void popOneBlock(bool delBlock = true);
+     void popInlineBlocks();
+--- a/khtml/html/html_elementimpl.cpp
++++ b/khtml/html/html_elementimpl.cpp
+@@ -495,7 +495,7 @@
+ DocumentFragment HTMLElementImpl::createContextualFragment( const DOMString &html )
+ {
+     // the following is in accordance with the definition as used by IE
+-    if( endTag[id()] == FORBIDDEN )
++    if( endTagRequirement(id()) == FORBIDDEN )
+         return DocumentFragment();
+     // IE disallows innerHTML on inline elements.
+     // I don't see why we should have this restriction, as our
+@@ -582,7 +582,7 @@
+ void HTMLElementImpl::setInnerText( const DOMString &text, int& exceptioncode )
+ {
+     // following the IE specs.
+-    if( endTag[id()] == FORBIDDEN ) {
++    if( endTagRequirement(id()) == FORBIDDEN ) {
+         exceptioncode = DOMException::NO_MODIFICATION_ALLOWED_ERR;
+         return;
+     }
+@@ -653,7 +653,7 @@
+ 	DOMString result = openTagStartToString();
+ 	result += ">";	//krazy:exclude=doublequote_chars DOM demands chars
+ 
+-	if (endTag[id()] == REQUIRED) {
++	if (endTagRequirement(id()) == REQUIRED) {
+ 	    result += "</";
+ 	    result += tagName();
+ 	    result += ">";	//krazy:exclude=doublequote_chars DOM demands chars
+--- a/khtml/html/dtd.cpp
++++ b/khtml/html/dtd.cpp
+@@ -2,7 +2,7 @@
+  * This file is part of the DOM implementation for KDE.
+  *
+  * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+- *           (C) 2006 Allan Sandfeld Jensen (kde at carewolf.com)
++ *           (C) 2006-2007 Allan Sandfeld Jensen (kde at carewolf.com)
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Library General Public
+@@ -22,7 +22,6 @@
+  */
+ 
+ #include "html/dtd.h"
+-#include "misc/htmlhashes.h"
+ 
+ using namespace DOM;
+ 
+@@ -35,23 +34,22 @@
+ //
+ // 0 elements with forbidden close tag and text. They don't get pushed
+ //   to the stack.
+-// 1 inline elements
+-// 2 form elements
+-// 3 regular block level elements
+-// 4 lists (OL UL DIR MENU)
+-// 5 TD TH SELECT
+-// 6 TR
+-// 7 tbody thead tfoot caption  object
+-// 8 table
+-// 9 body frameset
+-// 10 html
++// 1 formatting elements
++// 3 form nobr noscript
++// 5 phrasing elements
++// 6 TD TH SELECT
++// 7 TR
++// 8 tbody thead tfoot
++// 9 table
++// 10 body frameset head noembed noframes
++// 11 html
+ 
+-const unsigned short KDE_NO_EXPORT DOM::tagPriority[] = {
++const unsigned short KDE_NO_EXPORT DOM::tagPriorityArray[] = {
+     0, // 0
+     1, // ID_A == 1
+     1, // ID_ABBR
+     1, // ID_ACRONYM
+-    3, // ID_ADDRESS
++    5, // ID_ADDRESS
+     1, // ID_APPLET
+     0, // ID_AREA
+     1, // ID_B
+@@ -63,23 +61,23 @@
+    10, // ID_BODY
+     0, // ID_BR
+     1, // ID_BUTTON
+-    0, // ID_CANVAS
++    1, // ID_CANVAS
+     5, // ID_CAPTION
+     5, // ID_CENTER
+     1, // ID_CITE
+     1, // ID_CODE
+     0, // ID_COL
+     1, // ID_COLGROUP
+-    3, // ID_DD
++    5, // ID_DD
+     1, // ID_DEL
+     1, // ID_DFN
+     5, // ID_DIR
+     5, // ID_DIV
+     5, // ID_DL
+-    3, // ID_DT
++    5, // ID_DT
+     1, // ID_EM
+     0, // ID_EMBED
+-    3, // ID_FIELDSET
++    5, // ID_FIELDSET
+     1, // ID_FONT
+     3, // ID_FORM
+     0, // ID_FRAME
+@@ -105,10 +103,10 @@
+     1, // ID_LABEL
+     1, // ID_LAYER
+     1, // ID_LEGEND
+-    3, // ID_LI
++    5, // ID_LI
+     0, // ID_LINK
+     1, // ID_MAP
+-    3, // ID_MARQUEE
++    5, // ID_MARQUEE
+     5, // ID_MENU
+     0, // ID_META
+     5, // ID_NOBR
+@@ -120,7 +118,7 @@
+     5, // ID_OL
+     1, // ID_OPTGROUP
+     2, // ID_OPTION
+-    3, // ID_P
++    5, // ID_P
+     0, // ID_PARAM
+     5, // ID_PLAINTEXT
+     5, // ID_PRE
+@@ -136,7 +134,7 @@
+     1, // ID_STYLE
+     1, // ID_SUB
+     1, // ID_SUP
+-    9,// ID_TABLE
++    9, // ID_TABLE
+     8, // ID_TBODY
+     6, // ID_TD
+     1, // ID_TEXTAREA
+@@ -154,7 +152,7 @@
+     0, // ID_TEXT
+ };
+ 
+-const tagStatus DOM::endTag[] = {
++const tagStatus DOM::endTagArray[] = {
+     REQUIRED,  // 0
+     REQUIRED,  // ID_A == 1
+     REQUIRED,  // ID_ABBR
+@@ -171,7 +169,7 @@
+     REQUIRED,  // ID_BODY
+     FORBIDDEN, // ID_BR
+     REQUIRED,  // ID_BUTTON
+-    FORBIDDEN, // ID_CANVAS
++    REQUIRED,  // ID_CANVAS
+     REQUIRED,  // ID_CAPTION
+     REQUIRED,  // ID_CENTER
+     REQUIRED,  // ID_CITE
+@@ -372,7 +370,7 @@
+ };
+ 
+ 
+-static const ushort tag_list_7[] = {
++static const ushort tag_list_select[] = {
+     ID_TEXT,
+     ID_OPTGROUP,
+     ID_OPTION,
+@@ -381,7 +379,7 @@
+     0
+ };
+ 
+-static const ushort tag_list_10[] = {
++static const ushort tag_list_frame[] = {
+     ID_FRAMESET,
+     ID_FRAME,
+     ID_NOFRAMES,
+@@ -389,7 +387,7 @@
+     0
+ };
+ 
+-static const ushort tag_list_11[] = {
++static const ushort tag_list_head[] = {
+     ID_SCRIPT,
+     ID_STYLE,
+     ID_META,
+@@ -434,11 +432,14 @@
+ {
+     //kDebug( 6030 ) << "checkChild: " << tagID << "/" << childID;
+ 
+-    if (tagID >= 1000 || childID >= 1000)
+-        return true; // one or both of the elements in an XML element; just allow for now
+-
+     if (childID == ID_COMMENT) return true;
+ 
++    // Treat custom elements the same as <span>.
++    if (tagID > ID_LAST_TAG)
++        tagID = ID_SPAN;
++    if (childID > ID_LAST_TAG)
++        childID = ID_SPAN;
++
+     switch(tagID)
+     {
+     case ID_TT:
+@@ -475,7 +476,7 @@
+         return check_flow(childID, true);
+     case ID_P:
+         // P: %inline *
+-        return check_inline(childID, strict) || 
++        return check_inline(childID, strict) ||
+                (!strict && childID == ID_TABLE );
+     case ID_H1:
+     case ID_H2:
+@@ -507,11 +508,11 @@
+         return check_flow(childID, strict);
+     case ID_ADDRESS:
+         // ADDRESS: %inline *
+-        return check_inline(childID, strict) || 
++        return check_inline(childID, strict) ||
+                (!strict && childID == ID_P);
+     case ID_DT:
+         // DT: %inline *
+-        return check_inline(childID, strict) || 
++        return check_inline(childID, strict) ||
+               (!strict && check_block(childID, true) && childID != ID_DL);
+     case ID_LI:
+     case ID_DIV:
+@@ -530,10 +531,11 @@
+     case ID_NOSCRIPT:
+     case ID_CAPTION:
+     case ID_MARQUEE:
++    case ID_CANVAS:
+         // DIV: %flow *
+         return check_flow(childID, strict);
+     case ID_MAP:
+-        // MAP: ( %block | AREA ) + 
++        // MAP: ( %block | AREA ) +
+         return check_block(childID, true) || childID == ID_AREA ||
+                (!strict && childID == ID_SCRIPT);
+     case ID_OBJECT:
+@@ -548,16 +550,14 @@
+         return check_flow(childID, true);
+     case ID_DL:
+         // DL: DT | DD +
+-        return (childID == ID_DT || childID == ID_DD || childID == ID_TEXT) || 
+-               (!strict && check_flow(childID, true));
++        return (childID == ID_DT || childID == ID_DD || check_flow(childID, strict));
+     case ID_OL:
+     case ID_UL:
+     case ID_DIR:
+     case ID_MENU:
+         // OL: LI +
+-        // For DIR and MENU, the DTD says - %block, but it contradicts spec language.. 
+-        return (childID == ID_LI || childID == ID_TEXT) || 
+-               (!strict && check_flow(childID, true));
++        // For DIR and MENU, the DTD says - %block, but it contradicts spec language..
++        return (childID == ID_LI || check_flow(childID, strict));
+     case ID_FORM:
+         // FORM: %flow * - FORM
+         return check_flow(childID, strict);
+@@ -572,7 +572,7 @@
+         // Yes, consider it a hack (Dirk)
+     case ID_SELECT:
+         // SELECT: _7 +
+-        return check_array(childID, tag_list_7);
++        return check_array(childID, tag_list_select);
+     case ID_OPTGROUP:
+         // OPTGROUP: OPTION +
+         if(childID == ID_OPTION) return true;
+@@ -624,10 +624,10 @@
+         return (childID == ID_TH || childID == ID_TD || childID == ID_SCRIPT);
+     case ID_FRAMESET:
+         // FRAMESET: _10
+-        return check_array(childID, tag_list_10);
++        return check_array(childID, tag_list_frame);
+     case ID_HEAD:
+         // HEAD: _11
+-        return check_array(childID, tag_list_11);
++        return check_array(childID, tag_list_head);
+     case ID_HTML:
+         // HTML: ( HEAD , COMMENT, ( BODY | ( FRAMESET & NOFRAMES ? ) ) )
+         switch(childID)
+--- a/khtml/html/html_formimpl.h
++++ b/khtml/html/html_formimpl.h
+@@ -29,8 +29,6 @@
+ #include "html/html_imageimpl.h"
+ #include "dom/html_element.h"
+ 
+-#include <Qt3Support/Q3PtrList>
+-
+ class QTextCodec;
+ 
+ namespace khtml
+@@ -110,8 +108,8 @@
+ 
+ private:
+     void gatherWalletData();
+-    Q3PtrList<HTMLGenericFormElementImpl> formElements;
+-    Q3PtrList<HTMLImageElementImpl> imgElements;
++    QList<HTMLGenericFormElementImpl*> formElements;
++    QList<HTMLImageElementImpl*> imgElements;
+     DOMString m_target;
+     DOMString m_enctype;
+     QString m_boundary;
+--- a/khtml/html/htmlparser.cpp
++++ b/khtml/html/htmlparser.cpp
+@@ -259,10 +259,6 @@
+     {
+         ElementImpl *e = static_cast<ElementImpl *>(n);
+         e->setAttributeMap(t->attrs);
+-
+-        // take care of optional close tags
+-        if(endTag[e->id()] == DOM::OPTIONAL)
+-            popBlock(t->tid);
+     }
+ 
+     // if this tag is forbidden inside the current context, pop
+@@ -282,7 +278,7 @@
+     }
+ 
+     // the tokenizer needs the feedback for space discarding
+-    if ( tagPriority[t->tid] == 0 )
++    if ( tagPriority(t->tid) == 0 )
+ 	t->flat = true;
+ 
+     if ( !insertNode(n, t->flat) ) {
+@@ -335,13 +331,13 @@
+         }
+ 
+ 	// don't push elements without end tag on the stack
+-        if(tagPriority[id] != 0 && !flat) {
++        if(tagPriority(id) != 0 && !flat) {
+ #if SPEED_DEBUG < 2
+             if(!n->attached() && HTMLWidget )
+                 n->attach();
+ #endif
+ 	    if(n->isInline()) m_inline = true;
+-            pushBlock(id, tagPriority[id]);
++            pushBlock(id, tagPriority(id));
+             setCurrent( newNode );
+         } else {
+ #if SPEED_DEBUG < 2
+@@ -359,7 +355,7 @@
+ 
+ 
+ #if SPEED_DEBUG < 1
+-        if(tagPriority[id] == 0 && n->renderer())
++        if(tagPriority(id) == 0 && n->renderer())
+             n->renderer()->calcMinMaxWidth();
+ #endif
+         return true;
+@@ -452,7 +448,7 @@
+             if ( head ) {
+                 DOM::NodeImpl *newNode = head->addChild(n);
+                 if ( newNode ) {
+-                    pushBlock(id, tagPriority[id]);
++                    pushBlock(id, tagPriority(id));
+                     setCurrent ( newNode );
+ #if SPEED_DEBUG < 2
+ 		    if(!n->attached() && HTMLWidget)
+@@ -573,7 +569,7 @@
+                     NodeImpl* table = tsection->parent();
+                     int exceptioncode = 0;
+                     table->insertBefore(n, tsection, exceptioncode);
+-                    pushBlock(id, tagPriority[id]);
++                    pushBlock(id, tagPriority(id));
+                     setCurrent(n);
+                     inStrayTableContent++;
+                     blockStack->strayTableContent = true;
+@@ -712,10 +708,10 @@
+                             kDebug(6035) << "adding content before table failed..";
+                         break;
+                     }
+-                    if ( n->isElementNode() && tagPriority[id] != 0 &&
+-                         !flat && endTag[id] != DOM::FORBIDDEN ) {
++                    if ( n->isElementNode() && tagPriority(id) != 0 &&
++                         !flat && endTagRequirement(id) != DOM::FORBIDDEN ) {
+ 
+-                        pushBlock(id, tagPriority[id]);
++                        pushBlock(id, tagPriority(id));
+                         setCurrent ( n );
+                         inStrayTableContent++;
+                         blockStack->strayTableContent = true;
+@@ -947,6 +943,7 @@
+         n = new HTMLOptGroupElementImpl(document, form);
+         break;
+     case ID_OPTION:
++        popOptionalBlock(ID_OPTION);
+         n = new HTMLOptionElementImpl(document, form);
+         break;
+     case ID_SELECT:
+@@ -962,14 +959,14 @@
+         n = new HTMLDListElementImpl(document);
+         break;
+     case ID_DD:
++        popOptionalBlock(ID_DT);
++        popOptionalBlock(ID_DD);
+         n = new HTMLGenericElementImpl(document, t->tid);
+-        popBlock(ID_DT);
+-        popBlock(ID_DD);
+         break;
+     case ID_DT:
++        popOptionalBlock(ID_DD);
++        popOptionalBlock(ID_DT);
+         n = new HTMLGenericElementImpl(document, t->tid);
+-        popBlock(ID_DD);
+-        popBlock(ID_DT);
+         break;
+     case ID_UL:
+     {
+@@ -988,7 +985,7 @@
+         n = new HTMLMenuElementImpl(document);
+         break;
+     case ID_LI:
+-        popBlock(ID_LI);
++        popOptionalBlock(ID_LI);
+         n = new HTMLLIElementImpl(document);
+         break;
+ // formatting elements (block)
+@@ -1104,16 +1101,16 @@
+         break;
+     case ID_TD:
+     case ID_TH:
+-        popBlock(ID_TH);
+-        popBlock(ID_TD);
++        popOptionalBlock(ID_TH);
++        popOptionalBlock(ID_TD);
+         n = new HTMLTableCellElementImpl(document, t->tid);
+         break;
+     case ID_TBODY:
+     case ID_THEAD:
+     case ID_TFOOT:
+-        popBlock( ID_THEAD );
+-        popBlock( ID_TBODY );
+-        popBlock( ID_TFOOT );
++        popOptionalBlock( ID_THEAD );
++        popOptionalBlock( ID_TBODY );
++        popOptionalBlock( ID_TFOOT );
+         n = new HTMLTableSectionElementImpl(document, t->tid, false);
+         break;
+ 
+@@ -1162,7 +1159,7 @@
+     case ID_WBR:
+     case ID_NOBR:
+         if ( t->tid == ID_NOBR || t->tid == ID_WBR )
+-            popBlock( t->tid );
++            popOptionalBlock( t->tid );
+     case ID_BDO:
+         n = new HTMLGenericElementImpl(document, t->tid);
+         break;
+@@ -1203,7 +1200,9 @@
+         n = new CommentImpl(document, t->text);
+         break;
+     default:
+-        kDebug( 6035 ) << "Unknown tag " << t->tid << "!";
++        n = new HTMLGenericElementImpl(document, t->tid);
++        break;
++//         kDebug( 6035 ) << "Unknown tag " << t->tid << "!";
+     }
+     return n;
+ }
+@@ -1246,7 +1245,8 @@
+         child = child->nextSibling();
+     }
+ #endif
+-    popBlock(t->tid-ID_CLOSE_TAG);
++    generateImpliedEndTags( t->tid - ID_CLOSE_TAG );
++    popBlock( t->tid - ID_CLOSE_TAG );
+ #ifdef PARSER_DEBUG
+     kDebug( 6035 ) << "closeTag --> current = " << current->nodeName().string();
+ #endif
+@@ -1256,17 +1256,18 @@
+ {
+     switch (_id) {
+         case ID_A:
+-        case ID_FONT:
+-        case ID_TT:
+-        case ID_U:
+         case ID_B:
++        case ID_BIG:
++        case ID_EM:
++        case ID_FONT:
+         case ID_I:
++        case ID_NOBR:
+         case ID_S:
+-        case ID_STRIKE:
+-        case ID_BIG:
+         case ID_SMALL:
+-        case ID_EM:
++        case ID_STRIKE:
+         case ID_STRONG:
++        case ID_TT:
++        case ID_U:
+         case ID_DFN:
+         case ID_CODE:
+         case ID_SAMP:
+@@ -1275,7 +1276,6 @@
+         case ID_DEL:
+         case ID_INS:
+         case ID_WBR:
+-        case ID_NOBR:
+             return true;
+         default:
+             return false;
+@@ -1541,6 +1541,46 @@
+     addForbidden(_id, forbiddenTag);
+ }
+ 
++void KHTMLParser::generateImpliedEndTags( int _id )
++{
++    HTMLStackElem *Elem = blockStack;
++
++    int level = tagPriority(_id);
++    while( Elem && Elem->id != _id)
++    {
++        HTMLStackElem *NextElem = Elem->next;
++        if (endTagRequirement(Elem->id) == DOM::OPTIONAL && Elem->level <= level) {
++            popOneBlock();
++        }
++        else
++            break;
++        Elem = NextElem;
++    }
++}
++
++void KHTMLParser::popOptionalBlock( int _id )
++{
++    bool found = false;
++    HTMLStackElem *Elem = blockStack;
++
++    int level = tagPriority(_id);
++    while( Elem )
++    {
++        if (Elem->id == _id) {
++            found = true;
++            break;
++        }
++        if (Elem->level > level || (endTagRequirement(Elem->id) != DOM::OPTIONAL && !isResidualStyleTag(Elem->id)) )
++            break;
++        Elem = Elem->next;
++    }
++
++    if (found) {
++        generateImpliedEndTags(_id);
++        popBlock(_id);
++    }
++}
++
+ void KHTMLParser::popBlock( int _id )
+ {
+     HTMLStackElem *Elem = blockStack;
+--- a/khtml/html/html_objectimpl.h
++++ b/khtml/html/html_objectimpl.h
+@@ -42,6 +42,7 @@
+ 
+     virtual void parseAttribute(AttributeImpl *attr);
+     virtual void attach();
++    virtual void defaultEventHandler(EventImpl *e);
+ 
+     virtual void recalcStyle( StyleChange ch );
+ 
+--- a/khtml/html/html_documentimpl.cpp
++++ b/khtml/html/html_documentimpl.cpp
+@@ -51,6 +51,7 @@
+ #include <kglobalsettings.h>
+ #include <ktoolinvocation.h>
+ #include <QtDBus/QtDBus>
++#include <kcookiejar_interface.h>
+ 
+ #include "css/cssproperties.h"
+ #include "css/cssstyleselector.h"
+@@ -114,10 +115,8 @@
+     if ( v && v->topLevelWidget() )
+       windowId = v->topLevelWidget()->winId();
+ 
+-    QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar",
+-                              "org.kde.KCookieServer");
+-    QDBusReply<QString> reply = kcookiejar.call("findDOMCookies",
+-                                                URL().url(), qlonglong(windowId));
++    org::kde::KCookieServer kcookiejar("org.kde.kded", "/modules/kcookiejar", QDBusConnection::sessionBus());
++    QDBusReply<QString> reply = kcookiejar.findDOMCookies(URL().url(), qlonglong(windowId));
+ 
+     if ( !reply.isValid() )
+     {
+@@ -136,24 +135,14 @@
+     if ( v && v->topLevelWidget() )
+       windowId = v->topLevelWidget()->winId();
+ 
+-    QString fake_header("Set-Cookie: ");
++    QByteArray fake_header("Set-Cookie: ");
+     fake_header.append(value.string().toLatin1().constData());
+     fake_header.append("\n");
+-    QDBusInterface *kcookiejar = new QDBusInterface("org.kde.kded", "/modules/kcookiejar",
+-                                                    "org.kde.KCookieServer");
+-    if (!kcookiejar->isValid())
+-    {
+-        // Maybe it wasn't running (e.g. we're opening local html files)
+-        QDBusInterface("org.kde.kded", "/kded", "org.kde.kded").call("loadModule", QByteArray("kcookiejar"));
+-        delete kcookiejar;
+-        kcookiejar = new QDBusInterface("org.kde.kded", "/modules/kcookiejar",
+-                                        "org.kde.KCookieServer");
+-    }
+-
+-    kcookiejar->call(QDBus::NoBlock, "addCookies",
++    // Note that kded modules are autoloaded so we don't need to call loadModule ourselves.
++    org::kde::KCookieServer kcookiejar("org.kde.kded", "/modules/kcookiejar", QDBusConnection::sessionBus());
++    // Can't use kcookiejar.addCookies because then we can't pass NoBlock...
++    kcookiejar.call(QDBus::NoBlock, "addCookies",
+                      URL().url(), fake_header, qlonglong(windowId));
+-
+-    delete kcookiejar;
+ }
+ 
+ 
+--- a/khtml/html/html_baseimpl.h
++++ b/khtml/html/html_baseimpl.h
+@@ -199,6 +199,7 @@
+     virtual void parseAttribute(AttributeImpl *attr);
+     virtual void attach();
+     virtual void recalcStyle( StyleChange ch );
++    virtual void defaultEventHandler(EventImpl *evt);
+ 
+ protected:
+ 
+--- a/khtml/html/html_canvasimpl.h
++++ b/khtml/html/html_canvasimpl.h
+@@ -1,4 +1,5 @@
+ /*
++ * Copyright (C) 2007 Maksim Orlovich <maksim at kde.org>
+  * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+@@ -25,32 +26,284 @@
+ #ifndef HTML_CANVASIMPL_H
+ #define HTML_CANVASIMPL_H
+ 
+-#include "html/html_imageimpl.h"
+-#include "html/html_inlineimpl.h"
++#include "dom/dom_string.h"
++#include "html/html_elementimpl.h"
+ #include "misc/khtmllayout.h"
+ #include "rendering/render_object.h"
+ 
+ #include <QtGui/QRegion>
+ #include <QtCore/QMap>
++#include <QtCore/QStack>
+ #include <QtGui/QPixmap>
++#include <QtGui/QGradient>
++
++namespace khtmlImLoad {
++    class CanvasImage;
++}
+ 
+ namespace DOM {
+ 
++class CanvasContext2DImpl;
+ 
+-class HTMLCanvasElementImpl
+-    : public HTMLImageElementImpl
++class HTMLCanvasElementImpl : public HTMLElementImpl
+ {
+ public:
+     HTMLCanvasElementImpl(DocumentImpl *doc);
+     ~HTMLCanvasElementImpl();
+ 
++    virtual void parseAttribute(AttributeImpl*);
+     virtual Id id() const;
+ 
+     virtual void attach();
+-    virtual void detach();
++
++    int width () const { return w; }
++    int height() const { return h; }
++
++    CanvasContext2DImpl* getContext2D();
++
++    // Returns the canvas image, but does not guarantee it's
++    // up-to-date
++    khtmlImLoad::CanvasImage* getCanvasImage();
++private:
++    int w, h;
++    SharedPtr<CanvasContext2DImpl> context;
++};
++
++// Base class for representing styles for fill and stroke.
++// Not part of the DOM
++class CanvasStyleBaseImpl : public khtml::Shared<CanvasStyleBaseImpl>
++{
++public:
++    enum Type {
++        Color,
++        Gradient,
++        Pattern
++    };
++
++    virtual ~CanvasStyleBaseImpl() {}
++    
++    virtual Type   type() const = 0;
++    virtual QBrush toBrush() const = 0;
++};
++
++
++// Not part of the DOM.
++class CanvasColorImpl : public CanvasStyleBaseImpl
++{
++public:
++    QColor color;
++
++    CanvasColorImpl(const QColor& newColor) : color(newColor)
++    {}
++
++    virtual Type type() const { return Color; }
++
++    virtual QBrush toBrush() const {
++        return QBrush(color);
++    }
++
++    DOM::DOMString toString() const;
++
++    // Note: returns 0 if it can not be parsed.
++    static CanvasColorImpl* fromString(const DOM::DOMString &s);
++};
++
++
++class CanvasPatternImpl : public CanvasStyleBaseImpl
++{
++public:
++    CanvasPatternImpl(const QImage& inImg, bool rx, bool ry);
++    
++    virtual Type type() const { return Pattern; }
++    virtual QBrush toBrush() const;
++private:
++    QImage img;
++    bool   repeatX, repeatY;
++};
++
++class CanvasGradientImpl : public CanvasStyleBaseImpl
++{
++public:
++    CanvasGradientImpl(QGradient* newGradient);
++    ~CanvasGradientImpl();
++
++    // Our internal interface..
++    virtual Type type() const { return Gradient; }
++    virtual QBrush toBrush() const;
++
++    // DOM API
++    void addColorStop(float offset, const DOM::DOMString& color, int& exceptionCode);
++private:
++    QGradient* gradient;
++};
++
++class CanvasContext2DImpl : public khtml::Shared<CanvasContext2DImpl>
++{
++public:
++    CanvasContext2DImpl(HTMLCanvasElementImpl* element, int width, int height);
++    ~CanvasContext2DImpl();
++
++    // Note: the native API does not attempt to validate
++    // input for NaN and +/- infinity to raise exceptions;
++    // but it does handle them for transformations
++
++    // For renderer..
++    void commit();
++
++    // Public API, exported via the DOM.
++    HTMLCanvasElementImpl* canvas() const;
++
++    // State management
++    void save();
++    void restore();
++
++    // Transformations
++    void scale(float x, float y);
++    void rotate(float angle);
++    void translate(float x, float y);
++    void transform(float m11, float m12, float m21, float m22, float dx, float dy);
++    void setTransform(float m11, float m12, float m21, float m22, float dx, float dy);
++
++    // Composition state setting
++    float globalAlpha() const;
++    void  setGlobalAlpha(float a);
++    DOMString globalCompositeOperation() const;
++    void  setGlobalCompositeOperation(const DOMString& op);
++
++    // Colors and styles..
++    void setStrokeStyle(CanvasStyleBaseImpl* strokeStyle);
++    CanvasStyleBaseImpl* strokeStyle() const;
++    void setFillStyle(CanvasStyleBaseImpl* fillStyle);
++    CanvasStyleBaseImpl* fillStyle() const;
++    CanvasGradientImpl* createLinearGradient(float x0, float y0, float x1, float y1) const;
++    CanvasGradientImpl* createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, int& exceptionCode) const;
++    CanvasPatternImpl*  createPattern(ElementImpl* pat, const DOMString& rpt, int& exceptionCode) const;
++
++    // Line attributes
++    float lineWidth() const;
++    void  setLineWidth(float newLW);
++    DOMString lineCap() const;
++    void  setLineCap(const DOMString& newCap);
++    DOMString lineJoin() const;
++    void  setLineJoin(const DOMString& newJoin);
++    float miterLimit() const;
++    void  setMiterLimit(float newML);
++
++    // Rectangle operations
++    void clearRect (float x, float y, float w, float h, int& exceptionCode);
++    void fillRect  (float x, float y, float w, float h, int& exceptionCode);
++    void strokeRect(float x, float y, float w, float h, int& exceptionCode);
++
++    // Path-based ops
++    void beginPath();
++    void closePath();
++    void moveTo(float x, float y);
++    void lineTo(float x, float y);
++    void quadraticCurveTo(float cpx, float cpy, float x, float y);
++    void bezierCurveTo   (float cp1x, float cp1y, float cp2x, float cp2y, float x, float y);
++    void arcTo(float x1, float y1, float x2, float y2, float radius, int& exceptionCode);
++    void rect(float x, float y, float w, float h, int& exceptionCode);
++    void arc(float x, float y, float radius, float startAngle, float endAngle,
++             bool ccw, int& exceptionCode);
++    void fill();
++    void stroke();
++    void clip();
++    bool isPointInPath(float x, float y);
++
++    // Image ops
++    void drawImage(ElementImpl* image, float dx, float dy, int& exceptionCode);
++    void drawImage(ElementImpl* image, float dx, float dy, float dw, float dh, int& exceptionCode);
++    void drawImage(ElementImpl* image, float sx, float sy, float sw, float sh,
++                   float dx, float dy, float dw, float dh, int& exceptionCode);
++private:
++    friend class HTMLCanvasElementImpl;
++
++    // initialize canvas for new size
++    void resetContext(int width, int height);
++
++    // Cleared by canvas dtor..
++    HTMLCanvasElementImpl* canvasElement;
++    
++    // Helper for methods that take images via elements; this will extract them,
++    // and signal an exception if needed be
++    QImage extractImage(ElementImpl* el, int& exceptionCode) const;
++
++    // This method will prepare a painter for use, making sure it's active,
++    // that all the dirty state got sync'd, etc, and will mark the
++    // canvas as dirty so the renderer can flush everything, etc.
++    QPainter* acquirePainter();
++
++    // We use khtmlImLoad to manage our canvas image, so that
++    // the Renderer can scale easily.
++    khtmlImLoad::CanvasImage* canvasImage;
++
++    // The path is global, and never saved/restored
++    QPainterPath path;
++
++    // We keep track of non-path state ourselves. There are two reasons:
++    // 1) The painter may have to be end()ed so we can not rely on it to remember
++    //    things
++    // 2) The stroke and fill style can actually be DOM objects, so we have to
++    //    be able to hand them back
++    // "The canvas state" section of the spec describes what's included here
++    struct PaintState {
++        // Viewport state (not readable from outside)
++        QTransform    transform;
++        bool          infinityTransform; // Marks that the transform has become invalid,
++                                         // and should be treated as identity.
++        QPainterPath  clipPath; // This is in -physical- coordinates
++
++        // Compositing state
++        float globalAlpha;
++        QPainter::CompositionMode globalCompositeOperation;
++
++        // Stroke and fill styles.
++        SharedPtr<CanvasStyleBaseImpl> strokeStyle;
++        SharedPtr<CanvasStyleBaseImpl> fillStyle;
++
++        // Line stuff
++        float            lineWidth;
++        Qt::PenCapStyle  lineCap;
++        Qt::PenJoinStyle lineJoin;
++        float            miterLimit;
++
++        // ### TODO: shadow stuff
++    };
++
++    // The stack of states. The entry on the top is always the current state.
++    QStack<PaintState> stateStack;
++
++    const PaintState& activeState() const { return stateStack.top(); }
++    PaintState& activeState() { return stateStack.top(); }
++
++    enum DirtyFlags {
++        DrtTransform = 0x01,
++        DrtClip      = 0x02,
++        DrtAlpha     = 0x04,
++        DrtCompOp    = 0x08,
++        DrtStroke    = 0x10,
++        DrtFill      = 0x20,
++        DrtAll       = 0xFF
++    };
++
++    // The painter for working on the QImage. Might not be active.
++    // Should not be used directly, but rather via acquirePainter
++    QPainter workPainter;
++
++    // How out-of-date the painter is, if it is active.
++    int dirty;
++
++    // If we have not committed all the changes to the entire
++    // scaler hierarchy
++    bool needsCommit;
++
++    // Tells the element and then the renderer that we changed, so need
++    // repainting.
++    void needRendererUpdate();
+ };
+ 
+ 
+ } //namespace
+ 
+ #endif
++// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- /dev/null
++++ b/khtml/html/kcookiejar_include.h
+@@ -0,0 +1,2 @@
++// This is needed by the generated kcookiejar dbus interface code
++Q_DECLARE_METATYPE(QList<int>)
+--- a/khtml/ecma/kjs_navigator.cpp
++++ b/khtml/ecma/kjs_navigator.cpp
+@@ -39,8 +39,6 @@
+ #include <khtml_part.h>
+ #include <sys/utsname.h>
+ 
+-#include <Qt3Support/Q3PtrList>
+-
+ using namespace KJS;
+ 
+ namespace KJS {
+@@ -66,11 +64,11 @@
+             QString name;
+             QString file;
+             QString desc;
+-            Q3PtrList<MimeClassInfo> mimes;
++            QList<const MimeClassInfo*> mimes;
+         };
+ 
+-        static Q3PtrList<PluginInfo> *plugins;
+-        static Q3PtrList<MimeClassInfo> *mimes;
++        static QList<const PluginInfo*> *plugins;
++        static QList<const MimeClassInfo*> *mimes;
+ 
+     private:
+         static int m_refCount;
+@@ -116,7 +114,7 @@
+ 
+     class Plugin : public PluginBase {
+     public:
+-        Plugin( ExecState *exec, PluginBase::PluginInfo *info )
++        Plugin(ExecState *exec, const PluginBase::PluginInfo *info)
+           : PluginBase( exec, true )
+         { m_info = info; }
+         virtual bool getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot);
+@@ -124,9 +122,9 @@
+         static const ClassInfo info;
+         ValueImp *mimeByName(ExecState* exec, const QString& name ) const;
+         ValueImp *getValueProperty(ExecState *exec, int token) const;
+-        PluginBase::PluginInfo *pluginInfo() const { return m_info; }
++        const PluginBase::PluginInfo *pluginInfo() const { return m_info; }
+     private:
+-        PluginBase::PluginInfo *m_info;
++        const PluginBase::PluginInfo *m_info;
+         static ValueImp *indexGetter(ExecState *, JSObject*, const Identifier&, const PropertySlot&);
+         static ValueImp *nameGetter(ExecState *, JSObject*, const Identifier&, const PropertySlot&);
+     };
+@@ -134,7 +132,7 @@
+ 
+     class MimeType : public PluginBase {
+     public:
+-        MimeType( ExecState *exec, PluginBase::MimeClassInfo *info )
++        MimeType(ExecState *exec, const PluginBase::MimeClassInfo *info)
+           : PluginBase( exec, true )
+         { m_info = info; }
+         virtual bool getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot);
+@@ -142,15 +140,15 @@
+         static const ClassInfo info;
+         ValueImp *getValueProperty(ExecState *exec, int token) const;
+     private:
+-        PluginBase::MimeClassInfo *m_info;
++        const PluginBase::MimeClassInfo *m_info;
+     };
+ 
+ }
+ 
+ 
+-Q3PtrList<PluginBase::PluginInfo> *KJS::PluginBase::plugins = 0;
+-Q3PtrList<PluginBase::MimeClassInfo> *KJS::PluginBase::mimes = 0;
+-int KJS::PluginBase::m_refCount = 0;
++QList<const PluginBase::PluginInfo*> *KJS::PluginBase::plugins;
++QList<const PluginBase::MimeClassInfo*> *KJS::PluginBase::mimes;
++int KJS::PluginBase::m_refCount;
+ 
+ const ClassInfo Navigator::info = { "Navigator", 0, &NavigatorTable, 0 };
+ /*
+@@ -265,7 +263,7 @@
+         struct utsname name;
+         int ret = uname(&name);
+         if ( ret >= 0 )
+-            return String(QString::fromLatin1("%1 %1 X11").arg(name.sysname).arg(name.machine));
++            return String(QString::fromLatin1("%1 %2").arg(name.sysname).arg(name.machine));
+         else // can't happen
+             return String("Unix X11");
+     }
+@@ -276,7 +274,7 @@
+     if ( ret >= 0 )
+       return String(name.machine);
+     else // can't happen
+-      return String("x86");
++      return String("unknown");
+   }
+   case _Plugins:
+     return new Plugins(exec, m_part->pluginsEnabled());
+@@ -296,10 +294,8 @@
+   : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype() )
+ {
+     if ( loadPluginInfo && !plugins ) {
+-        plugins = new Q3PtrList<PluginInfo>;
+-        mimes = new Q3PtrList<MimeClassInfo>;
+-        plugins->setAutoDelete( true );
+-        mimes->setAutoDelete( true );
++        plugins = new QList<const PluginInfo*>;
++        mimes = new QList<const MimeClassInfo*>;
+ 
+         // read in using KServiceTypeTrader
+         const KService::List offers = KServiceTypeTrader::self()->query("Browser/View");
+@@ -316,20 +312,21 @@
+                     continue;
+             }
+             // read configuration
+-            KConfigGroup kc = KSharedConfig::openConfig( KStandardDirs::locate ("data", pluginsinfo.toString()) )->group( "0" );
+-            const int num = kc.readEntry("number", 0);
++            QString fn = KStandardDirs::locate("data", pluginsinfo.toString());
++            const KSharedConfig::Ptr sc = KSharedConfig::openConfig(fn);
++            const int num = sc->group("").readEntry("number", 0);
+             for ( int n = 0; n < num; n++ ) {
+-                kc.changeGroup( QString::number(n) );
++                const KConfigGroup kc = sc->group(QString::number(n));
+                 PluginInfo *plugin = new PluginInfo;
+ 
+                 plugin->name = kc.readEntry("name");
+-                plugin->file = kc.readPathEntry("file");
++                plugin->file = kc.readPathEntry("file", QString());
+                 plugin->desc = kc.readEntry("description");
+ 
+                 plugins->append( plugin );
+ 
+-                QStringList types = kc.readEntry("mime", QStringList(), ';');
+-                QStringList::Iterator type;
++                const QStringList types = kc.readXdgListEntry("mime");
++                QStringList::const_iterator type;
+                 for ( type=types.begin(); type!=types.end(); ++type ) {
+ 
+                     // get mime information
+@@ -366,6 +363,10 @@
+ {
+     m_refCount--;
+     if ( m_refCount==0 ) {
++        if (plugins)
++            qDeleteAll(*plugins);
++        if (mimes)
++            qDeleteAll(*mimes);
+         delete plugins;
+         delete mimes;
+         plugins = 0;
+@@ -387,7 +388,7 @@
+ */
+ KJS_IMPLEMENT_PROTOFUNC(PluginsFunc)
+ 
+-ValueImp *Plugins::getValueProperty(ExecState *exec, int token) const
++ValueImp *Plugins::getValueProperty(ExecState*, int token) const
+ {
+   assert(token == Plugins_Length);
+   if (pluginsEnabled())
+@@ -396,12 +397,12 @@
+     return Number(0);
+ }
+ 
+-ValueImp *Plugins::indexGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *Plugins::indexGetter(ExecState* exec, JSObject*, const Identifier& /*propertyName*/, const PropertySlot& slot)
+ {
+   return new Plugin(exec, plugins->at(slot.index()));
+ }
+ 
+-ValueImp *Plugins::nameGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *Plugins::nameGetter(ExecState* exec, JSObject*, const Identifier& propertyName, const PropertySlot& /*slot*/)
+ {
+   return pluginByName(exec, propertyName.qstring());
+ }
+@@ -418,14 +419,15 @@
+     // plugins[#]
+     bool ok;
+     unsigned int i = propertyName.toUInt32(&ok);
+-    if (ok && i < plugins->count()) {
++    if (ok && i < static_cast<unsigned>(plugins->count())) {
+       slot.setCustomIndex(this, i, indexGetter);
+       return true;
+     }
+ 
+     // plugin[name]
+-    for (PluginInfo *pl = plugins->first(); pl; pl = plugins->next()) {
+-      if (pl->name == propertyName.qstring()) {
++    QList<const PluginInfo*>::const_iterator it, end = plugins->constEnd();
++    for (it = plugins->constBegin(); it != end; ++it) {
++      if ((*it)->name == propertyName.qstring()) {
+         slot.setCustom(this, nameGetter);
+         return true;
+       }
+@@ -437,9 +439,10 @@
+ 
+ ValueImp *Plugins::pluginByName( ExecState* exec, const QString& name )
+ {
+-  for ( PluginInfo *pl = plugins->first(); pl!=0; pl = plugins->next() ) {
+-    if ( pl->name == name )
+-      return new Plugin( exec, pl );
++  QList<const PluginInfo*>::const_iterator it, end = plugins->end();
++  for (it = plugins->begin(); it != end; ++it) {
++    if ((*it)->name == name)
++      return new Plugin(exec, *it);
+   }
+   return Undefined();
+ }
+@@ -458,7 +461,7 @@
+   {
+     bool ok;
+     unsigned int i = args[0]->toString(exec).toArrayIndex(&ok);
+-    if( ok && i<base->plugins->count() )
++    if (ok && i < static_cast<unsigned>(base->plugins->count()))
+       return new Plugin( exec, base->plugins->at(i) );
+     return Undefined();
+   }
+@@ -485,12 +488,12 @@
+ */
+ KJS_IMPLEMENT_PROTOFUNC(MimeTypesFunc)
+ 
+-ValueImp *MimeTypes::indexGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *MimeTypes::indexGetter(ExecState* exec, JSObject*, const Identifier& /*propertyName*/, const PropertySlot& slot)
+ {
+   return new MimeType(exec, mimes->at(slot.index()));
+ }
+ 
+-ValueImp *MimeTypes::nameGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *MimeTypes::nameGetter(ExecState* exec, JSObject*, const Identifier& propertyName, const PropertySlot& /*slot*/)
+ {
+   return mimeTypeByName(exec, propertyName.qstring());
+ }
+@@ -507,14 +510,15 @@
+     // mimeTypes[#]
+     bool ok;
+     unsigned int i = propertyName.toUInt32(&ok);
+-    if (ok && i < mimes->count()) {
++    if (ok && i < static_cast<unsigned>(mimes->count())) {
+       slot.setCustomIndex(this, i, indexGetter);
+       return true;
+     }
+ 
+     // mimeTypes[name]
+-    for (MimeClassInfo *m = mimes->first(); m; m = mimes->next()) {
+-      if (m->type == propertyName.qstring()) {
++    QList<const MimeClassInfo*>::const_iterator it, end = mimes->end();
++    for (it = mimes->begin(); it != end; ++it) {
++      if ((*it)->type == propertyName.qstring()) {
+         slot.setCustom(this, nameGetter);
+         return true;
+       }
+@@ -527,9 +531,10 @@
+ ValueImp *MimeTypes::mimeTypeByName( ExecState* exec, const QString& name )
+ {
+   //kDebug(6070) << "MimeTypes[" << name << "]";
+-  for ( MimeClassInfo *m = mimes->first(); m!=0; m = mimes->next() ) {
+-    if ( m->type == name )
+-      return new MimeType( exec, m );
++  QList<const MimeClassInfo*>::const_iterator it, end = mimes->end();
++  for (it = mimes->begin(); it != end; ++it) {
++    if ((*it)->type == name)
++      return new MimeType(exec, (*it));
+   }
+   return Undefined();
+ }
+@@ -555,7 +560,7 @@
+   {
+     bool ok;
+     unsigned int i = args[0]->toString(exec).toArrayIndex(&ok);
+-    if( ok && i<base->mimes->count() )
++    if (ok && i < static_cast<unsigned>(base->mimes->count()))
+       return new MimeType( exec, base->mimes->at(i) );
+     return Undefined();
+   }
+@@ -584,7 +589,7 @@
+ */
+ KJS_IMPLEMENT_PROTOFUNC(PluginFunc)
+ 
+-ValueImp *Plugin::indexGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *Plugin::indexGetter(ExecState *exec, JSObject*, const Identifier& /*propertyName*/, const PropertySlot& slot)
+ {
+     Plugin *thisObj = static_cast<Plugin *>(slot.slotBase());
+     return new MimeType(exec, thisObj->m_info->mimes.at(slot.index()));
+@@ -601,20 +606,21 @@
+ #ifdef KJS_VERBOSE
+   kDebug(6070) << "Plugin::getOwnPropertySlot " << propertyName.qstring();
+ #endif
+-  if (getStaticOwnPropertySlot<PluginFunc, Plugin>(&PluginsTable, this, propertyName, slot))
++  if (getStaticOwnPropertySlot<PluginFunc, Plugin>(&PluginTable, this, propertyName, slot))
+       return true;
+ 
+   // plugin[#]
+   bool ok;
+   unsigned int i = propertyName.toUInt32(&ok);
+-  if (ok && i < m_info->mimes.count()) {
++  if (ok && i < static_cast<unsigned>(m_info->mimes.count())) {
+     slot.setCustomIndex(this, i, indexGetter);
+     return true;
+   }
+ 
+   // plugin["name"]
+-  for (MimeClassInfo *m=m_info->mimes.first(); m; m = m_info->mimes.next()) {
+-    if (m->type == propertyName.qstring()) {
++  QList<const MimeClassInfo*>::const_iterator it, end = mimes->end();
++  for (it = mimes->begin(); it != end; ++it) {
++    if ((*it)->type == propertyName.qstring()) {
+       slot.setCustom(this, nameGetter);
+       return true;
+     }
+@@ -625,10 +631,11 @@
+ 
+ ValueImp *Plugin::mimeByName(ExecState* exec, const QString& name) const
+ {
+-  for ( PluginBase::MimeClassInfo *m = m_info->mimes.first();
+-        m != 0; m = m_info->mimes.next() ) {
+-    if ( m->type == name )
+-      return new MimeType(exec, m);
++  const QList<const MimeClassInfo*>& mimes = m_info->mimes;
++  QList<const MimeClassInfo*>::const_iterator it, end = mimes.end();
++  for (it = mimes.begin(); it != end; ++it) {
++    if ((*it)->type == name)
++      return new MimeType(exec, (*it));
+   }
+   return Undefined();
+ }
+@@ -659,7 +666,7 @@
+   {
+     bool ok;
+     unsigned int i = args[0]->toString(exec).toArrayIndex(&ok);
+-    if( ok && i< plugin->pluginInfo()->mimes.count() )
++    if (ok && i< static_cast<unsigned>(plugin->pluginInfo()->mimes.count()))
+       return new MimeType( exec, plugin->pluginInfo()->mimes.at(i) );
+     return Undefined();
+   }
+@@ -676,7 +683,7 @@
+ 
+ /*****************************************************************************/
+ 
+-const ClassInfo MimeType::info = { "MimeType", 0, &MimeTypesTable, 0 };
++const ClassInfo MimeType::info = { "MimeType", 0, &MimeTypeTable, 0 };
+ /*
+ @begin MimeTypeTable 4
+   description  	MimeType_Description    	DontDelete|ReadOnly
+@@ -691,7 +698,7 @@
+ #ifdef KJS_VERBOSE
+   kDebug(6070) << "MimeType::get " << propertyName.qstring();
+ #endif
+-  return getStaticValueSlot<MimeType, ObjectImp>(exec, &MimeTypesTable, this, propertyName, slot);
++  return getStaticValueSlot<MimeType, ObjectImp>(exec, &MimeTypeTable, this, propertyName, slot);
+ }
+ 
+ ValueImp *MimeType::getValueProperty(ExecState* exec, int token) const
+--- a/khtml/ecma/debugger/debugwindow.cpp
++++ b/khtml/ecma/debugger/debugwindow.cpp
+@@ -111,7 +111,7 @@
+ // ----------------------------------------------
+ 
+ DebugWindow::DebugWindow(QWidget *parent)
+-  : KXmlGuiWindow(parent, Qt::WType_TopLevel),
++  : KXmlGuiWindow(parent, Qt::Window),
+     KComponentData("kjs_debugger")
+ {
+     setObjectName(QLatin1String("DebugWindow"));
+@@ -463,6 +463,7 @@
+     kDebug() << "  sourceId: " << sourceId << endl
+              << "lineNumber: " << lineno << endl;
+ 
++    Q_UNUSED( exec );
+     DebugDocument *document = m_sourceIdLookup[sourceId];
+     if (document)
+     {
+--- a/khtml/ecma/debugger/scriptsdock.cpp
++++ b/khtml/ecma/debugger/scriptsdock.cpp
+@@ -94,7 +94,7 @@
+     m_widget->invisibleRootItem()->addChild(parent);
+ }
+ 
+-void ScriptsDock::scriptSelected(QTreeWidgetItem *item, int column)
++void ScriptsDock::scriptSelected(QTreeWidgetItem *item, int /*column*/)
+ {
+     KJS::DebugDocument *doc = m_documents.key(item);
+     if (doc)
+--- a/khtml/ecma/kjs_html.h
++++ b/khtml/ecma/kjs_html.h
+@@ -156,7 +156,7 @@
+            IFrameMarginHeight, IFrameMarginWidth, IFrameScrolling, IFrameWidth,
+            IFrameContentDocument, IFrameContentWindow,
+            MarqueeStart, MarqueeStop,
+-           GetContext,
++           GetContext, CanvasWidth, CanvasHeight,
+            LayerTop, LayerLeft, LayerVisibility, LayerBgColor, LayerClip, LayerDocument, LayerLayers,
+            ElementInnerHTML, ElementTitle, ElementId, ElementDir, ElementLang,
+            ElementClassName, ElementInnerText, ElementDocument,
+@@ -331,6 +331,7 @@
+   DEFINE_PSEUDO_CONSTRUCTOR(HTMLFrameElementPseudoCtor)
+   DEFINE_PSEUDO_CONSTRUCTOR(HTMLIFrameElementPseudoCtor)
+   DEFINE_PSEUDO_CONSTRUCTOR(HTMLMarqueeElementPseudoCtor)
++  DEFINE_PSEUDO_CONSTRUCTOR(HTMLCanvasElementPseudoCtor)
+ } // namespace
+ 
+ #endif
+--- a/khtml/ecma/kjs_window.h
++++ b/khtml/ecma/kjs_window.h
+@@ -170,7 +170,7 @@
+            HTMLTableElementCtor, HTMLTableCaptionElementCtor, HTMLTableColElementCtor,
+            HTMLTableSectionElementCtor, HTMLTableRowElementCtor, HTMLTableCellElementCtor,
+            HTMLFrameSetElementCtor, HTMLLayerElementCtor, HTMLFrameElementCtor, HTMLIFrameElementCtor,
+-           CSSStyleDeclarationCtor};
++           CSSStyleDeclarationCtor, HTMLCanvasElementCtor, Context2DCtor};
+     WindowQObject *winq;
+ 
+     void forgetSuppressedWindows();
+--- a/khtml/ecma/kjs_dom.cpp
++++ b/khtml/ecma/kjs_dom.cpp
+@@ -174,6 +174,8 @@
+   offsetParent	DOMNode::OffsetParent		DontDelete|ReadOnly
+   clientWidth	DOMNode::ClientWidth		DontDelete|ReadOnly
+   clientHeight	DOMNode::ClientHeight		DontDelete|ReadOnly
++  clientLeft    DOMNode::ClientLeft		DontDelete|ReadOnly
++  clientTop	DOMNode::ClientTop		DontDelete|ReadOnly
+   scrollLeft	DOMNode::ScrollLeft		DontDelete
+   scrollTop	DOMNode::ScrollTop		DontDelete
+   scrollWidth   DOMNode::ScrollWidth            DontDelete|ReadOnly
+@@ -218,6 +220,8 @@
+       break;
+     case DOMNode::ClientHeight:
+     case DOMNode::ClientWidth:
++    case DOMNode::ClientLeft:
++    case DOMNode::ClientTop:
+       needViewport = true;
+       break;
+   }
+@@ -366,6 +370,10 @@
+       return rend ? Number( rend->clientWidth() ) : Undefined();
+     case ClientHeight:
+       return rend ? Number( rend->clientHeight() ) : Undefined();
++    case ClientLeft:
++      return rend ? Number( rend->clientLeft() ) : Undefined();
++    case ClientTop:
++      return rend ? Number( rend->clientTop() ) : Undefined();
+     case ScrollWidth:
+       return rend ? Number(rend->scrollWidth()) : Undefined();
+     case ScrollHeight:
+@@ -538,16 +546,7 @@
+ {
+   if (m_impl.isNull())
+     return "null";
+-  UString s;
+-
+-
+-  if ( m_impl->isElementNode() ) {
+-    DOM::ElementImpl* e = static_cast<DOM::ElementImpl*>(impl());
+-    s = DOMString(e->nodeName().string());
+-  } else
+-    s = className(); // fallback
+-
+-  return "[object " + s + "]";	//krazy:exclude=doublequote_chars DOM demands chars
++  return "[object " + className() + "]";	//krazy:exclude=doublequote_chars DOM demands chars
+ }
+ 
+ void DOMNode::setListener(ExecState *exec, int eventId, ValueImp* func) const
+@@ -1211,7 +1210,7 @@
+   return false;
+ }
+ 
+-ValueImp *DOMElement::attributeGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *DOMElement::attributeGetter(ExecState*, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
+ {
+   DOMElement *thisObj = static_cast<DOMElement *>(slot.slotBase());
+ 
+--- a/khtml/ecma/kjs_context2d.h
++++ b/khtml/ecma/kjs_context2d.h
+@@ -27,6 +27,7 @@
+ #include <kjs/object.h>
+ 
+ #include "misc/loader_client.h"
++#include "html/html_canvasimpl.h"
+ 
+ #include <QtGui/QPainterPath>
+ 
+@@ -34,159 +35,97 @@
+    class HTMLElementImpl;
+ }
+ 
+-class QGradient;
+-
+ namespace KJS {
+-  ////////////////////// Context2D Object ////////////////////////
+-
+-  class Context2D : public DOMObject {
+-  friend class Context2DFunction;
++  ////////////////////// Conversion helpers //////////////////////
++  template<typename Wrapper>
++  ValueImp* getWrapper(ExecState *exec, typename Wrapper::wrappedType* g)
++  {
++      DOMObject *ret = 0;
++      if (!g)
++          return Null();
++
++      ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
++      if ((ret = interp->getDOMObject(g)))
++          return ret;
++
++      ret = new Wrapper(exec, g);
++      interp->putDOMObject(g, ret);
++      return ret;
++  }
++
++  template<typename Wrapped>
++  class DOMWrapperObject : public DOMObject
++  {
+   public:
+-    Context2D(DOM::HTMLElementImpl *e);
+-    ~Context2D();
+-    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
+-    ValueImp *getValueProperty(ExecState *exec, int token) const;
+-    virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+-    void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+-    virtual bool toBoolean(ExecState *) const { return true; }
+-    virtual void mark();
+-    virtual const ClassInfo* classInfo() const { return &info; }
+-    static const ClassInfo info;
++    typedef Wrapped wrappedType;
++    typedef DOMWrapperObject<Wrapped> WrapperBase;
+ 
+-    QPainterPath &path() {
+-        return m_path;
+-    }
+-    void setPath( const QPainterPath &p ) {
+-        m_path = p;
++    DOMWrapperObject(JSObject* proto, Wrapped* wrapee):
++      DOMObject(proto), m_impl(wrapee)
++    {}
++
++    virtual ~DOMWrapperObject() {
++      ScriptInterpreter::forgetDOMObject(m_impl.get());
+     }
+ 
+-    enum {
+-        StrokeStyle,
+-        FillStyle,
+-        LineWidth,
+-        LineCap,
+-        LineJoin,
+-        MiterLimit,
+-        GlobalAlpha,
+-        GlobalCompositeOperation,
+-        Save, Restore,
+-        Scale, Rotate, Translate,
+-        BeginPath, ClosePath,
+-        SetStrokeColor, SetFillColor, SetLineWidth, SetLineCap, SetLineJoin, SetMiterLimit,
+-        Fill, Stroke,
+-        MoveTo, LineTo, QuadraticCurveTo, BezierCurveTo, ArcTo, Arc, Rect, Clip,
+-        ClearRect, FillRect, StrokeRect,
+-        DrawImage, DrawImageFromRect,
+-        SetAlpha, SetCompositeOperation,
+-        CreateLinearGradient,
+-        CreateRadialGradient,
+-        CreatePattern
+-    };
++    virtual bool toBoolean(ExecState *) const { return true; }
+ 
+-private:
+-    QBrush constructBrush(ExecState* exec);
+-    QPen constructPen(ExecState* exec);
+-
+-    void save();
+-    void restore();
+-
+-    QPainter *drawingContext();
+-    bool _validStrokeImagePattern;
+-    void updateStrokeImagePattern();
+-
+-    SharedPtr<DOM::HTMLElementImpl> _element;
+-    bool _needsFlushRasterCache;
+-
+-    QPainterPath m_path;
+-
+-    QList<List*> stateStack;
+-
+-    ValueImp *_strokeStyle;
+-    ValueImp *_fillStyle;
+-    ValueImp *_lineWidth;
+-    ValueImp *_lineCap;
+-    ValueImp *_lineJoin;
+-    ValueImp *_miterLimit;
+-    ValueImp *_globalAlpha;
+-    ValueImp *_globalComposite;
++    Wrapped* impl() { return m_impl.get(); }
++    const Wrapped* impl() const { return m_impl.get(); }
++  private:
++    SharedPtr<Wrapped> m_impl;
+   };
+ 
+-    QColor colorFromValue(ExecState *exec, ValueImp *value);
+-
+-    struct ColorStop {
+-        float stop;
+-        float red;
+-        float green;
+-        float blue;
+-        float alpha;
+-
+-        ColorStop(float s, float r, float g, float b, float a) : stop(s), red(r), green(g), blue(b), alpha(a) {}
+-    };
++  ////////////////////// Context2D Object ////////////////////////
++  DEFINE_PSEUDO_CONSTRUCTOR(Context2DPseudoCtor)
+ 
+-  class Gradient : public DOMObject {
++  class Context2D : public DOMWrapperObject<DOM::CanvasContext2DImpl> {
+   friend class Context2DFunction;
+   public:
+-    Gradient(float x0, float y0, float x1, float y1);
+-    Gradient(float x0, float y0, float r0, float x1, float y1, float r1);
+-    ~Gradient();
++    Context2D(ExecState* exec, DOM::CanvasContext2DImpl *ctx);
++    
+     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
+     ValueImp *getValueProperty(ExecState *exec, int token) const;
+     virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+     void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+-    virtual bool toBoolean(ExecState *) const { return true; }
++
+     virtual const ClassInfo* classInfo() const { return &info; }
+     static const ClassInfo info;
+ 
+-    QGradient *qgradient() const { return m_gradient; }
+-
+-
+-    enum {
+-        AddColorStop
+-    };
+-
+     enum {
+-        Radial, Linear
++        Canvas,
++        Save, Restore, // state
++        Scale, Rotate, Translate, Transform, SetTransform, // transformations
++        GlobalAlpha, GlobalCompositeOperation,             // compositing
++        StrokeStyle, FillStyle, CreateLinearGradient, CreateRadialGradient, CreatePattern, // colors and styles.
++        LineWidth, LineCap, LineJoin, MiterLimit, // line properties
++        // TODO: shadows
++        ClearRect, FillRect, StrokeRect,          // rectangle ops
++        BeginPath, ClosePath, MoveTo, LineTo, QuadraticCurveTo, BezierCurveTo, ArcTo, Rect, Arc,
++        Fill, Stroke, Clip, IsPointInPath,        // paths
++        DrawImage,  // do we want backwards compat for drawImageFromRect?
++        GetImageData, PutImageData // pixel ops. ewww.
+     };
+-
+-    void addColorStop (float s, float r, float g, float b, float alpha);
+-
+-    int lastStop;
+-    int nextStop;
+-
+-private:
+-    void commonInit();
+-    QGradient *m_gradient;
+-    float _x0, _y0, _r0, _x1, _y1, _r1;
+-
+-    int maxStops;
+-    int stopCount;
+-    ColorStop *stops;
+-    mutable int adjustedStopCount;
+-    mutable ColorStop *adjustedStops;
+-    mutable unsigned stopsNeedAdjusting:1;
+   };
+ 
+-  class ImagePattern : public DOMObject {
++  class CanvasGradient : public DOMWrapperObject<DOM::CanvasGradientImpl> {
+   public:
+-    ImagePattern(HTMLElement *i, int type);
+-    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
+-    ValueImp *getValueProperty(ExecState *exec, int token) const;
+-    virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+-    void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+-    virtual bool toBoolean(ExecState *) const { return true; }
++    CanvasGradient(ExecState* exec, DOM::CanvasGradientImpl* impl);
++
+     virtual const ClassInfo* classInfo() const { return &info; }
+     static const ClassInfo info;
+ 
+-    QPixmap pixmap() { return _pixmap; }
+-    QBrush createPattern();
+-
+     enum {
+-        Repeat, RepeatX, RepeatY, NoRepeat
++        AddColorStop
+     };
++  };
+ 
+-private:
+-    float _rw, _rh;
+-    QPixmap _pixmap;
++  class CanvasPattern : public DOMWrapperObject<DOM::CanvasPatternImpl> {
++  public:
++    CanvasPattern(ExecState* exec, DOM::CanvasPatternImpl *i);
++    
++    virtual const ClassInfo* classInfo() const { return &info; }
++    static const ClassInfo info;
+   };
+ } // namespace
+ 
+--- a/khtml/ecma/kjs_css.cpp
++++ b/khtml/ecma/kjs_css.cpp
+@@ -612,15 +612,16 @@
+ ValueImp* DOMCSSStyleSheet::getValueProperty(ExecState *exec, int token)
+ {
+   CSSStyleSheetImpl& cssStyleSheet = *impl();
++  // MSIE does not list the charset rules in its proprietary extension
++  bool omitCharsetRules = true;
+   switch (token) {
+     case OwnerRule:
+       return getDOMCSSRule(exec,cssStyleSheet.ownerRule());
+     case CssRules:
++        omitCharsetRules = false;
++        // nobreak
+     case Rules: {
+-      //### this is a bit odd -- why is the impl returning the wrapper?
+-      DOM::CSSRuleList rules = cssStyleSheet.cssRules();
+-      SharedPtr<CSSRuleListImpl> ri = static_cast<CSSRuleListImpl*>(rules.handle());
+-      return getDOMCSSRuleList(exec, ri.get());
++        return getDOMCSSRuleList(exec, cssStyleSheet.cssRules(omitCharsetRules));
+     }
+     default:
+       assert(0);
+@@ -651,7 +652,7 @@
+       //Unpassed/-1 means append. Since insertRule is picky (throws exceptions)
+       //we adjust it to the desired length
+       unsigned long index  = args[2]->toInteger(exec);
+-      unsigned long length = styleSheet.cssRules().length();
++      unsigned long length = styleSheet.length();
+       if (args[2]->type() == UndefinedType) index = length;
+       if (index > length)                   index = length;
+       DOM::DOMString str = args[0]->toString(exec).domString() + " { " + args[1]->toString(exec).domString() + " } ";
+--- a/khtml/ecma/kjs_html.cpp
++++ b/khtml/ecma/kjs_html.cpp
+@@ -318,7 +318,7 @@
+   return Undefined();
+ }
+ 
+-ValueImp *HTMLDocument::frameNameGetter(ExecState *exec, JSObject*, const Identifier& name, const PropertySlot& slot)
++ValueImp *HTMLDocument::frameNameGetter(ExecState*, JSObject*, const Identifier& name, const PropertySlot& slot)
+ {
+   HTMLDocument *thisObj = static_cast<HTMLDocument*>(slot.slotBase());
+   KHTMLView *view      = thisObj->impl()->view();
+@@ -1196,21 +1196,23 @@
+   stop            KJS::HTMLElement::MarqueeStop                 DontDelete|Function 0
+ @end
+ 
+- at begin HTMLCanvasElementTable 1
++ at begin HTMLCanvasElementTable 2
++  width           KJS::HTMLElement::CanvasWidth                 DontDelete
++  height          KJS::HTMLElement::CanvasHeight                DontDelete
++ at end
++
++ at begin HTMLCanvasElementProtoTable 1
+   getContext      KJS::HTMLElement::GetContext                  DontDelete|Function 1
+ @end
+ */
+ KJS_IMPLEMENT_PROTOFUNC(HTMLElementFunction)
+ 
+-static KParts::LiveConnectExtension *getLiveConnectExtension(const DOM::HTMLElementImpl* element)
++static KParts::LiveConnectExtension *getLiveConnectExtension(const DOM::HTMLElementImpl &element)
+ {
+-  if (!element)
+-    return 0L;
+-
+-  DOM::DocumentImpl* doc = element->getDocument();
++  DOM::DocumentImpl* doc = element.getDocument();
+   KHTMLView *view = doc->view();
+   if (view)
+-    return view->part()->liveConnectExtension(static_cast<khtml::RenderPart*>(element->renderer()));
++    return view->part()->liveConnectExtension(static_cast<khtml::RenderPart*>(element.renderer()));
+   return 0L;
+ }
+ 
+@@ -1828,6 +1830,14 @@
+     }
+   }
+   break;
++  case ID_CANVAS: {
++    DOM::HTMLCanvasElementImpl& canvas = static_cast<DOM::HTMLCanvasElementImpl&>(element);
++    switch (token) {
++    case CanvasHeight:          return Number(canvas.height());
++    case CanvasWidth:           return Number(canvas.width());
++    }
++  }
++  break;
+   case ID_OBJECT: {
+     DOM::HTMLObjectElementImpl& object = static_cast<DOM::HTMLObjectElementImpl&>(element);
+     switch (token) {
+@@ -2294,10 +2304,10 @@
+     }
+   case ID_CANVAS: {
+       if (id == KJS::HTMLElement::GetContext) {
+-        if (args.size() == 0 || (args.size() == 1 && args[0]->toString(exec).domString().lower() == "2d")) {
+-          return new Context2D(&element);
+-        }
+-        return Undefined();
++        DOM::HTMLCanvasElementImpl& canvasEl = static_cast<DOM::HTMLCanvasElementImpl&>(element);
++        if (args[0]->toString(exec) == "2d")
++          return getWrapper<Context2D>(exec, canvasEl.getContext2D());
++        return jsNull();
+       }
+       break;
+     }
+@@ -2341,10 +2351,6 @@
+       }
+       break;
+     }
+-#ifdef __GNUC__
+-#warning "FIXME: LiveConnect!"
+-#endif
+-#if 0
+     case ID_APPLET:
+     case ID_OBJECT:
+     case ID_EMBED: {
+@@ -2353,7 +2359,6 @@
+         return;
+       break;
+     }
+-#endif
+     default:
+       break;
+   }
+@@ -2541,6 +2546,21 @@
+         }
+     }
+     break;
++    case ID_CANVAS: {
++        DOM::HTMLCanvasElementImpl& canvas = static_cast<DOM::HTMLCanvasElementImpl&>(element);
++        switch (token) {
++        // ### it may make sense to do something different here, to at least
++        // emulate reflecting properties somewhat.
++        case CanvasWidth:
++            canvas.setAttribute(ATTR_WIDTH, value->toString(exec).domString());
++            return;
++        case CanvasHeight:
++            canvas.setAttribute(ATTR_HEIGHT, value->toString(exec).domString());
++            return;
++        }
++    }
++    break;
++
+ 
+ //    case ID_FIELDSET: {
+ //      DOM::HTMLFieldSetElementImpl& fieldSet = static_cast<DOM::HTMLFieldSetElementImpl&>(element);
+@@ -2770,6 +2790,11 @@
+ KJS_IMPLEMENT_PROTOTYPE("HTMLMarqueeElement", HTMLMarqueeElementProto, HTMLElementFunction)
+ IMPLEMENT_PSEUDO_CONSTRUCTOR(HTMLMarqueeElementPseudoCtor, "HTMLMarqueeElement", HTMLMarqueeElementProto)
+ 
++KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(HTMLCanvasElementProto, HTMLElementProto)
++KJS_IMPLEMENT_PROTOTYPE("HTMLCanvasElement", HTMLCanvasElementProto, HTMLElementFunction)
++IMPLEMENT_PSEUDO_CONSTRUCTOR(HTMLCanvasElementPseudoCtor, "HTMLCanvasElement", HTMLCanvasElementProto)
++
++
+ static ObjectImp* prototypeForID(ExecState* exec, DOM::NodeImpl::Id id) {
+   switch (id) {
+   case ID_HTML:
+@@ -2892,6 +2917,8 @@
+     return HTMLIFrameElementProto::self(exec);
+   case ID_MARQUEE:
+     return HTMLMarqueeElementProto::self(exec);
++  case ID_CANVAS:
++    return HTMLCanvasElementProto::self(exec);
+   default:
+     return HTMLElementProto::self(exec);
+   }
+@@ -2961,6 +2988,8 @@
+ #ifdef KJS_VERBOSE
+   kDebug(6070) << "KJS::HTMLCollection::getOwnPropertySlot " << propertyName.ascii();
+ #endif
++  if (propertyName.isEmpty())
++    return false;
+   if (propertyName == exec->propertyNames().length)
+   {
+ #ifdef KJS_VERBOSE
+@@ -3008,7 +3037,7 @@
+     // support for document.all(<index>) etc.
+     bool ok;
+     UString s = args[0]->toString(exec);
+-    unsigned int u = s.toUInt32(&ok);
++    unsigned int u = s.toUInt32(&ok, false);
+     if (ok)
+       return getDOMNode(exec, collection.item(u));
+     // support for document.images('<name>') etc.
+@@ -3018,7 +3047,7 @@
+   {
+     bool ok;
+     UString s = args[0]->toString(exec);
+-    unsigned int u = args[1]->toString(exec).toUInt32(&ok);
++    unsigned int u = args[1]->toString(exec).toUInt32(&ok, false);
+     if (ok)
+     {
+       DOM::DOMString pstr = s.domString();
+@@ -3079,14 +3108,14 @@
+     // support for item(<index>) (DOM)
+     UString s = args[0]->toString(exec);
+     bool ok;
+-    unsigned int u = s.toUInt32(&ok);
++    unsigned int u = s.toUInt32(&ok, false);
+     if (ok) {
+       return getDOMNode(exec,coll.item(u));
+     }
+ 
+     // support for item('<name>') (IE only)
+     kWarning() << "non-standard HTMLCollection.item('" << s.ascii() << "') called, use namedItem instead";
+-    return getDOMNode(exec,coll.namedItem(s.domString()));
++    return static_cast<HTMLCollection *>(thisObj)->getNamedItems(exec, Identifier(s));
+   }
+   case KJS::HTMLCollection::Tags:
+   {
+@@ -3141,13 +3170,13 @@
+                                                 DOM::HTMLSelectElementImpl* e)
+       : HTMLCollection(HTMLSelectCollectionProto::self(exec), c), element(e) { }
+ 
+-ValueImp *HTMLSelectCollection::selectedIndexGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *HTMLSelectCollection::selectedIndexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot)
+ {
+     HTMLSelectCollection *thisObj = static_cast<HTMLSelectCollection *>(slot.slotBase());
+     return Number(thisObj->element->selectedIndex());
+ }
+ 
+-ValueImp *HTMLSelectCollection::selectedValueGetter(ExecState *exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
++ValueImp *HTMLSelectCollection::selectedValueGetter(ExecState*, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
+ {
+     HTMLSelectCollection *thisObj = static_cast<HTMLSelectCollection *>(slot.slotBase());
+     return String(thisObj->element->value());
+--- a/khtml/ecma/kjs_window.cpp
++++ b/khtml/ecma/kjs_window.cpp
+@@ -36,7 +36,6 @@
+ #include <config.h>
+ 
+ #include <QtCore/QTimer>
+-#include <Qt3Support/Q3PaintDeviceMetrics>
+ #include <QtGui/QApplication>
+ #include <kdebug.h>
+ #include <kmessagebox.h>
+@@ -67,6 +66,7 @@
+ #include "kjs_events.h"
+ #include "kjs_views.h"
+ #include "kjs_audio.h"
++#include "kjs_context2d.h"
+ #include "xmlhttprequest.h"
+ #include "xmlserializer.h"
+ #include "domparser.h"
+@@ -398,7 +398,9 @@
+   HTMLLayerElement Window::HTMLLayerElementCtor DontDelete
+   HTMLFrameElement Window::HTMLFrameElementCtor DontDelete
+   HTMLIFrameElement Window::HTMLIFrameElementCtor DontDelete
++  HTMLCanvasElement Window::HTMLCanvasElementCtor DontDelete
+   CSSStyleDeclaration Window::CSSStyleDeclarationCtor DontDelete
++  CanvasRenderingContext2D Window::Context2DCtor DontDelete
+ @end
+ */
+ KJS_IMPLEMENT_PROTOFUNC(WindowFunc)
+@@ -889,6 +891,10 @@
+       return HTMLFrameElementPseudoCtor::self(exec);
+     case HTMLIFrameElementCtor:
+       return HTMLIFrameElementPseudoCtor::self(exec);
++    case HTMLCanvasElementCtor:
++      return HTMLCanvasElementPseudoCtor::self(exec);
++    case Context2DCtor:
++      return Context2DPseudoCtor::self(exec);
+     case DocumentCtor:
+       return DocumentPseudoCtor::self(exec);
+     case HTMLDocumentCtor:
+@@ -2158,11 +2164,11 @@
+ {
+   if (func && !func->marked())
+     func->mark();
+-  args.mark();
+ }
+ 
+ ScheduledAction::~ScheduledAction()
+ {
++  args.reset();
+   //kDebug(6070) << "ScheduledAction::~ScheduledAction " << this;
+ }
+ 
+--- a/khtml/ecma/kjs_context2d.cpp
++++ b/khtml/ecma/kjs_context2d.cpp
+@@ -3,6 +3,7 @@
+  *  This file is part of the KDE libraries
+  *  Copyright (C) 2004 Apple Computer, Inc.
+  *  Copyright (C) 2005 Zack Rusin <zack at kde.org>
++ *  Copyright (C) 2007 Maksim Orlovich <maksim at kde.org>
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Lesser General Public
+@@ -48,6 +49,7 @@
+ #include "kjs_window.h"
+ #include "kjs_events.h"
+ #include "kjs_proxy.h"
++#include <kjs/operations.h>
+ 
+ #include <rendering/render_canvasimage.h>
+ #include <rendering/render_object.h>
+@@ -59,20 +61,8 @@
+ #include <css/css_stylesheetimpl.h>
+ #include <css/css_ruleimpl.h>
+ 
+-#include <QtAlgorithms>
+-#include <QtGui/QPainter>
+-#include <QtGui/QPainterPath>
+-#include <QtGui/QImage>
+-#include <QtGui/QPixmap>
+-#include <QtGui/QBrush>
+-#include <QtGui/QColor>
+-#include <QtCore/QDebug>
+-#include <QtCore/QLocale>
+-
+-#include <math.h>
+ 
+ using namespace DOM;
+-using khtml::RenderCanvasImage;
+ 
+ #include "kjs_context2d.lut.h"
+ 
+@@ -80,1304 +70,572 @@
+ 
+ ////////////////////// Context2D Object ////////////////////////
+ 
++KJS_DEFINE_PROTOTYPE(Context2DProto)
+ KJS_IMPLEMENT_PROTOFUNC(Context2DFunction)
++KJS_IMPLEMENT_PROTOTYPE("CanvasRenderingContext2DProto", Context2DProto, Context2DFunction)
+ 
+-static bool isGradient(ValueImp *value)
+-{
+-    return value->isObject(&Gradient::info);
+-}
++/*
++   @begin Context2DProtoTable 48
++   #
++   # state ops
++   save                     Context2D::Save                        DontDelete|Function 0
++   restore                  Context2D::Restore                     DontDelete|Function 0
++   #
++   # transformations
++   scale                    Context2D::Scale                       DontDelete|Function 2
++   rotate                   Context2D::Rotate                      DontDelete|Function 2
++   translate                Context2D::Translate                   DontDelete|Function 1
++   transform                Context2D::Transform                   DontDelete|Function 6
++   setTransform             Context2D::SetTransform                DontDelete|Function 6
++   #
++   # colors and styles
++   createLinearGradient     Context2D::CreateLinearGradient        DontDelete|Function 4
++   createRadialGradient     Context2D::CreateRadialGradient        DontDelete|Function 6
++   createPattern            Context2D::CreatePattern               DontDelete|Function 2
++   #
++   # rectangle ops
++   clearRect                Context2D::ClearRect                   DontDelete|Function 4
++   fillRect                 Context2D::FillRect                    DontDelete|Function 4
++   strokeRect               Context2D::StrokeRect                  DontDelete|Function 4
++   #
++   # paths
++   beginPath                Context2D::BeginPath                   DontDelete|Function 0
++   closePath                Context2D::ClosePath                   DontDelete|Function 0
++   moveTo                   Context2D::MoveTo                      DontDelete|Function 2
++   lineTo                   Context2D::LineTo                      DontDelete|Function 2
++   quadraticCurveTo         Context2D::QuadraticCurveTo            DontDelete|Function 4
++   bezierCurveTo            Context2D::BezierCurveTo               DontDelete|Function 6
++   arcTo                    Context2D::ArcTo                       DontDelete|Function 5
++   rect                     Context2D::Rect                        DontDelete|Function 4
++   arc                      Context2D::Arc                         DontDelete|Function 6
++   fill                     Context2D::Fill                        DontDelete|Function 0
++   isPointInPath            Context2D::IsPointInPath               DontDelete|Function 2
++   stroke                   Context2D::Stroke                      DontDelete|Function 0
++   clip                     Context2D::Clip                        DontDelete|Function 0
++   #
++   # images. Lots of overloading here!
++   drawImage                Context2D::DrawImage                   DontDelete|Function 3
++   #
++   # pixel ops.
++   getImageData             Context2D::GetImageData                DontDelete|Function 4
++   putImageData             Context2D::PutImageData                DontDelete|Function 3
++   @end
++*/
++
++IMPLEMENT_PSEUDO_CONSTRUCTOR(Context2DPseudoCtor, "CanvasRenderingContext2D", Context2DProto)
+ 
+-static bool isImagePattern(ValueImp *value)
++Context2D::Context2D(ExecState* exec, DOM::CanvasContext2DImpl *ctx):
++    WrapperBase(Context2DProto::self(exec), ctx)
++{}
++
++// Checks count and sets an exception if needed
++static bool enoughArguments(ExecState* exec, const List& args, int limit)
+ {
+-    return value->isObject(&ImagePattern::info);
++    if (args.size() < limit) {
++        setDOMException(exec, DOMException::NOT_SUPPORTED_ERR);
++        return false;
++    }
++    return true;
+ }
+ 
+-static QPainter::CompositionMode compositeOperatorFromString(const QString &compositeOperator)
++// Verifies that float arguments are not NaN or a plus/minus infinity (unless infOK)
++static bool argFloatsOK(ExecState* exec, const List& args, int minArg, int maxArg, bool infOK)
+ {
+-    if ( compositeOperator == "source-over" ) {
+-        return QPainter::CompositionMode_SourceOver;
+-    } else if ( compositeOperator == "source-out" ) {
+-        return QPainter::CompositionMode_SourceOut;
+-    } else if ( compositeOperator == "source-in" ) {
+-        return QPainter::CompositionMode_SourceIn;
+-    } else if ( compositeOperator == "source-atop" ) {
+-        return QPainter::CompositionMode_SourceAtop;
+-    } else if ( compositeOperator == "destination-atop" ) {
+-        return QPainter::CompositionMode_DestinationAtop;
+-    } else if ( compositeOperator == "destination-in" ) {
+-        return QPainter::CompositionMode_DestinationIn;
+-    } else if ( compositeOperator == "destination-out" ) {
+-        return QPainter::CompositionMode_DestinationOut;
+-    } else if ( compositeOperator == "destination-over" ) {
+-        return QPainter::CompositionMode_DestinationOver;
+-    } else if ( compositeOperator == "darker" ) {
+-        return QPainter::CompositionMode_SourceOver;
+-    } else if ( compositeOperator == "lighter" ) {
+-        return QPainter::CompositionMode_SourceOver;
+-    } else if ( compositeOperator == "copy" ) {
+-        return QPainter::CompositionMode_Source;
+-    } else if ( compositeOperator == "xor" ) {
+-        return QPainter::CompositionMode_Xor;
++    for (int c = minArg; c <= maxArg; ++c) {
++        float val = args[c]->toFloat(exec);
++        if (KJS::isNaN(val) || (!infOK && KJS::isInf(val))) {
++            setDOMException(exec, DOMException::NOT_SUPPORTED_ERR);
++            return false;
++        }
+     }
+-
+-    return QPainter::CompositionMode_SourceOver;
++    return true;
+ }
+ 
+-#define DEGREES(t) ((t) * 180.0 / M_PI)
++// HTML5-style checking
++#define KJS_REQUIRE_ARGS(n) do { if (!enoughArguments(exec, args,n)) return jsUndefined(); } while(0);
++#define KJS_CHECK_FLOAT_ARGS(min,max) do { if (!argFloatsOK(exec, args, min, max, false )) return jsUndefined(); } while(0);
++#define KJS_CHECK_FLOAT_OR_INF_ARGS(min,max) do { if (!argFloatsOK(exec, args, min, max, true)) return jsUndefined(); } while(0);
+ 
+ ValueImp *KJS::Context2DFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+ {
+-    if (!thisObj->inherits(&Context2D::info))
+-        return throwError(exec, TypeError);
+-
+-    Context2D *contextObject = static_cast<KJS::Context2D *>(thisObj);
+-    khtml::RenderCanvasImage *renderer = static_cast<khtml::RenderCanvasImage*>(contextObject->_element->renderer());
+-    if (!renderer)
+-        return Undefined();
+-
+-    QPainter *drawingContext = renderer->drawingContext();
+-    if (!drawingContext)
+-        return Undefined();
++    KJS_CHECK_THIS(Context2D, thisObj);
++    
++#ifdef KJS_VERBOSE
++    kDebug(6070) << "KJS::Context2DFunction::callAsFunction " << functionName().qstring();
++#endif
+ 
++    Context2D *jsContextObject = static_cast<KJS::Context2D *>(thisObj);
++    CanvasContext2DImpl* ctx   = jsContextObject->impl();
++    DOMExceptionTranslator exception(exec);
++    
+     switch (id) {
++    // State ops
++    /////////////
+     case Context2D::Save: {
+-        if (args.size() != 0)
+-            return throwError(exec, SyntaxError);
+-        drawingContext->save();
+-        contextObject->save();
++        ctx->save();
+         break;
+     }
++    
+     case Context2D::Restore: {
+-        if (args.size() != 0)
+-            return throwError(exec, SyntaxError);
+-        drawingContext->restore();
+-        contextObject->restore();
++        ctx->restore();
++        break;
++    }
++
++    // Transform ops. These have NaN inf handled specially in the impl
++    case Context2D::Scale: {
++        KJS_REQUIRE_ARGS(2);
++        KJS_CHECK_FLOAT_OR_INF_ARGS(0, 1);
+ 
++        ctx->scale(args[0]->toFloat(exec), args[1]->toFloat(exec));
+         break;
+     }
+-    case Context2D::BeginPath: {
+-        if (args.size() != 0)
+-            return throwError(exec, SyntaxError);
+-        contextObject->setPath( QPainterPath() );
+-        contextObject->path().setFillRule( Qt::WindingFill );
++
++    case Context2D::Rotate: {
++        KJS_REQUIRE_ARGS(1);
++        // Rotate actually rejects NaN/infinity as well
++        KJS_CHECK_FLOAT_ARGS(0, 0);
++        
++
++        ctx->rotate(args[0]->toFloat(exec));
+         break;
+     }
+-    case Context2D::ClosePath: {
+-        if (args.size() != 0)
+-            return throwError(exec, SyntaxError);
+-        contextObject->path().closeSubpath();
+-        break;
+-    }
+-    case Context2D::SetStrokeColor: {
+-        // string arg = named color
+-        // string arg, number arg = named color, alpha
+-        // number arg = gray color
+-        // number arg, number arg = gray color, alpha
+-        // 4 args (string or number) = r, g, b, a
+-        // 5 args (string or number) = c, m, y, k, a
+-        QPen pen = drawingContext->pen();
+-        int numArgs = args.size();
+-        switch (numArgs) {
+-        case 1: {
+-            if (args[0]->isString()) {
+-                QColor qc = colorFromValue( exec, args[0] );
+-                pen.setColor( qc );
+-
+-            }
+-            else {
+-                float g = (float)args[0]->toNumber(exec);
+-                QColor qc;
+-                qc.setRgbF( g, g, g );
+-                pen.setColor( qc );
+-            }
+-        }
+-            break;
+-        case 2: {
+-            float a = args[1]->toNumber(exec);
+-            if (args[0]->isString()) {
+-                QColor qc = colorFromValue( exec, args[0] );
+-                qc.setAlphaF( a );
+-                pen.setColor( qc );
+-            }
+-            else {
+-                float g = (float)args[0]->toNumber(exec);
+-                QColor qc;
+-                qc.setRgbF( g, g, g, a );
+-                pen.setColor( qc );
+-            }
+-        }
+-            break;
+-        case 4: {
+-            float r = (float)args[0]->toNumber(exec);
+-            float g = (float)args[1]->toNumber(exec);
+-            float b = (float)args[2]->toNumber(exec);
+-            float a = (float)args[3]->toNumber(exec);
+-            QColor qc;
+-            qc.setRgbF( r, g, b, a );
+-            pen.setColor( qc );
+-        }
+-            break;
+-        case 5: {
+-            float c = (float)args[0]->toNumber(exec);
+-            float m = (float)args[1]->toNumber(exec);
+-            float y = (float)args[2]->toNumber(exec);
+-            float k = (float)args[3]->toNumber(exec);
+-            float a = (float)args[4]->toNumber(exec);
+-            QColor qc;
+-            qc.setCmykF( c, m, y, k, a );
+-            pen.setColor( qc );
+-        }
+-            break;
+-        default:
+-            return throwError(exec, SyntaxError);
+-        }
+-        drawingContext->setPen( pen );
++
++    case Context2D::Translate: {
++        KJS_REQUIRE_ARGS(2);
++        KJS_CHECK_FLOAT_OR_INF_ARGS(0, 1);
++
++        ctx->translate(args[0]->toFloat(exec), args[1]->toFloat(exec));
+         break;
+     }
+-    case Context2D::SetFillColor: {
+-        // string arg = named color
+-        // string arg, number arg = named color, alpha
+-        // number arg = gray color
+-        // number arg, number arg = gray color, alpha
+-        // 4 args (string or number) = r, g, b, a
+-        // 5 args (string or number) = c, m, y, k, a
+-        int numArgs = args.size();
+-        QBrush brush = drawingContext->brush();
+-        switch (numArgs) {
+-        case 1: {
+-            if (args[0]->isString()) {
+-                QColor qc = colorFromValue( exec, args[0] );
+-                brush.setColor( qc );
+-                drawingContext->setBrush( brush );
+-            }
+-            else {
+-                float g = (float)args[0]->toNumber(exec);
+-                QColor qc;
+-                qc.setRgbF( g, g, g );
+-                brush.setColor( qc );
+-                drawingContext->setBrush( brush );
+-            }
+-        }
+-            break;
+-        case 2: {
+-            float a = args[1]->toNumber(exec);
+-            if (args[0]->isString()) {
+-                QColor qc = colorFromValue( exec, args[0] );
+-                brush.setColor( qc );
+-                drawingContext->setBrush( brush );
+-            }
+-            else {
+-                float g = (float)args[0]->toNumber(exec);
+-                QColor qc;
+-                qc.setRgbF( g, g, g, a );
+-                brush.setColor( qc );
+-                drawingContext->setBrush( brush );
+-            }
+-        }
+-            break;
+-        case 4: {
+-            float r = (float)args[0]->toNumber(exec);
+-            float g = (float)args[1]->toNumber(exec);
+-            float b = (float)args[2]->toNumber(exec);
+-            float a = (float)args[3]->toNumber(exec);
+-            QColor qc;
+-            qc.setRgbF( r, g, b, a );
+-            brush.setColor( qc );
+-            drawingContext->setBrush( brush );
+-        }
+-            break;
+-        case 5: {
+-            float c = (float)args[0]->toNumber(exec);
+-            float m = (float)args[1]->toNumber(exec);
+-            float y = (float)args[2]->toNumber(exec);
+-            float k = (float)args[3]->toNumber(exec);
+-            float a = (float)args[4]->toNumber(exec);
+-            QColor qc;
+-            qc.setCmykF( c, m, y, k, a );
+-            brush.setColor( qc );
+-            drawingContext->setBrush( brush );
+-        }
+-            break;
+-        default:
+-            return throwError(exec, SyntaxError);
+-        }
++
++    case Context2D::Transform: {
++        KJS_REQUIRE_ARGS(6);
++        KJS_CHECK_FLOAT_OR_INF_ARGS(0, 5);
++
++        ctx->transform(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                       args[2]->toFloat(exec), args[3]->toFloat(exec),
++                       args[4]->toFloat(exec), args[5]->toFloat(exec));
++
+         break;
+     }
+-    case Context2D::SetLineWidth: {
+-        if (args.size() != 1)
+-            return throwError(exec, SyntaxError);
+-        float w = (float)args[0]->toNumber(exec);
+-        QPen pen = drawingContext->pen();
+-        pen.setWidthF( w );
+-        drawingContext->setPen( pen );
+-        break;
+-    }
+-    case Context2D::SetLineCap: {
+-        if (args.size() != 1)
+-            return throwError(exec, SyntaxError);
+-        QPen pen = drawingContext->pen();
+-        DOMString capString = args[0]->toString(exec).domString().lower();
+-        if (capString == "round")
+-            pen.setCapStyle( Qt::RoundCap );
+-        else if (capString == "square")
+-            pen.setCapStyle( Qt::SquareCap );
+-        else
+-            pen.setCapStyle( Qt::FlatCap );
+-        drawingContext->setPen( pen );
+-        break;
+-    }
+-    case Context2D::SetLineJoin: {
+-        if (args.size() != 1)
+-            return throwError(exec, SyntaxError);
+-        DOMString joinString = args[0]->toString(exec).domString().lower();
+-        QPen pen = drawingContext->pen();
+-        if (joinString == "round")
+-            pen.setJoinStyle(Qt::RoundJoin);
+-        else if (joinString == "bevel")
+-            pen.setJoinStyle(Qt::BevelJoin);
+-        else
+-            pen.setJoinStyle(Qt::MiterJoin);
+-        drawingContext->setPen( pen );
+-        break;
+-    }
+-    case Context2D::SetMiterLimit: {
+-        if (args.size() != 1)
+-            return throwError(exec, SyntaxError);
+-        float l = (float)args[0]->toNumber(exec);
+-        QPen pen = drawingContext->pen();
+-        pen.setMiterLimit( l );
+-        drawingContext->setPen( pen );
++    
++    case Context2D::SetTransform: {
++        KJS_REQUIRE_ARGS(6);
++        KJS_CHECK_FLOAT_OR_INF_ARGS(0, 5);
++
++        ctx->setTransform(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                          args[2]->toFloat(exec), args[3]->toFloat(exec),
++                          args[4]->toFloat(exec), args[5]->toFloat(exec));
+         break;
+     }
+-    case Context2D::Fill: {
+-        if (args.size() != 0)
+-            return throwError(exec, SyntaxError);
++    
++    // Composition state is properties --- not in prototype
++    
++    // Color and style info..
++    case Context2D::CreateLinearGradient: {
++        KJS_REQUIRE_ARGS(4);
++        KJS_CHECK_FLOAT_ARGS(0, 3);
++
++        CanvasGradientImpl* grad = ctx->createLinearGradient(
++              args[0]->toFloat(exec), args[1]->toFloat(exec),
++              args[2]->toFloat(exec), args[3]->toFloat(exec));
++        return getWrapper<CanvasGradient>(exec, grad);
++    }
++
++    case Context2D::CreateRadialGradient: {
++        KJS_REQUIRE_ARGS(6);
++        KJS_CHECK_FLOAT_ARGS(0, 5);
++        
++        CanvasGradientImpl* grad = ctx->createRadialGradient(
++              args[0]->toFloat(exec), args[1]->toFloat(exec),
++              args[2]->toFloat(exec), args[3]->toFloat(exec),
++              args[4]->toFloat(exec), args[5]->toFloat(exec),
++              exception);
++
++        return getWrapper<CanvasGradient>(exec, grad);
++    }
+ 
+-        drawingContext->fillPath( contextObject->path(), contextObject->constructBrush( exec ) );
++    case Context2D::CreatePattern: {
++        KJS_REQUIRE_ARGS(2);
++
++        ElementImpl* el = toElement(args[0]);
++        if (!el) {
++          setDOMException(exec, DOMException::TYPE_MISMATCH_ERR);
++          return jsUndefined();
++        }
++
++        CanvasPatternImpl* pat = ctx->createPattern(el, args[1]->toString(exec).domString(),
++                                                    exception);
++
++        return getWrapper<CanvasPattern>(exec, pat);
++    }
++    
++    // Line properties are all... properties!
++    
++    // Rectangle ops
++    case Context2D::ClearRect: {
++        KJS_REQUIRE_ARGS(4);
++        KJS_CHECK_FLOAT_ARGS(0, 3);
++        
++        ctx->clearRect(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                       args[2]->toFloat(exec), args[3]->toFloat(exec),
++                       exception);
+ 
+-        renderer->setNeedsImageUpdate();
+         break;
+     }
+-    case Context2D::Stroke: {
+-        if (args.size() != 0)
+-            return throwError(exec, SyntaxError);
+ 
+-        drawingContext->strokePath( contextObject->path(), contextObject->constructPen( exec ) );
++    case Context2D::FillRect: {
++        KJS_REQUIRE_ARGS(4);
++        KJS_CHECK_FLOAT_ARGS(0, 3);
++        
++        ctx->fillRect(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                      args[2]->toFloat(exec), args[3]->toFloat(exec),
++                      exception);
+ 
+-        renderer->setNeedsImageUpdate();
+         break;
+     }
+-    case Context2D::Scale: {
+-        if (args.size() != 2)
+-            return throwError(exec, SyntaxError);
+-        float sx = (float)args[0]->toNumber(exec);
+-        float sy = (float)args[1]->toNumber(exec);
+-        drawingContext->scale( sx, sy );
+-        contextObject->_needsFlushRasterCache = true;
++
++    case Context2D::StrokeRect: {
++        KJS_REQUIRE_ARGS(4);
++        KJS_CHECK_FLOAT_ARGS(0, 3);
++        
++        ctx->strokeRect(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                        args[2]->toFloat(exec), args[3]->toFloat(exec),
++                        exception);
++
+         break;
+     }
+-    case Context2D::Rotate: {
+-        if (args.size() != 1)
+-            return throwError(exec, SyntaxError);
+-        float angle = (float)args[0]->toNumber(exec);
+-        drawingContext->rotate( angle );
+-        contextObject->_needsFlushRasterCache = true;
++
++    // Path ops
++    case Context2D::BeginPath: {
++        ctx->beginPath();
+         break;
+     }
+-    case Context2D::Translate: {
+-        if (args.size() != 2)
+-            return throwError(exec, SyntaxError);
+-        float tx = (float)args[0]->toNumber(exec);
+-        float ty = (float)args[1]->toNumber(exec);
+-        drawingContext->translate( tx, ty );
++    
++    case Context2D::ClosePath: {
++        ctx->closePath();
+         break;
+     }
++
+     case Context2D::MoveTo: {
+-        if (args.size() != 2)
+-            return throwError(exec, SyntaxError);
+-        float x = (float)args[0]->toNumber(exec);
+-        float y = (float)args[1]->toNumber(exec);
+-        contextObject->path().moveTo( x, y );
+-        renderer->setNeedsImageUpdate();
++        KJS_REQUIRE_ARGS(2);
++        KJS_CHECK_FLOAT_ARGS(0, 1);
++        
++        ctx->moveTo(args[0]->toFloat(exec), args[1]->toFloat(exec));
+         break;
+     }
++
+     case Context2D::LineTo: {
+-        if (args.size() != 2)
+-            return throwError(exec, SyntaxError);
+-        float x = (float)args[0]->toNumber(exec);
+-        float y = (float)args[1]->toNumber(exec);
+-        contextObject->path().lineTo( x, y );
+-        renderer->setNeedsImageUpdate();
++        KJS_REQUIRE_ARGS(2);
++        KJS_CHECK_FLOAT_ARGS(0, 1);
++            
++        ctx->lineTo(args[0]->toFloat(exec), args[1]->toFloat(exec));
+         break;
+     }
++
+     case Context2D::QuadraticCurveTo: {
+-        if (args.size() != 4)
+-            return throwError(exec, SyntaxError);
+-        float cpx = (float)args[0]->toNumber(exec);
+-        float cpy = (float)args[1]->toNumber(exec);
+-        float x = (float)args[2]->toNumber(exec);
+-        float y = (float)args[3]->toNumber(exec);
+-        contextObject->path().quadTo( cpx, cpy, x, y );
+-        renderer->setNeedsImageUpdate();
++        KJS_REQUIRE_ARGS(4);
++        KJS_CHECK_FLOAT_ARGS(0, 3);
++            
++        ctx->quadraticCurveTo(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                              args[2]->toFloat(exec), args[3]->toFloat(exec));
+         break;
+     }
++
+     case Context2D::BezierCurveTo: {
+-        if (args.size() != 6)
+-            return throwError(exec, SyntaxError);
+-        float cp1x = (float)args[0]->toNumber(exec);
+-        float cp1y = (float)args[1]->toNumber(exec);
+-        float cp2x = (float)args[2]->toNumber(exec);
+-        float cp2y = (float)args[3]->toNumber(exec);
+-        float x = (float)args[4]->toNumber(exec);
+-        float y = (float)args[5]->toNumber(exec);
+-        contextObject->path().cubicTo( cp1x, cp1y, cp2x, cp2y, x, y );
+-        renderer->setNeedsImageUpdate();
++        KJS_REQUIRE_ARGS(6);
++        KJS_CHECK_FLOAT_ARGS(0, 5);
++            
++        ctx->bezierCurveTo(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                           args[2]->toFloat(exec), args[3]->toFloat(exec),
++                           args[4]->toFloat(exec), args[5]->toFloat(exec));
+         break;
+     }
+-    case Context2D::ArcTo: {
+-        if (args.size() != 5)
+-            return throwError(exec, SyntaxError);
+-        float x1 = (float)args[0]->toNumber(exec);
+-        float y1 = (float)args[1]->toNumber(exec);
+-        float x2 = (float)args[2]->toNumber(exec);
+-        float y2 = (float)args[3]->toNumber(exec);
+-        float r = (float)args[4]->toNumber(exec);
+-        //### FIXME busted
+-        //me no feely like doing math to convert this correctly, yo
+-        contextObject->path().arcTo(x1, y1, x2-x1, y2-y1, r, 90);
+-        break;
+-    }
+-    case Context2D::Arc: {
+-        if (args.size() != 6)
+-            return throwError(exec, SyntaxError);
+-        float xc = (float)args[0]->toNumber(exec);
+-        float yc = (float)args[1]->toNumber(exec);
+-        float radius = (float)args[2]->toNumber(exec);
+-        float sar = (float)args[3]->toNumber(exec);
+-        float ear = (float)args[4]->toNumber(exec);
+-        bool  anticlockwise = args[5]->toBoolean(exec);
+-
+-
+-        //### HACK
+-        // In Qt we don't switch the coordinate system for degrees
+-        // and still use the 0,0 as bottom left for degrees so we need
+-        // to switch
+-        sar = -sar;
+-        ear = -ear;
+-        anticlockwise = !anticlockwise;
+-        //end hack
+-
+-        float sa = DEGREES( sar );
+-        float ea = DEGREES( ear );
+-
+-        double span = 0;
+-
+-        double xs     = xc - radius;
+-        double ys     = yc - radius;
+-        double width  = radius*2;
+-        double height = radius*2;
+-
+-        if ( !anticlockwise && ( ea < sa ) ) {
+-            span += 360;
+-        } else if ( anticlockwise && ( sa < ea ) ) {
+-            span -= 360;
+-        }
+-
+-        //### this is also due to switched coordinate system
+-        // we would end up with a 0 span instead of 360
+-        if ( !( qFuzzyCompare( span + ( ea - sa ), 0.0 ) &&
+-                qFuzzyCompare( fabs( span ), 360.0 ) ) ) {
+-            span   += ea - sa;
+-        }
+ 
+-        contextObject->path().moveTo( QPointF( xc + radius  * cos( sar ),
+-                                               yc - radius  * sin( sar ) ) );
+-#if 0
+-        QPen pen = drawingContext->pen();
+-        pen.setColor( Qt::red );
+-        pen.setWidth( 10 );
+-        drawingContext->save();
+-        drawingContext->setPen( pen );
+-        drawingContext->drawPoint( QPointF( xc + radius  * cos( sar ),
+-                                            yc - radius * sin( sar ) ) );
+-        drawingContext->restore();
+-        qDebug()<<"arcTo "<<xs<<ys<<width<<height<<sa<<span;
+-#endif
++    case Context2D::ArcTo: {
++        KJS_REQUIRE_ARGS(5);
++        KJS_CHECK_FLOAT_ARGS(0, 4);
+ 
+-        contextObject->path().arcTo(xs, ys, width, height, sa, span);
++        ctx->arcTo(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                   args[2]->toFloat(exec), args[3]->toFloat(exec),
++                   args[4]->toFloat(exec), exception);
+         break;
+     }
++
+     case Context2D::Rect: {
+-        if (args.size() != 4)
+-            return throwError(exec, SyntaxError);
+-        float x = (float)args[0]->toNumber(exec);
+-        float y = (float)args[1]->toNumber(exec);
+-        float w = (float)args[2]->toNumber(exec);
+-        float h = (float)args[3]->toNumber(exec);
+-        contextObject->path().addRect( x, y, w, h );
++        KJS_REQUIRE_ARGS(4);
++        KJS_CHECK_FLOAT_ARGS(0, 3);
++            
++        ctx->rect(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                  args[2]->toFloat(exec), args[3]->toFloat(exec),
++                  exception);
+         break;
+     }
+-    case Context2D::Clip: {
+-        if (args.size() != 0)
+-            return throwError(exec, SyntaxError);
+-        drawingContext->setClipPath( contextObject->path() );
++
++    case Context2D::Arc: {
++        KJS_REQUIRE_ARGS(6);
++        KJS_CHECK_FLOAT_ARGS(0, 5);
++            
++        ctx->arc(args[0]->toFloat(exec), args[1]->toFloat(exec),
++                 args[2]->toFloat(exec), args[3]->toFloat(exec),
++                 args[4]->toFloat(exec), args[5]->toBoolean(exec),
++                 exception);
+         break;
+     }
+ 
+-    case Context2D::ClearRect: {
+-        if (args.size() != 4)
+-            return throwError(exec, SyntaxError);
+-        float x = (float)args[0]->toNumber(exec);
+-        float y = (float)args[1]->toNumber(exec);
+-        float w = (float)args[2]->toNumber(exec);
+-        float h = (float)args[3]->toNumber(exec);
+-        drawingContext->eraseRect( QRectF( x, y, w, h ) );
+-        renderer->setNeedsImageUpdate();
++    case Context2D::Fill: {
++        ctx->fill();
+         break;
+     }
+-    case Context2D::FillRect: {
+-        if (args.size() != 4)
+-            return throwError(exec, SyntaxError);
+-        float x = (float)args[0]->toNumber(exec);
+-        float y = (float)args[1]->toNumber(exec);
+-        float w = (float)args[2]->toNumber(exec);
+-        float h = (float)args[3]->toNumber(exec);
+ 
+-        drawingContext->fillRect( QRectF( x, y, w, h ), contextObject->constructBrush( exec ) );
+-        renderer->setNeedsImageUpdate();
++    case Context2D::Stroke: {
++        ctx->stroke();
+         break;
+     }
+-    case Context2D::StrokeRect: {
+-        int size = args.size();
+-        if (size < 4)
+-            return throwError(exec, SyntaxError);
+-        float x = (float)args[0]->toNumber(exec);
+-        float y = (float)args[1]->toNumber(exec);
+-        float w = (float)args[2]->toNumber(exec);
+-        float h = (float)args[3]->toNumber(exec);
+-
+-        QPainterPath path; path.addRect( x, y, w, h );
+-        if (size > 4) {
+-            QPen pen = contextObject->constructPen( exec );
+-            pen.setWidthF( (float)args[4]->toNumber(exec) );
+-            drawingContext->strokePath( path, pen );
+-        }
+-        else {
+-            drawingContext->strokePath( path, contextObject->constructPen( exec ) );
+-        }
+-        renderer->setNeedsImageUpdate();
++
++    case Context2D::Clip: {
++        ctx->clip();
+         break;
+     }
+-        // DrawImage has three variants:
+-        // drawImage (img, dx, dy)
+-        // drawImage (img, dx, dy, dw, dh)
+-        // drawImage (img, sx, sy, sw, sh, dx, dy, dw, dh)
+-        // composite operation is specified with globalCompositeOperation
+-        // img parameter can be a JavaScript Image, <img>, or a <canvas>
+-    case Context2D::DrawImage: {
+-        if (args.size() < 3)
+-            return throwError(exec, SyntaxError);
+ 
+-        // Make sure first argument is an object.
+-        ObjectImp *o = static_cast<ObjectImp*>(args[0]);
+-        if (!o->isObject())
+-            return throwError(exec, TypeError);
+-
+-        float w = 0; // quiet incorrect gcc 4.0 warning
+-        float h = 0; // quiet incorrect gcc 4.0 warning
+-        QPixmap pixmap;
+-        QPainter *sourceContext = 0;
+-
+-        // Check for <img> or <canvas>.
+-        if (o->inherits(&KJS::HTMLElement::img_info)){
+-            NodeImpl *n = static_cast<HTMLElement *>(args[0])->impl();
+-            HTMLImageElementImpl *e = static_cast<HTMLImageElementImpl*>(n);
+-            pixmap = e->currentPixmap();
+-            w = pixmap.width();
+-            h = pixmap.height();
+-        }
+-        else if (o->inherits(&KJS::HTMLElement::canvas_info)){
+-            NodeImpl *n = static_cast<HTMLElement *>(args[0])->impl();
+-            HTMLCanvasElementImpl *e = static_cast<HTMLCanvasElementImpl*>(n);
+-            khtml::RenderCanvasImage *renderer = static_cast<khtml::RenderCanvasImage*>(e->renderer());
+-            if (!renderer) {
+-                // No renderer, nothing to draw.
+-                return Undefined();
+-            }
+-
+-            sourceContext = renderer->drawingContext();
+-            w = (float)sourceContext->device()->width();
+-            h = (float)sourceContext->device()->height();
+-        }
+-        else
+-            return throwError(exec, TypeError);
+-
+-        float dx, dy, dw = w, dh = h;
+-        float sx = 0.f, sy = 0.f, sw = w, sh = h;
+-
+-        if (args.size() == 3) {
+-            dx = args[1]->toNumber(exec);
+-            dy = args[2]->toNumber(exec);
+-        }
+-        else if (args.size() == 5) {
+-            dx = args[1]->toNumber(exec);
+-            dy = args[2]->toNumber(exec);
+-            dw = args[3]->toNumber(exec);
+-            dh = args[4]->toNumber(exec);
+-        }
+-        else if (args.size() == 9) {
+-            sx = args[1]->toNumber(exec);
+-            sy = args[2]->toNumber(exec);
+-            sw = args[3]->toNumber(exec);
+-            sh = args[4]->toNumber(exec);
+-            dx = args[5]->toNumber(exec);
+-            dy = args[6]->toNumber(exec);
+-            dw = args[7]->toNumber(exec);
+-            dh = args[8]->toNumber(exec);
++    case Context2D::DrawImage: {
++        ElementImpl* el = toElement(args[0]);
++        if (!el) {
++            setDOMException(exec, DOMException::TYPE_MISMATCH_ERR);
++            break;
+         }
+-        else
+-            return throwError(exec, SyntaxError);
+ 
+-        if (!sourceContext) {
+-            QString compositeOperator = contextObject->_globalComposite->toString(exec).qstring().toLower();
+-            QPainter::CompositionMode mode = compositeOperatorFromString(compositeOperator);
+-            drawingContext->setCompositionMode( mode );
+-            drawingContext->drawPixmap( QRectF( dx, dy, dw, dh ), pixmap, QRectF( sx, sy, sw, sh ) );
+-        }
+-        else {
+-            // Cheap, because the image is backed by copy-on-write memory, and we're
+-            // guaranteed to release before doing any more drawing in the source context.
+-            sourceContext->end();
+-            QImage *sourceImage = dynamic_cast<QImage*>( sourceContext->device() );
+-            if ( sourceImage ) {
+-                drawingContext->drawImage( QRectF( sx, sy, sw, sh ), *sourceImage,
+-                                           QRectF( dx, dy, dw, dh ) );
+-            }
++        if (args.size() < 3) {
++            setDOMException(exec, DOMException::NOT_SUPPORTED_ERR);
++            break;
+         }
+-
+-        renderer->setNeedsImageUpdate();
+-        break;
+-    }
+-    case Context2D::DrawImageFromRect: {
+-        if (args.size() != 10)
+-            return throwError(exec, SyntaxError);
+-        ObjectImp *o = static_cast<ObjectImp*>(args[0]);
+-        if (!o->isObject() || !o->inherits(&HTMLElement::img_info))
+-            return throwError(exec, TypeError);
+-        DOM::HTMLImageElementImpl *i = static_cast<DOM::HTMLImageElementImpl*>(static_cast<HTMLElement*>(o)->impl());
+-        float sx = args[1]->toNumber(exec);
+-        float sy = args[2]->toNumber(exec);
+-        float sw = args[3]->toNumber(exec);
+-        float sh = args[4]->toNumber(exec);
+-        float dx = args[5]->toNumber(exec);
+-        float dy = args[6]->toNumber(exec);
+-        float dw = args[7]->toNumber(exec);
+-        float dh = args[8]->toNumber(exec);
+-        QString compositeOperator = args[9]->toString(exec).qstring().toLower();
+-        khtml::CachedImage *ci = i->image();
+-        if (ci) {
+-            QPixmap pixmap = ci->pixmap();
+-            if ( !compositeOperator.isEmpty() ) {
+-                QPainter::CompositionMode mode = compositeOperatorFromString(compositeOperator);
+-                drawingContext->setCompositionMode( mode );
+-            }
+-
+-            drawingContext->drawPixmap(QRectF( dx, dy, dw, dh ), pixmap, QRectF( sx, sy, sw, sh ));
+-
+-            renderer->setNeedsImageUpdate();
++        
++        if (args.size() < 5) { // 3 or 4 arguments
++            KJS_CHECK_FLOAT_ARGS(1, 2);
++            ctx->drawImage(el,
++                           args[1]->toFloat(exec),
++                           args[2]->toFloat(exec),
++                           exception);
++        } else if (args.size() < 9) { // 5 through 9 arguments
++            KJS_CHECK_FLOAT_ARGS(1, 4);
++            ctx->drawImage(el,
++                           args[1]->toFloat(exec),
++                           args[2]->toFloat(exec),
++                           args[3]->toFloat(exec),
++                           args[4]->toFloat(exec),
++                           exception);
++        } else  { // 9 or more arguments
++            KJS_CHECK_FLOAT_ARGS(1, 8);
++            ctx->drawImage(el,
++                           args[1]->toFloat(exec),
++                           args[2]->toFloat(exec),
++                           args[3]->toFloat(exec),
++                           args[4]->toFloat(exec),
++                           args[5]->toFloat(exec),
++                           args[6]->toFloat(exec),
++                           args[7]->toFloat(exec),
++                           args[8]->toFloat(exec),
++                           exception);
+         }
+         break;
+     }
+-    case Context2D::SetAlpha: {
+-        if (args.size() != 1)
+-            return throwError(exec, SyntaxError);
+-        float a =  (float)args[0]->toNumber(exec);
+-        QPen     pen = drawingContext->pen();
+-        QBrush brush = drawingContext->brush();
+-        QColor qc = pen.color();
+-        qc.setAlphaF( a );
+-        pen.setColor( qc );
+-        qc = brush.color();
+-        qc.setAlphaF( a );
+-        brush.setColor( qc );
+-        drawingContext->setPen( pen );
+-        drawingContext->setBrush( brush );
+-        break;
+-    }
+-    case Context2D::SetCompositeOperation: {
+-        if (args.size() != 1)
+-            return throwError(exec, SyntaxError);
+-        QString compositeOperator = args[0]->toString(exec).qstring().toLower();
+-        QPainter::CompositionMode mode = compositeOperatorFromString( compositeOperator );
+-        //###
+-        drawingContext->setCompositionMode(mode);
+-        break;
+-    }
+-
+-    case Context2D::CreateLinearGradient: {
+-        if (args.size() != 4)
+-            return throwError(exec, SyntaxError);
+-        float x0 = args[0]->toNumber(exec);
+-        float y0 = args[1]->toNumber(exec);
+-        float x1 = args[2]->toNumber(exec);
+-        float y1 = args[3]->toNumber(exec);
+-
+-        return new Gradient(x0, y0, x1, y1);
+-    }
+ 
+-    case Context2D::CreateRadialGradient: {
+-        if (args.size() != 6)
+-            return throwError(exec, SyntaxError);
+-        float x0 = args[0]->toNumber(exec);
+-        float y0 = args[1]->toNumber(exec);
+-        float r0 = args[2]->toNumber(exec);
+-        float x1 = args[3]->toNumber(exec);
+-        float y1 = args[4]->toNumber(exec);
+-        float r1 = args[5]->toNumber(exec);
+-
+-        return new Gradient(x0, y0, r0, x1, y1, r1);
+-    }
+-
+-    case Context2D::CreatePattern: {
+-        if (args.size() != 2)
+-            return throwError(exec, SyntaxError);
+-        ObjectImp *o = static_cast<ObjectImp*>(args[0]);
+-        if (!o->isObject() || !o->inherits(&HTMLElement::img_info))
+-            return throwError(exec, TypeError);
+-        int repetitionType = ImagePattern::Repeat;
+-        DOMString repetitionString = args[1]->toString(exec).domString().lower();
+-        if (repetitionString == "repeat-x")
+-            repetitionType = ImagePattern::RepeatX;
+-        else if (repetitionString == "repeat-y")
+-            repetitionType = ImagePattern::RepeatY;
+-        else if (repetitionString == "no-repeat")
+-            repetitionType = ImagePattern::NoRepeat;
+-        return new ImagePattern(static_cast<HTMLElement*>(o), repetitionType);
+-    }
++    //### TODO: isPointInPath, shadows, ImageData
+     }
+ 
+     return Undefined();
+ }
+ 
+-const ClassInfo Context2D::info = { "Context2D", 0, &Context2DTable, 0 };
++const ClassInfo Context2D::info = { "CanvasRenderingContext2D", 0, &Context2DTable, 0 };
+ 
+-/* Source for Context2DTable. Use "make hashtables" to regenerate.
+-   @begin Context2DTable 48
++/*
++   @begin Context2DTable 11
++   canvas                   Context2D::Canvas                      DontDelete|ReadOnly
++   #
++   # compositing
++   globalAlpha              Context2D::GlobalAlpha                 DontDelete
++   globalCompositeOperation Context2D::GlobalCompositeOperation    DontDelete
++   #
++   # colors and styles
+    strokeStyle              Context2D::StrokeStyle                 DontDelete
+    fillStyle                Context2D::FillStyle                   DontDelete
++   #
++   # line drawing properties
+    lineWidth                Context2D::LineWidth                   DontDelete
+    lineCap                  Context2D::LineCap                     DontDelete
+    lineJoin                 Context2D::LineJoin                    DontDelete
+    miterLimit               Context2D::MiterLimit                  DontDelete
+-   globalAlpha              Context2D::GlobalAlpha                 DontDelete
+-   globalCompositeOperation Context2D::GlobalCompositeOperation    DontDelete
+-   save                     Context2D::Save                        DontDelete|Function 0
+-   restore                  Context2D::Restore                     DontDelete|Function 0
+-   scale                    Context2D::Scale                       DontDelete|Function 2
+-   rotate                   Context2D::Rotate                      DontDelete|Function 2
+-   translate                Context2D::Translate                   DontDelete|Function 1
+-   beginPath                Context2D::BeginPath                   DontDelete|Function 0
+-   closePath                Context2D::ClosePath                   DontDelete|Function 0
+-   setStrokeColor           Context2D::SetStrokeColor              DontDelete|Function 1
+-   setFillColor             Context2D::SetFillColor                DontDelete|Function 1
+-   setLineWidth             Context2D::SetLineWidth                DontDelete|Function 1
+-   setLineCap               Context2D::SetLineCap                  DontDelete|Function 1
+-   setLineJoin              Context2D::SetLineJoin                 DontDelete|Function 1
+-   setMiterLimit            Context2D::SetMiterLimit               DontDelete|Function 1
+-   fill                     Context2D::Fill                        DontDelete|Function 0
+-   stroke                   Context2D::Stroke                      DontDelete|Function 0
+-   moveTo                   Context2D::MoveTo                      DontDelete|Function 2
+-   lineTo                   Context2D::LineTo                      DontDelete|Function 2
+-   quadraticCurveTo         Context2D::QuadraticCurveTo            DontDelete|Function 4
+-   bezierCurveTo            Context2D::BezierCurveTo               DontDelete|Function 6
+-   arcTo                    Context2D::ArcTo                       DontDelete|Function 5
+-   arc                      Context2D::Arc                         DontDelete|Function 6
+-   rect                     Context2D::Rect                        DontDelete|Function 4
+-   clip                     Context2D::Clip                        DontDelete|Function 0
+-   clearRect                Context2D::ClearRect                   DontDelete|Function 4
+-   fillRect                 Context2D::FillRect                    DontDelete|Function 4
+-   strokeRect               Context2D::StrokeRect                  DontDelete|Function 4
+-   drawImage                Context2D::DrawImage                   DontDelete|Function 6
+-   drawImageFromRect        Context2D::DrawImageFromRect           DontDelete|Function 10
+-   setAlpha                 Context2D::SetAlpha                    DontDelete|Function 1
+-   setCompositeOperation    Context2D::SetCompositeOperation       DontDelete|Function 1
+-   createLinearGradient     Context2D::CreateLinearGradient        DontDelete|Function 4
+-   createRadialGradient     Context2D::CreateRadialGradient        DontDelete|Function 6
+-   createPattern            Context2D::CreatePattern               DontDelete|Function 2
+    @end
+ */
+ 
+-bool Context2D::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
++bool Context2D::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+ {
+-    // FIXME: functions should be on the prototype, not in the object itself
+-    return getStaticPropertySlot<Context2DFunction, Context2D, DOMObject>(exec, &Context2DTable, this, propertyName, slot);
++    return getStaticOwnValueSlot<Context2D>(&Context2DTable, this, propertyName, slot);
+ }
+ 
+-ValueImp *Context2D::getValueProperty(ExecState *, int token) const
++static ValueImp* encodeStyle(ExecState* exec, CanvasStyleBaseImpl* style)
+ {
+-    switch(token) {
+-    case StrokeStyle: {
+-        return _strokeStyle;
+-    }
+-
+-    case FillStyle: {
+-        return _fillStyle;
++    switch (style->type()) {
++    case CanvasStyleBaseImpl::Color:
++        return jsString(UString(static_cast<CanvasColorImpl*>(style)->toString()));
++    case CanvasStyleBaseImpl::Gradient:
++        return getWrapper<CanvasGradient>(exec, static_cast<CanvasGradientImpl*>(style));
++    case CanvasStyleBaseImpl::Pattern:
++        return getWrapper<CanvasPattern>(exec, static_cast<CanvasPatternImpl*>(style));
+     }
+ 
+-    case LineWidth: {
+-        return _lineWidth;
+-    }
+-
+-    case LineCap: {
+-        return _lineCap;
+-    }
+-
+-    case LineJoin: {
+-        return _lineJoin;
+-    }
+-
+-    case MiterLimit: {
+-        return _miterLimit;
+-    }
+-
+-    case GlobalAlpha: {
+-        return _globalAlpha;
+-    }
+-
+-    case GlobalCompositeOperation: {
+-        return _globalComposite;
+-    }
+-
+-    default: {
+-    }
+-    }
+-
+-    return Undefined();
++    return jsNull();
+ }
+ 
+-void Context2D::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
++
++// ### TODO: test how non-string things are handled in other browsers.
++static CanvasStyleBaseImpl* decodeStyle(ExecState* exec, ValueImp* v)
+ {
+-    lookupPut<Context2D,DOMObject>(exec, propertyName, value, attr, &Context2DTable, this );
++    if (v->isObject() && static_cast<ObjectImp*>(v)->inherits(&CanvasGradient::info))
++        return static_cast<CanvasGradient*>(v)->impl();
++    else if (v->isObject() && static_cast<ObjectImp*>(v)->inherits(&CanvasPattern::info))
++        return static_cast<CanvasPattern*>(v)->impl();
++    else
++        return CanvasColorImpl::fromString(v->toString(exec).domString());
+ }
+ 
+-QPainter *Context2D::drawingContext()
++ValueImp* Context2D::getValueProperty(ExecState* exec, int token) const
+ {
+-    khtml::RenderCanvasImage *renderer = static_cast<khtml::RenderCanvasImage*>(_element->renderer());
+-    if (!renderer)
+-        return 0;
+-
+-    QPainter *context = renderer->drawingContext();
+-    if (!context)
+-        return 0;
++    const CanvasContext2DImpl* ctx = impl();
++    switch(token) {
++    case Canvas:
++        return getDOMNode(exec, ctx->canvas());
+ 
+-    return context;
+-}
++    case GlobalAlpha:
++        return jsNumber(ctx->globalAlpha());
+ 
+-static QList<qreal> parseNumbersList(QString::const_iterator &itr)
+-{
+-    QList<qreal> points;
+-    QLocale c(QLocale::C);
+-    QString temp;
+-    bool percent = false;
+-    while ((*itr).isSpace())
+-        ++itr;
+-    while ((*itr).isNumber() ||
+-           (*itr) == '-' || (*itr) == '+' || (*itr) == '.') {
+-        temp = QString();
+-
+-        if ((*itr) == '-')
+-            temp += *itr++;
+-        else if ((*itr) == '+')
+-            temp += *itr++;
+-        while ((*itr).isDigit())
+-            temp += *itr++;
+-        if ((*itr) == '.')
+-            temp += *itr++;
+-        while ((*itr).isDigit())
+-            temp += *itr++;
+-        while ((*itr).isSpace())
+-            ++itr;
+-        if ((*itr) == '%')
+-            ++itr, percent = true;
+-        while ((*itr).isSpace())
+-            ++itr;
+-        if ((*itr) == ',')
+-            ++itr;
+-        points.append(c.toDouble(temp) * (percent ? 2.55 : 1));
+-        //eat spaces
+-        while ((*itr).isSpace())
+-            ++itr;
+-        percent = false;
+-    }
++    case GlobalCompositeOperation:
++        return jsString(ctx->globalCompositeOperation());
+ 
+-    return points;
+-}
++    case StrokeStyle:
++        return encodeStyle(exec, ctx->strokeStyle());
+ 
+-QColor colorFromValue(ExecState *exec, ValueImp *value)
+-{
+-    QString name = value->toString(exec).qstring().trimmed();
+-    QString::const_iterator itr = name.constBegin();
+-    QList<qreal> compo;
+-    if ( name.startsWith( "rgba(" ) || name.startsWith( "hsva(" ) ) {
+-        ++itr; ++itr; ++itr; ++itr; ++itr;
+-        compo = parseNumbersList(itr);
+-        if ( compo.size() != 4 ) {
+-            return QColor();
+-        }
+-        return name.startsWith('h') ?
+-            QColor::fromHsvF( compo[0]/255, compo[1]/255, compo[2]/255, compo[3] ) :
+-            QColor::fromRgbF( compo[0]/255, compo[1]/255, compo[2]/255, compo[3] );
+-    } else if ( name.startsWith( "rgb(" ) ||  name.startsWith( "hsv(" ) ) {
+-        ++itr; ++itr; ++itr; ++itr;
+-        compo = parseNumbersList(itr);
+-        if ( compo.size() != 3 ) {
+-            return QColor();
+-        }
+-        return name.startsWith('h') ?
+-            QColor::fromHsv( compo[0], compo[1], compo[2] ) :
+-            QColor::fromRgb( compo[0], compo[1], compo[2] );
+-    } else {
+-        QRgb color;
+-        DOM::CSSParser::parseColor(name, color);
+-        return QColor(color);
+-    }
+-}
++    case FillStyle:
++        return encodeStyle(exec, ctx->fillStyle());
+ 
+-void Context2D::updateStrokeImagePattern()
+-{
+-    QPainter *context = drawingContext();
++    case LineWidth:
++        return jsNumber(ctx->lineWidth());
++    
++    case LineCap:
++        return jsString(ctx->lineCap());
+ 
+-    if (!_validStrokeImagePattern) {
+-        ImagePattern *imagePattern = static_cast<ImagePattern *>(_fillStyle);
+-        QBrush pattern = imagePattern->createPattern();
+-        QPen pen = context->pen();
+-        pen.setBrush( pattern );
+-        context->setPen( pen );
+-        _validStrokeImagePattern = true;
+-    }
+-}
++    case LineJoin:
++        return jsString(ctx->lineJoin());
+ 
+-QBrush Context2D::constructBrush(ExecState* exec)
+-{
+-    //### FIXME: caching and such
+-    if (_fillStyle->isString()) {
+-        QColor qc = colorFromValue(exec, _fillStyle);
+-        return QBrush( qc );
+-    }
+-    else {
+-        ObjectImp *o = static_cast<ObjectImp*>(_fillStyle);
+-
+-        if (o->inherits(&Gradient::info)) {
+-            Gradient *gradient = static_cast<Gradient*>(o);
+-            return QBrush( *gradient->qgradient() );
+-        } else {
+-            //Must be an image pattern
+-            ImagePattern *imagePattern = static_cast<ImagePattern *>(_fillStyle);
+-            return imagePattern->createPattern();
+-        }
++    case MiterLimit:
++        return jsNumber(ctx->miterLimit());
++
++    default:
++        assert(0);
++        return jsUndefined();
+     }
+ }
+ 
+-
+-QPen Context2D::constructPen(ExecState* exec)
++void Context2D::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+ {
+-    //### FIXME: caching and such
+-    QPen pen = drawingContext()->pen();
+-    float w = (float)_lineWidth->toNumber(exec);
+-    pen.setWidth(w);
+-    if (_strokeStyle->isString()) {
+-        QColor qc = colorFromValue(exec, _strokeStyle);
+-        pen.setColor( qc );
+-        return pen;
+-    }
+-    else {
+-        ObjectImp *o = static_cast<ObjectImp*>(_strokeStyle);
+-        if (o->inherits(&Gradient::info)) {
+-            Gradient *gradient = static_cast<Gradient*>(o);
+-            pen.setBrush( QBrush( *gradient->qgradient() ) );
+-            return pen;
+-        } else {
+-            //Must be an image pattern
+-            ImagePattern *imagePattern = static_cast<ImagePattern *>(_fillStyle);
+-            pen.setBrush( imagePattern->createPattern() );
+-            return pen;
+-        }
+-    }
++    lookupPut<Context2D,DOMObject>(exec, propertyName, value, attr, &Context2DTable, this );
+ }
+ 
+ void Context2D::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+ {
+-    QPainter *context = drawingContext();
+-    if (!context)
+-        return;
+-
++    CanvasContext2DImpl* ctx = impl();
+     switch(token) {
+-    case StrokeStyle: {
+-        _strokeStyle = value;
+-        if (value->isString()) {
+-            QColor qc = colorFromValue(exec, value);
+-            QPen pen = context->pen();
+-            pen.setColor( qc );
+-        }
+-        else {
+-            // _strokeStyle is used when stroke() is called on the context.
+-            //### fix this
+-            ObjectImp *o = static_cast<ObjectImp*>(value);
+-
+-            if (!o->isObject() || !(o->inherits(&Gradient::info) || o->inherits(&ImagePattern::info)))
+-                throwError(exec, TypeError);
+-        }
++    case GlobalAlpha:
++        ctx->setGlobalAlpha(value->toFloat(exec));
+         break;
+-    }
+-
+-    case FillStyle: {
+-        if (!value->isString()) {
+-            ObjectImp *o = static_cast<ObjectImp*>(value);
+-            if (!o->isObject() || !(o->inherits(&Gradient::info) || o->inherits(&ImagePattern::info)))
+-                throwError(exec, TypeError);
+-        }
+-        _fillStyle = value;
++    case GlobalCompositeOperation:
++        ctx->setGlobalCompositeOperation(value->toString(exec).domString());
+         break;
+-    }
+-
+-    case LineWidth: {
+-        _lineWidth = value;
+-        float w = (float)value->toNumber(exec);
+-        QPen pen = context->pen();
+-        pen.setWidthF( w );
+-        context->setPen( pen );
++    case StrokeStyle:
++        ctx->setStrokeStyle(decodeStyle(exec, value));
+         break;
+-    }
+-
+-    case LineCap: {
+-        _lineCap = value;
+-        QPen pen = context->pen();
+-        DOMString capString = value->toString(exec).domString().lower();
+-        if (capString == "round")
+-            pen.setCapStyle( Qt::RoundCap );
+-        else if (capString == "square")
+-            pen.setCapStyle( Qt::SquareCap );
+-        else
+-            pen.setCapStyle( Qt::FlatCap );
+-        context->setPen( pen );
++    case FillStyle:
++        ctx->setFillStyle(decodeStyle(exec, value));
+         break;
+-    }
+-
+-    case LineJoin: {
+-        _lineJoin = value;
+-        DOMString joinString = value->toString(exec).domString().lower();
+-        QPen pen = context->pen();
+-        if (joinString == "round")
+-            pen.setJoinStyle( Qt::RoundJoin );
+-        else if (joinString == "bevel")
+-            pen.setJoinStyle( Qt::BevelJoin );
+-        else
+-            pen.setJoinStyle( Qt::MiterJoin );
+-        context->setPen( pen );
++    case LineWidth:
++        ctx->setLineWidth(value->toFloat(exec));
+         break;
+-    }
+-
+-    case MiterLimit: {
+-        _miterLimit = value;
+-
+-        float l = (float)value->toNumber(exec);
+-        QPen pen = context->pen();
+-        pen.setMiterLimit( l );
+-        context->setPen( pen );
++    case LineCap:
++        ctx->setLineCap(value->toString(exec).domString());
+         break;
+-    }
+-
+-    case GlobalAlpha: {
+-        _globalAlpha = value;
+-        float a =  (float)value->toNumber(exec);
+-        QBrush brush = context->brush();
+-        QPen     pen = context->pen();
+-
+-        QColor qc = brush.color(); qc.setAlphaF( a ); brush.setColor( qc );
+-        context->setBrush( brush );
+-
+-        qc = pen.color(); qc.setAlphaF( a ); pen.setColor( qc );
+-        context->setPen( pen );
++    case LineJoin:
++        ctx->setLineJoin(value->toString(exec).domString());
+         break;
+-    }
+-
+-    case GlobalCompositeOperation: {
+-        _globalComposite = value;
+-        QString compositeOperator = value->toString(exec).qstring().toLower();
+-        QPainter::CompositionMode mode = compositeOperatorFromString( compositeOperator );
+-        context->setCompositionMode( mode );
++    case MiterLimit:
++        ctx->setMiterLimit(value->toFloat(exec));
+         break;
+-    }
+-
+-    default: {
+-    }
++    default:
++        {} // huh?
+     }
+ }
+ 
+-void Context2D::save()
+-{
+-    List *list = new List();
+-
+-    list->append(_strokeStyle);
+-    list->append(_fillStyle);
+-    list->append(_lineWidth);
+-    list->append(_lineCap);
+-    list->append(_lineJoin);
+-    list->append(_miterLimit);
+-    list->append(_globalAlpha);
+-    list->append(_globalComposite);
+-
+-    stateStack.append(list);
+-}
+-
+-void Context2D::restore()
+-{
+-    if (stateStack.count() < 1) {
+-        return;
+-    }
+-
+-    List *list = stateStack.last();
+-
+-    int pos = 0;
+-    _strokeStyle = list->at(pos++);
+-    _fillStyle = list->at(pos++);
+-    _lineWidth = list->at(pos++);
+-    _lineCap = list->at(pos++);
+-    _lineJoin = list->at(pos++);
+-    _miterLimit = list->at(pos++);
+-    _globalAlpha = list->at(pos++);
+-    _globalComposite = list->at(pos++);
+-
+-    // This will delete list.
+-    stateStack.removeLast();
+-}
+-
+-Context2D::Context2D(HTMLElementImpl *e)
+-    : _validStrokeImagePattern(false),
+-      _element(e), _needsFlushRasterCache(false),
+-      _strokeStyle(Undefined()),
+-      _fillStyle(Undefined()),
+-      _lineWidth(Undefined()),
+-      _lineCap(Undefined()),
+-      _lineJoin(Undefined()),
+-      _miterLimit(Undefined()),
+-      _globalAlpha(Undefined()),
+-      _globalComposite(Undefined())
+-{
+-    _lineWidth = Number(1);
+-    _strokeStyle = String("black");
+-    _fillStyle = String("black");
+-
+-    _lineCap = String("butt");
+-    _lineJoin = String("miter");
+-    _miterLimit = Number(10);
+-
+-    _globalAlpha = Number(1);
+-    _globalComposite = String("source-over");
+-}
+-
+-Context2D::~Context2D()
+-{
+-    qDeleteAll(stateStack.begin(), stateStack.end());
+-}
+-
+-void Context2D::mark()
+-{
+-    ValueImp *v;
+-
+-    v = _strokeStyle;
+-    if (!v->marked())
+-        v->mark();
+ 
+-    v = _fillStyle;
+-    if (!v->marked())
+-        v->mark();
+ 
+-    v = _lineWidth;
+-    if (!v->marked())
+-        v->mark();
++////////////////////// CanvasGradient Object ////////////////////////
++const ClassInfo KJS::CanvasGradient::info = { "CanvasGradient", 0, 0, 0 };
+ 
+-    v = _lineCap;
+-    if (!v->marked())
+-        v->mark();
++KJS_DEFINE_PROTOTYPE(CanvasGradientProto)
++KJS_IMPLEMENT_PROTOFUNC(CanvasGradientFunction)
++KJS_IMPLEMENT_PROTOTYPE("CanvasGradientProto", CanvasGradientProto, CanvasGradientFunction)
+ 
+-    v = _lineJoin;
+-    if (!v->marked())
+-        v->mark();
+-
+-    v = _miterLimit;
+-    if (!v->marked())
+-        v->mark();
+-
+-    v = _globalAlpha;
+-    if (!v->marked())
+-        v->mark();
+-
+-    v = _globalComposite;
+-    if (!v->marked())
+-        v->mark();
+-
+-    QListIterator<List*> it(stateStack);
+-    List *list;
+-    while (it.hasNext()) {
+-        list = it.next();
+-        list->mark();
+-    }
+-
+-    DOMObject::mark();
+-}
+-
+-static qreal adjustPosition( qreal pos, const QGradientStops &stops )
+-{
+-    QGradientStops::const_iterator itr = stops.constBegin();
+-    const qreal smallDiff = 0.00001;
+-    while ( itr != stops.constEnd() ) {
+-        const QGradientStop &stop = *itr;
+-        ++itr;
+-        bool atEnd = ( itr != stops.constEnd() );
+-        if ( qFuzzyCompare( pos, stop.first ) ) {
+-            if ( atEnd || !qFuzzyCompare( pos + smallDiff, ( *itr ).first ) ) {
+-                return pos + smallDiff;
+-            }
+-        }
+-    }
+-    return pos;
+-}
+-
+-const ClassInfo KJS::Gradient::info = { "Gradient", 0, &GradientTable, 0 };
+-
+-/* Source for GradientTable. Use "make hashtables" to regenerate.
+-   @begin GradientTable 1
+-   addColorStop             Gradient::AddColorStop                DontDelete|Function 2
++/*
++   @begin CanvasGradientProtoTable 1
++   addColorStop             CanvasGradient::AddColorStop                DontDelete|Function 2
+    @end
+ */
+ 
+-KJS_IMPLEMENT_PROTOFUNC(GradientFunction)
+-
+-ValueImp *GradientFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
++ValueImp *CanvasGradientFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+ {
+-    if (!thisObj->inherits(&Gradient::info))
+-        return throwError(exec, TypeError);
++    KJS_CHECK_THIS(CanvasGradient, thisObj);
+ 
+-    Gradient *gradient = static_cast<KJS::Gradient *>(thisObj);
++    CanvasGradientImpl* impl = static_cast<KJS::CanvasGradient*>(thisObj)->impl();
+ 
++    DOMExceptionTranslator exception(exec);
+     switch (id) {
+-    case Gradient::AddColorStop: {
+-        if (args.size() != 2)
+-            return throwError(exec, SyntaxError);
+-
+-        QColor color = colorFromValue(exec, args[1]);
+-        qreal pos = (float)args[0]->toNumber(exec);
+-        //<canvas> says that gradient can have two stops at the same position
+-        //Qt doesn't handle that. We hack around that by creating a fake position
+-        //stop.
+-        pos = adjustPosition( pos, gradient->qgradient()->stops() );
+-        gradient->addColorStop(pos, color.red()/255.f, color.green()/255.f, color.blue()/255.f, color.alpha()/255.f);
++    case CanvasGradient::AddColorStop:
++        KJS_REQUIRE_ARGS(2);
++        impl->addColorStop(args[0]->toFloat(exec), args[1]->toString(exec).domString(), exception);
+         break;
+-    }
++    default:
++        assert(0);
+     }
+ 
+     return Undefined();
+ }
+ 
+-void Gradient::commonInit()
+-{
+-    stops = 0;
+-    stopCount = 0;
+-    maxStops = 0;
+-    stopsNeedAdjusting = false;
+-    adjustedStopCount = 0;
+-    adjustedStops = 0;
+-}
++CanvasGradient::CanvasGradient(ExecState* exec, DOM::CanvasGradientImpl* impl) :
++    WrapperBase(CanvasGradientProto::self(exec), impl)
++{}
+ 
+-Gradient::Gradient(float x0, float y0, float x1, float y1)
+-{
+-    m_gradient = new QLinearGradient( x0, y0, x1, y1 );
++////////////////////// CanvasPattern Object ////////////////////////
+ 
+-    commonInit();
+-}
++const ClassInfo CanvasPattern::info = { "CanvasPattern", 0, 0, 0 };
+ 
+-Gradient::Gradient(float x0, float y0, float r0, float x1, float y1, float /*r1*/)
+-{
+-    //### need to add the outer redius to Qt Arthur
+-    m_gradient = new QRadialGradient( x0, y0, r0, x1, y1 );
+-
+-    commonInit();
+-}
+-
+-bool Gradient::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+-{
+-    return getStaticPropertySlot<GradientFunction, Gradient, DOMObject>(exec, &GradientTable, this, propertyName, slot);
+-}
+-
+-ValueImp *Gradient::getValueProperty(ExecState *, int token) const
+-{
+-    return Undefined();
+-}
+-
+-void Gradient::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+-{
+-    lookupPut<Gradient,DOMObject>(exec, propertyName, value, attr, &GradientTable, this );
+-}
+-
+-void Gradient::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+-{
+-}
+-
+-Gradient::~Gradient()
+-{
+-    delete m_gradient; m_gradient = 0;
+-}
+-
+-void Gradient::addColorStop (float s, float r, float g, float b, float a)
+-{
+-    QColor qc;
+-    qc.setRgbF( r, g, b, a );
+-    m_gradient->setColorAt( s, qc );
+-}
+-
+-const ClassInfo ImagePattern::info = { "ImagePattern", 0, &ImagePatternTable, 0 };
++// Provide an empty prototype in case people want to hack it
++KJS_DEFINE_PROTOTYPE(CanvasPatternProto)
++KJS_IMPLEMENT_PROTOFUNC(CanvasPatternFunction)
++KJS_IMPLEMENT_PROTOTYPE("CanvasPatternProto", CanvasPatternProto, CanvasPatternFunction)
+ 
+-/* Source for ImagePatternTable. Use "make hashtables" to regenerate.
+-   @begin ImagePatternTable 0
++/*
++   @begin CanvasPatternProtoTable 0
+    @end
+ */
+ 
+-ImagePattern::ImagePattern(HTMLElement *i, int repetitionType)
+-    : _rw(0), _rh(0)
+-{
+-    khtml::CachedImage *ci = static_cast<DOM::HTMLImageElementImpl*>(i->impl())->image();
+-    if (ci) {
+-        _pixmap = ci->pixmap();
+-        float w = _pixmap.width();
+-        float h = _pixmap.height();
+-    }
+-}
+-
+-QBrush ImagePattern::createPattern()
+-{
+-    if (_pixmap.isNull())
+-        return QBrush();
+-    return QBrush( _pixmap );
+-}
+-
+-bool ImagePattern::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
++ValueImp *CanvasPatternFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+ {
+-    return getStaticValueSlot<ImagePattern, DOMObject>(exec, &ImagePatternTable, this, propertyName, slot);
++    assert(0);
++    return NULL;
+ }
+ 
+-ValueImp *ImagePattern::getValueProperty(ExecState *, int token) const
+-{
+-    return Undefined();
+-}
+-
+-void ImagePattern::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+-{
+-    lookupPut<ImagePattern,DOMObject>(exec, propertyName, value, attr, &ImagePatternTable, this );
+-}
+-
+-void ImagePattern::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+-{
+-}
++CanvasPattern::CanvasPattern(ExecState* exec, DOM::CanvasPatternImpl* impl) :
++    WrapperBase(CanvasPatternProto::self(exec), impl)
++{}
+ 
+ } // namespace
++
++// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- a/khtml/ecma/kjs_dom.h
++++ b/khtml/ecma/kjs_dom.h
+@@ -64,7 +64,7 @@
+            OnMouseMove, OnMouseOut, OnMouseOver, OnMouseUp, OnMove, OnReset,
+            OnResize, OnSelect, OnSubmit, OnUnload,
+            OffsetLeft, OffsetTop, OffsetWidth, OffsetHeight, OffsetParent,
+-           ClientWidth, ClientHeight, ScrollLeft, ScrollTop,
++           ClientLeft, ClientTop, ClientWidth, ClientHeight, ScrollLeft, ScrollTop,
+ 	   ScrollWidth, ScrollHeight, SourceIndex, TextContent };
+ 
+     //### toNode? virtual
+--- a/khtml/test_regression.h
++++ b/khtml/test_regression.h
+@@ -26,6 +26,7 @@
+ #include <khtml_part.h>
+ #include <kurl.h>
+ #include <QtCore/QObject>
++#include <QtCore/QStack>
+ #include <kjs/ustring.h>
+ #include <kjs/object.h>
+ #include <kjs/interpreter.h>
+@@ -33,6 +34,7 @@
+ 
+ class RegressionTest;
+ class QTimer;
++class QEventLoop;
+ 
+ /**
+  * @internal
+@@ -44,7 +46,10 @@
+     PartMonitor(KHTMLPart *_part);
+     ~PartMonitor();
+     void waitForCompletion();
++    void enterLoop();
++    void exitLoop();
+     static PartMonitor* sm_highestMonitor;
++    QStack<QEventLoop*> m_eventLoopStack;
+     bool m_completed;
+     KHTMLPart *m_part;
+     int m_timer_waits;
+--- /dev/null
++++ b/khtml/khtmladaptorpart.h
+@@ -0,0 +1,47 @@
++/*
++ *  This file is part of the KDE libraries
++ *  Copyright (C) 2007 Harri Porten (porten at kde.org)
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Library General Public
++ *  License as published by the Free Software Foundation; either
++ *  version 2 of the License, or (at your option) any later version.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Library General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Library General Public
++ *  License along with this library; if not, write to the Free Software
++ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
++ */
++
++#ifndef KHTMLADAPTORPART_H
++#define KHTMLADAPTORPART_H
++
++#include <khtml_export.h>
++#include <kparts/part.h>
++#include <kparts/browserextension.h>
++#include <kparts/factory.h>
++
++class KHTMLAdaptorPartFactory : public KParts::Factory {
++    Q_OBJECT
++public:
++    KHTMLAdaptorPartFactory ();
++    virtual KParts::Part *createPartObject(QWidget *wparent,
++                                           QObject *parent,
++                                           const char *className,
++                                           const QStringList &args);
++};
++
++class AdaptorView : public KParts::ReadOnlyPart {
++    Q_OBJECT
++public:
++    AdaptorView(QWidget* wparent, QObject* parent, const QStringList& args);
++
++protected:
++    bool openFile();
++};
++
++#endif
+--- a/khtml/CMakeLists.txt
++++ b/khtml/CMakeLists.txt
+@@ -1,7 +1,6 @@
+ 
+ project(khtml)
+ KDE4_NO_ENABLE_FINAL(khtml)
+-add_definitions(-DQT3_SUPPORT_WARNINGS -DQT3_SUPPORT)
+ 
+ add_subdirectory( tests )
+ 
+@@ -156,17 +155,6 @@
+   ${CMAKE_SOURCE_DIR}/khtml/rendering/render_canvasimage.cpp
+ )
+ 
+-# khtml/java/Makefile.am: kjava
+-
+-set(kjava_STAT_SRCS
+-  ${CMAKE_SOURCE_DIR}/khtml/java/kjavaapplet.cpp
+-  ${CMAKE_SOURCE_DIR}/khtml/java/kjavaappletcontext.cpp
+-  ${CMAKE_SOURCE_DIR}/khtml/java/kjavaappletserver.cpp
+-  ${CMAKE_SOURCE_DIR}/khtml/java/kjavaappletwidget.cpp
+-  ${CMAKE_SOURCE_DIR}/khtml/java/kjavaprocess.cpp
+-  ${CMAKE_SOURCE_DIR}/khtml/java/kjavadownloader.cpp
+-)
+-
+ # khtml/css/Makefile.am: khtmlcss
+ 
+ set(khtmlcss_STAT_SRCS
+@@ -211,6 +199,7 @@
+   ${CMAKE_SOURCE_DIR}/khtml/imload/image.cpp
+   ${CMAKE_SOURCE_DIR}/khtml/imload/imagemanager.cpp
+   ${CMAKE_SOURCE_DIR}/khtml/imload/animtimer.cpp
++  ${CMAKE_SOURCE_DIR}/khtml/imload/canvasimage.cpp  
+ )
+ 
+ # khtml/imload/decoders/Makefile.am: decoders
+@@ -227,7 +216,7 @@
+ 
+ include_directories( ${KDE4_KPARTS_INCLUDES} )
+ include_directories( ${CMAKE_BINARY_DIR}/kio/kssl )
+-include_directories( ${KDE4_KJS_INCLUDES} ${CMAKE_SOURCE_DIR}/kimgio ${CMAKE_SOURCE_DIR}/kio/kssl ${CMAKE_SOURCE_DIR}/kdeprint ${CMAKE_SOURCE_DIR}/interfaces ${CMAKE_SOURCE_DIR}/interfaces/kregexpeditor ${CMAKE_SOURCE_DIR}/kde3support ${CMAKE_SOURCE_DIR}/kde3support/kdeui ${CMAKE_BINARY_DIR}/phonon)
++include_directories( ${KDE4_KJS_INCLUDES} ${CMAKE_SOURCE_DIR}/kimgio ${CMAKE_SOURCE_DIR}/kio/kssl ${CMAKE_SOURCE_DIR}/interfaces ${CMAKE_SOURCE_DIR}/interfaces/kregexpeditor ${CMAKE_BINARY_DIR}/phonon)
+ 
+ include_directories(
+   ${CMAKE_CURRENT_SOURCE_DIR}/misc
+@@ -282,17 +271,27 @@
+    ${khtmldom_STAT_SRCS}
+    ${khtmlimload_STAT_SRCS}
+    ${decoders_STAT_SRCS}
+-   ${kjava_STAT_SRCS}
+    )
+ 
+ 
+ qt4_add_dbus_adaptor(khtml_LIB_SRCS org.kde.KHTMLPart.xml khtml_iface.h KHTMLPartIface)
+ 
++set(kcookiejar_XML ${CMAKE_CURRENT_SOURCE_DIR}/../kioslave/http/kcookiejar/org.kde.KCookieServer.xml)
++set_source_files_properties(${kcookiejar_XML} PROPERTIES INCLUDE "html/kcookiejar_include.h")
++if (cmake_version GREATER 20500)
++   # The following requires CMake CVS.
++   # See: http://www.cmake.org/Bug/view.php?id=1729
++   qt4_add_dbus_interface(khtml_LIB_SRCS ${kcookiejar_XML} kcookiejar_interface)
++else (cmake_version GREATER 20500)
++   # workaround:
++   set(khtml_LIB_SRCS ${khtml_LIB_SRCS} kcookiejar_interface.cpp kcookiejar_interface.h)
++endif (cmake_version GREATER 20500)
++
+ kde4_add_ui_files(khtml_LIB_SRCS kjserrordlgbase.ui htmlpageinfo.ui )
+ 
+ kde4_add_library(khtml SHARED ${khtml_LIB_SRCS})
+ 
+-target_link_libraries(khtml ${KDE4_KPARTS_LIBS} ktexteditor kdeprint kde3support kjs ${KDE4_PHONON_LIBS} ${JPEG_LIBRARIES} ${GIF_LIBRARIES} ${PNG_LIBRARIES} )
++target_link_libraries(khtml ${KDE4_KPARTS_LIBS} ktexteditor kjs ${KDE4_PHONON_LIBS} ${JPEG_LIBRARIES} ${GIF_LIBRARIES} ${PNG_LIBRARIES} )
+ 
+ set_target_properties(khtml PROPERTIES VERSION ${KDE_NON_GENERIC_LIB_VERSION} SOVERSION ${KDE_NON_GENERIC_LIB_SOVERSION} )
+ 
+@@ -358,6 +357,16 @@
+ 
+ install(TARGETS khtmlimagepart  DESTINATION ${PLUGIN_INSTALL_DIR} )
+ 
++########### next target ###############
++
++kde4_add_plugin(khtmladaptorpart khtmladaptorpart.cpp)
++
++target_link_libraries(khtmladaptorpart ${KDE4_KPARTS_LIBS} kjs)
++
++install(TARGETS khtmladaptorpart DESTINATION ${PLUGIN_INSTALL_DIR} )
++
++#######################################
++
+ # msvc linker doesn't like "#define protected public"
+ if(NOT MSVC)
+ 
+@@ -365,7 +374,6 @@
+ 
+     set(testkhtml_SRCS
+         testkhtml.cpp
+-        domtreeview.cpp
+     )
+ 
+ 
+@@ -377,7 +385,6 @@
+ 
+     set(testkhtml_static_SRCS
+         testkhtml.cpp
+-        domtreeview.cpp
+     )
+ 
+ 
+@@ -421,7 +428,8 @@
+ 
+ ########### install files ###############
+ 
+-install( FILES khtml.desktop khtmlimage.desktop  DESTINATION  ${SERVICES_INSTALL_DIR} )
++install( FILES khtml.desktop khtmlimage.desktop
++	 khtmladaptorpart.desktop DESTINATION  ${SERVICES_INSTALL_DIR} )
+ install( FILES khtml.rc khtml_browser.rc  DESTINATION  ${DATA_INSTALL_DIR}/khtml )
+ install( FILES khtml_export.h khtmlview.h khtml_part.h khtml_events.h khtml_settings.h khtmldefaults.h  DESTINATION  ${INCLUDE_INSTALL_DIR} )
+ install( FILES dom/dom_exception.h   dom/html_base.h       dom/html_inline.h    dom/css_rule.h        dom/dom_html.h        dom/html_block.h      dom/html_list.h    dom/css_stylesheet.h  dom/dom_misc.h        dom/html_document.h   dom/html_misc.h    dom/css_value.h       dom/dom_node.h        dom/html_element.h    dom/html_object.h     dom/dom_core.h        dom/dom_string.h      dom/html_form.h       dom/html_table.h   dom/dom_doc.h         dom/dom_text.h        dom/html_head.h    dom/dom_element.h     dom/dom_xml.h         dom/html_image.h   dom/dom2_range.h      dom/dom2_traversal.h  dom/dom2_events.h     dom/dom2_views.h  DESTINATION  ${INCLUDE_INSTALL_DIR}/dom )
+--- a/khtml/rendering/render_applet.h
++++ /dev/null
+@@ -1,59 +0,0 @@
+-/*
+- * This file is part of the HTML widget for KDE.
+- *
+- * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Library General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * This library is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- * Library General Public License for more details.
+- *
+- * You should have received a copy of the GNU Library General Public License
+- * along with this library; see the file COPYING.LIB.  If not, write to
+- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02110-1301, USA.
+- *
+- */
+-#ifndef render_applet_h
+-#define render_applet_h
+-
+-#include "rendering/render_replaced.h"
+-#include "html/html_objectimpl.h"
+-
+-#include <QtGui/QWidget>
+-#include <QtCore/QMap>
+-
+-
+-namespace DOM {
+-    class HTMLElementImpl;
+-}
+-
+-namespace khtml {
+-
+-class RenderApplet : public RenderWidget
+-{
+-public:
+-    RenderApplet(DOM::HTMLElementImpl* node, const QMap<QString, QString> &args);
+-    virtual ~RenderApplet();
+-
+-    virtual const char *renderName() const { return "RenderApplet"; }
+-
+-    virtual void layout();
+-    virtual short intrinsicWidth() const;
+-    virtual int intrinsicHeight() const;
+-    virtual bool isApplet() const { return true; }
+-
+-    DOM::HTMLElementImpl *element() const
+-    { return static_cast<DOM::HTMLElementImpl*>(RenderObject::element()); }
+-
+-private:
+-    void processArguments( const QMap<QString, QString> &args );
+-};
+-
+-}
+-#endif
+--- a/khtml/rendering/render_applet.cpp
++++ /dev/null
+@@ -1,147 +0,0 @@
+-/**
+- * This file is part of the HTML widget for KDE.
+- *
+- * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Library General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * This library is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- * Library General Public License for more details.
+- *
+- * You should have received a copy of the GNU Library General Public License
+- * along with this library; see the file COPYING.LIB.  If not, write to
+- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02110-1301, USA.
+- *
+- */
+-
+-#include "render_applet.h"
+-
+-#include <config.h>
+-#include <klocale.h>
+-
+-#include <kdebug.h>
+-
+-#include "render_canvas.h"
+-#include <xml/dom_docimpl.h>
+-#include <khtmlview.h>
+-#include <khtml_part.h>
+-
+-#include <QtGui/QLabel>
+-
+-#ifndef Q_WS_QWS // We don't have Java in Qt Embedded
+-
+-#include <java/kjavaappletwidget.h>
+-#include <misc/htmltags.h>
+-#include <html/html_objectimpl.h>
+-
+-using namespace khtml;
+-using namespace DOM;
+-
+-RenderApplet::RenderApplet(HTMLElementImpl *applet, const QMap<QString, QString> &args )
+-    : RenderWidget(applet)
+-{
+-    // init RenderObject attributes
+-    setInline(true);
+-
+-    KJavaAppletContext *context = 0;
+-    KHTMLView *_view = applet->getDocument()->view();
+-    if ( _view ) {
+-        KHTMLPart *part = _view->part();
+-        context = part->createJavaContext();
+-    }
+-
+-    if ( context ) {
+-        //kDebug(6100) << "RenderApplet::RenderApplet, setting QWidget";
+-        setQWidget( new KJavaAppletWidget(context, _view->widget()) );
+-        processArguments(args);
+-    }
+-}
+-
+-RenderApplet::~RenderApplet()
+-{
+-}
+-
+-short RenderApplet::intrinsicWidth() const
+-{
+-    int rval = 300;
+-
+-    if( m_widget )
+-        rval = ((KJavaAppletWidget*)(m_widget))->sizeHint().width();
+-
+-    return rval > 10 ? rval : 50;
+-}
+-
+-int RenderApplet::intrinsicHeight() const
+-{
+-    int rval = 150;
+-
+-    if( m_widget )
+-        rval = m_widget->sizeHint().height();
+-
+-    return rval > 10 ? rval : 50;
+-}
+-
+-void RenderApplet::layout()
+-{
+-    //kDebug(6100) << "RenderApplet::layout";
+-
+-    KHTMLAssert( needsLayout() );
+-    KHTMLAssert( minMaxKnown() );
+-
+-    calcWidth();
+-    calcHeight();
+-
+-    KJavaAppletWidget *tmp = static_cast<KJavaAppletWidget*>(m_widget);
+-    if ( tmp ) {
+-        NodeImpl *child = element()->firstChild();
+-
+-        while(child) {
+-
+-            if(child->id() == ID_PARAM) {
+-                HTMLParamElementImpl *p = static_cast<HTMLParamElementImpl *>(child);
+-                if(tmp->applet())
+-                    tmp->applet()->setParameter( p->name(), p->value());
+-            }
+-            child = child->nextSibling();
+-        }
+-        //kDebug(6100) << "setting applet widget to size: " << m_width << ", " << m_height;
+-        m_widget->resize(m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
+-                         m_height-borderTop()-borderBottom()-paddingTop()-paddingBottom());
+-        tmp->showApplet();
+-    }
+-
+-    setNeedsLayout(false);
+-}
+-
+-void RenderApplet::processArguments(const QMap<QString, QString> &args)
+-{
+-    KJavaAppletWidget *w = static_cast<KJavaAppletWidget*>(m_widget);
+-    KJavaApplet* applet = w ? w->applet() : 0;
+-
+-    if ( applet ) {
+-        applet->setBaseURL( args[QLatin1String("baseURL") ] );
+-        applet->setAppletClass( args[QLatin1String("code") ] );
+-
+-	QString str = args[QLatin1String("codeBase") ];
+-        if( !str.isEmpty() )
+-            applet->setCodeBase( str );
+-
+-	str = args[QLatin1String("name") ];
+-        if( !str.isNull() )
+-            applet->setAppletName( str );
+-        else
+-            applet->setAppletName( args[QLatin1String("code") ] );
+-
+-	str = args[QLatin1String("archive") ];
+-        if( !str.isEmpty() )
+-            applet->setArchives( args[QLatin1String("archive") ] );
+-    }
+-}
+-
+-#endif
+--- a/khtml/rendering/render_flow.cpp
++++ b/khtml/rendering/render_flow.cpp
+@@ -479,7 +479,7 @@
+ int
+ RenderFlow::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
+ {
+-    int bottom = RenderBox::lowestPosition(includeOverflowInterior, includeSelf);
++    int bottom = includeSelf && m_width > 0 ? m_height : 0;;
+     if (!includeOverflowInterior && hasOverflowClip())
+         return bottom;
+ 
+@@ -504,7 +504,7 @@
+ 
+ int RenderFlow::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
+ {
+-    int right = RenderBox::rightmostPosition(includeOverflowInterior, includeSelf);
++    int right = includeSelf && m_height > 0 ? m_width : 0;
+     if (!includeOverflowInterior && hasOverflowClip())
+         return right;
+ 
+@@ -529,7 +529,7 @@
+ 
+ int RenderFlow::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
+ {
+-    int left = RenderBox::leftmostPosition(includeOverflowInterior, includeSelf);
++    int left = includeSelf && m_height > 0 ? 0 : m_width;
+     if (!includeOverflowInterior && hasOverflowClip())
+         return left;
+ 
+--- a/khtml/rendering/render_form.h
++++ b/khtml/rendering/render_form.h
+@@ -43,7 +43,6 @@
+ #include <kcombobox.h>
+ #include "dom/dom_misc.h"
+ 
+-class K3Spell;
+ class KFindDialog;
+ class KReplaceDialog;
+ class KFind;
+@@ -283,10 +282,9 @@
+ private Q_SLOTS:
+     void clearHistoryActivated();
+     void slotCheckSpelling();
+-    void slotSpellCheckReady( K3Spell *s );
+     void slotSpellCheckDone( const QString &s );
+-    void spellCheckerMisspelling( const QString &text, const QStringList &, unsigned int pos);
+-    void spellCheckerCorrected( const QString &, const QString &, unsigned int );
++    void spellCheckerMisspelling( const QString &text, int pos);
++    void spellCheckerCorrected( const QString &, int, const QString &);
+     void spellCheckerFinished();
+ 
+ private:
+@@ -295,7 +293,6 @@
+     };
+     DOM::HTMLInputElementImpl* m_input;
+     KHTMLView* m_view;
+-    K3Spell *m_spell;
+     KAction *m_spellAction;
+ };
+ 
+@@ -402,6 +399,12 @@
+ { 
+ public:
+     ListBoxWidget(QWidget* p): KListWidget(p) { m_kwp->setIsRedirected(true); }
++protected:
++    void scrollContentsBy(int, int)
++    {
++        viewport()->update();
++    }
++        
+ };
+ 
+ class RenderSelect : public RenderFormElement
+--- a/khtml/rendering/render_object.h
++++ b/khtml/rendering/render_object.h
+@@ -165,10 +165,9 @@
+         return isRoot()/* ### */ || isPositioned() || isRelPositioned() || hasOverflowClip() || style()->opacity() < 1.0f;
+     }
+ 
+-    // ### rename to overflowClipRect and clipRect
+-    virtual QRect getOverflowClipRect(int /*tx*/, int /*ty*/)
++    virtual QRect overflowClipRect(int /*tx*/, int /*ty*/)
+ 	{ return QRect(0,0,0,0); }
+-    virtual QRect getClipRect(int /*tx*/, int /*ty*/) { return QRect(0,0,0,0); }
++    virtual QRect clipRect(int /*tx*/, int /*ty*/) { return QRect(0,0,0,0); }
+     bool hasClip() const { return isPositioned() &&  style()->hasClip(); }
+     bool hasOverflowClip() const { return m_hasOverflowClip; }
+ 
+@@ -361,7 +360,7 @@
+     void updateBackgroundImages(RenderStyle* oldStyle);
+ 
+     virtual InlineBox* createInlineBox(bool makePlaceHolderBox, bool isRootLineBox);
+-    virtual void removeInlineBox(InlineBox* box) {}
++    virtual void removeInlineBox(InlineBox* /*box*/) {}
+ 
+     virtual short lineHeight( bool firstLine ) const;
+     virtual short verticalPositionHint( bool firstLine ) const;
+@@ -623,6 +622,8 @@
+     virtual int offsetLeft() const;
+     virtual int offsetTop() const;
+     virtual RenderObject* offsetParent() const;
++    int clientLeft() const;
++    int clientTop() const;
+     short clientWidth() const;
+     int clientHeight() const;
+     short scrollWidth() const;
+@@ -756,7 +757,7 @@
+     bool inPosObjectList() const { return m_inPosObjectList; }
+ 
+     virtual void deleteInlineBoxes(RenderArena* arena=0) {(void)arena;}
+-    virtual void dirtyInlineBoxes(bool fullLayout, bool isRootLineBox = false) {}
++    virtual void dirtyInlineBoxes(bool /*fullLayout*/, bool /*isRootLineBox*/ = false) {}
+     virtual void dirtyLinesFromChangedChild(RenderObject*) {}
+     virtual void detach( );
+ 
+--- a/khtml/rendering/font.h
++++ b/khtml/rendering/font.h
+@@ -31,9 +31,6 @@
+ #include <QtGui/QFontMetrics>
+ #include <QtGui/QPainter>
+ 
+-class Q3PaintDeviceMetrics;
+-
+-
+ namespace khtml
+ {
+ class RenderStyle;
+--- a/khtml/rendering/render_canvasimage.cpp
++++ b/khtml/rendering/render_canvasimage.cpp
+@@ -1,6 +1,7 @@
+ /*
+  * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+  * Copyright (C) 2005 Zack Rusin <zack at kde.org>
++ * Copyright (C) 2007 Maksim Orlovich <maksim at kde.org>
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+@@ -41,6 +42,7 @@
+ #include <html/html_canvasimpl.h>
+ #include <xml/dom2_eventsimpl.h>
+ #include <html/html_documentimpl.h>
++#include <imload/canvasimage.h>
+ 
+ #include <math.h>
+ 
+@@ -49,65 +51,11 @@
+ 
+ // -------------------------------------------------------------------------
+ 
+-RenderCanvasImage::RenderCanvasImage(NodeImpl *_node)
+-    : RenderImage(_node), m_drawingContext(0),
+-      m_drawnImage(0), m_needsImageUpdate(0)
++RenderCanvasImage::RenderCanvasImage(DOM::HTMLCanvasElementImpl* canvasEl)
++    : RenderReplaced(canvasEl), imagePainter(canvasEl->getCanvasImage())
+ {
+-}
+-
+-RenderCanvasImage::~RenderCanvasImage()
+-{
+-    delete m_drawingContext; m_drawingContext = 0;
+-    delete m_drawnImage; m_drawnImage = 0;
+-}
+-
+-void RenderCanvasImage::createDrawingContext()
+-{
+-    delete m_drawingContext;
+-    delete m_drawnImage;
+-
+-    int cWidth = contentWidth();
+-    int cHeight = contentHeight();
+-    if ( !cWidth ) {
+-        cWidth = 300;
+-        setWidth( cWidth );
+-    }
+-    if ( !cHeight ) {
+-        cHeight = 200;
+-        setHeight( cHeight );
+-    }
+-    m_drawnImage = new QImage( cWidth, cHeight, QImage::Format_ARGB32_Premultiplied );
+-    //### clear color is bogus
+-    //m_drawnImage->fill( 0xffffffff );
+-    m_drawingContext = new QPainter( m_drawnImage );
+-    m_drawingContext->setRenderHint( QPainter::Antialiasing );
+-}
+-
+-QPainter *RenderCanvasImage::drawingContext()
+-{
+-    if (!m_drawingContext) {
+-        document()->updateLayout();
+-        createDrawingContext();
+-    }
+-    if ( !m_drawingContext->isActive() ) {
+-        //### clear color is bogus
+-        //m_drawnImage->fill( 0xffffffff );
+-        m_drawingContext->begin( m_drawnImage );
+-    }
+-
+-    return m_drawingContext;
+-}
+-
+-void RenderCanvasImage::setNeedsImageUpdate()
+-{
+-    m_needsImageUpdate = true;
+-    repaint();
+-}
+-
+-
+-void RenderCanvasImage::updateDrawnImage()
+-{
+-    m_drawingContext->end();
++    setIntrinsicWidth (element()->width());
++    setIntrinsicHeight(element()->height());
+ }
+ 
+ void RenderCanvasImage::paint(PaintInfo& i, int _tx, int _ty)
+@@ -126,9 +74,6 @@
+     if (i.phase != PaintActionForeground && i.phase != PaintActionSelection)
+         return;
+ 
+-    //if (!shouldPaintWithinRoot(i))
+-    //return;
+-
+     bool isPrinting = (i.p->device()->devType() == QInternal::Printer);
+     bool drawSelectionTint = (selectionState() != SelectionNone) && !isPrinting;
+     if (i.phase == PaintActionSelection) {
+@@ -141,7 +86,7 @@
+     int cWidth = contentWidth();
+     int cHeight = contentHeight();
+     if ( !cWidth )  cWidth = 300;
+-    if ( !cHeight ) cHeight = 200;
++    if ( !cHeight ) cHeight = 150;
+     int leftBorder = borderLeft();
+     int topBorder = borderTop();
+     int leftPad = paddingLeft();
+@@ -150,16 +95,9 @@
+     x += leftBorder + leftPad;
+     y += topBorder + topPad;
+ 
+-    if (m_needsImageUpdate) {
+-        updateDrawnImage();
+-        m_needsImageUpdate = false;
+-    }
+-    //qDebug()<<"drawing image "<<m_drawnImage;
+-    if (m_drawnImage) {
+-        HTMLCanvasElementImpl* i = (element() && element()->id() == ID_CANVAS ) ? static_cast<HTMLCanvasElementImpl*>(element()) : 0;
+-        p->drawImage( QRectF( x, y, cWidth, cHeight ), *m_drawnImage,
+-                      QRectF( 0, 0, m_drawnImage->width(), m_drawnImage->height() ) );
+-    }
++    element()->getContext2D()->commit(); // Make sure everything is up-to-date
++    imagePainter.setSize(QSize(cWidth, cHeight));
++    imagePainter.paint(x, y, p, 0, 0);
+ 
+     // if (drawSelectionTint) {
+ //         QBrush brush(selectionColor(p));
+@@ -173,30 +111,24 @@
+     KHTMLAssert( needsLayout());
+     KHTMLAssert( minMaxKnown() );
+ 
+-    short oldwidth = m_width;
+-    int oldheight = m_height;
+-
+     calcWidth();
+     calcHeight();
+ 
+-    if ( m_width != oldwidth || m_height != oldheight ) {
+-        createDrawingContext();
+-    }
++    setNeedsLayout(false);
++}
+ 
+-    // if they are variable width and we calculate a huge height or width, we assume they
+-    // actually wanted the intrinsic width.
+-    if ( m_width > 4096 && !style()->width().isFixed() )
+-	m_width = intrinsicWidth() + paddingLeft() + paddingRight() + borderLeft() + borderRight();
+-    if ( m_height > 2048 && !style()->height().isFixed() )
+-	m_height = intrinsicHeight() + paddingTop() + paddingBottom() + borderTop() + borderBottom();
+-
+-    // limit total size to not run out of memory when doing the xform call.
+-    if ( ( m_width * m_height > 4096*2048 ) &&
+-         ( contentWidth() > intrinsicWidth() || contentHeight() > intrinsicHeight() ) ) {
+-	float scale = ::sqrt( m_width*m_height / ( 4096.*2048. ) );
+-	m_width = (int) (m_width/scale);
+-	m_height = (int) (m_height/scale);
++void RenderCanvasImage::updateFromElement()
++{
++    int newWidth  = element()->width();
++    int newHeight = element()->height();
++    if (intrinsicHeight() != newHeight || intrinsicWidth()  != newWidth) {
++        setIntrinsicWidth (newWidth);
++        setIntrinsicHeight(newHeight);
++        setNeedsLayoutAndMinMaxRecalc();
+     }
+-
+-    setNeedsLayout(false);
++    
++    if (!needsLayout())
++        repaint();
+ }
++
++// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- a/khtml/rendering/render_layer.h
++++ b/khtml/rendering/render_layer.h
+@@ -51,7 +51,6 @@
+ #include "render_object.h"
+ 
+ //template <class T*> class QVector;
+-template <class T> class QStack;
+ 
+ namespace khtml {
+     class RenderObject;
+@@ -123,7 +122,6 @@
+ {
+ public:
+     static ScrollBarWidget* gScrollBar;
+-    static QStack<QRegion>* s_clipHolder;
+ 
+     RenderLayer(RenderObject* object);
+     ~RenderLayer();
+@@ -214,6 +212,11 @@
+     void updateOverflowList();
+     QVector<RenderLayer*>* overflowList() const { return m_overflowList; }
+ 
++    bool hasVisibleContent() const { return m_hasVisibleContent; }
++    void setHasVisibleContent(bool b);
++    void dirtyVisibleContentStatus();
++    
++
+     void setHasOverlaidWidgets(bool b=true) { m_hasOverlaidWidgets = b; }
+     bool hasOverlaidWidgets() const { return m_hasOverlaidWidgets; }
+     QRegion getMask() const { return m_region; }
+@@ -280,7 +283,14 @@
+                                      int x, int y, const QRect& hitTestRect);
+     bool shouldBeOverflowOnly() const;
+ 
++    void childVisibilityChanged(bool newVisibility);
++    void dirtyVisibleDescendantStatus();
++    void updateVisibilityStatus();
++
+ protected:
++    void setClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect, bool setup = false);
++    void restoreClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect, bool cleanup = false);
++
+     RenderObject* m_object;
+ 
+     RenderLayer* m_parent;
+@@ -321,7 +331,11 @@
+     bool m_overflowListDirty: 1;
+     bool m_isOverflowOnly: 1;
+     bool m_markedForRepaint: 1;
+-    bool m_hasOverlaidWidgets: 1; 
++    bool m_hasOverlaidWidgets: 1;
++    bool m_visibleContentStatusDirty : 1;
++    bool m_hasVisibleContent : 1;
++    bool m_visibleDescendantStatusDirty : 1;
++    bool m_hasVisibleDescendant : 1;
+ 
+     QRect m_visibleRect;
+ 
+--- a/khtml/rendering/enumerate.cpp
++++ b/khtml/rendering/enumerate.cpp
+@@ -280,7 +280,7 @@
+ 
+ static inline QString toNumeric( int number, int base ) {
+     QString letter = QString::number(number);
+-    for(unsigned int i = 0; i < letter.length(); i++) {
++    for(int i = 0; i < letter.length(); i++) {
+         if (letter[i].isDigit())
+         letter[i] = QChar(letter[i].digitValue()+base);
+     }
+--- a/khtml/rendering/render_line.cpp
++++ b/khtml/rendering/render_line.cpp
+@@ -403,7 +403,7 @@
+                     includeRightEdge = true;
+             }
+             else {
+-                if ((!prevLineBox() || !prevLineBox()->isConstructed()) &&
++                if ((!prevLineBox() || prevLineBox()->isConstructed()) &&
+                     ((lastLine && !object()->continuation()) ||
+                      prevOnLineExists() || onEndChain(endObject)))
+                     includeLeftEdge = true;
+--- a/khtml/rendering/render_box.h
++++ b/khtml/rendering/render_box.h
+@@ -174,8 +174,8 @@
+     void calcAbsoluteVerticalReplaced();
+     void calcAbsoluteHorizontalReplaced();
+ 
+-    QRect getOverflowClipRect(int tx, int ty);
+-    QRect getClipRect(int tx, int ty);
++    QRect overflowClipRect(int tx, int ty);
++    QRect clipRect(int tx, int ty);
+ 
+     void restructureParentFlow();
+     void detachRemainingChildren();
+--- a/khtml/rendering/render_form.cpp
++++ b/khtml/rendering/render_form.cpp
+@@ -37,7 +37,8 @@
+ #include <kmessagebox.h>
+ #include <kreplace.h>
+ #include <kreplacedialog.h>
+-#include <k3spell.h>
++#include <dialog.h>
++#include <backgroundchecker.h>
+ #include <kurlcompletion.h>
+ #include <kwindowsystem.h>
+ #include <kstandardaction.h>
+@@ -377,7 +378,7 @@
+ };
+ 
+ LineEditWidget::LineEditWidget(DOM::HTMLInputElementImpl* input, KHTMLView* view, QWidget* parent)
+-    : KLineEdit(parent), m_input(input), m_view(view), m_spell(0)
++    : KLineEdit(parent), m_input(input), m_view(view)
+ {
+     m_kwp->setIsRedirected( true );
+     setMouseTracking(true);
+@@ -391,8 +392,6 @@
+ 
+ LineEditWidget::~LineEditWidget()
+ {
+-    delete m_spell;
+-    m_spell = 0L;
+ }
+ 
+ void LineEditWidget::slotCheckSpelling()
+@@ -400,16 +399,17 @@
+     if ( text().isEmpty() ) {
+         return;
+     }
+-
+-    delete m_spell;
+-    m_spell = new K3Spell( this, i18n( "Spell Checking" ), this, SLOT( slotSpellCheckReady( K3Spell *) ), 0, true, true);
+-
+-    connect( m_spell, SIGNAL( death() ),this, SLOT( spellCheckerFinished() ) );
+-    connect( m_spell, SIGNAL( misspelling( const QString &, const QStringList &, unsigned int ) ),this, SLOT( spellCheckerMisspelling( const QString &, const QStringList &, unsigned int ) ) );
+-    connect( m_spell, SIGNAL( corrected( const QString &, const QString &, unsigned int ) ),this, SLOT( spellCheckerCorrected( const QString &, const QString &, unsigned int ) ) );
++    Sonnet::Dialog *spellDialog = new Sonnet::Dialog(new Sonnet::BackgroundChecker(this), 0);
++    connect(spellDialog, SIGNAL(replace( const QString&, int,const QString&)), this, SLOT(spellCheckerCorrected( const QString&, int,const QString&)));
++    connect(spellDialog, SIGNAL(misspelling( const QString&, int)), this, SLOT(spellCheckerMisspelling(const QString &,int)));
++    connect(spellDialog, SIGNAL(done(const QString&)), this, SLOT(spellCheckerDone(const QString&)));
++    connect(spellDialog, SIGNAL(cancel()), this, SLOT(spellCheckerFinished()));
++    connect(spellDialog, SIGNAL(stop()), this, SLOT(spellCheckerFinished()));
++    spellDialog->setBuffer(text());
++    spellDialog->show();
+ }
+ 
+-void LineEditWidget::spellCheckerMisspelling( const QString &_text, const QStringList &, unsigned int pos)
++void LineEditWidget::spellCheckerMisspelling( const QString &_text, int pos)
+ {
+     highLightWord( _text.length(),pos );
+ }
+@@ -425,7 +425,7 @@
+     setSelection ( pos, length );
+ }
+ 
+-void LineEditWidget::spellCheckerCorrected( const QString &old, const QString &corr, unsigned int pos )
++void LineEditWidget::spellCheckerCorrected( const QString &old, int pos, const QString &corr )
+ {
+     if( old!= corr )
+     {
+@@ -439,12 +439,6 @@
+ {
+ }
+ 
+-void LineEditWidget::slotSpellCheckReady( K3Spell *s )
+-{
+-    s->check( text() );
+-    connect( s, SIGNAL( done( const QString & ) ), this, SLOT( slotSpellCheckDone( const QString & ) ) );
+-}
+-
+ void LineEditWidget::slotSpellCheckDone( const QString &s )
+ {
+     if( s != text() )
+@@ -505,7 +499,7 @@
+ {
+     if (KLineEdit::event(e))
+ 	return true;
+-
++#if 0
+     if ( e->type() == QEvent::AccelAvailable && isReadOnly() ) {
+         QKeyEvent* ke = (QKeyEvent*) e;
+         if ( ke->modifiers() & Qt::ControlModifier ) {
+@@ -522,6 +516,7 @@
+             }
+         }
+     }
++#endif
+     return false;
+ }
+ 
+@@ -1195,11 +1190,18 @@
+         int width = 0;
+         int height = 0;
+ 
++        QAbstractItemModel *m = w->model();
++        QAbstractItemDelegate *d = w->itemDelegate();
++        QStyleOptionViewItem so;
++        so.font = w->font();
++
+         for ( int rowIndex = 0 ; rowIndex < w->count() ; rowIndex++ ) {
+-            QListWidgetItem* p = w->item(0);
+-            width = qMax(width, p->listWidget()->visualItemRect(p).width());
+-            height = qMax(height, p->listWidget()->visualItemRect(p).height());
++            QModelIndex mi = m->index(rowIndex, 0);
++            QSize s = d->sizeHint( so, mi);
++            width = qMax(width, s.width());
++            height = qMax(height, s.height());
+         }
++
+         if ( !height )
+             height = w->fontMetrics().height();
+         if ( !width )
+@@ -1619,6 +1621,7 @@
+ 
+ bool TextAreaWidget::event( QEvent *e )
+ {
++#if 0
+     if ( e->type() == QEvent::AccelAvailable && isReadOnly() ) {
+         QKeyEvent* ke = (QKeyEvent*) e;
+         if ( ke->modifiers() & Qt::ControlModifier ) {
+@@ -1635,6 +1638,7 @@
+             }
+         }
+     }
++#endif
+     return KTextEdit::event( e );
+ }
+ 
+--- a/khtml/rendering/render_object.cpp
++++ b/khtml/rendering/render_object.cpp
+@@ -50,6 +50,7 @@
+ #include "khtmlview.h"
+ #include <khtml_part.h>
+ #include <QBitmap>
++#include <QPaintEngine>
+ 
+ #include <assert.h>
+ using namespace DOM;
+@@ -252,13 +253,13 @@
+     KHTMLAssert(0);
+ }
+ 
+-RenderObject* RenderObject::removeChildNode(RenderObject* )
++RenderObject* RenderObject::removeChildNode(RenderObject*)
+ {
+     KHTMLAssert(0);
+     return 0;
+ }
+ 
+-void RenderObject::removeChild(RenderObject *o )
++void RenderObject::removeChild(RenderObject*)
+ {
+     KHTMLAssert(0);
+ }
+@@ -503,6 +504,16 @@
+         (layer() ? layer()->verticalScrollbarWidth() : 0);
+ }
+ 
++int RenderObject::clientLeft() const
++{
++    return borderLeft();
++}
++
++int RenderObject::clientTop() const
++{
++    return borderTop();
++}
++
+ int RenderObject::clientHeight() const
+ {
+     return height() - borderTop() - borderBottom() -
+@@ -740,8 +751,16 @@
+     if(!c.isValid()) {
+         if(invalidisInvert)
+         {
+-            p->setCompositionMode(QPainter::CompositionMode_Difference);
+-            c = Qt::white;
++            // handle 'outline-color: invert'
++            if (p->paintEngine()->hasFeature(QPaintEngine::BlendModes)) {
++                p->setCompositionMode(QPainter::CompositionMode_Difference);
++                c = Qt::white;
++            } else {
++                // 'invert' is not supported on this platform (for instance XRender)
++                // CSS3 UI 8.4: If the UA does not support the 'invert' value then the initial value of
++                // the 'outline-color' property is the 'currentColor' [CSS3COLOR] keyword.
++                c = m_style->color();
++            }
+         }
+         else {
+             if(style == INSET || style == OUTSET || style == RIDGE || style ==
+@@ -758,7 +777,7 @@
+     case BNONE:
+     case BHIDDEN:
+         // should not happen
+-        if(invalidisInvert && p->compositionMode() == QPainter::CompositionMode_Xor)
++        if(invalidisInvert && p->compositionMode() == QPainter::CompositionMode_Difference)
+             p->setCompositionMode(QPainter::CompositionMode_SourceOver);
+ 
+         return;
+@@ -968,7 +987,7 @@
+         break;
+     }
+ 
+-    if(invalidisInvert && p->compositionMode() == QPainter::CompositionMode_Xor)
++    if(invalidisInvert && p->compositionMode() == QPainter::CompositionMode_Difference)
+         p->setCompositionMode(QPainter::CompositionMode_SourceOver);
+ }
+ 
+@@ -1306,6 +1325,15 @@
+                 layer()->stackingContext()->dirtyZOrderLists();
+                 layer()->dirtyZOrderLists();
+             }
++            // keep layer hierarchy visibility bits up to date if visibility changes
++            if (m_style->visibility() != style->visibility()) {
++                RenderLayer* l = enclosingLayer(); 
++                if (style->visibility() == VISIBLE && l)
++                    l->setHasVisibleContent(true);
++                else if (l && l->hasVisibleContent() && 
++                    (this == l->renderer() || l->renderer()->style()->visibility() != VISIBLE))
++                    l->dirtyVisibleContentStatus();
++            }            
+         }
+ 
+         // reset style flags
+@@ -2212,34 +2240,31 @@
+ 
+ CounterNode* RenderObject::lookupCounter(const QString& counter) const
+ {
+-    Q3Dict<khtml::CounterNode>* counters = document()->counters(this);
+-    if (counters)
+-        return counters->find(counter);
+-    else
+-        return 0;
++    QHash<QString,khtml::CounterNode*>* counters = document()->counters(this);
++    return counters ? counters->value(counter) : 0;
+ }
+ 
+ void RenderObject::detachCounters()
+ {
+-    Q3Dict<khtml::CounterNode>* counters = document()->counters(this);
++    QHash<QString,khtml::CounterNode*>* counters = document()->counters(this);
+     if (!counters) return;
+ 
+-    Q3DictIterator<khtml::CounterNode> i(*counters);
++    QHashIterator<QString,khtml::CounterNode*> i(*counters);
+ 
+-    while (i.current()) {
+-        (*i)->remove();
+-        delete (*i);
+-        ++i;
++    while (i.hasNext()) {
++        i.next();
++        i.value()->remove();
++        delete i.value();
+     }
+     document()->removeCounters(this);
+ }
+ 
+ void RenderObject::insertCounter(const QString& counter, CounterNode* val)
+ {
+-    Q3Dict<khtml::CounterNode>* counters = document()->counters(this);
++    QHash<QString,khtml::CounterNode*>* counters = document()->counters(this);
+ 
+     if (!counters) {
+-        counters = new Q3Dict<khtml::CounterNode>(11);
++        counters = new QHash<QString,khtml::CounterNode*>();
+         document()->setCounters(this, counters);
+     }
+ 
+--- a/khtml/rendering/font.cpp
++++ b/khtml/rendering/font.cpp
+@@ -44,7 +44,6 @@
+ 
+ #include <QtGui/QPainter>
+ #include <QtGui/QFontDatabase>
+-#include <Qt3Support/Q3PaintDeviceMetrics>
+ 
+ using namespace khtml;
+ 
+--- a/khtml/rendering/render_layer.cpp
++++ b/khtml/rendering/render_layer.cpp
+@@ -66,7 +66,6 @@
+ using namespace khtml;
+ 
+ ScrollBarWidget* RenderLayer::gScrollBar = 0;
+-QStack<QRegion>* RenderLayer::s_clipHolder = 0;
+ 
+ #ifndef NDEBUG
+ static bool inRenderLayerDetach;
+@@ -102,8 +101,16 @@
+ m_isOverflowOnly( shouldBeOverflowOnly() ),
+ m_markedForRepaint( false ),
+ m_hasOverlaidWidgets( false ),
++m_visibleContentStatusDirty( true ),
++m_hasVisibleContent( false ),
++m_visibleDescendantStatusDirty( false ),
++m_hasVisibleDescendant( false ),
+ m_marquee( 0 )
+ {
++    if (!object->firstChild() && object->style()) {
++        m_visibleContentStatusDirty = false;
++        m_hasVisibleContent = object->style()->visibility() == VISIBLE;
++    }
+ }
+ 
+ RenderLayer::~RenderLayer()
+@@ -164,7 +171,7 @@
+ {
+     updateZOrderLists();
+     QRegion r;
+-    if (m_negZOrderList) {
++    if (m_negZOrderList && m_hasVisibleDescendant) {
+         uint count = m_negZOrderList->count();
+         for (uint i = 0; i < count; i++) {
+             RenderLayer* child = m_negZOrderList->at(i);
+@@ -172,19 +179,19 @@
+         }
+     }
+     const RenderStyle *s= renderer()->style();
+-    if (s->visibility() == VISIBLE) {
++    if (m_hasVisibleContent) {
+         int x = 0; int y = 0;
+         convertToLayerCoords(rootLayer,x,y);
+         QRect cr(x,y,width(),height());
+-        if ( s->backgroundImage() || s->backgroundColor().isValid() || s->hasBorder() || 
+-             renderer()->scrollsOverflow() || renderer()->isReplaced() ) {
++        if (s->visibility() == VISIBLE && (s->backgroundImage() || s->backgroundColor().isValid() || s->hasBorder() || 
++             renderer()->scrollsOverflow() || renderer()->isReplaced()) ) {
+             r += cr;
+         } else {
+             r += renderer()->visibleFlowRegion(x, y);
+         }
+     }
+     
+-    if (m_posZOrderList) {
++    if (m_posZOrderList && m_hasVisibleDescendant) {
+         uint count = m_posZOrderList->count();
+         for (uint i = 0; i < count; i++) {
+             RenderLayer* child = m_posZOrderList->at(i);
+@@ -229,12 +236,9 @@
+         positionScrollbars(layerBounds);
+     }
+ 
+-#ifdef APPLE_CHANGES
+-    // FIXME: Child object could override visibility.
+-    if (checkForRepaint && (m_object->style()->visibility() == VISIBLE))
+-        m_object->repaintAfterLayoutIfNeeded(m_repaintRect, m_fullRepaintRect);
+-#else    
+-    if (checkForRepaint && m_markedForRepaint) {
++    updateVisibilityStatus();
++
++    if (m_hasVisibleContent && checkForRepaint && m_markedForRepaint) {
+         QRect layerBounds, damageRect, fgrect;
+         calculateRects(rootLayer, renderer()->viewRect(), layerBounds, damageRect, fgrect);
+         QRect vr = damageRect.intersect( layerBounds );
+@@ -244,7 +248,6 @@
+         }
+     }
+     m_markedForRepaint = false;   
+-#endif
+     
+     for	(RenderLayer* child = firstChild(); child; child = child->nextSibling())
+         child->updateLayerPositions(rootLayer, doFullRepaint, checkForRepaint);
+@@ -254,6 +257,92 @@
+         m_marquee->updateMarqueePosition();
+ }
+ 
++ 
++void RenderLayer::setHasVisibleContent(bool b) 
++{ 
++    if (m_hasVisibleContent == b && !m_visibleContentStatusDirty)
++        return;
++    m_visibleContentStatusDirty = false; 
++    m_hasVisibleContent = b;
++    if (parent())
++        parent()->childVisibilityChanged(m_hasVisibleContent);
++}
++
++void RenderLayer::dirtyVisibleContentStatus() 
++{ 
++    m_visibleContentStatusDirty = true; 
++    if (parent())
++        parent()->dirtyVisibleDescendantStatus();
++}
++
++void RenderLayer::childVisibilityChanged(bool newVisibility) 
++{ 
++    if (m_hasVisibleDescendant == newVisibility || m_visibleDescendantStatusDirty)
++        return;
++    if (newVisibility) {
++        RenderLayer* l = this;
++        while (l && !l->m_visibleDescendantStatusDirty && !l->m_hasVisibleDescendant) {
++            l->m_hasVisibleDescendant = true;
++            l = l->parent();
++        }
++    } else 
++        dirtyVisibleDescendantStatus();
++}
++
++void RenderLayer::dirtyVisibleDescendantStatus()
++{
++    RenderLayer* l = this;
++    while (l && !l->m_visibleDescendantStatusDirty) {
++        l->m_visibleDescendantStatusDirty = true;
++        l = l->parent();
++    }
++}
++
++void RenderLayer::updateVisibilityStatus()
++{
++    if (m_visibleDescendantStatusDirty) {
++        m_hasVisibleDescendant = false;
++        for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
++            child->updateVisibilityStatus();        
++            if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) {
++                m_hasVisibleDescendant = true;
++                break;
++            }
++        }
++        m_visibleDescendantStatusDirty = false;
++    }
++
++    if (m_visibleContentStatusDirty) {
++        if (m_object->style()->visibility() == VISIBLE)
++            m_hasVisibleContent = true;
++        else {
++            // layer may be hidden but still have some visible content, check for this
++            m_hasVisibleContent = false;
++            RenderObject* r = m_object->firstChild();
++            while (r) {
++                if (r->style()->visibility() == VISIBLE && !r->layer()) {
++                    m_hasVisibleContent = true;
++                    break;
++                }
++                if (r->firstChild() && !r->layer())
++                    r = r->firstChild();
++                else if (r->nextSibling())
++                    r = r->nextSibling();
++                else {
++                    do {
++                        r = r->parent();
++                        if (r==m_object)
++                            r = 0;
++                    } while (r && !r->nextSibling());
++                    if (r)
++                        r = r->nextSibling();
++                }
++            }
++        }    
++        m_visibleContentStatusDirty = false; 
++    }
++}
++
+ void RenderLayer::updateWidgetMasks(RenderLayer* rootLayer) 
+ {
+     if (hasOverlaidWidgets() && !renderer()->canvas()->pagedMode()) {
+@@ -384,6 +473,9 @@
+         if (stackingContext)
+             stackingContext->dirtyZOrderLists();
+     }
++    child->updateVisibilityStatus();
++    if (child->m_hasVisibleContent || child->m_hasVisibleDescendant)
++        childVisibilityChanged(true);
+ }
+ 
+ RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild)
+@@ -414,6 +506,10 @@
+     oldChild->setNextSibling(0);
+     oldChild->setParent(0);
+ 
++    oldChild->updateVisibilityStatus();
++    if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
++        childVisibilityChanged(false);
++
+     return oldChild;
+ }
+ 
+@@ -817,28 +913,30 @@
+     paintLayer(this, p, damageRect, selectionOnly);
+ }
+ 
+-static void setClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect, bool setup = false)
++void RenderLayer::setClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect, bool setup)
+ {
+     if (paintDirtyRect == clipRect)
+         return;
+-    if (!RenderLayer::s_clipHolder)
+-        RenderLayer::s_clipHolder = new QStack<QRegion>;
++    KHTMLView* v = m_object->canvas()->view();
++    if (!v->clipHolder())
++        v->setClipHolder(new QStack<QRegion>);
+ 
+     QRegion r = clipRect;
+-    if (!RenderLayer::s_clipHolder->isEmpty())
+-        r &= RenderLayer::s_clipHolder->top();
++    if (!v->clipHolder()->isEmpty())
++        r &= v->clipHolder()->top();
+     
+     p->setClipRegion( r );
+-    RenderLayer::s_clipHolder->push( r );
++    v->clipHolder()->push( r );
+ }
+ 
+-static void restoreClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect, bool cleanup = false)
++void RenderLayer::restoreClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect, bool cleanup)
+ {
+     if (paintDirtyRect == clipRect)
+         return;
+-    RenderLayer::s_clipHolder->pop();
+-    if (!RenderLayer::s_clipHolder->isEmpty())
+-        p->setClipRegion( RenderLayer::s_clipHolder->top() );
++    KHTMLView* v = m_object->element()->getDocument()->view();
++    v->clipHolder()->pop();
++    if (!v->clipHolder()->isEmpty())
++        p->setClipRegion( v->clipHolder()->top() );
+     else
+         p->setClipRegion( QRegion(), Qt::NoClip );
+ }
+@@ -846,7 +944,7 @@
+ void RenderLayer::paintLayer(RenderLayer* rootLayer, QPainter *p,
+                         const QRect& paintDirtyRect, bool selectionOnly)
+ {
+-    assert( rootLayer != this || !s_clipHolder );
++    assert( rootLayer != this || !m_object->canvas()->view()->clipHolder() );
+ 
+     // Calculate the clip rects we should use.
+     QRect layerBounds, damageRect, clipRectToApply;
+@@ -961,10 +1059,11 @@
+     if (isTransparent())
+         p->setOpacity(previousOpacity);
+ 
+-    if (s_clipHolder && rootLayer == this) {
+-        assert(s_clipHolder->isEmpty());
+-        delete s_clipHolder;
+-        s_clipHolder = 0;
++    if (rootLayer == this && m_object->canvas()->view()->clipHolder()) {
++        KHTMLView* const v = m_object->canvas()->view();
++        assert(v->clipHolder()->isEmpty());
++        delete v->clipHolder();
++        v->setClipHolder(0);
+     }
+ }
+ 
+@@ -1105,13 +1204,13 @@
+         convertToLayerCoords(rootLayer, x, y);
+ 
+         if (m_object->hasOverflowClip()) {
+-            QRect newOverflowClip = m_object->getOverflowClipRect(x,y);
++            QRect newOverflowClip = m_object->overflowClipRect(x,y);
+             overflowClipRect  = newOverflowClip.intersect(overflowClipRect);
+             if (m_object->isPositioned() || m_object->isRelPositioned())
+                 posClipRect = newOverflowClip.intersect(posClipRect);
+         }
+         if (m_object->hasClip()) {
+-            QRect newPosClip = m_object->getClipRect(x,y);
++            QRect newPosClip = m_object->clipRect(x,y);
+             posClipRect = posClipRect.intersect(newPosClip);
+             overflowClipRect = overflowClipRect.intersect(newPosClip);
+             fixedClipRect = fixedClipRect.intersect(newPosClip);
+@@ -1141,11 +1240,11 @@
+     if (m_object->hasOverflowClip() || m_object->hasClip()) {
+         // This layer establishes a clip of some kind.
+         if (m_object->hasOverflowClip())
+-            foregroundRect = foregroundRect.intersect(m_object->getOverflowClipRect(x,y));
++            foregroundRect = foregroundRect.intersect(m_object->overflowClipRect(x,y));
+ 
+         if (m_object->hasClip()) {
+             // Clip applies to *us* as well, so go ahead and update the damageRect.
+-            QRect newPosClip = m_object->getClipRect(x,y);
++            QRect newPosClip = m_object->clipRect(x,y);
+             backgroundRect = backgroundRect.intersect(newPosClip);
+             foregroundRect = foregroundRect.intersect(newPosClip);
+         }
+@@ -1367,14 +1466,10 @@
+ 
+ void RenderLayer::collectLayers(QVector<RenderLayer*>*& posBuffer, QVector<RenderLayer*>*& negBuffer)
+ {
+-    // FIXME: A child render object or layer could override visibility.  Don't remove this
+-    // optimization though until RenderObject's nodeAtPoint is patched to understand what to do
+-    // when visibility is overridden by a child.
+-    if (renderer()->style()->visibility() != VISIBLE)
+-        return;
++    updateVisibilityStatus();
+ 
+     // Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists.
+-    if (!isOverflowOnly()) {
++    if (m_hasVisibleContent && !isOverflowOnly()) {
+         // Determine which buffer the child should be in.
+         QVector<RenderLayer*>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
+ 
+@@ -1388,7 +1483,7 @@
+ 
+     // Recur into our children to collect more layers, but only if we don't establish
+     // a stacking context.
+-    if (!isStackingContext()) {
++    if (m_hasVisibleDescendant && !isStackingContext()) {
+         for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+             child->collectLayers(posBuffer, negBuffer);
+     }
+--- a/khtml/rendering/render_replaced.cpp
++++ b/khtml/rendering/render_replaced.cpp
+@@ -161,12 +161,6 @@
+     detachCounters();
+     remove();
+ 
+-    InlineBox* ph = placeHolderBox();
+-    if (ph) {
+-        ph->detach(renderArena());
+-        setPlaceHolderBox( 0 );
+-    }
+-
+     if ( m_widget ) {
+         if ( m_view ) {
+             m_view->setWidgetVisible(this, false);
+@@ -574,19 +568,19 @@
+     setInPaintEventFlag( widget, false );
+ 
+     widget->render( d, (buffered ? QPoint(0,0) : thePoint), r);
++    
++    setInPaintEventFlag( widget );
+ 
+-    if (!p->isActive())
++    if (!buffered) {
+         p->begin(x);
+-    p->setWorldMatrix( m );
+-    p->setClipRegion( rg );
+-
+-    if (buffered) {
++        if (!rg.isEmpty())
++            p->setClipRegion( rg );
++        p->setWorldMatrix( m );
++    } else {
+         // transfer results
+         p->drawPixmap(QPoint(tx, ty), static_cast<QPixmap&>(*d), r);
+         PaintBuffer::release();
+     }
+-
+-    setInPaintEventFlag( widget );
+ }
+ 
+ void RenderWidget::paintWidget(PaintInfo& pI, QWidget *widget, int tx, int ty)
+@@ -690,6 +684,9 @@
+ 
+ void RenderWidget::EventPropagator::sendEvent(QEvent *e) {
+     switch(e->type()) {
++    case QEvent::Wheel:
++        wheelEvent ( static_cast<QWheelEvent *> (e) );
++        break;
+     case QEvent::MouseButtonPress:
+         mousePressEvent(static_cast<QMouseEvent *>(e));
+         break;
+@@ -807,6 +804,7 @@
+                  me.clientY() - absy + m_view->contentsY());
+ 
+         QWidget* target = 0;
++        KHTMLView* itsaview = qobject_cast<KHTMLView*>(m_widget);
+         target = m_widget->childAt(p);
+ 
+         if (m_underMouse != target && ev.id() == EventImpl::MOUSEMOVE_EVENT) {
+--- a/khtml/rendering/render_container.cpp
++++ b/khtml/rendering/render_container.cpp
+@@ -33,6 +33,7 @@
+ #include "rendering/render_canvas.h"
+ #include "rendering/render_generated.h"
+ #include "rendering/render_inline.h"
++#include "rendering/render_layer.h"
+ #include "xml/dom_docimpl.h"
+ #include "css/css_valueimpl.h"
+ 
+@@ -163,15 +164,26 @@
+ {
+     KHTMLAssert(oldChild->parent() == this);
+ 
+-    // So that we'll get the appropriate dirty bit set (either that a normal flow child got yanked or
+-    // that a positioned child got yanked).  We also repaint, so that the area exposed when the child
+-    // disappears gets repainted properly.
+     if ( document()->renderer() ) {
+-        oldChild->setNeedsLayoutAndMinMaxRecalc();
++        oldChild->setNeedsLayoutAndMinMaxRecalc(); // Dirty the containing block chain
++        oldChild->setNeedsLayout( false ); // The child itself does not need to layout - it's going away.
++
++        // Repaint, so that the area exposed when the child
++        // disappears gets repainted properly.
+         oldChild->repaint();
+ 
+-        // Keep our layer hierarchy updated.
+-        oldChild->removeLayers(enclosingLayer());
++        // if we remove visible child from an invisible parent, we don't know the layer visibility any more
++        RenderLayer* layer = 0;
++        if (m_style->visibility() != VISIBLE && oldChild->style()->visibility() == VISIBLE && !oldChild->layer()) {
++            layer = enclosingLayer();
++            layer->dirtyVisibleContentStatus();
++        }
++
++         // Keep our layer hierarchy updated.
++        if (oldChild->firstChild() || oldChild->layer()) {
++            if (!layer) layer = enclosingLayer();            
++            oldChild->removeLayers(layer);
++        }
+         // remove the child from any special layout lists
+         oldChild->removeFromObjectLists();
+         
+@@ -192,6 +204,16 @@
+             canvas()->clearSelection();
+     }
+ 
++    // remove and detach the place holder box
++    if (oldChild->isBox()) {
++        RenderBox* rb = static_cast<RenderBox*>(oldChild);
++        InlineBox* ph = rb->placeHolderBox();
++        if (ph) {
++            ph->detach(rb->renderArena());
++            rb->setPlaceHolderBox( 0 );
++        }
++    }
++
+     // remove the child from the render-tree
+     if (oldChild->previousSibling())
+         oldChild->previousSibling()->setNextSibling(oldChild->nextSibling());
+@@ -473,21 +495,29 @@
+ 
+     // Keep our layer hierarchy updated.  Optimize for the common case where we don't have any children
+     // and don't have a layer attached to ourselves.
++    RenderLayer* layer = 0;
+     if (newChild->firstChild() || newChild->layer()) {
+-        RenderLayer* layer = enclosingLayer();
++        layer = enclosingLayer();
+         newChild->addLayers(layer, newChild);
+     }
+ 
++    // if the new child is visible but this object was not, tell the layer it has some visible content
++    // that needs to be drawn and layer visibility optimization can't be used
++    if (style()->visibility() != VISIBLE && newChild->style()->visibility() == VISIBLE && !newChild->layer()) {
++        if (!layer) layer = enclosingLayer();
++        layer->setHasVisibleContent(true);
++    }
++
+     if (!newChild->isFloatingOrPositioned() && childrenInline())
+         dirtyLinesFromChangedChild(newChild);
+ 
+     newChild->setNeedsLayoutAndMinMaxRecalc(); // Goes up the containing block hierarchy.
+ 
+-    // We may supply the static position for an absolute positioned child.
+-    if (!normalChildNeedsLayout() && !newChild->isText()) {
+-        if (newChild->firstChild() || newChild->isPosWithStaticDim())
++    if (!normalChildNeedsLayout()) {
++        // We may supply the static position for an absolute positioned child.
++        if (newChild->firstChild() || newChild->isPosWithStaticDim() || !newChild->isPositioned())
+             setChildNeedsLayout(true);
+-        else if (newChild->isPositioned()) {
++        else {
+             assert(!newChild->inPosObjectList());
+             newChild->containingBlock()->insertPositionedObject(newChild);
+         }
+@@ -516,19 +546,31 @@
+     child->setPreviousSibling(prev);
+     child->setParent(this);
+ 
+-    // Keep our layer hierarchy updated.
+-    RenderLayer* layer = enclosingLayer();
+-    child->addLayers(layer, child);
++    // Keep our layer hierarchy updated.  Optimize for the common case where we don't have any children
++    // and don't have a layer attached to ourselves.
++    RenderLayer* layer = 0;
++    if (child->firstChild() || child->layer()) {
++        layer = enclosingLayer();
++        child->addLayers(layer, child);
++    }
++
++    // if the new child is visible but this object was not, tell the layer it has some visible content
++    // that needs to be drawn and layer visibility optimization can't be used
++    if (style()->visibility() != VISIBLE && child->style()->visibility() == VISIBLE && !child->layer()) {
++        if (!layer) layer = enclosingLayer();
++        layer->setHasVisibleContent(true);
++    }
+ 
+     if (!child->isFloating() && childrenInline())
+         dirtyLinesFromChangedChild(child);
+ 
+     child->setNeedsLayoutAndMinMaxRecalc();
+-    // We may supply the static position for an absolute positioned child.
+-    if (!normalChildNeedsLayout() && !child->isText()) {
+-        if (child->firstChild() || child->isPosWithStaticDim())
++
++    if (!normalChildNeedsLayout()) {
++        // We may supply the static position for an absolute positioned child.
++        if (child->firstChild() || child->isPosWithStaticDim() || !child->isPositioned())
+             setChildNeedsLayout(true);
+-        else if (child->isPositioned()) {
++        else {
+             assert(!child->inPosObjectList());
+             child->containingBlock()->insertPositionedObject(child);
+         }
+--- a/khtml/rendering/render_canvasimage.h
++++ b/khtml/rendering/render_canvasimage.h
+@@ -1,6 +1,7 @@
+ /*
+- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
++ * Copyright (C) 2004, 2006, 2007 Apple Computer, Inc.  All rights reserved.
+  * Copyright (C) 2005 Zack Rusin <zack at kde.org>
++ * Copyright (C) 2007 Maksim Orlovich <maksim at kde.org>
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+@@ -28,44 +29,37 @@
+ #define RENDER_CANVASIMAGE_H
+ 
+ #include "html/html_elementimpl.h"
+-#include "rendering/render_image.h"
++#include "html/html_canvasimpl.h"
++#include "rendering/render_replaced.h"
+ #include "dom/dom_string.h"
+ 
+ #include <QtCore/QMap>
+ #include <QtGui/QImage>
+ #include <QtGui/QPainter>
+ 
++#include "imload/imagepainter.h"
++
++
+ namespace khtml {
+ 
+ 
+-class RenderCanvasImage : public RenderImage
++class RenderCanvasImage : public RenderReplaced
+ {
+ public:
+-    RenderCanvasImage(DOM::NodeImpl*);
+-    virtual ~RenderCanvasImage();
++    RenderCanvasImage(DOM::HTMLCanvasElementImpl*);
+ 
+     virtual const char *renderName() const { return "RenderCanvasImage"; }
+ 
+     virtual void paint(PaintInfo& i, int tx, int ty);
+-
+     virtual void layout();
+-
+-    void setNeedsImageUpdate();
++    virtual void updateFromElement();
+ 
+     // don't even think about making this method virtual!
+-    DOM::HTMLElementImpl* element() const
+-    { return static_cast<DOM::HTMLElementImpl*>(RenderObject::element()); }
+-
+-    void updateDrawnImage();
+-    QPainter *drawingContext();
++    DOM::HTMLCanvasElementImpl* element() const
++    { return static_cast<DOM::HTMLCanvasElementImpl*>(RenderObject::element()); }
+ 
+ private:
+-    void createDrawingContext();
+-
+-    QPainter *m_drawingContext;
+-    QImage   *m_drawnImage;
+-
+-    unsigned int m_needsImageUpdate:1;
++    khtmlImLoad::ImagePainter imagePainter;
+ };
+ 
+ 
+--- a/khtml/rendering/render_text.cpp
++++ b/khtml/rendering/render_text.cpp
+@@ -1202,7 +1202,7 @@
+     KHTMLAssert(!isBR() || (str->l == 1 && (*str->s) == '\n'));
+     KHTMLAssert(!str->l || str->s);
+ 
+-    setNeedsLayoutAndMinMaxRecalc();
++    if (parent()) setNeedsLayoutAndMinMaxRecalc();
+ #ifdef BIDI_DEBUG
+     QString cstr = QString::fromRawData(str->s, str->l);
+     kDebug( 6040 ) << "RenderText::setText( " << cstr.length() << " ) '" << cstr << "'";
+--- a/khtml/rendering/render_table.cpp
++++ b/khtml/rendering/render_table.cpp
+@@ -2315,8 +2315,14 @@
+     if (colSpan() > 1 || !w.isVariable())
+         return w;
+     RenderTableCol* col = table()->colElement(_col);
+-    if (col)
++    if (col) {
+         w = col->style()->width();
++
++        // Column widths specified on <col> apply to the border box of the cell.
++        // Percentages don't need to be handled since they're always treated this way (even when specified on the cells).
++        if (w.isFixed() && w.value() > 0)
++            w = Length(qMax(0, w.value() - borderLeft() - borderRight() - paddingLeft() - paddingRight()), Fixed);
++    }
+     return w;
+ }
+ 
+--- a/khtml/rendering/render_box.cpp
++++ b/khtml/rendering/render_box.cpp
+@@ -215,13 +215,6 @@
+     RenderArena* arena = renderArena();
+ 
+     detachRemainingChildren();
+-    
+-    InlineBox* ph = placeHolderBox();
+-    if (ph) {
+-        ph->detach(arena);
+-        setPlaceHolderBox( 0 );
+-    }
+-
+     RenderContainer::detach();
+ 
+     if (layer)
+@@ -700,7 +693,7 @@
+     p->drawRect(_tx, _ty, m_width, m_height);
+ }
+ 
+-QRect RenderBox::getOverflowClipRect(int tx, int ty)
++QRect RenderBox::overflowClipRect(int tx, int ty)
+ {
+     // XXX When overflow-clip (CSS3) is implemented, we'll obtain the property
+     // here.
+@@ -719,7 +712,7 @@
+     return QRect(clipx,clipy,clipw,cliph);
+ }
+ 
+-QRect RenderBox::getClipRect(int tx, int ty)
++QRect RenderBox::clipRect(int tx, int ty)
+ {
+     int bl=borderLeft(),bt=borderTop(),bb=borderBottom(),br=borderRight();
+     // ### what about paddings?
+@@ -896,9 +889,12 @@
+ 
+ void RenderBox::relativePositionOffset(int &tx, int &ty) const
+ {
+-    if(!style()->left().isVariable())
+-        tx += style()->left().width(containingBlockWidth());
+-    else if(!style()->right().isVariable())
++    if (!style()->left().isVariable()) {
++        if (!style()->right().isVariable() && containingBlock()->style()->direction() == RTL)
++            tx -= style()->right().width(containingBlockWidth());
++        else
++            tx +=  style()->left().width(containingBlockWidth());
++    } else if (!style()->right().isVariable())
+         tx -= style()->right().width(containingBlockWidth());
+     if(!style()->top().isVariable())
+     {
+@@ -2224,16 +2220,38 @@
+ int RenderBox::lowestPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+ {
+     return includeSelf ? m_height : 0;
++    if (!includeSelf || !m_width)
++        return 0;
++    int bottom = m_height;
++    if (isRelPositioned()) {
++        int x;
++        relativePositionOffset(x, bottom);
++    }
++    return bottom;
+ }
+ 
+ int RenderBox::rightmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+ {
+-    return includeSelf ? m_width : 0;
++    if (!includeSelf || !m_height)
++        return 0;
++    int right = m_width;
++    if (isRelPositioned()) {
++        int y;
++        relativePositionOffset(right, y);
++    }
++    return right;
+ }
+ 
+ int RenderBox::leftmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+ {
+-    return includeSelf ? 0 : m_width;
++    if (!includeSelf || !m_height)
++        return m_width;
++    int left = 0;
++    if (isRelPositioned()) {
++        int y;
++        relativePositionOffset(left, y);
++    }
++    return left;
+ }
+ 
+ int RenderBox::pageTopAfter(int y) const
+--- a/khtml/rendering/render_block.cpp
++++ b/khtml/rendering/render_block.cpp
+@@ -2610,33 +2610,35 @@
+ #ifdef DEBUG_LAYOUT
+     kDebug( 6040 ) << renderName() << "(RenderBlock)::calcMinMaxWidth() this=" << this;
+ #endif
++    if (!isTableCell() && style()->width().isFixed() && style()->width().value() > 0)
++        m_minWidth = m_maxWidth = calcContentWidth(style()->width().value());
++    else {
++        m_minWidth = 0;
++        m_maxWidth = 0;
++
++        bool noWrap = !style()->autoWrap();
++        if (childrenInline())
++            calcInlineMinMaxWidth();
++        else
++            calcBlockMinMaxWidth();
+ 
+-    m_minWidth = 0;
+-    m_maxWidth = 0;
++        if(m_maxWidth < m_minWidth) m_maxWidth = m_minWidth;
+ 
+-    bool noWrap = !style()->autoWrap();
+-    if (childrenInline())
+-        calcInlineMinMaxWidth();
+-    else
+-        calcBlockMinMaxWidth();
+-
+-    if(m_maxWidth < m_minWidth) m_maxWidth = m_minWidth;
+-
+-    if (noWrap && childrenInline()) {
+-         m_minWidth = m_maxWidth;
+-
+-        // A horizontal marquee with inline children has no minimum width.
+-        if (style()->overflowX() == OMARQUEE && m_layer && m_layer->marquee() &&
+-            m_layer->marquee()->isHorizontal() && !m_layer->marquee()->isUnfurlMarquee())
+-            m_minWidth = 0;
+-    }
+-
+-    if (isTableCell()) {
+-        Length w = static_cast<RenderTableCell*>(this)->styleOrColWidth();
+-        if (w.isFixed() && w.value() > 0)
+-            m_maxWidth = qMax((int)m_minWidth, calcContentWidth(w.value()));
+-    } else if (style()->width().isFixed() && style()->width().value() > 0)
+-        m_minWidth = m_maxWidth = calcContentWidth(style()->width().value());
++        if (noWrap && childrenInline()) {
++             m_minWidth = m_maxWidth;
++
++            // A horizontal marquee with inline children has no minimum width.
++            if (style()->overflowX() == OMARQUEE && m_layer && m_layer->marquee() &&
++                m_layer->marquee()->isHorizontal() && !m_layer->marquee()->isUnfurlMarquee())
++                m_minWidth = 0;
++        }
++
++        if (isTableCell()) {
++            Length w = static_cast<RenderTableCell*>(this)->styleOrColWidth();
++            if (w.isFixed() && w.value() > 0)
++                m_maxWidth = qMax((int)m_minWidth, calcContentWidth(w.value()));
++        }
++    }
+ 
+     if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
+         m_maxWidth = qMax(m_maxWidth, (int)calcContentWidth(style()->minWidth().value()));
+--- a/khtml/rendering/render_line.h
++++ b/khtml/rendering/render_line.h
+@@ -30,7 +30,7 @@
+ class InlineFlowBox;
+ class RootInlineBox;
+ class RenderArena;
+-class BidiStatus;
++struct BidiStatus;
+ class BidiContext;
+ 
+ // InlineBox represents a rectangle that occurs on a line.  It corresponds to
+--- a/khtml/rendering/render_generated.cpp
++++ b/khtml/rendering/render_generated.cpp
+@@ -379,7 +379,7 @@
+         diamond[2] = QPoint(x+s,   y+2*s);
+         diamond[3] = QPoint(x,     y+s);
+         p->setBrush( color );
+-        p->drawConvexPolygon( diamond, 0, 4 );
++        p->drawConvexPolygon( diamond.constData(), 4 );
+         return;
+     }
+     case LNONE:
+--- a/khtml/khtml_pagecache.cpp
++++ b/khtml/khtml_pagecache.cpp
+@@ -26,8 +26,8 @@
+ #include <kstandarddirs.h>
+ 
+ #include <QQueue>
+-#include <Qt3Support/Q3IntDict>
+-#include <Qt3Support/Q3PtrList>
++#include <QHash>
++#include <QList>
+ #include <QtCore/QTimer>
+ #include <QtCore/QFile>
+ #include <errno.h>
+@@ -40,7 +40,7 @@
+ #define KHTML_PAGE_CACHE_SIZE 12
+ #endif
+ 
+-template class Q3PtrList<KHTMLPageCacheDelivery>;
++template class QList<KHTMLPageCacheDelivery*>;
+ class KHTMLPageCacheEntry
+ {
+   friend class KHTMLPageCache;
+@@ -52,8 +52,8 @@
+   void addData(const QByteArray &data);
+   void endData();
+ 
+-  bool isComplete() {return m_complete;}
+-  QString fileName() {return m_fileName;}
++  bool isComplete() const {return m_complete;}
++  QString fileName() const {return m_fileName;}
+ 
+   KHTMLPageCacheDelivery *fetchData(QObject *recvObj, const char *recvSlot);
+ private:
+@@ -69,8 +69,8 @@
+ public:
+   long newId;
+   bool deliveryActive;
+-  Q3IntDict<KHTMLPageCacheEntry> dict;
+-  Q3PtrList<KHTMLPageCacheDelivery> delivery;
++  QHash<int, KHTMLPageCacheEntry*> dict;
++  QList<KHTMLPageCacheDelivery*> delivery;
+   QQueue<long> expireQueue;
+ };
+ 
+@@ -142,8 +142,8 @@
+ 
+ KHTMLPageCache::~KHTMLPageCache()
+ {
+-  d->delivery.setAutoDelete(true);
+-  d->dict.setAutoDelete(true);
++  qDeleteAll(d->dict);
++  qDeleteAll(d->delivery);
+   delete d;
+ }
+ 
+@@ -163,7 +163,7 @@
+ KHTMLPageCache::addData(long id, const QByteArray &data)
+ {
+ 
+-  KHTMLPageCacheEntry *entry = d->dict.find(id);
++  KHTMLPageCacheEntry *entry = d->dict.value( id );
+   if (entry)
+      entry->addData(data);
+ }
+@@ -171,7 +171,7 @@
+ void
+ KHTMLPageCache::endData(long id)
+ {
+-  KHTMLPageCacheEntry *entry = d->dict.find(id);
++  KHTMLPageCacheEntry *entry = d->dict.value( id );
+   if (entry)
+      entry->endData();
+ }
+@@ -179,7 +179,7 @@
+ void
+ KHTMLPageCache::cancelEntry(long id)
+ {
+-  KHTMLPageCacheEntry *entry = d->dict.take(id);
++  KHTMLPageCacheEntry *entry = d->dict.take( id );
+   if (entry)
+   {
+      d->expireQueue.removeAll(entry->m_id);
+@@ -190,13 +190,13 @@
+ bool
+ KHTMLPageCache::isValid(long id)
+ {
+-  return (d->dict.find(id) != 0);
++  return d->dict.contains(id);
+ }
+ 
+ bool
+ KHTMLPageCache::isComplete(long id)
+ {
+-  KHTMLPageCacheEntry *entry = d->dict.find(id);
++  KHTMLPageCacheEntry *entry = d->dict.value( id );
+   if (entry)
+      return entry->isComplete();
+   return false;
+@@ -205,7 +205,7 @@
+ void
+ KHTMLPageCache::fetchData(long id, QObject *recvObj, const char *recvSlot)
+ {
+-  KHTMLPageCacheEntry *entry = d->dict.find(id);
++  KHTMLPageCacheEntry *entry = d->dict.value( id );
+   if (!entry || !entry->isComplete()) return;
+ 
+   // Make this entry the most recent entry.
+@@ -223,16 +223,13 @@
+ void
+ KHTMLPageCache::cancelFetch(QObject *recvObj)
+ {
+-  KHTMLPageCacheDelivery *next;
+-  for(KHTMLPageCacheDelivery* delivery = d->delivery.first();
+-      delivery;
+-      delivery = next)
+-  {
+-      next = d->delivery.next();
++  QMutableListIterator<KHTMLPageCacheDelivery*> it( d->delivery );
++  while (it.hasNext()) {
++      KHTMLPageCacheDelivery* delivery = it.next();
+       if (delivery->recvObj == recvObj)
+       {
+-         d->delivery.removeRef(delivery);
+          delete delivery;
++         it.remove();
+       }
+   }
+ }
+@@ -246,7 +243,7 @@
+      return;
+   }
+ 
+-  KHTMLPageCacheDelivery *delivery = d->delivery.take(0);
++  KHTMLPageCacheDelivery *delivery = d->delivery.takeFirst();
+   assert(delivery);
+ 
+   QByteArray byteArray(delivery->file->read(64*1024));
+@@ -269,8 +266,8 @@
+ void
+ KHTMLPageCache::saveData(long id, QDataStream *str)
+ {
+-  KHTMLPageCacheEntry *entry = d->dict.find(id);
+-  assert(entry);
++  assert(d->dict.contains( id ));
++  KHTMLPageCacheEntry *entry = d->dict.value( id );
+ 
+   if (!entry->isComplete())
+   {
+--- a/khtml/java/tests/CMakeLists.txt
++++ b/khtml/java/tests/CMakeLists.txt
+@@ -5,12 +5,19 @@
+ 
+ ########### next target ###############
+ 
+-set(testserver_SRCS testkjavaappletserver.cpp )
++set(testserver_SRCS testkjavaappletserver.cpp
++    ../kjavaappletcontext.cpp  ../kjavaappletviewer.cpp  ../kjavaprocess.cpp
++    ../kjavaapplet.cpp         ../kjavaappletwidget.cpp  ../kjavadownloader.cpp
++    ../kjavaappletserver.cpp)
+ 
+ 
+ kde4_add_executable(testserver TEST ${testserver_SRCS})
+ 
+-target_link_libraries(testserver  ${KDE4_KDECORE_LIBS} khtml)
++target_link_libraries(testserver  ${KDE4_KDECORE_LIBS}
++    ${KDE4_KPARTS_LIBS}
++    ${KDE4_KDEUI_LIBS}
++    ${QT_QT3SUPPORT_LIBRARY}
++    ${KDE4_KDE3SUPPORT_LIBRARY})
+ 
+ 
+ 
+--- a/khtml/java/kjavaappletviewer.cpp
++++ b/khtml/java/kjavaappletviewer.cpp
+@@ -29,11 +29,11 @@
+ #undef Always
+ #endif
+ #include <QtCore/QDir>
+-#include <Qt3Support/Q3Table>
+ #include <QtCore/QPair>
+ #include <QtCore/QTimer>
+ #include <QtCore/QPointer>
+ #include <QtGui/QLabel>
++#include <QtGui/QTableWidget>
+ #include <QtDBus/QtDBus>
+ 
+ #include <kauthorized.h>
+@@ -132,31 +132,40 @@
+     setModal( true );
+ 
+     KJavaApplet* const applet = parent->applet ();
+-    table = new Q3Table (30, 2, this);
++    table = new QTableWidget (30, 2, this);
+     table->setMinimumSize (QSize (600, 400));
+     table->setColumnWidth (0, 200);
+     table->setColumnWidth (1, 340);
+-    Q3Header* const header = table->horizontalHeader();
+-    header->setLabel (0, i18n ("Parameter"));
+-    header->setLabel (1, i18n ("Value"));
+-    Q3TableItem * tit = new Q3TableItem (table, Q3TableItem::Never, i18n("Class"));
++    QTableWidgetItem* const header1 = new QTableWidgetItem(i18n ("Parameter"));
++    QTableWidgetItem* const header2 = new QTableWidgetItem(i18n ("Value"));
++    table->setHorizontalHeaderItem(1, header1);
++    table->setHorizontalHeaderItem(2, header2);
++    QTableWidgetItem * tit = new QTableWidgetItem(i18n("Class"));
++    tit->setFlags( tit->flags()^Qt::ItemIsEditable );
+     table->setItem (0, 0, tit);
+-    tit = new Q3TableItem(table, Q3TableItem::Always, applet->appletClass());
++    tit = new QTableWidgetItem(applet->appletClass());
++    tit->setFlags( tit->flags()|Qt::ItemIsEditable );
+     table->setItem (0, 1, tit);
+-    tit = new Q3TableItem (table, Q3TableItem::Never, i18n ("Base URL"));
++    tit = new QTableWidgetItem (i18n ("Base URL"));
++    tit->setFlags( tit->flags()^Qt::ItemIsEditable );
+     table->setItem (1, 0, tit);
+-    tit = new Q3TableItem(table, Q3TableItem::Always, applet->baseURL());
++    tit = new QTableWidgetItem(applet->baseURL());
++    tit->setFlags( tit->flags()|Qt::ItemIsEditable );
+     table->setItem (1, 1, tit);
+-    tit = new Q3TableItem (table, Q3TableItem::Never, i18n ("Archives"));
++    tit = new QTableWidgetItem(i18n ("Archives"));
++    tit->setFlags( tit->flags()^Qt::ItemIsEditable );
+     table->setItem (2, 0, tit);
+-    tit = new Q3TableItem(table, Q3TableItem::Always, applet->archives());
++    tit = new QTableWidgetItem(applet->archives());
++    tit->setFlags( tit->flags()|Qt::ItemIsEditable );
+     table->setItem (2, 1, tit);
+     QMap<QString,QString>::const_iterator it = applet->getParams().begin();
+     const QMap<QString,QString>::const_iterator itEnd = applet->getParams().end();
+     for (int count = 2; it != itEnd; ++it) {
+-        tit = new Q3TableItem (table, Q3TableItem::Always, it.key ());
++        tit = new QTableWidgetItem (it.key ());
++        tit->setFlags( tit->flags()|Qt::ItemIsEditable );
+         table->setItem (++count, 0, tit);
+-        tit = new Q3TableItem(table, Q3TableItem::Always, it.value ());
++        tit = new QTableWidgetItem(it.value());
++        tit->setFlags( tit->flags()|Qt::ItemIsEditable );
+         table->setItem (count, 1, tit);
+     }
+     setMainWidget (table);
+@@ -164,12 +173,12 @@
+ }
+ 
+ void AppletParameterDialog::slotClose () {
+-    table->selectCells (0, 0, 0, 0);
++    table->setRangeSelected(QTableWidgetSelectionRange(0, 0, 0, 0), true);
+     KJavaApplet* const applet = m_appletWidget->applet ();
+     applet->setAppletClass (table->item (0, 1)->text ());
+     applet->setBaseURL (table->item (1, 1)->text ());
+     applet->setArchives (table->item (2, 1)->text ());
+-    const int lim = table->numRows();
++    const int lim = table->rowCount();
+     for (int i = 3; i < lim; ++i) {
+         if (table->item (i, 0) && table->item (i, 1) && !table->item (i, 0)->text ().isEmpty ())
+             applet->setParameter (table->item (i, 0)->text (),
+@@ -231,6 +240,7 @@
+ {
+     m_view = new CoverWidget (wparent);
+     QString classname, classid, codebase, khtml_codebase, src_param;
++    QString appletname;
+     int width = -1;
+     int height = -1;
+     KJavaApplet* const applet = m_view->appletWidget()->applet ();
+@@ -269,7 +279,7 @@
+                          name_lower.startsWith ("cache_archive"))
+                     applet->setArchives (value);
+                 else if (name_lower == QLatin1String("name"))
+-                    applet->setAppletName (value);
++                    appletname = value;
+                 else if (name_lower == QLatin1String("width"))
+                     width = value.toInt();
+                 else if (name_lower == QLatin1String("height"))
+@@ -306,6 +316,9 @@
+         m_view->resize (width, height);
+         applet->setSize( QSize( width, height ) );
+     }
++    if (appletname.isEmpty())
++        appletname = classname;
++    applet->setAppletName (appletname);
+     applet->setBaseURL (baseurl);
+     // check codebase first
+     const KUrl kbaseURL( baseurl );
+--- a/khtml/java/kjavaappletserver.cpp
++++ b/khtml/java/kjavaappletserver.cpp
+@@ -221,7 +221,7 @@
+ 
+     QString jvm_path = "java";
+ 
+-    QString jPath = config.readPathEntry( "JavaPath" );
++    QString jPath = config.readPathEntry( "JavaPath", QString() );
+     if ( !jPath.isEmpty() && jPath != "java" )
+     {
+         // Cut off trailing slash if any
+@@ -762,7 +762,7 @@
+     killTimers();
+     startTimer(15000);
+     while (!frame->exit)
+-		QAbstractEventDispatcher::instance()->processEvents (QEventLoop::AllEvents | QEventLoop::WaitForMore);
++		QAbstractEventDispatcher::instance()->processEvents (QEventLoop::AllEvents | QEventLoop::WaitForMoreEvents);
+     if (d->jsstack.size() <= 1)
+         killTimers();
+     kDebug(6100) << "<KJavaAppletServer::waitForReturnData stacksize:" << d->jsstack.size();
+--- a/khtml/java/kjavaprocess.cpp
++++ b/khtml/java/kjavaprocess.cpp
+@@ -157,9 +157,8 @@
+     const QString size_str = QString("%1").arg( size, 8 );
+     kDebug(6100) << "KJavaProcess::storeSize, size = " << size_str;
+ 
+-    const char* size_ptr = size_str.toLatin1().constData();
+     for( int i = 0; i < 8; ++i )
+-        buff->data()[ i ] = size_ptr[i];
++        buff->data()[ i ] = size_str[i].toLatin1();
+ }
+ 
+ void KJavaProcess::send( char cmd_code, const QStringList& args )
+--- a/khtml/java/kjavaappletviewer.desktop
++++ b/khtml/java/kjavaappletviewer.desktop
+@@ -11,7 +11,7 @@
+ Name[cy]=Gwelydd Rhaglennig Java Mewnadeiladedig
+ Name[da]=Indlejret Java-applet fremviser
+ Name[de]=Eingebetteter Betrachter für Java-Programme
+-Name[el]=Ενσωματωμένος προβολέας εφαρμογιδίων Java
++Name[el]=Ενσωματωμένος προβολέας μικροεφαρμογών Java
+ Name[eo]=Enkonstruita javaplikaĵrigardilo
+ Name[es]=Visor empotrado de miniaplicaciones Java
+ Name[et]=Põimitav Java apleti näitaja
+@@ -50,8 +50,8 @@
+ Name[ru]=Встраиваемый модуль просмотра аплетов Java
+ Name[se]=Vuojuhanláhkái Javaprográmmaš čájeheaddji
+ Name[sl]=Vgrajeni pregledovalnik vstavkov java
+-Name[sr]=Уграђени приказивач Java аплета
+-Name[sr at latin]=Ugrađeni prikazivač Java apleta
++Name[sr]=Угњеждени приказивач јаванских аплета
++Name[sr at latin]=Ugnježdeni prikazivač javanskih apleta
+ Name[sv]=Inbäddningsbar visare av Javaminiprogram
+ Name[ta]=உட்பொதிந்த ஜாவா சிறுநிரல் காட்டி
+ Name[te]=పొదిగిన జావా ఎపలెట్ చూపరి
+--- a/khtml/java/kjavaappletviewer.h
++++ b/khtml/java/kjavaappletviewer.h
+@@ -36,7 +36,7 @@
+ 
+ #include "kjavaappletwidget.h"
+ 
+-class Q3Table;
++class QTableWidget;
+ class QLabel;
+ class KJavaProcess;
+ class KJavaAppletViewer;
+@@ -141,7 +141,7 @@
+     void slotClose ();
+ private:
+     KJavaAppletWidget * m_appletWidget;
+-    Q3Table * table;
++    QTableWidget * table;
+ };
+ 
+ #endif
+--- /dev/null
++++ b/khtml/kcookiejar_interface.cpp
+@@ -0,0 +1,28 @@
++/*
++ * This file was generated by dbusxml2cpp version 0.6
++ * Command line was: dbusxml2cpp -i kcookiejar_include.h -m -p kcookiejar_interface ../kioslave/http/kcookiejar/org.kde.KCookieServer.xml
++ *
++ * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved.
++ *
++ * This is an auto-generated file.
++ * This file may have been hand-edited. Look for HAND-EDIT comments
++ * before re-generating it.
++ */
++
++#include "kcookiejar_interface.h"
++
++/*
++ * Implementation of interface class OrgKdeKCookieServerInterface
++ */
++
++OrgKdeKCookieServerInterface::OrgKdeKCookieServerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
++    : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
++{
++}
++
++OrgKdeKCookieServerInterface::~OrgKdeKCookieServerInterface()
++{
++}
++
++
++#include "kcookiejar_interface.moc"
+--- a/khtml/css/html4.css
++++ b/khtml/css/html4.css
+@@ -257,15 +257,15 @@
+         display: list-item;
+ }
+ 
+-ul   ul ul,   ul   ol ul,     ul   menu ul,   ul   dir ul, 
++ul   ul ul,   ul   ol ul,     ul   menu ul,   ul   dir ul,
+ ol   ul ul,   ol   ol ul,     ol   menu ul,   ol   dir ul,
+ menu ul ul,   menu ol ul,     menu menu ul,   menu dir ul,
+ dir  ul ul,   dir  ol ul,     dir  menu ul,   dir  dir ul,
+-ul   ul menu, ul   ol menu,   ul   menu menu, ul   dir menu, 
++ul   ul menu, ul   ol menu,   ul   menu menu, ul   dir menu,
+ ol   ul menu, ol   ol menu,   ol   menu menu, ol   dir menu,
+ menu ul menu, menu ol menu,   menu menu menu, menu dir menu,
+ dir  ul menu, dir  ol menu,   dir  menu menu, dir  dir menu,
+-ul   ul dir,  ul   ol dir,    ul   menu dir,  ul   dir dir, 
++ul   ul dir,  ul   ol dir,    ul   menu dir,  ul   dir dir,
+ ol   ul dir,  ol   ol dir,    ol   menu dir,  ol   dir dir,
+ menu ul dir,  menu ol dir,    menu menu dir,  menu dir dir,
+ dir  ul dir,  dir  ol dir,    dir  menu dir,  dir  dir dir
+@@ -273,10 +273,10 @@
+   list-style-type: square;
+ }
+ 
+-ul   ul, ul   ol, ul   menu, ul   dir,
+-ol   ul, ol   ol, ol   menu, ol   dir,
+-menu ul, menu ol, menu menu, menu dir,
+-dir  ul, dir  ol, dir  menu, dir  dir
++ul   ul, ul   menu, ul   dir,
++ol   ul, ol   menu, ol   dir,
++menu ul, menu menu, menu dir,
++dir  ul, dir  menu, dir  dir
+ {
+   list-style-type: circle;
+ }
+--- a/khtml/css/parser.h
++++ b/khtml/css/parser.h
+@@ -144,7 +144,7 @@
+ {
+     CSSRuleImpl *rule;
+     CSSSelector *selector;
+-    Q3PtrList<CSSSelector> *selectorList;
++    QList<CSSSelector*> *selectorList;
+     bool ok;
+     MediaListImpl *mediaList;
+     CSSMediaRuleImpl *mediaRule;
+--- a/khtml/css/cssparser.cpp
++++ b/khtml/css/cssparser.cpp
+@@ -303,8 +303,7 @@
+ 
+ CSSStyleDeclarationImpl *CSSParser::createStyleDeclaration( CSSStyleRuleImpl *rule )
+ {
+-    Q3PtrList<CSSProperty> *propList = new Q3PtrList<CSSProperty>;
+-    propList->setAutoDelete( true );
++    QList<CSSProperty*> *propList = new QList<CSSProperty*>;
+     for ( int i = 0; i < numParsedProperties; i++ )
+         propList->append( parsedProperties[i] );
+ 
+--- a/khtml/css/css_ruleimpl.h
++++ b/khtml/css/css_ruleimpl.h
+@@ -40,6 +40,7 @@
+ class CSSStyleSheet;
+ class CSSStyleSheetImpl;
+ class CSSStyleDeclarationImpl;
++class CSSStyleListImpl;
+ class MediaListImpl;
+ 
+ class CSSRuleImpl : public StyleBaseImpl
+@@ -68,12 +69,14 @@
+ public:
+     CSSCharsetRuleImpl(StyleBaseImpl *parent)
+         : CSSRuleImpl(parent) { m_type = CSSRule::CHARSET_RULE; }
++    CSSCharsetRuleImpl(StyleBaseImpl *parent, const DOM::DOMString &encoding)
++        : CSSRuleImpl(parent), m_encoding(encoding) {  m_type = CSSRule::CHARSET_RULE; }
+ 
+     virtual bool isCharsetRule() const { return true; }
+ 
+     DOMString encoding() const { return m_encoding; }
+     void setEncoding(DOMString _encoding) { m_encoding = _encoding; }
+-
++    virtual DOM::DOMString cssText() const { return DOMString("@charset \"") + m_encoding + "\";"; }
+ protected:
+     DOMString m_encoding;
+ };
+@@ -133,6 +136,7 @@
+ {
+ public:
+     CSSRuleListImpl() {}
++    CSSRuleListImpl(StyleListImpl* const lst, bool omitCharsetRules = false);
+ 
+     ~CSSRuleListImpl();
+ 
+@@ -146,7 +150,7 @@
+ 
+     void append( CSSRuleImpl *rule ) { m_lstCSSRules.append( rule ); }
+ protected:
+-    Q3PtrList<CSSRuleImpl> m_lstCSSRules;
++    QList<CSSRuleImpl*> m_lstCSSRules;
+ };
+ 
+ class CSSMediaRuleImpl : public CSSRuleImpl
+@@ -209,17 +213,17 @@
+ 
+     virtual bool parseString( const DOMString &string, bool = false );
+ 
+-    void setSelector( Q3PtrList<CSSSelector> *selector) { m_selector = selector; }
++    void setSelector( QList<CSSSelector*> *selector) { m_selector = selector; }
+     void setDeclaration( CSSStyleDeclarationImpl *style);
+ 
+-    Q3PtrList<CSSSelector> *selector() { return m_selector; }
++    QList<CSSSelector*> *selector() { return m_selector; }
+     CSSStyleDeclarationImpl *declaration() { return m_style; }
+ 
+     void setNonCSSHints();
+ 
+ protected:
+     CSSStyleDeclarationImpl *m_style;
+-    Q3PtrList<CSSSelector> *m_selector;
++    QList<CSSSelector*> *m_selector;
+ };
+ 
+ 
+--- a/khtml/css/css_valueimpl.cpp
++++ b/khtml/css/css_valueimpl.cpp
+@@ -43,7 +43,6 @@
+ #include <kdebug.h>
+ #include <QtCore/QRegExp>
+ #include <QtGui/QPaintDevice>
+-#include <Qt3Support/Q3PaintDeviceMetrics>
+ 
+ // Hack for debugging purposes
+ extern DOM::DOMString getPropertyName(unsigned short id);
+@@ -88,7 +87,7 @@
+     m_node = 0;
+ }
+ 
+-CSSStyleDeclarationImpl::CSSStyleDeclarationImpl(CSSRuleImpl *parent, Q3PtrList<CSSProperty> *lstValues)
++CSSStyleDeclarationImpl::CSSStyleDeclarationImpl(CSSRuleImpl *parent, QList<CSSProperty*> *lstValues)
+     : StyleBaseImpl(parent)
+ {
+     m_lstValues = lstValues;
+@@ -98,15 +97,15 @@
+ CSSStyleDeclarationImpl&  CSSStyleDeclarationImpl::operator= (const CSSStyleDeclarationImpl& o)
+ {
+     // don't attach it to the same node, just leave the current m_node value
++    if (m_lstValues)
++        qDeleteAll(*m_lstValues);
+     delete m_lstValues;
+     m_lstValues = 0;
+     if (o.m_lstValues) {
+-        m_lstValues = new Q3PtrList<CSSProperty>;
+-        m_lstValues->setAutoDelete( true );
+-
+-        Q3PtrListIterator<CSSProperty> lstValuesIt(*o.m_lstValues);
+-        for (lstValuesIt.toFirst(); lstValuesIt.current(); ++lstValuesIt)
+-            m_lstValues->append(new CSSProperty(*lstValuesIt.current()));
++        m_lstValues = new QList<CSSProperty*>;
++        QListIterator<CSSProperty*> lstValuesIt(*o.m_lstValues);
++        while ( lstValuesIt.hasNext() )
++            m_lstValues->append(new CSSProperty(*lstValuesIt.next()));
+     }
+ 
+     return *this;
+@@ -114,6 +113,8 @@
+ 
+ CSSStyleDeclarationImpl::~CSSStyleDeclarationImpl()
+ {
++    if (m_lstValues)
++        qDeleteAll( *m_lstValues );
+     delete m_lstValues;
+     // we don't use refcounting for m_node, to avoid cyclic references (see ElementImpl)
+ }
+@@ -292,11 +293,13 @@
+ {
+     if(!m_lstValues) return 0;
+ 
+-    Q3PtrListIterator<CSSProperty> lstValuesIt(*m_lstValues);
++    QListIterator<CSSProperty*> lstValuesIt(*m_lstValues);
+     CSSProperty *current;
+-    for ( lstValuesIt.toLast(); (current = lstValuesIt.current()); --lstValuesIt )
++    while ( lstValuesIt.hasNext() ) {
++        current = lstValuesIt.next();
+         if (current->m_id == propertyID && !current->nonCSSHint)
+             return current->value();
++    }
+     return 0;
+ }
+ 
+@@ -305,14 +308,17 @@
+     if(!m_lstValues) return DOMString();
+     DOMString value;
+ 
+-    Q3PtrListIterator<CSSProperty> lstValuesIt(*m_lstValues);
+-     CSSProperty *current;
+-     for ( lstValuesIt.toLast(); (current = lstValuesIt.current()); --lstValuesIt )  {
+-         if (current->m_id == propertyID && NonCSSHint == current->nonCSSHint) {
+-             value = current->value()->cssText();
+-             m_lstValues->removeRef(current);
+-             setChanged();
+-	     break;
++    QMutableListIterator<CSSProperty*> lstValuesIt(*m_lstValues);
++    CSSProperty *current;
++    lstValuesIt.toBack();
++    while ( lstValuesIt.hasPrevious() ) {
++        current = lstValuesIt.previous();
++        if (current->m_id == propertyID && NonCSSHint == current->nonCSSHint) {
++            value = current->value()->cssText();
++            delete lstValuesIt.value();
++            lstValuesIt.remove();
++            setChanged();
++            break;
+         }
+      }
+ 
+@@ -339,18 +345,22 @@
+     if (!m_lstValues)
+ 	return;
+ 
+-    for (int i = (int)m_lstValues->count()-1; i >= 0; i--) {
+-	if (!m_lstValues->at(i)->nonCSSHint)
+-	    m_lstValues->remove(i);
++    QMutableListIterator<CSSProperty*> it(*m_lstValues);
++    while (it.hasNext()) {
++        if (!it.next()->nonCSSHint) {
++            delete it.value();
++            it.remove();
++        }
+     }
+ }
+ 
+ bool CSSStyleDeclarationImpl::getPropertyPriority( int propertyID ) const
+ {
+     if ( m_lstValues) {
+-	Q3PtrListIterator<CSSProperty> lstValuesIt(*m_lstValues);
++	QListIterator<CSSProperty*> lstValuesIt(*m_lstValues);
+ 	CSSProperty *current;
+-	for ( lstValuesIt.toFirst(); (current = lstValuesIt.current()); ++lstValuesIt ) {
++	while (lstValuesIt.hasNext()) {
++            current = lstValuesIt.next();
+ 	    if( propertyID == current->m_id )
+ 		return current->m_important;
+ 	}
+@@ -361,8 +371,7 @@
+ bool CSSStyleDeclarationImpl::setProperty(int id, const DOMString &value, bool important, bool nonCSSHint)
+ {
+     if(!m_lstValues) {
+-	m_lstValues = new Q3PtrList<CSSProperty>;
+-	m_lstValues->setAutoDelete(true);
++	m_lstValues = new QList<CSSProperty*>;
+     }
+ 
+     CSSParser parser( strictParsing );
+@@ -378,8 +387,7 @@
+ void CSSStyleDeclarationImpl::setProperty(int id, int value, bool important, bool nonCSSHint)
+ {
+     if(!m_lstValues) {
+-	m_lstValues = new Q3PtrList<CSSProperty>;
+-	m_lstValues->setAutoDelete(true);
++	m_lstValues = new QList<CSSProperty*>;
+     }
+     removeProperty(id, nonCSSHint );
+ 
+@@ -401,8 +409,7 @@
+ void CSSStyleDeclarationImpl::setProperty ( const DOMString &propertyString)
+ {
+     if(!m_lstValues) {
+-	m_lstValues = new Q3PtrList<CSSProperty>;
+-	m_lstValues->setAutoDelete( true );
++	m_lstValues = new QList<CSSProperty*>;
+     }
+ 
+     CSSParser parser( strictParsing );
+@@ -417,7 +424,7 @@
+ 
+ DOMString CSSStyleDeclarationImpl::item( unsigned long index ) const
+ {
+-    if(m_lstValues && index < m_lstValues->count() && m_lstValues->at(index))
++    if(m_lstValues && index < (unsigned)m_lstValues->count() && m_lstValues->at(index))
+ 	return getPropertyName(m_lstValues->at(index)->m_id);
+     return DOMString();
+ }
+@@ -433,10 +440,9 @@
+     DOMString result;
+ 
+     if ( m_lstValues) {
+-	Q3PtrListIterator<CSSProperty> lstValuesIt(*m_lstValues);
+-	CSSProperty *current;
+-	for ( lstValuesIt.toFirst(); (current = lstValuesIt.current()); ++lstValuesIt ) {
+-	    result += current->cssText();
++	QListIterator<CSSProperty*> lstValuesIt(*m_lstValues);
++	while (lstValuesIt.hasNext()) {
++	    result += lstValuesIt.next()->cssText();
+ 	}
+     }
+ 
+@@ -446,10 +452,10 @@
+ void CSSStyleDeclarationImpl::setCssText(DOM::DOMString text)
+ {
+     if (m_lstValues) {
++        qDeleteAll(*m_lstValues);
+ 	m_lstValues->clear();
+     } else {
+-	m_lstValues = new Q3PtrList<CSSProperty>;
+-	m_lstValues->setAutoDelete( true );
++	m_lstValues = new QList<CSSProperty*>;
+     }
+ 
+     CSSParser parser( strictParsing );
+@@ -491,11 +497,8 @@
+ 
+ CSSValueListImpl::~CSSValueListImpl()
+ {
+-    CSSValueImpl *val = m_values.first();
+-    while( val ) {
+-	val->deref();
+-	val = m_values.next();
+-    }
++    for (QListIterator<CSSValueImpl*> iterator(m_values); iterator.hasNext();)
++        iterator.next()->deref();
+ }
+ 
+ unsigned short CSSValueListImpl::cssValueType() const
+@@ -513,8 +516,8 @@
+ {
+     DOMString result = "";
+ 
+-    for (Q3PtrListIterator<CSSValueImpl> iterator(m_values); iterator.current(); ++iterator) {
+-	result += iterator.current()->cssText();
++    for (QListIterator<CSSValueImpl*> iterator(m_values); iterator.hasNext();) {
++	result += iterator.next()->cssText();
+     }
+ 
+     return result;
+--- a/khtml/css/cssstyleselector.h
++++ b/khtml/css/cssstyleselector.h
+@@ -23,12 +23,10 @@
+ #ifndef _CSS_cssstyleselector_h_
+ #define _CSS_cssstyleselector_h_
+ 
+-#include <Qt3Support/Q3PtrList>
+-#include <Qt3Support/Q3MemArray>
+-
+ #include "rendering/render_style.h"
+ #include "dom/dom_string.h"
+ #include "xml/dom_restyler.h"
++#include <QtCore/QVarLengthArray>
+ 
+ class KHTMLSettings;
+ class KHTMLView;
+@@ -53,7 +51,6 @@
+ {
+     class CSSStyleSelectorList;
+     class CSSOrderedRule;
+-    class CSSOrderedProperty;
+     class CSSOrderedPropertyList;
+     class RenderStyle;
+ 
+@@ -73,6 +70,46 @@
+ 	UserImportant =7
+     };
+ 
++    /*
++     * List of properties that get applied to the Element. We need to collect them first
++     * and then apply them one by one, because we have to change the apply order.
++     * Some properties depend on other one already being applied (for example all properties specifying
++     * some length need to have already the correct font size. Same applies to color
++     *
++     * While sorting them, we have to take care not to mix up the original order.
++     */
++    class CSSOrderedProperty
++    {
++    public:
++	CSSOrderedProperty(DOM::CSSProperty *_prop, uint _selector,
++			   bool first, Source source, unsigned int specificity,
++			   unsigned int _position )
++	    : prop ( _prop ), pseudoId( RenderStyle::NOPSEUDO ), selector( _selector ),
++	      position( _position )
++	{
++	    priority = (!first << 30) | (source << 24) | specificity;
++	}
++	CSSOrderedProperty(): prop( 0 ), pseudoId( RenderStyle::NOPSEUDO ), selector(0),
++	      position( 0 )
++        {
++        
++        }
++
++	bool operator < ( const CSSOrderedProperty &other ) const {
++             if (priority < other.priority) return true;
++             if (priority > other.priority) return false;
++             if (position < other.position) return true;
++             return false;
++	}
++
++	DOM::CSSProperty *prop;
++	RenderStyle::PseudoId pseudoId;
++	unsigned int selector;
++	unsigned int position;
++
++	quint32 priority;
++    };
++
+     /**
+      * this class selects a RenderStyle for a given Element based on the
+      * collection of stylesheets it contains. This is just a virtual base class
+@@ -232,7 +269,7 @@
+ 	SelectorCache *selectorCache;
+ 	unsigned int properties_size;
+ 	CSSOrderedProperty **properties;
+-	Q3MemArray<CSSOrderedProperty> inlineProps;
++	QVarLengthArray<CSSOrderedProperty> inlineProps;
+         QString m_medium;
+ 	CSSOrderedProperty **propsToApply;
+ 	CSSOrderedProperty **pseudoProps;
+@@ -259,48 +296,13 @@
+     };
+ 
+     /*
+-     * List of properties that get applied to the Element. We need to collect them first
+-     * and then apply them one by one, because we have to change the apply order.
+-     * Some properties depend on other one already being applied (for example all properties specifying
+-     * some length need to have already the correct font size. Same applies to color
+-     *
+-     * While sorting them, we have to take care not to mix up the original order.
+-     */
+-    class CSSOrderedProperty
+-    {
+-    public:
+-	CSSOrderedProperty(DOM::CSSProperty *_prop, uint _selector,
+-			   bool first, Source source, unsigned int specificity,
+-			   unsigned int _position )
+-	    : prop ( _prop ), pseudoId( RenderStyle::NOPSEUDO ), selector( _selector ),
+-	      position( _position )
+-	{
+-	    priority = (!first << 30) | (source << 24) | specificity;
+-	}
+-
+-	bool operator < ( const CSSOrderedProperty &other ) const {
+-             if (priority < other.priority) return true;
+-             if (priority > other.priority) return false;
+-             if (position < other.position) return true;
+-             return false;
+-	}
+-
+-	DOM::CSSProperty *prop;
+-	RenderStyle::PseudoId pseudoId;
+-	unsigned int selector;
+-	unsigned int position;
+-
+-	quint32 priority;
+-    };
+-
+-    /*
+      * This is the list we will collect all properties we need to apply in.
+      * It will get sorted once before applying.
+      */
+-    class CSSOrderedPropertyList : public Q3PtrList<CSSOrderedProperty>
++    class CSSOrderedPropertyList : public QList<CSSOrderedProperty*>
+     {
+     public:
+-	virtual int compareItems(Q3PtrCollection::Item i1, Q3PtrCollection::Item i2);
++	static bool compareItems(const CSSOrderedProperty* i1, const CSSOrderedProperty* i2);
+ 	void append(DOM::CSSStyleDeclarationImpl *decl, uint selector, uint specificity,
+ 		    Source regular, Source important );
+     };
+@@ -316,7 +318,7 @@
+ 	int index;
+     };
+ 
+-    class CSSStyleSelectorList : public Q3PtrList<CSSOrderedRule>
++    class CSSStyleSelectorList : public QList<CSSOrderedRule*>
+     {
+     public:
+ 	CSSStyleSelectorList();
+@@ -325,7 +327,7 @@
+ 	void append( DOM::CSSStyleSheetImpl *sheet,
+ 		     const DOM::DOMString &medium = "screen" );
+ 
+-	void collect( Q3PtrList<DOM::CSSSelector> *selectorList, CSSOrderedPropertyList *propList,
++	void collect( QList<DOM::CSSSelector*> *selectorList, CSSOrderedPropertyList *propList,
+ 		      Source regular, Source important );
+     };
+ 
+--- a/khtml/css/parser.y
++++ b/khtml/css/parser.y
+@@ -90,7 +90,7 @@
+ %union {
+     CSSRuleImpl *rule;
+     CSSSelector *selector;
+-    Q3PtrList<CSSSelector> *selectorList;
++    QList<CSSSelector*> *selectorList;
+     bool ok;
+     MediaListImpl *mediaList;
+     CSSMediaRuleImpl *mediaRule;
+@@ -131,7 +131,7 @@
+ 
+ %destructor { delete $$; $$ = 0; } expr;
+ %destructor { delete $$; $$ = 0; } maybe_media_list media_list;
+-%destructor { delete $$; $$ = 0; } selector_list;
++%destructor { if ($$) qDeleteAll(*$$); delete $$; $$ = 0; } selector_list;
+ %destructor { delete $$; $$ = 0; } ruleset_list;
+ %destructor { delete $$; $$ = 0; } specifier specifier_list simple_selector selector class attrib pseudo;
+ 
+@@ -203,7 +203,9 @@
+ 
+ %type <relation> combinator
+ 
++%type <rule> charset
+ %type <rule> ruleset
++%type <rule> ruleset_or_import
+ %type <rule> media
+ %type <rule> import
+ %type <rule> page
+@@ -264,8 +266,13 @@
+   | khtml_value maybe_space
+   ;
+ 
++ruleset_or_import:
++    ruleset |
++    import
++;
++
+ khtml_rule:
+-    KHTML_RULE_SYM '{' maybe_space ruleset maybe_space '}' {
++    KHTML_RULE_SYM '{' maybe_space ruleset_or_import maybe_space '}' {
+         CSSParser *p = static_cast<CSSParser *>(parser);
+ 	p->rule = $4;
+     }
+@@ -284,18 +291,18 @@
+ 	    p->valueList = $4;
+ #ifdef CSS_DEBUG
+ 	    kDebug( 6080 ) << "   got property for " << p->id <<
+-		(p->important?" important":"")<< endl;
++		(p->important?" important":"");
+ 	    bool ok =
+ #endif
+ 		p->parseValue( p->id, p->important );
+ #ifdef CSS_DEBUG
+ 	    if ( !ok )
+-		kDebug( 6080 ) << "     couldn't parse value!" << endl;
++		kDebug( 6080 ) << "     couldn't parse value!";
+ #endif
+ 	}
+ #ifdef CSS_DEBUG
+ 	else
+-	    kDebug( 6080 ) << "     no value found!" << endl;
++	    kDebug( 6080 ) << "     no value found!";
+ #endif
+ 	delete p->valueList;
+ 	p->valueList = 0;
+@@ -315,13 +322,26 @@
+ 
+ maybe_charset:
+    /* empty */
+- | CHARSET_SYM maybe_space STRING maybe_space ';' {
++  | charset
++ ;
++charset:
++  CHARSET_SYM maybe_space STRING maybe_space ';' {
+ #ifdef CSS_DEBUG
+-     kDebug( 6080 ) << "charset rule: " << qString($3) << endl;
++     kDebug( 6080 ) << "charset rule: " << qString($3);
+ #endif
++     CSSParser* p = static_cast<CSSParser*>(parser);
++     if ($$ && p->styleElement && p->styleElement->isCSSStyleSheet()) {
++         $$ = new CSSCharsetRuleImpl(p->styleElement, domString($3));
++         p->styleElement->append($$);
++     } else
++         $$ = 0;
++ }
++  | CHARSET_SYM error invalid_block {
++      $$ = 0;
++ }
++  | CHARSET_SYM error ';' {
++      $$ = 0;
+  }
+-  | CHARSET_SYM error invalid_block
+-  | CHARSET_SYM error ';'
+  ;
+ 
+ import_list:
+@@ -339,7 +359,7 @@
+ import:
+     IMPORT_SYM maybe_space string_or_uri maybe_space maybe_media_list ';' {
+ #ifdef CSS_DEBUG
+-	kDebug( 6080 ) << "@import: " << qString($3) << endl;
++	kDebug( 6080 ) << "@import: " << qString($3);
+ #endif
+ 	CSSParser *p = static_cast<CSSParser *>(parser);
+ 	if ( $5 && p->styleElement && p->styleElement->isCSSStyleSheet() )
+@@ -363,7 +383,7 @@
+ namespace:
+ NAMESPACE_SYM maybe_space maybe_ns_prefix string_or_uri maybe_space ';' {
+ #ifdef CSS_DEBUG
+-    kDebug( 6080 ) << "@namespace: " << qString($4) << endl;
++    kDebug( 6080 ) << "@namespace: " << qString($4);
+ #endif
+       CSSParser *p = static_cast<CSSParser *>(parser);
+     if (p->styleElement && p->styleElement->isCSSStyleSheet())
+@@ -509,7 +529,7 @@
+ ruleset:
+     selector_list declaration_block {
+ #ifdef CSS_DEBUG
+-	kDebug( 6080 ) << "got ruleset" << endl << "  selector:" << endl;
++	kDebug( 6080 ) << "got ruleset" << endl << "  selector:";
+ #endif
+ 	CSSParser *p = static_cast<CSSParser *>(parser);
+ 	if ( $1 && $2 && p->numParsedProperties ) {
+@@ -520,7 +540,9 @@
+ 	    $$ = rule;
+ 	} else {
+ 	    $$ = 0;
++	    if ($1) qDeleteAll(*$1);
+ 	    delete $1;
++	    $1 = 0;
+ 	    p->clearProperties();
+ 	}
+     }
+@@ -529,10 +551,9 @@
+ selector_list:
+     selector %prec UNIMPORTANT_TOK {
+ 	if ( $1 ) {
+-	    $$ = new Q3PtrList<CSSSelector>;
+-            $$->setAutoDelete( true );
++	    $$ = new QList<CSSSelector*>;
+ #ifdef CSS_DEBUG
+-	    kDebug( 6080 ) << "   got simple selector:" << endl;
++	    kDebug( 6080 ) << "   got simple selector:";
+ 	    $1->print();
+ #endif
+ 	    $$->append( $1 );
+@@ -547,17 +568,22 @@
+ 	    $$->append( $4 );
+ 	    khtml::CSSStyleSelector::precomputeAttributeDependencies(static_cast<CSSParser *>(parser)->document(), $4);
+ #ifdef CSS_DEBUG
+-	    kDebug( 6080 ) << "   got simple selector:" << endl;
++	    kDebug( 6080 ) << "   got simple selector:";
+ 	    $4->print();
+ #endif
+ 	} else {
++            if ($1) qDeleteAll(*$1);
+ 	    delete $1;
++	    $1=0;
++
+ 	    delete $4;
+ 	    $$ = 0;
+ 	}
+     }
+   | selector_list error {
++        if ($1) qDeleteAll(*$1);
+ 	delete $1;
++	$1 = 0;
+ 	$$ = 0;
+     }
+    ;
+@@ -874,14 +900,14 @@
+ 	    p->valueList = $4;
+ #ifdef CSS_DEBUG
+ 	    kDebug( 6080 ) << "   got property: " << $1 <<
+-		($5?" important":"")<< endl;
++		($5?" important":"");
+ #endif
+ 	        bool ok = p->parseValue( $1, $5 );
+                 if ( ok )
+ 		    $$ = ok;
+ #ifdef CSS_DEBUG
+ 	        else
+-		    kDebug( 6080 ) << "     couldn't parse value!" << endl;
++		    kDebug( 6080 ) << "     couldn't parse value!";
+ #endif
+ 	} else {
+             delete $4;
+@@ -1017,13 +1043,13 @@
+     '@' error invalid_block {
+ 	$$ = 0;
+ #ifdef CSS_DEBUG
+-	kDebug( 6080 ) << "skipped invalid @-rule" << endl;
++	kDebug( 6080 ) << "skipped invalid @-rule";
+ #endif
+     }
+   | '@' error ';' {
+ 	$$ = 0;
+ #ifdef CSS_DEBUG
+-	kDebug( 6080 ) << "skipped invalid @-rule" << endl;
++	kDebug( 6080 ) << "skipped invalid @-rule";
+ #endif
+     }
+     ;
+@@ -1032,7 +1058,7 @@
+     error invalid_block {
+ 	$$ = 0;
+ #ifdef CSS_DEBUG
+-	kDebug( 6080 ) << "skipped invalid rule" << endl;
++	kDebug( 6080 ) << "skipped invalid rule";
+ #endif
+     }
+ /*
+@@ -1042,13 +1068,13 @@
+   | error ';' {
+ 	$$ = 0;
+ #ifdef CSS_DEBUG
+-	kDebug( 6080 ) << "skipped invalid rule" << endl;
++	kDebug( 6080 ) << "skipped invalid rule";
+ #endif
+     }
+   | error '}' {
+ 	$$ = 0;
+ #ifdef CSS_DEBUG
+-	kDebug( 6080 ) << "skipped invalid rule" << endl;
++	kDebug( 6080 ) << "skipped invalid rule";
+ #endif
+     }
+ */
+--- a/khtml/css/css_base.cpp
++++ b/khtml/css/css_base.cpp
+@@ -76,16 +76,19 @@
+ }
+ 
+ void StyleBaseImpl::setParsedValue(int propId, const CSSValueImpl *parsedValue,
+-				   bool important, bool nonCSSHint, Q3PtrList<CSSProperty> *propList)
++				   bool important, bool nonCSSHint, QList<CSSProperty*> *propList)
+ {
+-    Q3PtrListIterator<CSSProperty> propIt(*propList);
+-    propIt.toLast(); // just remove the top one - not sure what should happen if we have multiple instances of the property
+-    while (propIt.current() &&
+-           ( propIt.current()->m_id != propId || propIt.current()->nonCSSHint != nonCSSHint ||
+-             propIt.current()->m_important != important) )
+-        --propIt;
+-    if (propIt.current())
+-        propList->removeRef(propIt.current());
++    QMutableListIterator<CSSProperty*> propIt(*propList);
++    propIt.toBack(); // just remove the top one - not sure what should happen if we have multiple instances of the property
++    CSSProperty* p;
++    while (propIt.hasPrevious()) {
++        p = propIt.previous();
++        if (p->m_id == propId && p->nonCSSHint == nonCSSHint && p->m_important == important ) {
++            delete propIt.value();
++            propIt.remove();
++            break;
++        }
++    }
+ 
+     CSSProperty *prop = new CSSProperty();
+     prop->m_id = propId;
+@@ -110,8 +113,10 @@
+ 
+     if(!m_lstChildren) return;
+ 
+-    for( n = m_lstChildren->first(); n != 0; n = m_lstChildren->next() )
++    QListIterator<StyleBaseImpl*> it( *m_lstChildren );
++    while ( it.hasNext() )
+     {
++        n = it.next();
+         n->setParent(0);
+         if( !n->refCount() ) delete n;
+     }
+--- a/khtml/css/css_stylesheetimpl.h
++++ b/khtml/css/css_stylesheetimpl.h
+@@ -23,8 +23,6 @@
+ #ifndef _CSS_css_stylesheetimpl_h_
+ #define _CSS_css_stylesheetimpl_h_
+ 
+-#include <Qt3Support/Q3PtrList>
+-
+ #include "dom/dom_string.h"
+ #include "css/css_base.h"
+ #include "misc/loader_client.h"
+@@ -42,7 +40,7 @@
+ class CSSParser;
+ class MediaListImpl;
+ class CSSRuleImpl;
+-class CSSRuleList;
++class CSSRuleListImpl;
+ class NodeImpl;
+ class DocumentImpl;
+ 
+@@ -94,7 +92,7 @@
+     virtual DOM::DOMString type() const { return "text/css"; }
+ 
+     CSSRuleImpl *ownerRule() const;
+-    CSSRuleList cssRules();
++    CSSRuleListImpl *cssRules(bool omitCharsetRule = false);
+     unsigned long insertRule ( const DOM::DOMString &rule, unsigned long index, int &exceptioncode );
+     void deleteRule ( unsigned long index, int &exceptioncode );
+ 
+@@ -111,6 +109,7 @@
+     void setNonCSSHints();
+ 
+     virtual void checkLoaded() const;
++    bool processed() const { return m_processed; }
+ 
+     // ### remove? (clients should use sheet->doc()->docLoader())
+     khtml::DocLoader *docLoader() const
+@@ -121,7 +120,8 @@
+ protected:
+     DocumentImpl *m_doc;
+     bool m_implicit;
+-    Q_UINT32 m_defaultNamespace;
++    mutable bool m_processed;
++    quint32 m_defaultNamespace;
+     CSSNamespace* m_namespaces;
+     DOMString m_charset;
+ };
+@@ -141,7 +141,7 @@
+     void add(StyleSheetImpl* s);
+     void remove(StyleSheetImpl* s);
+ 
+-    Q3PtrList<StyleSheetImpl> styleSheets;
++    QList<StyleSheetImpl*> styleSheets;
+ };
+ 
+ // ----------------------------------------------------------------------------
+--- a/khtml/css/parser.cpp
++++ b/khtml/css/parser.cpp
+@@ -286,7 +286,7 @@
+ {
+     CSSRuleImpl *rule;
+     CSSSelector *selector;
+-    Q3PtrList<CSSSelector> *selectorList;
++    QList<CSSSelector*> *selectorList;
+     bool ok;
+     MediaListImpl *mediaList;
+     CSSMediaRuleImpl *mediaRule;
+@@ -550,18 +550,18 @@
+ #endif
+ 
+ /* YYFINAL -- State number of the termination state.  */
+-#define YYFINAL  16
++#define YYFINAL  17
+ /* YYLAST -- Last index in YYTABLE.  */
+-#define YYLAST   479
++#define YYLAST   477
+ 
+ /* YYNTOKENS -- Number of terminals.  */
+ #define YYNTOKENS  67
+ /* YYNNTS -- Number of nonterminals.  */
+-#define YYNNTS  54
++#define YYNNTS  56
+ /* YYNRULES -- Number of rules.  */
+-#define YYNRULES  162
++#define YYNRULES  165
+ /* YYNRULES -- Number of states.  */
+-#define YYNSTATES  305
++#define YYNSTATES  308
+ 
+ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+ #define YYUNDEFTOK  2
+@@ -611,104 +611,105 @@
+    YYRHS.  */
+ static const yytype_uint16 yyprhs[] =
+ {
+-       0,     0,     3,     9,    12,    15,    18,    25,    28,    34,
+-      35,    38,    39,    42,    45,    46,    52,    56,    60,    61,
+-      65,    72,    76,    80,    81,    85,    92,    96,   100,   101,
+-     104,   105,   109,   111,   113,   115,   117,   119,   121,   124,
+-     126,   128,   129,   131,   133,   138,   141,   149,   150,   154,
+-     157,   161,   165,   169,   173,   176,   179,   182,   183,   185,
+-     187,   190,   192,   197,   200,   202,   206,   209,   211,   214,
+-     217,   220,   224,   227,   231,   236,   240,   242,   244,   246,
+-     249,   252,   254,   256,   258,   260,   263,   266,   271,   280,
+-     286,   296,   298,   300,   302,   304,   306,   308,   310,   312,
+-     315,   319,   324,   329,   334,   339,   345,   350,   355,   360,
+-     366,   372,   376,   380,   385,   390,   396,   399,   402,   405,
+-     406,   408,   412,   415,   418,   419,   421,   424,   427,   430,
+-     433,   436,   439,   441,   443,   446,   449,   452,   455,   458,
+-     461,   464,   467,   470,   473,   476,   479,   482,   485,   488,
+-     491,   494,   497,   500,   506,   510,   513,   517,   521,   524,
+-     530,   534,   536
++       0,     0,     3,     9,    12,    15,    18,    20,    22,    29,
++      32,    38,    39,    42,    43,    46,    49,    50,    52,    58,
++      62,    66,    67,    71,    78,    82,    86,    87,    91,    98,
++     102,   106,   107,   110,   111,   115,   117,   119,   121,   123,
++     125,   127,   130,   132,   134,   135,   137,   139,   144,   147,
++     155,   156,   160,   163,   167,   171,   175,   179,   182,   185,
++     188,   189,   191,   193,   196,   198,   203,   206,   208,   212,
++     215,   217,   220,   223,   226,   230,   233,   237,   242,   246,
++     248,   250,   252,   255,   258,   260,   262,   264,   266,   269,
++     272,   277,   286,   292,   302,   304,   306,   308,   310,   312,
++     314,   316,   318,   321,   325,   330,   335,   340,   345,   351,
++     356,   361,   366,   372,   378,   382,   386,   391,   396,   402,
++     405,   408,   411,   412,   414,   418,   421,   424,   425,   427,
++     430,   433,   436,   439,   442,   445,   447,   449,   452,   455,
++     458,   461,   464,   467,   470,   473,   476,   479,   482,   485,
++     488,   491,   494,   497,   500,   503,   506,   512,   516,   519,
++     523,   527,   530,   536,   540,   542
+ };
+ 
+ /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+ static const yytype_int8 yyrhs[] =
+ {
+-      68,     0,    -1,    74,    73,    75,    77,    80,    -1,    69,
+-      72,    -1,    70,    72,    -1,    71,    72,    -1,    26,    54,
+-      72,    92,    72,    55,    -1,    27,   106,    -1,    28,    54,
+-      72,   111,    55,    -1,    -1,    72,     4,    -1,    -1,    73,
+-       5,    -1,    73,     4,    -1,    -1,    24,    72,    11,    72,
+-      56,    -1,    24,     1,   119,    -1,    24,     1,    56,    -1,
+-      -1,    75,    76,    73,    -1,    20,    72,    82,    72,    83,
+-      56,    -1,    20,     1,   119,    -1,    20,     1,    56,    -1,
+-      -1,    77,    78,    73,    -1,    25,    72,    79,    82,    72,
+-      56,    -1,    25,     1,   119,    -1,    25,     1,    56,    -1,
+-      -1,    12,     4,    -1,    -1,    80,    81,    73,    -1,    92,
+-      -1,    85,    -1,    88,    -1,    89,    -1,   118,    -1,   117,
+-      -1,    76,     1,    -1,    11,    -1,    50,    -1,    -1,    84,
+-      -1,    87,    -1,    84,    57,    72,    87,    -1,    84,     1,
+-      -1,    22,    72,    84,    54,    72,    86,    55,    -1,    -1,
+-      86,    92,    72,    -1,    12,    72,    -1,    21,     1,   119,
+-      -1,    21,     1,    56,    -1,    23,     1,   119,    -1,    23,
+-       1,    56,    -1,    58,    72,    -1,    59,    72,    -1,    60,
+-      72,    -1,    -1,    61,    -1,    58,    -1,    93,   106,    -1,
+-      94,    -1,    93,    57,    72,    94,    -1,    93,     1,    -1,
+-      96,    -1,    94,    90,    96,    -1,    94,     1,    -1,    19,
+-      -1,    18,    19,    -1,    12,    19,    -1,    97,    72,    -1,
+-      97,    98,    72,    -1,    98,    72,    -1,    95,    97,    72,
+-      -1,    95,    97,    98,    72,    -1,    95,    98,    72,    -1,
+-      12,    -1,    18,    -1,    99,    -1,    98,    99,    -1,    98,
+-       1,    -1,    14,    -1,   100,    -1,   102,    -1,   105,    -1,
+-      16,    12,    -1,    12,    72,    -1,    17,    72,   101,    62,
+-      -1,    17,    72,   101,   103,    72,   104,    72,    62,    -1,
+-      17,    72,    95,   101,    62,    -1,    17,    72,    95,   101,
+-     103,    72,   104,    72,    62,    -1,    63,    -1,     6,    -1,
+-       7,    -1,     8,    -1,     9,    -1,    10,    -1,    12,    -1,
+-      11,    -1,    15,    12,    -1,    15,    15,    12,    -1,    15,
+-      51,    13,    64,    -1,    15,    51,    49,    64,    -1,    15,
+-      51,    12,    64,    -1,    15,    51,    11,    64,    -1,    15,
+-      52,    72,    96,    64,    -1,    54,    72,   108,    55,    -1,
+-      54,    72,     1,    55,    -1,    54,    72,   107,    55,    -1,
+-      54,    72,   107,   108,    55,    -1,    54,    72,   107,     1,
+-      55,    -1,   108,    56,    72,    -1,     1,    56,    72,    -1,
+-     107,   108,    56,    72,    -1,   107,     1,    56,    72,    -1,
+-     109,    15,    72,   111,   110,    -1,     1,   119,    -1,    12,
+-      72,    -1,    29,    72,    -1,    -1,   113,    -1,   111,   112,
+-     113,    -1,    65,    72,    -1,    57,    72,    -1,    -1,   114,
+-      -1,    91,   114,    -1,    46,    72,    -1,    11,    72,    -1,
+-      12,    72,    -1,    50,    72,    -1,    53,    72,    -1,   116,
+-      -1,   115,    -1,    49,    72,    -1,    48,    72,    -1,    47,
+-      72,    -1,    33,    72,    -1,    34,    72,    -1,    35,    72,
+-      -1,    36,    72,    -1,    37,    72,    -1,    38,    72,    -1,
+-      39,    72,    -1,    40,    72,    -1,    41,    72,    -1,    42,
+-      72,    -1,    43,    72,    -1,    44,    72,    -1,    45,    72,
+-      -1,    31,    72,    -1,    30,    72,    -1,    32,    72,    -1,
+-      51,    72,   111,    64,    72,    -1,    51,    72,     1,    -1,
+-      14,    72,    -1,    66,     1,   119,    -1,    66,     1,    56,
+-      -1,     1,   119,    -1,    54,     1,   120,     1,    55,    -1,
+-      54,     1,    55,    -1,   119,    -1,   120,     1,   119,    -1
++      68,     0,    -1,    75,    74,    77,    79,    82,    -1,    70,
++      73,    -1,    71,    73,    -1,    72,    73,    -1,    94,    -1,
++      78,    -1,    26,    54,    73,    69,    73,    55,    -1,    27,
++     108,    -1,    28,    54,    73,   113,    55,    -1,    -1,    73,
++       4,    -1,    -1,    74,     5,    -1,    74,     4,    -1,    -1,
++      76,    -1,    24,    73,    11,    73,    56,    -1,    24,     1,
++     121,    -1,    24,     1,    56,    -1,    -1,    77,    78,    74,
++      -1,    20,    73,    84,    73,    85,    56,    -1,    20,     1,
++     121,    -1,    20,     1,    56,    -1,    -1,    79,    80,    74,
++      -1,    25,    73,    81,    84,    73,    56,    -1,    25,     1,
++     121,    -1,    25,     1,    56,    -1,    -1,    12,     4,    -1,
++      -1,    82,    83,    74,    -1,    94,    -1,    87,    -1,    90,
++      -1,    91,    -1,   120,    -1,   119,    -1,    78,     1,    -1,
++      11,    -1,    50,    -1,    -1,    86,    -1,    89,    -1,    86,
++      57,    73,    89,    -1,    86,     1,    -1,    22,    73,    86,
++      54,    73,    88,    55,    -1,    -1,    88,    94,    73,    -1,
++      12,    73,    -1,    21,     1,   121,    -1,    21,     1,    56,
++      -1,    23,     1,   121,    -1,    23,     1,    56,    -1,    58,
++      73,    -1,    59,    73,    -1,    60,    73,    -1,    -1,    61,
++      -1,    58,    -1,    95,   108,    -1,    96,    -1,    95,    57,
++      73,    96,    -1,    95,     1,    -1,    98,    -1,    96,    92,
++      98,    -1,    96,     1,    -1,    19,    -1,    18,    19,    -1,
++      12,    19,    -1,    99,    73,    -1,    99,   100,    73,    -1,
++     100,    73,    -1,    97,    99,    73,    -1,    97,    99,   100,
++      73,    -1,    97,   100,    73,    -1,    12,    -1,    18,    -1,
++     101,    -1,   100,   101,    -1,   100,     1,    -1,    14,    -1,
++     102,    -1,   104,    -1,   107,    -1,    16,    12,    -1,    12,
++      73,    -1,    17,    73,   103,    62,    -1,    17,    73,   103,
++     105,    73,   106,    73,    62,    -1,    17,    73,    97,   103,
++      62,    -1,    17,    73,    97,   103,   105,    73,   106,    73,
++      62,    -1,    63,    -1,     6,    -1,     7,    -1,     8,    -1,
++       9,    -1,    10,    -1,    12,    -1,    11,    -1,    15,    12,
++      -1,    15,    15,    12,    -1,    15,    51,    13,    64,    -1,
++      15,    51,    49,    64,    -1,    15,    51,    12,    64,    -1,
++      15,    51,    11,    64,    -1,    15,    52,    73,    98,    64,
++      -1,    54,    73,   110,    55,    -1,    54,    73,     1,    55,
++      -1,    54,    73,   109,    55,    -1,    54,    73,   109,   110,
++      55,    -1,    54,    73,   109,     1,    55,    -1,   110,    56,
++      73,    -1,     1,    56,    73,    -1,   109,   110,    56,    73,
++      -1,   109,     1,    56,    73,    -1,   111,    15,    73,   113,
++     112,    -1,     1,   121,    -1,    12,    73,    -1,    29,    73,
++      -1,    -1,   115,    -1,   113,   114,   115,    -1,    65,    73,
++      -1,    57,    73,    -1,    -1,   116,    -1,    93,   116,    -1,
++      46,    73,    -1,    11,    73,    -1,    12,    73,    -1,    50,
++      73,    -1,    53,    73,    -1,   118,    -1,   117,    -1,    49,
++      73,    -1,    48,    73,    -1,    47,    73,    -1,    33,    73,
++      -1,    34,    73,    -1,    35,    73,    -1,    36,    73,    -1,
++      37,    73,    -1,    38,    73,    -1,    39,    73,    -1,    40,
++      73,    -1,    41,    73,    -1,    42,    73,    -1,    43,    73,
++      -1,    44,    73,    -1,    45,    73,    -1,    31,    73,    -1,
++      30,    73,    -1,    32,    73,    -1,    51,    73,   113,    64,
++      73,    -1,    51,    73,     1,    -1,    14,    73,    -1,    66,
++       1,   121,    -1,    66,     1,    56,    -1,     1,   121,    -1,
++      54,     1,   122,     1,    55,    -1,    54,     1,    55,    -1,
++     121,    -1,   122,     1,   121,    -1
+ };
+ 
+ /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+ static const yytype_uint16 yyrline[] =
+ {
+-       0,   263,   263,   264,   265,   266,   270,   277,   283,   308,
+-     309,   312,   314,   315,   318,   320,   325,   326,   329,   331,
+-     342,   352,   355,   361,   362,   366,   374,   375,   379,   380,
+-     383,   385,   396,   397,   398,   399,   400,   401,   402,   406,
+-     407,   411,   414,   419,   423,   428,   435,   449,   450,   460,
+-     482,   485,   491,   494,   500,   501,   502,   503,   507,   508,
+-     512,   532,   546,   561,   568,   571,   585,   592,   593,   594,
+-     598,   602,   607,   612,   619,   628,   640,   656,   662,   666,
+-     676,   683,   689,   690,   691,   695,   704,   728,   733,   739,
+-     747,   759,   762,   765,   768,   771,   774,   780,   781,   785,
+-     791,   797,   804,   811,   818,   825,   834,   837,   840,   843,
+-     848,   854,   858,   861,   866,   872,   894,   900,   907,   908,
+-     912,   916,   932,   935,   938,   944,   945,   947,   948,   949,
+-     955,   956,   957,   959,   965,   966,   967,   968,   969,   970,
+-     971,   972,   973,   974,   975,   976,   977,   978,   979,   980,
+-     981,   982,   983,   988,   996,  1012,  1019,  1025,  1034,  1060,
+-    1061,  1065,  1066
++       0,   263,   263,   264,   265,   266,   270,   271,   275,   282,
++     288,   313,   314,   317,   319,   320,   323,   325,   328,   339,
++     342,   347,   349,   360,   370,   373,   379,   380,   384,   392,
++     393,   397,   398,   401,   403,   414,   415,   416,   417,   418,
++     419,   420,   424,   425,   429,   432,   437,   441,   446,   453,
++     467,   468,   478,   500,   503,   509,   512,   518,   519,   520,
++     521,   525,   526,   530,   552,   565,   583,   592,   595,   609,
++     616,   617,   618,   622,   626,   631,   636,   643,   652,   664,
++     680,   686,   690,   700,   707,   713,   714,   715,   719,   728,
++     752,   757,   763,   771,   783,   786,   789,   792,   795,   798,
++     804,   805,   809,   815,   821,   828,   835,   842,   849,   858,
++     861,   864,   867,   872,   878,   882,   885,   890,   896,   918,
++     924,   931,   932,   936,   940,   956,   959,   962,   968,   969,
++     971,   972,   973,   979,   980,   981,   983,   989,   990,   991,
++     992,   993,   994,   995,   996,   997,   998,   999,  1000,  1001,
++    1002,  1003,  1004,  1005,  1006,  1007,  1012,  1020,  1036,  1043,
++    1049,  1058,  1084,  1085,  1089,  1090
+ };
+ #endif
+ 
+@@ -726,10 +727,10 @@
+   "RADS", "GRADS", "MSECS", "SECS", "HERZ", "KHERZ", "DIMEN", "PERCENTAGE",
+   "FLOAT", "INTEGER", "URI", "FUNCTION", "NOTFUNCTION", "UNICODERANGE",
+   "'{'", "'}'", "';'", "','", "'+'", "'~'", "'>'", "'-'", "']'", "'='",
+-  "')'", "'/'", "'@'", "$accept", "stylesheet", "khtml_rule",
+-  "khtml_decls", "khtml_value", "maybe_space", "maybe_sgml",
+-  "maybe_charset", "import_list", "import", "namespace_list", "namespace",
+-  "maybe_ns_prefix", "rule_list", "rule", "string_or_uri",
++  "')'", "'/'", "'@'", "$accept", "stylesheet", "ruleset_or_import",
++  "khtml_rule", "khtml_decls", "khtml_value", "maybe_space", "maybe_sgml",
++  "maybe_charset", "charset", "import_list", "import", "namespace_list",
++  "namespace", "maybe_ns_prefix", "rule_list", "rule", "string_or_uri",
+   "maybe_media_list", "media_list", "media", "ruleset_list", "medium",
+   "page", "font_face", "combinator", "unary_operator", "ruleset",
+   "selector_list", "selector", "namespace_selector", "simple_selector",
+@@ -759,45 +760,45 @@
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+ static const yytype_uint8 yyr1[] =
+ {
+-       0,    67,    68,    68,    68,    68,    69,    70,    71,    72,
+-      72,    73,    73,    73,    74,    74,    74,    74,    75,    75,
+-      76,    76,    76,    77,    77,    78,    78,    78,    79,    79,
+-      80,    80,    81,    81,    81,    81,    81,    81,    81,    82,
+-      82,    83,    83,    84,    84,    84,    85,    86,    86,    87,
+-      88,    88,    89,    89,    90,    90,    90,    90,    91,    91,
+-      92,    93,    93,    93,    94,    94,    94,    95,    95,    95,
+-      96,    96,    96,    96,    96,    96,    97,    97,    98,    98,
+-      98,    99,    99,    99,    99,   100,   101,   102,   102,   102,
+-     102,   103,   103,   103,   103,   103,   103,   104,   104,   105,
+-     105,   105,   105,   105,   105,   105,   106,   106,   106,   106,
+-     106,   107,   107,   107,   107,   108,   108,   109,   110,   110,
+-     111,   111,   112,   112,   112,   113,   113,   113,   113,   113,
+-     113,   113,   113,   113,   114,   114,   114,   114,   114,   114,
+-     114,   114,   114,   114,   114,   114,   114,   114,   114,   114,
+-     114,   114,   114,   115,   115,   116,   117,   117,   118,   119,
+-     119,   120,   120
++       0,    67,    68,    68,    68,    68,    69,    69,    70,    71,
++      72,    73,    73,    74,    74,    74,    75,    75,    76,    76,
++      76,    77,    77,    78,    78,    78,    79,    79,    80,    80,
++      80,    81,    81,    82,    82,    83,    83,    83,    83,    83,
++      83,    83,    84,    84,    85,    85,    86,    86,    86,    87,
++      88,    88,    89,    90,    90,    91,    91,    92,    92,    92,
++      92,    93,    93,    94,    95,    95,    95,    96,    96,    96,
++      97,    97,    97,    98,    98,    98,    98,    98,    98,    99,
++      99,   100,   100,   100,   101,   101,   101,   101,   102,   103,
++     104,   104,   104,   104,   105,   105,   105,   105,   105,   105,
++     106,   106,   107,   107,   107,   107,   107,   107,   107,   108,
++     108,   108,   108,   108,   109,   109,   109,   109,   110,   110,
++     111,   112,   112,   113,   113,   114,   114,   114,   115,   115,
++     115,   115,   115,   115,   115,   115,   115,   116,   116,   116,
++     116,   116,   116,   116,   116,   116,   116,   116,   116,   116,
++     116,   116,   116,   116,   116,   116,   117,   117,   118,   119,
++     119,   120,   121,   121,   122,   122
+ };
+ 
+ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+ static const yytype_uint8 yyr2[] =
+ {
+-       0,     2,     5,     2,     2,     2,     6,     2,     5,     0,
+-       2,     0,     2,     2,     0,     5,     3,     3,     0,     3,
+-       6,     3,     3,     0,     3,     6,     3,     3,     0,     2,
+-       0,     3,     1,     1,     1,     1,     1,     1,     2,     1,
+-       1,     0,     1,     1,     4,     2,     7,     0,     3,     2,
+-       3,     3,     3,     3,     2,     2,     2,     0,     1,     1,
+-       2,     1,     4,     2,     1,     3,     2,     1,     2,     2,
+-       2,     3,     2,     3,     4,     3,     1,     1,     1,     2,
+-       2,     1,     1,     1,     1,     2,     2,     4,     8,     5,
+-       9,     1,     1,     1,     1,     1,     1,     1,     1,     2,
+-       3,     4,     4,     4,     4,     5,     4,     4,     4,     5,
+-       5,     3,     3,     4,     4,     5,     2,     2,     2,     0,
+-       1,     3,     2,     2,     0,     1,     2,     2,     2,     2,
+-       2,     2,     1,     1,     2,     2,     2,     2,     2,     2,
++       0,     2,     5,     2,     2,     2,     1,     1,     6,     2,
++       5,     0,     2,     0,     2,     2,     0,     1,     5,     3,
++       3,     0,     3,     6,     3,     3,     0,     3,     6,     3,
++       3,     0,     2,     0,     3,     1,     1,     1,     1,     1,
++       1,     2,     1,     1,     0,     1,     1,     4,     2,     7,
++       0,     3,     2,     3,     3,     3,     3,     2,     2,     2,
++       0,     1,     1,     2,     1,     4,     2,     1,     3,     2,
++       1,     2,     2,     2,     3,     2,     3,     4,     3,     1,
++       1,     1,     2,     2,     1,     1,     1,     1,     2,     2,
++       4,     8,     5,     9,     1,     1,     1,     1,     1,     1,
++       1,     1,     2,     3,     4,     4,     4,     4,     5,     4,
++       4,     4,     5,     5,     3,     3,     4,     4,     5,     2,
++       2,     2,     0,     1,     3,     2,     2,     0,     1,     2,
++       2,     2,     2,     2,     2,     1,     1,     2,     2,     2,
+        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+-       2,     2,     2,     5,     3,     2,     3,     3,     2,     5,
+-       3,     1,     3
++       2,     2,     2,     2,     2,     2,     5,     3,     2,     3,
++       3,     2,     5,     3,     1,     3
+ };
+ 
+ /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+@@ -805,243 +806,243 @@
+    means the default is an error.  */
+ static const yytype_uint8 yydefact[] =
+ {
+-      14,     0,     0,     0,     0,     0,     9,     9,     9,    11,
+-       0,     0,     9,     9,     7,     9,     1,     3,     4,     5,
+-      18,     0,    17,    16,    10,     9,     0,     0,     0,    13,
+-      12,    23,     0,     0,    76,    81,     0,     0,     9,    77,
+-      67,     9,     0,     0,     0,    64,     9,     0,    78,    82,
+-      83,    84,     0,     9,     0,     0,     0,     9,     9,     9,
+-       9,     9,     9,     9,     9,     9,     9,     9,     9,     9,
+-       9,     9,     9,     9,     9,     9,     9,     9,     9,     9,
+-       9,     9,     9,    59,    58,     0,   124,   120,   125,   133,
+-     132,     0,    11,    30,   160,   161,     0,    15,    69,    99,
+-       0,     0,     9,    85,     0,    68,     0,    63,     9,    60,
+-      66,     9,     9,     9,     0,    76,    77,     9,     0,    70,
+-       0,    80,    72,    79,   107,     9,   116,   117,     0,   108,
+-       0,   106,     9,     9,   128,   129,   155,   151,   150,   152,
+-     137,   138,   139,   140,   141,   142,   143,   144,   145,   146,
+-     147,   148,   149,   127,   136,   135,   134,   130,     0,   131,
+-     126,     8,     9,     9,     0,     0,     0,    19,     0,    11,
+-       0,     0,   100,     0,     0,     0,     0,     0,     9,     0,
+-       0,     0,     6,     0,    54,    55,    56,    65,    73,     0,
+-      75,    71,   112,   110,     9,   109,     9,   111,     0,   154,
+-     124,   123,   122,   121,    22,    21,    39,    40,     9,     0,
+-      28,    24,     0,     0,     9,     0,     0,     0,    11,    33,
+-      34,    35,    32,    37,    36,   159,   162,   104,   103,   101,
+-     102,     0,    86,     9,     0,    92,    93,    94,    95,    96,
+-      87,    91,     9,     0,    74,   114,   113,   124,     9,    41,
+-      27,    26,     0,     0,   158,     0,     0,     0,     0,    38,
+-      31,   105,    89,     9,     0,     9,   115,   153,     9,     0,
+-       0,    43,    29,     9,    51,    50,     0,    53,    52,   157,
+-     156,     0,    98,    97,     9,   118,    49,    20,    45,     9,
+-       0,     9,     9,     0,     0,    25,    47,     0,    88,    44,
+-       0,    90,    46,     9,    48
++      16,     0,     0,     0,     0,     0,    11,    11,    11,    13,
++      17,     0,     0,    11,    11,     9,    11,     1,     3,     4,
++       5,    21,     0,    20,    19,    12,    11,     0,     0,     0,
++      15,    14,    26,     0,     0,    79,    84,     0,     0,    11,
++      80,    70,     0,    11,     7,     6,     0,     0,     0,    67,
++      11,     0,    81,    85,    86,    87,     0,    11,     0,     0,
++       0,    11,    11,    11,    11,    11,    11,    11,    11,    11,
++      11,    11,    11,    11,    11,    11,    11,    11,    11,    11,
++      11,    11,    11,    11,    11,    11,    11,    62,    61,     0,
++     127,   123,   128,   136,   135,    13,    33,   163,   164,     0,
++      18,    72,   102,     0,     0,    11,    88,     0,    71,     0,
++       0,     0,    66,    11,    63,    69,    11,    11,    11,     0,
++      79,    80,    11,     0,    73,     0,    83,    75,    82,   110,
++      11,   119,   120,     0,   111,     0,   109,    11,    11,   131,
++     132,   158,   154,   153,   155,   140,   141,   142,   143,   144,
++     145,   146,   147,   148,   149,   150,   151,   152,   130,   139,
++     138,   137,   133,     0,   134,   129,    10,    11,    11,     0,
++      22,     0,    13,     0,     0,   103,     0,     0,     0,     0,
++       0,    11,     0,     0,     0,    25,    24,    42,    43,    11,
++       8,     0,    57,    58,    59,    68,    76,     0,    78,    74,
++     115,   113,    11,   112,    11,   114,     0,   157,   127,   126,
++     125,   124,     0,    31,    27,     0,     0,    11,     0,     0,
++       0,    13,    36,    37,    38,    35,    40,    39,   162,   165,
++     107,   106,   104,   105,     0,    89,    11,     0,    95,    96,
++      97,    98,    99,    90,    94,    11,    44,     0,    77,   117,
++     116,   127,    11,    30,    29,     0,     0,   161,     0,     0,
++       0,     0,    41,    34,   108,    92,    11,     0,    11,     0,
++       0,    46,    11,   118,   156,    32,    11,    54,    53,     0,
++      56,    55,   160,   159,     0,   101,   100,    11,    52,    23,
++      48,    11,   121,     0,    11,    11,     0,     0,    28,    50,
++       0,    91,    47,     0,    93,    49,    11,    51
+ };
+ 
+ /* YYDEFGOTO[NTERM-NUM].  */
+ static const yytype_int16 yydefgoto[] =
+ {
+-      -1,     5,     6,     7,     8,   232,    20,     9,    31,    92,
+-      93,   169,   253,   170,   218,   208,   269,   270,   219,   300,
+-     271,   220,   221,   114,    85,    41,    42,    43,    44,    45,
+-      46,    47,    48,    49,   181,    50,   242,   284,    51,    14,
+-      54,    55,    56,   266,    86,   164,    87,    88,    89,    90,
+-     223,   224,   126,    96
++      -1,     5,    43,     6,     7,     8,   235,    21,     9,    10,
++      32,    44,    96,   172,   256,   173,   221,   189,   269,   270,
++     222,   303,   271,   223,   224,   119,    89,    45,    46,    47,
++      48,    49,    50,    51,    52,    53,   184,    54,   245,   287,
++      55,    15,    58,    59,    60,   273,    90,   169,    91,    92,
++      93,    94,   226,   227,   131,    99
+ };
+ 
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+    STATE-NUM.  */
+-#define YYPACT_NINF -167
++#define YYPACT_NINF -172
+ static const yytype_int16 yypact[] =
+ {
+-     252,    19,   -46,   -32,   -20,    44,  -167,  -167,  -167,  -167,
+-     147,   183,  -167,  -167,  -167,  -167,  -167,    96,    96,    96,
+-      34,   114,  -167,  -167,  -167,  -167,   333,   156,   355,  -167,
+-    -167,    85,    98,    -2,    99,  -167,   158,   109,  -167,   152,
+-    -167,  -167,    52,   241,   222,  -167,   229,   162,  -167,  -167,
+-    -167,  -167,   215,  -167,   101,   168,   118,  -167,  -167,  -167,
+-    -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,
+-    -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,
+-    -167,  -167,  -167,  -167,  -167,   430,   127,  -167,  -167,  -167,
+-    -167,   119,  -167,   160,  -167,  -167,   189,  -167,  -167,  -167,
+-     202,   116,  -167,  -167,    14,  -167,   104,  -167,  -167,  -167,
+-    -167,  -167,  -167,  -167,   346,  -167,  -167,   229,   162,    96,
+-     162,  -167,    96,  -167,  -167,  -167,  -167,    96,   238,  -167,
+-     210,  -167,  -167,  -167,    96,    96,    96,    96,    96,    96,
+-      96,    96,    96,    96,    96,    96,    96,    96,    96,    96,
+-      96,    96,    96,    96,    96,    96,    96,    96,   273,    96,
+-    -167,  -167,  -167,  -167,   398,   150,     5,    34,   185,  -167,
+-     125,   157,  -167,   154,   169,   217,   218,   333,    99,   152,
+-     237,    41,  -167,   333,    96,    96,    96,  -167,    96,   162,
+-      96,    96,    96,  -167,  -167,  -167,  -167,    96,   355,  -167,
+-     -36,    96,    96,  -167,  -167,  -167,  -167,  -167,  -167,   161,
+-     110,    34,   232,   288,  -167,   295,   296,   326,  -167,  -167,
+-    -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,
+-    -167,   264,    96,  -167,    87,  -167,  -167,  -167,  -167,  -167,
+-    -167,  -167,  -167,   324,    96,    96,    96,   143,  -167,   171,
+-    -167,  -167,   325,    88,  -167,   198,   171,   207,   219,  -167,
+-      34,  -167,  -167,  -167,    31,  -167,  -167,    96,  -167,   274,
+-      35,  -167,  -167,  -167,  -167,  -167,    97,  -167,  -167,  -167,
+-    -167,    31,  -167,  -167,  -167,    96,    96,  -167,  -167,  -167,
+-      79,  -167,  -167,    23,   171,  -167,    96,    27,  -167,  -167,
+-     213,  -167,  -167,  -167,    96
++     235,    18,   -44,   -27,    59,    23,  -172,  -172,  -172,  -172,
++    -172,   135,     0,  -172,  -172,  -172,  -172,  -172,   119,   119,
++     119,    32,   134,  -172,  -172,  -172,  -172,   340,    20,   335,
++    -172,  -172,   121,    47,    53,   127,  -172,   195,   156,  -172,
++     173,  -172,   189,  -172,  -172,  -172,    38,   168,   459,  -172,
++     317,   160,  -172,  -172,  -172,  -172,   186,  -172,   102,   103,
++     180,  -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,
++    -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,
++    -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,   413,
++      63,  -172,  -172,  -172,  -172,  -172,   177,  -172,  -172,   197,
++    -172,  -172,  -172,   203,   114,  -172,  -172,    16,  -172,   152,
++      94,   126,  -172,  -172,  -172,  -172,  -172,  -172,  -172,   451,
++    -172,  -172,   317,   160,   119,   160,  -172,   119,  -172,  -172,
++    -172,  -172,   119,   194,  -172,   213,  -172,  -172,  -172,   119,
++     119,   119,   119,   119,   119,   119,   119,   119,   119,   119,
++     119,   119,   119,   119,   119,   119,   119,   119,   119,   119,
++     119,   119,   119,   277,   119,  -172,  -172,  -172,  -172,   378,
++      32,   193,  -172,   133,   219,  -172,   181,   192,   196,   206,
++     383,   127,   173,   241,    37,  -172,  -172,  -172,  -172,  -172,
++    -172,   383,   119,   119,   119,  -172,   119,   160,   119,   119,
++     119,  -172,  -172,  -172,  -172,   119,   335,  -172,    74,   119,
++     119,  -172,   157,   107,    32,   222,   276,  -172,   278,   279,
++     281,  -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,  -172,
++    -172,  -172,  -172,  -172,   221,   119,  -172,    45,  -172,  -172,
++    -172,  -172,  -172,  -172,  -172,  -172,   161,   283,   119,   119,
++     119,   377,  -172,  -172,  -172,   288,    -2,  -172,   167,   161,
++     198,   210,  -172,    32,  -172,  -172,  -172,   226,  -172,   227,
++       2,  -172,  -172,  -172,   119,  -172,  -172,  -172,  -172,    39,
++    -172,  -172,  -172,  -172,   226,  -172,  -172,  -172,   119,  -172,
++    -172,  -172,   119,   106,  -172,  -172,    27,   161,  -172,   119,
++      29,  -172,  -172,   217,  -172,  -172,  -172,   119
+ };
+ 
+ /* YYPGOTO[NTERM-NUM].  */
+ static const yytype_int16 yypgoto[] =
+ {
+-    -167,  -167,  -167,  -167,  -167,    -1,   -82,  -167,  -167,   163,
+-    -167,  -167,  -167,  -167,  -167,    82,  -167,    76,  -167,  -167,
+-      50,  -167,  -167,  -167,  -167,  -166,  -167,   170,   242,   -95,
+-     310,   -29,   -34,  -167,   175,  -167,   122,    89,  -167,   315,
+-    -167,   314,  -167,  -167,  -157,  -167,   208,   286,  -167,  -167,
+-    -167,  -167,    -7,  -167
++    -172,  -172,  -172,  -172,  -172,  -172,    -1,   -78,  -172,  -172,
++    -172,   -31,  -172,  -172,  -172,  -172,  -172,    31,  -172,    44,
++    -172,  -172,     7,  -172,  -172,  -172,  -172,  -171,  -172,   105,
++     199,   -93,   297,   -32,   -37,  -172,   146,  -172,    99,    64,
++    -172,   304,  -172,   293,  -172,  -172,   -66,  -172,   184,   272,
++    -172,  -172,  -172,  -172,    -3,  -172
+ };
+ 
+ /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+    positive, shift that token.  If negative, reduce the rule which
+    number is the opposite.  If zero, do what YYDEFACT says.
+    If YYTABLE_NINF, syntax error.  */
+-#define YYTABLE_NINF -120
++#define YYTABLE_NINF -123
+ static const yytype_int16 yytable[] =
+ {
+-      11,   200,    24,    23,   222,    17,    18,    19,    12,    24,
+-     167,    26,    27,   123,    28,   118,   206,   120,    24,   187,
+-      10,   162,    13,    -9,    33,    95,   178,    24,   248,   163,
+-      -9,    24,   179,    40,    15,    24,   288,   104,    29,    30,
+-     106,   247,   282,   283,    16,   119,   122,   235,   236,   237,
+-     238,   239,   127,   107,    97,   207,   134,   135,   136,   137,
+-     138,   139,   140,   141,   142,   143,   144,   145,   146,   147,
+-     148,   149,   150,   151,   152,   153,   154,   155,   156,   157,
+-     158,   159,   231,    24,   123,   298,   123,   211,   189,   301,
+-     166,   -42,   289,   235,   236,   237,   238,   239,   288,   206,
+-      24,   177,   128,   240,   241,    91,    13,   183,    24,   108,
+-     184,   185,   186,    53,    24,    32,   188,   190,    98,   191,
+-     165,   103,   252,    -9,   192,    -2,   212,   173,   174,   175,
+-      -9,   197,   198,   133,   303,   295,   260,    34,   207,    35,
+-      36,    37,    38,    39,    40,    91,   213,   214,   215,   262,
+-     241,   291,    21,    94,   289,   123,   129,    52,   205,   182,
+-      24,   201,   202,   121,   226,   176,    -9,   210,    53,    -9,
+-      99,   105,   265,   100,    -9,    24,    35,    36,    37,    38,
+-      -9,    -9,   161,   268,   162,   168,   209,    24,   244,    -9,
+-     171,   216,   163,   245,    25,   246,    -9,    -9,  -119,  -119,
+-     162,    21,   251,    22,    21,   254,   204,   249,   163,   101,
+-     102,    21,   225,   256,   172,    21,    -9,   250,   227,    -9,
+-      -9,    -9,    -9,   131,   132,    34,    -9,    35,    36,    37,
+-      38,    39,    40,   228,   115,    -9,    35,    36,    37,    38,
+-     116,   264,   110,    35,    36,    37,    38,   267,   275,   233,
+-     278,   280,    21,   -57,   274,   -57,   -57,   -57,   -57,   -57,
+-     -57,    21,   281,   277,   285,   195,   196,   286,   302,    21,
+-     124,   125,   290,    21,   199,   279,     1,    24,     2,     3,
+-       4,   229,   230,   293,    57,    58,    21,    59,   294,   255,
+-     296,   297,    21,   193,   194,   -61,   257,   258,   -61,   111,
+-     112,   113,   304,    60,    61,    62,    63,    64,    65,    66,
++      12,    95,   225,   290,    25,    18,    19,    20,    24,   187,
++      13,    26,    27,    28,   128,    29,   123,   170,   125,    11,
++      25,    56,   -11,    17,    25,    34,   195,    14,   181,   -11,
++      98,    25,    57,    25,   182,    41,    30,    31,   107,   112,
++     290,   110,   111,   238,   239,   240,   241,   242,   188,   124,
++     127,   238,   239,   240,   241,   242,   132,    25,   -45,   291,
++     139,   140,   141,   142,   143,   144,   145,   146,   147,   148,
++     149,   150,   151,   152,   153,   154,   155,   156,   157,   158,
++     159,   160,   161,   162,   163,   164,   128,   234,   128,   301,
++     197,   304,    14,   294,   214,   113,   291,   208,    25,   243,
++     244,    22,    97,   133,   180,   187,   186,   265,   244,   100,
++      25,    25,   191,    16,    57,   192,   193,   194,   166,   255,
++     167,   196,   198,    25,   199,   176,   177,   178,   168,   200,
++      25,   167,   306,    -2,   215,    33,   205,   206,   252,   168,
++     251,    42,   220,   263,   188,    35,   101,    36,    37,    38,
++      39,    40,    41,    42,   216,   217,   218,   134,   136,   137,
++     128,   126,   298,   179,   -11,    25,   209,   210,   106,   115,
++     213,   229,   -11,   268,    36,    37,    38,    39,   -11,   -11,
++     -60,   190,   -60,   -60,   -60,   -60,   -60,   -60,   246,    22,
++     109,    23,   108,   -11,   212,   138,   248,   -11,   174,   219,
++     -11,   249,   171,   250,   -11,   -11,    22,   102,   185,   254,
++     103,    22,   257,   253,   -11,   175,   259,   -11,   -11,   -11,
++     -11,    22,   -64,   277,   -11,   -64,   116,   117,   118,    35,
++      25,    36,    37,    38,    39,    40,    41,   285,   286,   -11,
++      22,   129,   130,   -11,   267,   230,   104,   105,    22,   201,
++     202,   274,    22,   236,   280,   278,   231,   281,   283,     1,
++     232,     2,     3,     4,    22,   284,   282,   288,   203,   204,
++     233,   292,   305,    22,   228,   293,    22,   258,   207,   260,
++     261,    25,   262,   289,   115,   264,   296,   276,    61,    62,
++     297,    63,   275,   299,   300,   -60,   247,   -60,   -60,   -60,
++     -60,   -60,   -60,   279,   302,   307,   183,    64,    65,    66,
+       67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
+-      77,    78,    79,    80,    81,   110,    82,   259,   261,   272,
+-     287,    83,   276,   217,    84,   273,   -57,    24,   -57,   -57,
+-     -57,   -57,   -57,   -57,   299,    34,   180,    35,    36,    37,
+-      38,    39,    40,   243,   117,   234,   263,   109,    34,    24,
+-      35,    36,    37,    38,    39,    40,    57,    58,   130,    59,
+-     292,   160,   203,     0,     0,     0,     0,     0,   -62,     0,
+-       0,   -62,   111,   112,   113,    60,    61,    62,    63,    64,
+-      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
+-      75,    76,    77,    78,    79,    80,    81,     0,    82,    57,
+-      58,     0,    59,    83,     0,     0,    84,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,     0,     0,    60,    61,
+-      62,    63,    64,    65,    66,    67,    68,    69,    70,    71,
+-      72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+-       0,    82,     0,     0,     0,     0,    83,     0,     0,    84,
+-      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+-      70,    71,    72,    73,    74,    75,     0,    77,    78,    79
++      77,    78,    79,    80,    81,    82,    83,    84,    85,   237,
++      86,    36,    37,    38,    39,    87,   266,   -65,    88,    25,
++     -65,   116,   117,   118,    25,   122,    61,    62,   295,    63,
++     114,   135,    35,   211,    36,    37,    38,    39,    40,    41,
++      42,   165,     0,     0,     0,    64,    65,    66,    67,    68,
++      69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
++      79,    80,    81,    82,    83,    84,    85,    25,    86,    61,
++      62,     0,    63,    87,     0,    35,    88,    36,    37,    38,
++      39,    40,    41,     0,     0,     0,   272,     0,    64,    65,
++      66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
++      76,    77,    78,    79,    80,    81,    82,    83,    84,    85,
++       0,    86,  -122,  -122,   167,     0,    87,     0,     0,    88,
++       0,     0,   168,    64,    65,    66,    67,    68,    69,    70,
++      71,    72,    73,    74,    75,    76,    77,    78,    79,     0,
++      81,    82,    83,    35,     0,    36,    37,    38,    39,    40,
++      41,   120,     0,    36,    37,    38,    39,   121
+ };
+ 
+ static const yytype_int16 yycheck[] =
+ {
+-       1,   158,     4,    10,   170,     6,     7,     8,    54,     4,
+-      92,    12,    13,    47,    15,    44,    11,    46,     4,   114,
+-       1,    57,    54,     4,    25,    32,    12,     4,    64,    65,
+-      11,     4,    18,    19,    54,     4,     1,    38,     4,     5,
+-      41,   198,    11,    12,     0,    46,    47,     6,     7,     8,
+-       9,    10,    53,     1,    56,    50,    57,    58,    59,    60,
++       1,    32,   173,     1,     4,     6,     7,     8,    11,    11,
++      54,    11,    13,    14,    51,    16,    48,    95,    50,     1,
++       4,     1,     4,     0,     4,    26,   119,    54,    12,    11,
++      33,     4,    12,     4,    18,    19,     4,     5,    39,     1,
++       1,    42,    43,     6,     7,     8,     9,    10,    50,    50,
++      51,     6,     7,     8,     9,    10,    57,     4,    56,    57,
+       61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
+       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
+-      81,    82,   177,     4,   118,    62,   120,   169,   117,    62,
+-      91,    56,    57,     6,     7,     8,     9,    10,     1,    11,
+-       4,   102,     1,    62,    63,    20,    54,   108,     4,    57,
+-     111,   112,   113,    12,     4,     1,   117,   118,    19,   120,
+-       1,    12,    12,     4,   125,     0,     1,    11,    12,    13,
+-      11,   132,   133,    15,   300,    56,   218,    12,    50,    14,
+-      15,    16,    17,    18,    19,    20,    21,    22,    23,    62,
+-      63,    54,    54,    55,    57,   189,    55,     1,   165,    55,
+-       4,   162,   163,     1,   171,    49,     4,   168,    12,    50,
+-      12,    19,    29,    15,    12,     4,    14,    15,    16,    17,
+-      18,    19,    55,    12,    57,    25,     1,     4,   189,     4,
+-       1,    66,    65,   194,    11,   196,    11,    12,    55,    56,
+-      57,    54,   209,    56,    54,   212,    56,   208,    65,    51,
+-      52,    54,    55,   214,    12,    54,    54,    56,    64,    57,
+-      58,    59,    60,    55,    56,    12,    64,    14,    15,    16,
+-      17,    18,    19,    64,    12,    50,    14,    15,    16,    17,
+-      18,   242,     1,    14,    15,    16,    17,   248,   255,    12,
+-     257,   258,    54,    12,    56,    14,    15,    16,    17,    18,
+-      19,    54,   263,    56,   265,    55,    56,   268,    55,    54,
+-      55,    56,   273,    54,     1,    56,    24,     4,    26,    27,
+-      28,    64,    64,   284,    11,    12,    54,    14,   289,     1,
+-     291,   292,    54,    55,    56,    54,     1,     1,    57,    58,
+-      59,    60,   303,    30,    31,    32,    33,    34,    35,    36,
+-      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
+-      47,    48,    49,    50,    51,     1,    53,     1,    64,     4,
+-      56,    58,   256,   170,    61,   253,    12,     4,    14,    15,
+-      16,    17,    18,    19,   294,    12,   104,    14,    15,    16,
+-      17,    18,    19,   183,    44,   180,   234,    42,    12,     4,
+-      14,    15,    16,    17,    18,    19,    11,    12,    54,    14,
+-     281,    85,   164,    -1,    -1,    -1,    -1,    -1,    54,    -1,
+-      -1,    57,    58,    59,    60,    30,    31,    32,    33,    34,
++      81,    82,    83,    84,    85,    86,   123,   180,   125,    62,
++     122,    62,    54,    54,   172,    57,    57,   163,     4,    62,
++      63,    54,    55,     1,   105,    11,   109,    62,    63,    56,
++       4,     4,   113,    54,    12,   116,   117,   118,    55,    12,
++      57,   122,   123,     4,   125,    11,    12,    13,    65,   130,
++       4,    57,   303,     0,     1,     1,   137,   138,    64,    65,
++     206,    20,   173,   221,    50,    12,    19,    14,    15,    16,
++      17,    18,    19,    20,    21,    22,    23,    55,    55,    56,
++     197,     1,    56,    49,     4,     4,   167,   168,    12,     1,
++     171,   174,    12,    12,    14,    15,    16,    17,    18,    19,
++      12,    55,    14,    15,    16,    17,    18,    19,   189,    54,
++       1,    56,    19,     4,     1,    15,   197,     4,     1,    66,
++      11,   202,    25,   204,    11,    12,    54,    12,    56,   212,
++      15,    54,   215,    56,    54,    12,   217,    57,    58,    59,
++      60,    54,    54,    56,    64,    57,    58,    59,    60,    12,
++       4,    14,    15,    16,    17,    18,    19,    11,    12,    50,
++      54,    55,    56,    50,   245,    64,    51,    52,    54,    55,
++      56,   252,    54,    12,    56,   258,    64,   260,   261,    24,
++      64,    26,    27,    28,    54,   266,    56,   268,    55,    56,
++      64,   272,    55,    54,    55,   276,    54,     1,     1,     1,
++       1,     4,     1,    56,     1,    64,   287,   256,    11,    12,
++     291,    14,     4,   294,   295,    12,   191,    14,    15,    16,
++      17,    18,    19,   259,   297,   306,   107,    30,    31,    32,
++      33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
++      43,    44,    45,    46,    47,    48,    49,    50,    51,   183,
++      53,    14,    15,    16,    17,    58,   237,    54,    61,     4,
++      57,    58,    59,    60,     4,    48,    11,    12,   284,    14,
++      46,    58,    12,   169,    14,    15,    16,    17,    18,    19,
++      20,    89,    -1,    -1,    -1,    30,    31,    32,    33,    34,
+       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
+-      45,    46,    47,    48,    49,    50,    51,    -1,    53,    11,
+-      12,    -1,    14,    58,    -1,    -1,    61,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    30,    31,
++      45,    46,    47,    48,    49,    50,    51,     4,    53,    11,
++      12,    -1,    14,    58,    -1,    12,    61,    14,    15,    16,
++      17,    18,    19,    -1,    -1,    -1,    29,    -1,    30,    31,
+       32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
+       42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
+-      -1,    53,    -1,    -1,    -1,    -1,    58,    -1,    -1,    61,
+-      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
+-      40,    41,    42,    43,    44,    45,    -1,    47,    48,    49
++      -1,    53,    55,    56,    57,    -1,    58,    -1,    -1,    61,
++      -1,    -1,    65,    30,    31,    32,    33,    34,    35,    36,
++      37,    38,    39,    40,    41,    42,    43,    44,    45,    -1,
++      47,    48,    49,    12,    -1,    14,    15,    16,    17,    18,
++      19,    12,    -1,    14,    15,    16,    17,    18
+ };
+ 
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+    symbol of state STATE-NUM.  */
+ static const yytype_uint8 yystos[] =
+ {
+-       0,    24,    26,    27,    28,    68,    69,    70,    71,    74,
+-       1,    72,    54,    54,   106,    54,     0,    72,    72,    72,
+-      73,    54,    56,   119,     4,    11,    72,    72,    72,     4,
+-       5,    75,     1,    72,    12,    14,    15,    16,    17,    18,
+-      19,    92,    93,    94,    95,    96,    97,    98,    99,   100,
+-     102,   105,     1,    12,   107,   108,   109,    11,    12,    14,
+-      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
+-      40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
+-      50,    51,    53,    58,    61,    91,   111,   113,   114,   115,
+-     116,    20,    76,    77,    55,   119,   120,    56,    19,    12,
+-      15,    51,    52,    12,    72,    19,    72,     1,    57,   106,
+-       1,    58,    59,    60,    90,    12,    18,    97,    98,    72,
+-      98,     1,    72,    99,    55,    56,   119,    72,     1,    55,
+-     108,    55,    56,    15,    72,    72,    72,    72,    72,    72,
+-      72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
+-      72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
+-     114,    55,    57,    65,   112,     1,    72,    73,    25,    78,
+-      80,     1,    12,    11,    12,    13,    49,    72,    12,    18,
+-      95,   101,    55,    72,    72,    72,    72,    96,    72,    98,
+-      72,    72,    72,    55,    56,    55,    56,    72,    72,     1,
+-     111,    72,    72,   113,    56,   119,    11,    50,    82,     1,
+-      72,    73,     1,    21,    22,    23,    66,    76,    81,    85,
+-      88,    89,    92,   117,   118,    55,   119,    64,    64,    64,
+-      64,    96,    72,    12,   101,     6,     7,     8,     9,    10,
+-      62,    63,   103,    94,    72,    72,    72,   111,    64,    72,
+-      56,   119,    12,    79,   119,     1,    72,     1,     1,     1,
+-      73,    64,    62,   103,    72,    29,   110,    72,    12,    83,
+-      84,    87,     4,    82,    56,   119,    84,    56,   119,    56,
+-     119,    72,    11,    12,   104,    72,    72,    56,     1,    57,
+-      72,    54,   104,    72,    72,    56,    72,    72,    62,    87,
+-      86,    62,    55,    92,    72
++       0,    24,    26,    27,    28,    68,    70,    71,    72,    75,
++      76,     1,    73,    54,    54,   108,    54,     0,    73,    73,
++      73,    74,    54,    56,   121,     4,    11,    73,    73,    73,
++       4,     5,    77,     1,    73,    12,    14,    15,    16,    17,
++      18,    19,    20,    69,    78,    94,    95,    96,    97,    98,
++      99,   100,   101,   102,   104,   107,     1,    12,   109,   110,
++     111,    11,    12,    14,    30,    31,    32,    33,    34,    35,
++      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
++      46,    47,    48,    49,    50,    51,    53,    58,    61,    93,
++     113,   115,   116,   117,   118,    78,    79,    55,   121,   122,
++      56,    19,    12,    15,    51,    52,    12,    73,    19,     1,
++      73,    73,     1,    57,   108,     1,    58,    59,    60,    92,
++      12,    18,    99,   100,    73,   100,     1,    73,   101,    55,
++      56,   121,    73,     1,    55,   110,    55,    56,    15,    73,
++      73,    73,    73,    73,    73,    73,    73,    73,    73,    73,
++      73,    73,    73,    73,    73,    73,    73,    73,    73,    73,
++      73,    73,    73,    73,    73,   116,    55,    57,    65,   114,
++      74,    25,    80,    82,     1,    12,    11,    12,    13,    49,
++      73,    12,    18,    97,   103,    56,   121,    11,    50,    84,
++      55,    73,    73,    73,    73,    98,    73,   100,    73,    73,
++      73,    55,    56,    55,    56,    73,    73,     1,   113,    73,
++      73,   115,     1,    73,    74,     1,    21,    22,    23,    66,
++      78,    83,    87,    90,    91,    94,   119,   120,    55,   121,
++      64,    64,    64,    64,    98,    73,    12,   103,     6,     7,
++       8,     9,    10,    62,    63,   105,    73,    96,    73,    73,
++      73,   113,    64,    56,   121,    12,    81,   121,     1,    73,
++       1,     1,     1,    74,    64,    62,   105,    73,    12,    85,
++      86,    89,    29,   112,    73,     4,    84,    56,   121,    86,
++      56,   121,    56,   121,    73,    11,    12,   106,    73,    56,
++       1,    57,    73,    73,    54,   106,    73,    73,    56,    73,
++      73,    62,    89,    88,    62,    55,    94,    73
+ };
+ 
+ #define yyerrok		(yyerrstatus = 0)
+@@ -1549,62 +1550,62 @@
+ 
+   switch (yytype)
+     {
+-      case 83: /* "maybe_media_list" */
++      case 85: /* "maybe_media_list" */
+ 
+ 	{ delete (yyvaluep->mediaList); (yyvaluep->mediaList) = 0; };
+ 
+ 	break;
+-      case 84: /* "media_list" */
++      case 86: /* "media_list" */
+ 
+ 	{ delete (yyvaluep->mediaList); (yyvaluep->mediaList) = 0; };
+ 
+ 	break;
+-      case 86: /* "ruleset_list" */
++      case 88: /* "ruleset_list" */
+ 
+ 	{ delete (yyvaluep->ruleList); (yyvaluep->ruleList) = 0; };
+ 
+ 	break;
+-      case 93: /* "selector_list" */
++      case 95: /* "selector_list" */
+ 
+-	{ delete (yyvaluep->selectorList); (yyvaluep->selectorList) = 0; };
++	{ if ((yyvaluep->selectorList)) qDeleteAll(*(yyvaluep->selectorList)); delete (yyvaluep->selectorList); (yyvaluep->selectorList) = 0; };
+ 
+ 	break;
+-      case 94: /* "selector" */
++      case 96: /* "selector" */
+ 
+ 	{ delete (yyvaluep->selector); (yyvaluep->selector) = 0; };
+ 
+ 	break;
+-      case 96: /* "simple_selector" */
++      case 98: /* "simple_selector" */
+ 
+ 	{ delete (yyvaluep->selector); (yyvaluep->selector) = 0; };
+ 
+ 	break;
+-      case 98: /* "specifier_list" */
++      case 100: /* "specifier_list" */
+ 
+ 	{ delete (yyvaluep->selector); (yyvaluep->selector) = 0; };
+ 
+ 	break;
+-      case 99: /* "specifier" */
++      case 101: /* "specifier" */
+ 
+ 	{ delete (yyvaluep->selector); (yyvaluep->selector) = 0; };
+ 
+ 	break;
+-      case 100: /* "class" */
++      case 102: /* "class" */
+ 
+ 	{ delete (yyvaluep->selector); (yyvaluep->selector) = 0; };
+ 
+ 	break;
+-      case 102: /* "attrib" */
++      case 104: /* "attrib" */
+ 
+ 	{ delete (yyvaluep->selector); (yyvaluep->selector) = 0; };
+ 
+ 	break;
+-      case 105: /* "pseudo" */
++      case 107: /* "pseudo" */
+ 
+ 	{ delete (yyvaluep->selector); (yyvaluep->selector) = 0; };
+ 
+ 	break;
+-      case 111: /* "expr" */
++      case 113: /* "expr" */
+ 
+ 	{ delete (yyvaluep->valueList); (yyvaluep->valueList) = 0; };
+ 
+@@ -1915,7 +1916,7 @@
+   YY_REDUCE_PRINT (yyn);
+   switch (yyn)
+     {
+-        case 6:
++        case 8:
+ 
+     {
+         CSSParser *p = static_cast<CSSParser *>(parser);
+@@ -1923,14 +1924,14 @@
+     ;}
+     break;
+ 
+-  case 7:
++  case 9:
+ 
+     {
+ 	/* can be empty */
+     ;}
+     break;
+ 
+-  case 8:
++  case 10:
+ 
+     {
+ 	CSSParser *p = static_cast<CSSParser *>(parser);
+@@ -1938,7 +1939,7 @@
+ 	    p->valueList = (yyvsp[(4) - (5)].valueList);
+ #ifdef CSS_DEBUG
+ 	    kDebug( 6080 ) << "   got property for " << p->id <<
+-		(p->important?" important":"")<< endl;
++		(p->important?" important":"");
+ 	    bool ok =
+ #endif
+ 		p->parseValue( p->id, p->important );
+@@ -1956,18 +1957,38 @@
+     ;}
+     break;
+ 
+-  case 15:
++  case 18:
+ 
+     {
+ #ifdef CSS_DEBUG
+      kDebug( 6080 ) << "charset rule: " << qString((yyvsp[(3) - (5)].string));
+ #endif
++     CSSParser* p = static_cast<CSSParser*>(parser);
++     if ((yyval.rule) && p->styleElement && p->styleElement->isCSSStyleSheet()) {
++         (yyval.rule) = new CSSCharsetRuleImpl(p->styleElement, domString((yyvsp[(3) - (5)].string)));
++         p->styleElement->append((yyval.rule));
++     } else
++         (yyval.rule) = 0;
+  ;}
+     break;
+ 
+   case 19:
+ 
+     {
++      (yyval.rule) = 0;
++ ;}
++    break;
++
++  case 20:
++
++    {
++      (yyval.rule) = 0;
++ ;}
++    break;
++
++  case 22:
++
++    {
+      CSSParser *p = static_cast<CSSParser *>(parser);
+      if ( (yyvsp[(2) - (3)].rule) && p->styleElement && p->styleElement->isCSSStyleSheet() ) {
+ 	 p->styleElement->append( (yyvsp[(2) - (3)].rule) );
+@@ -1977,7 +1998,7 @@
+  ;}
+     break;
+ 
+-  case 20:
++  case 23:
+ 
+     {
+ #ifdef CSS_DEBUG
+@@ -1991,21 +2012,21 @@
+     ;}
+     break;
+ 
+-  case 21:
++  case 24:
+ 
+     {
+         (yyval.rule) = 0;
+     ;}
+     break;
+ 
+-  case 22:
++  case 25:
+ 
+     {
+         (yyval.rule) = 0;
+     ;}
+     break;
+ 
+-  case 25:
++  case 28:
+ 
+     {
+ #ifdef CSS_DEBUG
+@@ -2017,17 +2038,17 @@
+  ;}
+     break;
+ 
+-  case 28:
++  case 31:
+ 
+     { (yyval.string).string = 0; ;}
+     break;
+ 
+-  case 29:
++  case 32:
+ 
+     { (yyval.string) = (yyvsp[(1) - (2)].string); ;}
+     break;
+ 
+-  case 31:
++  case 34:
+ 
+     {
+      CSSParser *p = static_cast<CSSParser *>(parser);
+@@ -2039,19 +2060,19 @@
+  ;}
+     break;
+ 
+-  case 38:
++  case 41:
+ 
+     { delete (yyvsp[(1) - (2)].rule); (yyval.rule) = 0; ;}
+     break;
+ 
+-  case 41:
++  case 44:
+ 
+     {
+ 	(yyval.mediaList) = new MediaListImpl();
+     ;}
+     break;
+ 
+-  case 43:
++  case 46:
+ 
+     {
+ 	(yyval.mediaList) = new MediaListImpl();
+@@ -2059,7 +2080,7 @@
+     ;}
+     break;
+ 
+-  case 44:
++  case 47:
+ 
+     {
+ 	(yyval.mediaList) = (yyvsp[(1) - (4)].mediaList);
+@@ -2068,7 +2089,7 @@
+     ;}
+     break;
+ 
+-  case 45:
++  case 48:
+ 
+     {
+        delete (yyvsp[(1) - (2)].mediaList);
+@@ -2076,7 +2097,7 @@
+     ;}
+     break;
+ 
+-  case 46:
++  case 49:
+ 
+     {
+ 	CSSParser *p = static_cast<CSSParser *>(parser);
+@@ -2091,12 +2112,12 @@
+     ;}
+     break;
+ 
+-  case 47:
++  case 50:
+ 
+     { (yyval.ruleList) = 0; ;}
+     break;
+ 
+-  case 48:
++  case 51:
+ 
+     {
+       (yyval.ruleList) = (yyvsp[(1) - (3)].ruleList);
+@@ -2107,72 +2128,72 @@
+   ;}
+     break;
+ 
+-  case 49:
++  case 52:
+ 
+     {
+       (yyval.string) = (yyvsp[(1) - (2)].string);
+   ;}
+     break;
+ 
+-  case 50:
++  case 53:
+ 
+     {
+       (yyval.rule) = 0;
+     ;}
+     break;
+ 
+-  case 51:
++  case 54:
+ 
+     {
+       (yyval.rule) = 0;
+     ;}
+     break;
+ 
+-  case 52:
++  case 55:
+ 
+     {
+       (yyval.rule) = 0;
+     ;}
+     break;
+ 
+-  case 53:
++  case 56:
+ 
+     {
+       (yyval.rule) = 0;
+     ;}
+     break;
+ 
+-  case 54:
++  case 57:
+ 
+     { (yyval.relation) = CSSSelector::DirectAdjacent; ;}
+     break;
+ 
+-  case 55:
++  case 58:
+ 
+     { (yyval.relation) = CSSSelector::IndirectAdjacent; ;}
+     break;
+ 
+-  case 56:
++  case 59:
+ 
+     { (yyval.relation) = CSSSelector::Child; ;}
+     break;
+ 
+-  case 57:
++  case 60:
+ 
+     { (yyval.relation) = CSSSelector::Descendant; ;}
+     break;
+ 
+-  case 58:
++  case 61:
+ 
+     { (yyval.val) = -1; ;}
+     break;
+ 
+-  case 59:
++  case 62:
+ 
+     { (yyval.val) = 1; ;}
+     break;
+ 
+-  case 60:
++  case 63:
+ 
+     {
+ #ifdef CSS_DEBUG
+@@ -2187,18 +2208,19 @@
+ 	    (yyval.rule) = rule;
+ 	} else {
+ 	    (yyval.rule) = 0;
++	    if ((yyvsp[(1) - (2)].selectorList)) qDeleteAll(*(yyvsp[(1) - (2)].selectorList));
+ 	    delete (yyvsp[(1) - (2)].selectorList);
++	    (yyvsp[(1) - (2)].selectorList) = 0;
+ 	    p->clearProperties();
+ 	}
+     ;}
+     break;
+ 
+-  case 61:
++  case 64:
+ 
+     {
+ 	if ( (yyvsp[(1) - (1)].selector) ) {
+-	    (yyval.selectorList) = new Q3PtrList<CSSSelector>;
+-            (yyval.selectorList)->setAutoDelete( true );
++	    (yyval.selectorList) = new QList<CSSSelector*>;
+ #ifdef CSS_DEBUG
+ 	    kDebug( 6080 ) << "   got simple selector:";
+ 	    (yyvsp[(1) - (1)].selector)->print();
+@@ -2211,7 +2233,7 @@
+     ;}
+     break;
+ 
+-  case 62:
++  case 65:
+ 
+     {
+ 	if ( (yyvsp[(1) - (4)].selectorList) && (yyvsp[(4) - (4)].selector) ) {
+@@ -2223,29 +2245,34 @@
+ 	    (yyvsp[(4) - (4)].selector)->print();
+ #endif
+ 	} else {
++            if ((yyvsp[(1) - (4)].selectorList)) qDeleteAll(*(yyvsp[(1) - (4)].selectorList));
+ 	    delete (yyvsp[(1) - (4)].selectorList);
++	    (yyvsp[(1) - (4)].selectorList)=0;
++
+ 	    delete (yyvsp[(4) - (4)].selector);
+ 	    (yyval.selectorList) = 0;
+ 	}
+     ;}
+     break;
+ 
+-  case 63:
++  case 66:
+ 
+     {
++        if ((yyvsp[(1) - (2)].selectorList)) qDeleteAll(*(yyvsp[(1) - (2)].selectorList));
+ 	delete (yyvsp[(1) - (2)].selectorList);
++	(yyvsp[(1) - (2)].selectorList) = 0;
+ 	(yyval.selectorList) = 0;
+     ;}
+     break;
+ 
+-  case 64:
++  case 67:
+ 
+     {
+ 	(yyval.selector) = (yyvsp[(1) - (1)].selector);
+     ;}
+     break;
+ 
+-  case 65:
++  case 68:
+ 
+     {
+ 	if ( !(yyvsp[(1) - (3)].selector) || !(yyvsp[(3) - (3)].selector) ) {
+@@ -2263,7 +2290,7 @@
+     ;}
+     break;
+ 
+-  case 66:
++  case 69:
+ 
+     {
+ 	delete (yyvsp[(1) - (2)].selector);
+@@ -2271,22 +2298,22 @@
+     ;}
+     break;
+ 
+-  case 67:
++  case 70:
+ 
+     { (yyval.string).string = 0; (yyval.string).length = 0; ;}
+     break;
+ 
+-  case 68:
++  case 71:
+ 
+     { static unsigned short star = '*'; (yyval.string).string = &star; (yyval.string).length = 1; ;}
+     break;
+ 
+-  case 69:
++  case 72:
+ 
+     { (yyval.string) = (yyvsp[(1) - (2)].string); ;}
+     break;
+ 
+-  case 70:
++  case 73:
+ 
+     {
+ 	(yyval.selector) = new CSSSelector();
+@@ -2294,7 +2321,7 @@
+     ;}
+     break;
+ 
+-  case 71:
++  case 74:
+ 
+     {
+ 	(yyval.selector) = (yyvsp[(2) - (3)].selector);
+@@ -2303,7 +2330,7 @@
+     ;}
+     break;
+ 
+-  case 72:
++  case 75:
+ 
+     {
+ 	(yyval.selector) = (yyvsp[(1) - (2)].selector);
+@@ -2312,7 +2339,7 @@
+     ;}
+     break;
+ 
+-  case 73:
++  case 76:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2323,7 +2350,7 @@
+     ;}
+     break;
+ 
+-  case 74:
++  case 77:
+ 
+     {
+         (yyval.selector) = (yyvsp[(3) - (4)].selector);
+@@ -2336,7 +2363,7 @@
+     ;}
+     break;
+ 
+-  case 75:
++  case 78:
+ 
+     {
+         (yyval.selector) = (yyvsp[(2) - (3)].selector);
+@@ -2349,7 +2376,7 @@
+     ;}
+     break;
+ 
+-  case 76:
++  case 79:
+ 
+     {
+ 	CSSParser *p = static_cast<CSSParser *>(parser);
+@@ -2369,14 +2396,14 @@
+     ;}
+     break;
+ 
+-  case 77:
++  case 80:
+ 
+     {
+ 	(yyval.element) = makeId(static_cast<CSSParser*>(parser)->defaultNamespace(), anyLocalName);
+     ;}
+     break;
+ 
+-  case 78:
++  case 81:
+ 
+     {
+ 	(yyval.selector) = (yyvsp[(1) - (1)].selector);
+@@ -2384,7 +2411,7 @@
+     ;}
+     break;
+ 
+-  case 79:
++  case 82:
+ 
+     {
+ 	(yyval.selector) = (yyvsp[(1) - (2)].selector);
+@@ -2398,7 +2425,7 @@
+     ;}
+     break;
+ 
+-  case 80:
++  case 83:
+ 
+     {
+ 	delete (yyvsp[(1) - (2)].selector);
+@@ -2406,7 +2433,7 @@
+     ;}
+     break;
+ 
+-  case 81:
++  case 84:
+ 
+     {
+ 	(yyval.selector) = new CSSSelector();
+@@ -2416,7 +2443,7 @@
+     ;}
+     break;
+ 
+-  case 85:
++  case 88:
+ 
+     {
+ 	(yyval.selector) = new CSSSelector();
+@@ -2426,7 +2453,7 @@
+     ;}
+     break;
+ 
+-  case 86:
++  case 89:
+ 
+     {
+ 	CSSParser *p = static_cast<CSSParser *>(parser);
+@@ -2451,7 +2478,7 @@
+     ;}
+     break;
+ 
+-  case 87:
++  case 90:
+ 
+     {
+ 	(yyval.selector) = new CSSSelector();
+@@ -2460,7 +2487,7 @@
+     ;}
+     break;
+ 
+-  case 88:
++  case 91:
+ 
+     {
+ 	(yyval.selector) = new CSSSelector();
+@@ -2470,7 +2497,7 @@
+     ;}
+     break;
+ 
+-  case 89:
++  case 92:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2482,7 +2509,7 @@
+     ;}
+     break;
+ 
+-  case 90:
++  case 93:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2495,49 +2522,49 @@
+    ;}
+     break;
+ 
+-  case 91:
++  case 94:
+ 
+     {
+ 	(yyval.match) = CSSSelector::Exact;
+     ;}
+     break;
+ 
+-  case 92:
++  case 95:
+ 
+     {
+ 	(yyval.match) = CSSSelector::List;
+     ;}
+     break;
+ 
+-  case 93:
++  case 96:
+ 
+     {
+ 	(yyval.match) = CSSSelector::Hyphen;
+     ;}
+     break;
+ 
+-  case 94:
++  case 97:
+ 
+     {
+ 	(yyval.match) = CSSSelector::Begin;
+     ;}
+     break;
+ 
+-  case 95:
++  case 98:
+ 
+     {
+ 	(yyval.match) = CSSSelector::End;
+     ;}
+     break;
+ 
+-  case 96:
++  case 99:
+ 
+     {
+ 	(yyval.match) = CSSSelector::Contain;
+     ;}
+     break;
+ 
+-  case 99:
++  case 102:
+ 
+     {
+ 	(yyval.selector) = new CSSSelector();
+@@ -2546,7 +2573,7 @@
+     ;}
+     break;
+ 
+-  case 100:
++  case 103:
+ 
+     {
+ 	(yyval.selector) = new CSSSelector();
+@@ -2555,7 +2582,7 @@
+     ;}
+     break;
+ 
+-  case 101:
++  case 104:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2565,7 +2592,7 @@
+     ;}
+     break;
+ 
+-  case 102:
++  case 105:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2575,7 +2602,7 @@
+     ;}
+     break;
+ 
+-  case 103:
++  case 106:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2585,7 +2612,7 @@
+     ;}
+     break;
+ 
+-  case 104:
++  case 107:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2595,7 +2622,7 @@
+     ;}
+     break;
+ 
+-  case 105:
++  case 108:
+ 
+     {
+         (yyval.selector) = new CSSSelector();
+@@ -2605,28 +2632,28 @@
+     ;}
+     break;
+ 
+-  case 106:
++  case 109:
+ 
+     {
+ 	(yyval.ok) = (yyvsp[(3) - (4)].ok);
+     ;}
+     break;
+ 
+-  case 107:
++  case 110:
+ 
+     {
+ 	(yyval.ok) = false;
+     ;}
+     break;
+ 
+-  case 108:
++  case 111:
+ 
+     {
+ 	(yyval.ok) = (yyvsp[(3) - (4)].ok);
+     ;}
+     break;
+ 
+-  case 109:
++  case 112:
+ 
+     {
+ 	(yyval.ok) = (yyvsp[(3) - (5)].ok);
+@@ -2635,28 +2662,28 @@
+     ;}
+     break;
+ 
+-  case 110:
++  case 113:
+ 
+     {
+ 	(yyval.ok) = (yyvsp[(3) - (5)].ok);
+     ;}
+     break;
+ 
+-  case 111:
++  case 114:
+ 
+     {
+ 	(yyval.ok) = (yyvsp[(1) - (3)].ok);
+     ;}
+     break;
+ 
+-  case 112:
++  case 115:
+ 
+     {
+         (yyval.ok) = false;
+     ;}
+     break;
+ 
+-  case 113:
++  case 116:
+ 
+     {
+ 	(yyval.ok) = (yyvsp[(1) - (4)].ok);
+@@ -2665,14 +2692,14 @@
+     ;}
+     break;
+ 
+-  case 114:
++  case 117:
+ 
+     {
+         (yyval.ok) = (yyvsp[(1) - (4)].ok);
+     ;}
+     break;
+ 
+-  case 115:
++  case 118:
+ 
+     {
+ 	(yyval.ok) = false;
+@@ -2681,7 +2708,7 @@
+ 	    p->valueList = (yyvsp[(4) - (5)].valueList);
+ #ifdef CSS_DEBUG
+ 	    kDebug( 6080 ) << "   got property: " << (yyvsp[(1) - (5)].prop_id) <<
+-		((yyvsp[(5) - (5)].b)?" important":"")<< endl;
++		((yyvsp[(5) - (5)].b)?" important":"");
+ #endif
+ 	        bool ok = p->parseValue( (yyvsp[(1) - (5)].prop_id), (yyvsp[(5) - (5)].b) );
+                 if ( ok )
+@@ -2698,14 +2725,14 @@
+     ;}
+     break;
+ 
+-  case 116:
++  case 119:
+ 
+     {
+         (yyval.ok) = false;
+     ;}
+     break;
+ 
+-  case 117:
++  case 120:
+ 
+     {
+ 	QString str = qString((yyvsp[(1) - (2)].string));
+@@ -2713,17 +2740,17 @@
+     ;}
+     break;
+ 
+-  case 118:
++  case 121:
+ 
+     { (yyval.b) = true; ;}
+     break;
+ 
+-  case 119:
++  case 122:
+ 
+     { (yyval.b) = false; ;}
+     break;
+ 
+-  case 120:
++  case 123:
+ 
+     {
+ 	(yyval.valueList) = new ValueList;
+@@ -2731,7 +2758,7 @@
+     ;}
+     break;
+ 
+-  case 121:
++  case 124:
+ 
+     {
+ 	(yyval.valueList) = (yyvsp[(1) - (3)].valueList);
+@@ -2748,48 +2775,48 @@
+     ;}
+     break;
+ 
+-  case 122:
++  case 125:
+ 
+     {
+ 	(yyval.tok) = '/';
+     ;}
+     break;
+ 
+-  case 123:
++  case 126:
+ 
+     {
+ 	(yyval.tok) = ',';
+     ;}
+     break;
+ 
+-  case 124:
++  case 127:
+ 
+     {
+         (yyval.tok) = 0;
+   ;}
+     break;
+ 
+-  case 125:
++  case 128:
+ 
+     { (yyval.value) = (yyvsp[(1) - (1)].value); ;}
+     break;
+ 
+-  case 126:
++  case 129:
+ 
+     { (yyval.value) = (yyvsp[(2) - (2)].value); (yyval.value).fValue *= (yyvsp[(1) - (2)].val); ;}
+     break;
+ 
+-  case 127:
++  case 130:
+ 
+     { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_DIMENSION; ;}
+     break;
+ 
+-  case 128:
++  case 131:
+ 
+     { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_STRING; ;}
+     break;
+ 
+-  case 129:
++  case 132:
+ 
+     {
+       QString str = qString( (yyvsp[(1) - (2)].string) );
+@@ -2799,124 +2826,124 @@
+   ;}
+     break;
+ 
+-  case 130:
++  case 133:
+ 
+     { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_URI; ;}
+     break;
+ 
+-  case 131:
++  case 134:
+ 
+     { (yyval.value).id = 0; (yyval.value).iValue = 0; (yyval.value).unit = CSSPrimitiveValue::CSS_UNKNOWN;/* ### */ ;}
+     break;
+ 
+-  case 132:
++  case 135:
+ 
+     { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (1)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_RGBCOLOR; ;}
+     break;
+ 
+-  case 133:
++  case 136:
+ 
+     {
+       (yyval.value) = (yyvsp[(1) - (1)].value);
+   ;}
+     break;
+ 
+-  case 134:
++  case 137:
+ 
+     { (yyval.value).id = 0; (yyval.value).isInt = true; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_NUMBER; ;}
+     break;
+ 
+-  case 135:
++  case 138:
+ 
+     { (yyval.value).id = 0; (yyval.value).isInt = false; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_NUMBER; ;}
+     break;
+ 
+-  case 136:
++  case 139:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_PERCENTAGE; ;}
+     break;
+ 
+-  case 137:
++  case 140:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_PX; ;}
+     break;
+ 
+-  case 138:
++  case 141:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_CM; ;}
+     break;
+ 
+-  case 139:
++  case 142:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_MM; ;}
+     break;
+ 
+-  case 140:
++  case 143:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_IN; ;}
+     break;
+ 
+-  case 141:
++  case 144:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_PT; ;}
+     break;
+ 
+-  case 142:
++  case 145:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_PC; ;}
+     break;
+ 
+-  case 143:
++  case 146:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_DEG; ;}
+     break;
+ 
+-  case 144:
++  case 147:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_RAD; ;}
+     break;
+ 
+-  case 145:
++  case 148:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_GRAD; ;}
+     break;
+ 
+-  case 146:
++  case 149:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_MS; ;}
+     break;
+ 
+-  case 147:
++  case 150:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_S; ;}
+     break;
+ 
+-  case 148:
++  case 151:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_HZ; ;}
+     break;
+ 
+-  case 149:
++  case 152:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_KHZ; ;}
+     break;
+ 
+-  case 150:
++  case 153:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_EMS; ;}
+     break;
+ 
+-  case 151:
++  case 154:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = Value::Q_EMS; ;}
+     break;
+ 
+-  case 152:
++  case 155:
+ 
+     { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].val); (yyval.value).unit = CSSPrimitiveValue::CSS_EXS; ;}
+     break;
+ 
+-  case 153:
++  case 156:
+ 
+     {
+       Function *f = new Function;
+@@ -2928,7 +2955,7 @@
+   ;}
+     break;
+ 
+-  case 154:
++  case 157:
+ 
+     {
+       Function *f = new Function;
+@@ -2940,12 +2967,12 @@
+   ;}
+     break;
+ 
+-  case 155:
++  case 158:
+ 
+     { (yyval.string) = (yyvsp[(1) - (2)].string); ;}
+     break;
+ 
+-  case 156:
++  case 159:
+ 
+     {
+ 	(yyval.rule) = 0;
+@@ -2955,7 +2982,7 @@
+     ;}
+     break;
+ 
+-  case 157:
++  case 160:
+ 
+     {
+ 	(yyval.rule) = 0;
+@@ -2965,7 +2992,7 @@
+     ;}
+     break;
+ 
+-  case 158:
++  case 161:
+ 
+     {
+ 	(yyval.rule) = 0;
+--- a/khtml/css/css_ruleimpl.cpp
++++ b/khtml/css/css_ruleimpl.cpp
+@@ -205,6 +205,12 @@
+ 
+     if (m_cachedSheet)
+     {
++      // if the import rule is issued dynamically, the sheet may have already been
++      // removed from the pending sheet count, so let the doc know
++      // the sheet being imported is pending.
++      if (parentSheet && parentSheet->processed())
++          parentSheet->doc()->addPendingSheet();
++
+       m_cachedSheet->ref(this);
+ 
+       // If the imported sheet is in the cache, then setStyleSheet gets called,
+@@ -273,13 +279,6 @@
+     return newRule ? m_lstCSSRules->insertRule( newRule, index ) : 0;
+ }
+ 
+-CSSRuleListImpl::~CSSRuleListImpl()
+-{
+-    CSSRuleImpl* rule;
+-    while ( !m_lstCSSRules.isEmpty() && ( rule = m_lstCSSRules.take( 0 ) ) )
+-        rule->deref();
+-}
+-
+ // ---------------------------------------------------------------------------
+ 
+ CSSPageRuleImpl::CSSPageRuleImpl(StyleBaseImpl *parent)
+@@ -328,8 +327,8 @@
+ {
+     if (m_selector) {
+         DOMString str;
+-        for (CSSSelector *s = m_selector->first(); s; s = m_selector->next()) {
+-            if (s != m_selector->getFirst())
++        foreach (CSSSelector *s, *m_selector) {
++            if (s != m_selector->at(0))
+                 str += ", ";
+             str += s->selectorText();
+         }
+@@ -360,33 +359,59 @@
+ 
+ void CSSStyleRuleImpl::setNonCSSHints()
+ {
+-    CSSSelector *s = m_selector->first();
+-    while ( s ) {
+-	s->nonCSSHint = true;
+-	s = m_selector->next();
+-    }
++    QListIterator<CSSSelector*> it(*m_selector);
++    while (it.hasNext())
++        it.next()->nonCSSHint = true;
++}
++
++// --------------------------------------------------------------------
++
++CSSRuleListImpl::CSSRuleListImpl(StyleListImpl* const lst, bool omitCharsetRules)
++{
++     if (lst) {
++         unsigned len = lst->length();
++         for (unsigned i = 0; i < len; ++i) {
++             StyleBaseImpl* rule = lst->item(i);
++             if (rule->isRule() && !(omitCharsetRules && rule->isCharsetRule())) {
++                 append(static_cast<CSSRuleImpl*>(rule));
++                 rule->ref();
++             }
++         }
++     }
+ }
+ 
+-void CSSRuleListImpl::deleteRule ( unsigned long index )
++CSSRuleListImpl::~CSSRuleListImpl()
+ {
+-    CSSRuleImpl *rule = m_lstCSSRules.take( index );
+-    if( rule )
++    CSSRuleImpl* rule;
++    while ( !m_lstCSSRules.isEmpty() && ( rule = m_lstCSSRules.takeFirst() ) )
+         rule->deref();
+-    else {
+-         // ### Throw INDEX_SIZE_ERR exception here (TODO)
++}
++
++void CSSRuleListImpl::deleteRule ( unsigned long index )
++{
++    if (index+1 > (unsigned) m_lstCSSRules.size()) {
++        return;
++        // ### Throw INDEX_SIZE_ERR exception here (TODO)
+     }
++    CSSRuleImpl *rule = m_lstCSSRules.takeAt( index );
++    rule->deref();
+ }
+ 
+ unsigned long CSSRuleListImpl::insertRule( CSSRuleImpl *rule,
+                                            unsigned long index )
+ {
+-    if( rule && m_lstCSSRules.insert( index, rule ) )
++    if (index > (unsigned) m_lstCSSRules.size()) {
++        return 0;
++        // ### Throw INDEX_SIZE_ERR exception here (TODO)
++    }
++    
++    if( rule )
+     {
++        m_lstCSSRules.insert( index, rule );
+         rule->ref();
+         return index;
+     }
+ 
+-    // ### Should throw INDEX_SIZE_ERR exception instead! (TODO)
+     return 0;
+ }
+ 
+--- a/khtml/css/cssstyleselector.cpp
++++ b/khtml/css/cssstyleselector.cpp
+@@ -240,11 +240,9 @@
+     // add stylesheets from document
+     authorStyle = new CSSStyleSelectorList();
+ 
+-
+-    Q3PtrListIterator<StyleSheetImpl> it( styleSheets->styleSheets );
+-    for ( ; it.current(); ++it ) {
+-        if ( it.current()->isCSSStyleSheet() && !it.current()->disabled()) {
+-            authorStyle->append( static_cast<CSSStyleSheetImpl*>( it.current() ), m_medium );
++    foreach (StyleSheetImpl* sh, styleSheets->styleSheets) {
++        if ( sh->isCSSStyleSheet() && !sh->disabled()) {
++            authorStyle->append( static_cast<CSSStyleSheetImpl*>( sh ), m_medium );
+         }
+     }
+ 
+@@ -765,8 +763,8 @@
+     if (!decl && !addDecls)
+         return numProps;
+ 
+-    Q3PtrList<CSSProperty>* values = decl ? decl->values() : 0;
+-    Q3PtrList<CSSProperty>* addValues = addDecls ? addDecls->values() : 0;
++    QList<CSSProperty*>* values = decl ? decl->values() : 0;
++    QList<CSSProperty*>* addValues = addDecls ? addDecls->values() : 0;
+     if (!values && !addValues)
+         return numProps;
+ 
+@@ -774,7 +772,7 @@
+     int secondLen = addValues ? addValues->count() : 0;
+     uint totalLen = firstLen + secondLen;
+ 
+-    if (inlineProps.size() < totalLen)
++    if ((unsigned)inlineProps.size() < totalLen)
+ 	{
+         inlineProps.resize(totalLen + 1);
+ 	}
+@@ -1665,7 +1663,7 @@
+     clearLists();
+     // collect all selectors and Properties in lists. Then transfer them to the array for faster lookup.
+ 
+-    Q3PtrList<CSSSelector> selectorList;
++    QList<CSSSelector*> selectorList;
+     CSSOrderedPropertyList propertyList;
+ 
+     if(m_medium == "print" && defaultPrintStyle)
+@@ -1682,13 +1680,9 @@
+ 
+     selectors_size = selectorList.count();
+     selectors = new CSSSelector *[selectors_size];
+-    CSSSelector *s = selectorList.first();
+     CSSSelector **sel = selectors;
+-    while ( s ) {
+-	*sel = s;
+-	s = selectorList.next();
+-	++sel;
+-    }
++    for (QListIterator<CSSSelector*> sit(selectorList); sit.hasNext(); ++sel)
++	*sel = sit.next();
+ 
+     selectorCache = new SelectorCache[selectors_size];
+     for ( unsigned int i = 0; i < selectors_size; i++ ) {
+@@ -1698,16 +1692,12 @@
+     }
+ 
+     // presort properties. Should make the sort() calls in styleForElement faster.
+-    propertyList.sort();
++    qSort(propertyList.begin(), propertyList.end(), CSSOrderedPropertyList::compareItems);
+     properties_size = propertyList.count() + 1;
+     properties = new CSSOrderedProperty *[ properties_size ];
+-    CSSOrderedProperty *p = propertyList.first();
+     CSSOrderedProperty **prop = properties;
+-    while ( p ) {
+-	*prop = p;
+-	p = propertyList.next();
+-	++prop;
+-    }
++    for (QListIterator<CSSOrderedProperty*> pit(propertyList); pit.hasNext(); ++prop)
++        *prop = pit.next();
+     *prop = 0;
+ 
+     unsigned int* offsets = new unsigned int[selectors_size];
+@@ -1756,12 +1746,13 @@
+ // -----------------------------------------------------------------
+ 
+ CSSStyleSelectorList::CSSStyleSelectorList()
+-    : Q3PtrList<CSSOrderedRule>()
++    : QList<CSSOrderedRule*>()
+ {
+-    setAutoDelete(true);
+ }
+ CSSStyleSelectorList::~CSSStyleSelectorList()
+ {
++    qDeleteAll(*this);
++    clear();
+ }
+ 
+ void CSSStyleSelectorList::append( CSSStyleSheetImpl *sheet,
+@@ -1775,18 +1766,17 @@
+         return; // style sheet not applicable for this medium
+ 
+     int len = sheet->length();
+-
+     for(int i = 0; i< len; i++)
+     {
+         StyleBaseImpl *item = sheet->item(i);
+         if(item->isStyleRule())
+         {
+             CSSStyleRuleImpl *r = static_cast<CSSStyleRuleImpl *>(item);
+-            Q3PtrList<CSSSelector> *s = r->selector();
++            QList<CSSSelector*> *s = r->selector();
+             for(int j = 0; j < (int)s->count(); j++)
+             {
+                 CSSOrderedRule *rule = new CSSOrderedRule(r, s->at(j), count());
+-		Q3PtrList<CSSOrderedRule>::append(rule);
++		QList<CSSOrderedRule*>::append(rule);
+                 //kDebug( 6080 ) << "appending StyleRule!";
+             }
+         }
+@@ -1828,12 +1818,12 @@
+                         CSSStyleRuleImpl *styleRule =
+                                 static_cast<CSSStyleRuleImpl *>( childItem );
+ 
+-                        Q3PtrList<CSSSelector> *s = styleRule->selector();
++                        QList<CSSSelector*> *s = styleRule->selector();
+                         for( int j = 0; j < ( int ) s->count(); j++ )
+                         {
+                             CSSOrderedRule *orderedRule = new CSSOrderedRule(
+                                             styleRule, s->at( j ), count() );
+-                	    Q3PtrList<CSSOrderedRule>::append( orderedRule );
++                	    QList<CSSOrderedRule*>::append( orderedRule );
+                         }
+                     }
+                     else
+@@ -1854,42 +1844,46 @@
+ }
+ 
+ 
+-void CSSStyleSelectorList::collect( Q3PtrList<CSSSelector> *selectorList, CSSOrderedPropertyList *propList,
++void CSSStyleSelectorList::collect( QList<CSSSelector*> *selectorList, CSSOrderedPropertyList *propList,
+ 				    Source regular, Source important )
+ {
+-    CSSOrderedRule *r = first();
+-    while( r ) {
+-	CSSSelector *sel = selectorList->first();
++    CSSOrderedRule *r;
++    QListIterator<CSSOrderedRule*> tIt(*this);
++    CSSSelector *sel;
++
++    while( tIt.hasNext() ) {
++        r = tIt.next();
+ 	int selectorNum = 0;
+-	while( sel ) {
+-	    if ( *sel == *(r->selector) )
++	sel = 0;
++        bool found = false;
++        // already in list?
++	QListIterator<CSSSelector*> it(*selectorList);
++	while( it.hasNext() ) {
++	    sel = it.next();
++	    if ( *sel == *(r->selector) ) {
++	        found = true;
+ 		break;
+-	    sel = selectorList->next();
++            }
+ 	    selectorNum++;
+ 	}
+-	if ( !sel )
++	if ( !found )
++	    // nope.
+ 	    selectorList->append( r->selector );
+-//	else
+-//	    qDebug("merged one selector");
+ 	propList->append(r->rule->declaration(), selectorNum, r->selector->specificity(), regular, important );
+-	r = next();
+     }
+ }
+ 
+ // -------------------------------------------------------------------------
+ 
+-int CSSOrderedPropertyList::compareItems(Q3PtrCollection::Item i1, Q3PtrCollection::Item i2)
++bool CSSOrderedPropertyList::compareItems(const CSSOrderedProperty * i1, const CSSOrderedProperty *i2)
+ {
+-    int diff =  static_cast<CSSOrderedProperty *>(i1)->priority
+-        - static_cast<CSSOrderedProperty *>(i2)->priority;
+-    return diff ? diff : static_cast<CSSOrderedProperty *>(i1)->position
+-        - static_cast<CSSOrderedProperty *>(i2)->position;
++    return *i1 < *i2;
+ }
+ 
+ void CSSOrderedPropertyList::append(DOM::CSSStyleDeclarationImpl *decl, uint selector, uint specificity,
+ 				    Source regular, Source important )
+ {
+-    Q3PtrList<CSSProperty> *values = decl->values();
++    QList<CSSProperty*> *values = decl->values();
+     if(!values) return;
+     int len = values->count();
+     for(int i = 0; i < len; i++)
+@@ -1921,7 +1915,7 @@
+             break;
+         }
+ 
+-	Q3PtrList<CSSOrderedProperty>::append(new CSSOrderedProperty(prop, selector,
++	QList<CSSOrderedProperty*>::append(new CSSOrderedProperty(prop, selector,
+ 								 first, source, specificity,
+ 								 count() ));
+     }
+@@ -3463,15 +3457,12 @@
+ // shorthand properties
+     case CSS_PROP_BACKGROUND:
+         if (isInitial) {
+-            style->clearBackgroundLayers();
++            style->setBackgroundColor(QColor());
+             return;
+         }
+         else if (isInherit) {
+-            if (parentStyle)
+-                style->inheritBackgroundLayers(*parentStyle->backgroundLayers());
+-            else
+-                style->clearBackgroundLayers();
+-            return;
++            style->inheritBackgroundLayers(*parentStyle->backgroundLayers());
++            style->setBackgroundColor(parentStyle->backgroundColor());
+         }
+         break;
+     case CSS_PROP_BORDER:
+--- a/khtml/css/cssproperties.h
++++ b/khtml/css/cssproperties.h
+@@ -138,6 +138,6 @@
+ #define CSS_PROP__KHTML_USER_INPUT 128
+ 
+ #define CSS_PROP_TOTAL 129
+-const size_t maxCSSPropertyNameLength = 17;
++const size_t maxCSSPropertyNameLength = 32;
+ #endif
+ 
+--- a/khtml/css/css_valueimpl.h
++++ b/khtml/css/css_valueimpl.h
+@@ -30,8 +30,6 @@
+ #include "misc/loader_client.h"
+ #include "misc/shared.h"
+ 
+-#include <Qt3Support/Q3IntDict>
+-
+ namespace khtml {
+     class RenderStyle;
+     class CachedImage;
+@@ -51,7 +49,7 @@
+ {
+ public:
+     CSSStyleDeclarationImpl(CSSRuleImpl *parentRule);
+-    CSSStyleDeclarationImpl(CSSRuleImpl *parentRule, Q3PtrList<CSSProperty> *lstValues);
++    CSSStyleDeclarationImpl(CSSRuleImpl *parentRule, QList<CSSProperty*> *lstValues);
+     virtual ~CSSStyleDeclarationImpl();
+ 
+     CSSStyleDeclarationImpl& operator=( const CSSStyleDeclarationImpl&);
+@@ -86,7 +84,7 @@
+     virtual DOMString getPropertyValue( int propertyID ) const;
+     virtual bool getPropertyPriority( int propertyID ) const;
+ 
+-    Q3PtrList<CSSProperty> *values() const { return m_lstValues; }
++    QList<CSSProperty*> *values() const { return m_lstValues; }
+     void setNode(NodeImpl *_node) { m_node = _node; }
+ 
+     void setChanged();
+@@ -97,7 +95,7 @@
+     DOMString getShortHandValue( const int* properties, int number ) const;
+     DOMString get4Values( const int* properties ) const;
+ 
+-    Q3PtrList<CSSProperty> *m_lstValues;
++    QList<CSSProperty*> *m_lstValues;
+     NodeImpl *m_node;
+ 
+ private:
+@@ -153,7 +151,7 @@
+     virtual DOM::DOMString cssText() const;
+ 
+ protected:
+-    Q3PtrList<CSSValueImpl> m_values;
++    QList<CSSValueImpl*> m_values;
+ };
+ 
+ 
+--- a/khtml/css/css_stylesheetimpl.cpp
++++ b/khtml/css/css_stylesheetimpl.cpp
+@@ -110,40 +110,45 @@
+ CSSStyleSheetImpl::CSSStyleSheetImpl(CSSStyleSheetImpl *parentSheet, DOMString href)
+     : StyleSheetImpl(parentSheet, href)
+ {
+-    m_lstChildren = new Q3PtrList<StyleBaseImpl>;
++    m_lstChildren = new QList<StyleBaseImpl*>;
+     m_doc = parentSheet ? parentSheet->doc() : 0;
+     m_implicit = false;
+     m_namespaces = 0;
+     m_defaultNamespace = anyNamespace;
++    m_processed = false;
+ }
+ 
+ CSSStyleSheetImpl::CSSStyleSheetImpl(DOM::NodeImpl *parentNode, DOMString href, bool _implicit)
+     : StyleSheetImpl(parentNode, href)
+ {
+-    m_lstChildren = new Q3PtrList<StyleBaseImpl>;
++    m_lstChildren = new QList<StyleBaseImpl*>;
+     m_doc = parentNode->getDocument();
+     m_implicit = _implicit;
+     m_namespaces = 0;
+     m_defaultNamespace = anyNamespace;
++    m_processed = false;
+ }
+ 
+ CSSStyleSheetImpl::CSSStyleSheetImpl(CSSRuleImpl *ownerRule, DOMString href)
+     : StyleSheetImpl(ownerRule, href)
+ {
+-    m_lstChildren = new Q3PtrList<StyleBaseImpl>;
++    m_lstChildren = new QList<StyleBaseImpl*>;
+     m_doc = static_cast<CSSStyleSheetImpl*>(ownerRule->stylesheet())->doc();
+     m_implicit = false;
+     m_namespaces = 0;
+     m_defaultNamespace = anyNamespace;
++    m_processed = false;
+ }
+ 
+ CSSStyleSheetImpl::CSSStyleSheetImpl(DOM::NodeImpl *parentNode, CSSStyleSheetImpl *orig)
+     : StyleSheetImpl(parentNode, orig->m_strHref)
+ {
+-    m_lstChildren = new Q3PtrList<StyleBaseImpl>;
++    m_lstChildren = new QList<StyleBaseImpl*>;
+     StyleBaseImpl *rule;
+-    for ( rule = orig->m_lstChildren->first(); rule != 0; rule = orig->m_lstChildren->next() )
++    QListIterator<StyleBaseImpl*> it( *orig->m_lstChildren );
++    while ( it.hasNext() )
+     {
++        rule = it.next();
+         m_lstChildren->append(rule);
+         rule->setParent(this);
+     }
+@@ -151,16 +156,19 @@
+     m_implicit = false;
+     m_namespaces = 0;
+     m_defaultNamespace = anyNamespace;
++    m_processed = false;
+ }
+ 
+ CSSStyleSheetImpl::CSSStyleSheetImpl(CSSRuleImpl *ownerRule, CSSStyleSheetImpl *orig)
+     : StyleSheetImpl(ownerRule, orig->m_strHref)
+ {
+     // m_lstChildren is deleted in StyleListImpl
+-    m_lstChildren = new Q3PtrList<StyleBaseImpl>;
++    m_lstChildren = new QList<StyleBaseImpl*>;
+     StyleBaseImpl *rule;
+-    for ( rule = orig->m_lstChildren->first(); rule != 0; rule = orig->m_lstChildren->next() )
++    QListIterator<StyleBaseImpl*> it( *orig->m_lstChildren );
++    while ( it.hasNext() )
+     {
++        rule = it.next();
+         m_lstChildren->append(rule);
+         rule->setParent(this);
+     }
+@@ -168,6 +176,7 @@
+     m_implicit = false;
+     m_namespaces = 0;
+     m_defaultNamespace = anyNamespace;
++    m_processed = false;
+ }
+ 
+ CSSRuleImpl *CSSStyleSheetImpl::ownerRule() const
+@@ -180,7 +189,7 @@
+ unsigned long CSSStyleSheetImpl::insertRule( const DOMString &rule, unsigned long index, int &exceptioncode )
+ {
+     exceptioncode = 0;
+-    if(index > m_lstChildren->count()) {
++    if (index > (unsigned) m_lstChildren->count()) {
+         exceptioncode = DOMException::INDEX_SIZE_ERR;
+         return 0;
+     }
+@@ -200,19 +209,20 @@
+     return index;
+ }
+ 
+-CSSRuleList CSSStyleSheetImpl::cssRules()
++CSSRuleListImpl *CSSStyleSheetImpl::cssRules(bool omitCharsetRules)
+ {
+-    return this;
++    return new CSSRuleListImpl(this, omitCharsetRules);
+ }
+ 
+ void CSSStyleSheetImpl::deleteRule( unsigned long index, int &exceptioncode )
+ {
+     exceptioncode = 0;
+-    StyleBaseImpl *b = m_lstChildren->take(index);
+-    if(!b) {
++    if (index+1 > (unsigned) m_lstChildren->count()) {
+         exceptioncode = DOMException::INDEX_SIZE_ERR;
+         return;
+     }
++    StyleBaseImpl *b = m_lstChildren->takeAt(index);
++
+     // TreeShared requires delete not deref when removed from tree
+     b->setParent(0);
+     if( !b->refCount() ) delete b;
+@@ -220,7 +230,7 @@
+         m_doc->updateStyleSelector(true /*shallow*/);
+ }
+ 
+-void CSSStyleSheetImpl::addNamespace(CSSParser* p, const DOM::DOMString& prefix, const DOM::DOMString& uri)
++void CSSStyleSheetImpl::addNamespace(CSSParser* /*p*/, const DOM::DOMString& prefix, const DOM::DOMString& uri)
+ {
+     int exceptioncode = 0;
+     if (uri.isEmpty())
+@@ -253,7 +263,7 @@
+             Q_ASSERT(m_doc != 0);
+ 
+             // Look up the id for this namespace URI.
+-            Q_UINT16 nsid = m_doc->getId(NodeImpl::NamespaceId, 0, 0, ns->uri().implementation(), false, false, &exceptioncode);
++            quint16 nsid = m_doc->getId(NodeImpl::NamespaceId, 0, 0, ns->uri().implementation(), false, false, &exceptioncode);
+             id = makeId(nsid, localNamePart(id));
+         }
+     }
+@@ -274,8 +284,10 @@
+ bool CSSStyleSheetImpl::isLoading() const
+ {
+     StyleBaseImpl *rule;
+-    for ( rule = m_lstChildren->first(); rule != 0; rule = m_lstChildren->next() )
++    QListIterator<StyleBaseImpl*> it( *m_lstChildren );
++    while ( it.hasNext() )
+     {
++        rule = it.next();
+         if(rule->isImportRule())
+         {
+             CSSImportRuleImpl *import = static_cast<CSSImportRuleImpl *>(rule);
+@@ -299,16 +311,19 @@
+     if(isLoading()) return;
+     if(m_parent) m_parent->checkLoaded();
+     if(m_parentNode) m_parentNode->sheetLoaded();
++    m_processed = true;
+ }
+ 
+ void CSSStyleSheetImpl::setNonCSSHints()
+ {
+-    StyleBaseImpl *rule = m_lstChildren->first();
+-    while(rule) {
++    StyleBaseImpl *rule;
++    QListIterator<StyleBaseImpl*> it( *m_lstChildren );
++    while ( it.hasNext() )
++    {
++        rule = it.next();                
+         if(rule->isStyleRule()) {
+             static_cast<CSSStyleRuleImpl *>(rule)->setNonCSSHints();
+         }
+-        rule = m_lstChildren->next();
+     }
+ }
+ 
+@@ -318,13 +333,13 @@
+ 
+ StyleSheetListImpl::~StyleSheetListImpl()
+ {
+-    for ( Q3PtrListIterator<StyleSheetImpl> it ( styleSheets ); it.current(); ++it )
+-        it.current()->deref();
++    foreach (StyleSheetImpl* sh, styleSheets)
++        sh->deref();
+ }
+ 
+ void StyleSheetListImpl::add( StyleSheetImpl* s )
+ {
+-    if ( !styleSheets.containsRef( s ) ) {
++    if ( !styleSheets.contains( s ) ) {
+         s->ref();
+         styleSheets.append( s );
+     }
+@@ -332,7 +347,7 @@
+ 
+ void StyleSheetListImpl::remove( StyleSheetImpl* s )
+ {
+-    if ( styleSheets.removeRef( s ) )
++    if ( styleSheets.removeAll( s ) )
+         s->deref();
+ }
+ 
+@@ -340,9 +355,8 @@
+ {
+     // hack so implicit BODY stylesheets don't get counted here
+     unsigned long l = 0;
+-    Q3PtrListIterator<StyleSheetImpl> it(styleSheets);
+-    for (; it.current(); ++it) {
+-        if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheetImpl*>(it.current())->implicit())
++    foreach (StyleSheetImpl* sh, styleSheets) {
++        if (!sh->isCSSStyleSheet() || !static_cast<CSSStyleSheetImpl*>(sh)->implicit())
+             ++l;
+     }
+     return l;
+@@ -351,11 +365,10 @@
+ StyleSheetImpl *StyleSheetListImpl::item ( unsigned long index )
+ {
+     unsigned long l = 0;
+-    Q3PtrListIterator<StyleSheetImpl> it(styleSheets);
+-    for (; it.current(); ++it) {
+-        if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheetImpl*>(it.current())->implicit()) {
++    foreach (StyleSheetImpl* sh, styleSheets) {
++        if (!sh->isCSSStyleSheet() || !static_cast<CSSStyleSheetImpl*>(sh)->implicit()) {
+             if (l == index)
+-                return it.current();
++                return sh;
+             ++l;
+         }
+     }
+--- a/khtml/css/css_base.h
++++ b/khtml/css/css_base.h
+@@ -31,7 +31,6 @@
+ #include "misc/shared.h"
+ #include <kdemacros.h>
+ #include <QtCore/QDate>
+-#include <Qt3Support/Q3PtrList>
+ 
+ namespace DOM {
+ 
+@@ -209,7 +208,7 @@
+ 	virtual bool isRuleList() const { return false; }
+ 	virtual bool isRule() const { return false; }
+ 	virtual bool isStyleRule() const { return false; }
+-	virtual bool isCharetRule() const { return false; }
++	virtual bool isCharsetRule() const { return false; }
+ 	virtual bool isImportRule() const { return false; }
+ 	virtual bool isMediaRule() const { return false; }
+ 	virtual bool isFontFaceRule() const { return false; }
+@@ -224,7 +223,7 @@
+ 	void setParent(StyleBaseImpl *parent) { m_parent = parent; }
+ 
+ 	static void setParsedValue(int propId, const CSSValueImpl *parsedValue,
+-				   bool important, bool nonCSSHint, Q3PtrList<CSSProperty> *propList);
++				   bool important, bool nonCSSHint, QList<CSSProperty*> *propList);
+ 
+ 	virtual bool parseString(const DOMString &/*cssString*/, bool = false) { return false; }
+ 
+@@ -256,7 +255,7 @@
+ 	void append(StyleBaseImpl *item) { m_lstChildren->append(item); }
+ 
+     protected:
+-	Q3PtrList<StyleBaseImpl> *m_lstChildren;
++	QList<StyleBaseImpl*> *m_lstChildren;
+     };
+ 
+     KDE_NO_EXPORT int getPropertyID(const char *tagStr, int len);
+--- a/khtml/css/csshelper.cpp
++++ b/khtml/css/csshelper.cpp
+@@ -24,7 +24,6 @@
+ #include <QtGui/QFontMetrics>
+ #include <QtGui/QFontInfo>
+ #include <QtGui/QPaintDevice>
+-#include <Qt3Support/Q3PaintDeviceMetrics>
+ #include <QtGui/QFontDatabase>
+ 
+ #include <kcharsets.h>
+--- a/khtml/css/makeprop
++++ b/khtml/css/makeprop
+@@ -49,7 +49,7 @@
+ print ""; \
+ print "#define '$NS'CSS_PROP_TOTAL " (i + 1 - '$num') \
+ }' >> "$prefix"cssproperties.h
+-perl -e 'my $max = 0; while (<>) { chomp; $max = length if $ ax < length; } print "const size_t max'$NS'CSSPropertyNameLength = $max;\n"' < "$prefix"cssproperties.strip >> "$prefix"cssproperties.h
++perl -e 'my $max = 0; while (<>) { chomp; $max = length if $max < length; } print "const size_t max'$NS'CSSPropertyNameLength = $max;\n"' < "$prefix"cssproperties.strip >> "$prefix"cssproperties.h
+ 
+ gperf -a -L 'ANSI-C' -E -C -c -o -t -k '*' -NfindProp"$NS" -Hhash_prop"$prefix" -Wwordlist_prop"$prefix" -D -s 2 "$prefix"cssproperties.gperf > "$prefix"cssproperties.c || exit 1
+ echo -e '#endif\n' >> "$prefix"cssproperties.h
+--- a/khtml/khtml_printsettings.cpp
++++ b/khtml/khtml_printsettings.cpp
+@@ -24,7 +24,7 @@
+ #include <QtGui/QLayout>
+ 
+ KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent)
+-    : KPrintDialogPage(parent)
++    : QWidget(parent)
+ {
+ 	//WhatsThis strings.... (added by pfeifle at kde.org)
+ 	QString whatsThisPrintImages = i18n( "<qt>"
+@@ -67,7 +67,7 @@
+ 		"certainly use much more toner or ink."
+ 		"</p>"
+ 						" </qt>" );
+-	setTitle(i18n("HTML Settings"));
++	setWindowTitle(i18n("HTML Settings"));
+ 
+ 	m_printfriendly = new QCheckBox(i18n("Printer friendly mode (black text, no background)"), this);
+ 	m_printfriendly->setWhatsThis(whatsThisPrinterFriendlyMode);
+@@ -80,8 +80,8 @@
+ 	m_printheader->setChecked(true);
+ 
+ 	QVBoxLayout	*l0 = new QVBoxLayout(this);
+-  l0->setMargin(0);
+-  l0->setSpacing(10);
++	l0->setMargin(0);
++	l0->setSpacing(10);
+ 	l0->addWidget(m_printfriendly);
+ 	l0->addWidget(m_printimages);
+ 	l0->addWidget(m_printheader);
+@@ -92,18 +92,20 @@
+ {
+ }
+ 
+-void KHTMLPrintSettings::getOptions(QMap<QString,QString>& opts, bool /*incldef*/)
++bool KHTMLPrintSettings::printFriendly()
+ {
+-	opts["app-khtml-printfriendly"] = (m_printfriendly->isChecked() ? "true" : "false");
+-	opts["app-khtml-printimages"] = (m_printimages->isChecked() ? "true" : "false");
+-	opts["app-khtml-printheader"] = (m_printheader->isChecked() ? "true" : "false");
++	return m_printfriendly->isChecked();
+ }
+ 
+-void KHTMLPrintSettings::setOptions(const QMap<QString,QString>& opts)
++bool KHTMLPrintSettings::printImages()
+ {
+-	m_printfriendly->setChecked(opts["app-khtml-printfriendly"] != "false");
+-	m_printimages->setChecked(opts["app-khtml-printimages"] != "false");
+-	m_printheader->setChecked(opts["app-khtml-printheader"] != "false");
++	return m_printimages->isChecked();
+ }
+ 
++bool KHTMLPrintSettings::printHeader()
++{
++	return m_printheader->isChecked();
++}
++
++
+ #include "khtml_printsettings.moc"
+--- a/khtml/test_regression.cpp
++++ b/khtml/test_regression.cpp
+@@ -37,6 +37,7 @@
+ #include <kstandarddirs.h>
+ #include <QtGui/QImage>
+ #include <QtCore/QFile>
++#include <QtCore/QEventLoop>
+ #include <stdio.h>
+ 
+ #include "css/cssstyleselector.h"
+@@ -190,7 +191,7 @@
+         case CT_PushButton:
+             return QSize(size.width(), size.height() - 1);
+         case CT_LineEdit:
+-	    if (widget && widget->parentWidget() && !qstricmp(widget->parentWidget()->className(), "KUrlRequester"))
++	    if (widget && widget->parentWidget() && !qstricmp(widget->parentWidget()->metaObject()->className(), "KUrlRequester"))
+ 		return QSize(size.width() + 1, size.height());
+             return QSize(size.width() + 2, size.height() + 2);
+         case CT_ComboBox:
+@@ -277,6 +278,7 @@
+ {
+    if (this == sm_highestMonitor)
+ 	sm_highestMonitor = 0;
++   qDeleteAll(m_eventLoopStack);
+ }
+ 
+ 
+@@ -289,7 +291,7 @@
+ 
+ 	sm_highestMonitor = this;
+ 
+-        qApp->enter_loop();
++        enterLoop();
+ 
+         //connect(m_timeout_timer, SIGNAL(timeout()), this, SLOT( timeout() ) );
+         //m_timeout_timer->stop();
+@@ -297,12 +299,27 @@
+     }
+ 
+     QTimer::singleShot( 0, this, SLOT( finishTimers() ) );
+-    qApp->enter_loop();
++    enterLoop();
++}
++
++void PartMonitor::enterLoop()
++{
++    if (m_eventLoopStack.isEmpty() || m_eventLoopStack.top()->isRunning())
++        m_eventLoopStack.push(new QEventLoop());
++    m_eventLoopStack.top()->exec();
++}
++
++void PartMonitor::exitLoop()
++{
++    while (!m_eventLoopStack.isEmpty() && !m_eventLoopStack.top()->isRunning())
++        delete m_eventLoopStack.pop();
++    if (!m_eventLoopStack.isEmpty())
++        m_eventLoopStack.top()->exit();
+ }
+ 
+ void PartMonitor::timeout()
+ {
+-    qApp->exit_loop();
++    exitLoop();
+ }
+ 
+ void PartMonitor::finishTimers()
+@@ -314,7 +331,7 @@
+         QTimer::singleShot( 10, this, SLOT(finishTimers() ) );
+         return;
+     }
+-    qApp->exit_loop();
++    exitLoop();
+ }
+ 
+ void PartMonitor::partCompleted()
+@@ -749,7 +766,6 @@
+ 	visual = true;
+ 
+     a.setTopWidget(part->widget());
+-    a.setMainWidget( toplevel );
+     if ( visual )
+         toplevel->show();
+ 
+@@ -853,6 +869,7 @@
+   : QObject(part)
+ {
+     m_part = part;
++
+     m_baseDir = baseDir;
+     m_baseDir = m_baseDir.replace( "//", "/" );
+     if ( m_baseDir.endsWith( "/" ) )	//krazy:exclude=duoblequote_chars DOM demands chars
+@@ -887,6 +904,7 @@
+ 
+     curr = this;
+     m_part->view()->setFrameStyle(QFrame::StyledPanel | QFrame::Plain);
++    resizeTopLevelWidget(800, 598 );
+ }
+ 
+ 
+@@ -1141,7 +1159,7 @@
+     if (ew * eh > 4000 * 4000) // don't DoS us
+         return QImage();
+ 
+-    QImage img( ew, eh, 32 );
++    QImage img( ew, eh, QImage::Format_ARGB32 );
+     img.fill( 0xff0000 );
+     if (!m_paintBuffer )
+         m_paintBuffer = new QPixmap( 512, 128 );
+@@ -1435,7 +1453,7 @@
+ 
+ void RegressionTest::testStaticFile(const QString & filename)
+ {
+-    qApp->mainWidget()->resize( 800, 598 ); // restore size
++    resizeTopLevelWidget( 800, 598 ); // restore size
+ 
+     // Set arguments
+     KParts::OpenUrlArguments args;
+@@ -1587,7 +1605,7 @@
+ 
+ void RegressionTest::testJSFile(const QString & filename )
+ {
+-    qApp->mainWidget()->resize( 800, 598 ); // restore size
++    resizeTopLevelWidget( 800, 598 ); // restore size
+ 
+     // create interpreter
+     // note: this is different from the interpreter used by the part,
+@@ -1824,7 +1842,7 @@
+ 
+ void RegressionTest::resizeTopLevelWidget( int w, int h )
+ {
+-    qApp->mainWidget()->resize( w, h );
++    m_part->widget()->parentWidget()->resize( w, h );
+     // Since we're not visible, this doesn't have an immediate effect, QWidget posts the event
+     QApplication::sendPostedEvents( 0, QEvent::Resize );
+ }
+--- a/khtml/xml/xml_tokenizer.h
++++ b/khtml/xml/xml_tokenizer.h
+@@ -24,8 +24,8 @@
+ #define _XML_Tokenizer_h_
+ 
+ #include <Qt/qxml.h>
+-#include <Qt3Support/Q3PtrList>
+ #include <QtCore/QStack>
++#include <QtCore/QLinkedList>
+ #include <QMap>
+ #include <QtCore/QObject>
+ #include "misc/loader_client.h"
+@@ -183,8 +183,8 @@
+     void executeScripts();
+     void addScripts(DOM::NodeImpl *n);
+ 
+-    Q3PtrList<DOM::HTMLScriptElementImpl> m_scripts;
+-    Q3PtrListIterator<DOM::HTMLScriptElementImpl> *m_scriptsIt;
++    QLinkedList<DOM::HTMLScriptElementImpl*> m_scripts;
++    QLinkedListIterator<DOM::HTMLScriptElementImpl*> *m_scriptsIt;
+     khtml::CachedScript *m_cachedScript;
+ 
+     XMLHandler m_handler;
+--- a/khtml/xml/dom_nodeimpl.cpp
++++ b/khtml/xml/dom_nodeimpl.cpp
+@@ -48,7 +48,6 @@
+ #include <QMouseEvent>
+ #include <QKeyEvent>
+ #include <QEvent>
+-#include <Q3PtrList>
+ 
+ // from khtml_caret_p.h
+ namespace khtml {
+@@ -432,7 +431,7 @@
+     // ### check that type specified
+ 
+     // work out what nodes to send event to
+-    Q3PtrList<NodeImpl> nodeChain;
++    QList<NodeImpl*> nodeChain;
+     NodeImpl *n;
+  
+     if (inDocument()) {
+@@ -448,40 +447,50 @@
+ 
+     // trigger any capturing event handlers on our way down
+     evt->setEventPhase(Event::CAPTURING_PHASE);
+-    Q3PtrListIterator<NodeImpl> it(nodeChain);
+-    for (; it.current() && it.current() != this && !evt->propagationStopped(); ++it) {
+-        evt->setCurrentTarget(it.current());
+-        it.current()->handleLocalEvents(evt,true);
++    QListIterator<NodeImpl*> it(nodeChain);
++    while (it.hasNext()) {
++        NodeImpl* cur = it.next();
++        if (cur == this || evt->propagationStopped())
++            break;
++        cur->handleLocalEvents(evt,true);
+     }
+ 
+     // dispatch to the actual target node
+-    it.toLast();
++    it.toBack();
++    NodeImpl* curn = it.hasPrevious() ? it.previous() : 0;
+     NodeImpl* propagationSentinel = 0;
+-    if (!evt->propagationStopped()) {
++    if (curn && !evt->propagationStopped()) {
+         evt->setEventPhase(Event::AT_TARGET);
+-        evt->setCurrentTarget(it.current());
+-        it.current()->handleLocalEvents(evt, true);
++        evt->setCurrentTarget(curn);
++        curn->handleLocalEvents(evt, true);
+         if (!evt->propagationStopped())
+-            it.current()->handleLocalEvents(evt,false);
++            curn->handleLocalEvents(evt,false);
+         else
+-            propagationSentinel = it.current();
++            propagationSentinel = curn;
+     }
+-    --it;
++
++    curn = it.hasPrevious() ? it.previous() : 0;
+ 
+     if (evt->bubbles()) {
+         evt->setEventPhase(Event::BUBBLING_PHASE);
+-        for (; it.current() && !evt->propagationStopped(); --it) {
+-            if (evt->propagationStopped()) propagationSentinel = it.current();
+-            evt->setCurrentTarget(it.current());
+-            it.current()->handleLocalEvents(evt,false);
++        while (curn && !evt->propagationStopped()) {
++            if (evt->propagationStopped()) propagationSentinel = curn;
++            evt->setCurrentTarget(curn);
++            curn->handleLocalEvents(evt,false);
++            curn = it.hasPrevious() ? it.previous() : 0;
+         }
+ 
+         // now we call all default event handlers (this is not part of DOM - it is internal to khtml)
+         evt->setCurrentTarget(0);
+         evt->setEventPhase(0); // I guess this is correct, the spec does not seem to say
+-        for (it.toLast(); it.current() && it.current() != propagationSentinel &&
+-                 !evt->defaultPrevented() && !evt->defaultHandled(); --it)
+-            it.current()->defaultEventHandler(evt);
++
++        it.toBack();
++        while (it.hasPrevious()) {
++            curn = it.previous();
++            if (curn == propagationSentinel || evt->defaultPrevented() || evt->defaultHandled())
++                break;
++            curn->defaultEventHandler(evt);
++        }
+ 
+         if (evt->id() == EventImpl::CLICK_EVENT && !evt->defaultPrevented() &&
+              static_cast<MouseEventImpl*>( evt )->button() == 0) // LMB click
+@@ -493,9 +502,9 @@
+     doc->ref();
+ 
+     // deref all nodes in chain
+-    it.toFirst();
+-    for (; it.current(); ++it)
+-        it.current()->deref(); // this may delete us
++    it.toFront();
++    while (it.hasNext())
++        it.next()->deref(); // this may delete us
+ 
+     DocumentImpl::updateDocumentsRendering();
+     doc->deref();
+@@ -2034,13 +2043,13 @@
+     : NamedNodeMapImpl()
+ {
+     m_doc = doc;
+-    m_contents = new Q3PtrList<NodeImpl>;
++    m_contents = new QList<NodeImpl*>;
+ }
+ 
+ GenericRONamedNodeMapImpl::~GenericRONamedNodeMapImpl()
+ {
+     while (!m_contents->isEmpty())
+-        m_contents->take(0)->deref();
++        m_contents->takeLast()->deref();
+ 
+     delete m_contents;
+ }
+@@ -2048,10 +2057,10 @@
+ NodeImpl *GenericRONamedNodeMapImpl::getNamedItem ( NodeImpl::Id id, bool /*nsAware*/, DOMStringImpl* /*qName*/ ) const
+ {
+     // ## do we need namespace support in this class?
+-    Q3PtrListIterator<NodeImpl> it(*m_contents);
+-    for (; it.current(); ++it)
+-        if (it.current()->id() == id)
+-            return it.current();
++    QListIterator<NodeImpl*> it(*m_contents);
++    while (it.hasNext())
++        if (it.next()->id() == id)
++            return it.peekPrevious();
+     return 0;
+ }
+ 
+@@ -2073,7 +2082,7 @@
+ 
+ NodeImpl *GenericRONamedNodeMapImpl::item ( unsigned long index ) const
+ {
+-    if (index >= m_contents->count())
++    if (index >= (unsigned int) m_contents->count())
+         return 0;
+ 
+     return m_contents->at(index);
+--- a/khtml/xml/dom2_eventsimpl.cpp
++++ b/khtml/xml/dom2_eventsimpl.cpp
+@@ -30,6 +30,7 @@
+ #include "dom_stringimpl.h"
+ #include "dom_nodeimpl.h"
+ #include "dom_docimpl.h"
++#include "misc/translator.h"
+ #include <rendering/render_layer.h>
+ #include <khtmlview.h>
+ 
+@@ -492,47 +493,6 @@
+ }
+ 
+ //---------------------------------------------------------------------------------------------
+-/* This class is used to do remapping between different encodings reasonably compactly */
+-
+-template<typename L, typename R, typename MemL>
+-class IDTranslator
+-{
+-public:
+-    struct Info {
+-        MemL l;
+-        R    r;
+-    };
+-
+-    IDTranslator(const Info* table) {
+-        for (const Info* cursor = table; cursor->l; ++cursor) {
+-            m_lToR.insert(cursor->l,  cursor->r);
+-            m_rToL.insert(cursor->r,  cursor->l);
+-        }
+-    }
+-
+-    L toLeft(R r) {
+-        typename QMap<R,L>::iterator i( m_rToL.find(r) );
+-        if (i != m_rToL.end())
+-            return *i;
+-        return L();
+-    }
+-
+-    R toRight(L l) {
+-        typename QMap<L,R>::iterator i = m_lToR.find(l);
+-        if (i != m_lToR.end())
+-            return *i;
+-        return R();
+-    }
+-
+-private:
+-    QMap<L, R> m_lToR;
+-    QMap<R, L> m_rToL;
+-};
+-
+-#define MAKE_TRANSLATOR(name,L,R,MR,table) static IDTranslator<L,R,MR>* s_##name; \
+-    static IDTranslator<L,R,MR>* name() { if (!s_##name) s_##name = new IDTranslator<L,R,MR>(table); \
+-        return s_##name; }
+-//---------------------------------------------------------------------------------------------
+ 
+ /* Mapping between special Qt keycodes and virtual DOM codes */
+ IDTranslator<unsigned, unsigned, unsigned>::Info virtKeyToQtKeyTable[] =
+@@ -557,8 +517,8 @@
+     {KeyEventBaseImpl::DOM_VK_RIGHT,        Qt::Key_Right},
+     {KeyEventBaseImpl::DOM_VK_UP,           Qt::Key_Up},
+     {KeyEventBaseImpl::DOM_VK_DOWN,         Qt::Key_Down},
+-    {KeyEventBaseImpl::DOM_VK_PAGE_DOWN,    Qt::Key_Next},
+-    {KeyEventBaseImpl::DOM_VK_PAGE_UP,      Qt::Key_Prior},
++    {KeyEventBaseImpl::DOM_VK_PAGE_DOWN,    Qt::Key_PageDown},
++    {KeyEventBaseImpl::DOM_VK_PAGE_UP,      Qt::Key_PageUp},
+     {KeyEventBaseImpl::DOM_VK_F1,           Qt::Key_F1},
+     {KeyEventBaseImpl::DOM_VK_F2,           Qt::Key_F2},
+     {KeyEventBaseImpl::DOM_VK_F3,           Qt::Key_F3},
+@@ -726,10 +686,10 @@
+ 
+ /** These are the modifiers we currently support */
+ static const IDTranslator<QByteArray, unsigned, const char*>::Info keyModifiersToCodeTable[] = {
+-    {"Alt",         Qt::AltButton},
+-    {"Control",     Qt::ControlButton},
+-    {"Shift",       Qt::ShiftButton},
+-    {"Meta",        Qt::MetaButton},
++    {"Alt",         Qt::AltModifier},
++    {"Control",     Qt::ControlModifier},
++    {"Shift",       Qt::ShiftModifier},
++    {"Meta",        Qt::MetaModifier},
+     {0,             0}
+ };
+ 
+--- a/khtml/xml/dom_nodeimpl.h
++++ b/khtml/xml/dom_nodeimpl.h
+@@ -34,7 +34,6 @@
+ // The namespace used for XHTML elements
+ #define XHTML_NAMESPACE "http://www.w3.org/1999/xhtml"
+ 
+-template <class type> class Q3PtrList;
+ template <class type> class QList;
+ class KHTMLView;
+ class QRect;
+@@ -740,7 +739,7 @@
+ 
+ protected:
+     DocumentImpl* m_doc;
+-    Q3PtrList<NodeImpl> *m_contents;
++    QList<NodeImpl*> *m_contents;
+ };
+ 
+ } //namespace
+--- a/khtml/xml/dom2_eventsimpl.h
++++ b/khtml/xml/dom2_eventsimpl.h
+@@ -338,10 +338,10 @@
+                          unsigned long virtKeyVal,
+                          unsigned long modifiers);
+ 
+-  bool ctrlKey()  const { return m_modifier & Qt::ControlButton; }
+-  bool shiftKey() const { return m_modifier & Qt::ShiftButton; }
+-  bool altKey()   const { return m_modifier & Qt::AltButton; }
+-  bool metaKey()  const { return m_modifier & Qt::MetaButton; }
++  bool ctrlKey()  const { return m_modifier & Qt::ControlModifier; }
++  bool shiftKey() const { return m_modifier & Qt::ShiftModifier; }
++  bool altKey()   const { return m_modifier & Qt::AltModifier; }
++  bool metaKey()  const { return m_modifier & Qt::MetaModifier; }
+ 
+   bool             inputGenerated() const { return m_virtKeyVal == 0; }
+   unsigned long    keyVal() const     { return m_keyVal; }
+--- a/khtml/xml/dom_docimpl.cpp
++++ b/khtml/xml/dom_docimpl.cpp
+@@ -48,7 +48,6 @@
+ #include <QtCore/QStack>
+ //Added by qt3to4:
+ #include <QTimerEvent>
+-#include <Q3PtrList>
+ #include <QtCore/QList>
+ #include <kdebug.h>
+ #include <klocale.h>
+@@ -237,16 +236,20 @@
+ 
+ // ------------------------------------------------------------------------
+ 
+-ElementMappingCache::ElementMappingCache():m_dict(257)
++ElementMappingCache::ElementMappingCache():m_dict()
+ {
+-    m_dict.setAutoDelete(true);
++}
++
++ElementMappingCache::~ElementMappingCache()
++{
++    qDeleteAll( m_dict );
+ }
+ 
+ void ElementMappingCache::add(const QString& id, ElementImpl* nd)
+ {
+     if (id.isEmpty()) return;
+ 
+-    ItemInfo* info = m_dict.find(id);
++    ItemInfo* info = m_dict.value(id);
+     if (info)
+     {
+         info->ref++;
+@@ -265,7 +268,8 @@
+ {
+     if (id.isEmpty()) return;
+ 
+-    ItemInfo* info = m_dict.find(id);
++    assert(m_dict.contains(id));
++    ItemInfo* info = m_dict.value(id);
+     info->nd = nd;
+ }
+ 
+@@ -273,7 +277,8 @@
+ {
+     if (id.isEmpty()) return;
+ 
+-    ItemInfo* info = m_dict.find(id);
++    assert(m_dict.contains(id));
++    ItemInfo* info = m_dict.value(id);
+     info->ref--;
+     if (info->ref == 0)
+     {
+@@ -290,13 +295,13 @@
+ bool ElementMappingCache::contains(const QString& id)
+ {
+     if (id.isEmpty()) return false;
+-    return m_dict.find(id);
++    return m_dict.contains(id);
+ }
+ 
+ ElementMappingCache::ItemInfo* ElementMappingCache::get(const QString& id)
+ {
+     if (id.isEmpty()) return 0;
+-    return m_dict.find(id);
++    return m_dict.value(id);
+ }
+ 
+ typedef QList<DocumentImpl*> ChangedDocuments ;
+@@ -304,7 +309,7 @@
+ 
+ // KHTMLView might be 0
+ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
+-    : NodeBaseImpl( 0 ), m_domtree_version(0), m_counterDict(257),
++    : NodeBaseImpl( 0 ), m_domtree_version(0), m_counterDict(),
+       m_imageLoadEventTimer(0)
+ {
+     m_document.resetSkippingRef(this); //Make getDocument return us..
+@@ -366,7 +371,6 @@
+     m_inDocument = true;
+     m_styleSelectorDirty = false;
+     m_styleSelector = 0;
+-    m_counterDict.setAutoDelete(true);
+ 
+     m_inStyleRecalc = false;
+     m_pendingStylesheets = 0;
+@@ -374,8 +378,9 @@
+     m_async = true;
+     m_hadLoadError = false;
+     m_docLoading = false;
+-    m_inSyncLoad = false;
++    m_inSyncLoad = 0;
+     m_loadingXMLDoc = 0;
++    m_documentElement = 0;
+     m_cssTarget = 0;
+     m_dynamicDomRestyler = new khtml::DynamicDomRestyler();
+ }
+@@ -420,6 +425,11 @@
+             m_activeNode->deref();
+             m_activeNode = 0;
+         }
++        
++        if (m_documentElement) {
++            m_documentElement->deref();
++            m_documentElement = 0;
++        }
+ 
+         removeChildren();
+ 
+@@ -436,9 +446,9 @@
+     //you may also have to fix removedLastRef() above - M.O.
+     assert( !m_render );
+ 
+-    Q3IntDictIterator<NodeListImpl::Cache> it(m_nodeListCache);
+-    for (; it.current(); ++it)
+-        it.current()->deref();
++    QHashIterator<long,NodeListImpl::Cache*> it(m_nodeListCache);
++    while (it.hasNext())
++        it.next().value()->deref();
+ 
+     if (m_loadingXMLDoc)
+ 	m_loadingXMLDoc->deref(this);
+@@ -468,6 +478,9 @@
+         m_hoverNode->deref();
+     if (m_activeNode)
+         m_activeNode->deref();
++    if (m_documentElement)
++        m_documentElement->deref();
++    qDeleteAll(m_counterDict);
+ 
+     m_renderArena.reset();
+ 
+@@ -485,12 +498,25 @@
+     return m_implementation;
+ }
+ 
++void DocumentImpl::childrenChanged()
++{
++    // invalidate the document element we have cached in case it was replaced
++    if (m_documentElement)
++        m_documentElement->deref();
++    m_documentElement = 0;
++}
++
+ ElementImpl *DocumentImpl::documentElement() const
+ {
+-    NodeImpl *n = firstChild();
+-    while (n && n->nodeType() != Node::ELEMENT_NODE)
+-      n = n->nextSibling();
+-    return static_cast<ElementImpl*>(n);
++    if (!m_documentElement) {
++        NodeImpl* n = firstChild();
++        while (n && n->nodeType() != Node::ELEMENT_NODE)
++            n = n->nextSibling();
++        m_documentElement = static_cast<ElementImpl*>(n);
++        if (m_documentElement)
++            m_documentElement->ref();
++    }
++    return m_documentElement;
+ }
+ 
+ ElementImpl *DocumentImpl::createElement( const DOMString &name, int* pExceptioncode )
+@@ -1056,16 +1082,16 @@
+ QStringList DocumentImpl::docState()
+ {
+     QStringList s;
+-    for (Q3PtrListIterator<NodeImpl> it(m_maintainsState); it.current(); ++it)
+-        s.append(it.current()->state());
++    for (QListIterator<NodeImpl*> it(m_maintainsState); it.hasNext();)
++        s.append(it.next()->state());
+ 
+     return s;
+ }
+ 
+ bool DocumentImpl::unsubmittedFormChanges()
+ {
+-    for (Q3PtrListIterator<NodeImpl> it(m_maintainsState); it.current(); ++it)
+-        if (it.current()->state().endsWith('M'))
++    for (QListIterator<NodeImpl*> it(m_maintainsState); it.hasNext();)
++        if (it.next()->state().endsWith('M'))
+             return true;
+ 
+     return false;
+@@ -1877,17 +1903,17 @@
+     QString name = cs ? n : n.toUpper();
+ 
+     if (!_nsURI) {
+-        id = (NodeImpl::Id)(long) map->ids.find( name );
++        id = (NodeImpl::Id)(long)map->ids.value( name );
+         if (!id && _type != NodeImpl::NamespaceId) {
+-            id = (NodeImpl::Id)(long) map->ids.find( "aliases: " + name );
++            id = (NodeImpl::Id)(long)map->ids.value( "aliases: " + name );
+ 	}
+     } else {
+-        id = (NodeImpl::Id)(long) map->ids.find( name );
++        id = (NodeImpl::Id)(long)map->ids.value( name );
+         if (!readonly && id && _prefix && _prefix->l) {
+             // we were called in registration mode... check if the alias exists
+             const QString px = QString::fromRawData( _prefix->s, _prefix->l );
+             QString qn("aliases: " + (cs ? px : px.toUpper()) + ":" + name);	//krazy:exclude=doublequote_chars DOM demands chars
+-            if (!map->ids.find( qn )) {
++            if (!map->ids.contains( qn )) {
+                 map->ids.insert( qn, (void*)id );
+             }
+         }
+@@ -2013,7 +2039,7 @@
+ 
+     if (m_addedStyleSheets) {
+         bool in_main_list = !sheet->hasOneRef();
+-        removed = m_addedStyleSheets->styleSheets.removeRef(sheet);
++        removed = m_addedStyleSheets->styleSheets.removeAll(sheet);
+         sheet->deref();
+ 
+         if (m_addedStyleSheets->styleSheets.count() == 0) {
+@@ -2061,7 +2087,7 @@
+ 
+     assert(m_pendingStylesheets==0);
+ 
+-    Q3PtrList<StyleSheetImpl> oldStyleSheets = m_styleSheets->styleSheets;
++    QList<StyleSheetImpl*> oldStyleSheets = m_styleSheets->styleSheets;
+     m_styleSheets->styleSheets.clear();
+     QString sheetUsed = view() ? view()->part()->d->m_sheetUsed.replace("&&", "&") : QString();
+     bool autoselect = sheetUsed.isEmpty();
+@@ -2183,17 +2209,15 @@
+ 
+     // Include programmatically added style sheets
+     if (m_addedStyleSheets) {
+-        Q3PtrListIterator<StyleSheetImpl> it = m_addedStyleSheets->styleSheets;
+-        for (; *it; ++it) {
+-            if ((*it)->isCSSStyleSheet() && !(*it)->disabled())
+-                m_styleSheets->add(*it);
++        foreach (StyleSheetImpl* sh, m_addedStyleSheets->styleSheets) {
++            if (sh->isCSSStyleSheet() && !sh->disabled())
++                m_styleSheets->add(sh);
+         }
+     }
+ 
+     // De-reference all the stylesheets in the old list
+-    Q3PtrListIterator<StyleSheetImpl> it(oldStyleSheets);
+-    for (; it.current(); ++it)
+-	it.current()->deref();
++    foreach ( StyleSheetImpl* sh, oldStyleSheets)
++        sh->deref();
+ 
+     rebuildStyleSelector();
+ }
+@@ -2327,14 +2351,16 @@
+ 
+ void DocumentImpl::detachNodeIterator(NodeIteratorImpl *ni)
+ {
+-    m_nodeIterators.remove(ni);
++    int i = m_nodeIterators.indexOf(ni);
++    if (i != -1)
++        m_nodeIterators.removeAt(i);
+ }
+ 
+ void DocumentImpl::notifyBeforeNodeRemoval(NodeImpl *n)
+ {
+-    Q3PtrListIterator<NodeIteratorImpl> it(m_nodeIterators);
+-    for (; it.current(); ++it)
+-        it.current()->notifyBeforeNodeRemoval(n);
++    QListIterator<NodeIteratorImpl*> it(m_nodeIterators);
++    while (it.hasNext())
++        it.next()->notifyBeforeNodeRemoval(n);
+ }
+ 
+ bool DocumentImpl::isURLAllowed(const QString& url) const
+@@ -2411,8 +2437,8 @@
+ void DocumentImpl::abort()
+ {
+     if (m_inSyncLoad) {
+-	m_inSyncLoad = false;
+-	qApp->exit_loop();
++        assert(m_inSyncLoad->isRunning());
++        m_inSyncLoad->exit();
+     }
+ 
+     if (m_loadingXMLDoc)
+@@ -2423,8 +2449,8 @@
+ void DocumentImpl::load(const DOMString &uri)
+ {
+     if (m_inSyncLoad) {
+-	m_inSyncLoad = false;
+-	qApp->exit_loop();
++        assert(m_inSyncLoad->isRunning());
++        m_inSyncLoad->exit();
+     }
+ 
+     m_hadLoadError = false;
+@@ -2449,8 +2475,13 @@
+     m_loadingXMLDoc->ref(this);
+ 
+     if (!m_async && m_docLoading) {
+-	m_inSyncLoad = true;
+-	qApp->enter_loop();
++        assert(!m_inSyncLoad);
++	m_inSyncLoad = new QEventLoop();
++	m_inSyncLoad->exec();
++	// returning from event loop:
++	assert(!m_inSyncLoad->isRunning());
++	delete m_inSyncLoad;
++	m_inSyncLoad = 0;
+     }
+ }
+ 
+@@ -2472,8 +2503,8 @@
+ 
+     m_docLoading = false;
+     if (m_inSyncLoad) {
+-	m_inSyncLoad = false;
+-	qApp->exit_loop();
++        assert(m_inSyncLoad->isRunning());
++        m_inSyncLoad->exit();
+     }
+ 
+     assert(m_loadingXMLDoc != 0);
+@@ -2485,8 +2516,8 @@
+ {
+     m_docLoading = false;
+     if (m_inSyncLoad) {
+-	m_inSyncLoad = false;
+-	qApp->exit_loop();
++        assert(m_inSyncLoad->isRunning());
++        m_inSyncLoad->exit();
+     }
+ 
+     m_hadLoadError = true;
+@@ -2573,9 +2604,8 @@
+ void DocumentImpl::removeImage(HTMLImageElementImpl *image)
+ {
+     // Remove instances of this image from both lists.
+-    // Use loops because we allow multiple instances to get into the lists.
+-    while (m_imageLoadEventDispatchSoonList.removeRef(image)) { }
+-    while (m_imageLoadEventDispatchingList.removeRef(image)) { }
++    m_imageLoadEventDispatchSoonList.removeAll(image);
++    m_imageLoadEventDispatchingList.removeAll(image);
+     if (m_imageLoadEventDispatchSoonList.isEmpty() && m_imageLoadEventTimer) {
+         killTimer(m_imageLoadEventTimer);
+         m_imageLoadEventTimer = 0;
+@@ -2598,15 +2628,8 @@
+ 
+     m_imageLoadEventDispatchingList = m_imageLoadEventDispatchSoonList;
+     m_imageLoadEventDispatchSoonList.clear();
+-    for (Q3PtrListIterator<HTMLImageElementImpl> it(m_imageLoadEventDispatchingList); it.current(); ) {
+-        HTMLImageElementImpl* image = it.current();
+-        // Must advance iterator *before* dispatching call.
+-        // Otherwise, it might be advanced automatically if dispatching the call had a side effect
+-        // of destroying the current HTMLImageElementImpl, and then we would advance past the *next*
+-        // item, missing one altogether.
+-        ++it;
+-        image->dispatchLoadEvent();
+-    }
++    for (QLinkedListIterator<HTMLImageElementImpl*> it(m_imageLoadEventDispatchingList); it.hasNext(); )
++        it.next()->dispatchLoadEvent();
+     m_imageLoadEventDispatchingList.clear();
+ }
+ 
+@@ -2702,7 +2725,7 @@
+ 
+     //Check to see if we have this sort of item cached.
+     NodeListImpl::Cache* cached =
+-        (type == NodeListImpl::UNCACHEABLE) ? 0 : m_nodeListCache.find(key.hash());
++        (type == NodeListImpl::UNCACHEABLE) ? 0 : m_nodeListCache.value(key.hash());
+ 
+     if (cached) {
+         if (cached->key == key) {
+@@ -2722,7 +2745,7 @@
+ 
+     if (type != NodeListImpl::UNCACHEABLE) {
+         newInfo->ref(); //Add the cache's reference
+-        m_nodeListCache.replace(key.hash(), newInfo);
++        m_nodeListCache.insert(key.hash(), newInfo);
+     }
+ 
+     return newInfo;
+--- a/khtml/xml/xml_tokenizer.cpp
++++ b/khtml/xml/xml_tokenizer.cpp
+@@ -520,7 +520,7 @@
+         // Parsing was successful. Now locate all html <script> tags in the document and execute them
+         // one by one
+         addScripts(m_doc);
+-        m_scriptsIt = new Q3PtrListIterator<HTMLScriptElementImpl>(m_scripts);
++        m_scriptsIt = new QLinkedListIterator<HTMLScriptElementImpl*>(m_scripts);
+         executeScripts();
+     }
+ 
+@@ -546,14 +546,14 @@
+     // start loading the script and return (executeScripts() will be called again once the script is loaded
+     // and continue where it left off). For scripts that don't have a src attribute, execute the code
+     // inside the tag
+-    while (m_scriptsIt->current()) {
+-        DOMString scriptSrc = m_scriptsIt->current()->getAttribute(ATTR_SRC);
+-        QString charset = m_scriptsIt->current()->getAttribute(ATTR_CHARSET).string();
++    while (m_scriptsIt->hasNext()) {
++        HTMLScriptElementImpl* script = m_scriptsIt->next();
++        DOMString scriptSrc = script->getAttribute(ATTR_SRC);
++        QString charset = script->getAttribute(ATTR_CHARSET).string();
+ 
+         if (!scriptSrc.isEmpty()) {
+             // we have a src attribute
+             m_cachedScript = m_doc->docLoader()->requestScript(scriptSrc, charset);
+-            ++(*m_scriptsIt);
+             if (m_cachedScript) {
+                 m_cachedScript->ref(this); // will call executeScripts() again if already cached
+                 return;
+@@ -563,7 +563,7 @@
+             // no src attribute - execute from contents of tag
+             QString scriptCode = "";
+             NodeImpl *child;
+-            for (child = m_scriptsIt->current()->firstChild(); child; child = child->nextSibling()) {
++            for (child = script->firstChild(); child; child = child->nextSibling()) {
+                 if ( ( child->nodeType() == Node::TEXT_NODE || child->nodeType() == Node::CDATA_SECTION_NODE) &&
+                      static_cast<TextImpl*>(child)->string() )
+                     scriptCode += QString::fromRawData(static_cast<TextImpl*>(child)->string()->s,
+@@ -576,7 +576,6 @@
+             if (m_view) {
+                 m_view->part()->executeScript(DOM::Node(), scriptCode);
+             }
+-            ++(*m_scriptsIt);
+         }
+     }
+ 
+--- a/khtml/xml/dom_docimpl.h
++++ b/khtml/xml/dom_docimpl.h
+@@ -35,11 +35,11 @@
+ #include "misc/seed.h"
+ 
+ #include <QtCore/QStringList>
+-#include <Qt3Support/Q3PtrList>
+ #include <QtCore/QObject>
+-#include <Qt3Support/Q3IntDict>
+-#include <Qt3Support/Q3Dict>
++#include <QtCore/QList>
++#include <QtCore/QHash>
+ #include <QtCore/QMap>
++
+ //Added by qt3to4:
+ #include <QTimerEvent>
+ 
+@@ -48,6 +48,7 @@
+ class QPaintDevice;
+ class QTextCodec;
+ class KHTMLView;
++class QEventLoop;
+ 
+ namespace khtml {
+     class Tokenizer;
+@@ -144,6 +145,7 @@
+     };
+ 
+     ElementMappingCache();
++    ~ElementMappingCache();
+ 
+     /**
+      Add a pointer as just one of candidates, not neccesserily the proper one
+@@ -170,7 +172,7 @@
+     */
+     ItemInfo* get(const QString& id);
+ private:
+-    Q3Dict<ItemInfo> m_dict;
++    QHash<QString,ItemInfo*> m_dict;
+ };
+ 
+ 
+@@ -190,6 +192,7 @@
+ 
+     DOMImplementationImpl *implementation() const;
+     ElementImpl *documentElement() const;
++    virtual void childrenChanged();
+     virtual ElementImpl *createElement ( const DOMString &tagName, int* pExceptioncode = 0 );
+     virtual AttrImpl *createAttribute( const DOMString &tagName, int* pExceptioncode = 0 );
+     DocumentFragmentImpl *createDocumentFragment ();
+@@ -271,7 +274,7 @@
+     QStringList docState();
+     bool unsubmittedFormChanges();
+     void registerMaintainsState(NodeImpl* e) { m_maintainsState.append(e); }
+-    void deregisterMaintainsState(NodeImpl* e) { m_maintainsState.removeRef(e); }
++    void deregisterMaintainsState(NodeImpl* e) { int i; if ((i = m_maintainsState.indexOf(e)) != -1) m_maintainsState.removeAt(i); }
+ 
+     // Set the state the document should restore to
+     void setRestoreState( const QStringList &s);
+@@ -516,9 +519,9 @@
+     void incDOMTreeVersion() { ++m_domtree_version; }
+     unsigned int domTreeVersion() const { return m_domtree_version; }
+ 
+-    Q3Dict<khtml::CounterNode>* counters(const khtml::RenderObject* o) { return m_counterDict[(void*)o]; }
+-    void setCounters(const khtml::RenderObject* o, Q3Dict<khtml::CounterNode> *dict) { m_counterDict.insert((void*)o, dict);}
+-    void removeCounters(const khtml::RenderObject* o) { m_counterDict.remove((void*)o); }
++    QHash<QString,khtml::CounterNode*>* counters(const khtml::RenderObject* o) { return m_counterDict.value(o); }
++    void setCounters(const khtml::RenderObject* o, QHash<QString,khtml::CounterNode*> *dict) { m_counterDict.insert(o, dict);}
++    void removeCounters(const khtml::RenderObject* o) { delete m_counterDict.take(o); }
+ 
+ 
+     ElementMappingCache& underDocNamedCache() {
+@@ -587,21 +590,14 @@
+         IdNameMapping(unsigned short _start)
+             : idStart(_start), count(0) {}
+         ~IdNameMapping() {
+-            Q3IntDictIterator<DOM::DOMStringImpl> it(names);
+-            for (; it.current() ; ++it)
+-                it.current()->deref();
++            QHashIterator<long,DOM::DOMStringImpl*> it(names);
++            while (it.hasNext())
++                it.next().value()->deref();
+         }
+         unsigned short idStart;
+         unsigned short count;
+-        Q3IntDict<DOM::DOMStringImpl> names;
+-        Q3Dict<void> ids;
+-
+-        void expandIfNeeded() {
+-            if (ids.size() <= ids.count() && ids.size() != khtml_MaxSeed)
+-                ids.resize( khtml::nextSeed(ids.count()) );
+-            if (names.size() <= names.count() && names.size() != khtml_MaxSeed)
+-                names.resize( khtml::nextSeed(names.count()) );
+-        }
++        QHash<long,DOM::DOMStringImpl*> names;
++        QHash<QString,void*> ids;
+ 
+         void addAlias(DOMStringImpl* _prefix, DOMStringImpl* _name, bool cs, NodeImpl::Id id) {
+             if(_prefix && _prefix->l) {
+@@ -609,11 +605,10 @@
+                 QString px( _prefix->s, _prefix->l );
+                 QString name = cs ? n : n.toUpper();
+                 QString qn("aliases: " + (cs ? px : px.toUpper()) + ":" + name);
+-                if (!ids.find( qn )) {
++                if (!ids.contains( qn )) {
+                     ids.insert( qn, (void*)id );
+                 }
+             }
+-            expandIfNeeded();
+         }
+ 
+     };
+@@ -622,7 +617,7 @@
+     IdNameMapping *m_elementMap;
+     IdNameMapping *m_namespaceMap;
+ 
+-    Q3PtrList<NodeIteratorImpl> m_nodeIterators;
++    QList<NodeIteratorImpl*> m_nodeIterators;
+     AbstractViewImpl *m_defaultView;
+ 
+     unsigned short m_listenerTypes;
+@@ -630,10 +625,10 @@
+     StyleSheetListImpl *m_addedStyleSheets; // programmatically added style sheets
+     LocalStyleRefs m_localStyleRefs; // references to inlined style elements
+     RegisteredListenerList m_windowEventListeners;
+-    Q3PtrList<NodeImpl> m_maintainsState;
++    QList<NodeImpl*> m_maintainsState;
+ 
+     // ### evaluate for placement in RenderStyle
+-    Q3PtrDict<Q3Dict<khtml::CounterNode> > m_counterDict;
++    QHash<const khtml::RenderObject*,QHash<QString,khtml::CounterNode*> *> m_counterDict;
+ 
+     khtml::DynamicDomRestyler *m_dynamicDomRestyler;
+ 
+@@ -645,11 +640,14 @@
+     bool m_async;
+     bool m_hadLoadError;
+     bool m_docLoading;
+-    bool m_inSyncLoad;
++
++    QEventLoop* m_inSyncLoad;
+ 
+     DOMString m_title;
+     DOMString m_preferredStylesheetSet;
+     khtml::CachedCSSStyleSheet *m_loadingXMLDoc;
++    
++    mutable ElementImpl* m_documentElement;
+ 
+     //int m_decoderMibEnum;
+ 
+@@ -657,10 +655,10 @@
+     ElementMappingCache m_underDocNamedCache;
+ 
+     //Cache for nodelists and collections.
+-    Q3IntDict<NodeListImpl::Cache> m_nodeListCache;
++    QHash<long,NodeListImpl::Cache*> m_nodeListCache;
+ 
+-    Q3PtrList<HTMLImageElementImpl> m_imageLoadEventDispatchSoonList;
+-    Q3PtrList<HTMLImageElementImpl> m_imageLoadEventDispatchingList;
++    QLinkedList<HTMLImageElementImpl*> m_imageLoadEventDispatchSoonList;
++    QLinkedList<HTMLImageElementImpl*> m_imageLoadEventDispatchingList;
+     int m_imageLoadEventTimer;
+ 
+     //Cache for getElementById
+--- /dev/null
++++ b/khtml/khtmladaptorpart.cpp
+@@ -0,0 +1,55 @@
++/*
++ *  This file is part of the KDE libraries
++ *  Copyright (C) 2007 Harri Porten (porten at kde.org)
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Library General Public
++ *  License as published by the Free Software Foundation; either
++ *  version 2 of the License, or (at your option) any later version.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Library General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Library General Public
++ *  License along with this library; if not, write to the Free
++ *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ *  Boston, MA 02110-1301 USA
++ */
++
++#include "khtmladaptorpart.h"
++
++#include <qlabel.h>
++
++AdaptorView::AdaptorView(QWidget* wparent, QObject* parent,
++                         const QStringList& args)
++    : KParts::ReadOnlyPart(parent)
++{
++    QLabel *placeHolder = new QLabel("Inactive", wparent);
++    placeHolder->setAlignment(Qt::AlignCenter);
++    placeHolder->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
++
++    KParts::Part::setWidget(placeHolder);
++}
++
++bool AdaptorView::openFile()
++{
++    return true;
++}
++
++K_EXPORT_COMPONENT_FACTORY (khtmladaptorpart, KHTMLAdaptorPartFactory)
++
++KHTMLAdaptorPartFactory::KHTMLAdaptorPartFactory()
++{
++}
++
++KParts::Part* KHTMLAdaptorPartFactory::createPartObject(QWidget* wparent,
++                                                        QObject* parent,
++                                                        const char* className,
++                                                        const QStringList& args)
++{
++    return new AdaptorView(wparent, parent, args);
++}
++
++#include "moc_khtmladaptorpart.cpp"
+--- a/khtml/imload/imagepainter.cpp
++++ b/khtml/imload/imagepainter.cpp
+@@ -96,6 +96,25 @@
+     }
+ 
+     PixmapPlane* plane = image->getSize(size);
++
++    if (plane->animProvider)
++    {
++        // Clip the request ourselves when animating..
++        QSize imageSize = image->size();
++        
++        if (width == -1)
++            width  = imageSize.width();
++        if (height == -1)
++            height = imageSize.height();
++
++        QRect clippedRect = QRect(0, 0, imageSize.width(), imageSize.height())
++                            & QRect(sx, sy, width, height);
++        plane->animProvider->paint(dx, dy, p, clippedRect.x(), clippedRect.y(),
++                                          clippedRect.width(), clippedRect.height());
++        return;
++    }
++
++    // non-animated, go straight to PixmapPlane; it clips itself
+     plane->paint(dx, dy, p, sx, sy, width, height);
+ }
+ 
+--- a/khtml/imload/imageplane.h
++++ b/khtml/imload/imageplane.h
+@@ -42,6 +42,8 @@
+ 
+     ImagePlane(unsigned int _width, unsigned int _height):Plane(_width, _height)
+     {}
++    
++    virtual void flushCache() = 0;
+ 
+     /**
+      Returns true if the given pixmap tile is up-to-date.
+--- a/khtml/imload/pixmapplane.cpp
++++ b/khtml/imload/pixmapplane.cpp
+@@ -26,12 +26,13 @@
+ 
+ #include <QPainter>
+ 
++
+ namespace khtmlImLoad {
+ 
+ void PixmapPlane::paint(int dx, int dy, QPainter* p,
+-                  int sx, int sy, int sWidth, int sHeight, bool useAnimProvider)
++                  int sx, int sy, int sWidth, int sHeight)
+ {
+-    //Do some basic clipping, discarding invalid requests and adjusting sizes of others
++    //Do some basic clipping, discarding invalid requests and adjusting sizes of others.
+     if (sy >= (int)height)
+         return;
+     if (sx >= (int)width)
+@@ -54,12 +55,6 @@
+     sHeight = ey - sy + 1;
+     sWidth  = ex - sx + 1;
+ 
+-    if (animProvider && useAnimProvider)
+-    {
+-        animProvider->paint(dx, dy, p, sx, sy, sWidth, sHeight);
+-        return;
+-    }
+-
+     //Calculate the range of tiles to paint, in both directions
+     unsigned int startTileY = sy / Tile::TileSize;
+     unsigned int endTileY   = ey / Tile::TileSize;
+@@ -111,12 +106,13 @@
+             {
+                 //Scan the versions to see how much to paint.
+                 unsigned int h = 0;
+-                for (h = 0; h < Tile::TileSize && tile.versions[h]; ++h)
+-                {}
++                for (int checkY = startY; checkY < Tile::TileSize && tile.versions[checkY]; ++checkY)
++                    ++h;
+ 
+-                //Draw it.
+-                p->drawPixmap(paintX, paintY, *tile.pixmap, startX, startY,
+-                              paintWidth, qMin(h, paintHeight));
++                //Draw it, if there is anything (note: Qt would interpret 0 as everything)
++                if (h)
++                    p->drawPixmap(paintX, paintY, *tile.pixmap, startX, startY,
++                                  paintWidth, qMin(h, paintHeight));
+             }
+             paintX += paintWidth;
+         }
+@@ -124,6 +120,18 @@
+     }
+ }
+ 
++void PixmapPlane::flushCache()
++{
++    parent->flushCache();
++    for (unsigned tileX = 0; tileX < tilesWidth; ++tileX) {
++        for (unsigned tileY = 0; tileY < tilesHeight; ++tileY) {
++            PixmapTile& pixTile = tiles.at(tileX, tileY);
++            if (pixTile.pixmap)
++                ImageManager::pixmapCache()->removeEntry(&pixTile);
++        }
++    }
++}
++
+ }
+ 
+ // kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- a/khtml/imload/scaledimageplane.h
++++ b/khtml/imload/scaledimageplane.h
+@@ -67,7 +67,8 @@
+     unsigned int* yScaleTable;
+ public:
+     virtual ~ScaledImagePlane();
+-    
++
++    virtual void flushCache();
+ 
+     ScaledImagePlane(unsigned int _width, unsigned int _height, RawImagePlane* _parent):
+             ImagePlane(_width, _height), parent(_parent), tiles(tilesWidth, tilesHeight)
+--- /dev/null
++++ b/khtml/imload/canvasimage.h
+@@ -0,0 +1,54 @@
++/*
++    KHTML image displaying library.
++
++    Copyright (C) 2007 Maks Orlovich (maksim at kde.org)
++
++    Permission is hereby granted, free of charge, to any person obtaining a copy
++    of this software and associated documentation files (the "Software"), to deal
++    in the Software without restriction, including without limitation the rights
++    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++    copies of the Software, and to permit persons to whom the Software is
++    furnished to do so, subject to the following conditions:
++
++    The above copyright notice and this permission notice shall be included in
++    all copies or substantial portions of the Software.
++
++    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
++    AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
++    AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++
++*/
++#ifndef IMLOAD_CANVAS_IMAGE_H
++#define IMLOAD_CANVAS_IMAGE_H
++
++class QImage;
++
++#include "image.h"
++
++namespace khtmlImLoad {
++
++/**
++  A CanvasImage encapsulates a QImage that will be painted on externally,
++  in order to permit scaling of it.  When drawing happens, however, the client must call the
++  contentUpdated() method to avoid out-of-date data being painted. 
++ */
++class CanvasImage : public Image
++{
++public:
++    CanvasImage(int width, int height);
++    void contentUpdated();
++    void resizeImage(int width, int height);
++private:
++    void setupOriginalPlane(int width, int height);
++    void flushAllCaches();
++    static ImageOwner* trivialOwner();
++    static ImageOwner* s_trivialOwner;
++};
++
++}
++
++#endif
++// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- a/khtml/imload/image.h
++++ b/khtml/imload/image.h
+@@ -81,6 +81,17 @@
+      Returns true if the image has been fully loaded
+     */
+     bool complete() const;
++
++    /**
++     Returns true if the image may have an alpha channel
++    */
++    bool hasAlpha() const;
++
++    /**
++     Returns the image of basic content. Should be treated as READ ONLY.
++     (but see CanvasImage)
++    */
++    QImage* qimage()  const;
+ private:
+     //Interface to the loader.
+     friend class ImageLoader;
+@@ -117,7 +128,7 @@
+     void refSize  (QSize size);
+     PixmapPlane* getSize(QSize size);
+ 
+-private:
++protected:
+     ImageOwner * owner;
+ 
+     //Update reporting to owner
+@@ -138,7 +149,6 @@
+     */
+     void notifyPerformUpdate();
+ 
+-
+     //Loader stuff.
+     QByteArray bufferPreDetect;
+     ImageLoader* loader;
+--- a/khtml/imload/imageplane.cpp
++++ b/khtml/imload/imageplane.cpp
+@@ -53,7 +53,7 @@
+                    unsigned char* versions)
+ {
+     //Determine the range which needs pushing.
+-    unsigned int first = 0xFFFF, last;
++    unsigned int first = 0xFFFF, last = 0;
+     if (!tile->pixmap)
+     {
+         //### this can be wasteful if we do conversion
+@@ -64,7 +64,8 @@
+     else
+     {
+         ImageManager::pixmapCache()->touchEntry(tile);
+-    
++
++        // figure out the dirty range
+         for (unsigned int line = 0; line < tileHeight(tileY); ++line)
+         {
+             if (versions[line] > tile->versions[line])
+@@ -72,12 +73,13 @@
+                 last = line;
+                 if (first == 0xFFFF)
+                     first = line;
+-                //Will fix it.
+-                tile->versions[line] = versions[line];
+             }
+         }
+     }
+ 
++    // Now tile will be up-to-date, so sync up w/our versions array
++    std::memcpy(tile->versions, versions, Tile::TileSize);
++
+     assert( tile->pixmap );
+ 
+     //Special case, hopefully-fast path: if we just wants to push
+--- a/khtml/imload/decoders/gifloader.cpp
++++ b/khtml/imload/decoders/gifloader.cpp
+@@ -116,7 +116,7 @@
+     {
+         QRect frameGeom = frameInfo[frame].geom;
+ 
+-        // Take the passed paint rectangle in gif screen coordinates, and 
++        // Take the passed paint rectangle in gif screen coordinates, and
+         // clip it to the frame's geometry
+         QRect screenPaintRect = QRect(sx, sy, width, height) & frameGeom;
+ 
+@@ -125,13 +125,13 @@
+ 
+         curFrame->paint(dx + screenPaintRect.x() - sx, dy + screenPaintRect.y() - sy, p,
+                 framePaintRect.x(), framePaintRect.y(),
+-                framePaintRect.width(), framePaintRect.height(), false /* don't get back to us!*/);
++                framePaintRect.width(), framePaintRect.height());
+     }
+ 
+     // Renders current gif screen state on the painter
+     void renderCurScreen(int dx, int dy, QPainter* p, int sx, int sy, int width, int height)
+     {
+-        // Depending on the previous frame's mode, we make have to cut out a hole when 
++        // Depending on the previous frame's mode, we may have to cut out a hole when
+         // painting the canvas, since if previous frame had BG disposal, we have to do OpSrc.
+         if (previousWasBG)
+         {
+@@ -206,7 +206,7 @@
+ 
+         // Move over to next frame if need be, incorporating 
+         // the change effect of current one onto the screen.
+-        if (shouldSwitchFrame) 
++        if (shouldSwitchFrame)
+         {
+             updateScreenAfterDispose();
+ 
+--- a/khtml/imload/scaledimageplane.cpp
++++ b/khtml/imload/scaledimageplane.cpp
+@@ -56,6 +56,17 @@
+ }
+ //### is special version for TileSize worth it?
+ 
++void ScaledImagePlane::flushCache()
++{
++    for (unsigned tileX = 0; tileX < tilesWidth; ++tileX) {
++        for (unsigned tileY = 0; tileY < tilesHeight; ++tileY) {
++            ImageTile& imageTile = tiles.at(tileX, tileY);
++            if (!imageTile.image.isNull())
++                ImageManager::imageCache()->removeEntry(&imageTile);
++        }
++    }
++}
++
+ void ScaledImagePlane::ensureUpToDate(unsigned int tileX, unsigned int tileY,
+                             PixmapTile* tile)
+ {
+@@ -77,6 +88,7 @@
+         int origLine = yScaleTable[line + tileY*Tile::TileSize];
+         if (imageTile.versions[line] < parent->versions[origLine])
+         {
++            imageTile.versions[line] = parent->versions[origLine];
+             if (parent->format.depth() == 1)
+                 scaleLoop<quint8>(&imageTile.image, xScaleTable, line, 
+                                 parent->image, origLine, tileX, tileY);
+--- /dev/null
++++ b/khtml/imload/canvasimage.cpp
+@@ -0,0 +1,101 @@
++/*
++    KHTML image displaying library.
++
++    Copyright (C) 2007 Maks Orlovich (maksim at kde.org)
++
++    Permission is hereby granted, free of charge, to any person obtaining a copy
++    of this software and associated documentation files (the "Software"), to deal
++    in the Software without restriction, including without limitation the rights
++    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++    copies of the Software, and to permit persons to whom the Software is
++    furnished to do so, subject to the following conditions:
++
++    The above copyright notice and this permission notice shall be included in
++    all copies or substantial portions of the Software.
++
++    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
++    AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
++    AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++
++*/
++#include "canvasimage.h"
++#include "imageowner.h"
++#include "pixmapplane.h"
++#include "rawimageplane.h"
++#include "scaledimageplane.h"
++
++namespace khtmlImLoad {
++
++class TrivialImageOwner : public ImageOwner
++{
++public:
++    virtual void imageHasGeometry(Image*, int, int) {}
++    virtual void imageChange(Image*, QRect) {}
++    virtual void imageError(Image*) {};
++    virtual void imageDone(Image*) {};
++};
++
++ImageOwner* CanvasImage::s_trivialOwner = 0;
++
++ImageOwner* CanvasImage::trivialOwner()
++{
++    if (!s_trivialOwner)
++        s_trivialOwner = new TrivialImageOwner;
++    return s_trivialOwner;
++}
++
++void CanvasImage::setupOriginalPlane(int width, int height)
++{
++    fullyDecoded = true;
++    this->width  = width;
++    this->height = height;
++    
++    RawImagePlane* imgPlane = new RawImagePlane(width, height, 1 /*already "loaded"*/);
++    imgPlane->image = QImage(width, height, QImage::Format_ARGB32_Premultiplied);
++    original = new PixmapPlane(width, height, imgPlane);
++    
++}
++
++CanvasImage::CanvasImage(int width, int height): Image(trivialOwner())
++{
++    setupOriginalPlane(width, height);
++}
++
++void CanvasImage::contentUpdated()
++{
++    flushAllCaches();
++}
++
++void CanvasImage::flushAllCaches()
++{
++    // Flush all the planes, including any scaled ones, etc.
++    original->flushCache();
++
++    for (QMap<QPair<int, int>, PixmapPlane*>::iterator i = scaled.begin(); i != scaled.end(); ++i)
++        i.value()->flushCache();
++}
++
++void CanvasImage::resizeImage(int width, int height)
++{
++    // Dump any cached info, it's useless
++    flushAllCaches();
++
++    // Create a new master pixmap and raw image planes
++    delete original;
++    setupOriginalPlane(width, height);
++    RawImagePlane* imgPlane = static_cast<RawImagePlane*>(original->parent);
++
++    // Now go through the scaling cache, and fix things up.
++    for (QMap<QPair<int, int>, PixmapPlane*>::iterator i = scaled.begin(); i != scaled.end(); ++i) {
++        PixmapPlane* scaledPix = i.value();
++        delete scaledPix->parent;
++        scaledPix->parent = new ScaledImagePlane(scaledPix->width, scaledPix->height, imgPlane);
++    }
++}
++
++}
++
++// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- a/khtml/imload/rawimageplane.h
++++ b/khtml/imload/rawimageplane.h
+@@ -38,17 +38,20 @@
+     QImage image;
+     unsigned char* versions; //Versions of scanlines --- node that this is is padded to be of width / by 64
+ 
+-    RawImagePlane(unsigned int _width, unsigned int _height):
++    RawImagePlane(unsigned int _width, unsigned int _height, char initialVer = 0):
+         ImagePlane(_width, _height)
+     {
+         versions = new unsigned char[tilesHeight * Tile::TileSize];
+-        std::memset(versions, 0, tilesHeight * Tile::TileSize);
++        std::memset(versions, initialVer, tilesHeight * Tile::TileSize);
+     }
+ 
+     ~RawImagePlane()
+     {
+         delete[] versions;
+     }
++    
++    virtual void flushCache()
++    {} // Nothing caches
+ 
+     /**
+      Returns true if the given pixmap tile is up-to-date.
+--- a/khtml/imload/image.cpp
++++ b/khtml/imload/image.cpp
+@@ -404,6 +404,21 @@
+     }
+ }
+ 
++QImage* Image::qimage() const
++{
++    if (!original || !original->parent)
++        return 0;
++
++    return &static_cast<RawImagePlane*>(original->parent)->image;
++}
++
++bool Image::hasAlpha() const
++{
++    if (!original || !original->parent)
++        return false;
++    return original->parent->format.hasAlpha();
++}
++
+ }
+ 
+ // kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
+--- a/khtml/imload/pixmapplane.h
++++ b/khtml/imload/pixmapplane.h
+@@ -55,6 +55,8 @@
+ 
+     PixmapPlane*  nextFrame;
+     AnimProvider* animProvider;
++    
++    void flushCache();
+ 
+     ~PixmapPlane()
+     {
+@@ -68,7 +70,7 @@
+      The source rectangle starts at sx, sy and has dimension width * height.
+     */
+     void paint(int dx, int dy, QPainter* p,
+-               int sx, int sy, int width = -1, int height = -1, bool useAnimProvider = true);
++               int sx, int sy, int width = -1, int height = -1);
+ };
+ 
+ }
+--- a/cmake/modules/FindCups.cmake
++++ /dev/null
+@@ -1,56 +0,0 @@
+-# - Try to find the Cups printing system
+-# Once done this will define
+-#
+-#  CUPS_FOUND - system has Cups
+-#  CUPS_INCLUDE_DIR - the Cups include directory
+-#  CUPS_LIBRARIES - Libraries needed to use Cups
+-#  Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which 
+-#  features this function (i.e. at least 1.1.19)
+-#  Set CUPS_REQUIRE_CUPS_DO_AUTHENTICATION to TRUE if you need a version which
+-#  features this function (i.e. at least 1.1.20)
+-
+-# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
+-#
+-# Redistribution and use is allowed according to the terms of the BSD license.
+-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+-
+-
+-INCLUDE(CheckLibraryExists)
+-
+-FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h )
+-
+-FIND_LIBRARY(CUPS_LIBRARIES NAMES cups )
+-
+-IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
+-   SET(CUPS_FOUND TRUE)
+-   GET_FILENAME_COMPONENT(CUPS_LIBRARY_DIR "${CUPS_LIBRARIES}" PATH)
+-
+-   # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
+-   CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "${CUPS_LIBRARY_DIR}" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
+-   IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
+-      SET(CUPS_FOUND FALSE)
+-   ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
+-
+-   # cupsDoAuthentication is new in cups-1.1.20 (and used by kdeprint)
+-   CHECK_LIBRARY_EXISTS(cups cupsDoAuthentication "${CUPS_LIBRARY_DIR}" CUPS_HAS_CUPS_DO_AUTHENTICATION)
+-   IF (CUPS_REQUIRE_CUPS_DO_AUTHENTICATION AND NOT CUPS_HAS_CUPS_DO_AUTHENTICATION)
+-      SET(CUPS_FOUND FALSE)
+-   ENDIF (CUPS_REQUIRE_CUPS_DO_AUTHENTICATION AND NOT CUPS_HAS_CUPS_DO_AUTHENTICATION)
+-
+-ELSE  (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
+-   SET(CUPS_FOUND FALSE)
+-ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
+-
+-IF (CUPS_FOUND)
+-   IF (NOT Cups_FIND_QUIETLY)
+-      MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}")
+-   ENDIF (NOT Cups_FIND_QUIETLY)
+-ELSE (CUPS_FOUND)
+-   SET(CUPS_LIBRARIES )
+-   IF (Cups_FIND_REQUIRED)
+-      MESSAGE(FATAL_ERROR "Could NOT find Cups")
+-   ENDIF (Cups_FIND_REQUIRED)
+-ENDIF (CUPS_FOUND)
+-  
+-MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
+-  
+--- a/cmake/modules/FindSoprano.cmake
++++ b/cmake/modules/FindSoprano.cmake
+@@ -1,11 +1,11 @@
+ 
+ 
+-if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES)
++if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES)
+ 
+   # read from cache
+   set(Soprano_FOUND TRUE)
+ 
+-else(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES)
++else(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES)
+   INCLUDE(FindLibraryWithDebug)
+ 
+   FIND_PATH(SOPRANO_INCLUDE_DIR 
+@@ -24,7 +24,8 @@
+     ${LIB_INSTALL_DIR}
+   )
+ 
+-  FIND_LIBRARY_WITH_DEBUG(SOPRANO_INDEX_LIBRARIES
++
++  FIND_LIBRARY_WITH_DEBUG(SOPRANO_INDEX_LIBRARIES 
+     WIN32_DEBUG_POSTFIX d
+     NAMES
+     sopranoindex
+@@ -33,7 +34,7 @@
+     ${LIB_INSTALL_DIR}
+     )
+ 
+-  FIND_LIBRARY_WITH_DEBUG(SOPRANO_CLIENT_LIBRARIES
++  FIND_LIBRARY_WITH_DEBUG(SOPRANO_CLIENT_LIBRARIES 
+     WIN32_DEBUG_POSTFIX d
+     NAMES
+     sopranoclient
+@@ -42,11 +43,32 @@
+     ${LIB_INSTALL_DIR}
+     )
+ 
++  FIND_LIBRARY_WITH_DEBUG(SOPRANO_SERVER_LIBRARIES 
++    WIN32_DEBUG_POSTFIX d
++    NAMES
++    sopranoserver
++    PATHS
++    ${KDE4_LIB_DIR}
++    ${LIB_INSTALL_DIR}
++    )
++
++  # check for all the libs as required to make sure that we do not try to compile with an old version
++  # FIXME: introduce a Soprano version check
+   if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_CLIENT_LIBRARIES AND SOPRANO_INDEX_LIBRARIES)
+     set(Soprano_FOUND TRUE)
++  endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_CLIENT_LIBRARIES AND SOPRANO_INDEX_LIBRARIES)
++
++  if(Soprano_FOUND AND SOPRANO_INDEX_LIBRARIES)
+     set(SopranoIndex_FOUND TRUE)
++  endif(Soprano_FOUND AND SOPRANO_INDEX_LIBRARIES)
++
++  if(Soprano_FOUND AND SOPRANO_CLIENT_LIBRARIES)
+     set(SopranoClient_FOUND TRUE)
+-  endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_CLIENT_LIBRARIES AND SOPRANO_INDEX_LIBRARIES)
++  endif(Soprano_FOUND AND SOPRANO_CLIENT_LIBRARIES)
++
++  if(Soprano_FOUND AND SOPRANO_SERVER_LIBRARIES)
++    set(SopranoServer_FOUND TRUE)
++  endif(Soprano_FOUND AND SOPRANO_SERVER_LIBRARIES)
+   
+   if(Soprano_FOUND)
+     if(NOT Soprano_FIND_QUIETLY)
+@@ -72,4 +94,4 @@
+     endif(Soprano_FIND_REQUIRED)
+   endif(Soprano_FOUND)
+ 
+-endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES)
++endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES)
+--- a/cmake/modules/FindKipi.cmake
++++ b/cmake/modules/FindKipi.cmake
+@@ -19,8 +19,8 @@
+   message(STATUS "Check Kipi library in local sub-folder...")
+ 
+   # Check if library is not in local sub-folder
+-  
+-  FIND_FILE(KIPI_LOCAL_FOUND libkipi/version.h.cmake ${CMAKE_SOURCE_DIR}/libkipi ${CMAKE_SOURCE_DIR}/libs/libkipi NO_DEFAULT_PATH)
++
++  find_file (KIPI_LOCAL_FOUND libkipi/version.h.cmake ${CMAKE_SOURCE_DIR}/libkipi ${CMAKE_SOURCE_DIR}/libs/libkipi NO_DEFAULT_PATH)
+ 
+   if (KIPI_LOCAL_FOUND)
+ 
+@@ -29,22 +29,22 @@
+     set(KIPI_LIBRARIES kipi)
+     message(STATUS "Found Kipi library in local sub-folder: ${KIPI_LIBRARIES}")
+     set(KIPI_FOUND TRUE)
+-    MARK_AS_ADVANCED(KIPI_INCLUDE_DIR KIPI_LIBRARIES)
++    mark_as_advanced(KIPI_INCLUDE_DIR KIPI_LIBRARIES)
+ 
+   else(KIPI_LOCAL_FOUND)
+ 
+-    if(NOT WIN32) 
++    if(NOT WIN32)
+       message(STATUS "Check Kipi library using pkg-config...")
+ 
+       # use pkg-config to get the directories and then use these values
+       # in the FIND_PATH() and FIND_LIBRARY() calls
+       INCLUDE(UsePkgConfig)
+-    
++
+       PKGCONFIG(libkipi _KIPIIncDir _KIPILinkDir _KIPILinkFlags _KIPICflags)
+-    
++
+       if(_KIPILinkFlags)
+         # query pkg-config asking for a libkipi >= 0.2.0
+-        EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkipi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
++        exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkipi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+         if(_return_VALUE STREQUAL "0")
+             message(STATUS "Found libkipi release >= 0.2.0")
+             set(KIPI_VERSION_GOOD_FOUND TRUE)
+@@ -58,20 +58,14 @@
+         set(KIPI_FOUND FALSE)
+       endif(_KIPILinkFlags)
+     else(NOT WIN32)
+-	set(KIPI_VERSION_GOOD_FOUND TRUE)
++      set(KIPI_VERSION_GOOD_FOUND TRUE)
+     endif(NOT WIN32)
+     if(KIPI_VERSION_GOOD_FOUND)
+         set(KIPI_DEFINITIONS ${_KIPICflags})
+-    
+-        FIND_PATH(KIPI_INCLUDE_DIR libkipi/version.h
+-        ${_KIPIIncDir}
+-        )
+-    
+-        FIND_LIBRARY(KIPI_LIBRARIES NAMES kipi
+-        PATHS
+-        ${_KIPILinkDir}
+-        )
+-    
++
++        find_path(KIPI_INCLUDE_DIR NAMES libkipi/version.h PATHS ${KDE4_INCLUDE_DIR} ${_KIPIIncDir})
++        find_library(KIPI_LIBRARIES NAMES kipi PATHS ${KDE4_LIB_DIR} ${_KIPILinkDir})
++
+         if (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
+             set(KIPI_FOUND TRUE)
+         endif (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
+--- a/cmake/modules/FindX11.cmake
++++ b/cmake/modules/FindX11.cmake
+@@ -25,6 +25,7 @@
+ #                X11_Xinput_INCLUDE_PATH,       X11_Xinput_LIB,     X11_Xinput_FOUND
+ #                X11_Xkb_INCLUDE_PATH,                              X11_Xkb_FOUND
+ #                X11_Xkblib_INCLUDE_PATH,                           X11_Xkb_FOUND
++#                X11_Xkbfile_INCLUDE_PATH,      X11_Xkbfile_LIB,    X11_Xkbfile_FOUND
+ #                X11_Xpm_INCLUDE_PATH,          X11_Xpm_LIB,        X11_Xpm_FOUND
+ #                X11_XTest_INCLUDE_PATH,        X11_XTest_LIB,      X11_XTest_FOUND
+ #                X11_Xrandr_INCLUDE_PATH,       X11_Xrandr_LIB,     X11_Xrandr_FOUND
+@@ -85,6 +86,7 @@
+   FIND_PATH(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h          ${X11_INC_SEARCH_PATH})
+   FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h                ${X11_INC_SEARCH_PATH})
+   FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h                     ${X11_INC_SEARCH_PATH})
++  FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h        ${X11_INC_SEARCH_PATH})
+   FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h                           ${X11_INC_SEARCH_PATH})
+   FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h            ${X11_INC_SEARCH_PATH})
+   FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h              ${X11_INC_SEARCH_PATH})
+@@ -112,6 +114,7 @@
+   FIND_LIBRARY(X11_Xft_LIB Xft               ${X11_LIB_SEARCH_PATH})
+   FIND_LIBRARY(X11_Xinerama_LIB Xinerama     ${X11_LIB_SEARCH_PATH})
+   FIND_LIBRARY(X11_Xinput_LIB Xi             ${X11_LIB_SEARCH_PATH})
++  FIND_LIBRARY(X11_Xkbfile_LIB xkbfile       ${X11_LIB_SEARCH_PATH})
+   FIND_LIBRARY(X11_Xpm_LIB Xpm               ${X11_LIB_SEARCH_PATH})
+   FIND_LIBRARY(X11_Xrandr_LIB Xrandr         ${X11_LIB_SEARCH_PATH})
+   FIND_LIBRARY(X11_Xrender_LIB Xrender       ${X11_LIB_SEARCH_PATH})
+@@ -264,6 +267,11 @@
+      SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
+   ENDIF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
+ 
++  IF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
++     SET(X11_Xkbfile_FOUND TRUE)
++     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
++  ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
++
+   IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
+      SET(X11_Xinput_FOUND TRUE)
+      SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
+@@ -408,6 +416,8 @@
+     X11_Xf86misc_INCLUDE_PATH
+     X11_Xkb_INCLUDE_PATH
+     X11_Xkblib_INCLUDE_PATH
++    X11_Xkbfile_INCLUDE_PATH
++    X11_Xkbfile_LIB
+     X11_Xscreensaver_INCLUDE_PATH
+     X11_Xscreensaver_LIB
+     X11_Xpm_INCLUDE_PATH
+--- a/cmake/modules/FindQt4.cmake
++++ b/cmake/modules/FindQt4.cmake
+@@ -1020,15 +1020,20 @@
+     SET(_impl   ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+     SET(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
+ 
+-    GET_SOURCE_FILE_PROPERTY(_nonamespace ${_infile} NO_NAMESPACE)
++    GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE)
+     IF ( _nonamespace )
+-        SET(_params -N -m -p)
++        SET(_params -N -m)
+     ELSE ( _nonamespace )
+-        SET(_params -m -p)
++        SET(_params -m)
+     ENDIF ( _nonamespace )
+ 
+-     ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+-        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} ${_basename} ${_infile}
++    GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE)
++    IF ( _include )
++        SET(_params ${_params} -i ${_include})
++    ENDIF ( _include )
++
++    ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
++        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile}
+         DEPENDS ${_infile})
+   
+     SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
+--- a/cmake/modules/FindStrigi.cmake
++++ b/cmake/modules/FindStrigi.cmake
+@@ -14,14 +14,17 @@
+ 
+ if (WIN32)
+   file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
++  string(REPLACE "\\" "/" _program_FILES_DIR "${_program_FILES_DIR}")
+   set(STRIGI_NO_DEF_PATH "")
+ else(WIN32)
+   set(STRIGI_NO_DEF_PATH NO_DEFAULT_PATH)
+ endif(WIN32)
+ 
++string(REPLACE "\\" "/" strigi_home "$ENV{STRIGI_HOME}")
++
+ find_path(STRIGI_INCLUDE_DIR strigi/streamanalyzer.h
+   PATHS
+-  $ENV{STRIGI_HOME}/include
++  ${strigi_home}/include
+   ${CMAKE_INSTALL_PREFIX}/include
+   ${_program_FILES_DIR}/strigi/include
+   ${STRIGI_NO_DEF_PATH}
+@@ -31,7 +34,7 @@
+   WIN32_DEBUG_POSTFIX d
+   NAMES streamanalyzer
+   PATHS
+-  $ENV{STRIGI_HOME}/lib
++  ${strigi_home}/lib
+   ${CMAKE_INSTALL_PREFIX}/lib
+   ${_program_FILES_DIR}/strigi/lib
+   ${STRIGI_NO_DEF_PATH}
+@@ -41,7 +44,7 @@
+   WIN32_DEBUG_POSTFIX d
+   NAMES streams
+   PATHS
+-  $ENV{STRIGI_HOME}/lib
++  ${strigi_home}/lib
+   ${CMAKE_INSTALL_PREFIX}/lib
+   ${_program_FILES_DIR}/strigi/lib
+   ${STRIGI_NO_DEF_PATH}
+@@ -51,7 +54,7 @@
+   WIN32_DEBUG_POSTFIX d
+   NAMES strigiqtdbusclient
+   PATHS
+-  $ENV{STRIGI_HOME}/lib
++  ${strigi_home}/lib
+   ${CMAKE_INSTALL_PREFIX}/lib
+   ${_program_FILES_DIR}/strigi/lib
+   ${STRIGI_NO_DEF_PATH}
+--- a/cmake/modules/FindKDE4Internal.cmake
++++ b/cmake/modules/FindKDE4Internal.cmake
+@@ -33,7 +33,6 @@
+ # KDE4_KHTML_LIBRARY       - the khtml library
+ # KDE4_KJS_LIBRARY         - the kjs library
+ # KDE4_KNEWSTUFF2_LIBRARY  - the knewstuff2 library
+-# KDE4_KDEPRINT_LIBRARY    - the kdeprint library
+ # KDE4_KDNSSD_LIBRARY      - the kdnssd library
+ # KDE4_PHONON_LIBRARY      - the phonon library
+ # KDE4_KAUDIODEVICELIST_LIBRARY - the kaudiodevicelist library
+@@ -59,7 +58,6 @@
+ # KDE4_KHTML_LIBS            - the khtml library and all depending libraries
+ # KDE4_KJS_LIBS              - the kjs library and all depending libraries
+ # KDE4_KNEWSTUFF2_LIBS       - the knewstuff2 library and all depending libraries
+-# KDE4_KDEPRINT_LIBS         - the kdeprint library and all depending libraries
+ # KDE4_KDNSSD_LIBS           - the kdnssd library and all depending libraries
+ # KDE4_KDESU_LIBS            - the kdesu library and all depending libraries
+ # KDE4_KPTY_LIBS             - the kpty library and all depending libraries
+@@ -377,9 +375,6 @@
+    find_library(KDE4_KNEWSTUFF2_LIBRARY NAMES knewstuff2 PATHS ${KDE4_LIB_INSTALL_DIR} NO_DEFAULT_PATH )
+    set(KDE4_KNEWSTUFF2_LIBS ${knewstuff2_LIB_DEPENDS} ${KDE4_KNEWSTUFF2_LIBRARY} )
+ 
+-   find_library(KDE4_KDEPRINT_LIBRARY NAMES kdeprint PATHS ${KDE4_LIB_INSTALL_DIR} NO_DEFAULT_PATH )
+-   set(KDE4_KDEPRINT_LIBS ${kdeprint_LIB_DEPENDS} ${KDE4_KDEPRINT_LIBRARY} )
+-
+    if (UNIX)
+       find_library(KDE4_KPTY_LIBRARY NAMES kpty PATHS ${KDE4_LIB_INSTALL_DIR} NO_DEFAULT_PATH )
+       set(KDE4_KPTY_LIBS ${kpty_LIB_DEPENDS} ${KDE4_KPTY_LIBRARY} )
+--- a/cmake/modules/FindQCA2.cmake
++++ b/cmake/modules/FindQCA2.cmake
+@@ -26,7 +26,7 @@
+   INCLUDE(UsePkgConfig)
+ 
+   IF (NOT WIN32)
+-    PKGCONFIG(qca QCA2_INCLUDE_DIR _Qca2LinkDir _Qca2LinkFlags _Qca2Cflags)
++    PKGCONFIG(qca2 QCA2_INCLUDE_DIR _Qca2LinkDir _Qca2LinkFlags _Qca2Cflags)
+ 
+     set(QCA2_DEFINITIONS ${_Qca2Cflags})
+ 
+@@ -40,10 +40,10 @@
+                     WIN32_DEBUG_POSTFIX d
+                     NAMES qca)
+ 
+-    FIND_PATH(QCA2_INCLUDE_DIR QtCrypto/qca.h)
+-    IF(QCA2_INCLUDE_DIR)
+-      SET(QCA2_INCLUDE_DIR ${QCA2_INCLUDE_DIR}/QtCrypto CACHE TYPE PATH FORCE)
+-    ENDIF(QCA2_INCLUDE_DIR)
++    FIND_PATH(QCA2_INCLUDE_DIR_tmp QtCrypto/qca.h)
++    IF(QCA2_INCLUDE_DIR_tmp)
++      SET(QCA2_INCLUDE_DIR ${QCA2_INCLUDE_DIR_tmp}/QtCrypto CACHE TYPE PATH FORCE)
++    ENDIF(QCA2_INCLUDE_DIR_tmp)
+   ENDIF (NOT WIN32)
+ 
+ 
+--- a/cmake/modules/KDE4Macros.cmake
++++ b/cmake/modules/KDE4Macros.cmake
+@@ -300,7 +300,7 @@
+ 
+    if(_installDest)
+       file(GLOB _images *.png)
+-      install(FILES ${_docs} ${_images} DESTINATION ${_installDest}/${dirname})
++      install(FILES ${_doc} ${_docs} ${_images} DESTINATION ${_installDest}/${dirname})
+       # TODO symlinks on non-unix platforms
+       if (UNIX)
+          # execute some cmake code on make install which creates the symlink
+@@ -486,11 +486,12 @@
+          # don't include c-files in the final-file, because they usually come
+          # from a 3rd party and as such are not intended to be compiled all-in-one
+          string(REGEX MATCH ".+\\.c$" _isCFile ${_abs_FILE})
+-         if (_isCFile)
++         string(REGEX MATCH ".+\\.h$" _isHFile ${_abs_FILE})
++         if (_isCFile OR _isHFile)
+             list(APPEND ${_filesExcludedFromFinalFile} ${_abs_FILE})
+-         else (_isCFile)
++         else (_isCFile OR _isHFile)
+             file(APPEND ${_filenameCPP} "#include \"${_abs_FILE}\"\n")
+-         endif (_isCFile)
++         endif (_isCFile OR _isHFile)
+       endif (_isGenerated)
+    endforeach (_current_FILE)
+ 
+--- a/ConfigureChecks.cmake
++++ b/ConfigureChecks.cmake
+@@ -27,8 +27,6 @@
+    set(NEED_BZ2_PREFIX 1)
+ endif(BZIP2_FOUND AND BZIP2_NEED_PREFIX)
+ 
+-macro_bool_to_01(CUPS_FOUND HAVE_CUPS)                  # kdeprint
+-
+ macro_bool_to_01(CARBON_FOUND HAVE_CARBON)              # kdecore
+ 
+ macro_bool_to_01(LIBINTL_FOUND ENABLE_NLS)              # kdecore, khtml, kjs
+--- a/kde3support/kdeui/k3dockwidget.h
++++ b/kde3support/kdeui/k3dockwidget.h
+@@ -79,7 +79,7 @@
+ class QPixmap;
+ 
+ #ifndef NO_KDE2
+-class KConfig;
++class KConfigGroup;
+ #else
+ #endif
+ 
+@@ -124,12 +124,12 @@
+   /**
+    * Provides saving the current configuration. Must be overridden by an inheriting class.
+    */
+-  virtual void saveConfig( KConfig* ){}
++  virtual void saveConfig( KConfigGroup* ){}
+ 
+   /**
+    * Provides loading the current configuration.  Must be overridden by an inheriting class
+    */
+-  virtual void loadConfig( KConfig* ){}
++  virtual void loadConfig( KConfigGroup* ){}
+ #endif
+ 
+ protected:
+@@ -280,14 +280,14 @@
+    *
+    * @param c the configuration safe
+    */
+-  virtual void saveConfig( KConfig* c);
++  virtual void saveConfig( KConfigGroup* c);
+ 
+   /**
+    * Loads the current button state from a KDE config container object.
+    *
+    * @param c the configuration safe
+    */
+-  virtual void loadConfig( KConfig* c);
++  virtual void loadConfig( KConfigGroup* c);
+ #endif
+ 
+    /**
+--- a/kde3support/kdeui/k3textedit.cpp
++++ b/kde3support/kdeui/k3textedit.cpp
+@@ -147,7 +147,7 @@
+       e->accept();
+       return;
+     }
+-    else if ( KStandardShortcut::home().contains( key ) )
++    else if ( KStandardShortcut::begin().contains( key ) )
+     {
+       moveCursor( MoveHome, false );
+       e->accept();
+--- a/kde3support/kdeui/k3dockwidget.cpp
++++ b/kde3support/kdeui/k3dockwidget.cpp
+@@ -475,16 +475,14 @@
+ }
+ 
+ #ifndef NO_KDE2
+-void K3DockWidgetHeader::saveConfig( KConfig* c )
++void K3DockWidgetHeader::saveConfig( KConfigGroup* cg )
+ {
+-  KConfigGroup cg(c, c->group());
+-  cg.writeEntry( QString("%1:stayButton").arg(parent()->name()), stayButton->isChecked() );
++  cg->writeEntry( QString("%1:stayButton").arg(parent()->name()), stayButton->isChecked() );
+ }
+ 
+-void K3DockWidgetHeader::loadConfig( KConfig* c )
++void K3DockWidgetHeader::loadConfig( KConfigGroup* cg )
+ {
+-  KConfigGroup cg(c, c->group());
+-  setDragEnabled( !cg.readEntry( QString("%1:stayButton").arg(parent()->name()), false ) );
++  setDragEnabled( !cg->readEntry( QString("%1:stayButton").arg(parent()->name()), false ) );
+ }
+ #endif
+ 
+@@ -2683,7 +2681,7 @@
+     obj = getDockWidgetFromName( *nListIt );
+     QString cname = obj->name();
+     if ( obj->header ){
+-      obj->header->saveConfig( c );
++      obj->header->saveConfig( &cg );
+     }
+     if (obj->d->isContainer) {
+        K3DockContainer* x = dynamic_cast<K3DockContainer*>(obj->widget);
+@@ -2852,7 +2850,7 @@
+ 		removeFromAutoCreateList(obj);
+     }
+     if ( obj && obj->header){
+-      obj->header->loadConfig( c );
++      obj->header->loadConfig( &cg );
+     }
+   }
+ 
+@@ -2902,7 +2900,7 @@
+ 
+     if (obj && obj->d->isContainer)  dynamic_cast<K3DockContainer*>(obj->widget)->load(c,group);
+     if ( obj && obj->header){
+-      obj->header->loadConfig( c );
++      obj->header->loadConfig( &cg );
+     }
+   }
+ 
+--- a/kde3support/kdecore/k3multipledrag.h
++++ b/kde3support/kdecore/k3multipledrag.h
+@@ -49,6 +49,7 @@
+  * Note that the drag objects added to the multiple drag become owned by it.
+  * For that reason their parent should be 0.
+  *
++ * @deprecated use QMimeData instead
+  * @author David Faure <faure at kde.org>
+  */
+ class KDE3SUPPORT_EXPORT K3MultipleDrag : public Q3DragObject
+--- a/interfaces/kimproxy/interface/dbusinstantmessenger.desktop
++++ b/interfaces/kimproxy/interface/dbusinstantmessenger.desktop
+@@ -12,7 +12,9 @@
+ Comment[el]=Στιγμιαίος αποστολέας μηνυμάτων με διασύνδεση D-Bus
+ Comment[eo]=Tujmesaĝilo kun D-Bus-interfaco
+ Comment[es]=Programa de mensajería instantánea con una interfaz D-Bus
++Comment[et]=Kiirsuhtlemisrakendus D-Bus-liidesega
+ Comment[fa]=پیام‌رسان فوری با یک واسط D-Bus
++Comment[fi]=Pikaviestiohjelma D-Bus-rajapinnalla
+ Comment[ga]=Clár teachtaireachtaí meandaracha le comhéadan D-Bus
+ Comment[he]=תוכנת מסרים מידיים עם ממשק D-Bus
+ Comment[hu]=Azonnali üzenetküldő DBus felülettel
+@@ -22,6 +24,8 @@
+ Comment[km]=​កម្មវិធី​ផ្ញើ​សារ​បន្ទាន់ដែល​មាន​ចំណុច​ប្រទាក់ DCOP
+ Comment[kn]=D-Bus ಅಂತರಮುಖದೊಂದಿಗಿನ (interface) ತತ್ಷಣ ಓಲೆಕಾರ
+ Comment[ko]=D-Bus 인터페이스를 사용하는 인스턴트 메신저
++Comment[lt]=Momentinių žinučių klientas su D-Bus sąsaja
++Comment[nb]=Lynmeldingsprogram med D-Bus-grensesnitt
+ Comment[nds]=Kortnarichten-Maker mit en D-Bus-Koppelsteed
+ Comment[ne]=D-Bus इन्टरफेससँग इन्सट्यान्ट मेसेन्जर
+ Comment[nl]=Instant messenger met een D-BUS-interface
+@@ -29,9 +33,12 @@
+ Comment[pt]=Mensageiro Instantâneo com interface D-Bus
+ Comment[pt_BR]=Mensageiro Instantâneo com interface D-Bus
+ Comment[sl]=Takojšni sporočilnik z vmesnikom D-Bus
++Comment[sr]=Брзи гласник са Д-бус сучељем
++Comment[sr at latin]=Brzi glasnik sa D-Bus sučeljem
+ Comment[sv]=Direktmeddelanden med ett D-Bus gränssnitt
+ Comment[te]=డి-బస్ ఇంటర్ఫెస్ కలిగివున్న ఇంస్టెంట్ మెస్సెన్జర్
+ Comment[th]=โปรแกรมส่งข้อความแบบทันที ด้วยส่วนติดต่อกับ D-Bus
++Comment[uk]=Програма Миттєвого Зв'язку, яка має інтерфейс D-Bus
+ Comment[vi]=Bộ tin nhắn có giao diện D-Bus
+ Comment[wa]=Messaedjreye sol moumint avou ene eterface D-Bus
+ Comment[x-test]=xxInstant Messenger with a D-Bus interfacexx
+--- a/interfaces/kimproxy/interface/kcm_instantmessenger.desktop
++++ b/interfaces/kimproxy/interface/kcm_instantmessenger.desktop
+@@ -94,7 +94,7 @@
+ Comment[lt]=Momentinių žinučių klientas kalbėtis individams ir grupėms.
+ Comment[mk]=Инстант гласникот овозможува двонасочна комуникација меѓу индивидуи и групи.
+ Comment[ms]=Utusan segera membenarkan perbualan di antara individu dan kumpulan.
+-Comment[nb]=Et lynmeldingsprogram som tallater toveis samtale mellom enkeltpersoner og grupper.
++Comment[nb]=Et lynmeldingsprogram som tillater toveis samtale mellom enkeltpersoner og grupper.
+ Comment[nds]=Mit den Kortnarichten-Maker köönt enkelte Minschen oder Gruppen ünnerenanner snacken.
+ Comment[ne]=इन्सट्यान्ट मेसेन्जरले एक अर्का र समूहबीच दोहोरो कुराकानीका लागि अनुमति दिन्छ ।
+ Comment[nl]=De instant messenger maakt directe communicatie tussen personen of groepen mogelijk.
+@@ -107,8 +107,8 @@
+ Comment[ru]=Клиент обмена сообщениями служит для обмена сообщениями между людьми и группами.
+ Comment[se]=Šleađgadiehtoprográmma gos olbmot ja joavkkut sáhttet buillardallat (chat).
+ Comment[sl]=Takojšni sporočilnik omogoča dvosmeren klepet med posamezniki in skupinami.
+-Comment[sr]=Брзи гласник вам омогућава двосмерно ћаскање између појединаца и група.
+-Comment[sr at latin]=Brzi glasnik vam omogućava dvosmerno ćaskanje između pojedinaca i grupa.
++Comment[sr]=Брзим гласником можете ћаскати са другим појединацима и у групама.
++Comment[sr at latin]=Brzim glasnikom možete ćaskati sa drugim pojedinacima i u grupama.
+ Comment[sv]=Direktmeddelanden möjliggör tvåvägschatt mellan individer och grupper.
+ Comment[ta]=உடனடி தகவல் உங்களை இரண்டு வழியில் தனிநபர் மற்றும் குழுக்கள் இடையே அனுமதிக்கும்.
+ Comment[te]=ఇంస్టెంట్ మెస్సెన్జర్ వ్యక్తు లు మరయు గుంపుల తొ ఇరువయపుల నుంచి సంబాషించవచ్చు 
+--- a/interfaces/kspeech/dbustexttospeech.desktop
++++ b/interfaces/kspeech/dbustexttospeech.desktop
+@@ -12,7 +12,9 @@
+ Comment[el]=Υπηρεσία κειμένου-σε-ομιλία με διασύνδεση D-Bus
+ Comment[eo]=Teksto-al-voĉo Servo kun D-Bus-interfaco
+ Comment[es]=Servicio de texto a voz con una interfaz D-Bus
++Comment[et]=Teksti kõneks muutmise teenus D-Bus-liidesega
+ Comment[fa]=خدمت متن به گفتار با یک واسط D-Bus
++Comment[fi]=Puhesynteesipalvelu D-Bus-rajapinnalla
+ Comment[ga]=Seirbhís Téacs-go-Caint le comhéadan D-Bus
+ Comment[he]=שירות טקסט לדיבור עם ממשק D-Bus
+ Comment[hu]=Szövegfelolvasó szolgáltatás D-Bus felülettel
+@@ -22,6 +24,8 @@
+ Comment[km]=សេវា​អត្ថបទ-ទៅ-សំដី​ដែល​មានចំណុចប្រទាក់ DCOP
+ Comment[kn]=D-Bus ಅಂತರಮುಖದೊಂದಿಗೆ (interface) ಪಠ್ಯ ವಾಚನ (text-to-speech) ಸೇವೆ
+ Comment[ko]=D-Bus 인터페이스를 사용하는 텍스트 음성 변환 서비스
++Comment[lt]=Teksto vertimo kalba tarnyba su D-Bus sąsaja
++Comment[nb]=Tekst til tale-program med D-Bus-grensesnitt
+ Comment[nds]=Vörleesdeenst mit en DBUS-Koppelsteed
+ Comment[ne]=D-Bus इन्टरफेससँग पाठ-बाट-बोली सेवा
+ Comment[nl]=Tekst-tot-spraak-dienst met een DCOP interface
+@@ -29,9 +33,12 @@
+ Comment[pt]=Serviço de Texto-para-Fala com interface D-Bus
+ Comment[pt_BR]=Serviço de conversão de texto para fala com interface D-Bus
+ Comment[sl]=Servis, ki spremeni besedilo v govor, z vmesnikom D-Bus
++Comment[sr]=Текст-у-говор сервис са Д-бус сучељем
++Comment[sr at latin]=Tekst-u-govor servis sa D-Bus sučeljem
+ Comment[sv]=Text till tal-tjänst med ett D-bus gränssnitt
+ Comment[te]=డి-బస్ ఇంటర్ఫేస్ కల్గిన వాచకం నుంచి మాటలకు మార్చు సేవ
+ Comment[th]=บริการเปลี่ยนข้อความเป็นเสียงพูด พร้อมด้วยส่วนติดต่อกับ DCOP
++Comment[uk]=Служба синтезу мовлення з інтерфейсом D-Bus
+ Comment[vi]=Dịch vụ Văn bản sang Tiếng nói có giao diện D-Bus
+ Comment[wa]=Siervice tecse-viè-vwès avou ene eterface D-Bus
+ Comment[x-test]=xxText-to-Speech Service with a D-Bus interfacexx
+--- a/interfaces/ktexteditor/ktexteditor.desktop
++++ b/interfaces/ktexteditor/ktexteditor.desktop
+@@ -52,8 +52,8 @@
+ Comment[ru]=Встраиваемый элемент редактора текста (с поддержкой модели документ/вид)
+ Comment[se]=Vuojuhanláhkái čállinprográmmaoassi (Doc/View-sirremiin)
+ Comment[sl]=Vgradljiva komponenta urejevalnika besedil (z ločevanjem pogleda in dokumenta)
+-Comment[sr]=Уградива компонента за уређивање текста (са „документ/приказ“ одвајањем)
+-Comment[sr at latin]=Ugradiva komponenta za uređivanje teksta (sa „dokument/prikaz“ odvajanjem)
++Comment[sr]=Угњездива компонента уређивача текста (уз раздвајање документ-приказ)
++Comment[sr at latin]=Ugnjezdiva komponenta uređivača teksta (uz razdvajanje dokument-prikaz)
+ Comment[sv]=Inbäddningsbar texteditor (med dok/vyseparation)
+ Comment[ta]=உட்பொதிந்த உரை தொகுப்பாளர் பகுதி (ஆவண/காட்சி பிரிவுகளுடன்)
+ Comment[te]=పొదగబడె వాచకం సరిచేయు అంశం (పత్ర/వీక్షణ విభజన వున్నది)
+--- a/interfaces/ktexteditor/editorchooser.cpp
++++ b/interfaces/ktexteditor/editorchooser.cpp
+@@ -59,7 +59,7 @@
+ 
+   KService::List offers = KMimeTypeTrader::self()->query("text/plain", "KTextEditor/Document");
+   KConfigGroup config = KSharedConfig::openConfig("default_components")->group("KTextEditor");
+-  QString editor = config.readPathEntry("embeddedEditor");
++  QString editor = config.readPathEntry("embeddedEditor", QString());
+ 
+   if (editor.isEmpty()) editor = "katepart";
+ 
+@@ -93,7 +93,7 @@
+ void EditorChooser::readAppSetting(const QString& postfix)
+ {
+   KConfigGroup cg(KGlobal::config(), "KTEXTEDITOR:" + postfix);
+-  QString editor = cg.readPathEntry("editor");
++  QString editor = cg.readPathEntry("editor", QString());
+   if (editor.isEmpty())
+     d->chooser->editorCombo->setCurrentIndex(0);
+   else
+@@ -117,7 +117,7 @@
+ {
+   // try to read the used library from the application's config
+   KConfigGroup cg(KGlobal::config(), "KTEXTEDITOR:" + postfix);
+-  QString editor = cg.readPathEntry("editor");
++  QString editor = cg.readPathEntry("editor", QString());
+   if (editor.isEmpty())
+   {
+     // there is no library set in the application's config,
+--- a/interfaces/ktexteditor/ktexteditorplugin.desktop
++++ b/interfaces/ktexteditor/ktexteditorplugin.desktop
+@@ -54,8 +54,8 @@
+ Comment[ru]=Модуль KTextEditor
+ Comment[se]=KDE-čállinprográmma lassemoduvla
+ Comment[sl]=Vstavek KTextEditor
+-Comment[sr]=KTextEditor прикључак
+-Comment[sr at latin]=KTextEditor priključak
++Comment[sr]=Прикључак за уређивање текста
++Comment[sr at latin]=Priključak za uređivanje teksta
+ Comment[sv]=Insticksprogram för texteditor
+ Comment[ta]=கேஉரைதொகுப்பி சொருகுப்பொருள்
+ Comment[te]=కెటెక్స్ట్ ఎడిటర్ ప్లగిన్
+--- a/interfaces/ktexteditor/kcm_ktexteditor.desktop
++++ b/interfaces/ktexteditor/kcm_ktexteditor.desktop
+@@ -48,8 +48,8 @@
+ Name[ru]=Встроенный текстовый редактор
+ Name[se]=Vuojuhahtti čállinprográmma
+ Name[sl]=Vključeni urejevalnik besedil
+-Name[sr]=Уграђени уређивач текста
+-Name[sr at latin]=Ugrađeni uređivač teksta
++Name[sr]=Угњеждени уређивач текста
++Name[sr at latin]=Ugnježdeni uređivač teksta
+ Name[sv]=Inbäddad texteditor
+ Name[ta]=உட்பொதிந்த உரை தொகுப்பி
+ Name[te]=పొదగిన వాచకం సరిచేయునది
+@@ -101,7 +101,7 @@
+ Comment[lv]=Teksta redaktora serviss sniedz teksta aplūkošanas un rediģēšanas pakalpojumus programmām. KDE programmām, kurām tas ir nepieciešams, vajadzētu izmantot šo servisu.
+ Comment[mk]=Сервисот за текст уредувач ги снабдува апликациите со текст прегледник и уредувач. KDE апликациите што овозможуваат уредување текст би требало да го користат овој сервис.
+ Comment[ms]= Servis penyunting teks yang menyediakan aplikasi dengan pelihat teks dan editor. Aplikasi KDE yang menyediakan kemudahan penyuntingan teks patut menggunakan servis ini.
+-Comment[nb]=Skriveprogrammet gir kan vise og redigere teks. KDE-programmer som kan redigere tekst bør bruke denne tjenesten.
++Comment[nb]=Skriveprogrammet gir kan vise og redigere tekst. KDE-programmer som kan redigere tekst bør bruke denne tjenesten.
+ Comment[nds]=De Texteditor-Deenst föögt Programmen en Textwieser un -editor to. KDE-Programmen, mit de Texten bewerkt warrt, schöölt em bruken.
+ Comment[ne]=पाठ सम्पादक सेवाले पाठ दर्शक र सम्पादक भएको अनुप्रयोग उपलब्ध गराउँछ । पाठ सम्पादक सुविधा उपलब्ध गर्ने केडीई अनुप्रयोगले यो सेवा प्रयोग गर्नु आवश्यक हुन्छ ।
+ Comment[nl]=Dit component stelt programma's een tekstviewer en -editor tot hun beschikking. KDE-toepassingen die te maken hebben met het bewerken van tekst kunnen gebruik maken van deze aangeboden dienst.
+@@ -114,8 +114,8 @@
+ Comment[ru]=Сервис текстового редактора для приложений, в которых требуется просмотр и редактирование текста. Его должны использовать приложения KDE, где требуется редактирование текста.
+ Comment[se]=Čállinprográmmabálvalus fállá teakstačájeheami ja -doaimmaheaheami. KDE-prográmmat, mat fállet teakstadoaimmahanvejolašvuođaid, galggašedje geavahit dán bálvalusa.
+ Comment[sl]=Storitev urejevalnika besedila omogoča programom dostop do pregledovalnika in urejevalnika besedil. Programi za KDE, ki omogočajo urejanje besedila, naj bi uporabljali to storitev.
+-Comment[sr]= Сервис уређивача текста обезбеђује програмима преглед и измене текстова. KDE програми који обезбеђују могућност обраде текста требало би да користе овај сервис.
+-Comment[sr at latin]= Servis uređivača teksta obezbeđuje programima pregled i izmene tekstova. KDE programi koji obezbeđuju mogućnost obrade teksta trebalo bi da koriste ovaj servis.
++Comment[sr]=Сервис уређивача текста пружа програмима начин за приказивање и уређивање текстова. Требало би да га користе сви КДЕ програми којима је то потребно.
++Comment[sr at latin]=Servis uređivača teksta pruža programima način za prikazivanje i uređivanje tekstova. Trebalo bi da ga koriste svi KDE programi kojima je to potrebno.
+ Comment[sv]=Texteditortjänsten ger program en textvisare och editor. KDE-program som tillhandahåller textredigeringsfunktioner bör använda denna tjänst.
+ Comment[ta]=உரை மற்றும் தொகுப்பாளருடனான பயன்பாடுகளை உரை தொகுப்பாளர் சேவை வழங்குகிறது. உரை தொகுக்கும் வசதிகளை வழங்கும் கேடிஇ பயன்பாடுகள் இச்சேவையைப் பயன்படுத்த வேண்டும்.
+ Comment[te]=కార్యక్రమాలకు వాచకం సరిచేయు సేవ ఒక వాచకం విక్షణ మరియు సరిచెయుటకు సహాయపడును. కెడిఈ కార్యక్రమాలు వాచకం సరిచెయు సౌకర్యాలు వున్నట్టైతె దిని సేవ ను ఉపయొగించొకొవలెను
+--- a/knotify/tests/knotifytest.notifyrc
++++ b/knotify/tests/knotifytest.notifyrc
+@@ -3,17 +3,26 @@
+ Comment=Test for Knotify
+ Comment[ca]=Prova pel Knotify
+ Comment[cs]=Test pro KNotify
++Comment[de]=Test für KNotify
+ Comment[el]=Δοκιμή του Knotify
++Comment[et]=Knotify test
+ Comment[ga]=Tástáil Knotify
+ Comment[hu]=A KNotify tesztelése
+ Comment[it]=Prova per Knotify
++Comment[kk]=Knotify-дің сынағы
+ Comment[km]=សាកល្បង​សម្រាប់ Knotify
++Comment[lt]=Knotify testas
++Comment[lv]=Knotify tests
+ Comment[nds]=Na KNotify kieken
+ Comment[nl]=Test voor KNotify
+ Comment[pa]=ਕੇ-ਨੋਟੀਫਾਈ ਲਈ ਟੈਸਟ
+ Comment[pt]=Teste do KNotify
+ Comment[pt_BR]=Teste do KNotify
++Comment[sr]=Проба за К-обавештења
++Comment[sr at latin]=Proba za K-obaveštenja
+ Comment[sv]=Test av Knotify
++Comment[th]=การทดสอบสำหรับ KNotify
++Comment[uk]=Тест для Knotify
+ Comment[x-test]=xxTest for Knotifyxx
+ Comment[zh_CN]=Knotify 测试
+ Comment[zh_TW]=測試 Knotify
+@@ -24,34 +33,55 @@
+ Name[be]=Група
+ Name[ca]=Grup
+ Name[cs]=Skupina
++Name[de]=Gruppe
+ Name[el]=Ομάδα
++Name[et]=Grupp
+ Name[ga]=Grúpa
+ Name[hu]=Csoport
+ Name[it]=Gruppo
++Name[kk]=Топ
+ Name[km]=ក្រុម
++Name[lt]=Grupė
++Name[lv]=Grupa
++Name[nb]=Gruppe
+ Name[nds]=Koppel
+ Name[nl]=Groep
++Name[oc]=Grop
+ Name[pa]=ਗਰੁੱਪ
+ Name[pt]=Grupo
+ Name[pt_BR]=Grupo
++Name[sr]=Група
++Name[sr at latin]=Grupa
+ Name[sv]=Grupp
++Name[th]=กลุ่ม
++Name[uk]=Група
+ Name[x-test]=xxGroupxx
+ Name[zh_CN]=组
+ Name[zh_TW]=群組
+ Comment=The group
+ Comment[ca]=El grup
+ Comment[cs]=Skupina
++Comment[de]=Die Gruppe
+ Comment[el]=Η ομάδα
++Comment[et]=Grupp
+ Comment[ga]=An grúpa
+ Comment[hu]=A csoport
+ Comment[it]=Il gruppo
++Comment[kk]=Тобы
+ Comment[km]=ក្រុម
++Comment[lt]=Grupė
++Comment[lv]=Grupa
++Comment[nb]=Gruppa
+ Comment[nds]=De Koppel
+ Comment[nl]=De groep
+ Comment[pa]=ਗਰੁੱਪ
+ Comment[pt]=O grupo
+ Comment[pt_BR]=O grupo
++Comment[sr]=Група
++Comment[sr at latin]=Grupa
+ Comment[sv]=Gruppen
++Comment[th]=กลุ่ม
++Comment[uk]=Група
+ Comment[x-test]=xxThe groupxx
+ Comment[zh_CN]=组
+ Comment[zh_TW]=群組
+@@ -62,30 +92,49 @@
+ Name[be]=У сеціве
+ Name[ca]=Connectat
+ Name[el]=Σε σύνδεση
++Name[et]=Võrgus
+ Name[ga]=Ar Líne
+ Name[it]=In linea
++Name[kk]=Онлайн
+ Name[km]=លើ​បណ្ដាញ
+ Name[lt]=Prisijungę
++Name[lv]=Tiešsaistē
++Name[nb]=Tilkoblet
+ Name[nds]=Tokoppelt
++Name[oc]=En linha
+ Name[pa]=ਆਨਲਾਇਨ
+ Name[pt]=Ligado
++Name[sr]=На вези
++Name[sr at latin]=Na vezi
+ Name[sv]=Uppkopplad
++Name[th]=ออนไลน์
++Name[uk]=В мережі
+ Name[x-test]=xxOnlinexx
+ Name[zh_CN]=在线
+ Name[zh_TW]=上線
+ Comment=The contact is now connected
+ Comment[ca]=El contacte ara està connectat
+ Comment[cs]=Kontakt je nyní připojen
++Comment[de]=Der Kontakt ist jetzt verbunden
+ Comment[el]=Η επαφή είναι τώρα συνδεδεμένη
++Comment[et]=Kontakt on nüüd võrgus
+ Comment[ga]=Tá an teagmháil nasctha anois
+ Comment[hu]=A partner csatlakozott (online állapotú)
+ Comment[it]=Il contatto è ora connesso
++Comment[kk]=Контакт қосылды
+ Comment[km]=ឥឡូវ ទំនាក់ទំនង​ត្រូវ​បាន​តភ្ជាប់
++Comment[lt]=Kontaktas dabar prisijungęs
++Comment[lv]=Kontakts ir savienots
++Comment[nb]=Kontakten er nå tilkoblet
+ Comment[nds]=De Kontakt is nu tokoppelt
+ Comment[nl]=De contact is nu verbonden
+ Comment[pt]=O contacto ligou-se agora
+ Comment[pt_BR]=O contato está conectado agora
++Comment[sr]=Контакт је сада повезан
++Comment[sr at latin]=Kontakt je sada povezan
+ Comment[sv]=Kontakten är nu uppkopplad
++Comment[th]=ขณะนี้ได้เชื่อมต่อกับรายชื่อติดต่อแล้ว
++Comment[uk]=Контакт тепер з'єднаний
+ Comment[x-test]=xxThe contact is now connectedxx
+ Comment[zh_CN]=联系人现已上线
+ Comment[zh_TW]=聯絡人已上線
+@@ -97,16 +146,27 @@
+ Name=Message Received
+ Name[ca]=Missatge rebut
+ Name[cs]=Obdržena zpráva
++Name[de]=Nachricht empfangen
+ Name[el]=Λήφθηκε μήνυμα
++Name[et]=Saadi sõnum
++Name[fi]=Uusi viesti
+ Name[ga]=Fuarthas Teachtaireacht
+ Name[hu]=Üzenet érkezett
+ Name[it]=Messaggio ricevuto
++Name[kk]=Хабарлама келді
+ Name[km]=បាន​ទទួល​សារ
++Name[lt]=Žinutė gauta
++Name[lv]=Ziņojums ir saņemts
++Name[nb]=Melding mottatt
+ Name[nds]=Bescheed kregen
+ Name[nl]=Bericht ontvangen
+ Name[pt]=Mensagem Recebida
+ Name[pt_BR]=Mensagem Recebida
++Name[sr]=Примљена порука
++Name[sr at latin]=Primljena poruka
+ Name[sv]=Meddelande mottaget
++Name[th]=ได้รับข้อความ
++Name[uk]=Повідомлення отримано
+ Name[x-test]=xxMessage Receivedxx
+ Name[zh_CN]=收到了消息
+ Name[zh_TW]=接到訊息
+@@ -114,16 +174,27 @@
+ Comment[be]=Была атрымана паведамленне
+ Comment[ca]=S'ha rebut un missatge
+ Comment[cs]=Byla obdržena zpráva
++Comment[de]=Eine Nachricht wurde empfangen
+ Comment[el]=Ένα μήνυμα λήφθηκε
++Comment[et]=Saadi sõnum
++Comment[fi]=Uusi viesti on saapunut
+ Comment[ga]=Fuarthas teachtaireacht
+ Comment[hu]=Üzenet érkezett
+ Comment[it]=È stato ricevuto un messaggio
++Comment[kk]=Хабарлама келді
+ Comment[km]=សារ​ត្រូវ​បាន​ទទួល
++Comment[lt]=Gauta žinutė
++Comment[lv]=Ir saņemts ziņojums
++Comment[nb]=En melding er mottatt
+ Comment[nds]=Dat en Bescheed geven
+ Comment[nl]=Er is een bericht ontvangen
+ Comment[pt]=Foi recebida uma mensagem
+ Comment[pt_BR]=Uma mensagem foi recebida
++Comment[sr]=Порука је управо примљена
++Comment[sr at latin]=Poruka je upravo primljena
+ Comment[sv]=Ett meddelande har tagits emot
++Comment[th]=ได้รับข้อความแล้ว
++Comment[uk]=Повідомлення було отримано
+ Comment[x-test]=xxA Message has been receivedxx
+ Comment[zh_CN]=收到了一条消息
+ Comment[zh_TW]=訊息已接收
+--- a/knotify/config/knotifyeventlist.cpp
++++ b/knotify/config/knotifyeventlist.cpp
+@@ -19,6 +19,7 @@
+ 
+ #include <kdebug.h>
+ #include <klocale.h>
++#include <kicon.h>
+ #include <kiconloader.h>
+ #include <kconfig.h>
+ #include <kconfiggroup.h>
+@@ -32,10 +33,17 @@
+ class KNotifyEventList::KNotifyEventListDelegate : public QItemDelegate
+ {
+ 	public:
++		KNotifyEventListDelegate(QObject *parent = 0);
++
+ 		virtual void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
+ 	private:
+ };
+ 
++KNotifyEventList::KNotifyEventListDelegate::KNotifyEventListDelegate(QObject *parent)
++	: QItemDelegate(parent)
++{
++}
++
+ void KNotifyEventList::KNotifyEventListDelegate::paint( QPainter* painter,
+ 		 const QStyleOptionViewItem& option, const QModelIndex& index ) const
+ {
+@@ -53,24 +61,25 @@
+ 
+ 
+ 	int mc_x=0;
++	QSize iconsSize = option.decorationSize;
+ 	foreach(QString key , prstring.split ("|"))
+ 	{
+-		QPixmap icon;
++		QIcon icon;
+ 		if(key == "Sound" )
+-			icon = SmallIcon("sound");
++			icon = KIcon("sound");
+ 		else if(key == "Popup" )
+-			icon = SmallIcon("document-properties");
++			icon = KIcon("document-properties");
+ 		else if(key == "Execute" )
+-			icon = SmallIcon("exec");
++			icon = KIcon("exec");
+ 		else if(key == "Taskbar" )
+-			icon = SmallIcon("kicker");
++			icon = KIcon("kicker");
+ 		else if(key == "Logfile" )
+-			icon = SmallIcon("log");
++			icon = KIcon("log");
+ 		else
+ 			continue;
+ 
+-		painter->drawPixmap( rect.left() + mc_x +4, rect.top() + (rect.height() - icon.height())/2, icon );
+-		mc_x += icon.width()+4;
++		icon.paint(painter, rect.left() + mc_x + 4, rect.top() + (rect.height() - iconsSize.height()) / 2, iconsSize.width(), iconsSize.height());
++		mc_x += iconsSize.width() + 4;
+ 	}
+ 
+ }
+@@ -84,7 +93,9 @@
+   headerLabels << i18nc( "Title of the notified event", "Title" ) << i18nc( "Description of the notified event", "Description" ) << i18nc( "State of the notified event", "State" );
+   setHeaderLabels( headerLabels );
+ 
+-  setItemDelegate(new KNotifyEventListDelegate);
++  setItemDelegate(new KNotifyEventListDelegate(this));
++  setRootIsDecorated(false);
++  setAlternatingRowColors(true);
+ 
+   connect(this, SIGNAL(currentItemChanged( QTreeWidgetItem * , QTreeWidgetItem *  )) , this , SLOT(slotSelectionChanged( QTreeWidgetItem * , QTreeWidgetItem *)));
+ }
+@@ -100,9 +111,9 @@
+ 	m_elements.clear();
+ 	clear();
+ 	delete config;
+-	config = new KConfig(appname + ".notifyrc" , KConfig::CascadeConfig);
+-        config->setExtraConfigFiles(KGlobal::dirs()->findAllResources("data",
+-                                appname + '/' + appname + ".notifyrc"));
++	config = new KConfig(appname + ".notifyrc" , KConfig::NoGlobals);
++        config->addConfigSources(KGlobal::dirs()->findAllResources("data",
++                                 appname + '/' + appname + ".notifyrc"));
+         config->reparseConfiguration();
+ 
+ 	QStringList conflist = config->groupList();
+--- a/knotify/config/knotifyconfigelement.cpp
++++ b/knotify/config/knotifyconfigelement.cpp
+@@ -38,7 +38,7 @@
+ {
+ 	if(m_cache.contains(entry))
+ 		return m_cache[entry];
+-	return path ?  m_config->readPathEntry(entry) :
++	return path ?  m_config->readPathEntry(entry, QString()) :
+ 		m_config->readEntry(entry, QString());
+ }
+ 
+--- a/knotify/config/knotifyconfigwidget.cpp
++++ b/knotify/config/knotifyconfigwidget.cpp
+@@ -46,9 +46,9 @@
+ 	connect(d->actionsconfig,SIGNAL(changed()),this,SLOT(slotActionChanged()));
+     
+ 	QVBoxLayout *layout = new QVBoxLayout(this);
++	layout->setMargin(0);
+ 	layout->addWidget(d->eventList,1);
+ 	layout->addWidget(d->actionsconfig);
+-	setLayout(layout);
+ }
+ 
+ 
+--- a/kate/render/katerenderer.h
++++ b/kate/render/katerenderer.h
+@@ -112,6 +112,11 @@
+     void setCaretStyle(KateRenderer::caretStyles style);
+ 
+     /**
++     * Set a \a brush with which to override drawing of the caret.  Set to QColor() to clear.
++     */
++    void setCaretOverrideColor(const QColor& color);
++
++    /**
+      * @returns whether tabs should be shown (ie. a small mark
+      * drawn to identify a tab)
+      * @return tabs should be shown
+@@ -305,6 +310,7 @@
+     bool m_showTabs;
+     bool m_showSpaces;
+     bool m_printerFriendly;
++    QColor m_caretOverrideColor;
+ 
+     QList<KTextEditor::Attribute::Ptr> m_attributes;
+ 
+--- a/kate/render/katerenderrange.cpp
++++ b/kate/render/katerenderrange.cpp
+@@ -1,5 +1,6 @@
+ /* This file is part of the KDE libraries
+    Copyright (C) 2003-2006 Hamish Rodda <rodda at kde.org>
++   Copyright (C) 2007 Mirko Stocker <me at misto.ch>
+ 
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+@@ -41,6 +42,14 @@
+     return KTextEditor::Cursor(INT_MAX,INT_MAX);
+ 
+   KTextEditor::SmartRange* r = m_currentRange->deepestRangeContaining(m_currentPos);
++  
++  if(!r) {
++    if(m_currentPos < m_currentRange->start()) {
++      return m_currentRange->start();
++    }
++    return KTextEditor::Cursor(INT_MAX, INT_MAX);
++  }
++  
+   foreach (KTextEditor::SmartRange* child, r->childRanges()) {
+     if (child->start() > m_currentPos)
+       return child->start();
+@@ -57,7 +66,7 @@
+ 
+   bool ret = false;
+ 
+-  while (m_currentRange && !m_currentRange->contains(pos)) {
++  while (m_currentRange && !m_currentRange->contains(pos) && m_currentRange->parentRange()) {
+     m_attribs.pop();
+     m_currentRange = m_currentRange->parentRange();
+     ret = true;
+@@ -78,7 +87,7 @@
+ 
+ KTextEditor::Attribute::Ptr SmartRenderRange::currentAttribute() const
+ {
+-  if (m_attribs.count())
++  if (m_attribs.count() && m_currentRange->contains(m_currentPos))
+     return m_attribs.top();
+   return KTextEditor::Attribute::Ptr();
+ }
+--- a/kate/render/katelayoutcache.cpp
++++ b/kate/render/katelayoutcache.cpp
+@@ -23,18 +23,22 @@
+ #include "katerenderer.h"
+ #include "kateview.h"
+ #include "katedocument.h"
++#include "kateedit.h"
+ 
+ #include <kdebug.h>
+ 
+ static bool enableLayoutCache = false;
+ 
+-KateLayoutCache::KateLayoutCache(KateRenderer* renderer)
+-  : m_renderer(renderer)
++KateLayoutCache::KateLayoutCache(KateRenderer* renderer, QObject* parent)
++  : QObject(parent)
++  , m_renderer(renderer)
+   , m_startPos(-1,-1)
+   , m_viewWidth(0)
+   , m_wrap(false)
+ {
+   Q_ASSERT(m_renderer);
++
++  connect(m_renderer->doc()->history(), SIGNAL(editDone(KateEditInfo*)), SLOT(slotEditDone(KateEditInfo*)));
+ }
+ 
+ void KateLayoutCache::updateViewCache(const KTextEditor::Cursor& startPos, int newViewLineCount, int viewLinesScrolled)
+@@ -245,6 +249,7 @@
+ int KateLayoutCache::displayViewLine(const KTextEditor::Cursor& virtualCursor, bool limitToVisible) const
+ {
+   KTextEditor::Cursor work = viewCacheStart();
++  work.setLine(m_renderer->doc()->getVirtualLine(work.line()));
+ 
+   int limit = m_textLayouts.count();
+ 
+@@ -318,42 +323,12 @@
+       kDebug() << "Line Invalid.";
+ }
+ 
+-void KateLayoutCache::slotTextInserted( KTextEditor::Document *, const KTextEditor::Range & range )
+-{
+-  // OPTIMISE: check to see if it's worth the effort
+-
+-  int deleteFromLine = range.start().line(); // eg 2,0 = 2 and 2,3 = 2
+-  int shiftFromLine = range.end().line() + (range.end().column() ? 1 : 0); // eg 3,6 = 4 and 3,0 = 3
+-  int shiftAmount = shiftFromLine - deleteFromLine; // eg 4 - 2 = 2 and 3 - 2 = 1
+-
+-  updateCache(deleteFromLine, shiftFromLine, shiftAmount);
+-}
+-
+-void KateLayoutCache::slotTextRemoved( KTextEditor::Document *, const KTextEditor::Range & range )
+-{
+-  // OPTIMISE: check to see if it's worth the effort
+-
+-  int deleteFromLine = range.start().line(); // eg 2,0 = 2 and 2,3 = 2
+-  int shiftFromLine = range.end().line() + (range.end().column() ? 1 : 0); // eg 3,6 = 4 and 3,0 = 3
+-  int shiftAmount = deleteFromLine - shiftFromLine; // eg 2 - 4 = -2 and 2 - 3 = -1
+-
+-  updateCache(deleteFromLine, shiftFromLine, shiftAmount);
+-}
+-
+-void KateLayoutCache::slotTextChanged(KTextEditor::Document *, const KTextEditor::Range& oldRange, const KTextEditor::Range& newRange)
++void KateLayoutCache::slotEditDone(KateEditInfo* edit)
+ {
+-  // OPTIMISE: check to see if it's worth the effort
+-
+-  int deleteFromLine = oldRange.start().line(); // eg 2,0 = 2 and 2,3 = 2
+-  int shiftFromLine = oldRange.end().line() + (oldRange.end().column() ? 1 : 0); // eg 3,6 = 4 and 3,0 = 3
+-  int shiftToLine = newRange.end().line() + (newRange.end().column() ? 1 : 0); // eg 5,6 = 6 and 5,0 = 5
+-  int shiftAmount = shiftToLine - shiftFromLine; // eg 6 - 4 = 2 and 5 - 4 = 1
++  int fromLine = edit->oldRange().start().line();
++  int toLine = edit->oldRange().end().line();
++  int shiftAmount = edit->translate().line();
+ 
+-  updateCache(deleteFromLine, shiftFromLine, shiftAmount);
+-}
+-
+-void KateLayoutCache::updateCache( int fromLine, int toLine, int shiftAmount )
+-{
+   if (shiftAmount) {
+     QMap<int, KateLineLayoutPtr> oldMap = m_lineLayouts;
+     m_lineLayouts.clear();
+@@ -362,19 +337,24 @@
+     while (it.hasNext()) {
+       it.next();
+ 
+-      if (it.key() >= toLine)
+-        m_lineLayouts.insert(it.key() + shiftAmount, it.value());
+-      else if (it.key() < fromLine)
++      if (it.key() > toLine) {
++        KateLineLayoutPtr layout = it.value();
++        layout->setLine(layout->line() + shiftAmount);
++        m_lineLayouts.insert(it.key() + shiftAmount, layout);
++
++      } else if (it.key() < fromLine) {
+         m_lineLayouts.insert(it.key(), it.value());
+-      else
++
++      } else {
+         //gets deleted when oldMap goes but invalidate it just in case
+         const_cast<KateLineLayoutPtr&>(it.value())->invalidateLayout();
++      }
+     }
+ 
+   } else {
+-    for (int i = fromLine; i < toLine; --i)
++    for (int i = fromLine; i <= toLine; ++i)
+       if (m_lineLayouts.contains(i)) {
+-        const_cast<KateLineLayoutPtr&>(m_lineLayouts[i])->invalidateLayout();
++        const_cast<KateLineLayoutPtr&>(m_lineLayouts[i])->setLayoutDirty();
+         m_lineLayouts.remove(i);
+       }
+   }
+@@ -434,3 +414,5 @@
+     if (m_lineLayouts.contains(i))
+       m_lineLayouts[i]->setLayoutDirty();
+ }
++
++#include "katelayoutcache.moc"
+--- a/kate/render/katelayoutcache.h
++++ b/kate/render/katelayoutcache.h
+@@ -24,6 +24,7 @@
+ #include "katetextlayout.h"
+ 
+ class KateRenderer;
++class KateEditInfo;
+ 
+ namespace KTextEditor { class Document; }
+ 
+@@ -41,10 +42,12 @@
+  *
+  * @author Hamish Rodda \<rodda at kde.org\>
+  */
+-class KateLayoutCache
++class KateLayoutCache : public QObject
+ {
++  Q_OBJECT
++
+   public:
+-    explicit KateLayoutCache(KateRenderer* renderer);
++    explicit KateLayoutCache(KateRenderer* renderer, QObject* parent);
+ 
+     void clear();
+ 
+@@ -107,9 +110,7 @@
+     // Methods for tagging layouts as dirty
+ 
+ private Q_SLOTS:
+-    void slotTextInserted(KTextEditor::Document *document, const KTextEditor::Range& range);
+-    void slotTextRemoved(KTextEditor::Document *document, const KTextEditor::Range& range);
+-    void slotTextChanged(KTextEditor::Document *document, const KTextEditor::Range& oldRange, const KTextEditor::Range& newRange);
++    void slotEditDone(KateEditInfo* edit);
+ 
+ private:
+     void updateCache(int fromLine, int toLine, int shiftAmount);
+--- a/kate/render/katerenderer.cpp
++++ b/kate/render/katerenderer.cpp
+@@ -296,6 +296,14 @@
+   if (selectionsOnly || textLine->attributesList().count() || m_view->externalHighlights().count() || m_view->internalHighlights().count() || m_doc->documentHighlights().count()) {
+     RenderRangeList renderRanges;
+ 
++    // Add the inbuilt highlighting to the list
++    NormalRenderRange* inbuiltHighlight = new NormalRenderRange();
++    const QVector<int> &al = textLine->attributesList();
++    for (int i = 0; i+2 < al.count(); i += 3) {
++      inbuiltHighlight->addRange(new KTextEditor::Range(KTextEditor::Cursor(line, al[i]), al[i+1]), specificAttribute(al[i+2]));
++    }
++    renderRanges.append(inbuiltHighlight);
++
+     if (!completionHighlight) {
+       // Add arbitrary highlighting ranges to the list
+       renderRanges.appendRanges(m_view->internalHighlights(), selectionsOnly, view());
+@@ -307,14 +315,6 @@
+       renderRanges.append(completionHighlight);
+     }
+ 
+-    // Add the inbuilt highlighting to the list
+-    NormalRenderRange* inbuiltHighlight = new NormalRenderRange();
+-    const QVector<int> &al = textLine->attributesList();
+-    for (int i = 0; i+2 < al.count(); i += 3) {
+-      inbuiltHighlight->addRange(new KTextEditor::Range(KTextEditor::Cursor(line, al[i]), al[i+1]), specificAttribute(al[i+2]));
+-    }
+-    renderRanges.append(inbuiltHighlight);
+-
+     // Add selection highlighting if we're creating the selection decorations
+     if ((selectionsOnly && showSelections() && m_view->selection()) || (completionHighlight && completionSelected) || m_view->blockSelection()) {
+       NormalRenderRange* selectionHighlight = new NormalRenderRange();
+@@ -480,8 +480,6 @@
+       KateTextLayout line = range->viewLine(i);
+ 
+       // Determine the background to use, if any, for the end of this view line
+-//       QBrush backgroundBrush;
+-//       bool backgroundBrushSet = false;
+       backgroundBrushSet = false;
+       while (it2.hasNext()) {
+         const QTextLayout::FormatRange& fr = it2.peekNext();
+@@ -520,19 +518,20 @@
+       backgroundDetermined:
+ 
+       // Draw selection outside of areas where text is rendered
+-      if (m_view->selection() && !m_view->blockSelection() && m_view->lineEndSelected(line.end(true))) {
+-        QRect area(line.endX() + line.xOffset() - xStart, fm.height() * i, xEnd - xStart, fm.height() * (i + 1));
+-        paint.fillRect(area, config()->selectionColor());
+-
+-      } else if (backgroundBrushSet && !m_view->blockSelection()) {
+-        // Draw text background outside of areas where text is rendered.
+-        QRect area(line.endX() /*+ line.xOffset()*/ - line.startX() +  (i==0?0:range->shiftX()) - xStart/*-(i*xEnd)*/, fm.height() * i, xEnd - xStart, fm.height() /** (i + 1)*/);
+-        paint.fillRect(area, /*QBrush(Qt::red));*/backgroundBrush);
+-//         kDebug()<<i<<":backgroundBrush:"<<backgroundBrush<<"---"<<xEnd<<"/"<<xStart;
+-//         kDebug()<<line.endX()<<"---"<<line.xOffset();
+-         kDebug()<<i<<"----"<<area;
++      if (!m_printerFriendly ) {
++        if (m_view->selection() && !m_view->blockSelection() && m_view->lineEndSelected(line.end(true))) {
++          QRect area(line.endX() + line.xOffset() - xStart, fm.height() * i, xEnd - xStart, fm.height() * (i + 1));
++          paint.fillRect(area, config()->selectionColor());
++  
++        } else if (backgroundBrushSet && !m_view->blockSelection()) {
++          // Draw text background outside of areas where text is rendered.
++          QRect area(line.endX() /*+ line.xOffset()*/ - line.startX() +  (i==0?0:range->shiftX()) - xStart/*-(i*xEnd)*/, fm.height() * i, xEnd - xStart, fm.height() /** (i + 1)*/);
++          paint.fillRect(area, /*QBrush(Qt::red));*/backgroundBrush);
++  //         kDebug()<<i<<":backgroundBrush:"<<backgroundBrush<<"---"<<xEnd<<"/"<<xStart;
++  //         kDebug()<<line.endX()<<"---"<<line.xOffset();
++          //kDebug()<<i<<"----"<<area;
++        }
+       }
+-
+       // Draw indent lines
+       if (showIndentLines() && i == 0)
+       {
+@@ -581,7 +580,7 @@
+         paint.fillRect(0, fm.height(), range->shiftX() - xStart, fm.height() * (range->viewLineCount() - 1),
+           backgroundBrush);
+       paint.fillRect(0, fm.height(), range->shiftX() - xStart, fm.height() * (range->viewLineCount() - 1),
+-        QBrush(config()->wordWrapMarkerColor(), Qt::DiagCrossPattern));
++        QBrush(config()->wordWrapMarkerColor(), Qt::Dense4Pattern));
+     }
+ 
+     // Draw caret
+@@ -602,16 +601,21 @@
+ 
+       QColor c;
+       // Could actually use the real highlighting system for this... would be slower but more accurate for corner cases
+-      foreach (QTextLayout::FormatRange r, range->layout()->additionalFormats())
+-        if ( (r.start <= cursor->column() ) && ( (r.start + r.length)  > cursor->column()) ) {
+-          c = r.format.foreground().color();
+-          break;
+-        }
+-      if (!c.isValid())
+-        if (range->layout()->additionalFormats().count())
+-          c = range->layout()->additionalFormats().last().format.foreground().color();
+-        else
+-          c = attribute(KateExtendedAttribute::dsNormal)->foreground().color();
++      if (m_caretOverrideColor.isValid()) {
++        c = m_caretOverrideColor;
++
++      } else {
++        foreach (QTextLayout::FormatRange r, range->layout()->additionalFormats())
++          if ( (r.start <= cursor->column() ) && ( (r.start + r.length)  > cursor->column()) ) {
++            c = r.format.foreground().color();
++            break;
++          }
++        if (!c.isValid())
++          if (range->layout()->additionalFormats().count())
++            c = range->layout()->additionalFormats().last().format.foreground().color();
++          else
++            c = attribute(KateExtendedAttribute::dsNormal)->foreground().color();
++      }
+ 
+       if (cursor->column() <= range->length()) {
+         paint.save();
+@@ -634,64 +638,6 @@
+     }
+   }
+ 
+-  /* Remnants from the old implementation which haven't yet been integrated into the new
+-  {
+-    bool isIMSel  = false;
+-    bool isIMEdit = false;
+-
+-    while (curCol - startcol < len)
+-    {
+-      // Only draw after the starting X value
+-      if ((int)xPosAfter >= xStart)
+-      {
+-        // input method edit area
+-        isIMEdit = m_view && m_view->isIMEdit( line, curCol );
+-
+-        // input method selection
+-        isIMSel = m_view && m_view->isIMSelection( line, curCol );
+-
+-          // indentation lines OR
+-          || (showIndentLines() && curCol < lastIndentColumn)
+-
+-          // input method edit area
+-          || ( m_view && (isIMEdit != m_view->isIMEdit( line, nextCol )) )
+-
+-          // input method selection
+-          || ( m_view && (isIMSel !=  m_view->isIMSelection( line, nextCol )) )
+-
+-            if (isIMSel && !isTab)
+-            {
+-              // input method selection
+-              fillColor = m_view->colorGroup().color(QPalette::Foreground);
+-            }
+-            else if (isIMEdit && !isTab)
+-            {
+-              // XIM support
+-              // input method edit area
+-              const QColorGroup& cg = m_view->colorGroup();
+-              int h1, s1, v1, h2, s2, v2;
+-              cg.color( QPalette::Base ).getHsv( &h1, &s1, &v1 );
+-              cg.color( QPalette::Background ).getHsv( &h2, &s2, &v2 );
+-              fillColor.setHsv( h1, s1, ( v1 + v2 ) / 2 );
+-            }
+-
+-            if (isIMSel && paintBackground && !isTab)
+-            {
+-              paint.save();
+-              paint.setPen( m_view->colorGroup().color( QPalette::BrightText ) );
+-            }
+-
+-            // Draw preedit's underline
+-            if (isIMEdit) {
+-              QRect r( oldXPos - xStart, 0, xPosAfter - oldXPos, config()->fontMetrics().height() );
+-              paint.drawLine( r.bottomLeft(), r.bottomRight() );
+-            }
+-
+-            // Put pen color back
+-            if (isIMSel) paint.restore();
+-    }
+-  */
+-
+   // show word wrap marker if desirable
+   if ((!isPrinterFriendly()) && config()->wordWrapMarker() && QFontInfo(config()->font()).fixedPitch())
+   {
+@@ -899,4 +845,9 @@
+   return ret;
+ }
+ 
++void KateRenderer::setCaretOverrideColor(const QColor& color)
++{
++  m_caretOverrideColor = color;
++}
++
+ // kate: space-indent on; indent-width 2; replace-tabs on;
+--- a/kate/plugins/kdatatool/ktexteditor_kdatatool.desktop
++++ b/kate/plugins/kdatatool/ktexteditor_kdatatool.desktop
+@@ -18,6 +18,7 @@
+ Name=Data tools
+ Name[ar]=أدوات للبيانات
+ Name[be]=Начынне дадзеных
++Name[br]=Ostilhoù roadoù
+ Name[ca]=Eina per a la gestió de dades
+ Name[cs]=Datové nástroje
+ Name[csb]=Nôrzãdze pòdôwków
+@@ -25,7 +26,9 @@
+ Name[el]=Εργαλεία δεδομένων
+ Name[eo]=Datumilo
+ Name[es]=Herramientas de datos
++Name[et]=Andmete tööriistad
+ Name[fa]=ابزار داده
++Name[fi]=Tekstinkäsittelytyökalut
+ Name[ga]=Uirlisí sonraí
+ Name[he]=כלי נתונים
+ Name[hu]=Adatkezelő programok
+@@ -35,6 +38,8 @@
+ Name[km]=ឧបករណ៍​ទិន្នន័យ
+ Name[kn]=ದತ್ತ ಸಲಕರಣೆಗಳು
+ Name[ko]=데이터 도구
++Name[lt]=Duomenų įrankiai
++Name[nb]=Dataverktøy
+ Name[nds]=Datenwarktüüch
+ Name[ne]=डेटा उपकरण
+ Name[nl]=Datagereedschappen
+@@ -42,9 +47,12 @@
+ Name[pt]=Ferramentas de dados
+ Name[pt_BR]=Ferramenta de Dados
+ Name[sl]=Podatkovna orodja
++Name[sr]=Алатке за податке
++Name[sr at latin]=Alatke za podatke
+ Name[sv]=Dataverktyg
+ Name[te]=దత్తాంశపు పనిముట్లు
+ Name[th]=เครื่องมือข้อมูล
++Name[uk]=Засоби для даних
+ Name[vi]=Công cụ dữ liệu
+ Name[wa]=Usteyes po les dnêyes
+ Name[x-test]=xxData toolsxx
+@@ -66,7 +74,7 @@
+ Comment[et]=Andmete tööriistad, näiteks thesaurus ja õigekirja kontroll
+ Comment[eu]=Gaitu thesaurus-a eta ortografia zuzentzailea bezalako tresnak (instalatua badaude)
+ Comment[fa]=فعال‌سازی ابزارهای داده مانند واژه‌نامه و غلط‌گیر (در صورت نصب)
+-Comment[fi]=Käytä datatyökaluja, kuten oikolukua ja sanakirjaa (jos asennettuna)
++Comment[fi]=Käytä tekstinkäsittelytyökaluja, kuten tekstin oikolukua ja sanakirjaa (jos asennettuna)
+ Comment[fr]=Activer les outils de données comme le thésaurus et la correction orthographique (s'ils sont installés)
+ Comment[fy]=Aktivearjen fan dataprogramma's, lykas de tesaurus en stavering (wannear't dy ynstallearre binne)
+ Comment[ga]=Cumasaigh uirlisí mar litreoir agus foclóir (má tá siad ar fáil)
+@@ -99,8 +107,8 @@
+ Comment[ru]=позволяет использовать утилиты словаря и проверки орфографии (если они установлены)
+ Comment[se]=Geavat diehtoreaidduid nugo synonymasátnelisttu ja čállindárkkisteami (jos leat sajáiduhttojuvvon)
+ Comment[sl]=Omogoči orodja za podatke, kot so slovar sopomenk in preverjanje črkovanja (če so nameščena)
+-Comment[sr]=Укључије алате као што су ризница и провера правописа (ако су инсталирани)
+-Comment[sr at latin]=Uključije alate kao što su riznica i provera pravopisa (ako su instalirani)
++Comment[sr]=Алатке попут синонимара и правописара (ако су инсталирани)
++Comment[sr at latin]=Alatke poput sinonimara i pravopisara (ako su instalirani)
+ Comment[sv]=Aktivera dataverktyg som synonymordlista och stavningskontroll (om installerade)
+ Comment[ta]=அகராதி, எழுத்துப்பிழை திருத்தி போன்ற தகவல் கருவிகளை இயக்கும் (நிறுவப்பட்டிருந்தால்)
+ Comment[te]=పదకోశం మరయూ అక్షర తప్పులను పట్టుకొను పనిముట్లను ఉపయోగించు (ఇంస్టాల్ చేసిన పనిచేయును)
+--- a/kate/plugins/insertfile/ktexteditor_insertfile.desktop
++++ b/kate/plugins/insertfile/ktexteditor_insertfile.desktop
+@@ -19,6 +19,7 @@
+ Name[ar]=أدرج ملفا
+ Name[be]=Уставіць файл
+ Name[bn_IN]=ফাইল সন্নিবেশ করুন
++Name[br]=Enlakkat ur restr
+ Name[ca]=Inserció de fitxer
+ Name[cs]=Vložit soubor
+ Name[csb]=Wstôwi lopk
+@@ -26,7 +27,9 @@
+ Name[el]=Εισαγωγή αρχείου
+ Name[eo]=Enmeti Dosieron
+ Name[es]=Insertar fichero
++Name[et]=Faililisaja
+ Name[fa]=درج پرونده
++Name[fi]=Lisää tiedosto
+ Name[ga]=Ionsáigh Comhad
+ Name[he]=הוספת קובץ
+ Name[hu]=Fájl beszúrása
+@@ -36,6 +39,8 @@
+ Name[km]=បញ្ចូល​ឯកសារ
+ Name[kn]=ಕಡತವನ್ನು ಒಳಸೇರಿಸು
+ Name[ko]=파일 삽입
++Name[lt]=Įterpti failą
++Name[nb]=Sett inn fil
+ Name[nds]=Datei infögen
+ Name[ne]=फाइल घुसाउँनुहोस्
+ Name[nl]=Bestand invoegen
+@@ -43,9 +48,12 @@
+ Name[pt]=Inserir um Ficheiro
+ Name[pt_BR]=Inserir Arquivo
+ Name[sl]=Vstavi datoteko
++Name[sr]=Уметање фајла
++Name[sr at latin]=Umetanje fajla
+ Name[sv]=Infoga fil
+ Name[te]=దస్త్రం చేర్చు
+ Name[th]=แทรกแฟ้ม
++Name[uk]=Вставити файл
+ Name[vi]=Chèn tập tin
+ Name[wa]=Sititchî fitchî
+ Name[x-test]=xxInsert Filexx
+@@ -66,7 +74,7 @@
+ Comment[et]=Suvalise loetava faili lisamine kursori asukohta
+ Comment[eu]=Kurtsorearen posizioan fitxategi irakurgarri bat txertatzen du
+ Comment[fa]=درج هر پروندۀ قابل خواندن در موقعیت مکان‌نما
+-Comment[fi]=Lisää mikä tahansa luettava tiedosto kursorin kohdalle
++Comment[fi]=Lisää mikä tahansa luettava tiedosto kohdistimen kohdalle
+ Comment[fr]=Insérer tout fichier lisible à la position du curseur
+ Comment[fy]=Els lêsber Triem by it rinnerke ynfoegje
+ Comment[ga]=Ionsáigh aon chomhad inléite ag an gcúrsóir
+@@ -99,8 +107,8 @@
+ Comment[ru]=вставка любого читаемого файла в позиции курсора
+ Comment[se]=Lasiha logahahtti fiilla čállinmearkka sajádahkii
+ Comment[sl]=Vstavi katerokoli berljivo datoteko na položaju kazalca
+-Comment[sr]=Убаците било који читљиви фајл на положају курсора
+-Comment[sr at latin]=Ubacite bilo koji čitljivi fajl na položaju kursora
++Comment[sr]=Убаци било који читљиви фајл на положају курсора
++Comment[sr at latin]=Ubaci bilo koji čitljivi fajl na položaju kursora
+ Comment[sv]=Infoga vilken läsbar fil som helst vid markörens plats
+ Comment[ta]=சுட்டும் இடத்தில் படிக்கக்கூடிய கோப்பினை உள்ளிடு
+ Comment[te]=ములుకు వున్న చోట చదవగలిగే దస్త్రాన్ని దూర్చును 
+--- a/kate/plugins/autobookmarker/ktexteditor_autobookmarker.desktop
++++ b/kate/plugins/autobookmarker/ktexteditor_autobookmarker.desktop
+@@ -24,6 +24,8 @@
+ Name[el]=Αυτόματοι σελιδοδείκτες
+ Name[eo]=Aŭtomata legosignigilo
+ Name[es]=Marcador automático
++Name[et]=Automaatne järjehoidjate märkija
++Name[fi]=Automaattinen kirjanmerkittäjä
+ Name[ga]=Leabharmharcálaí Uathoibríoch
+ Name[he]=מוסיף סימניות אוטומטי
+ Name[hu]=Automatikus könyvjelzők
+@@ -33,6 +35,8 @@
+ Name[km]=កម្មវិធី​ចំណាំ​ស្វ័យ​ប្រវត្តិ
+ Name[kn]=ಸ್ವಯಮಂಕನಕಾರ (ಬುಕ್ ಮಾರ್ಕರ್)
+ Name[ko]=자동 책갈피 설정
++Name[lt]=KTextEditor automatinis žymelių įterpikas
++Name[nb]=Autobokmerke
+ Name[nds]=Leestekensetter
+ Name[ne]=स्वाचालित पुस्तकचिनो
+ Name[nl]=Autobladwijzers
+@@ -40,9 +44,12 @@
+ Name[pt]=Auto-Favoritos do KTextEditor
+ Name[pt_BR]=Marcador de Favoritos Automático
+ Name[sl]=Samodejni zaznamki
++Name[sr]=Самододавач маркера
++Name[sr at latin]=Samododavač markera
+ Name[sv]=Automatiska bokmärken
+ Name[te]=ఆటొబుక్ మార్కర్
+ Name[th]=ตั้งที่คั่นหน้าอัตโนมัติ
++Name[uk]=Програма автоматичних закладок
+ Name[vi]=Bộ tự động lưu liên kết
+ Name[wa]=Rimåkes otomatikes
+ Name[x-test]=xxAutobookmarkerxx
+@@ -95,8 +102,8 @@
+ Comment[ru]=Установка закладок в текстовом документе по шаблону
+ Comment[se]=Bidjá girjemearkkaid linnjáide mat heivehit dihto minsttáriid go dokumeanttat rahpejuvvot.
+ Comment[sl]=Ob nalaganju dokumentov nastavi zaznamke za vrstice, ki se ujemajo z vzorcem
+-Comment[sr]=Поставља маркере на линијама које се уклапају у узорак када се учитавају документи
+-Comment[sr at latin]=Postavlja markere na linijama koje se uklapaju u uzorak kada se učitavaju dokumenti
++Comment[sr]=При учитавању докумената, постави маркере на линијама поклопљеним обрасцем
++Comment[sr at latin]=Pri učitavanju dokumenata, postavi markere na linijama poklopljenim obrascem
+ Comment[sv]=Lägg till bokmärken på rader som motsvarar ett mönster när dokument laddas
+ Comment[ta]= ஆவணங்கள் பதிவாகும் போது அமைப்பு புத்தகக்குறிப்பு கோடுகள் பொருத்தும் மாதிரி
+ Comment[te]=పత్రాలు ఎక్కించిన తరువాత బాణీకి సరిపొయిన వరుసల మీద బుక్ మార్కులను ఏర్పరుచును
+--- a/kate/plugins/autobookmarker/autobookmarker.cpp
++++ b/kate/plugins/autobookmarker/autobookmarker.cpp
+@@ -202,8 +202,8 @@
+   while ( config->hasGroup( QString("autobookmark%1").arg( n ) ) )
+   {
+     KConfigGroup cg( config, QString("autobookmark%1").arg( n ) );
+-    QStringList filemask = cg.readEntry( "filemask", QStringList(), ';' );
+-    QStringList mimemask = cg.readEntry( "mimemask", QStringList(), ';' );
++    QStringList filemask = cg.readXdgListEntry( "filemask" );
++    QStringList mimemask = cg.readXdgListEntry( "mimemask" );
+     int flags = cg.readEntry( "flags", 1 );
+     AutoBookmarkEnt *e = new AutoBookmarkEnt(
+         cg.readEntry( "pattern", "" ),
+@@ -235,8 +235,8 @@
+     AutoBookmarkEnt *e = m_ents->at( i );
+     KConfigGroup cg( config, QString("autobookmark%1").arg( i ) );
+     cg.writeEntry( "pattern", e->pattern );
+-    cg.writeEntry( "filemask", e->filemask, ';' );
+-    cg.writeEntry( "mimemask", e->mimemask, ';' );
++    cg.writeXdgListEntry( "filemask", e->filemask );
++    cg.writeXdgListEntry( "mimemask", e->mimemask );
+     cg.writeEntry( "flags", e->flags );
+   }
+ 
+--- a/kate/plugins/wordcompletion/docwordcompletion.h
++++ b/kate/plugins/wordcompletion/docwordcompletion.h
+@@ -116,6 +116,8 @@
+   private Q_SLOTS:
+     void completeBackwards();
+     void completeForwards();
++    void slotCursorMoved();
++
+     void shellComplete();
+ 
+     void popupCompletionList();
+--- a/kate/plugins/wordcompletion/docwordcompletion_config.cpp
++++ b/kate/plugins/wordcompletion/docwordcompletion_config.cpp
+@@ -31,7 +31,9 @@
+ #include <klocale.h>
+ #include <kgenericfactory.h>
+ 
++#ifndef KDE_USE_FINAL
+ K_PLUGIN_FACTORY_DECLARATION(DocWordCompletionFactory)
++#endif
+ 
+ DocWordCompletionConfig::DocWordCompletionConfig(QWidget *parent, const QVariantList &args)
+     : KCModule(DocWordCompletionFactory::componentData(), parent, args)
+--- a/kate/plugins/wordcompletion/ktexteditor_docwordcompletion.desktop
++++ b/kate/plugins/wordcompletion/ktexteditor_docwordcompletion.desktop
+@@ -25,6 +25,7 @@
+ Name[el]=Συμπλήρωση λέξεων
+ Name[eo]=Vortkompletigo
+ Name[es]=Terminación de palabras
++Name[et]=Sõnalõpetus
+ Name[fa]=تکمیل واژه
+ Name[ga]=Comhlánú Focal
+ Name[he]=השלמת מילים אוטומטית
+@@ -35,16 +36,22 @@
+ Name[km]=ការ​បំពេញ​ពាក្យ​
+ Name[kn]=ಪದ ಪೂರಣ
+ Name[ko]=단어 완성
++Name[lt]=Žodžių užbaigimas
++Name[nb]=Fullføring av ord
+ Name[nds]=Wöör-Kompletteren
+ Name[ne]=शब्द समापन
+ Name[nl]=Woordaanvulling
++Name[oc]=Completatge de mots
+ Name[pa]=ਸ਼ਬਦ ਪੂਰਨ
+ Name[pt]=Completação de Palavras
+ Name[pt_BR]=Complementação de Palavras
+ Name[sl]=Dopolnjevanje besed
++Name[sr]=Допуна речи
++Name[sr at latin]=Dopuna reči
+ Name[sv]=Ordkomplettering
+ Name[te]=పదం పూరణ
+ Name[th]=การเติมคำให้สมบูรณ์
++Name[uk]=Завершення слів
+ Name[vi]=Gõ xong từ
+ Name[wa]=Completaedje des mots
+ Name[x-test]=xxWord Completionxx
+@@ -77,6 +84,7 @@
+ Comment[it]=Completamento direzionale o con finestre a comparsa di parole nel documento
+ Comment[ja]=ポップアップまたはユーザの指示によって文書の単語から補完します
+ Comment[kk]=Құжаттағы сөздерді аяқтау модулі
++Comment[km]=ការ​បំពេញ​ពាក្យ​ដោយ​ផ្ទាល់ ឬ​តាម​រយៈ​ការ​លេចឡើង​នៃ​ពាក្យ​ដែល​មាន​ក្នុង​ឯកសារ
+ Comment[kn]=ದಸ್ತಾವೇಜಿನಲ್ಲಿ ನಿರ್ದೇಶನಾಧಾರಿತ ಅಥವಾ ಪುಟಿಕೆ (ಪಾಪ್ ಅಪ್) -ಆಧಾರಿತ ಪದಗಳ ಪೂರಣಗೊಳಿಸುವಿಕೆ
+ Comment[ko]=문서 내에서의 방향 및 팝업 기반 단어 완성
+ Comment[lb]=Direktional oder Opklapp-Fënster-baséiert Vervollstännegung vu Wierder am Dokument
+@@ -96,8 +104,8 @@
+ Comment[ro]=Propune completarea cuvintelor din document dintr-o listă popup sau direcţională
+ Comment[ru]=Автодополнение слов в документе
+ Comment[sl]=Neposredno ali pojavno dopolnjevanje iz besed v dokumentu
+-Comment[sr]=Директна или искачућа допуна од речи у документу
+-Comment[sr at latin]=Direktna ili iskačuća dopuna od reči u dokumentu
++Comment[sr]=Дирекционо или искачуће допуњавање према речима из документа
++Comment[sr at latin]=Direkciono ili iskačuće dopunjavanje prema rečima iz dokumenta
+ Comment[sv]=Komplettering av ord i dokumentet baserad på ordlista eller dialogruta
+ Comment[ta]=ஆவணத்திலுள்ள வார்த்தைகளிலிருந்து திசைகள் அல்லது மேல்விரி-சார்ந்த நிறைவு 
+ Comment[te]=పత్రం లోని పదాలు వాడె, దిశా లేక పాప్ అప్ ఆధారిత పద పూరణ
+--- a/kate/plugins/wordcompletion/docwordcompletion.cpp
++++ b/kate/plugins/wordcompletion/docwordcompletion.cpp
+@@ -33,6 +33,7 @@
+ #include <ktexteditor/variableinterface.h>
+ #include <ktexteditor/smartinterface.h>
+ #include <ktexteditor/smartrange.h>
++#include <ktexteditor/rangefeedback.h>
+ 
+ #include <kconfig.h>
+ #include <kdialog.h>
+@@ -47,6 +48,7 @@
+ #include <kpagewidgetmodel.h>
+ #include <ktoggleaction.h>
+ #include <kconfiggroup.h>
++#include <kcolorscheme.h>
+ 
+ #include <QtCore/QRegExp>
+ #include <QtCore/QString>
+@@ -85,8 +87,7 @@
+   switch ( role )
+   {
+     case Qt::DisplayRole:
+-      if ( index.column() == Name )
+-        return m_matches.at( index.row() );
++      return m_matches.at( index.row() );
+     case CompletionRole:
+       return (int)FirstProperty|LastProperty|Public;
+     case ScopeIndex:
+@@ -251,6 +252,7 @@
+   KToggleAction *autopopup; // for accessing state
+   uint treshold;        // the required length of a word before popping up the completion list automatically
+   int directionalPos;   // be able to insert "" at the correct time
++  bool isCompleting; // true when the directional completion is doing a completion
+ };
+ 
+ DocWordCompletionPluginView::DocWordCompletionPluginView( uint treshold,
+@@ -264,9 +266,9 @@
+     d( new DocWordCompletionPluginViewPrivate )
+ {
+ //   setObjectName( name );
+-
++  d->isCompleting = false;
+   d->treshold = treshold;
+-  d->dcRange = KTextEditor::Range();
++  d->dcRange = KTextEditor::Range::invalid();
+   KTextEditor::SmartInterface *si =
+      qobject_cast<KTextEditor::SmartInterface*>( m_view->document() );
+ 
+@@ -274,16 +276,12 @@
+     return;
+ 
+   d->liRange = si->newSmartRange();
+-//   d->liRange->setInsertBehavior(KTextEditor::SmartRange::ExpandRight|KTextEditor::SmartRange::ExpandLeft);
+ 
+-  KTextEditor::Attribute::Ptr a( new KTextEditor::Attribute() );
+-  QColor bg = Qt::blue;
+-  bg.setAlpha(0x88);
+-  a->setBackground( QBrush(bg) );
+-//   a->setForeground( QBrush(Qt:white) );
++  KColorScheme colors(QPalette::Active);
++  KTextEditor::Attribute::Ptr a = KTextEditor::Attribute::Ptr( new KTextEditor::Attribute() );
++  a->setBackground( colors.background(KColorScheme::ActiveBackground) );
++  a->setForeground( colors.foreground(KColorScheme::ActiveText) ); // ### this does 0
+   d->liRange->setAttribute( a );
+-  si->addHighlightToView( m_view, d->liRange, false );
+-//   si->addHighlightToDocument( d->liRange, false );
+ 
+   view->insertChildClient( this );
+ 
+@@ -380,7 +378,7 @@
+   if ( ! m_dWCompletionModel->rowCount(QModelIndex()) ) return;
+ 
+   KTextEditor::CodeCompletionInterface *cci = qobject_cast<KTextEditor::CodeCompletionInterface *>( m_view );
+-  if ( cci )
++  if ( cci && ! cci->isCompletionActive() )
+     cci->startCompletion( r, m_dWCompletionModel );
+ }
+ 
+@@ -425,12 +423,18 @@
+ 
+   QString partial = findLongestUnique( matches, r.columnWidth() );
+ 
+-  if ( partial.length() == r.columnWidth() )
++  if ( ! partial.length() )
+     popupCompletionList();
+ 
+   else
+   {
+     m_view->document()->insertText( r.end(), partial.mid( r.columnWidth() ) );
++    KTextEditor::SmartInterface *si = qobject_cast<KTextEditor::SmartInterface*>( m_view->document() );
++    if ( si ) {
++      si->addHighlightToView( m_view, d->liRange, true );
++      d->liRange->setRange( KTextEditor::Range( r.end(), partial.length() - r.columnWidth() ) );
++      connect( m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*, const KTextEditor::Cursor&)), this, SLOT(slotCursorMoved()) );
++    }
+   }
+ }
+ 
+@@ -445,13 +449,7 @@
+   int inc = fw ? 1 : -1;
+   KTextEditor::Document *doc = m_view->document();
+ 
+-  /* IF the current line is equal to the previous line
+-     AND the position - the length of the last inserted string
+-          is equal to the old position
+-     AND the lastinsertedlength last characters of the word is
+-          equal to the last inserted string
+-          */
+-  if ( r.start() == d->dcRange.start() && r.end() >= d->dcRange.end() )
++  if ( d->dcRange.isValid() )
+   {
+     //kDebug()<<"CONTINUE "<<d->dcRange;
+     // this is a repeted activation
+@@ -482,6 +480,14 @@
+     d->liRange->setRange( KTextEditor::Range( r.end(), 0 ) );
+     d->dcCursor = r.start();
+     d->directionalPos = inc;
++
++  KTextEditor::SmartInterface *si =
++     qobject_cast<KTextEditor::SmartInterface*>( m_view->document() );
++  if ( si )
++    si->addHighlightToView( m_view, d->liRange, true );
++
++    connect( m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*, const KTextEditor::Cursor&)), this, SLOT(slotCursorMoved()) );
++
+   }
+ 
+   d->re.setPattern( "\\b" + doc->text( d->dcRange ) + "(\\w+)" );
+@@ -499,21 +505,16 @@
+     {
+       //kDebug()<<"USABLE MATCH";
+       QString m = d->re.cap( 1 );
+-      if ( m != doc->text( *d->liRange ) )
++      if ( m != doc->text( *d->liRange ) && (d->dcCursor.line() != d->dcRange.start().line() || pos != d->dcRange.start().column() ) )
+       {
+         // we got good a match! replace text and return.
++        d->isCompleting = true;
+         doc->replaceText( *d->liRange, m );
+-kDebug()<<"liRange:"<<*d->liRange;
+-
+         d->liRange->setRange( KTextEditor::Range( d->dcRange.end(), m.length() ) );
+ 
+-kDebug()<<"lirange background:"<<d->liRange->attribute()->background();
+         d->dcCursor.setColumn( pos ); // for next try
+-  KTextEditor::SmartInterface *si =
+-     qobject_cast<KTextEditor::SmartInterface*>( m_view->document() );
+-foreach(KTextEditor::SmartRange* range, si->viewHighlights(m_view))
+-kDebug()<<"highlighted range:"<<*range;
+ 
++        d->isCompleting = false;
+         return;
+       }
+ 
+@@ -565,6 +566,20 @@
+   } // while true
+ }
+ 
++void DocWordCompletionPluginView::slotCursorMoved()
++{
++  if ( d->isCompleting) return;
++
++  d->dcRange = KTextEditor::Range::invalid();
++
++  disconnect( m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*, const KTextEditor::Cursor&)), this, SLOT(slotCursorMoved()) );
++
++  KTextEditor::SmartInterface *si =
++     qobject_cast<KTextEditor::SmartInterface*>( m_view->document() );
++  if ( si )
++    si->removeHighlightFromView( m_view, d->liRange );
++}
++
+ // Contributed by <brain at hdsnet.hu> FIXME
+ QString DocWordCompletionPluginView::findLongestUnique( const QStringList &matches, int lead ) const
+ {
+--- a/kate/plugins/wordcompletion/ktexteditor_docwordcompletion_config.desktop
++++ b/kate/plugins/wordcompletion/ktexteditor_docwordcompletion_config.desktop
+@@ -10,12 +10,15 @@
+ Name[ar]=السلوك
+ Name[be]=Паводзіны
+ Name[bn_IN]=আচরণ
++Name[br]=Emzalc'h
+ Name[ca]=Comportament
+ Name[cs]=Chování
+ Name[csb]=Zachòwónié
+ Name[de]=Verhalten
+ Name[el]=Συμπεριφορά
+ Name[es]=Comportamiento
++Name[et]=Käitumine
++Name[fi]=Käyttäytyminen
+ Name[ga]=Oibriú
+ Name[he]=פעולה
+ Name[hu]=Működés
+@@ -26,15 +29,21 @@
+ Name[kn]=ವರ್ತನೆ
+ Name[ko]=동작
+ Name[lt]=Elgsena
++Name[lv]=Izturēšanās
++Name[nb]=Oppførsel
+ Name[nds]=Bedregen
+ Name[ne]=ब्यवहार
+ Name[nl]=Gedrag
++Name[oc]=Compòrtament
+ Name[pa]=ਰਵੱਈਆ
+ Name[pt]=Comportamento
+ Name[pt_BR]=Comportamento
+ Name[sl]=Obnašanje
++Name[sr]=Понашање
++Name[sr at latin]=Ponašanje
+ Name[sv]=Beteende
+ Name[th]=พฤติกรรม
++Name[uk]=Поведінка
+ Name[wa]=Dujhance
+ Name[x-test]=xxBehaviorxx
+ Name[zh_CN]=行为
+--- a/kate/plugins/timedate/ktexteditor_timedate_config.desktop
++++ b/kate/plugins/timedate/ktexteditor_timedate_config.desktop
+@@ -13,6 +13,8 @@
+ Name[de]=Format für das Einfügen von Uhrzeit & Datum
+ Name[el]=Μορφή εισαγωγής ώρας & ημερομηνίας
+ Name[es]=Formato de la inserción de hora y fecha
++Name[et]=Kellaaja ja kuupäeva lisamise vorming
++Name[fi]=Ajan ja päiväyksen muoto
+ Name[ga]=Formáid Ionsáite Ama agus Dáta
+ Name[he]=הגדרות תבנית התאריך והשעה המוספים
+ Name[hu]=A beszúrt dátum és idő formátuma
+@@ -22,6 +24,8 @@
+ Name[km]=ទ្រង់ទ្រាយ​នៃ​ការ​បញ្ចូល​ពេលវេលា និង​កាលបរិច្ឆេទ
+ Name[kn]=ಸಮಯ ಮತ್ತು ದಿನಾಂಕ ಒಳಸೇರಿಸುವಿಕೆಯ ಶೈಲಿ
+ Name[ko]=날짜 및 시간 삽입 형식
++Name[lt]=Įterpiamos datos ir laiko formatas
++Name[nb]=Format for innsatt dato og tid
+ Name[nds]=Formaat för inföögt Datum un Tiet
+ Name[ne]=घुसाइने समय र मितिको ढाँचा
+ Name[nl]=Opmaak van ingevoegde datum en tijd
+@@ -29,8 +33,11 @@
+ Name[pt]=Formato da inserção da Data & Hora
+ Name[pt_BR]=Formato da inserção da Data & Hora
+ Name[sl]=Oblika vstavljenega časa in datuma
++Name[sr]=Формат уметања времена и датума
++Name[sr at latin]=Format umetanja vremena i datuma
+ Name[sv]=Format för att infoga tid och datum
+ Name[th]=รูปแบบของการแทรกเวลา & วันที่
++Name[uk]=Формат часу і дати для вставлення
+ Name[wa]=Cogne pol date et l' eure
+ Name[x-test]=xxFormat of Time & Date insertionxx
+ Name[zh_CN]=插入的时间和日期的格式
+--- a/kate/plugins/timedate/ktexteditor_timedate.desktop
++++ b/kate/plugins/timedate/ktexteditor_timedate.desktop
+@@ -16,11 +16,14 @@
+ Icon=korganizer
+ Name=Time & Date
+ Name[bn_IN]=সময় ও তারিখ
++Name[br]=Deiziad hag eur
+ Name[ca]=Data i hora
+ Name[cs]=Datum a čas
+ Name[de]=Uhrzeit & Datum
+ Name[el]=Ώρα & ημερομηνία
+ Name[es]=Hora y fecha
++Name[et]=Kuupäev ja kellaaeg
++Name[fi]=Aika ja päiväys
+ Name[ga]=Am agus Dáta
+ Name[he]=תאריך ושעה
+ Name[hu]=Dátum és idő
+@@ -31,6 +34,7 @@
+ Name[kn]=ಸಮಯ ಮತ್ತು ದಿನಾಂಕ
+ Name[ko]=시간과 날짜
+ Name[lt]=Laikas ir data
++Name[nb]=Dato og tid
+ Name[nds]=Datum un Tiet
+ Name[ne]=समय र मिति
+ Name[nl]=Datum & tijd
+@@ -38,8 +42,11 @@
+ Name[pt]=Hora & Data
+ Name[pt_BR]=Hora & Data
+ Name[sl]=Čas in datum
++Name[sr]=Време и датум
++Name[sr at latin]=Vreme i datum
+ Name[sv]=Tid och datum
+ Name[th]=เวลา & วันที่
++Name[uk]=Час і дата
+ Name[wa]=Date et eure
+ Name[x-test]=xxTime & Datexx
+ Name[zh_CN]=时间和日期
+@@ -50,6 +57,8 @@
+ Comment[de]=Einfügen von Uhrzeit & Datum
+ Comment[el]=Εισαγωγή τρέχουσας ώρας & ημερομηνίας
+ Comment[es]=Insertar hora y fecha actuales
++Comment[et]=Praeguse kellaaja ja kuupäeva lisamine
++Comment[fi]=Lisää aika ja päiväys
+ Comment[ga]=Ionsáigh an tAm agus an Dáta reatha
+ Comment[he]=הוספת התאריך והשעה הנוכחיים
+ Comment[hu]=Az aktuális dátum és idő beszúrása
+@@ -59,6 +68,8 @@
+ Comment[km]=បញ្ចូល​ពេលវេលា និង​កាលបរិច្ឆេទ​បច្ចុប្បន្ន
+ Comment[kn]=ಪ್ರಸ್ತುತ ಸಮಯ ಮತ್ತು ಮತ್ತು ದಿನಾಂಕವನ್ನು ಒಳಸೇರಿಸು
+ Comment[ko]=현재 시간과 날짜를 삽입합니다
++Comment[lt]=Įterpti dabartinį laiką ir datą
++Comment[nb]=Sett inn nåværende tid og dato
+ Comment[nds]=Aktuell Datum un Tiet infögen
+ Comment[ne]=हालको समय र मिति घुसाउनुहोस्
+ Comment[nl]=Huidige datum en tijd invoegen
+@@ -66,8 +77,11 @@
+ Comment[pt]=Inserir a Data & Hora actual
+ Comment[pt_BR]=Inserir a Data & Hora atual
+ Comment[sl]=Vstavi trenuten čas in datum
++Comment[sr]=Уметни тренутно време и датум
++Comment[sr at latin]=Umetni trenutno vreme i datum
+ Comment[sv]=Infoga aktuell tid och datum
+ Comment[th]=แทรกเวลาและวันที่
++Comment[uk]=Вставити поточний час і дату
+ Comment[wa]=Sititchî l' date et eure do moumint
+ Comment[x-test]=xxInsert current Time & Datexx
+ Comment[zh_CN]=插入当前时间和日期
+--- a/kate/dialogs/completionconfigwidget.ui
++++ b/kate/dialogs/completionconfigwidget.ui
+@@ -404,8 +404,14 @@
+             </property>
+             <item>
+              <widget class="QLabel" name="label" >
++              <property name="font" >
++               <font>
++                <weight>75</weight>
++                <bold>true</bold>
++               </font>
++              </property>
+               <property name="text" >
+-               <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Access Grouping properties&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
++               <string>Access Grouping properties</string>
+               </property>
+              </widget>
+             </item>
+@@ -464,8 +470,14 @@
+             </property>
+             <item>
+              <widget class="QLabel" name="label_3" >
++              <property name="font" >
++               <font>
++                <weight>75</weight>
++                <bold>true</bold>
++               </font>
++              </property>
+               <property name="text" >
+-               <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Item Grouping properties&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
++               <string>Item Grouping properties</string>
+               </property>
+              </widget>
+             </item>
+--- a/kate/dialogs/searchbarpower.ui
++++ b/kate/dialogs/searchbarpower.ui
+@@ -383,7 +383,7 @@
+               <string>Resolve placeholders (\0 to \9) and escape sequences (\n, \t, ..)</string>
+              </property>
+              <property name="text" >
+-              <string>Use Placeholders</string>
++              <string>Use placeholders</string>
+              </property>
+             </widget>
+            </item>
+--- a/kate/dialogs/katedialogs.cpp
++++ b/kate/dialogs/katedialogs.cpp
+@@ -3,6 +3,7 @@
+    Copyright (C) 2003 Christoph Cullmann <cullmann at kde.org>
+    Copyright (C) 2001 Joseph Wenninger <jowenn at kde.org>
+    Copyright (C) 2006 Dominik Haumann <dhdev at gmx.de>
++   Copyright (C) 2007 Mirko Stocker <me at misto.ch>
+ 
+    Based on work of:
+      Copyright (C) 1999 Jochen Wilhelmy <digisnap at cs.tu-berlin.de>
+@@ -519,29 +520,30 @@
+ 
+ //BEGIN KateEditKeyConfiguration
+ 
+-KateEditKeyConfiguration::KateEditKeyConfiguration( QWidget* parent, KateDocument* doc )
++KateEditKeyConfiguration::KateEditKeyConfiguration( QWidget* parent)
+   : KateConfigPage( parent )
++  , m_ready(false)
+ {
+-  m_doc = doc;
+-  m_ready = false;
++  m_doc = new KateDocument();
++  m_view = new KateView(m_doc, 0);
+ }
+ 
+-void KateEditKeyConfiguration::showEvent ( QShowEvent * )
++KateEditKeyConfiguration::~KateEditKeyConfiguration()
+ {
+-#ifdef __GNUC__
+-#warning fixme, to work without a document object, perhaps create some own internally
+-#endif
+-  return ;
++  delete m_view;
++  delete m_doc;
++}
+ 
++void KateEditKeyConfiguration::showEvent ( QShowEvent * )
++{
+   if (!m_ready)
+   {
+-    QVBoxLayout *l=new QVBoxLayout(this);
+-    KateView* view = (KateView*)m_doc->views().at(0);
+-    m_ac = view->editActionCollection();
+-    l->addWidget(m_shortcutsEditor = new KShortcutsEditor( m_ac, this, false ));
+-    //is this really needed? if yes, I'll add it to KShortcutsEditor
+-    //note that changes will immediately become active with KShortcutsEditor -- ahartmetz
+-    //connect( m_shortcutsEditor, SIGNAL( keyChange() ), this, SLOT( slotChanged() ) );
++	m_actionCollection = m_view->editActionCollection();
++
++    QVBoxLayout *layout = new QVBoxLayout(this);	
++    layout->addWidget(m_shortcutsEditor = new KShortcutsEditor( m_actionCollection, this, false ));
++    connect( m_shortcutsEditor, SIGNAL( keyChange() ), this, SLOT( slotChanged() ) );
++
+     m_shortcutsEditor->show ();
+ 
+     m_ready = true;
+@@ -552,22 +554,15 @@
+ 
+ void KateEditKeyConfiguration::apply()
+ {
+-#ifdef __GNUC__
+-#warning fixme, to work without a document object, perhaps create some own internally
+-#endif
+-  return ;
+-
+-  if ( ! hasChanged() )
++  if(!hasChanged())
+     return;
+   m_changed = false;
+ 
+   if (m_ready)
+   {
+-#ifdef __GNUC__
+-#warning: semantics of KKeyDialog changed from change/commit to change in-place/revert
+-#endif
+-    //m_keyChooser->commitChanges();
+-    m_ac->writeSettings();
++    KateViewConfig::global()->configStart ();
++    m_actionCollection->writeSettings();
++    KateViewConfig::global()->configEnd ();
+   }
+ }
+ //END KateEditKeyConfiguration
+--- a/kate/dialogs/katedialogs.h
++++ b/kate/dialogs/katedialogs.h
+@@ -3,6 +3,7 @@
+    Copyright (C) 2003 Christoph Cullmann <cullmann at kde.org>
+    Copyright (C) 2001 Joseph Wenninger <jowenn at kde.org>
+    Copyright (C) 2006 Dominik Haumann <dhdev at gmx.de>
++   Copyright (C) 2007 Mirko Stocker <me at misto.ch>
+ 
+    Based on work of:
+      Copyright (C) 1999 Jochen Wilhelmy <digisnap at cs.tu-berlin.de>
+@@ -204,7 +205,8 @@
+   Q_OBJECT
+ 
+   public:
+-    KateEditKeyConfiguration( QWidget* parent, KateDocument* doc );
++    KateEditKeyConfiguration( QWidget* parent );
++    ~KateEditKeyConfiguration();
+ 
+   public Q_SLOTS:
+     void apply();
+@@ -217,9 +219,12 @@
+ 
+   private:
+     bool m_ready;
+-    class KateDocument *m_doc;
+     KShortcutsEditor* m_shortcutsEditor;
+-    class KActionCollection *m_ac;
++    class KActionCollection *m_actionCollection;
++    
++    // we use a fake document/view to get the action collection:
++    class KateDocument *m_doc;
++    class KateView *m_view;
+ };
+ 
+ class KateSaveConfigTab : public KateConfigPage
+--- /dev/null
++++ b/kate/mode/katewildcardmatcher.cpp
+@@ -0,0 +1,89 @@
++/* This file is part of the KDE libraries
++   Copyright (C) 2007 Sebastian Pipping <webmaster at hartwork.org>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License version 2 as published by the Free Software Foundation.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++
++#include "katewildcardmatcher.h"
++#include <QString>
++#include <QChar>
++
++
++
++namespace KateWildcardMatcher {
++
++
++
++bool exactMatch(const QString & candidate, const QString & wildcard, int candidatePosFromRight,
++        int wildcardPosFromRight, bool caseSensitive = true) {
++	for (; wildcardPosFromRight >= 0; wildcardPosFromRight--) {
++		const ushort ch = wildcard[wildcardPosFromRight].unicode();
++		switch (ch) {
++		case L'*':
++		    if (candidatePosFromRight == -1) {
++		        break;
++		    }
++
++			if (wildcardPosFromRight == 0) {
++				return true;
++			}
++
++			// Eat all we can and go back as far as we have to
++			for (int j = -1; j <= candidatePosFromRight; j++) {
++				if (exactMatch(candidate, wildcard, j, wildcardPosFromRight - 1)) {
++					return true;
++				}
++			}
++			return false;
++
++		case L'?':
++		    if (candidatePosFromRight == -1) {
++		        return false;
++		    }
++
++			candidatePosFromRight--;
++			break;
++
++		default:
++		    if (candidatePosFromRight == -1) {
++		        return false;
++		    }
++
++    		const ushort candidateCh = candidate[candidatePosFromRight].unicode();
++		    const bool match = caseSensitive
++		            ? (candidateCh == ch)
++		            : (QChar::toLower(candidateCh) == QChar::toLower(ch));
++			if (match) {
++				candidatePosFromRight--;
++			} else {
++                return false;
++			}
++		}
++	}
++	return true;
++}
++
++
++
++bool exactMatch(const QString & candidate, const QString & wildcard,
++        bool caseSensitive) {
++    return exactMatch(candidate, wildcard, candidate.length() - 1,
++            wildcard.length() - 1, caseSensitive);
++}
++
++
++
++}
++
+--- a/kate/mode/katemodemanager.cpp
++++ b/kate/mode/katemodemanager.cpp
+@@ -19,6 +19,7 @@
+ //BEGIN Includes
+ #include "katemodemanager.h"
+ #include "katemodemanager.moc"
++#include "katewildcardmatcher.h"
+ 
+ #include "katedocument.h"
+ #include "kateconfig.h"
+@@ -68,7 +69,7 @@
+ //
+ void KateModeManager::update ()
+ {
+-  KConfig config ("katemoderc", KConfig::CascadeConfig);
++  KConfig config ("katemoderc", KConfig::NoGlobals);
+ 
+   QStringList g (config.groupList());
+ 
+@@ -83,8 +84,8 @@
+     type->number = z;
+     type->name = g[z];
+     type->section = cg.readEntry ("Section");
+-    type->wildcards = cg.readEntry ("Wildcards", QStringList(), ';');
+-    type->mimetypes = cg.readEntry ("Mimetypes", QStringList(), ';');
++    type->wildcards = cg.readXdgListEntry ("Wildcards");
++    type->mimetypes = cg.readXdgListEntry ("Mimetypes");
+     type->priority = cg.readEntry ("Priority", 0);
+     type->varLine = cg.readEntry ("Variables");
+     
+@@ -166,7 +167,7 @@
+ //
+ void KateModeManager::save (const QList<KateFileType *>& v)
+ {
+-  KConfig katerc("katemoderc", KConfig::CascadeConfig);
++  KConfig katerc("katemoderc", KConfig::NoGlobals);
+   KConfigGroup config(&katerc, QString());
+ 
+   QStringList newg;
+@@ -175,8 +176,8 @@
+     config.changeGroup(type->name);
+ 
+     config.writeEntry ("Section", type->section);
+-    config.writeEntry ("Wildcards", type->wildcards, ';');
+-    config.writeEntry ("Mimetypes", type->mimetypes, ';');
++    config.writeXdgListEntry ("Wildcards", type->wildcards);
++    config.writeXdgListEntry ("Mimetypes", type->mimetypes);
+     config.writeEntry ("Priority", type->priority);
+ 
+     QString varLine = type->varLine;
+@@ -279,38 +280,25 @@
+ 
+ QString KateModeManager::wildcardsFind (const QString &fileName)
+ {
+-  QList<KateFileType*> types;
+-
++  KateFileType * match = NULL;
++  int minPrio = -1;
+   foreach (KateFileType *type, m_types)
+   {
+-    foreach (QString wildcard, type->wildcards)
+-    {
+-      // anders: we need to be sure to match the end of string, as eg a css file
+-      // would otherwise end up with the c hl
+-      QRegExp re(wildcard, Qt::CaseSensitive, QRegExp::Wildcard);
+-      if ( ( re.indexIn( fileName ) > -1 ) && ( re.matchedLength() == (int)fileName.length() ) )
+-        types.append (type);
++    if (type->priority <= minPrio) {
++      continue;
+     }
+-  }
+-
+-  if ( !types.isEmpty() )
+-  {
+-    int pri = -1;
+-    QString name;
+ 
+-    foreach (KateFileType *type, types)
++    foreach (QString wildcard, type->wildcards)
+     {
+-      if (type->priority > pri)
+-      {
+-        pri = type->priority;
+-        name = type->name;
++      if (KateWildcardMatcher::exactMatch(fileName, wildcard)) {
++        match = type;
++        minPrio = type->priority;
++        break;
+       }
+     }
+-
+-    return name;
+   }
+ 
+-  return "";
++  return (match == NULL) ? "" : match->name;
+ }
+ 
+ const KateFileType& KateModeManager::fileType(const QString &name) const
+--- /dev/null
++++ b/kate/mode/katewildcardmatcher.h
+@@ -0,0 +1,47 @@
++/* This file is part of the KDE libraries
++   Copyright (C) 2007 Sebastian Pipping <webmaster at hartwork.org>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License version 2 as published by the Free Software Foundation.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++
++#ifndef KATE_WILDCARD_MATCHER_H
++#define KATE_WILDCARD_MATCHER_H
++
++
++
++class QString;
++
++
++
++namespace KateWildcardMatcher {
++
++    /**
++     * Matches a string against a given wildcard.
++     * The wildcard supports '*' (".*" in regex) and '?' ("." in regex), not more.
++     *
++     * @param candidate       Text to match
++     * @param wildcard        Wildcard to use
++     * @param caseSensitive   Case-sensitivity flag
++     * @return                True for an exact match, false otherwise
++     */
++    bool exactMatch(const QString & candidate, const QString & wildcard,
++            bool caseSensitive = true);
++
++}
++
++
++
++#endif // KATE_WILDCARD_MATCHER_H
++
+--- a/kate/mode/katemodemanager.h
++++ b/kate/mode/katemodemanager.h
+@@ -77,6 +77,7 @@
+   private:
+     QList<KateFileType *> m_types;
+     QHash<QString, KateFileType *> m_name2Type;
++
+ };
+ 
+ #endif
+--- /dev/null
++++ b/kate/mode/testing/katewildcardmatcher_test.cpp
+@@ -0,0 +1,63 @@
++/* This file is part of the KDE libraries
++   Copyright (C) 2007 Sebastian Pipping <webmaster at hartwork.org>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License version 2 as published by the Free Software Foundation.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++
++#include "../katewildcardmatcher.h"
++#include <QtGlobal>
++#include <QtDebug>
++
++
++
++bool testCase(const char * candidate, const char * wildcard) {
++    qDebug("\"%s\" / \"%s\"", candidate, wildcard);
++	return KateWildcardMatcher::exactMatch(QString(candidate), QString(wildcard));
++}
++
++
++
++int main() {
++    Q_ASSERT(testCase("abc.txt", "*.txt"));
++    Q_ASSERT(!testCase("abc.txt", "*.cpp"));
++
++    Q_ASSERT(testCase("Makefile.am", "*Makefile*"));
++
++    Q_ASSERT(testCase("control", "control"));
++
++    Q_ASSERT(testCase("abcd", "a??d"));
++
++    Q_ASSERT(testCase("a", "?"));
++    Q_ASSERT(testCase("a", "*?*"));
++    Q_ASSERT(testCase("a", "*"));
++    Q_ASSERT(testCase("a", "**"));
++    Q_ASSERT(testCase("a", "***"));
++
++    Q_ASSERT(testCase("", "*"));
++    Q_ASSERT(testCase("", "**"));
++    Q_ASSERT(!testCase("", "?"));
++
++    Q_ASSERT(testCase("ab", "a*"));
++    Q_ASSERT(testCase("ab", "*b"));
++    Q_ASSERT(testCase("ab", "a?"));
++    Q_ASSERT(testCase("ab", "?b"));
++
++    Q_ASSERT(testCase("aXXbXXbYYaYc", "a*b*c"));
++
++    
++    qDebug() << endl << "DONE";
++	return 0;
++}
++
+--- /dev/null
++++ b/kate/mode/testing/testing.pro
+@@ -0,0 +1,7 @@
++SOURCES += \
++    ../katewildcardmatcher.cpp \
++    katewildcardmatcher_test.cpp \
++
++HEADERS += \
++    ../katewildcardmatcher.h \
++
+--- a/kate/smart/katesmartmanager.cpp
++++ b/kate/smart/katesmartmanager.cpp
+@@ -22,6 +22,8 @@
+ #include "katesmartcursor.h"
+ #include "katesmartrange.h"
+ 
++#include <QThread>
++
+ #include <kdebug.h>
+ 
+ static const int s_defaultGroupSize = 40;
+@@ -35,7 +37,6 @@
+   , m_firstGroup(new KateSmartGroup(0, 0, 0L, 0L))
+   , m_invalidGroup(new KateSmartGroup(-1, -1, 0L, 0L))
+   , m_clearing(false)
+-  , m_usingRevision(-1)
+ {
+   connect(doc()->history(), SIGNAL(editDone(KateEditInfo*)), SLOT(slotTextChanged(KateEditInfo*)));
+   //connect(doc(), SIGNAL(textChanged(Document*)), SLOT(verifyCorrect()));
+@@ -63,7 +64,7 @@
+ KateSmartCursor * KateSmartManager::newSmartCursor( const Cursor & position, SmartCursor::InsertBehavior insertBehavior, bool internal )
+ {
+   KateSmartCursor* c;
+-  if (m_usingRevision != -1)
++  if (usingRevision() != -1)
+     c = new KateSmartCursor(translateFromRevision(position), doc(), insertBehavior);
+   else
+     c = new KateSmartCursor(position, doc(), insertBehavior);
+@@ -77,7 +78,7 @@
+ {
+   KateSmartRange* newRange;
+ 
+-  if (m_usingRevision != -1)
++  if (usingRevision() != -1)
+     newRange = new KateSmartRange(translateFromRevision(range), doc(), parent, insertBehavior);
+   else
+     newRange = new KateSmartRange(range, doc(), parent, insertBehavior);
+@@ -91,7 +92,7 @@
+ 
+ KateSmartRange * KateSmartManager::newSmartRange( KateSmartCursor * start, KateSmartCursor * end, SmartRange * parent, SmartRange::InsertBehaviors insertBehavior, bool internal )
+ {
+-  if (m_usingRevision != -1) {
++  if (usingRevision() != -1) {
+     *start = translateFromRevision(*start, (insertBehavior & SmartRange::ExpandLeft) ? SmartCursor::StayOnInsert : SmartCursor::MoveOnInsert);
+     *end = translateFromRevision(*end, (insertBehavior & SmartRange::ExpandRight) ? SmartCursor::MoveOnInsert : SmartCursor::StayOnInsert);
+   }
+@@ -515,7 +516,19 @@
+ 
+ void KateSmartManager::useRevision(int revision)
+ {
+-  m_usingRevision = revision;
++  if (revision == -1)
++    // Clear current revision use
++    m_usingRevision.remove(QThread::currentThread());
++  else
++    m_usingRevision[QThread::currentThread()] = revision;
++}
++
++int KateSmartManager::usingRevision() const
++{
++  if (m_usingRevision.contains(QThread::currentThread())) {
++    return m_usingRevision[QThread::currentThread()];
++  }
++  return -1;
+ }
+ 
+ void KateSmartManager::releaseRevision(int revision) const
+@@ -567,7 +580,7 @@
+ {
+   Cursor ret = cursor;
+ 
+-  foreach (KateEditInfo* edit, doc()->history()->editsBetweenRevisions(m_usingRevision))
++  foreach (KateEditInfo* edit, doc()->history()->editsBetweenRevisions(usingRevision()))
+     translate(edit, ret, insertBehavior);
+ 
+   return ret;
+@@ -577,7 +590,7 @@
+ {
+   Range ret = range;
+ 
+-  foreach (KateEditInfo* edit, doc()->history()->editsBetweenRevisions(m_usingRevision)) {
++  foreach (KateEditInfo* edit, doc()->history()->editsBetweenRevisions(usingRevision())) {
+     translate(edit, ret.start(), insertBehavior & KTextEditor::SmartRange::ExpandLeft ? SmartCursor::StayOnInsert : SmartCursor::MoveOnInsert);
+     translate(edit, ret.end(), insertBehavior & KTextEditor::SmartRange::ExpandRight ? SmartCursor::MoveOnInsert : SmartCursor::StayOnInsert);
+   }
+--- a/kate/smart/katesmartrange.cpp
++++ b/kate/smart/katesmartrange.cpp
+@@ -165,6 +165,38 @@
+     w->rangeContentsChanged(this, mostSpecific);
+ }
+ 
++void KateSmartRange::feedbackMouseCaretChange(KTextEditor::View* view, bool mouse, bool entered)
++{
++  if (mouse) {
++    if (entered) {
++      foreach (KTextEditor::SmartRangeNotifier* n, notifiers())
++        emit static_cast<KateSmartRangeNotifier*>(n)->mouseEnteredRange(this, view);
++      foreach (KTextEditor::SmartRangeWatcher* w, watchers())
++        w->mouseEnteredRange(this, view);
++
++    } else {
++      foreach (KTextEditor::SmartRangeNotifier* n, notifiers())
++        emit static_cast<KateSmartRangeNotifier*>(n)->mouseExitedRange(this, view);
++      foreach (KTextEditor::SmartRangeWatcher* w, watchers())
++        w->mouseExitedRange(this, view);
++    }
++
++  } else {
++    if (entered) {
++      foreach (KTextEditor::SmartRangeNotifier* n, notifiers())
++        emit static_cast<KateSmartRangeNotifier*>(n)->caretEnteredRange(this, view);
++      foreach (KTextEditor::SmartRangeWatcher* w, watchers())
++        w->caretEnteredRange(this, view);
++
++    } else {
++      foreach (KTextEditor::SmartRangeNotifier* n, notifiers())
++        emit static_cast<KateSmartRangeNotifier*>(n)->caretExitedRange(this, view);
++      foreach (KTextEditor::SmartRangeWatcher* w, watchers())
++        w->caretExitedRange(this, view);
++    }
++  }
++}
++
+ void KateSmartRange::shifted( )
+ {
+   if (kStart().lastPosition() != kStart()) {
+--- a/kate/smart/katesmartmanager.h
++++ b/kate/smart/katesmartmanager.h
+@@ -93,6 +93,7 @@
+ 
+   private:
+     KateSmartRange* feedbackRange(const KateEditInfo& edit, KateSmartRange* range);
++    int usingRevision() const;
+ 
+     void debugOutput() const;
+ 
+@@ -100,7 +101,7 @@
+     QSet<KateSmartRange*> m_topRanges;
+     KateSmartGroup* m_invalidGroup;
+     bool m_clearing;
+-    int m_usingRevision;
++    QHash<QThread*, int> m_usingRevision;
+ };
+ 
+ /**
+--- a/kate/smart/katesmartrange.h
++++ b/kate/smart/katesmartrange.h
+@@ -135,6 +135,8 @@
+     void feedbackMostSpecific(KateSmartRange* mostSpecific);
+     /// The range has been shifted only
+     void shifted();
++    /// Mouse / caret in or out
++    void feedbackMouseCaretChange(KTextEditor::View* view, bool mouse, bool entered);
+ 
+     void registerPointer(KateSmartRangePtr* ptr);
+     void deregisterPointer(KateSmartRangePtr* ptr);
+--- a/kate/syntax/katesyntaxmanager.cpp
++++ b/kate/syntax/katesyntaxmanager.cpp
+@@ -56,7 +56,7 @@
+ //BEGIN KateHlManager
+ KateHlManager::KateHlManager()
+   : QObject()
+-  , m_config ("katesyntaxhighlightingrc", KConfig::CascadeConfig)
++  , m_config ("katesyntaxhighlightingrc", KConfig::NoGlobals)
+   , commonSuffixes (QString(".orig;.new;~;.bak;.BAK").split(';'))
+   , syntax (new KateSyntaxDocument(&m_config))
+   , dynamicCtxsCount(0)
+@@ -149,22 +149,22 @@
+     // this one is for marking invalid input
+     names << "Error";
+ 
+-    translatedNames << i18n("Normal");
+-    translatedNames << i18n("Keyword");
+-    translatedNames << i18n("Data Type");
+-    translatedNames << i18n("Decimal/Value");
+-    translatedNames << i18n("Base-N Integer");
+-    translatedNames << i18n("Floating Point");
+-    translatedNames << i18n("Character");
+-    translatedNames << i18n("String");
+-    translatedNames << i18n("Comment");
+-    translatedNames << i18n("Others");
+-    translatedNames << i18n("Alert");
+-    translatedNames << i18n("Function");
++    translatedNames << i18nc("@item:intable Text context", "Normal");
++    translatedNames << i18nc("@item:intable Text context", "Keyword");
++    translatedNames << i18nc("@item:intable Text context", "Data Type");
++    translatedNames << i18nc("@item:intable Text context", "Decimal/Value");
++    translatedNames << i18nc("@item:intable Text context", "Base-N Integer");
++    translatedNames << i18nc("@item:intable Text context", "Floating Point");
++    translatedNames << i18nc("@item:intable Text context", "Character");
++    translatedNames << i18nc("@item:intable Text context", "String");
++    translatedNames << i18nc("@item:intable Text context", "Comment");
++    translatedNames << i18nc("@item:intable Text context", "Others");
++    translatedNames << i18nc("@item:intable Text context", "Alert");
++    translatedNames << i18nc("@item:intable Text context", "Function");
+     // this next one is for denoting the beginning/end of a user defined folding region
+-    translatedNames << i18n("Region Marker");
++    translatedNames << i18nc("@item:intable Text context", "Region Marker");
+     // this one is for marking invalid input
+-    translatedNames << i18n("Error");
++    translatedNames << i18nc("@item:intable Text context", "Error");
+   }
+ 
+   return translateNames ? translatedNames[n] : names[n];
+--- a/kate/syntax/data/debiancontrol.xml
++++ b/kate/syntax/data/debiancontrol.xml
+@@ -1,9 +1,9 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE language SYSTEM "language.dtd">
+-<language name="Debian Control" version="0.82" kateversion="2.4" section="Other" extensions="" mimetype="">
++<language name="Debian Control" version="0.83" kateversion="2.4" section="Other" extensions="control" mimetype="">
+     <highlighting>
+         <contexts>
+-            <context attribute="Normal Text" lineEndContext="#stay">
++            <context attribute="Normal Text" lineEndContext="#stay" name="INIT">
+                 <StringDetect attribute="Keyword" context="DependencyField" String="Depends:"/>
+                 <StringDetect attribute="Keyword" context="DependencyField" String="Recommends:"/>
+                 <StringDetect attribute="Keyword" context="DependencyField" String="Suggests:"/>
+--- /dev/null
++++ b/kate/syntax/data/dtd.xml
+@@ -0,0 +1,109 @@
++<?xml version="1.0" encoding="utf-8"?>
++<!DOCTYPE language SYSTEM "language.dtd"[
++  <!ENTITY nmtoken "[\-\w\d\.:_]+">
++  <!ENTITY entref  "(#[0-9]+|#[xX][0-9A-Fa-f]+|&nmtoken;);">
++]>
++<language name="DTD" version="1.02" kateversion="2.4" section="Markup" extensions="*.dtd" mimetype="application/xml-dtd" author="Andriy Lesyuk (s-andy at in.if.ua)" license="LGPL">
++  <highlighting>
++
++    <list name="Category">
++      <item>EMPTY</item>
++      <item>ANY</item>
++      <item>CDATA</item>
++      <item>ID</item>
++      <item>IDREF</item>
++      <item>IDREFS</item>
++      <item>NMTOKEN</item>
++      <item>NMTOKENS</item>
++      <item>ENTITY</item>
++      <item>ENTITIES</item>
++      <item>NOTATION</item>
++      <item>PUBLIC</item>
++      <item>SYSTEM</item>
++      <item>NDATA</item>
++    </list>
++
++    <list name="Keywords">
++      <item>#PCDATA</item>
++      <item>#REQUIRED</item>
++      <item>#IMPLIED</item>
++      <item>#FIXED</item>
++    </list>
++
++    <contexts>
++      <context name="Normal" attribute="Normal" lineEndContext="#stay">
++        <DetectSpaces />
++        <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
++        <StringDetect attribute="Processing Instruction" context="PI" String="&lt;?xml" beginRegion="pi" />
++        <StringDetect attribute="Declaration" context="Declaration" String="&lt;!ELEMENT" beginRegion="declaration" />
++        <StringDetect attribute="Declaration" context="Declaration" String="&lt;!ATTLIST" beginRegion="declaration" />
++        <StringDetect attribute="Declaration" context="Declaration" String="&lt;!NOTATION" beginRegion="declaration" />
++        <StringDetect attribute="Declaration" context="Declaration" String="&lt;!ENTITY" beginRegion="declaration" />
++        <DetectIdentifier />
++      </context>
++
++      <context name="Comment" attribute="Comment" lineEndContext="#stay">
++        <DetectSpaces />
++        <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
++        <IncludeRules context="##Alerts" />
++        <DetectIdentifier />
++      </context>
++
++      <context name="PI" attribute="Normal" lineEndContext="#stay">
++        <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
++      </context>
++
++      <context name="Declaration" attribute="Normal" lineEndContext="#stay">
++        <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
++        <Detect2Chars attribute="Comment" context="InlineComment" char="-" char1="-" />
++        <DetectChar attribute="Declaration" context="#pop" char="&gt;" endRegion="declaration" />
++        <DetectChar attribute="String" context="String" char="&quot;" />
++        <RegExpr attribute="Declaration" context="#stay" String="(-|O)\s(-|O)" />
++        <AnyChar attribute="Delimiter" context="#stay" String="(|)," />
++        <RegExpr attribute="Entity" context="#stay" String="(%|&amp;)&entref;" />
++        <AnyChar attribute="Symbol" context="#stay" String="?*+-&amp;" />
++        <RegExpr attribute="Local" context="#stay" String="%\s" />
++        <keyword attribute="Keyword" context="#stay" String="Category" />
++        <keyword attribute="Keyword" context="#stay" String="Keywords" />
++        <RegExpr attribute="Name" context="#stay" String="\b&nmtoken;\b" />
++      </context>
++
++      <context name="String" attribute="String" lineEndContext="#stay">
++        <DetectSpaces />
++        <DetectChar attribute="String" context="#pop" char="&quot;" />
++        <RegExpr attribute="Entity" context="#stay" String="%&nmtoken;;" />
++      </context>
++
++      <context name="InlineComment" attribute="Comment" lineEndContext="#pop">
++        <DetectSpaces />
++        <Detect2Chars attribute="Comment" context="#pop" char="-" char1="-" />
++        <IncludeRules context="##Alerts" />
++        <DetectIdentifier />
++      </context>
++
++    </contexts>
++
++    <itemDatas>
++      <itemData name="Normal" defStyleNum="dsNormal" />
++      <itemData name="Comment" defStyleNum="dsComment" />
++      <itemData name="Processing Instruction" defStyleNum="dsKeyword" />
++      <itemData name="Declaration" defStyleNum="dsDataType" bold="1" />
++      <itemData name="Name" defStyleNum="dsFunction" />
++      <itemData name="Delimiter" defStyleNum="dsDecVal" />
++      <itemData name="Symbol" defStyleNum="dsFloat" bold="1" />
++      <itemData name="Keyword" defStyleNum="dsKeyword" />
++      <itemData name="String" defStyleNum="dsString" />
++      <itemData name="Entity" defStyleNum="dsDecVal" />
++      <itemData name="Local" defStyleNum="dsDecVal" bold="1" />
++    </itemDatas>
++  </highlighting>
++
++  <general>
++    <comments>
++      <comment name="multiLine" start="&lt;!--" end="--&gt;" />
++    </comments>
++  </general>
++
++</language>
++<!-- kate: indent-width 2; indent-mode normal; tab-indents on; -->
++
+--- a/kate/syntax/data/makefile.xml
++++ b/kate/syntax/data/makefile.xml
+@@ -2,7 +2,7 @@
+ <!DOCTYPE language SYSTEM "language.dtd">
+ <!-- Makefile syntaxfile v0.9 by Per Wigren <wigren at home.se> -->
+ <!-- Modified by Joseph Wenninger <jowenn at kde.org> -->
+-<language name="Makefile" version="1.08" kateversion="2.4" section="Other" extensions="*makefile*;*Makefile*" mimetype="text/x-makefile" author="Per Wigren (wigren at home.se)" license="">
++<language name="Makefile" version="1.09" kateversion="2.4" section="Other" extensions="GNUmakefile;Makefile*;makefile*" mimetype="text/x-makefile" author="Per Wigren (wigren at home.se)" license="">
+   <highlighting>
+     <list name = "keywords">
+       <item> include </item>
+--- a/kate/syntax/data/c.xml
++++ b/kate/syntax/data/c.xml
+@@ -1,6 +1,13 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE language SYSTEM "language.dtd">
+-<language name="C" version="1.25" kateversion="2.4" section="Sources" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="5">
++<language name="C" version="1.41" kateversion="2.4" section="Sources" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="5">
++<!--
++##########################################################################
++## Fixes by Sebastian Pipping (webmaster at hartwork.org)
++##
++## NOTE: Keep in sync with C++ highlighter! (cpp.xml)
++##########################################################################
++-->
+   <highlighting>
+     <list name="keywords">
+       <item> break </item>
+@@ -46,8 +53,8 @@
+     <contexts>
+       <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+         <DetectSpaces />
+-	<RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" />
+-        <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" />
++	<RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="PP" firstNonSpace="true" />
++        <DetectChar context="AfterHash" char="#" firstNonSpace="true" lookAhead="true" />
+         <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
+         <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
+         <keyword attribute="Keyword" context="#stay" String="keywords"/>
+@@ -77,36 +84,51 @@
+         <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+         <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+       </context>
++
+       <context attribute="String" lineEndContext="#pop" name="String">
+         <LineContinue attribute="String" context="#stay"/>
+         <HlCStringChar attribute="String Char" context="#stay"/>
+         <DetectChar attribute="String" context="#pop" char="&quot;"/>
+       </context>
++
+       <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
+       </context>
++
+       <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+         <LineContinue attribute="Comment" context="#stay"/>
+         <IncludeRules context="##Alerts" />
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+         <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+         <IncludeRules context="##Alerts" />
+       </context>
++
++      <context attribute="Error" lineEndContext="#pop" name="AfterHash">
++        <!-- define, elif, else, endif, error, if, ifdef, ifndef, include, include_next, line, pragma, undef, warning -->
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*if(?:def|ndef)?(?=\s+\S)" insensitive="true" beginRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*endif" insensitive="true" endRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Define" String="#\s*define.*((?=\\))" insensitive="true" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*(?:el(?:se|if)|include(?:_next)?|define|undef|line|error|warning|pragma)" insensitive="true" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s+[0-9]+" insensitive="true" firstNonSpace="true" />
++      </context>
++
+       <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+         <LineContinue attribute="Preprocessor" context="#stay"/>
+-        <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
+-        <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
+         <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+         <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+         <IncludeRules context="##Doxygen" />
+-        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2"/>
++        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2" />
+       </context>
++
+       <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
+         <LineContinue attribute="Preprocessor" context="#stay"/>
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
+         <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
+         <DetectSpaces />
+         <IncludeRules context="##Alerts" />
+@@ -115,9 +137,11 @@
+         <IncludeRules context="##Doxygen" />
+         <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+         <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+-        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+-        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" />
++        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*el(?:se|if)" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
+         <DetectSpaces />
+         <IncludeRules context="##Alerts" />
+@@ -126,8 +150,8 @@
+         <IncludeRules context="##Doxygen" />
+         <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+         <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+-        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+-        <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true" />
++        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
+       </context>
+     </contexts>
+     <itemDatas>
+@@ -147,6 +171,7 @@
+       <itemData name="Prep. Lib"    defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
+       <itemData name="Alert"        defStyleNum="dsAlert" />
+       <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
++      <itemData name="Error"        defStyleNum="dsError" />
+     </itemDatas>
+   </highlighting>
+   <general>
+--- a/kate/syntax/data/css.xml
++++ b/kate/syntax/data/css.xml
+@@ -1,6 +1,24 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE language SYSTEM "language.dtd">
+-<language name="CSS" version="2.00" kateversion="2.4" section="Markup" extensions="*.css" mimetype="text/css" author="Wilbert Berendsen (wilbert at kde.nl)" license="LGPL">
++
++<!--
++
++    Kate CSS syntax highlighting definition
++
++
++    Changelog:
++
++    - Version 2.01, by Mathieu Bonnet:
++
++        - Added CSS 3 property "border-radius".
++        - Added Gecko CSS properties "-moz-border-radius" and "-moz-box-flex".
++        - Added Gecko CSS value "-moz-box".
++        - Added Trident CSS functional notation "expression".
++        - Extended the id and class syntax specifications, as per CSS 2.1 grammar.
++
++-->
++
++<language name="CSS" version="2.01" kateversion="2.4" section="Markup" extensions="*.css" mimetype="text/css" author="Wilbert Berendsen (wilbert at kde.nl)" license="LGPL">
+ 
+   <highlighting>
+     <list name="properties">
+@@ -130,10 +148,15 @@
+       <item> z-index </item>
+ 
+       <!-- CSS3 -->
++      <item> border-radius </item>
+       <item> box-sizing </item>
+       <item> opacity </item>
+       <item> text-shadow </item>
+ 
++      <!-- Gecko rendering engine CSS property extensions -->
++      <item> -moz-border-radius </item>
++      <item> -moz-box-flex </item>
++
+       <!-- konq specific -->
+       <item> konq_bgpos_x </item>
+       <item> konq_bgpos_y </item>
+@@ -349,6 +372,10 @@
+       <item> monospace </item>
+       <item> border-box </item>
+       <item> content-box </item>
++      
++      <!-- Gecko rendering engine CSS value extensions -->
++      <item> -moz-box </item>      
++      
+     </list>
+ 
+ 
+@@ -410,6 +437,10 @@
+       <!-- in @font-face -->
+       <item> local </item>
+       <item> format </item>
++      
++      <!-- Trident (a.k.a., MSHTML) rendering engine functional notation extensions -->
++      <item> expression </item>
++      
+     </list>
+ 
+     <list name="mediatypes">
+@@ -472,8 +503,8 @@
+         <DetectChar attribute="Property" context="RuleSet" char="{" beginRegion="ruleset" />
+         <!--parse selectors-->
+ 	<DetectChar attribute="Selector Attr" context="SelAttr" char="[" />
+-	<RegExpr attribute="Selector Id" context="#stay" String="#[A-Za-z0-9][\w\-]*" />
+-	<RegExpr attribute="Selector Class" context="#stay" String="\.[A-Za-z0-9][\w\-]*" />
++	<RegExpr attribute="Selector Id" context="#stay" String="#([a-zA-Z0-9\-_]|[\x80-\xFF]|\\[0-9A-Fa-f]{1,6})*" />
++	<RegExpr attribute="Selector Class" context="#stay" String="\.([a-zA-Z0-9\-_]|[\x80-\xFF]|\\[0-9A-Fa-f]{1,6})*" />
+ 	<RegExpr attribute="Selector Pseudo" context="#stay" String=":lang\([\w_-]+\)" />
+ 	<DetectChar attribute="Selector Pseudo" context="SelPseudo" char=":" />
+ 	<IncludeRules context="FindStrings" />
+--- a/kate/syntax/data/bash.xml
++++ b/kate/syntax/data/bash.xml
+@@ -8,10 +8,11 @@
+         <!ENTITY noword   "(?![\w$+-])">                <!-- no word, $, + or - following -->
+         <!ENTITY pathpart "([\w_ at .&#37;*?+-]|\\ )">     <!-- valid character in a file name -->
+ ]>
+-<language name="Bash" version="2.08" kateversion="2.4" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;.bashrc;.bash_profile;.bash_login;.profile" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert at kde.nl)" license="LGPL">
++<language name="Bash" version="2.10" kateversion="2.4" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;.bashrc;.bash_profile;.bash_login;.profile" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert at kde.nl)" license="LGPL">
+ 
+ <!-- (c) 2004 by Wilbert Berendsen (wilbert at kde.nl)
+     Changes by Matthew Woehlke (mw_triad at users.sourceforge.net)
++    Changes by Sebastian Pipping (webmaster at hartwork.org)
+     Released under the LGPL, part of kdelibs/kate -->
+ 
+   <highlighting>
+@@ -522,7 +523,7 @@
+         <!-- handle commands that have variable names as argument -->
+         <keyword attribute="Builtin" context="VarName" String="builtins_var" />
+         <!-- handle here-string -->
+-        <StringDetect attribute="Redirection" context="#stay" String="&lt;&lt;&lt;" />
++        <RegExpr attribute="Redirection" context="#stay" String="\d*&lt;&lt;&lt;" />
+         <!-- handle here document -->
+         <StringDetect attribute="Redirection" context="HereDoc" String="&lt;&lt;" lookAhead="true" />
+         <!-- handle process subst -->
+@@ -831,23 +832,23 @@
+ 
+       <context attribute="Normal Text" lineEndContext="#stay" name="HereDocQ" dynamic="true">
+         <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+-        <RegExpr attribute="Redirection" context="#pop#pop" String="%2[\s;]*$" dynamic="true" column="0"/>
++        <RegExpr attribute="Redirection" context="#pop#pop" String="^%2$" dynamic="true" column="0"/>
+       </context>
+ 
+       <context attribute="Normal Text" lineEndContext="#stay" name="HereDocNQ" dynamic="true">
+         <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+-        <RegExpr attribute="Redirection" context="#pop#pop" String="%2[\s;]*$" dynamic="true" column="0"/>
++        <RegExpr attribute="Redirection" context="#pop#pop" String="^%2$" dynamic="true" column="0"/>
+         <IncludeRules context="FindSubstitutions" />
+       </context>
+ 
+       <context attribute="Normal Text" lineEndContext="#stay" name="HereDocIQ" dynamic="true">
+         <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+-        <RegExpr attribute="Redirection" context="#pop#pop" String="\s*%2[\s;]*$" dynamic="true" column="0"/>
++        <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2$" dynamic="true" column="0"/>
+       </context>
+ 
+       <context attribute="Normal Text" lineEndContext="#stay" name="HereDocINQ" dynamic="true">
+         <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+-        <RegExpr attribute="Redirection" context="#pop#pop" String="\s*%2[\s;]*$" dynamic="true" column="0"/>
++        <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2$" dynamic="true" column="0"/>
+         <IncludeRules context="FindSubstitutions" />
+       </context>
+ 
+--- /dev/null
++++ b/kate/syntax/data/json.xml
+@@ -0,0 +1,100 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE language SYSTEM "language.dtd">
++<!--
++ ***************************************************************************
++ ** Writing a Kate Highlighting XML File
++ ** http://kate-editor.org/article/writing_a_kate_highlighting_xml_file
++ **
++ ** Introducing JSON
++ ** http://www.json.org/
++ **
++ ** The application/json Media Type for JavaScript Object Notation (JSON)
++ ** http://tools.ietf.org/html/rfc4627
++ ***************************************************************************
++-->
++<language name="JSON" section="Markup" version="1.00" kateversion="2.3" extensions="*.json" mimetype="application/json" author="Sebastian Pipping (webmaster at hartwork.org)" license="GPL">
++  <highlighting>
++		<list name="Constants">
++      <item>null</item>
++      <item>true</item>
++      <item>false</item>
++    </list>
++
++    <contexts>
++      <context name="Normal" lineEndContext="#stay" attribute="Style_Error">
++        <DetectChar char="{"       context="Pair" beginRegion="Region_Object" attribute="Style_Seperator_Pair" />
++      </context>
++
++      <context name="Pair" lineEndContext="#stay" attribute="Style_Error">
++        <DetectChar char="&quot;"  context="String_Key" attribute="Style_String_Key" />
++        <DetectChar char=":"       context="Value" attribute="Style_Seperator_Pair" />
++        <DetectChar char="}"       context="#pop" endRegion="Region_Object" attribute="Style_Seperator_Pair" />
++        <DetectChar char=","       context="#stay" attribute="Style_Seperator_Pair" />
++
++        <DetectSpaces context="#stay" attribute="Style_Normal" />
++      </context>
++
++      <context name="String_Key" lineEndContext="#stay" attribute="Style_String_Key">
++        <DetectChar char="&quot;"  context="#pop" attribute="Style_String_Key" />
++        <RegExpr String="\\(?:[&quot;\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" insensitive="false" minimal="false" attribute="Style_String_Key_Char" />
++      </context>
++
++      <context name="Value" lineEndContext="#stay" attribute="Style_Error" >
++        <DetectChar char="&quot;"  context="String_Value" attribute="Style_String_Value" />
++        <DetectChar char="{"       context="Pair" beginRegion="Region_Object" attribute="Style_Seperator_Pair" />
++        <DetectChar char="["       context="Array" beginRegion="Region_Array" attribute="Style_Seperator_Array" />
++        <DetectChar char="}"       context="#pop" lookAhead="true" />
++        <DetectChar char=","       context="#pop" lookAhead="true" />
++
++        <DetectSpaces context="#stay" attribute="Style_Normal" />
++
++        <keyword String="Constants" context="#stay" attribute="Style_Keyword" />
++
++        <RegExpr String="-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Float" />
++        <RegExpr String="-?(?:[0-9]|[1-9][0-9]+)(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Decimal" />
++      </context>
++
++      <context name="String_Value" lineEndContext="#stay" attribute="Style_String_Value">
++        <DetectChar char="&quot;"  context="#pop" attribute="Style_String_Value" />
++        <RegExpr String="\\(?:[&quot;\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" insensitive="false" minimal="false" attribute="Style_String_Value_Char" />
++      </context>
++
++      <context name="Array" lineEndContext="#stay" attribute="Style_Error">
++        <DetectChar char=","       context="#stay" attribute="Style_Seperator_Array" />
++        <DetectChar char="]"       context="#pop" endRegion="Region_Array" attribute="Style_Seperator_Array" />
++
++        <DetectChar char="{"       context="Pair" beginRegion="Region_Object" attribute="Style_Seperator_Pair" />
++        <DetectChar char="&quot;"  context="String_Value" attribute="Style_String_Value" />
++
++        <DetectSpaces context="#stay" attribute="Style_Normal" />
++
++        <keyword String="Constants" context="#stay" attribute="Style_Keyword" />
++
++        <RegExpr String="-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Float" />
++        <RegExpr String="-?(?:[0-9]|[1-9][0-9]+)(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Decimal" />
++      </context>
++    </contexts>
++
++    <itemDatas>
++      <itemData name="Style_Normal"             defStyleNum="dsNormal" />
++
++      <itemData name="Style_Seperator_Pair"     defStyleNum="dsNormal" bold="1" color="#EF0000" />
++      <itemData name="Style_Seperator_Array"    defStyleNum="dsNormal" bold="1" color="#0000AF" />
++
++      <itemData name="Style_Decimal"            defStyleNum="dsDecVal" />
++      <itemData name="Style_Float"              defStyleNum="dsFloat" />
++      <itemData name="Style_String_Key"         defStyleNum="dsDataType" />
++      <itemData name="Style_String_Value"       defStyleNum="dsString" color="#FF00FF" />
++      <itemData name="Style_String_Key_Char"    defStyleNum="dsDataType" underline="1" />
++      <itemData name="Style_String_Value_Char"  defStyleNum="dsString" color="#FF00FF" underline="1" />
++
++			<itemData name="Style_Keyword"            defStyleNum="dsDecVal" bold="1" />
++
++			<itemData name="Style_Error"              defStyleNum="dsError" />
++    </itemDatas>
++  </highlighting>
++</language>
++<!--
++// kate: space-indent on; indent-width 2; replace-tabs on;
++-->
++
+--- a/kate/syntax/data/tcl.xml
++++ b/kate/syntax/data/tcl.xml
+@@ -8,13 +8,25 @@
+     Updated by Pawel Salawa (boogie at scripts dot one dot pl)
+ 
+     Revision history:
++        1.10:
++            - Fixed problem with single ':' character after variable name (it's no longer variable,
++              because only double-colon is namespace delimiter and can be part of variable name).
++            - Fixed problem with matching quote character next to regular character, for example:
++              puts {"string"}
++              In that case left bracked was marked as string, but it's no longer like that.
++            - Fixed problem with variable names like: ${text\}test}
++              It whole is valid variable name, because of escape character.
++            - Fixed problem with marking ';' character as a comment when '#' character was after the ';'.
++            - Fixed problem with marking options. '-' character after word-delimiter character caused
++              marking that word-delimiter character as option too, even it wasn't white-space.
++            - Few other minor optimalizations.
+ 	1.09:
+ 	    - Added fast comments support (Ctrl+d or whatever your shortcut is)
+ 	    - Fixed single-character variables detection
+ 	    - Fixed detection of varaibles with names containing serval namespace delimiters (::)
+ -->
+ 
+-<language name="Tcl/Tk" version="1.09" kateversion="2.4" section="Scripts" extensions="*.tcl;*.tk" mimetype="text/x-tcl">
++<language name="Tcl/Tk" version="1.10" kateversion="2.4" section="Scripts" extensions="*.tcl;*.tk" mimetype="text/x-tcl">
+   <highlighting>
+     <list name="keywords">
+       <item> after </item>
+@@ -450,24 +462,39 @@
+ 
+     <contexts>
+       <context name = "Base" attribute = "Normal Text" lineEndContext="#stay">
++      
++        <!-- Virtual blocks -->
+         <RegExpr attribute="Region Marker" context="#stay" String="#\s*BEGIN.*$" beginRegion="region" firstNonSpace="true"/>
+         <RegExpr attribute="Region Marker" context="#stay" String="#\s*END.*$" endRegion="region" firstNonSpace="true"/>
++        
++        <!-- Standard -->
+         <keyword String = "keywords" attribute = "Keyword" context="#stay"/>
+         <keyword String = "keywords-opt" attribute = "Parameter" context="#stay"/>
+         <Float attribute = "Float" context="#stay"/>
+         <Int attribute ="Decimal" context="#stay"/>
+         <RegExpr String="\\." attribute = "Char" context = "#stay"/>
+-        <RegExpr String = "\W-\w+" attribute = "Parameter" context="#stay"/>
+-        <RegExpr String = "\$\{[^\}]+\}" attribute = "Variable" context="#stay"/>
+-        <RegExpr String = "\$[\w:]+" attribute = "Variable" context="#stay"/>
+-        <RegExpr String = "[^\\]&quot;&quot;" attribute = "String" context="#stay"/>
+-        <RegExpr String = "[^\\]&quot;" attribute = "String" context="String"/>
+-        <RegExpr String= "#.*$" attribute = "Comment" context="#stay" firstNonSpace="true"/>
+-        <RegExpr String= ";\s*#.*$" attribute = "Comment" context="#stay"/>
++        
++        <!-- Options -->
++        <RegExpr String = "\s-\w+" attribute = "Parameter" context="#stay"/>
++        
++        <!-- Variables -->
++        <RegExpr String = "\$\{([^\}]|\\\})+\}" attribute = "Variable" context="#stay"/>
++        <RegExpr String = "\$(::|\w)+" attribute = "Variable" context="#stay"/>
++        
++        <!-- Strings -->
++        <RegExpr String = "&quot;{2}" attribute = "String" context="#stay"/>
++        <RegExpr String = "&quot;" attribute = "String" context="String"/>
++        
++        <!-- Comments -->
++        <DetectChar char = ";" attribute = "Normal Text" context="New command line" />
++        <DetectChar char = "#" attribute = "Comment" context="Comment" firstNonSpace="true"/>
++        
++        <!-- Braces, brackets, etc -->
+         <DetectChar char = "{" attribute = "Keyword" context="#stay" beginRegion="block"/>
+         <DetectChar char = "}" attribute = "Keyword" context="#stay" endRegion="block"/>
+         <DetectChar char = "[" attribute = "Keyword" context="#stay"/>
+         <DetectChar char = "]" attribute = "Keyword" context="#stay"/>
++        
+       </context>
+ 
+       <context name = "String" attribute = "String" lineEndContext="#stay">
+@@ -475,6 +502,13 @@
+         <DetectChar char="&quot;" attribute = "String" context = "#pop"/>
+         <DetectChar char  = "$" attribute = "Variable" context="#stay"/>
+       </context>
++
++      <context name = "Comment" attribute = "Comment" lineEndContext="#pop"/>
++
++      <context name = "New command line" attribute = "Normal Text" lineEndContext="#stay">
++        <RegExpr String = "\s*#" attribute="Comment" context="Comment" />
++        <RegExpr String = "." attribute="Normal Text" context="#pop" lookAhead="true" />
++      </context>
+     </contexts>
+ 
+     <itemDatas>
+--- a/kate/syntax/data/javascript.xml
++++ b/kate/syntax/data/javascript.xml
+@@ -3,7 +3,7 @@
+ <!-- Author: Anders Lund <anders at alweb.dk> //-->
+ <!-- Minor changes: Joseph Wenninger <jowenn at kde.org> //-->
+ <!-- Full JavaScript 1.0 support by Whitehawk Stormchaser //-->
+-<language name="JavaScript" version="1.10" kateversion="2.3" section="Scripts" extensions="*.js" mimetype="text/x-javascript" author="Anders Lund (anders at alweb.dk), Joseph Wenninger (jowenn at kde.org), Whitehawk Stormchaser (zerokode at gmx.net)" license="">
++<language name="JavaScript" version="1.11" kateversion="2.3" section="Scripts" extensions="*.js" mimetype="text/x-javascript;application/x-javascript" author="Anders Lund (anders at alweb.dk), Joseph Wenninger (jowenn at kde.org), Whitehawk Stormchaser (zerokode at gmx.net)" license="">
+   <highlighting>
+     <list name="keywords">
+         <item> if </item>
+--- /dev/null
++++ b/kate/syntax/data/scala.xml
+@@ -0,0 +1,3503 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE language SYSTEM "language.dtd">
++<language name="Scala" version="1.0" kateversion="2.4" section="Sources"
++          extensions="*.scala" mimetype="text/x-scala" license="LGPL"
++          author="Stephane Micheloud (stephane.micheloud at epfl.ch)">
++<!--
++First version added to reository was 1.0 downloaded from
++https://lampsvn.epfl.ch/trac/scala/browser/scala-tool-support/trunk/src/kate/scala.xml?format=raw
++
++adapted from "java.xml" by Alfredo Luiz Foltran Fialho (alfoltran at ig.com.br)
++-->
++  <highlighting>
++    <list name="scala2">
++      <item> Actor </item>
++      <item> ActorProxy </item>
++      <item> ActorTask </item>
++      <item> ActorThread </item>
++      <item> AllRef </item>
++      <item> Any </item>
++      <item> AnyRef </item>
++      <item> Application </item>
++      <item> AppliedType </item>
++      <item> Array </item>
++      <item> ArrayBuffer </item>
++      <item> Attribute </item>
++      <item> BoxedArray </item>
++      <item> BoxedBooleanArray </item>
++      <item> BoxedByteArray </item>
++      <item> BoxedCharArray </item>
++      <item> Buffer </item>
++      <item> BufferedIterator </item>
++      <item> Char </item>
++      <item> Console </item>
++      <item> Enumeration </item>
++      <item> Fluid </item>
++      <item> Function </item>
++      <item> IScheduler </item>
++      <item> ImmutableMapAdaptor </item>
++      <item> ImmutableSetAdaptor </item>
++      <item> Int </item>
++      <item> Iterable </item>
++      <item> List </item>
++      <item> ListBuffer </item>
++      <item> None </item>
++      <item> Option </item>
++      <item> Ordered </item>
++      <item> Pair </item>
++      <item> PartialFunction </item>
++      <item> Pid </item>
++      <item> Predef </item>
++      <item> PriorityQueue </item>
++      <item> PriorityQueueProxy </item>
++      <item> Reaction </item>
++      <item> Ref </item>
++      <item> Responder </item>
++      <item> RichInt </item>
++      <item> RichString </item>
++      <item> Rule </item>
++      <item> RuleTransformer </item>
++      <item> Script </item>
++      <item> Seq </item>
++      <item> SerialVersionUID </item>
++      <item> Some </item>
++      <item> Stream </item>
++      <item> Symbol </item>
++      <item> TcpService </item>
++      <item> TcpServiceWorker </item>
++      <item> Triple </item>
++      <item> Unit </item>
++      <item> Value </item>
++      <item> WorkerThread </item>
++      <item> serializable </item>
++      <item> transient </item>
++      <item> volatile </item>
++    </list>
++    <list name="java15">
++      <item> ACTIVE </item>
++      <item> ACTIVITY_COMPLETED </item>
++      <item> ACTIVITY_REQUIRED </item>
++      <item> ARG_IN </item>
++      <item> ARG_INOUT </item>
++      <item> ARG_OUT </item>
++      <item> AWTError </item>
++      <item> AWTEvent </item>
++      <item> AWTEventListener </item>
++      <item> AWTEventListenerProxy </item>
++      <item> AWTEventMulticaster </item>
++      <item> AWTException </item>
++      <item> AWTKeyStroke </item>
++      <item> AWTPermission </item>
++      <item> AbstractAction </item>
++      <item> AbstractBorder </item>
++      <item> AbstractButton </item>
++      <item> AbstractCellEditor </item>
++      <item> AbstractCollection </item>
++      <item> AbstractColorChooserPanel </item>
++      <item> AbstractDocument </item>
++      <item> AbstractDocument.AttributeContext </item>
++      <item> AbstractDocument.Content </item>
++      <item> AbstractDocument.ElementEdit </item>
++      <item> AbstractExecutorService </item>
++      <item> AbstractInterruptibleChannel </item>
++      <item> AbstractLayoutCache </item>
++      <item> AbstractLayoutCache.NodeDimensions </item>
++      <item> AbstractList </item>
++      <item> AbstractListModel </item>
++      <item> AbstractMap </item>
++      <item> AbstractMethodError </item>
++      <item> AbstractPreferences </item>
++      <item> AbstractQueue </item>
++      <item> AbstractQueuedSynchronizer </item>
++      <item> AbstractSelectableChannel </item>
++      <item> AbstractSelectionKey </item>
++      <item> AbstractSelector </item>
++      <item> AbstractSequentialList </item>
++      <item> AbstractSet </item>
++      <item> AbstractSpinnerModel </item>
++      <item> AbstractTableModel </item>
++      <item> AbstractUndoableEdit </item>
++      <item> AbstractWriter </item>
++      <item> AccessControlContext </item>
++      <item> AccessControlException </item>
++      <item> AccessController </item>
++      <item> AccessException </item>
++      <item> Accessible </item>
++      <item> AccessibleAction </item>
++      <item> AccessibleAttributeSequence </item>
++      <item> AccessibleBundle </item>
++      <item> AccessibleComponent </item>
++      <item> AccessibleContext </item>
++      <item> AccessibleEditableText </item>
++      <item> AccessibleExtendedComponent </item>
++      <item> AccessibleExtendedTable </item>
++      <item> AccessibleExtendedText </item>
++      <item> AccessibleHyperlink </item>
++      <item> AccessibleHypertext </item>
++      <item> AccessibleIcon </item>
++      <item> AccessibleKeyBinding </item>
++      <item> AccessibleObject </item>
++      <item> AccessibleRelation </item>
++      <item> AccessibleRelationSet </item>
++      <item> AccessibleResourceBundle </item>
++      <item> AccessibleRole </item>
++      <item> AccessibleSelection </item>
++      <item> AccessibleState </item>
++      <item> AccessibleStateSet </item>
++      <item> AccessibleStreamable </item>
++      <item> AccessibleTable </item>
++      <item> AccessibleTableModelChange </item>
++      <item> AccessibleText </item>
++      <item> AccessibleTextSequence </item>
++      <item> AccessibleValue </item>
++      <item> AccountException </item>
++      <item> AccountExpiredException </item>
++      <item> AccountLockedException </item>
++      <item> AccountNotFoundException </item>
++      <item> Acl </item>
++      <item> AclEntry </item>
++      <item> AclNotFoundException </item>
++      <item> Action </item>
++      <item> ActionEvent </item>
++      <item> ActionListener </item>
++      <item> ActionMap </item>
++      <item> ActionMapUIResource </item>
++      <item> Activatable </item>
++      <item> ActivateFailedException </item>
++      <item> ActivationDesc </item>
++      <item> ActivationException </item>
++      <item> ActivationGroup </item>
++      <item> ActivationGroupDesc </item>
++      <item> ActivationGroupDesc.CommandEnvironment </item>
++      <item> ActivationGroupID </item>
++      <item> ActivationGroup_Stub </item>
++      <item> ActivationID </item>
++      <item> ActivationInstantiator </item>
++      <item> ActivationMonitor </item>
++      <item> ActivationSystem </item>
++      <item> Activator </item>
++      <item> ActiveEvent </item>
++      <item> ActivityCompletedException </item>
++      <item> ActivityRequiredException </item>
++      <item> AdapterActivator </item>
++      <item> AdapterActivatorOperations </item>
++      <item> AdapterAlreadyExists </item>
++      <item> AdapterAlreadyExistsHelper </item>
++      <item> AdapterInactive </item>
++      <item> AdapterInactiveHelper </item>
++      <item> AdapterManagerIdHelper </item>
++      <item> AdapterNameHelper </item>
++      <item> AdapterNonExistent </item>
++      <item> AdapterNonExistentHelper </item>
++      <item> AdapterStateHelper </item>
++      <item> AddressHelper </item>
++      <item> Adjustable </item>
++      <item> AdjustmentEvent </item>
++      <item> AdjustmentListener </item>
++      <item> Adler32 </item>
++      <item> AffineTransform </item>
++      <item> AffineTransformOp </item>
++      <item> AlgorithmParameterGenerator </item>
++      <item> AlgorithmParameterGeneratorSpi </item>
++      <item> AlgorithmParameterSpec </item>
++      <item> AlgorithmParameters </item>
++      <item> AlgorithmParametersSpi </item>
++      <item> AllPermission </item>
++      <item> AlphaComposite </item>
++      <item> AlreadyBound </item>
++      <item> AlreadyBoundException </item>
++      <item> AlreadyBoundHelper </item>
++      <item> AlreadyBoundHolder </item>
++      <item> AlreadyConnectedException </item>
++      <item> AncestorEvent </item>
++      <item> AncestorListener </item>
++      <item> AnnotatedElement </item>
++      <item> Annotation </item>
++      <item> Annotation </item>
++      <item> AnnotationFormatError </item>
++      <item> AnnotationTypeMismatchException </item>
++      <item> Any </item>
++      <item> AnyHolder </item>
++      <item> AnySeqHelper </item>
++      <item> AnySeqHelper </item>
++      <item> AnySeqHolder </item>
++      <item> AppConfigurationEntry </item>
++      <item> AppConfigurationEntry.LoginModuleControlFlag </item>
++      <item> Appendable </item>
++      <item> Applet </item>
++      <item> AppletContext </item>
++      <item> AppletInitializer </item>
++      <item> AppletStub </item>
++      <item> ApplicationException </item>
++      <item> Arc2D </item>
++      <item> Arc2D.Double </item>
++      <item> Arc2D.Float </item>
++      <item> Area </item>
++      <item> AreaAveragingScaleFilter </item>
++      <item> ArithmeticException </item>
++      <item> Array </item>
++      <item> Array </item>
++      <item> ArrayBlockingQueue </item>
++      <item> ArrayIndexOutOfBoundsException </item>
++      <item> ArrayList </item>
++      <item> ArrayStoreException </item>
++      <item> ArrayType </item>
++      <item> Arrays </item>
++      <item> AssertionError </item>
++      <item> AsyncBoxView </item>
++      <item> AsynchronousCloseException </item>
++      <item> AtomicBoolean </item>
++      <item> AtomicInteger </item>
++      <item> AtomicIntegerArray </item>
++      <item> AtomicIntegerFieldUpdater </item>
++      <item> AtomicLong </item>
++      <item> AtomicLongArray </item>
++      <item> AtomicLongFieldUpdater </item>
++      <item> AtomicMarkableReference </item>
++      <item> AtomicReference </item>
++      <item> AtomicReferenceArray </item>
++      <item> AtomicReferenceFieldUpdater </item>
++      <item> AtomicStampedReference </item>
++      <item> Attr </item>
++      <item> Attribute </item>
++      <item> Attribute </item>
++      <item> Attribute </item>
++      <item> AttributeChangeNotification </item>
++      <item> AttributeChangeNotificationFilter </item>
++      <item> AttributeException </item>
++      <item> AttributeInUseException </item>
++      <item> AttributeList </item>
++      <item> AttributeList </item>
++      <item> AttributeList </item>
++      <item> AttributeListImpl </item>
++      <item> AttributeModificationException </item>
++      <item> AttributeNotFoundException </item>
++      <item> AttributeSet </item>
++      <item> AttributeSet </item>
++      <item> AttributeSet.CharacterAttribute </item>
++      <item> AttributeSet.ColorAttribute </item>
++      <item> AttributeSet.FontAttribute </item>
++      <item> AttributeSet.ParagraphAttribute </item>
++      <item> AttributeSetUtilities </item>
++      <item> AttributeValueExp </item>
++      <item> AttributedCharacterIterator </item>
++      <item> AttributedCharacterIterator.Attribute </item>
++      <item> AttributedString </item>
++      <item> Attributes </item>
++      <item> Attributes </item>
++      <item> Attributes </item>
++      <item> Attributes.Name </item>
++      <item> Attributes2 </item>
++      <item> Attributes2Impl </item>
++      <item> AttributesImpl </item>
++      <item> AudioClip </item>
++      <item> AudioFileFormat </item>
++      <item> AudioFileFormat.Type </item>
++      <item> AudioFileReader </item>
++      <item> AudioFileWriter </item>
++      <item> AudioFormat </item>
++      <item> AudioFormat.Encoding </item>
++      <item> AudioInputStream </item>
++      <item> AudioPermission </item>
++      <item> AudioSystem </item>
++      <item> AuthPermission </item>
++      <item> AuthProvider </item>
++      <item> AuthenticationException </item>
++      <item> AuthenticationException </item>
++      <item> AuthenticationNotSupportedException </item>
++      <item> Authenticator </item>
++      <item> Authenticator.RequestorType </item>
++      <item> AuthorizeCallback </item>
++      <item> Autoscroll </item>
++      <item> BAD_CONTEXT </item>
++      <item> BAD_INV_ORDER </item>
++      <item> BAD_OPERATION </item>
++      <item> BAD_PARAM </item>
++      <item> BAD_POLICY </item>
++      <item> BAD_POLICY_TYPE </item>
++      <item> BAD_POLICY_VALUE </item>
++      <item> BAD_QOS </item>
++      <item> BAD_TYPECODE </item>
++      <item> BMPImageWriteParam </item>
++      <item> BackingStoreException </item>
++      <item> BadAttributeValueExpException </item>
++      <item> BadBinaryOpValueExpException </item>
++      <item> BadKind </item>
++      <item> BadLocationException </item>
++      <item> BadPaddingException </item>
++      <item> BadStringOperationException </item>
++      <item> BandCombineOp </item>
++      <item> BandedSampleModel </item>
++      <item> BaseRowSet </item>
++      <item> BasicArrowButton </item>
++      <item> BasicAttribute </item>
++      <item> BasicAttributes </item>
++      <item> BasicBorders </item>
++      <item> BasicBorders.ButtonBorder </item>
++      <item> BasicBorders.FieldBorder </item>
++      <item> BasicBorders.MarginBorder </item>
++      <item> BasicBorders.MenuBarBorder </item>
++      <item> BasicBorders.RadioButtonBorder </item>
++      <item> BasicBorders.RolloverButtonBorder </item>
++      <item> BasicBorders.SplitPaneBorder </item>
++      <item> BasicBorders.ToggleButtonBorder </item>
++      <item> BasicButtonListener </item>
++      <item> BasicButtonUI </item>
++      <item> BasicCheckBoxMenuItemUI </item>
++      <item> BasicCheckBoxUI </item>
++      <item> BasicColorChooserUI </item>
++      <item> BasicComboBoxEditor </item>
++      <item> BasicComboBoxEditor.UIResource </item>
++      <item> BasicComboBoxRenderer </item>
++      <item> BasicComboBoxRenderer.UIResource </item>
++      <item> BasicComboBoxUI </item>
++      <item> BasicComboPopup </item>
++      <item> BasicControl </item>
++      <item> BasicDesktopIconUI </item>
++      <item> BasicDesktopPaneUI </item>
++      <item> BasicDirectoryModel </item>
++      <item> BasicEditorPaneUI </item>
++      <item> BasicFileChooserUI </item>
++      <item> BasicFormattedTextFieldUI </item>
++      <item> BasicGraphicsUtils </item>
++      <item> BasicHTML </item>
++      <item> BasicIconFactory </item>
++      <item> BasicInternalFrameTitlePane </item>
++      <item> BasicInternalFrameUI </item>
++      <item> BasicLabelUI </item>
++      <item> BasicListUI </item>
++      <item> BasicLookAndFeel </item>
++      <item> BasicMenuBarUI </item>
++      <item> BasicMenuItemUI </item>
++      <item> BasicMenuUI </item>
++      <item> BasicOptionPaneUI </item>
++      <item> BasicOptionPaneUI.ButtonAreaLayout </item>
++      <item> BasicPanelUI </item>
++      <item> BasicPasswordFieldUI </item>
++      <item> BasicPermission </item>
++      <item> BasicPopupMenuSeparatorUI </item>
++      <item> BasicPopupMenuUI </item>
++      <item> BasicProgressBarUI </item>
++      <item> BasicRadioButtonMenuItemUI </item>
++      <item> BasicRadioButtonUI </item>
++      <item> BasicRootPaneUI </item>
++      <item> BasicScrollBarUI </item>
++      <item> BasicScrollPaneUI </item>
++      <item> BasicSeparatorUI </item>
++      <item> BasicSliderUI </item>
++      <item> BasicSpinnerUI </item>
++      <item> BasicSplitPaneDivider </item>
++      <item> BasicSplitPaneUI </item>
++      <item> BasicStroke </item>
++      <item> BasicTabbedPaneUI </item>
++      <item> BasicTableHeaderUI </item>
++      <item> BasicTableUI </item>
++      <item> BasicTextAreaUI </item>
++      <item> BasicTextFieldUI </item>
++      <item> BasicTextPaneUI </item>
++      <item> BasicTextUI </item>
++      <item> BasicTextUI.BasicCaret </item>
++      <item> BasicTextUI.BasicHighlighter </item>
++      <item> BasicToggleButtonUI </item>
++      <item> BasicToolBarSeparatorUI </item>
++      <item> BasicToolBarUI </item>
++      <item> BasicToolTipUI </item>
++      <item> BasicTreeUI </item>
++      <item> BasicViewportUI </item>
++      <item> BatchUpdateException </item>
++      <item> BeanContext </item>
++      <item> BeanContextChild </item>
++      <item> BeanContextChildComponentProxy </item>
++      <item> BeanContextChildSupport </item>
++      <item> BeanContextContainerProxy </item>
++      <item> BeanContextEvent </item>
++      <item> BeanContextMembershipEvent </item>
++      <item> BeanContextMembershipListener </item>
++      <item> BeanContextProxy </item>
++      <item> BeanContextServiceAvailableEvent </item>
++      <item> BeanContextServiceProvider </item>
++      <item> BeanContextServiceProviderBeanInfo </item>
++      <item> BeanContextServiceRevokedEvent </item>
++      <item> BeanContextServiceRevokedListener </item>
++      <item> BeanContextServices </item>
++      <item> BeanContextServicesListener </item>
++      <item> BeanContextServicesSupport </item>
++      <item> BeanContextServicesSupport.BCSSServiceProvider </item>
++      <item> BeanContextSupport </item>
++      <item> BeanContextSupport.BCSIterator </item>
++      <item> BeanDescriptor </item>
++      <item> BeanInfo </item>
++      <item> Beans </item>
++      <item> BevelBorder </item>
++      <item> Bidi </item>
++      <item> BigDecimal </item>
++      <item> BigInteger </item>
++      <item> BinaryRefAddr </item>
++      <item> BindException </item>
++      <item> Binding </item>
++      <item> Binding </item>
++      <item> BindingHelper </item>
++      <item> BindingHolder </item>
++      <item> BindingIterator </item>
++      <item> BindingIteratorHelper </item>
++      <item> BindingIteratorHolder </item>
++      <item> BindingIteratorOperations </item>
++      <item> BindingIteratorPOA </item>
++      <item> BindingListHelper </item>
++      <item> BindingListHolder </item>
++      <item> BindingType </item>
++      <item> BindingTypeHelper </item>
++      <item> BindingTypeHolder </item>
++      <item> BitSet </item>
++      <item> Blob </item>
++      <item> BlockView </item>
++      <item> BlockingQueue </item>
++      <item> Book </item>
++      <item> Boolean </item>
++      <item> BooleanControl </item>
++      <item> BooleanControl.Type </item>
++      <item> BooleanHolder </item>
++      <item> BooleanSeqHelper </item>
++      <item> BooleanSeqHolder </item>
++      <item> Border </item>
++      <item> BorderFactory </item>
++      <item> BorderLayout </item>
++      <item> BorderUIResource </item>
++      <item> BorderUIResource.BevelBorderUIResource </item>
++      <item> BorderUIResource.CompoundBorderUIResource </item>
++      <item> BorderUIResource.EmptyBorderUIResource </item>
++      <item> BorderUIResource.EtchedBorderUIResource </item>
++      <item> BorderUIResource.LineBorderUIResource </item>
++      <item> BorderUIResource.MatteBorderUIResource </item>
++      <item> BorderUIResource.TitledBorderUIResource </item>
++      <item> BoundedRangeModel </item>
++      <item> Bounds </item>
++      <item> Bounds </item>
++      <item> Box </item>
++      <item> Box.Filler </item>
++      <item> BoxLayout </item>
++      <item> BoxView </item>
++      <item> BoxedValueHelper </item>
++      <item> BreakIterator </item>
++      <item> BrokenBarrierException </item>
++      <item> Buffer </item>
++      <item> BufferCapabilities </item>
++      <item> BufferCapabilities.FlipContents </item>
++      <item> BufferOverflowException </item>
++      <item> BufferStrategy </item>
++      <item> BufferUnderflowException </item>
++      <item> BufferedImage </item>
++      <item> BufferedImageFilter </item>
++      <item> BufferedImageOp </item>
++      <item> BufferedInputStream </item>
++      <item> BufferedOutputStream </item>
++      <item> BufferedReader </item>
++      <item> BufferedWriter </item>
++      <item> Button </item>
++      <item> ButtonGroup </item>
++      <item> ButtonModel </item>
++      <item> ButtonUI </item>
++      <item> Byte </item>
++      <item> ByteArrayInputStream </item>
++      <item> ByteArrayOutputStream </item>
++      <item> ByteBuffer </item>
++      <item> ByteChannel </item>
++      <item> ByteHolder </item>
++      <item> ByteLookupTable </item>
++      <item> ByteOrder </item>
++      <item> CDATASection </item>
++      <item> CMMException </item>
++      <item> CODESET_INCOMPATIBLE </item>
++      <item> COMM_FAILURE </item>
++      <item> CRC32 </item>
++      <item> CRL </item>
++      <item> CRLException </item>
++      <item> CRLSelector </item>
++      <item> CSS </item>
++      <item> CSS.Attribute </item>
++      <item> CTX_RESTRICT_SCOPE </item>
++      <item> CacheRequest </item>
++      <item> CacheResponse </item>
++      <item> CachedRowSet </item>
++      <item> Calendar </item>
++      <item> Callable </item>
++      <item> CallableStatement </item>
++      <item> Callback </item>
++      <item> CallbackHandler </item>
++      <item> CancelablePrintJob </item>
++      <item> CancellationException </item>
++      <item> CancelledKeyException </item>
++      <item> CannotProceed </item>
++      <item> CannotProceedException </item>
++      <item> CannotProceedHelper </item>
++      <item> CannotProceedHolder </item>
++      <item> CannotRedoException </item>
++      <item> CannotUndoException </item>
++      <item> Canvas </item>
++      <item> CardLayout </item>
++      <item> Caret </item>
++      <item> CaretEvent </item>
++      <item> CaretListener </item>
++      <item> CellEditor </item>
++      <item> CellEditorListener </item>
++      <item> CellRendererPane </item>
++      <item> CertPath </item>
++      <item> CertPath.CertPathRep </item>
++      <item> CertPathBuilder </item>
++      <item> CertPathBuilderException </item>
++      <item> CertPathBuilderResult </item>
++      <item> CertPathBuilderSpi </item>
++      <item> CertPathParameters </item>
++      <item> CertPathTrustManagerParameters </item>
++      <item> CertPathValidator </item>
++      <item> CertPathValidatorException </item>
++      <item> CertPathValidatorResult </item>
++      <item> CertPathValidatorSpi </item>
++      <item> CertSelector </item>
++      <item> CertStore </item>
++      <item> CertStoreException </item>
++      <item> CertStoreParameters </item>
++      <item> CertStoreSpi </item>
++      <item> Certificate </item>
++      <item> Certificate </item>
++      <item> Certificate </item>
++      <item> Certificate.CertificateRep </item>
++      <item> CertificateEncodingException </item>
++      <item> CertificateEncodingException </item>
++      <item> CertificateException </item>
++      <item> CertificateException </item>
++      <item> CertificateExpiredException </item>
++      <item> CertificateExpiredException </item>
++      <item> CertificateFactory </item>
++      <item> CertificateFactorySpi </item>
++      <item> CertificateNotYetValidException </item>
++      <item> CertificateNotYetValidException </item>
++      <item> CertificateParsingException </item>
++      <item> CertificateParsingException </item>
++      <item> ChangeEvent </item>
++      <item> ChangeListener </item>
++      <item> ChangedCharSetException </item>
++      <item> Channel </item>
++      <item> ChannelBinding </item>
++      <item> Channels </item>
++      <item> CharArrayReader </item>
++      <item> CharArrayWriter </item>
++      <item> CharBuffer </item>
++      <item> CharConversionException </item>
++      <item> CharHolder </item>
++      <item> CharSeqHelper </item>
++      <item> CharSeqHolder </item>
++      <item> CharSequence </item>
++      <item> Character </item>
++      <item> Character.Subset </item>
++      <item> Character.UnicodeBlock </item>
++      <item> CharacterCodingException </item>
++      <item> CharacterData </item>
++      <item> CharacterIterator </item>
++      <item> Charset </item>
++      <item> CharsetDecoder </item>
++      <item> CharsetEncoder </item>
++      <item> CharsetProvider </item>
++      <item> Checkbox </item>
++      <item> CheckboxGroup </item>
++      <item> CheckboxMenuItem </item>
++      <item> CheckedInputStream </item>
++      <item> CheckedOutputStream </item>
++      <item> Checksum </item>
++      <item> Choice </item>
++      <item> ChoiceCallback </item>
++      <item> ChoiceFormat </item>
++      <item> Chromaticity </item>
++      <item> Cipher </item>
++      <item> CipherInputStream </item>
++      <item> CipherOutputStream </item>
++      <item> CipherSpi </item>
++      <item> Class </item>
++      <item> ClassCastException </item>
++      <item> ClassCircularityError </item>
++      <item> ClassDefinition </item>
++      <item> ClassDesc </item>
++      <item> ClassFileTransformer </item>
++      <item> ClassFormatError </item>
++      <item> ClassLoader </item>
++      <item> ClassLoaderRepository </item>
++      <item> ClassLoadingMXBean </item>
++      <item> ClassNotFoundException </item>
++      <item> ClientRequestInfo </item>
++      <item> ClientRequestInfoOperations </item>
++      <item> ClientRequestInterceptor </item>
++      <item> ClientRequestInterceptorOperations </item>
++      <item> Clip </item>
++      <item> Clipboard </item>
++      <item> ClipboardOwner </item>
++      <item> Clob </item>
++      <item> CloneNotSupportedException </item>
++      <item> Cloneable </item>
++      <item> Closeable </item>
++      <item> ClosedByInterruptException </item>
++      <item> ClosedChannelException </item>
++      <item> ClosedSelectorException </item>
++      <item> CodeSets </item>
++      <item> CodeSigner </item>
++      <item> CodeSource </item>
++      <item> Codec </item>
++      <item> CodecFactory </item>
++      <item> CodecFactoryHelper </item>
++      <item> CodecFactoryOperations </item>
++      <item> CodecOperations </item>
++      <item> CoderMalfunctionError </item>
++      <item> CoderResult </item>
++      <item> CodingErrorAction </item>
++      <item> CollationElementIterator </item>
++      <item> CollationKey </item>
++      <item> Collator </item>
++      <item> Collection </item>
++      <item> CollectionCertStoreParameters </item>
++      <item> Collections </item>
++      <item> Color </item>
++      <item> ColorChooserComponentFactory </item>
++      <item> ColorChooserUI </item>
++      <item> ColorConvertOp </item>
++      <item> ColorModel </item>
++      <item> ColorSelectionModel </item>
++      <item> ColorSpace </item>
++      <item> ColorSupported </item>
++      <item> ColorType </item>
++      <item> ColorUIResource </item>
++      <item> ComboBoxEditor </item>
++      <item> ComboBoxModel </item>
++      <item> ComboBoxUI </item>
++      <item> ComboPopup </item>
++      <item> Comment </item>
++      <item> CommunicationException </item>
++      <item> Comparable </item>
++      <item> Comparator </item>
++      <item> CompilationMXBean </item>
++      <item> Compiler </item>
++      <item> CompletionService </item>
++      <item> CompletionStatus </item>
++      <item> CompletionStatusHelper </item>
++      <item> Component </item>
++      <item> ComponentAdapter </item>
++      <item> ComponentColorModel </item>
++      <item> ComponentEvent </item>
++      <item> ComponentIdHelper </item>
++      <item> ComponentInputMap </item>
++      <item> ComponentInputMapUIResource </item>
++      <item> ComponentListener </item>
++      <item> ComponentOrientation </item>
++      <item> ComponentSampleModel </item>
++      <item> ComponentUI </item>
++      <item> ComponentView </item>
++      <item> Composite </item>
++      <item> CompositeContext </item>
++      <item> CompositeData </item>
++      <item> CompositeDataSupport </item>
++      <item> CompositeName </item>
++      <item> CompositeType </item>
++      <item> CompositeView </item>
++      <item> CompoundBorder </item>
++      <item> CompoundControl </item>
++      <item> CompoundControl.Type </item>
++      <item> CompoundEdit </item>
++      <item> CompoundName </item>
++      <item> Compression </item>
++      <item> ConcurrentHashMap </item>
++      <item> ConcurrentLinkedQueue </item>
++      <item> ConcurrentMap </item>
++      <item> ConcurrentModificationException </item>
++      <item> Condition </item>
++      <item> Configuration </item>
++      <item> ConfigurationException </item>
++      <item> ConfirmationCallback </item>
++      <item> ConnectException </item>
++      <item> ConnectException </item>
++      <item> ConnectIOException </item>
++      <item> Connection </item>
++      <item> ConnectionEvent </item>
++      <item> ConnectionEventListener </item>
++      <item> ConnectionPendingException </item>
++      <item> ConnectionPoolDataSource </item>
++      <item> ConsoleHandler </item>
++      <item> Constructor </item>
++      <item> Container </item>
++      <item> ContainerAdapter </item>
++      <item> ContainerEvent </item>
++      <item> ContainerListener </item>
++      <item> ContainerOrderFocusTraversalPolicy </item>
++      <item> ContentHandler </item>
++      <item> ContentHandler </item>
++      <item> ContentHandlerFactory </item>
++      <item> ContentModel </item>
++      <item> Context </item>
++      <item> Context </item>
++      <item> ContextList </item>
++      <item> ContextNotEmptyException </item>
++      <item> ContextualRenderedImageFactory </item>
++      <item> Control </item>
++      <item> Control </item>
++      <item> Control.Type </item>
++      <item> ControlFactory </item>
++      <item> ControllerEventListener </item>
++      <item> ConvolveOp </item>
++      <item> CookieHandler </item>
++      <item> CookieHolder </item>
++      <item> Copies </item>
++      <item> CopiesSupported </item>
++      <item> CopyOnWriteArrayList </item>
++      <item> CopyOnWriteArraySet </item>
++      <item> CountDownLatch </item>
++      <item> CounterMonitor </item>
++      <item> CounterMonitorMBean </item>
++      <item> CredentialException </item>
++      <item> CredentialExpiredException </item>
++      <item> CredentialNotFoundException </item>
++      <item> CropImageFilter </item>
++      <item> CubicCurve2D </item>
++      <item> CubicCurve2D.Double </item>
++      <item> CubicCurve2D.Float </item>
++      <item> Currency </item>
++      <item> Current </item>
++      <item> Current </item>
++      <item> Current </item>
++      <item> CurrentHelper </item>
++      <item> CurrentHelper </item>
++      <item> CurrentHelper </item>
++      <item> CurrentHolder </item>
++      <item> CurrentOperations </item>
++      <item> CurrentOperations </item>
++      <item> CurrentOperations </item>
++      <item> Cursor </item>
++      <item> CustomMarshal </item>
++      <item> CustomValue </item>
++      <item> Customizer </item>
++      <item> CyclicBarrier </item>
++      <item> DATA_CONVERSION </item>
++      <item> DESKeySpec </item>
++      <item> DESedeKeySpec </item>
++      <item> DGC </item>
++      <item> DHGenParameterSpec </item>
++      <item> DHKey </item>
++      <item> DHParameterSpec </item>
++      <item> DHPrivateKey </item>
++      <item> DHPrivateKeySpec </item>
++      <item> DHPublicKey </item>
++      <item> DHPublicKeySpec </item>
++      <item> DISCARDING </item>
++      <item> DOMConfiguration </item>
++      <item> DOMError </item>
++      <item> DOMErrorHandler </item>
++      <item> DOMException </item>
++      <item> DOMImplementation </item>
++      <item> DOMImplementationLS </item>
++      <item> DOMImplementationList </item>
++      <item> DOMImplementationRegistry </item>
++      <item> DOMImplementationSource </item>
++      <item> DOMLocator </item>
++      <item> DOMLocator </item>
++      <item> DOMResult </item>
++      <item> DOMSource </item>
++      <item> DOMStringList </item>
++      <item> DSAKey </item>
++      <item> DSAKeyPairGenerator </item>
++      <item> DSAParameterSpec </item>
++      <item> DSAParams </item>
++      <item> DSAPrivateKey </item>
++      <item> DSAPrivateKeySpec </item>
++      <item> DSAPublicKey </item>
++      <item> DSAPublicKeySpec </item>
++      <item> DTD </item>
++      <item> DTDConstants </item>
++      <item> DTDHandler </item>
++      <item> DataBuffer </item>
++      <item> DataBufferByte </item>
++      <item> DataBufferDouble </item>
++      <item> DataBufferFloat </item>
++      <item> DataBufferInt </item>
++      <item> DataBufferShort </item>
++      <item> DataBufferUShort </item>
++      <item> DataFlavor </item>
++      <item> DataFormatException </item>
++      <item> DataInput </item>
++      <item> DataInputStream </item>
++      <item> DataInputStream </item>
++      <item> DataLine </item>
++      <item> DataLine.Info </item>
++      <item> DataOutput </item>
++      <item> DataOutputStream </item>
++      <item> DataOutputStream </item>
++      <item> DataSource </item>
++      <item> DataTruncation </item>
++      <item> DatabaseMetaData </item>
++      <item> DatagramChannel </item>
++      <item> DatagramPacket </item>
++      <item> DatagramSocket </item>
++      <item> DatagramSocketImpl </item>
++      <item> DatagramSocketImplFactory </item>
++      <item> DatatypeConfigurationException </item>
++      <item> DatatypeConstants </item>
++      <item> DatatypeConstants.Field </item>
++      <item> DatatypeFactory </item>
++      <item> Date </item>
++      <item> Date </item>
++      <item> DateFormat </item>
++      <item> DateFormat.Field </item>
++      <item> DateFormatSymbols </item>
++      <item> DateFormatter </item>
++      <item> DateTimeAtCompleted </item>
++      <item> DateTimeAtCreation </item>
++      <item> DateTimeAtProcessing </item>
++      <item> DateTimeSyntax </item>
++      <item> DebugGraphics </item>
++      <item> DecimalFormat </item>
++      <item> DecimalFormatSymbols </item>
++      <item> DeclHandler </item>
++      <item> DefaultBoundedRangeModel </item>
++      <item> DefaultButtonModel </item>
++      <item> DefaultCaret </item>
++      <item> DefaultCellEditor </item>
++      <item> DefaultColorSelectionModel </item>
++      <item> DefaultComboBoxModel </item>
++      <item> DefaultDesktopManager </item>
++      <item> DefaultEditorKit </item>
++      <item> DefaultEditorKit.BeepAction </item>
++      <item> DefaultEditorKit.CopyAction </item>
++      <item> DefaultEditorKit.CutAction </item>
++      <item> DefaultEditorKit.DefaultKeyTypedAction </item>
++      <item> DefaultEditorKit.InsertBreakAction </item>
++      <item> DefaultEditorKit.InsertContentAction </item>
++      <item> DefaultEditorKit.InsertTabAction </item>
++      <item> DefaultEditorKit.PasteAction </item>
++      <item> DefaultFocusManager </item>
++      <item> DefaultFocusTraversalPolicy </item>
++      <item> DefaultFormatter </item>
++      <item> DefaultFormatterFactory </item>
++      <item> DefaultHandler </item>
++      <item> DefaultHandler2 </item>
++      <item> DefaultHighlighter </item>
++      <item> DefaultHighlighter.DefaultHighlightPainter </item>
++      <item> DefaultKeyboardFocusManager </item>
++      <item> DefaultListCellRenderer </item>
++      <item> DefaultListCellRenderer.UIResource </item>
++      <item> DefaultListModel </item>
++      <item> DefaultListSelectionModel </item>
++      <item> DefaultLoaderRepository </item>
++      <item> DefaultLoaderRepository </item>
++      <item> DefaultMenuLayout </item>
++      <item> DefaultMetalTheme </item>
++      <item> DefaultMutableTreeNode </item>
++      <item> DefaultPersistenceDelegate </item>
++      <item> DefaultSingleSelectionModel </item>
++      <item> DefaultStyledDocument </item>
++      <item> DefaultStyledDocument.AttributeUndoableEdit </item>
++      <item> DefaultStyledDocument.ElementSpec </item>
++      <item> DefaultTableCellRenderer </item>
++      <item> DefaultTableCellRenderer.UIResource </item>
++      <item> DefaultTableColumnModel </item>
++      <item> DefaultTableModel </item>
++      <item> DefaultTextUI </item>
++      <item> DefaultTreeCellEditor </item>
++      <item> DefaultTreeCellRenderer </item>
++      <item> DefaultTreeModel </item>
++      <item> DefaultTreeSelectionModel </item>
++      <item> DefinitionKind </item>
++      <item> DefinitionKindHelper </item>
++      <item> Deflater </item>
++      <item> DeflaterOutputStream </item>
++      <item> DelayQueue </item>
++      <item> Delayed </item>
++      <item> Delegate </item>
++      <item> Delegate </item>
++      <item> Delegate </item>
++      <item> DelegationPermission </item>
++      <item> Deprecated </item>
++      <item> Descriptor </item>
++      <item> DescriptorAccess </item>
++      <item> DescriptorSupport </item>
++      <item> DesignMode </item>
++      <item> DesktopIconUI </item>
++      <item> DesktopManager </item>
++      <item> DesktopPaneUI </item>
++      <item> Destination </item>
++      <item> DestroyFailedException </item>
++      <item> Destroyable </item>
++      <item> Dialog </item>
++      <item> Dictionary </item>
++      <item> DigestException </item>
++      <item> DigestInputStream </item>
++      <item> DigestOutputStream </item>
++      <item> Dimension </item>
++      <item> Dimension2D </item>
++      <item> DimensionUIResource </item>
++      <item> DirContext </item>
++      <item> DirObjectFactory </item>
++      <item> DirStateFactory </item>
++      <item> DirStateFactory.Result </item>
++      <item> DirectColorModel </item>
++      <item> DirectoryManager </item>
++      <item> DisplayMode </item>
++      <item> DnDConstants </item>
++      <item> Doc </item>
++      <item> DocAttribute </item>
++      <item> DocAttributeSet </item>
++      <item> DocFlavor </item>
++      <item> DocFlavor.BYTE_ARRAY </item>
++      <item> DocFlavor.CHAR_ARRAY </item>
++      <item> DocFlavor.INPUT_STREAM </item>
++      <item> DocFlavor.READER </item>
++      <item> DocFlavor.SERVICE_FORMATTED </item>
++      <item> DocFlavor.STRING </item>
++      <item> DocFlavor.URL </item>
++      <item> DocPrintJob </item>
++      <item> Document </item>
++      <item> Document </item>
++      <item> DocumentBuilder </item>
++      <item> DocumentBuilderFactory </item>
++      <item> DocumentEvent </item>
++      <item> DocumentEvent.ElementChange </item>
++      <item> DocumentEvent.EventType </item>
++      <item> DocumentFilter </item>
++      <item> DocumentFilter.FilterBypass </item>
++      <item> DocumentFragment </item>
++      <item> DocumentHandler </item>
++      <item> DocumentListener </item>
++      <item> DocumentName </item>
++      <item> DocumentParser </item>
++      <item> DocumentType </item>
++      <item> Documented </item>
++      <item> DomainCombiner </item>
++      <item> DomainManager </item>
++      <item> DomainManagerOperations </item>
++      <item> Double </item>
++      <item> DoubleBuffer </item>
++      <item> DoubleHolder </item>
++      <item> DoubleSeqHelper </item>
++      <item> DoubleSeqHolder </item>
++      <item> DragGestureEvent </item>
++      <item> DragGestureListener </item>
++      <item> DragGestureRecognizer </item>
++      <item> DragSource </item>
++      <item> DragSourceAdapter </item>
++      <item> DragSourceContext </item>
++      <item> DragSourceDragEvent </item>
++      <item> DragSourceDropEvent </item>
++      <item> DragSourceEvent </item>
++      <item> DragSourceListener </item>
++      <item> DragSourceMotionListener </item>
++      <item> Driver </item>
++      <item> DriverManager </item>
++      <item> DriverPropertyInfo </item>
++      <item> DropTarget </item>
++      <item> DropTarget.DropTargetAutoScroller </item>
++      <item> DropTargetAdapter </item>
++      <item> DropTargetContext </item>
++      <item> DropTargetDragEvent </item>
++      <item> DropTargetDropEvent </item>
++      <item> DropTargetEvent </item>
++      <item> DropTargetListener </item>
++      <item> DuplicateFormatFlagsException </item>
++      <item> DuplicateName </item>
++      <item> DuplicateNameHelper </item>
++      <item> Duration </item>
++      <item> DynAny </item>
++      <item> DynAny </item>
++      <item> DynAnyFactory </item>
++      <item> DynAnyFactoryHelper </item>
++      <item> DynAnyFactoryOperations </item>
++      <item> DynAnyHelper </item>
++      <item> DynAnyOperations </item>
++      <item> DynAnySeqHelper </item>
++      <item> DynArray </item>
++      <item> DynArray </item>
++      <item> DynArrayHelper </item>
++      <item> DynArrayOperations </item>
++      <item> DynEnum </item>
++      <item> DynEnum </item>
++      <item> DynEnumHelper </item>
++      <item> DynEnumOperations </item>
++      <item> DynFixed </item>
++      <item> DynFixed </item>
++      <item> DynFixedHelper </item>
++      <item> DynFixedOperations </item>
++      <item> DynSequence </item>
++      <item> DynSequence </item>
++      <item> DynSequenceHelper </item>
++      <item> DynSequenceOperations </item>
++      <item> DynStruct </item>
++      <item> DynStruct </item>
++      <item> DynStructHelper </item>
++      <item> DynStructOperations </item>
++      <item> DynUnion </item>
++      <item> DynUnion </item>
++      <item> DynUnionHelper </item>
++      <item> DynUnionOperations </item>
++      <item> DynValue </item>
++      <item> DynValue </item>
++      <item> DynValueBox </item>
++      <item> DynValueBoxOperations </item>
++      <item> DynValueCommon </item>
++      <item> DynValueCommonOperations </item>
++      <item> DynValueHelper </item>
++      <item> DynValueOperations </item>
++      <item> DynamicImplementation </item>
++      <item> DynamicImplementation </item>
++      <item> DynamicMBean </item>
++      <item> ECField </item>
++      <item> ECFieldF2m </item>
++      <item> ECFieldFp </item>
++      <item> ECGenParameterSpec </item>
++      <item> ECKey </item>
++      <item> ECParameterSpec </item>
++      <item> ECPoint </item>
++      <item> ECPrivateKey </item>
++      <item> ECPrivateKeySpec </item>
++      <item> ECPublicKey </item>
++      <item> ECPublicKeySpec </item>
++      <item> ENCODING_CDR_ENCAPS </item>
++      <item> EOFException </item>
++      <item> EditorKit </item>
++      <item> Element </item>
++      <item> Element </item>
++      <item> Element </item>
++      <item> ElementIterator </item>
++      <item> ElementType </item>
++      <item> Ellipse2D </item>
++      <item> Ellipse2D.Double </item>
++      <item> Ellipse2D.Float </item>
++      <item> EllipticCurve </item>
++      <item> EmptyBorder </item>
++      <item> EmptyStackException </item>
++      <item> EncodedKeySpec </item>
++      <item> Encoder </item>
++      <item> Encoding </item>
++      <item> EncryptedPrivateKeyInfo </item>
++      <item> Entity </item>
++      <item> Entity </item>
++      <item> EntityReference </item>
++      <item> EntityResolver </item>
++      <item> EntityResolver2 </item>
++      <item> Enum </item>
++      <item> EnumConstantNotPresentException </item>
++      <item> EnumControl </item>
++      <item> EnumControl.Type </item>
++      <item> EnumMap </item>
++      <item> EnumSet </item>
++      <item> EnumSyntax </item>
++      <item> Enumeration </item>
++      <item> Environment </item>
++      <item> Error </item>
++      <item> ErrorHandler </item>
++      <item> ErrorListener </item>
++      <item> ErrorManager </item>
++      <item> EtchedBorder </item>
++      <item> Event </item>
++      <item> EventContext </item>
++      <item> EventDirContext </item>
++      <item> EventHandler </item>
++      <item> EventListener </item>
++      <item> EventListenerList </item>
++      <item> EventListenerProxy </item>
++      <item> EventObject </item>
++      <item> EventQueue </item>
++      <item> EventSetDescriptor </item>
++      <item> Exception </item>
++      <item> ExceptionDetailMessage </item>
++      <item> ExceptionInInitializerError </item>
++      <item> ExceptionList </item>
++      <item> ExceptionListener </item>
++      <item> Exchanger </item>
++      <item> ExecutionException </item>
++      <item> Executor </item>
++      <item> ExecutorCompletionService </item>
++      <item> ExecutorService </item>
++      <item> Executors </item>
++      <item> ExemptionMechanism </item>
++      <item> ExemptionMechanismException </item>
++      <item> ExemptionMechanismSpi </item>
++      <item> ExpandVetoException </item>
++      <item> ExportException </item>
++      <item> Expression </item>
++      <item> ExtendedRequest </item>
++      <item> ExtendedResponse </item>
++      <item> Externalizable </item>
++      <item> FREE_MEM </item>
++      <item> FactoryConfigurationError </item>
++      <item> FailedLoginException </item>
++      <item> FeatureDescriptor </item>
++      <item> Fidelity </item>
++      <item> Field </item>
++      <item> FieldNameHelper </item>
++      <item> FieldNameHelper </item>
++      <item> FieldPosition </item>
++      <item> FieldView </item>
++      <item> File </item>
++      <item> FileCacheImageInputStream </item>
++      <item> FileCacheImageOutputStream </item>
++      <item> FileChannel </item>
++      <item> FileChannel.MapMode </item>
++      <item> FileChooserUI </item>
++      <item> FileDescriptor </item>
++      <item> FileDialog </item>
++      <item> FileFilter </item>
++      <item> FileFilter </item>
++      <item> FileHandler </item>
++      <item> FileImageInputStream </item>
++      <item> FileImageOutputStream </item>
++      <item> FileInputStream </item>
++      <item> FileLock </item>
++      <item> FileLockInterruptionException </item>
++      <item> FileNameMap </item>
++      <item> FileNotFoundException </item>
++      <item> FileOutputStream </item>
++      <item> FilePermission </item>
++      <item> FileReader </item>
++      <item> FileSystemView </item>
++      <item> FileView </item>
++      <item> FileWriter </item>
++      <item> FilenameFilter </item>
++      <item> Filter </item>
++      <item> FilterInputStream </item>
++      <item> FilterOutputStream </item>
++      <item> FilterReader </item>
++      <item> FilterWriter </item>
++      <item> FilteredImageSource </item>
++      <item> FilteredRowSet </item>
++      <item> Finishings </item>
++      <item> FixedHeightLayoutCache </item>
++      <item> FixedHolder </item>
++      <item> FlatteningPathIterator </item>
++      <item> FlavorEvent </item>
++      <item> FlavorException </item>
++      <item> FlavorListener </item>
++      <item> FlavorMap </item>
++      <item> FlavorTable </item>
++      <item> Float </item>
++      <item> FloatBuffer </item>
++      <item> FloatControl </item>
++      <item> FloatControl.Type </item>
++      <item> FloatHolder </item>
++      <item> FloatSeqHelper </item>
++      <item> FloatSeqHolder </item>
++      <item> FlowLayout </item>
++      <item> FlowView </item>
++      <item> FlowView.FlowStrategy </item>
++      <item> Flushable </item>
++      <item> FocusAdapter </item>
++      <item> FocusEvent </item>
++      <item> FocusListener </item>
++      <item> FocusManager </item>
++      <item> FocusTraversalPolicy </item>
++      <item> Font </item>
++      <item> FontFormatException </item>
++      <item> FontMetrics </item>
++      <item> FontRenderContext </item>
++      <item> FontUIResource </item>
++      <item> FormSubmitEvent </item>
++      <item> FormSubmitEvent.MethodType </item>
++      <item> FormView </item>
++      <item> Format </item>
++      <item> Format.Field </item>
++      <item> FormatConversionProvider </item>
++      <item> FormatFlagsConversionMismatchException </item>
++      <item> FormatMismatch </item>
++      <item> FormatMismatchHelper </item>
++      <item> Formattable </item>
++      <item> FormattableFlags </item>
++      <item> Formatter </item>
++      <item> Formatter </item>
++      <item> FormatterClosedException </item>
++      <item> ForwardRequest </item>
++      <item> ForwardRequest </item>
++      <item> ForwardRequestHelper </item>
++      <item> ForwardRequestHelper </item>
++      <item> Frame </item>
++      <item> Future </item>
++      <item> FutureTask </item>
++      <item> GSSContext </item>
++      <item> GSSCredential </item>
++      <item> GSSException </item>
++      <item> GSSManager </item>
++      <item> GSSName </item>
++      <item> GZIPInputStream </item>
++      <item> GZIPOutputStream </item>
++      <item> GapContent </item>
++      <item> GarbageCollectorMXBean </item>
++      <item> GatheringByteChannel </item>
++      <item> GaugeMonitor </item>
++      <item> GaugeMonitorMBean </item>
++      <item> GeneralPath </item>
++      <item> GeneralSecurityException </item>
++      <item> GenericArrayType </item>
++      <item> GenericDeclaration </item>
++      <item> GenericSignatureFormatError </item>
++      <item> GlyphJustificationInfo </item>
++      <item> GlyphMetrics </item>
++      <item> GlyphVector </item>
++      <item> GlyphView </item>
++      <item> GlyphView.GlyphPainter </item>
++      <item> GradientPaint </item>
++      <item> GraphicAttribute </item>
++      <item> Graphics </item>
++      <item> Graphics2D </item>
++      <item> GraphicsConfigTemplate </item>
++      <item> GraphicsConfiguration </item>
++      <item> GraphicsDevice </item>
++      <item> GraphicsEnvironment </item>
++      <item> GrayFilter </item>
++      <item> GregorianCalendar </item>
++      <item> GridBagConstraints </item>
++      <item> GridBagLayout </item>
++      <item> GridLayout </item>
++      <item> Group </item>
++      <item> Guard </item>
++      <item> GuardedObject </item>
++      <item> HOLDING </item>
++      <item> HTML </item>
++      <item> HTML.Attribute </item>
++      <item> HTML.Tag </item>
++      <item> HTML.UnknownTag </item>
++      <item> HTMLDocument </item>
++      <item> HTMLDocument.Iterator </item>
++      <item> HTMLEditorKit </item>
++      <item> HTMLEditorKit.HTMLFactory </item>
++      <item> HTMLEditorKit.HTMLTextAction </item>
++      <item> HTMLEditorKit.InsertHTMLTextAction </item>
++      <item> HTMLEditorKit.LinkController </item>
++      <item> HTMLEditorKit.Parser </item>
++      <item> HTMLEditorKit.ParserCallback </item>
++      <item> HTMLFrameHyperlinkEvent </item>
++      <item> HTMLWriter </item>
++      <item> Handler </item>
++      <item> HandlerBase </item>
++      <item> HandshakeCompletedEvent </item>
++      <item> HandshakeCompletedListener </item>
++      <item> HasControls </item>
++      <item> HashAttributeSet </item>
++      <item> HashDocAttributeSet </item>
++      <item> HashMap </item>
++      <item> HashPrintJobAttributeSet </item>
++      <item> HashPrintRequestAttributeSet </item>
++      <item> HashPrintServiceAttributeSet </item>
++      <item> HashSet </item>
++      <item> Hashtable </item>
++      <item> HeadlessException </item>
++      <item> HierarchyBoundsAdapter </item>
++      <item> HierarchyBoundsListener </item>
++      <item> HierarchyEvent </item>
++      <item> HierarchyListener </item>
++      <item> Highlighter </item>
++      <item> Highlighter.Highlight </item>
++      <item> Highlighter.HighlightPainter </item>
++      <item> HostnameVerifier </item>
++      <item> HttpRetryException </item>
++      <item> HttpURLConnection </item>
++      <item> HttpsURLConnection </item>
++      <item> HyperlinkEvent </item>
++      <item> HyperlinkEvent.EventType </item>
++      <item> HyperlinkListener </item>
++      <item> ICC_ColorSpace </item>
++      <item> ICC_Profile </item>
++      <item> ICC_ProfileGray </item>
++      <item> ICC_ProfileRGB </item>
++      <item> IDLEntity </item>
++      <item> IDLType </item>
++      <item> IDLTypeHelper </item>
++      <item> IDLTypeOperations </item>
++      <item> ID_ASSIGNMENT_POLICY_ID </item>
++      <item> ID_UNIQUENESS_POLICY_ID </item>
++      <item> IIOByteBuffer </item>
++      <item> IIOException </item>
++      <item> IIOImage </item>
++      <item> IIOInvalidTreeException </item>
++      <item> IIOMetadata </item>
++      <item> IIOMetadataController </item>
++      <item> IIOMetadataFormat </item>
++      <item> IIOMetadataFormatImpl </item>
++      <item> IIOMetadataNode </item>
++      <item> IIOParam </item>
++      <item> IIOParamController </item>
++      <item> IIOReadProgressListener </item>
++      <item> IIOReadUpdateListener </item>
++      <item> IIOReadWarningListener </item>
++      <item> IIORegistry </item>
++      <item> IIOServiceProvider </item>
++      <item> IIOWriteProgressListener </item>
++      <item> IIOWriteWarningListener </item>
++      <item> IMPLICIT_ACTIVATION_POLICY_ID </item>
++      <item> IMP_LIMIT </item>
++      <item> INACTIVE </item>
++      <item> INITIALIZE </item>
++      <item> INTERNAL </item>
++      <item> INTF_REPOS </item>
++      <item> INVALID_ACTIVITY </item>
++      <item> INVALID_TRANSACTION </item>
++      <item> INV_FLAG </item>
++      <item> INV_IDENT </item>
++      <item> INV_OBJREF </item>
++      <item> INV_POLICY </item>
++      <item> IOException </item>
++      <item> IOR </item>
++      <item> IORHelper </item>
++      <item> IORHolder </item>
++      <item> IORInfo </item>
++      <item> IORInfoOperations </item>
++      <item> IORInterceptor </item>
++      <item> IORInterceptorOperations </item>
++      <item> IORInterceptor_3_0 </item>
++      <item> IORInterceptor_3_0Helper </item>
++      <item> IORInterceptor_3_0Holder </item>
++      <item> IORInterceptor_3_0Operations </item>
++      <item> IRObject </item>
++      <item> IRObjectOperations </item>
++      <item> Icon </item>
++      <item> IconUIResource </item>
++      <item> IconView </item>
++      <item> IdAssignmentPolicy </item>
++      <item> IdAssignmentPolicyOperations </item>
++      <item> IdAssignmentPolicyValue </item>
++      <item> IdUniquenessPolicy </item>
++      <item> IdUniquenessPolicyOperations </item>
++      <item> IdUniquenessPolicyValue </item>
++      <item> IdentifierHelper </item>
++      <item> Identity </item>
++      <item> IdentityHashMap </item>
++      <item> IdentityScope </item>
++      <item> IllegalAccessError </item>
++      <item> IllegalAccessException </item>
++      <item> IllegalArgumentException </item>
++      <item> IllegalBlockSizeException </item>
++      <item> IllegalBlockingModeException </item>
++      <item> IllegalCharsetNameException </item>
++      <item> IllegalClassFormatException </item>
++      <item> IllegalComponentStateException </item>
++      <item> IllegalFormatCodePointException </item>
++      <item> IllegalFormatConversionException </item>
++      <item> IllegalFormatException </item>
++      <item> IllegalFormatFlagsException </item>
++      <item> IllegalFormatPrecisionException </item>
++      <item> IllegalFormatWidthException </item>
++      <item> IllegalMonitorStateException </item>
++      <item> IllegalPathStateException </item>
++      <item> IllegalSelectorException </item>
++      <item> IllegalStateException </item>
++      <item> IllegalThreadStateException </item>
++      <item> Image </item>
++      <item> ImageCapabilities </item>
++      <item> ImageConsumer </item>
++      <item> ImageFilter </item>
++      <item> ImageGraphicAttribute </item>
++      <item> ImageIO </item>
++      <item> ImageIcon </item>
++      <item> ImageInputStream </item>
++      <item> ImageInputStreamImpl </item>
++      <item> ImageInputStreamSpi </item>
++      <item> ImageObserver </item>
++      <item> ImageOutputStream </item>
++      <item> ImageOutputStreamImpl </item>
++      <item> ImageOutputStreamSpi </item>
++      <item> ImageProducer </item>
++      <item> ImageReadParam </item>
++      <item> ImageReader </item>
++      <item> ImageReaderSpi </item>
++      <item> ImageReaderWriterSpi </item>
++      <item> ImageTranscoder </item>
++      <item> ImageTranscoderSpi </item>
++      <item> ImageTypeSpecifier </item>
++      <item> ImageView </item>
++      <item> ImageWriteParam </item>
++      <item> ImageWriter </item>
++      <item> ImageWriterSpi </item>
++      <item> ImagingOpException </item>
++      <item> ImplicitActivationPolicy </item>
++      <item> ImplicitActivationPolicyOperations </item>
++      <item> ImplicitActivationPolicyValue </item>
++      <item> IncompatibleClassChangeError </item>
++      <item> IncompleteAnnotationException </item>
++      <item> InconsistentTypeCode </item>
++      <item> InconsistentTypeCode </item>
++      <item> InconsistentTypeCodeHelper </item>
++      <item> IndexColorModel </item>
++      <item> IndexOutOfBoundsException </item>
++      <item> IndexedPropertyChangeEvent </item>
++      <item> IndexedPropertyDescriptor </item>
++      <item> IndirectionException </item>
++      <item> Inet4Address </item>
++      <item> Inet6Address </item>
++      <item> InetAddress </item>
++      <item> InetSocketAddress </item>
++      <item> Inflater </item>
++      <item> InflaterInputStream </item>
++      <item> InheritableThreadLocal </item>
++      <item> Inherited </item>
++      <item> InitialContext </item>
++      <item> InitialContextFactory </item>
++      <item> InitialContextFactoryBuilder </item>
++      <item> InitialDirContext </item>
++      <item> InitialLdapContext </item>
++      <item> InlineView </item>
++      <item> InputContext </item>
++      <item> InputEvent </item>
++      <item> InputMap </item>
++      <item> InputMapUIResource </item>
++      <item> InputMethod </item>
++      <item> InputMethodContext </item>
++      <item> InputMethodDescriptor </item>
++      <item> InputMethodEvent </item>
++      <item> InputMethodHighlight </item>
++      <item> InputMethodListener </item>
++      <item> InputMethodRequests </item>
++      <item> InputMismatchException </item>
++      <item> InputSource </item>
++      <item> InputStream </item>
++      <item> InputStream </item>
++      <item> InputStream </item>
++      <item> InputStreamReader </item>
++      <item> InputSubset </item>
++      <item> InputVerifier </item>
++      <item> Insets </item>
++      <item> InsetsUIResource </item>
++      <item> InstanceAlreadyExistsException </item>
++      <item> InstanceNotFoundException </item>
++      <item> InstantiationError </item>
++      <item> InstantiationException </item>
++      <item> Instrument </item>
++      <item> Instrumentation </item>
++      <item> InsufficientResourcesException </item>
++      <item> IntBuffer </item>
++      <item> IntHolder </item>
++      <item> Integer </item>
++      <item> IntegerSyntax </item>
++      <item> Interceptor </item>
++      <item> InterceptorOperations </item>
++      <item> InternalError </item>
++      <item> InternalFrameAdapter </item>
++      <item> InternalFrameEvent </item>
++      <item> InternalFrameFocusTraversalPolicy </item>
++      <item> InternalFrameListener </item>
++      <item> InternalFrameUI </item>
++      <item> InternationalFormatter </item>
++      <item> InterruptedException </item>
++      <item> InterruptedIOException </item>
++      <item> InterruptedNamingException </item>
++      <item> InterruptibleChannel </item>
++      <item> IntrospectionException </item>
++      <item> IntrospectionException </item>
++      <item> Introspector </item>
++      <item> Invalid </item>
++      <item> InvalidActivityException </item>
++      <item> InvalidAddress </item>
++      <item> InvalidAddressHelper </item>
++      <item> InvalidAddressHolder </item>
++      <item> InvalidAlgorithmParameterException </item>
++      <item> InvalidApplicationException </item>
++      <item> InvalidAttributeIdentifierException </item>
++      <item> InvalidAttributeValueException </item>
++      <item> InvalidAttributeValueException </item>
++      <item> InvalidAttributesException </item>
++      <item> InvalidClassException </item>
++      <item> InvalidDnDOperationException </item>
++      <item> InvalidKeyException </item>
++      <item> InvalidKeyException </item>
++      <item> InvalidKeySpecException </item>
++      <item> InvalidMarkException </item>
++      <item> InvalidMidiDataException </item>
++      <item> InvalidName </item>
++      <item> InvalidName </item>
++      <item> InvalidName </item>
++      <item> InvalidNameException </item>
++      <item> InvalidNameHelper </item>
++      <item> InvalidNameHelper </item>
++      <item> InvalidNameHolder </item>
++      <item> InvalidObjectException </item>
++      <item> InvalidOpenTypeException </item>
++      <item> InvalidParameterException </item>
++      <item> InvalidParameterSpecException </item>
++      <item> InvalidPolicy </item>
++      <item> InvalidPolicyHelper </item>
++      <item> InvalidPreferencesFormatException </item>
++      <item> InvalidPropertiesFormatException </item>
++      <item> InvalidRelationIdException </item>
++      <item> InvalidRelationServiceException </item>
++      <item> InvalidRelationTypeException </item>
++      <item> InvalidRoleInfoException </item>
++      <item> InvalidRoleValueException </item>
++      <item> InvalidSearchControlsException </item>
++      <item> InvalidSearchFilterException </item>
++      <item> InvalidSeq </item>
++      <item> InvalidSlot </item>
++      <item> InvalidSlotHelper </item>
++      <item> InvalidTargetObjectTypeException </item>
++      <item> InvalidTransactionException </item>
++      <item> InvalidTypeForEncoding </item>
++      <item> InvalidTypeForEncodingHelper </item>
++      <item> InvalidValue </item>
++      <item> InvalidValue </item>
++      <item> InvalidValueHelper </item>
++      <item> InvocationEvent </item>
++      <item> InvocationHandler </item>
++      <item> InvocationTargetException </item>
++      <item> InvokeHandler </item>
++      <item> IstringHelper </item>
++      <item> ItemEvent </item>
++      <item> ItemListener </item>
++      <item> ItemSelectable </item>
++      <item> Iterable </item>
++      <item> Iterator </item>
++      <item> IvParameterSpec </item>
++      <item> JApplet </item>
++      <item> JButton </item>
++      <item> JCheckBox </item>
++      <item> JCheckBoxMenuItem </item>
++      <item> JColorChooser </item>
++      <item> JComboBox </item>
++      <item> JComboBox.KeySelectionManager </item>
++      <item> JComponent </item>
++      <item> JDesktopPane </item>
++      <item> JDialog </item>
++      <item> JEditorPane </item>
++      <item> JFileChooser </item>
++      <item> JFormattedTextField </item>
++      <item> JFormattedTextField.AbstractFormatter </item>
++      <item> JFormattedTextField.AbstractFormatterFactory </item>
++      <item> JFrame </item>
++      <item> JInternalFrame </item>
++      <item> JInternalFrame.JDesktopIcon </item>
++      <item> JLabel </item>
++      <item> JLayeredPane </item>
++      <item> JList </item>
++      <item> JMException </item>
++      <item> JMRuntimeException </item>
++      <item> JMXAuthenticator </item>
++      <item> JMXConnectionNotification </item>
++      <item> JMXConnector </item>
++      <item> JMXConnectorFactory </item>
++      <item> JMXConnectorProvider </item>
++      <item> JMXConnectorServer </item>
++      <item> JMXConnectorServerFactory </item>
++      <item> JMXConnectorServerMBean </item>
++      <item> JMXConnectorServerProvider </item>
++      <item> JMXPrincipal </item>
++      <item> JMXProviderException </item>
++      <item> JMXServerErrorException </item>
++      <item> JMXServiceURL </item>
++      <item> JMenu </item>
++      <item> JMenuBar </item>
++      <item> JMenuItem </item>
++      <item> JOptionPane </item>
++      <item> JPEGHuffmanTable </item>
++      <item> JPEGImageReadParam </item>
++      <item> JPEGImageWriteParam </item>
++      <item> JPEGQTable </item>
++      <item> JPanel </item>
++      <item> JPasswordField </item>
++      <item> JPopupMenu </item>
++      <item> JPopupMenu.Separator </item>
++      <item> JProgressBar </item>
++      <item> JRadioButton </item>
++      <item> JRadioButtonMenuItem </item>
++      <item> JRootPane </item>
++      <item> JScrollBar </item>
++      <item> JScrollPane </item>
++      <item> JSeparator </item>
++      <item> JSlider </item>
++      <item> JSpinner </item>
++      <item> JSpinner.DateEditor </item>
++      <item> JSpinner.DefaultEditor </item>
++      <item> JSpinner.ListEditor </item>
++      <item> JSpinner.NumberEditor </item>
++      <item> JSplitPane </item>
++      <item> JTabbedPane </item>
++      <item> JTable </item>
++      <item> JTable.PrintMode </item>
++      <item> JTableHeader </item>
++      <item> JTextArea </item>
++      <item> JTextComponent </item>
++      <item> JTextComponent.KeyBinding </item>
++      <item> JTextField </item>
++      <item> JTextPane </item>
++      <item> JToggleButton </item>
++      <item> JToggleButton.ToggleButtonModel </item>
++      <item> JToolBar </item>
++      <item> JToolBar.Separator </item>
++      <item> JToolTip </item>
++      <item> JTree </item>
++      <item> JTree.DynamicUtilTreeNode </item>
++      <item> JTree.EmptySelectionModel </item>
++      <item> JViewport </item>
++      <item> JWindow </item>
++      <item> JarEntry </item>
++      <item> JarException </item>
++      <item> JarFile </item>
++      <item> JarInputStream </item>
++      <item> JarOutputStream </item>
++      <item> JarURLConnection </item>
++      <item> JdbcRowSet </item>
++      <item> JobAttributes </item>
++      <item> JobAttributes.DefaultSelectionType </item>
++      <item> JobAttributes.DestinationType </item>
++      <item> JobAttributes.DialogType </item>
++      <item> JobAttributes.MultipleDocumentHandlingType </item>
++      <item> JobAttributes.SidesType </item>
++      <item> JobHoldUntil </item>
++      <item> JobImpressions </item>
++      <item> JobImpressionsCompleted </item>
++      <item> JobImpressionsSupported </item>
++      <item> JobKOctets </item>
++      <item> JobKOctetsProcessed </item>
++      <item> JobKOctetsSupported </item>
++      <item> JobMediaSheets </item>
++      <item> JobMediaSheetsCompleted </item>
++      <item> JobMediaSheetsSupported </item>
++      <item> JobMessageFromOperator </item>
++      <item> JobName </item>
++      <item> JobOriginatingUserName </item>
++      <item> JobPriority </item>
++      <item> JobPrioritySupported </item>
++      <item> JobSheets </item>
++      <item> JobState </item>
++      <item> JobStateReason </item>
++      <item> JobStateReasons </item>
++      <item> JoinRowSet </item>
++      <item> Joinable </item>
++      <item> KerberosKey </item>
++      <item> KerberosPrincipal </item>
++      <item> KerberosTicket </item>
++      <item> Kernel </item>
++      <item> Key </item>
++      <item> KeyAdapter </item>
++      <item> KeyAgreement </item>
++      <item> KeyAgreementSpi </item>
++      <item> KeyAlreadyExistsException </item>
++      <item> KeyEvent </item>
++      <item> KeyEventDispatcher </item>
++      <item> KeyEventPostProcessor </item>
++      <item> KeyException </item>
++      <item> KeyFactory </item>
++      <item> KeyFactorySpi </item>
++      <item> KeyGenerator </item>
++      <item> KeyGeneratorSpi </item>
++      <item> KeyListener </item>
++      <item> KeyManagementException </item>
++      <item> KeyManager </item>
++      <item> KeyManagerFactory </item>
++      <item> KeyManagerFactorySpi </item>
++      <item> KeyPair </item>
++      <item> KeyPairGenerator </item>
++      <item> KeyPairGeneratorSpi </item>
++      <item> KeyRep </item>
++      <item> KeyRep.Type </item>
++      <item> KeySpec </item>
++      <item> KeyStore </item>
++      <item> KeyStore.Builder </item>
++      <item> KeyStore.CallbackHandlerProtection </item>
++      <item> KeyStore.Entry </item>
++      <item> KeyStore.LoadStoreParameter </item>
++      <item> KeyStore.PasswordProtection </item>
++      <item> KeyStore.PrivateKeyEntry </item>
++      <item> KeyStore.ProtectionParameter </item>
++      <item> KeyStore.SecretKeyEntry </item>
++      <item> KeyStore.TrustedCertificateEntry </item>
++      <item> KeyStoreBuilderParameters </item>
++      <item> KeyStoreException </item>
++      <item> KeyStoreSpi </item>
++      <item> KeyStroke </item>
++      <item> KeyboardFocusManager </item>
++      <item> Keymap </item>
++      <item> LDAPCertStoreParameters </item>
++      <item> LIFESPAN_POLICY_ID </item>
++      <item> LOCATION_FORWARD </item>
++      <item> LSException </item>
++      <item> LSInput </item>
++      <item> LSLoadEvent </item>
++      <item> LSOutput </item>
++      <item> LSParser </item>
++      <item> LSParserFilter </item>
++      <item> LSProgressEvent </item>
++      <item> LSResourceResolver </item>
++      <item> LSSerializer </item>
++      <item> LSSerializerFilter </item>
++      <item> Label </item>
++      <item> LabelUI </item>
++      <item> LabelView </item>
++      <item> LanguageCallback </item>
++      <item> LastOwnerException </item>
++      <item> LayeredHighlighter </item>
++      <item> LayeredHighlighter.LayerPainter </item>
++      <item> LayoutFocusTraversalPolicy </item>
++      <item> LayoutManager </item>
++      <item> LayoutManager2 </item>
++      <item> LayoutQueue </item>
++      <item> LdapContext </item>
++      <item> LdapName </item>
++      <item> LdapReferralException </item>
++      <item> Lease </item>
++      <item> Level </item>
++      <item> LexicalHandler </item>
++      <item> LifespanPolicy </item>
++      <item> LifespanPolicyOperations </item>
++      <item> LifespanPolicyValue </item>
++      <item> LimitExceededException </item>
++      <item> Line </item>
++      <item> Line.Info </item>
++      <item> Line2D </item>
++      <item> Line2D.Double </item>
++      <item> Line2D.Float </item>
++      <item> LineBorder </item>
++      <item> LineBreakMeasurer </item>
++      <item> LineEvent </item>
++      <item> LineEvent.Type </item>
++      <item> LineListener </item>
++      <item> LineMetrics </item>
++      <item> LineNumberInputStream </item>
++      <item> LineNumberReader </item>
++      <item> LineUnavailableException </item>
++      <item> LinkException </item>
++      <item> LinkLoopException </item>
++      <item> LinkRef </item>
++      <item> LinkageError </item>
++      <item> LinkedBlockingQueue </item>
++      <item> LinkedHashMap </item>
++      <item> LinkedHashSet </item>
++      <item> LinkedList </item>
++      <item> List </item>
++      <item> List </item>
++      <item> ListCellRenderer </item>
++      <item> ListDataEvent </item>
++      <item> ListDataListener </item>
++      <item> ListIterator </item>
++      <item> ListModel </item>
++      <item> ListResourceBundle </item>
++      <item> ListSelectionEvent </item>
++      <item> ListSelectionListener </item>
++      <item> ListSelectionModel </item>
++      <item> ListUI </item>
++      <item> ListView </item>
++      <item> ListenerNotFoundException </item>
++      <item> LoaderHandler </item>
++      <item> LocalObject </item>
++      <item> Locale </item>
++      <item> LocateRegistry </item>
++      <item> Locator </item>
++      <item> Locator2 </item>
++      <item> Locator2Impl </item>
++      <item> LocatorImpl </item>
++      <item> Lock </item>
++      <item> LockSupport </item>
++      <item> LogManager </item>
++      <item> LogRecord </item>
++      <item> LogStream </item>
++      <item> Logger </item>
++      <item> LoggingMXBean </item>
++      <item> LoggingPermission </item>
++      <item> LoginContext </item>
++      <item> LoginException </item>
++      <item> LoginModule </item>
++      <item> Long </item>
++      <item> LongBuffer </item>
++      <item> LongHolder </item>
++      <item> LongLongSeqHelper </item>
++      <item> LongLongSeqHolder </item>
++      <item> LongSeqHelper </item>
++      <item> LongSeqHolder </item>
++      <item> LookAndFeel </item>
++      <item> LookupOp </item>
++      <item> LookupTable </item>
++      <item> MARSHAL </item>
++      <item> MBeanAttributeInfo </item>
++      <item> MBeanConstructorInfo </item>
++      <item> MBeanException </item>
++      <item> MBeanFeatureInfo </item>
++      <item> MBeanInfo </item>
++      <item> MBeanNotificationInfo </item>
++      <item> MBeanOperationInfo </item>
++      <item> MBeanParameterInfo </item>
++      <item> MBeanPermission </item>
++      <item> MBeanRegistration </item>
++      <item> MBeanRegistrationException </item>
++      <item> MBeanServer </item>
++      <item> MBeanServerBuilder </item>
++      <item> MBeanServerConnection </item>
++      <item> MBeanServerDelegate </item>
++      <item> MBeanServerDelegateMBean </item>
++      <item> MBeanServerFactory </item>
++      <item> MBeanServerForwarder </item>
++      <item> MBeanServerInvocationHandler </item>
++      <item> MBeanServerNotification </item>
++      <item> MBeanServerNotificationFilter </item>
++      <item> MBeanServerPermission </item>
++      <item> MBeanTrustPermission </item>
++      <item> MGF1ParameterSpec </item>
++      <item> MLet </item>
++      <item> MLetMBean </item>
++      <item> Mac </item>
++      <item> MacSpi </item>
++      <item> MalformedInputException </item>
++      <item> MalformedLinkException </item>
++      <item> MalformedObjectNameException </item>
++      <item> MalformedParameterizedTypeException </item>
++      <item> MalformedURLException </item>
++      <item> ManageReferralControl </item>
++      <item> ManagementFactory </item>
++      <item> ManagementPermission </item>
++      <item> ManagerFactoryParameters </item>
++      <item> Manifest </item>
++      <item> Map </item>
++      <item> Map.Entry </item>
++      <item> MappedByteBuffer </item>
++      <item> MarshalException </item>
++      <item> MarshalledObject </item>
++      <item> MaskFormatter </item>
++      <item> MatchResult </item>
++      <item> Matcher </item>
++      <item> Math </item>
++      <item> MathContext </item>
++      <item> MatteBorder </item>
++      <item> Media </item>
++      <item> MediaName </item>
++      <item> MediaPrintableArea </item>
++      <item> MediaSize </item>
++      <item> MediaSize.Engineering </item>
++      <item> MediaSize.ISO </item>
++      <item> MediaSize.JIS </item>
++      <item> MediaSize.NA </item>
++      <item> MediaSize.Other </item>
++      <item> MediaSizeName </item>
++      <item> MediaTracker </item>
++      <item> MediaTray </item>
++      <item> Member </item>
++      <item> MemoryCacheImageInputStream </item>
++      <item> MemoryCacheImageOutputStream </item>
++      <item> MemoryHandler </item>
++      <item> MemoryImageSource </item>
++      <item> MemoryMXBean </item>
++      <item> MemoryManagerMXBean </item>
++      <item> MemoryNotificationInfo </item>
++      <item> MemoryPoolMXBean </item>
++      <item> MemoryType </item>
++      <item> MemoryUsage </item>
++      <item> Menu </item>
++      <item> MenuBar </item>
++      <item> MenuBarUI </item>
++      <item> MenuComponent </item>
++      <item> MenuContainer </item>
++      <item> MenuDragMouseEvent </item>
++      <item> MenuDragMouseListener </item>
++      <item> MenuElement </item>
++      <item> MenuEvent </item>
++      <item> MenuItem </item>
++      <item> MenuItemUI </item>
++      <item> MenuKeyEvent </item>
++      <item> MenuKeyListener </item>
++      <item> MenuListener </item>
++      <item> MenuSelectionManager </item>
++      <item> MenuShortcut </item>
++      <item> MessageDigest </item>
++      <item> MessageDigestSpi </item>
++      <item> MessageFormat </item>
++      <item> MessageFormat.Field </item>
++      <item> MessageProp </item>
++      <item> MetaEventListener </item>
++      <item> MetaMessage </item>
++      <item> MetalBorders </item>
++      <item> MetalBorders.ButtonBorder </item>
++      <item> MetalBorders.Flush3DBorder </item>
++      <item> MetalBorders.InternalFrameBorder </item>
++      <item> MetalBorders.MenuBarBorder </item>
++      <item> MetalBorders.MenuItemBorder </item>
++      <item> MetalBorders.OptionDialogBorder </item>
++      <item> MetalBorders.PaletteBorder </item>
++      <item> MetalBorders.PopupMenuBorder </item>
++      <item> MetalBorders.RolloverButtonBorder </item>
++      <item> MetalBorders.ScrollPaneBorder </item>
++      <item> MetalBorders.TableHeaderBorder </item>
++      <item> MetalBorders.TextFieldBorder </item>
++      <item> MetalBorders.ToggleButtonBorder </item>
++      <item> MetalBorders.ToolBarBorder </item>
++      <item> MetalButtonUI </item>
++      <item> MetalCheckBoxIcon </item>
++      <item> MetalCheckBoxUI </item>
++      <item> MetalComboBoxButton </item>
++      <item> MetalComboBoxEditor </item>
++      <item> MetalComboBoxEditor.UIResource </item>
++      <item> MetalComboBoxIcon </item>
++      <item> MetalComboBoxUI </item>
++      <item> MetalDesktopIconUI </item>
++      <item> MetalFileChooserUI </item>
++      <item> MetalIconFactory </item>
++      <item> MetalIconFactory.FileIcon16 </item>
++      <item> MetalIconFactory.FolderIcon16 </item>
++      <item> MetalIconFactory.PaletteCloseIcon </item>
++      <item> MetalIconFactory.TreeControlIcon </item>
++      <item> MetalIconFactory.TreeFolderIcon </item>
++      <item> MetalIconFactory.TreeLeafIcon </item>
++      <item> MetalInternalFrameTitlePane </item>
++      <item> MetalInternalFrameUI </item>
++      <item> MetalLabelUI </item>
++      <item> MetalLookAndFeel </item>
++      <item> MetalMenuBarUI </item>
++      <item> MetalPopupMenuSeparatorUI </item>
++      <item> MetalProgressBarUI </item>
++      <item> MetalRadioButtonUI </item>
++      <item> MetalRootPaneUI </item>
++      <item> MetalScrollBarUI </item>
++      <item> MetalScrollButton </item>
++      <item> MetalScrollPaneUI </item>
++      <item> MetalSeparatorUI </item>
++      <item> MetalSliderUI </item>
++      <item> MetalSplitPaneUI </item>
++      <item> MetalTabbedPaneUI </item>
++      <item> MetalTextFieldUI </item>
++      <item> MetalTheme </item>
++      <item> MetalToggleButtonUI </item>
++      <item> MetalToolBarUI </item>
++      <item> MetalToolTipUI </item>
++      <item> MetalTreeUI </item>
++      <item> Method </item>
++      <item> MethodDescriptor </item>
++      <item> MidiChannel </item>
++      <item> MidiDevice </item>
++      <item> MidiDevice.Info </item>
++      <item> MidiDeviceProvider </item>
++      <item> MidiEvent </item>
++      <item> MidiFileFormat </item>
++      <item> MidiFileReader </item>
++      <item> MidiFileWriter </item>
++      <item> MidiMessage </item>
++      <item> MidiSystem </item>
++      <item> MidiUnavailableException </item>
++      <item> MimeTypeParseException </item>
++      <item> MinimalHTMLWriter </item>
++      <item> MissingFormatArgumentException </item>
++      <item> MissingFormatWidthException </item>
++      <item> MissingResourceException </item>
++      <item> Mixer </item>
++      <item> Mixer.Info </item>
++      <item> MixerProvider </item>
++      <item> ModelMBean </item>
++      <item> ModelMBeanAttributeInfo </item>
++      <item> ModelMBeanConstructorInfo </item>
++      <item> ModelMBeanInfo </item>
++      <item> ModelMBeanInfoSupport </item>
++      <item> ModelMBeanNotificationBroadcaster </item>
++      <item> ModelMBeanNotificationInfo </item>
++      <item> ModelMBeanOperationInfo </item>
++      <item> ModificationItem </item>
++      <item> Modifier </item>
++      <item> Monitor </item>
++      <item> MonitorMBean </item>
++      <item> MonitorNotification </item>
++      <item> MonitorSettingException </item>
++      <item> MouseAdapter </item>
++      <item> MouseDragGestureRecognizer </item>
++      <item> MouseEvent </item>
++      <item> MouseInfo </item>
++      <item> MouseInputAdapter </item>
++      <item> MouseInputListener </item>
++      <item> MouseListener </item>
++      <item> MouseMotionAdapter </item>
++      <item> MouseMotionListener </item>
++      <item> MouseWheelEvent </item>
++      <item> MouseWheelListener </item>
++      <item> MultiButtonUI </item>
++      <item> MultiColorChooserUI </item>
++      <item> MultiComboBoxUI </item>
++      <item> MultiDesktopIconUI </item>
++      <item> MultiDesktopPaneUI </item>
++      <item> MultiDoc </item>
++      <item> MultiDocPrintJob </item>
++      <item> MultiDocPrintService </item>
++      <item> MultiFileChooserUI </item>
++      <item> MultiInternalFrameUI </item>
++      <item> MultiLabelUI </item>
++      <item> MultiListUI </item>
++      <item> MultiLookAndFeel </item>
++      <item> MultiMenuBarUI </item>
++      <item> MultiMenuItemUI </item>
++      <item> MultiOptionPaneUI </item>
++      <item> MultiPanelUI </item>
++      <item> MultiPixelPackedSampleModel </item>
++      <item> MultiPopupMenuUI </item>
++      <item> MultiProgressBarUI </item>
++      <item> MultiRootPaneUI </item>
++      <item> MultiScrollBarUI </item>
++      <item> MultiScrollPaneUI </item>
++      <item> MultiSeparatorUI </item>
++      <item> MultiSliderUI </item>
++      <item> MultiSpinnerUI </item>
++      <item> MultiSplitPaneUI </item>
++      <item> MultiTabbedPaneUI </item>
++      <item> MultiTableHeaderUI </item>
++      <item> MultiTableUI </item>
++      <item> MultiTextUI </item>
++      <item> MultiToolBarUI </item>
++      <item> MultiToolTipUI </item>
++      <item> MultiTreeUI </item>
++      <item> MultiViewportUI </item>
++      <item> MulticastSocket </item>
++      <item> MultipleComponentProfileHelper </item>
++      <item> MultipleComponentProfileHolder </item>
++      <item> MultipleDocumentHandling </item>
++      <item> MultipleMaster </item>
++      <item> MutableAttributeSet </item>
++      <item> MutableComboBoxModel </item>
++      <item> MutableTreeNode </item>
++      <item> NON_EXISTENT </item>
++      <item> NO_IMPLEMENT </item>
++      <item> NO_MEMORY </item>
++      <item> NO_PERMISSION </item>
++      <item> NO_RESOURCES </item>
++      <item> NO_RESPONSE </item>
++      <item> NVList </item>
++      <item> Name </item>
++      <item> NameAlreadyBoundException </item>
++      <item> NameCallback </item>
++      <item> NameClassPair </item>
++      <item> NameComponent </item>
++      <item> NameComponentHelper </item>
++      <item> NameComponentHolder </item>
++      <item> NameDynAnyPair </item>
++      <item> NameDynAnyPairHelper </item>
++      <item> NameDynAnyPairSeqHelper </item>
++      <item> NameHelper </item>
++      <item> NameHolder </item>
++      <item> NameList </item>
++      <item> NameNotFoundException </item>
++      <item> NameParser </item>
++      <item> NameValuePair </item>
++      <item> NameValuePair </item>
++      <item> NameValuePairHelper </item>
++      <item> NameValuePairHelper </item>
++      <item> NameValuePairSeqHelper </item>
++      <item> NamedNodeMap </item>
++      <item> NamedValue </item>
++      <item> NamespaceChangeListener </item>
++      <item> NamespaceContext </item>
++      <item> NamespaceSupport </item>
++      <item> Naming </item>
++      <item> NamingContext </item>
++      <item> NamingContextExt </item>
++      <item> NamingContextExtHelper </item>
++      <item> NamingContextExtHolder </item>
++      <item> NamingContextExtOperations </item>
++      <item> NamingContextExtPOA </item>
++      <item> NamingContextHelper </item>
++      <item> NamingContextHolder </item>
++      <item> NamingContextOperations </item>
++      <item> NamingContextPOA </item>
++      <item> NamingEnumeration </item>
++      <item> NamingEvent </item>
++      <item> NamingException </item>
++      <item> NamingExceptionEvent </item>
++      <item> NamingListener </item>
++      <item> NamingManager </item>
++      <item> NamingSecurityException </item>
++      <item> NavigationFilter </item>
++      <item> NavigationFilter.FilterBypass </item>
++      <item> NegativeArraySizeException </item>
++      <item> NetPermission </item>
++      <item> NetworkInterface </item>
++      <item> NoClassDefFoundError </item>
++      <item> NoConnectionPendingException </item>
++      <item> NoContext </item>
++      <item> NoContextHelper </item>
++      <item> NoInitialContextException </item>
++      <item> NoPermissionException </item>
++      <item> NoRouteToHostException </item>
++      <item> NoServant </item>
++      <item> NoServantHelper </item>
++      <item> NoSuchAlgorithmException </item>
++      <item> NoSuchAttributeException </item>
++      <item> NoSuchElementException </item>
++      <item> NoSuchFieldError </item>
++      <item> NoSuchFieldException </item>
++      <item> NoSuchMethodError </item>
++      <item> NoSuchMethodException </item>
++      <item> NoSuchObjectException </item>
++      <item> NoSuchPaddingException </item>
++      <item> NoSuchProviderException </item>
++      <item> Node </item>
++      <item> NodeChangeEvent </item>
++      <item> NodeChangeListener </item>
++      <item> NodeList </item>
++      <item> NonReadableChannelException </item>
++      <item> NonWritableChannelException </item>
++      <item> NoninvertibleTransformException </item>
++      <item> NotActiveException </item>
++      <item> NotBoundException </item>
++      <item> NotCompliantMBeanException </item>
++      <item> NotContextException </item>
++      <item> NotEmpty </item>
++      <item> NotEmptyHelper </item>
++      <item> NotEmptyHolder </item>
++      <item> NotFound </item>
++      <item> NotFoundHelper </item>
++      <item> NotFoundHolder </item>
++      <item> NotFoundReason </item>
++      <item> NotFoundReasonHelper </item>
++      <item> NotFoundReasonHolder </item>
++      <item> NotOwnerException </item>
++      <item> NotSerializableException </item>
++      <item> NotYetBoundException </item>
++      <item> NotYetConnectedException </item>
++      <item> Notation </item>
++      <item> Notification </item>
++      <item> NotificationBroadcaster </item>
++      <item> NotificationBroadcasterSupport </item>
++      <item> NotificationEmitter </item>
++      <item> NotificationFilter </item>
++      <item> NotificationFilterSupport </item>
++      <item> NotificationListener </item>
++      <item> NotificationResult </item>
++      <item> NullCipher </item>
++      <item> NullPointerException </item>
++      <item> Number </item>
++      <item> NumberFormat </item>
++      <item> NumberFormat.Field </item>
++      <item> NumberFormatException </item>
++      <item> NumberFormatter </item>
++      <item> NumberOfDocuments </item>
++      <item> NumberOfInterveningJobs </item>
++      <item> NumberUp </item>
++      <item> NumberUpSupported </item>
++      <item> NumericShaper </item>
++      <item> OAEPParameterSpec </item>
++      <item> OBJECT_NOT_EXIST </item>
++      <item> OBJ_ADAPTER </item>
++      <item> OMGVMCID </item>
++      <item> ORB </item>
++      <item> ORB </item>
++      <item> ORBIdHelper </item>
++      <item> ORBInitInfo </item>
++      <item> ORBInitInfoOperations </item>
++      <item> ORBInitializer </item>
++      <item> ORBInitializerOperations </item>
++      <item> ObjID </item>
++      <item> Object </item>
++      <item> Object </item>
++      <item> ObjectAlreadyActive </item>
++      <item> ObjectAlreadyActiveHelper </item>
++      <item> ObjectChangeListener </item>
++      <item> ObjectFactory </item>
++      <item> ObjectFactoryBuilder </item>
++      <item> ObjectHelper </item>
++      <item> ObjectHolder </item>
++      <item> ObjectIdHelper </item>
++      <item> ObjectIdHelper </item>
++      <item> ObjectImpl </item>
++      <item> ObjectImpl </item>
++      <item> ObjectInput </item>
++      <item> ObjectInputStream </item>
++      <item> ObjectInputStream.GetField </item>
++      <item> ObjectInputValidation </item>
++      <item> ObjectInstance </item>
++      <item> ObjectName </item>
++      <item> ObjectNotActive </item>
++      <item> ObjectNotActiveHelper </item>
++      <item> ObjectOutput </item>
++      <item> ObjectOutputStream </item>
++      <item> ObjectOutputStream.PutField </item>
++      <item> ObjectReferenceFactory </item>
++      <item> ObjectReferenceFactoryHelper </item>
++      <item> ObjectReferenceFactoryHolder </item>
++      <item> ObjectReferenceTemplate </item>
++      <item> ObjectReferenceTemplateHelper </item>
++      <item> ObjectReferenceTemplateHolder </item>
++      <item> ObjectReferenceTemplateSeqHelper </item>
++      <item> ObjectReferenceTemplateSeqHolder </item>
++      <item> ObjectStreamClass </item>
++      <item> ObjectStreamConstants </item>
++      <item> ObjectStreamException </item>
++      <item> ObjectStreamField </item>
++      <item> ObjectView </item>
++      <item> Observable </item>
++      <item> Observer </item>
++      <item> OceanTheme </item>
++      <item> OctetSeqHelper </item>
++      <item> OctetSeqHolder </item>
++      <item> Oid </item>
++      <item> OpenDataException </item>
++      <item> OpenMBeanAttributeInfo </item>
++      <item> OpenMBeanAttributeInfoSupport </item>
++      <item> OpenMBeanConstructorInfo </item>
++      <item> OpenMBeanConstructorInfoSupport </item>
++      <item> OpenMBeanInfo </item>
++      <item> OpenMBeanInfoSupport </item>
++      <item> OpenMBeanOperationInfo </item>
++      <item> OpenMBeanOperationInfoSupport </item>
++      <item> OpenMBeanParameterInfo </item>
++      <item> OpenMBeanParameterInfoSupport </item>
++      <item> OpenType </item>
++      <item> OpenType </item>
++      <item> OperatingSystemMXBean </item>
++      <item> Operation </item>
++      <item> OperationNotSupportedException </item>
++      <item> OperationsException </item>
++      <item> Option </item>
++      <item> OptionPaneUI </item>
++      <item> OptionalDataException </item>
++      <item> OrientationRequested </item>
++      <item> OutOfMemoryError </item>
++      <item> OutputDeviceAssigned </item>
++      <item> OutputKeys </item>
++      <item> OutputStream </item>
++      <item> OutputStream </item>
++      <item> OutputStream </item>
++      <item> OutputStreamWriter </item>
++      <item> OverlappingFileLockException </item>
++      <item> OverlayLayout </item>
++      <item> Override </item>
++      <item> Owner </item>
++      <item> PBEKey </item>
++      <item> PBEKeySpec </item>
++      <item> PBEParameterSpec </item>
++      <item> PDLOverrideSupported </item>
++      <item> PERSIST_STORE </item>
++      <item> PKCS8EncodedKeySpec </item>
++      <item> PKIXBuilderParameters </item>
++      <item> PKIXCertPathBuilderResult </item>
++      <item> PKIXCertPathChecker </item>
++      <item> PKIXCertPathValidatorResult </item>
++      <item> PKIXParameters </item>
++      <item> POA </item>
++      <item> POAHelper </item>
++      <item> POAManager </item>
++      <item> POAManagerOperations </item>
++      <item> POAOperations </item>
++      <item> PRIVATE_MEMBER </item>
++      <item> PSSParameterSpec </item>
++      <item> PSource </item>
++      <item> PSource.PSpecified </item>
++      <item> PUBLIC_MEMBER </item>
++      <item> Pack200 </item>
++      <item> Pack200.Packer </item>
++      <item> Pack200.Unpacker </item>
++      <item> Package </item>
++      <item> PackedColorModel </item>
++      <item> PageAttributes </item>
++      <item> PageAttributes.ColorType </item>
++      <item> PageAttributes.MediaType </item>
++      <item> PageAttributes.OrientationRequestedType </item>
++      <item> PageAttributes.OriginType </item>
++      <item> PageAttributes.PrintQualityType </item>
++      <item> PageFormat </item>
++      <item> PageRanges </item>
++      <item> Pageable </item>
++      <item> PagedResultsControl </item>
++      <item> PagedResultsResponseControl </item>
++      <item> PagesPerMinute </item>
++      <item> PagesPerMinuteColor </item>
++      <item> Paint </item>
++      <item> PaintContext </item>
++      <item> PaintEvent </item>
++      <item> Panel </item>
++      <item> PanelUI </item>
++      <item> Paper </item>
++      <item> ParagraphView </item>
++      <item> ParagraphView </item>
++      <item> Parameter </item>
++      <item> ParameterBlock </item>
++      <item> ParameterDescriptor </item>
++      <item> ParameterMetaData </item>
++      <item> ParameterMode </item>
++      <item> ParameterModeHelper </item>
++      <item> ParameterModeHolder </item>
++      <item> ParameterizedType </item>
++      <item> ParseException </item>
++      <item> ParsePosition </item>
++      <item> Parser </item>
++      <item> Parser </item>
++      <item> ParserAdapter </item>
++      <item> ParserConfigurationException </item>
++      <item> ParserDelegator </item>
++      <item> ParserFactory </item>
++      <item> PartialResultException </item>
++      <item> PasswordAuthentication </item>
++      <item> PasswordCallback </item>
++      <item> PasswordView </item>
++      <item> Patch </item>
++      <item> PathIterator </item>
++      <item> Pattern </item>
++      <item> PatternSyntaxException </item>
++      <item> Permission </item>
++      <item> Permission </item>
++      <item> PermissionCollection </item>
++      <item> Permissions </item>
++      <item> PersistenceDelegate </item>
++      <item> PersistentMBean </item>
++      <item> PhantomReference </item>
++      <item> Pipe </item>
++      <item> Pipe.SinkChannel </item>
++      <item> Pipe.SourceChannel </item>
++      <item> PipedInputStream </item>
++      <item> PipedOutputStream </item>
++      <item> PipedReader </item>
++      <item> PipedWriter </item>
++      <item> PixelGrabber </item>
++      <item> PixelInterleavedSampleModel </item>
++      <item> PlainDocument </item>
++      <item> PlainView </item>
++      <item> Point </item>
++      <item> Point2D </item>
++      <item> Point2D.Double </item>
++      <item> Point2D.Float </item>
++      <item> PointerInfo </item>
++      <item> Policy </item>
++      <item> Policy </item>
++      <item> Policy </item>
++      <item> PolicyError </item>
++      <item> PolicyErrorCodeHelper </item>
++      <item> PolicyErrorHelper </item>
++      <item> PolicyErrorHolder </item>
++      <item> PolicyFactory </item>
++      <item> PolicyFactoryOperations </item>
++      <item> PolicyHelper </item>
++      <item> PolicyHolder </item>
++      <item> PolicyListHelper </item>
++      <item> PolicyListHolder </item>
++      <item> PolicyNode </item>
++      <item> PolicyOperations </item>
++      <item> PolicyQualifierInfo </item>
++      <item> PolicyTypeHelper </item>
++      <item> Polygon </item>
++      <item> PooledConnection </item>
++      <item> Popup </item>
++      <item> PopupFactory </item>
++      <item> PopupMenu </item>
++      <item> PopupMenuEvent </item>
++      <item> PopupMenuListener </item>
++      <item> PopupMenuUI </item>
++      <item> Port </item>
++      <item> Port.Info </item>
++      <item> PortUnreachableException </item>
++      <item> PortableRemoteObject </item>
++      <item> PortableRemoteObjectDelegate </item>
++      <item> Position </item>
++      <item> Position.Bias </item>
++      <item> Predicate </item>
++      <item> PreferenceChangeEvent </item>
++      <item> PreferenceChangeListener </item>
++      <item> Preferences </item>
++      <item> PreferencesFactory </item>
++      <item> PreparedStatement </item>
++      <item> PresentationDirection </item>
++      <item> Principal </item>
++      <item> Principal </item>
++      <item> PrincipalHolder </item>
++      <item> PrintEvent </item>
++      <item> PrintException </item>
++      <item> PrintGraphics </item>
++      <item> PrintJob </item>
++      <item> PrintJobAdapter </item>
++      <item> PrintJobAttribute </item>
++      <item> PrintJobAttributeEvent </item>
++      <item> PrintJobAttributeListener </item>
++      <item> PrintJobAttributeSet </item>
++      <item> PrintJobEvent </item>
++      <item> PrintJobListener </item>
++      <item> PrintQuality </item>
++      <item> PrintRequestAttribute </item>
++      <item> PrintRequestAttributeSet </item>
++      <item> PrintService </item>
++      <item> PrintServiceAttribute </item>
++      <item> PrintServiceAttributeEvent </item>
++      <item> PrintServiceAttributeListener </item>
++      <item> PrintServiceAttributeSet </item>
++      <item> PrintServiceLookup </item>
++      <item> PrintStream </item>
++      <item> PrintWriter </item>
++      <item> Printable </item>
++      <item> PrinterAbortException </item>
++      <item> PrinterException </item>
++      <item> PrinterGraphics </item>
++      <item> PrinterIOException </item>
++      <item> PrinterInfo </item>
++      <item> PrinterIsAcceptingJobs </item>
++      <item> PrinterJob </item>
++      <item> PrinterLocation </item>
++      <item> PrinterMakeAndModel </item>
++      <item> PrinterMessageFromOperator </item>
++      <item> PrinterMoreInfo </item>
++      <item> PrinterMoreInfoManufacturer </item>
++      <item> PrinterName </item>
++      <item> PrinterResolution </item>
++      <item> PrinterState </item>
++      <item> PrinterStateReason </item>
++      <item> PrinterStateReasons </item>
++      <item> PrinterURI </item>
++      <item> PriorityBlockingQueue </item>
++      <item> PriorityQueue </item>
++      <item> PrivateClassLoader </item>
++      <item> PrivateCredentialPermission </item>
++      <item> PrivateKey </item>
++      <item> PrivateMLet </item>
++      <item> PrivilegedAction </item>
++      <item> PrivilegedActionException </item>
++      <item> PrivilegedExceptionAction </item>
++      <item> Process </item>
++      <item> ProcessBuilder </item>
++      <item> ProcessingInstruction </item>
++      <item> ProfileDataException </item>
++      <item> ProfileIdHelper </item>
++      <item> ProgressBarUI </item>
++      <item> ProgressMonitor </item>
++      <item> ProgressMonitorInputStream </item>
++      <item> Properties </item>
++      <item> PropertyChangeEvent </item>
++      <item> PropertyChangeListener </item>
++      <item> PropertyChangeListenerProxy </item>
++      <item> PropertyChangeSupport </item>
++      <item> PropertyDescriptor </item>
++      <item> PropertyEditor </item>
++      <item> PropertyEditorManager </item>
++      <item> PropertyEditorSupport </item>
++      <item> PropertyPermission </item>
++      <item> PropertyResourceBundle </item>
++      <item> PropertyVetoException </item>
++      <item> ProtectionDomain </item>
++      <item> ProtocolException </item>
++      <item> Provider </item>
++      <item> Provider.Service </item>
++      <item> ProviderException </item>
++      <item> Proxy </item>
++      <item> Proxy </item>
++      <item> Proxy.Type </item>
++      <item> ProxySelector </item>
++      <item> PublicKey </item>
++      <item> PushbackInputStream </item>
++      <item> PushbackReader </item>
++      <item> QName </item>
++      <item> QuadCurve2D </item>
++      <item> QuadCurve2D.Double </item>
++      <item> QuadCurve2D.Float </item>
++      <item> Query </item>
++      <item> QueryEval </item>
++      <item> QueryExp </item>
++      <item> Queue </item>
++      <item> QueuedJobCount </item>
++      <item> RC2ParameterSpec </item>
++      <item> RC5ParameterSpec </item>
++      <item> REBIND </item>
++      <item> REQUEST_PROCESSING_POLICY_ID </item>
++      <item> RGBImageFilter </item>
++      <item> RMIClassLoader </item>
++      <item> RMIClassLoaderSpi </item>
++      <item> RMIClientSocketFactory </item>
++      <item> RMIConnection </item>
++      <item> RMIConnectionImpl </item>
++      <item> RMIConnectionImpl_Stub </item>
++      <item> RMIConnector </item>
++      <item> RMIConnectorServer </item>
++      <item> RMICustomMaxStreamFormat </item>
++      <item> RMIFailureHandler </item>
++      <item> RMIIIOPServerImpl </item>
++      <item> RMIJRMPServerImpl </item>
++      <item> RMISecurityException </item>
++      <item> RMISecurityManager </item>
++      <item> RMIServer </item>
++      <item> RMIServerImpl </item>
++      <item> RMIServerImpl_Stub </item>
++      <item> RMIServerSocketFactory </item>
++      <item> RMISocketFactory </item>
++      <item> RSAKey </item>
++      <item> RSAKeyGenParameterSpec </item>
++      <item> RSAMultiPrimePrivateCrtKey </item>
++      <item> RSAMultiPrimePrivateCrtKeySpec </item>
++      <item> RSAOtherPrimeInfo </item>
++      <item> RSAPrivateCrtKey </item>
++      <item> RSAPrivateCrtKeySpec </item>
++      <item> RSAPrivateKey </item>
++      <item> RSAPrivateKeySpec </item>
++      <item> RSAPublicKey </item>
++      <item> RSAPublicKeySpec </item>
++      <item> RTFEditorKit </item>
++      <item> Random </item>
++      <item> RandomAccess </item>
++      <item> RandomAccessFile </item>
++      <item> Raster </item>
++      <item> RasterFormatException </item>
++      <item> RasterOp </item>
++      <item> Rdn </item>
++      <item> ReadOnlyBufferException </item>
++      <item> ReadWriteLock </item>
++      <item> Readable </item>
++      <item> ReadableByteChannel </item>
++      <item> Reader </item>
++      <item> RealmCallback </item>
++      <item> RealmChoiceCallback </item>
++      <item> Receiver </item>
++      <item> Rectangle </item>
++      <item> Rectangle2D </item>
++      <item> Rectangle2D.Double </item>
++      <item> Rectangle2D.Float </item>
++      <item> RectangularShape </item>
++      <item> ReentrantLock </item>
++      <item> ReentrantReadWriteLock </item>
++      <item> ReentrantReadWriteLock.ReadLock </item>
++      <item> ReentrantReadWriteLock.WriteLock </item>
++      <item> Ref </item>
++      <item> RefAddr </item>
++      <item> Reference </item>
++      <item> Reference </item>
++      <item> ReferenceQueue </item>
++      <item> ReferenceUriSchemesSupported </item>
++      <item> Referenceable </item>
++      <item> ReferralException </item>
++      <item> ReflectPermission </item>
++      <item> ReflectionException </item>
++      <item> RefreshFailedException </item>
++      <item> Refreshable </item>
++      <item> Region </item>
++      <item> RegisterableService </item>
++      <item> Registry </item>
++      <item> RegistryHandler </item>
++      <item> RejectedExecutionException </item>
++      <item> RejectedExecutionHandler </item>
++      <item> Relation </item>
++      <item> RelationException </item>
++      <item> RelationNotFoundException </item>
++      <item> RelationNotification </item>
++      <item> RelationService </item>
++      <item> RelationServiceMBean </item>
++      <item> RelationServiceNotRegisteredException </item>
++      <item> RelationSupport </item>
++      <item> RelationSupportMBean </item>
++      <item> RelationType </item>
++      <item> RelationTypeNotFoundException </item>
++      <item> RelationTypeSupport </item>
++      <item> RemarshalException </item>
++      <item> Remote </item>
++      <item> RemoteCall </item>
++      <item> RemoteException </item>
++      <item> RemoteObject </item>
++      <item> RemoteObjectInvocationHandler </item>
++      <item> RemoteRef </item>
++      <item> RemoteServer </item>
++      <item> RemoteStub </item>
++      <item> RenderContext </item>
++      <item> RenderableImage </item>
++      <item> RenderableImageOp </item>
++      <item> RenderableImageProducer </item>
++      <item> RenderedImage </item>
++      <item> RenderedImageFactory </item>
++      <item> Renderer </item>
++      <item> RenderingHints </item>
++      <item> RenderingHints.Key </item>
++      <item> RepaintManager </item>
++      <item> ReplicateScaleFilter </item>
++      <item> RepositoryIdHelper </item>
++      <item> Request </item>
++      <item> RequestInfo </item>
++      <item> RequestInfoOperations </item>
++      <item> RequestProcessingPolicy </item>
++      <item> RequestProcessingPolicyOperations </item>
++      <item> RequestProcessingPolicyValue </item>
++      <item> RequestingUserName </item>
++      <item> RequiredModelMBean </item>
++      <item> RescaleOp </item>
++      <item> ResolutionSyntax </item>
++      <item> ResolveResult </item>
++      <item> Resolver </item>
++      <item> ResourceBundle </item>
++      <item> ResponseCache </item>
++      <item> ResponseHandler </item>
++      <item> Result </item>
++      <item> ResultSet </item>
++      <item> ResultSetMetaData </item>
++      <item> Retention </item>
++      <item> RetentionPolicy </item>
++      <item> ReverbType </item>
++      <item> Robot </item>
++      <item> Role </item>
++      <item> RoleInfo </item>
++      <item> RoleInfoNotFoundException </item>
++      <item> RoleList </item>
++      <item> RoleNotFoundException </item>
++      <item> RoleResult </item>
++      <item> RoleStatus </item>
++      <item> RoleUnresolved </item>
++      <item> RoleUnresolvedList </item>
++      <item> RootPaneContainer </item>
++      <item> RootPaneUI </item>
++      <item> RoundRectangle2D </item>
++      <item> RoundRectangle2D.Double </item>
++      <item> RoundRectangle2D.Float </item>
++      <item> RoundingMode </item>
++      <item> RowMapper </item>
++      <item> RowSet </item>
++      <item> RowSetEvent </item>
++      <item> RowSetInternal </item>
++      <item> RowSetListener </item>
++      <item> RowSetMetaData </item>
++      <item> RowSetMetaDataImpl </item>
++      <item> RowSetReader </item>
++      <item> RowSetWarning </item>
++      <item> RowSetWriter </item>
++      <item> RuleBasedCollator </item>
++      <item> RunTime </item>
++      <item> RunTimeOperations </item>
++      <item> Runnable </item>
++      <item> Runtime </item>
++      <item> RuntimeErrorException </item>
++      <item> RuntimeException </item>
++      <item> RuntimeMBeanException </item>
++      <item> RuntimeMXBean </item>
++      <item> RuntimeOperationsException </item>
++      <item> RuntimePermission </item>
++      <item> SAXException </item>
++      <item> SAXNotRecognizedException </item>
++      <item> SAXNotSupportedException </item>
++      <item> SAXParseException </item>
++      <item> SAXParser </item>
++      <item> SAXParserFactory </item>
++      <item> SAXResult </item>
++      <item> SAXSource </item>
++      <item> SAXTransformerFactory </item>
++      <item> SERVANT_RETENTION_POLICY_ID </item>
++      <item> SQLData </item>
++      <item> SQLException </item>
++      <item> SQLInput </item>
++      <item> SQLInputImpl </item>
++      <item> SQLOutput </item>
++      <item> SQLOutputImpl </item>
++      <item> SQLPermission </item>
++      <item> SQLWarning </item>
++      <item> SSLContext </item>
++      <item> SSLContextSpi </item>
++      <item> SSLEngine </item>
++      <item> SSLEngineResult </item>
++      <item> SSLEngineResult.HandshakeStatus </item>
++      <item> SSLEngineResult.Status </item>
++      <item> SSLException </item>
++      <item> SSLHandshakeException </item>
++      <item> SSLKeyException </item>
++      <item> SSLPeerUnverifiedException </item>
++      <item> SSLPermission </item>
++      <item> SSLProtocolException </item>
++      <item> SSLServerSocket </item>
++      <item> SSLServerSocketFactory </item>
++      <item> SSLSession </item>
++      <item> SSLSessionBindingEvent </item>
++      <item> SSLSessionBindingListener </item>
++      <item> SSLSessionContext </item>
++      <item> SSLSocket </item>
++      <item> SSLSocketFactory </item>
++      <item> SUCCESSFUL </item>
++      <item> SYNC_WITH_TRANSPORT </item>
++      <item> SYSTEM_EXCEPTION </item>
++      <item> SampleModel </item>
++      <item> Sasl </item>
++      <item> SaslClient </item>
++      <item> SaslClientFactory </item>
++      <item> SaslException </item>
++      <item> SaslServer </item>
++      <item> SaslServerFactory </item>
++      <item> Savepoint </item>
++      <item> Scanner </item>
++      <item> ScatteringByteChannel </item>
++      <item> ScheduledExecutorService </item>
++      <item> ScheduledFuture </item>
++      <item> ScheduledThreadPoolExecutor </item>
++      <item> Schema </item>
++      <item> SchemaFactory </item>
++      <item> SchemaFactoryLoader </item>
++      <item> SchemaViolationException </item>
++      <item> ScrollBarUI </item>
++      <item> ScrollPane </item>
++      <item> ScrollPaneAdjustable </item>
++      <item> ScrollPaneConstants </item>
++      <item> ScrollPaneLayout </item>
++      <item> ScrollPaneLayout.UIResource </item>
++      <item> ScrollPaneUI </item>
++      <item> Scrollable </item>
++      <item> Scrollbar </item>
++      <item> SealedObject </item>
++      <item> SearchControls </item>
++      <item> SearchResult </item>
++      <item> SecretKey </item>
++      <item> SecretKeyFactory </item>
++      <item> SecretKeyFactorySpi </item>
++      <item> SecretKeySpec </item>
++      <item> SecureCacheResponse </item>
++      <item> SecureClassLoader </item>
++      <item> SecureRandom </item>
++      <item> SecureRandomSpi </item>
++      <item> Security </item>
++      <item> SecurityException </item>
++      <item> SecurityManager </item>
++      <item> SecurityPermission </item>
++      <item> Segment </item>
++      <item> SelectableChannel </item>
++      <item> SelectionKey </item>
++      <item> Selector </item>
++      <item> SelectorProvider </item>
++      <item> Semaphore </item>
++      <item> SeparatorUI </item>
++      <item> Sequence </item>
++      <item> SequenceInputStream </item>
++      <item> Sequencer </item>
++      <item> Sequencer.SyncMode </item>
++      <item> SerialArray </item>
++      <item> SerialBlob </item>
++      <item> SerialClob </item>
++      <item> SerialDatalink </item>
++      <item> SerialException </item>
++      <item> SerialJavaObject </item>
++      <item> SerialRef </item>
++      <item> SerialStruct </item>
++      <item> Serializable </item>
++      <item> SerializablePermission </item>
++      <item> Servant </item>
++      <item> ServantActivator </item>
++      <item> ServantActivatorHelper </item>
++      <item> ServantActivatorOperations </item>
++      <item> ServantActivatorPOA </item>
++      <item> ServantAlreadyActive </item>
++      <item> ServantAlreadyActiveHelper </item>
++      <item> ServantLocator </item>
++      <item> ServantLocatorHelper </item>
++      <item> ServantLocatorOperations </item>
++      <item> ServantLocatorPOA </item>
++      <item> ServantManager </item>
++      <item> ServantManagerOperations </item>
++      <item> ServantNotActive </item>
++      <item> ServantNotActiveHelper </item>
++      <item> ServantObject </item>
++      <item> ServantRetentionPolicy </item>
++      <item> ServantRetentionPolicyOperations </item>
++      <item> ServantRetentionPolicyValue </item>
++      <item> ServerCloneException </item>
++      <item> ServerError </item>
++      <item> ServerException </item>
++      <item> ServerIdHelper </item>
++      <item> ServerNotActiveException </item>
++      <item> ServerRef </item>
++      <item> ServerRequest </item>
++      <item> ServerRequestInfo </item>
++      <item> ServerRequestInfoOperations </item>
++      <item> ServerRequestInterceptor </item>
++      <item> ServerRequestInterceptorOperations </item>
++      <item> ServerRuntimeException </item>
++      <item> ServerSocket </item>
++      <item> ServerSocketChannel </item>
++      <item> ServerSocketFactory </item>
++      <item> ServiceContext </item>
++      <item> ServiceContextHelper </item>
++      <item> ServiceContextHolder </item>
++      <item> ServiceContextListHelper </item>
++      <item> ServiceContextListHolder </item>
++      <item> ServiceDetail </item>
++      <item> ServiceDetailHelper </item>
++      <item> ServiceIdHelper </item>
++      <item> ServiceInformation </item>
++      <item> ServiceInformationHelper </item>
++      <item> ServiceInformationHolder </item>
++      <item> ServiceNotFoundException </item>
++      <item> ServicePermission </item>
++      <item> ServiceRegistry </item>
++      <item> ServiceRegistry.Filter </item>
++      <item> ServiceUI </item>
++      <item> ServiceUIFactory </item>
++      <item> ServiceUnavailableException </item>
++      <item> Set </item>
++      <item> SetOfIntegerSyntax </item>
++      <item> SetOverrideType </item>
++      <item> SetOverrideTypeHelper </item>
++      <item> Severity </item>
++      <item> Shape </item>
++      <item> ShapeGraphicAttribute </item>
++      <item> SheetCollate </item>
++      <item> Short </item>
++      <item> ShortBuffer </item>
++      <item> ShortBufferException </item>
++      <item> ShortHolder </item>
++      <item> ShortLookupTable </item>
++      <item> ShortMessage </item>
++      <item> ShortSeqHelper </item>
++      <item> ShortSeqHolder </item>
++      <item> Sides </item>
++      <item> Signature </item>
++      <item> SignatureException </item>
++      <item> SignatureSpi </item>
++      <item> SignedObject </item>
++      <item> Signer </item>
++      <item> SimpleAttributeSet </item>
++      <item> SimpleBeanInfo </item>
++      <item> SimpleDateFormat </item>
++      <item> SimpleDoc </item>
++      <item> SimpleFormatter </item>
++      <item> SimpleTimeZone </item>
++      <item> SimpleType </item>
++      <item> SinglePixelPackedSampleModel </item>
++      <item> SingleSelectionModel </item>
++      <item> Size2DSyntax </item>
++      <item> SizeLimitExceededException </item>
++      <item> SizeRequirements </item>
++      <item> SizeSequence </item>
++      <item> Skeleton </item>
++      <item> SkeletonMismatchException </item>
++      <item> SkeletonNotFoundException </item>
++      <item> SliderUI </item>
++      <item> Socket </item>
++      <item> SocketAddress </item>
++      <item> SocketChannel </item>
++      <item> SocketException </item>
++      <item> SocketFactory </item>
++      <item> SocketHandler </item>
++      <item> SocketImpl </item>
++      <item> SocketImplFactory </item>
++      <item> SocketOptions </item>
++      <item> SocketPermission </item>
++      <item> SocketSecurityException </item>
++      <item> SocketTimeoutException </item>
++      <item> SoftBevelBorder </item>
++      <item> SoftReference </item>
++      <item> SortControl </item>
++      <item> SortKey </item>
++      <item> SortResponseControl </item>
++      <item> SortedMap </item>
++      <item> SortedSet </item>
++      <item> SortingFocusTraversalPolicy </item>
++      <item> Soundbank </item>
++      <item> SoundbankReader </item>
++      <item> SoundbankResource </item>
++      <item> Source </item>
++      <item> SourceDataLine </item>
++      <item> SourceLocator </item>
++      <item> SpinnerDateModel </item>
++      <item> SpinnerListModel </item>
++      <item> SpinnerModel </item>
++      <item> SpinnerNumberModel </item>
++      <item> SpinnerUI </item>
++      <item> SplitPaneUI </item>
++      <item> Spring </item>
++      <item> SpringLayout </item>
++      <item> SpringLayout.Constraints </item>
++      <item> SslRMIClientSocketFactory </item>
++      <item> SslRMIServerSocketFactory </item>
++      <item> Stack </item>
++      <item> StackOverflowError </item>
++      <item> StackTraceElement </item>
++      <item> StandardMBean </item>
++      <item> StartTlsRequest </item>
++      <item> StartTlsResponse </item>
++      <item> State </item>
++      <item> StateEdit </item>
++      <item> StateEditable </item>
++      <item> StateFactory </item>
++      <item> Statement </item>
++      <item> Statement </item>
++      <item> StreamCorruptedException </item>
++      <item> StreamHandler </item>
++      <item> StreamPrintService </item>
++      <item> StreamPrintServiceFactory </item>
++      <item> StreamResult </item>
++      <item> StreamSource </item>
++      <item> StreamTokenizer </item>
++      <item> Streamable </item>
++      <item> StreamableValue </item>
++      <item> StrictMath </item>
++      <item> String </item>
++      <item> StringBuffer </item>
++      <item> StringBufferInputStream </item>
++      <item> StringBuilder </item>
++      <item> StringCharacterIterator </item>
++      <item> StringContent </item>
++      <item> StringHolder </item>
++      <item> StringIndexOutOfBoundsException </item>
++      <item> StringMonitor </item>
++      <item> StringMonitorMBean </item>
++      <item> StringNameHelper </item>
++      <item> StringReader </item>
++      <item> StringRefAddr </item>
++      <item> StringSelection </item>
++      <item> StringSeqHelper </item>
++      <item> StringSeqHolder </item>
++      <item> StringTokenizer </item>
++      <item> StringValueExp </item>
++      <item> StringValueHelper </item>
++      <item> StringWriter </item>
++      <item> Stroke </item>
++      <item> Struct </item>
++      <item> StructMember </item>
++      <item> StructMemberHelper </item>
++      <item> Stub </item>
++      <item> StubDelegate </item>
++      <item> StubNotFoundException </item>
++      <item> Style </item>
++      <item> StyleConstants </item>
++      <item> StyleConstants.CharacterConstants </item>
++      <item> StyleConstants.ColorConstants </item>
++      <item> StyleConstants.FontConstants </item>
++      <item> StyleConstants.ParagraphConstants </item>
++      <item> StyleContext </item>
++      <item> StyleSheet </item>
++      <item> StyleSheet.BoxPainter </item>
++      <item> StyleSheet.ListPainter </item>
++      <item> StyledDocument </item>
++      <item> StyledEditorKit </item>
++      <item> StyledEditorKit.AlignmentAction </item>
++      <item> StyledEditorKit.BoldAction </item>
++      <item> StyledEditorKit.FontFamilyAction </item>
++      <item> StyledEditorKit.FontSizeAction </item>
++      <item> StyledEditorKit.ForegroundAction </item>
++      <item> StyledEditorKit.ItalicAction </item>
++      <item> StyledEditorKit.StyledTextAction </item>
++      <item> StyledEditorKit.UnderlineAction </item>
++      <item> Subject </item>
++      <item> SubjectDelegationPermission </item>
++      <item> SubjectDomainCombiner </item>
++      <item> SupportedValuesAttribute </item>
++      <item> SuppressWarnings </item>
++      <item> SwingConstants </item>
++      <item> SwingPropertyChangeSupport </item>
++      <item> SwingUtilities </item>
++      <item> SyncFactory </item>
++      <item> SyncFactoryException </item>
++      <item> SyncFailedException </item>
++      <item> SyncProvider </item>
++      <item> SyncProviderException </item>
++      <item> SyncResolver </item>
++      <item> SyncScopeHelper </item>
++      <item> SynchronousQueue </item>
++      <item> SynthConstants </item>
++      <item> SynthContext </item>
++      <item> SynthGraphicsUtils </item>
++      <item> SynthLookAndFeel </item>
++      <item> SynthPainter </item>
++      <item> SynthStyle </item>
++      <item> SynthStyleFactory </item>
++      <item> Synthesizer </item>
++      <item> SysexMessage </item>
++      <item> System </item>
++      <item> SystemColor </item>
++      <item> SystemException </item>
++      <item> SystemFlavorMap </item>
++      <item> TAG_ALTERNATE_IIOP_ADDRESS </item>
++      <item> TAG_CODE_SETS </item>
++      <item> TAG_INTERNET_IOP </item>
++      <item> TAG_JAVA_CODEBASE </item>
++      <item> TAG_MULTIPLE_COMPONENTS </item>
++      <item> TAG_ORB_TYPE </item>
++      <item> TAG_POLICIES </item>
++      <item> TAG_RMI_CUSTOM_MAX_STREAM_FORMAT </item>
++      <item> TCKind </item>
++      <item> THREAD_POLICY_ID </item>
++      <item> TIMEOUT </item>
++      <item> TRANSACTION_MODE </item>
++      <item> TRANSACTION_REQUIRED </item>
++      <item> TRANSACTION_ROLLEDBACK </item>
++      <item> TRANSACTION_UNAVAILABLE </item>
++      <item> TRANSIENT </item>
++      <item> TRANSPORT_RETRY </item>
++      <item> TabExpander </item>
++      <item> TabSet </item>
++      <item> TabStop </item>
++      <item> TabableView </item>
++      <item> TabbedPaneUI </item>
++      <item> TableCellEditor </item>
++      <item> TableCellRenderer </item>
++      <item> TableColumn </item>
++      <item> TableColumnModel </item>
++      <item> TableColumnModelEvent </item>
++      <item> TableColumnModelListener </item>
++      <item> TableHeaderUI </item>
++      <item> TableModel </item>
++      <item> TableModelEvent </item>
++      <item> TableModelListener </item>
++      <item> TableUI </item>
++      <item> TableView </item>
++      <item> TabularData </item>
++      <item> TabularDataSupport </item>
++      <item> TabularType </item>
++      <item> TagElement </item>
++      <item> TaggedComponent </item>
++      <item> TaggedComponentHelper </item>
++      <item> TaggedComponentHolder </item>
++      <item> TaggedProfile </item>
++      <item> TaggedProfileHelper </item>
++      <item> TaggedProfileHolder </item>
++      <item> Target </item>
++      <item> TargetDataLine </item>
++      <item> TargetedNotification </item>
++      <item> Templates </item>
++      <item> TemplatesHandler </item>
++      <item> Text </item>
++      <item> TextAction </item>
++      <item> TextArea </item>
++      <item> TextAttribute </item>
++      <item> TextComponent </item>
++      <item> TextEvent </item>
++      <item> TextField </item>
++      <item> TextHitInfo </item>
++      <item> TextInputCallback </item>
++      <item> TextLayout </item>
++      <item> TextLayout.CaretPolicy </item>
++      <item> TextListener </item>
++      <item> TextMeasurer </item>
++      <item> TextOutputCallback </item>
++      <item> TextSyntax </item>
++      <item> TextUI </item>
++      <item> TexturePaint </item>
++      <item> Thread </item>
++      <item> Thread.State </item>
++      <item> Thread.UncaughtExceptionHandler </item>
++      <item> ThreadDeath </item>
++      <item> ThreadFactory </item>
++      <item> ThreadGroup </item>
++      <item> ThreadInfo </item>
++      <item> ThreadLocal </item>
++      <item> ThreadMXBean </item>
++      <item> ThreadPolicy </item>
++      <item> ThreadPolicyOperations </item>
++      <item> ThreadPolicyValue </item>
++      <item> ThreadPoolExecutor </item>
++      <item> ThreadPoolExecutor.AbortPolicy </item>
++      <item> ThreadPoolExecutor.CallerRunsPolicy </item>
++      <item> ThreadPoolExecutor.DiscardOldestPolicy </item>
++      <item> ThreadPoolExecutor.DiscardPolicy </item>
++      <item> Throwable </item>
++      <item> Tie </item>
++      <item> TileObserver </item>
++      <item> Time </item>
++      <item> TimeLimitExceededException </item>
++      <item> TimeUnit </item>
++      <item> TimeZone </item>
++      <item> TimeoutException </item>
++      <item> Timer </item>
++      <item> Timer </item>
++      <item> Timer </item>
++      <item> TimerAlarmClockNotification </item>
++      <item> TimerMBean </item>
++      <item> TimerNotification </item>
++      <item> TimerTask </item>
++      <item> Timestamp </item>
++      <item> Timestamp </item>
++      <item> TitledBorder </item>
++      <item> TooManyListenersException </item>
++      <item> ToolBarUI </item>
++      <item> ToolTipManager </item>
++      <item> ToolTipUI </item>
++      <item> Toolkit </item>
++      <item> Track </item>
++      <item> TransactionRequiredException </item>
++      <item> TransactionRolledbackException </item>
++      <item> TransactionService </item>
++      <item> TransactionalWriter </item>
++      <item> TransferHandler </item>
++      <item> Transferable </item>
++      <item> TransformAttribute </item>
++      <item> Transformer </item>
++      <item> TransformerConfigurationException </item>
++      <item> TransformerException </item>
++      <item> TransformerFactory </item>
++      <item> TransformerFactoryConfigurationError </item>
++      <item> TransformerHandler </item>
++      <item> Transmitter </item>
++      <item> Transparency </item>
++      <item> TreeCellEditor </item>
++      <item> TreeCellRenderer </item>
++      <item> TreeExpansionEvent </item>
++      <item> TreeExpansionListener </item>
++      <item> TreeMap </item>
++      <item> TreeModel </item>
++      <item> TreeModelEvent </item>
++      <item> TreeModelListener </item>
++      <item> TreeNode </item>
++      <item> TreePath </item>
++      <item> TreeSelectionEvent </item>
++      <item> TreeSelectionListener </item>
++      <item> TreeSelectionModel </item>
++      <item> TreeSet </item>
++      <item> TreeUI </item>
++      <item> TreeWillExpandListener </item>
++      <item> TrustAnchor </item>
++      <item> TrustManager </item>
++      <item> TrustManagerFactory </item>
++      <item> TrustManagerFactorySpi </item>
++      <item> Type </item>
++      <item> TypeCode </item>
++      <item> TypeCodeHolder </item>
++      <item> TypeInfo </item>
++      <item> TypeInfoProvider </item>
++      <item> TypeMismatch </item>
++      <item> TypeMismatch </item>
++      <item> TypeMismatch </item>
++      <item> TypeMismatchHelper </item>
++      <item> TypeMismatchHelper </item>
++      <item> TypeNotPresentException </item>
++      <item> TypeVariable </item>
++      <item> Types </item>
++      <item> UID </item>
++      <item> UIDefaults </item>
++      <item> UIDefaults.ActiveValue </item>
++      <item> UIDefaults.LazyInputMap </item>
++      <item> UIDefaults.LazyValue </item>
++      <item> UIDefaults.ProxyLazyValue </item>
++      <item> UIManager </item>
++      <item> UIManager.LookAndFeelInfo </item>
++      <item> UIResource </item>
++      <item> ULongLongSeqHelper </item>
++      <item> ULongLongSeqHolder </item>
++      <item> ULongSeqHelper </item>
++      <item> ULongSeqHolder </item>
++      <item> UNKNOWN </item>
++      <item> UNKNOWN </item>
++      <item> UNSUPPORTED_POLICY </item>
++      <item> UNSUPPORTED_POLICY_VALUE </item>
++      <item> URI </item>
++      <item> URIException </item>
++      <item> URIResolver </item>
++      <item> URISyntax </item>
++      <item> URISyntaxException </item>
++      <item> URL </item>
++      <item> URLClassLoader </item>
++      <item> URLConnection </item>
++      <item> URLDecoder </item>
++      <item> URLEncoder </item>
++      <item> URLStreamHandler </item>
++      <item> URLStreamHandlerFactory </item>
++      <item> URLStringHelper </item>
++      <item> USER_EXCEPTION </item>
++      <item> UShortSeqHelper </item>
++      <item> UShortSeqHolder </item>
++      <item> UTFDataFormatException </item>
++      <item> UUID </item>
++      <item> UndeclaredThrowableException </item>
++      <item> UndoManager </item>
++      <item> UndoableEdit </item>
++      <item> UndoableEditEvent </item>
++      <item> UndoableEditListener </item>
++      <item> UndoableEditSupport </item>
++      <item> UnexpectedException </item>
++      <item> UnicastRemoteObject </item>
++      <item> UnionMember </item>
++      <item> UnionMemberHelper </item>
++      <item> UnknownEncoding </item>
++      <item> UnknownEncodingHelper </item>
++      <item> UnknownError </item>
++      <item> UnknownException </item>
++      <item> UnknownFormatConversionException </item>
++      <item> UnknownFormatFlagsException </item>
++      <item> UnknownGroupException </item>
++      <item> UnknownHostException </item>
++      <item> UnknownHostException </item>
++      <item> UnknownObjectException </item>
++      <item> UnknownServiceException </item>
++      <item> UnknownUserException </item>
++      <item> UnknownUserExceptionHelper </item>
++      <item> UnknownUserExceptionHolder </item>
++      <item> UnmappableCharacterException </item>
++      <item> UnmarshalException </item>
++      <item> UnmodifiableClassException </item>
++      <item> UnmodifiableSetException </item>
++      <item> UnrecoverableEntryException </item>
++      <item> UnrecoverableKeyException </item>
++      <item> Unreferenced </item>
++      <item> UnresolvedAddressException </item>
++      <item> UnresolvedPermission </item>
++      <item> UnsatisfiedLinkError </item>
++      <item> UnsolicitedNotification </item>
++      <item> UnsolicitedNotificationEvent </item>
++      <item> UnsolicitedNotificationListener </item>
++      <item> UnsupportedAddressTypeException </item>
++      <item> UnsupportedAudioFileException </item>
++      <item> UnsupportedCallbackException </item>
++      <item> UnsupportedCharsetException </item>
++      <item> UnsupportedClassVersionError </item>
++      <item> UnsupportedEncodingException </item>
++      <item> UnsupportedFlavorException </item>
++      <item> UnsupportedLookAndFeelException </item>
++      <item> UnsupportedOperationException </item>
++      <item> UserDataHandler </item>
++      <item> UserException </item>
++      <item> Util </item>
++      <item> UtilDelegate </item>
++      <item> Utilities </item>
++      <item> VMID </item>
++      <item> VM_ABSTRACT </item>
++      <item> VM_CUSTOM </item>
++      <item> VM_NONE </item>
++      <item> VM_TRUNCATABLE </item>
++      <item> Validator </item>
++      <item> ValidatorHandler </item>
++      <item> ValueBase </item>
++      <item> ValueBaseHelper </item>
++      <item> ValueBaseHolder </item>
++      <item> ValueExp </item>
++      <item> ValueFactory </item>
++      <item> ValueHandler </item>
++      <item> ValueHandlerMultiFormat </item>
++      <item> ValueInputStream </item>
++      <item> ValueMember </item>
++      <item> ValueMemberHelper </item>
++      <item> ValueOutputStream </item>
++      <item> VariableHeightLayoutCache </item>
++      <item> Vector </item>
++      <item> VerifyError </item>
++      <item> VersionSpecHelper </item>
++      <item> VetoableChangeListener </item>
++      <item> VetoableChangeListenerProxy </item>
++      <item> VetoableChangeSupport </item>
++      <item> View </item>
++      <item> ViewFactory </item>
++      <item> ViewportLayout </item>
++      <item> ViewportUI </item>
++      <item> VirtualMachineError </item>
++      <item> Visibility </item>
++      <item> VisibilityHelper </item>
++      <item> VoiceStatus </item>
++      <item> Void </item>
++      <item> VolatileImage </item>
++      <item> WCharSeqHelper </item>
++      <item> WCharSeqHolder </item>
++      <item> WStringSeqHelper </item>
++      <item> WStringSeqHolder </item>
++      <item> WStringValueHelper </item>
++      <item> WeakHashMap </item>
++      <item> WeakReference </item>
++      <item> WebRowSet </item>
++      <item> WildcardType </item>
++      <item> Window </item>
++      <item> WindowAdapter </item>
++      <item> WindowConstants </item>
++      <item> WindowEvent </item>
++      <item> WindowFocusListener </item>
++      <item> WindowListener </item>
++      <item> WindowStateListener </item>
++      <item> WrappedPlainView </item>
++      <item> WritableByteChannel </item>
++      <item> WritableRaster </item>
++      <item> WritableRenderedImage </item>
++      <item> WriteAbortedException </item>
++      <item> Writer </item>
++      <item> WrongAdapter </item>
++      <item> WrongAdapterHelper </item>
++      <item> WrongPolicy </item>
++      <item> WrongPolicyHelper </item>
++      <item> WrongTransaction </item>
++      <item> WrongTransactionHelper </item>
++      <item> WrongTransactionHolder </item>
++      <item> X500Principal </item>
++      <item> X500PrivateCredential </item>
++      <item> X509CRL </item>
++      <item> X509CRLEntry </item>
++      <item> X509CRLSelector </item>
++      <item> X509CertSelector </item>
++      <item> X509Certificate </item>
++      <item> X509Certificate </item>
++      <item> X509EncodedKeySpec </item>
++      <item> X509ExtendedKeyManager </item>
++      <item> X509Extension </item>
++      <item> X509KeyManager </item>
++      <item> X509TrustManager </item>
++      <item> XAConnection </item>
++      <item> XADataSource </item>
++      <item> XAException </item>
++      <item> XAResource </item>
++      <item> XMLConstants </item>
++      <item> XMLDecoder </item>
++      <item> XMLEncoder </item>
++      <item> XMLFilter </item>
++      <item> XMLFilterImpl </item>
++      <item> XMLFormatter </item>
++      <item> XMLGregorianCalendar </item>
++      <item> XMLParseException </item>
++      <item> XMLReader </item>
++      <item> XMLReaderAdapter </item>
++      <item> XMLReaderFactory </item>
++      <item> XPath </item>
++      <item> XPathConstants </item>
++      <item> XPathException </item>
++      <item> XPathExpression </item>
++      <item> XPathExpressionException </item>
++      <item> XPathFactory </item>
++      <item> XPathFactoryConfigurationException </item>
++      <item> XPathFunction </item>
++      <item> XPathFunctionException </item>
++      <item> XPathFunctionResolver </item>
++      <item> XPathVariableResolver </item>
++      <item> Xid </item>
++      <item> XmlReader </item>
++      <item> XmlWriter </item>
++      <item> ZipEntry </item>
++      <item> ZipException </item>
++      <item> ZipFile </item>
++      <item> ZipInputStream </item>
++      <item> ZipOutputStream </item>
++      <item> ZoneView </item>
++      <item> _BindingIteratorImplBase </item>
++      <item> _BindingIteratorStub </item>
++      <item> _DynAnyFactoryStub </item>
++      <item> _DynAnyStub </item>
++      <item> _DynArrayStub </item>
++      <item> _DynEnumStub </item>
++      <item> _DynFixedStub </item>
++      <item> _DynSequenceStub </item>
++      <item> _DynStructStub </item>
++      <item> _DynUnionStub </item>
++      <item> _DynValueStub </item>
++      <item> _IDLTypeStub </item>
++      <item> _NamingContextExtStub </item>
++      <item> _NamingContextImplBase </item>
++      <item> _NamingContextStub </item>
++      <item> _PolicyStub </item>
++      <item> _Remote_Stub </item>
++      <item> _ServantActivatorStub </item>
++      <item> _ServantLocatorStub </item>
++    </list>
++    <list name="keywords">
++      <item> abstract </item>
++      <item> case </item>
++      <item> catch </item>
++      <item> class </item>
++      <item> def </item>
++      <item> do </item>
++      <item> else </item>
++      <item> extends </item>
++      <item> false </item>
++      <item> final </item>
++      <item> finally </item>
++      <item> for </item>
++      <item> forSome </item>
++      <item> if </item>
++      <item> implicit </item>
++      <item> import </item>
++      <item> lazy </item>
++      <item> match </item>
++      <item> new </item>
++      <item> null </item>
++      <item> object </item>
++      <item> override </item>
++      <item> package </item>
++      <item> private </item>
++      <item> protected </item>
++      <item> requires </item>
++      <item> return </item>
++      <item> sealed </item>
++      <item> super </item>
++      <item> this </item>
++      <item> throw </item>
++      <item> trait </item>
++      <item> true </item>
++      <item> try </item>
++      <item> type </item>
++      <item> val </item>
++      <item> var </item>
++      <item> while </item>
++      <item> with </item>
++      <item> yield </item>
++    </list>
++    <list name="types">
++      <item> boolean </item>
++      <item> byte </item>
++      <item> char </item>
++      <item> double </item>
++      <item> float </item>
++      <item> int </item>
++      <item> long </item>
++      <item> short </item>
++      <item> unit </item>
++    </list>
++    <contexts>
++      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
++        <!-- Comment next line if you don't use Javadoc tool -->
++        <IncludeRules context="##Javadoc"/>
++        <keyword attribute="Keyword" context="#stay" String="keywords"/>
++        <keyword attribute="Data Type" context="#stay" String="types"/>
++        <keyword attribute="Java15" context="#stay" String="java15"/>
++        <keyword attribute="Scala2" context="#stay" String="scala2"/>
++        <Float attribute="Float" context="#stay">
++          <AnyChar String="fF" attribute="Float" context="#stay"/>
++        </Float>
++        <HlCOct attribute="Octal" context="#stay"/>
++        <HlCHex attribute="Hex" context="#stay"/>
++        <Int attribute="Decimal" context="#stay">
++          <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
++          <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
++          <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
++          <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
++          <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
++          <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
++          <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
++          <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
++        </Int>
++        <HlCChar attribute="Char" context="#stay"/>
++        <RegExpr attribute="Decimal" context="#stay" String="//\s*BEGIN.*$" beginRegion="Region1"/>
++        <RegExpr attribute="Decimal" context="#stay" String="//\s*END.*$" endRegion="Region1"/>
++        <DetectChar attribute="String" context="String" char="&quot;"/>
++        <RegExpr attribute="Function" context="Printf" String="\.(format|printf)\b" />
++        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
++        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
++        <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/>
++        <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/>
++<!--
++        <RegExpr attribute="Keyword" context="#stay" String="\.{3,3}\s+" />
++        <RegExpr attribute="Keyword" context="StaticImports" String="\b(import\s+static)\b" />
++        <RegExpr attribute="Keyword" context="Imports" String="\b(package|import)\b" />
++-->
++        <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
++        <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
++        <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
++      </context>
++      <context attribute="String" lineEndContext="#pop" name="String">
++        <LineContinue attribute="String" context="#stay"/>
++        <HlCStringChar attribute="String Char" context="#stay"/>
++        <DetectChar attribute="String" context="#pop" char="&quot;"/>
++      </context>
++      <context attribute="Printf" lineEndContext="#pop" name="Printf">
++        <DetectChar attribute="Normal Text" context="#pop" char="&#059;" />
++        <DetectChar attribute="String" context="PrintfString" char="&quot;"/>
++      </context>
++      <context attribute="PrintfString" lineEndContext="#pop" name="PrintfString">
++        <LineContinue attribute="String" context="#stay"/>
++        <HlCStringChar attribute="String Char" context="#stay"/>
++        <DetectChar attribute="String" context="#pop" char="&quot;"/>
++        <RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(\.\d+)?[a-hosxA-CEGHSX]" />
++        <RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(t|T)(a|A|b|B|c|C|d|D|e|F|h|H|I|j|k|l|L|m|M|N|p|P|Q|r|R|s|S|T|y|Y|z|Z)" />
++        <RegExpr attribute="String Char" context="#stay" String="%(%|n)" />
++      </context>
++      <context attribute="Normal Text" lineEndContext="#pop" name="Member" fallthrough="true" fallthroughContext="#pop">
++        <RegExpr attribute="Function" context="#pop" String="\b[_a-zA-Z]\w*(?=[\s]*)" />
++      </context>
++<!--
++      <context attribute="Normal Text" lineEndContext="#pop" name="StaticImports">
++        <RegExpr attribute="StaticImports" context="#pop" String="\s*.*$" />
++      </context>
++      <context attribute="Normal Text" lineEndContext="#pop" name="Imports">
++        <RegExpr attribute="Imports" context="#pop" String="\s*.*$" />
++      </context>
++-->
++      <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
++      <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
++        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
++      </context>
++    </contexts>
++    <itemDatas>
++      <itemData name="Normal Text"  defStyleNum="dsNormal"/>
++      <itemData name="Keyword"      defStyleNum="dsKeyword"/>
++      <itemData name="Function"     defStyleNum="dsFunction"/>
++      <itemData name="StaticImports"      defStyleNum="dsKeyword" color="#800080" selColor="#FFFFFF" bold="0" italic="0"/>
++      <itemData name="Imports"      defStyleNum="dsKeyword" color="#808000" selColor="#FFFFFF" bold="0" italic="0"/>
++      <itemData name="Data Type"    defStyleNum="dsDataType"/>
++      <itemData name="Decimal"      defStyleNum="dsDecVal"/>
++      <itemData name="Octal"        defStyleNum="dsBaseN"/>
++      <itemData name="Hex"          defStyleNum="dsBaseN"/>
++      <itemData name="Float"        defStyleNum="dsFloat"/>
++      <itemData name="Char"         defStyleNum="dsChar"/>
++      <itemData name="String"       defStyleNum="dsString"/>
++      <itemData name="String Char"  defStyleNum="dsChar"/>
++      <itemData name="PrintfString" defStyleNum="dsString"/>
++      <itemData name="Comment"      defStyleNum="dsComment"/>
++      <itemData name="Symbol"       defStyleNum="dsNormal"/>
++      <itemData name="Scala2"       defStyleNum="dsNormal" color="#0095FF" selColor="#FFFFFF" bold="1" italic="0"/>
++      <itemData name="Java15"       defStyleNum="dsNormal" color="#0095FF" selColor="#FFFFFF" bold="1" italic="0"/>
++    </itemDatas>
++  </highlighting>
++  <general>
++    <comments>
++      <comment name="singleLine" start="//"/>
++      <comment name="multiLine" start="/*" end="*/"/>
++    </comments>
++    <keywords casesensitive="1"/>
++  </general>
++</language>
+--- a/kate/syntax/data/roff.xml
++++ b/kate/syntax/data/roff.xml
+@@ -7,7 +7,7 @@
+   <!ENTITY argsep1 "([^\\]|\\[&#37; |^{}'`-_!?@)/,&amp;:~0acdeEprtu])">
+   <!ENTITY argsep2 "([^\\0-9]|\\[&#37;:{}'`-_!@/cep])">
+ ]>
+-<language name="Roff" section="Markup" version="0.11" kateversion="2.9" author="Matthew Woehlke (mw_triad at users.sourceforge.net)" license="GPL">
++<language name="Roff" section="Markup" version="0.11" kateversion="2.9" extensions="" author="Matthew Woehlke (mw_triad at users.sourceforge.net)" license="GPL">
+ 
+   <highlighting>
+ 
+--- a/kate/syntax/data/vhdl.xml
++++ b/kate/syntax/data/vhdl.xml
+@@ -1,286 +1,346 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+-<!DOCTYPE language SYSTEM "language.dtd">
+-<language name="VHDL" version="1.04" kateversion="2.1" section="Hardware" extensions="*.vhdl;*.vhd" mimetype="text/x-vhdl">
+-    <highlighting>
+-        <list name="keywords">
+-            <item> access </item>
+-            <item> after </item>
+-            <item> alias </item>
+-            <item> all </item>
+-            <item> assert </item>
+-            <item> architecture </item>
+-            <item> begin </item>
+-            <item> block </item>
+-            <item> body </item>
+-            <item> buffer </item>
+-            <item> bus </item>
+-            <item> case </item>
+-            <item> component </item>
+-            <item> configuration </item>
+-            <item> constant </item>
+-            <item> disconnect </item>
+-            <item> downto </item>
+-            <item> else </item>
+-            <item> elsif </item>
+-            <item> end </item>
+-            <item> entity </item>
+-            <item> exit </item>
+-            <item> file </item>
+-            <item> for </item>
+-            <item> function </item>
+-            <item> generate </item>
+-            <item> generic </item>
+-            <item> group </item>
+-            <item> guarded </item>
+-            <item> if </item>
+-            <item> impure </item>
+-            <item> in </item>
+-            <item> inertial </item>
+-            <item> inout </item>
+-            <item> is </item>
+-            <item> label </item>
+-            <item> library </item>
+-            <item> linkage </item>
+-            <item> literal </item>
+-            <item> loop </item>
+-            <item> map </item>
+-            <item> new </item>
+-            <item> next </item>
+-            <item> null </item>
+-            <item> of </item>
+-            <item> on </item>
+-            <item> open </item>
+-            <item> others </item>
+-            <item> out </item>
+-            <item> package </item>
+-            <item> port </item>
+-            <item> postponed </item>
+-            <item> procedure </item>
+-            <item> process </item>
+-            <item> pure </item>
+-            <item> range </item>
+-            <item> record </item>
+-            <item> register </item>
+-            <item> reject </item>
+-            <item> report </item>
+-            <item> return </item>
+-            <item> select </item>
+-            <item> severity </item>
+-            <item> signal </item>
+-            <item> shared </item>
+-            <item> subtype </item>
+-            <item> then </item>
+-            <item> to </item>
+-            <item> transport </item>
+-            <item> type </item>
+-            <item> unaffected </item>
+-            <item> units </item>
+-            <item> until </item>
+-            <item> use </item>
+-            <item> variable </item>
+-            <item> wait </item>
+-            <item> when </item>
+-            <item> while </item>
+-            <item> with </item>
+-            <item> note </item>
+-            <item> warning </item>
+-            <item> error </item>
+-            <item> failure </item>
+-            <item> ACCESS </item>
+-            <item> AFTER </item>
+-            <item> ALIAS </item>
+-            <item> ALL </item>
+-            <item> ASSERT </item>
+-            <item> ARCHITECTURE </item>
+-            <item> BEGIN </item>
+-            <item> BLOCK </item>
+-            <item> BODY </item>
+-            <item> BUFFER </item>
+-            <item> BUS </item>
+-            <item> CASE </item>
+-            <item> COMPONENT </item>
+-            <item> CONFIGURATION </item>
+-            <item> CONSTANT </item>
+-            <item> DISCONNECT </item>
+-            <item> DOWNTO </item>
+-            <item> ELSE </item>
+-            <item> ELSIF </item>
+-            <item> END </item>
+-            <item> ENTITY </item>
+-            <item> EXIT </item>
+-            <item> FILE </item>
+-            <item> FOR </item>
+-            <item> FUNCTION </item>
+-            <item> GENERATE </item>
+-            <item> GENERIC </item>
+-            <item> GROUP </item>
+-            <item> GUARDED </item>
+-            <item> IF </item>
+-            <item> IMPURE </item>
+-            <item> IN </item>
+-            <item> INERTIAL </item>
+-            <item> INOUT </item>
+-            <item> IS </item>
+-            <item> LABEL </item>
+-            <item> LIBRARY </item>
+-            <item> LINKAGE </item>
+-            <item> LITERAL </item>
+-            <item> LOOP </item>
+-            <item> MAP </item>
+-            <item> NEW </item>
+-            <item> NEXT </item>
+-            <item> NULL </item>
+-            <item> OF </item>
+-            <item> ON </item>
+-            <item> OPEN </item>
+-            <item> OTHERS </item>
+-            <item> OUT </item>
+-            <item> PACKAGE </item>
+-            <item> PORT </item>
+-            <item> POSTPONED </item>
+-            <item> PROCEDURE </item>
+-            <item> PROCESS </item>
+-            <item> PURE </item>
+-            <item> RANGE </item>
+-            <item> RECORD </item>
+-            <item> REGISTER </item>
+-            <item> REJECT </item>
+-            <item> REPORT </item>
+-            <item> RETURN </item>
+-            <item> SELECT </item>
+-            <item> SEVERITY </item>
+-            <item> SIGNAL </item>
+-            <item> SHARED </item>
+-            <item> SUBTYPE </item>
+-            <item> THEN </item>
+-            <item> TO </item>
+-            <item> TRANSPORT </item>
+-            <item> TYPE </item>
+-            <item> UNAFFECTED </item>
+-            <item> UNITS </item>
+-            <item> UNTIL </item>
+-            <item> USE </item>
+-            <item> VARIABLE </item>
+-            <item> WAIT </item>
+-            <item> WHEN </item>
+-            <item> WHILE </item>
+-            <item> WITH </item>
+-            <item> NOTE </item>
+-            <item> WARNING </item>
+-            <item> ERROR </item>
+-            <item> FAILURE </item>
+-            <item> and </item>
+-            <item> or </item>
+-            <item> xor </item>
+-            <item> not </item>
+-            <item> AND </item>
+-            <item> OR </item>
+-            <item> XOR </item>
+-            <item> NOT </item>
+-         </list>
+-        <list name="types">
+-            <item> bit </item>
+-            <item> bit_vector </item>
+-            <item> character </item>
+-            <item> boolean </item>
+-            <item> integer </item>
+-            <item> real </item>
+-            <item> time </item>
+-            <item> string </item>
+-            <item> severity_level </item>
+-            <item> positive </item>
+-            <item> natural </item>
+-            <item> signed </item>
+-            <item> unsigned </item>
+-            <item> line </item>
+-            <item> text </item>
+-            <item> std_logic </item>
+-            <item> std_logic_vector </item>
+-            <item> std_ulogic </item>
+-            <item> std_ulogic_vector </item>
+-            <item> qsim_state </item>
+-            <item> qsim_state_vector </item>
+-            <item> qsim_12state </item>
+-            <item> qsim_12state_vector </item>
+-            <item> qsim_strength </item>
+-            <item> mux_bit </item>
+-            <item> mux_vector </item>
+-            <item> reg_bit </item>
+-            <item> reg_vector </item>
+-            <item> wor_bit </item>
+-            <item> wor_vector </item>
+-            <item> BIT </item>
+-            <item> BIT_VECTOR </item>
+-            <item> CHARACTER </item>
+-            <item> BOOLEAN </item>
+-            <item> INTEGER </item>
+-            <item> REAL </item>
+-            <item> TIME </item>
+-            <item> STRING </item>
+-            <item> SEVERITY_LEVEL </item>
+-            <item> POSITIVE </item>
+-            <item> NATURAL </item>
+-            <item> SIGNED </item>
+-            <item> UNSIGNED </item>
+-            <item> LINE </item>
+-            <item> TEXT </item>
+-            <item> STD_LOGIC </item>
+-            <item> STD_LOGIC_VECTOR </item>
+-            <item> STD_ULOGIC </item>
+-            <item> STD_ULOGIC_VECTOR </item>
+-            <item> QSIM_STATE </item>
+-            <item> QSIM_STATE_VECTOR </item>
+-            <item> QSIM_12STATE </item>
+-            <item> QSIM_12STATE_VECTOR </item>
+-            <item> QSIM_STRENGTH </item>
+-            <item> MUX_BIT </item>
+-            <item> MUX_VECTOR </item>
+-            <item> REG_BIT </item>
+-            <item> REG_VECTOR </item>
+-            <item> WOR_BIT </item>
+-            <item> WOR_VECTOR </item>
+-        </list>
+-        <contexts>
+-            <context name="normal" attribute="Normal Text" lineEndContext="#stay">
+-                <keyword attribute="Keyword" context="#stay"  String="keywords"/>
+-                <keyword attribute="Data Type" context="#stay"  String="types"/>
+-                <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" />
+-                <Int attribute="Integer" context="#stay" />
+-                <HlCChar attribute="Bit" context="#stay" />
+-                <DetectChar attribute="Vector" context="string" char="&quot;" />
+-                <AnyChar attribute="Operator" context="#stay" String="[&amp;&gt;&lt;=:+\-*\/|]().,;" />
+-                <DetectChar attribute="Attribute" context="attribute" char="'" />
+-             </context>
+-            <context name="comment" attribute="Comment" lineEndContext="#pop" />
+-            <context name="string" attribute="Vector" lineEndContext="#stay" >
+-                <DetectChar attribute="Vector" context="#pop" char="&quot;" />
+-            </context>
+-            <context name="attribute" attribute="Attribute" lineEndContext="#pop">
+-                <DetectChar attribute="Attribute" context="quot in att" char="&quot;" />
+-                <DetectChar attribute="Normal Text" context="#pop" char=" " />
+-                <AnyChar attribute="Attribute" context="#pop" String=")=&lt;&gt;" />
+-            </context>
+-            <context name="quot in att" attribute="Attribute" lineEndContext="#stay">
+-                <DetectChar attribute="Attribute" context="#pop" char="&quot;" />
+-            </context>
+-        </contexts>
+-        <itemDatas>
+-            <itemData name="Normal Text" defStyleNum="dsNormal" />
+-            <itemData name="Keyword" defStyleNum="dsKeyword" />
+-            <itemData name="Data Type" defStyleNum="dsDataType" />
+-            <itemData name="Comment" defStyleNum="dsComment" />
+-            <itemData name="Integer" defStyleNum="dsDecVal" />
+-            <itemData name="Bit" defStyleNum="dsChar" />
+-            <itemData name="Vector" defStyleNum="dsString" />
+-            <itemData name="Operator" defStyleNum="dsOthers" />
+-            <itemData name="Attribute" defStyleNum="dsBaseN" />
+-        </itemDatas>
+-    </highlighting>
++<!DOCTYPE language SYSTEM "language.dtd"
++[
++  <!ENTITY funcname "[A-Za-z_:][A-Za-z0-9_:#&#37;@-]*">
++  <!ENTITY varname  "[A-Za-z_][A-Za-z0-9_]*">
++  <!ENTITY bos      "(|[^&quot;-]*)\b">			<!-- bol or space following -->
++<!--  <!ENTITY bos      "^(|.*\s)">-->			<!-- bol or space following -->
++  <!ENTITY eos      "\b">		<!-- eol or space following -->
++<!--  <!ENTITY eos      "(?=($|\s))">-->		<!-- eol or space following -->
++  <!ENTITY noword   "(?![\w$+-])">		<!-- no word, $, + or - following -->
++  <!ENTITY label     "((&varname;)\s*:\s*)?">
++  
++]>
++<language name="VHDL" version="1.08" kateversion="2.3" section="Hardware" extensions="*.vhdl;*.vhd" mimetype="text/x-vhdl" author="Rocky Scaletta (rocky at purdue.edu), Stefan Endrullis (stefan at endrullis.de), Jan Michel (jan at mueschelsoft.de)">
++  <highlighting>
++    <list name="keywordsToplevel">
++      <item> file </item>
++      <item> package </item>
++      <item> library </item>
++      <item> use </item>
++<!--
++      <item> entity </item>
++      <item> architecture </item>
++      <item> of </item>
++      <item> configuration </item>
++-->
++    </list>
++    <list name="keywords">
++      <item> access </item>
++      <item> after </item>
++      <item> alias </item>
++      <item> all </item>
++      <item> assert </item>
++      <item> begin </item>
++      <item> block </item>
++      <item> body </item>
++      <item> bus </item>
++      <item> component </item>
++      <item> constant </item>
++      <item> disconnect </item>
++      <item> downto </item>
++      <item> end </item>
++      <item> exit </item>
++      <item> function </item>
++      <item> generate </item>
++      <item> generic </item>
++      <item> group </item>
++      <item> guarded </item>
++      <item> impure </item>
++      <item> inertial </item>
++      <item> is </item>
++      <item> label </item>
++      <item> linkage </item>
++      <item> literal </item>
++      <item> map </item>
++      <item> new </item>
++      <item> next </item>
++      <item> null </item>
++      <item> on </item>
++      <item> open </item>
++      <item> others </item>
++      <item> port </item>
++      <item> postponed </item>
++      <item> procedure </item>
++      <item> process </item>
++      <item> pure </item>
++      <item> range </item>
++      <item> record </item>
++      <item> register </item>
++      <item> reject </item>
++      <item> report </item>
++      <item> return </item>
++      <item> select </item>
++      <item> severity </item>
++      <item> signal </item>
++      <item> shared </item>
++      <item> subtype </item>
++      <item> then </item>
++      <item> to </item>
++      <item> transport </item>
++      <item> type </item>
++      <item> unaffected </item>
++      <item> units </item>
++      <item> until </item>
++      <item> variable </item>
++      <item> wait </item>
++      <item> when </item>
++      <item> with </item>
++      <item> note </item>
++      <item> warning </item>
++      <item> error </item>
++      <item> failure </item>
++      <item> in </item>
++      <item> inout </item>
++      <item> out </item>
++      <item> buffer </item>
++      <item> and </item>
++      <item> or </item>
++      <item> xor </item>
++      <item> not </item>
++    </list>
++    
++    <list name="if">
++      <item> else </item>
++      <item> elsif </item>
++    </list>
++    
++    <list name="forOrWhile">
++      <item> loop </item>
++    </list>
++      
++    <list name="directions">
++      <item> in </item>
++      <item> inout </item>
++      <item> out </item>
++      <item> buffer </item>
++    </list>
++    
++    <list name="signals">
++      <item> signal </item>
++      <item> variable </item>
++      <item> constant </item>
++      <item> type </item>      
++    </list>
++ <!--   <list name="logics">
++      <item> and </item>
++      <item> or </item>
++      <item> xor </item>
++      <item> not </item>
++    </list>
++    
++    <list name="rangeDirection">
++      <item> to </item>
++      <item> downto </item>
++    </list>-->
++    
++    <list name="types">
++      <item> bit </item>
++      <item> bit_vector </item>
++      <item> character </item>
++      <item> boolean </item>
++      <item> integer </item>
++      <item> real </item>
++      <item> time </item>
++      <item> string </item>
++      <item> severity_level </item>
++      <item> positive </item>
++      <item> natural </item>
++      <item> signed </item>
++      <item> unsigned </item>
++      <item> line </item>
++      <item> text </item>
++      <item> std_logic </item>
++      <item> std_logic_vector </item>
++      <item> std_ulogic </item>
++      <item> std_ulogic_vector </item>
++      <item> qsim_state </item>
++      <item> qsim_state_vector </item>
++      <item> qsim_12state </item>
++      <item> qsim_12state_vector </item>
++      <item> qsim_strength </item>
++      <item> mux_bit </item>
++      <item> mux_vector </item>
++      <item> reg_bit </item>
++      <item> reg_vector </item>
++      <item> wor_bit </item>
++      <item> wor_vector </item>
++    </list>
++    <contexts>
++      <!-- start / global environment -->
++      <context name="start" attribute="Normal Text" lineEndContext="#stay">
++        <RegExpr attribute="Normal Text" context="entity" String="&bos;(entity\s*(&varname;)\s*is)&eos;" beginRegion="EntityRegion1" lookAhead="true" insensitive="true" />
++        <RegExpr attribute="Normal Text" context="architecture" String="&bos;(architecture\s*(&varname;)\s*of\s*&varname;\s*is)&eos;" beginRegion="ArchitectureRegion1" lookAhead="true" insensitive="true" />
++        <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" />
++        <keyword attribute="Keyword" context="#stay"  String="keywordsToplevel"/>
++      </context>
++      
++      <context name="preDetection" attribute="Normal Text" lineEndContext="#stay">
++        <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" />
++        <DetectChar attribute="Vector" context="string" char="&quot;" />
++        <AnyChar attribute="Operator" context="#stay" String="[&amp;&gt;&lt;=:+\-*\/|]().,;" />
++        <DetectChar attribute="Attribute" context="attribute" char="'" />
++      </context>
++      
++      <!-- general keywords detection -->
++      <context name="generalDetection" attribute="Normal Text" lineEndContext="#stay">
++        <keyword attribute="Data Type" context="#stay"  String="types"/>
++        <keyword attribute="Signal" context="#stay"  String="signals"/>
++        <keyword attribute="Keyword" context="#stay"  String="keywords"/>
++        <Int attribute="Integer" context="#stay" />
++        <HlCChar attribute="Bit" context="#stay" />
++      </context>
++      
++
++      
++      <!-- entity environment -->
++      <context name="entity" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Redirection" context="#stay" String="%2" dynamic="true" />
++        <IncludeRules context="preDetection" />
++        <RegExpr attribute="Redirection" context="#pop" String="^(|\s.*)end(\s*entity)?\s*(%3)?\s*;" dynamic="true" endRegion="EntityRegion1" insensitive="true" />
++        <!--<RegExpr attribute="Alert" context="generic" String="generic"/>-->
++        <IncludeRules context="generalDetection" />
++      </context>
++<!--      <context name="generic" attribute="Normal Text" lineEndContext="#stay">
++        <DetectChar attribute="Operator" context="range" char="("/>
++        <Detect2Chars attribute="Alert" context="#pop" char=")" char1=";"/>
++      </context>
++      <context name="range" attribute="Normal Text" lineEndContext="#stay">
++        <keyword attribute="Keyword" context="#stay"  String="rangeDirection"/>
++        <Int attribute="Integer" context="#stay" />
++        <HlCChar attribute="Bit" context="#stay" />
++        <DetectChar attribute="Vector" context="string" char="&quot;" />
++        <DetectChar attribute="Operator" context="#pop" char=")"/>
++      </context>-->
++      
++      <!-- architecture environment -->
++      <context name="architecture" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Redirection" context="#stay" String="%2" dynamic="true" />
++        <IncludeRules context="preDetection" />
++        <StringDetect attribute="Redirection" context="#stay" String="begin" insensitive="true" />
++        <RegExpr attribute="Redirection" context="#pop" String="&bos;end(\s+architecture)?(\s+%3)?\s*;" dynamic="true" endRegion="ArchitectureRegion1"  insensitive="true" />
++        <RegExpr attribute="Normal Text" context="component" String="&bos;(component\s+(&varname;)(\s+is)?)&eos;" beginRegion="ComponentRegion1" lookAhead="true"  insensitive="true" />
++        <RegExpr attribute="Normal Text" context="process1" String="^(|\s+)(&label;process)&eos;" beginRegion="ProcessRegion1" lookAhead="true"  insensitive="true" />
++        <RegExpr attribute="Normal Text" context="generate1" String="^(|\s+)((&varname;)\s*:\s*((for\s+.+\s+in\s+.+)|(if\s+.+))\s+generate)&eos;" beginRegion="GenerateRegion1" lookAhead="true" insensitive="true" />
++        <RegExpr attribute="Normal Text" context="instance" String="^(|\s+)((&varname;)\s*:\s*(&varname;))&eos;" beginRegion="InstanceRegion1" lookAhead="true"  insensitive="true" />
++        <IncludeRules context="generalDetection" />
++      </context>
++<!--      <context name="architectureBeforeBegin" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Redirection" context="#stay" String="%1" dynamic="true" />
++        <RegExpr attribute="Redirection" context="#pop" String="end\s*%2\s*;" dynamic="true" endRegion="ArchitectureRegion1" />
++        <StringDetect attribute="Redirection" context="architectureAfterBegin" String="begin" />
++        <RegExpr attribute="Redirection" context="#pop#pop" String="end\s*%2\s*;" dynamic="true" endRegion="ArchitectureRegion1" />
++        <IncludeRules context="normal" />
++      </context>
++      <context name="architectureAfterBegin" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Redirection" context="#stay" String="%1" dynamic="true" />
++        <IncludeRules context="normal" />
++      </context>-->
++      
++      <!-- component environment -->
++      <context name="component" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Redirection" context="" String="%2" dynamic="true" />
++        <IncludeRules context="preDetection" />
++        <RegExpr attribute="Redirection" context="#pop" String="&bos;end\s+component(\s+%3)?\s*;" dynamic="true" endRegion="ComponentRegion1" insensitive="true" />
++        <IncludeRules context="generalDetection" />
++      </context>
++
++      <!-- generate statement -->
++      <context name="generate1" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Process" context="generate2" String="%2" dynamic="true" />
++      </context>
++      <context name="generate2" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <IncludeRules context="architecture" />
++        <RegExpr attribute="Process" context="#pop#pop" String="^(|\s.*)end\s+generate(?:\s+%3)?\s*;" dynamic="true" endRegion="GenerateRegion1" insensitive="true" />
++      </context>
++
++      <context name="instance" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Redirection" context="#stay" String="%2" dynamic="true" />
++        <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" />
++        <DetectChar attribute="Vector" context="string" char="&quot;" />
++        <Detect2Chars attribute="Normal Text" context="#pop" char=")" char1=";" endRegion="InstanceRegion1" />
++        <IncludeRules context="generalDetection" />
++        <AnyChar attribute="Operator" context="#stay" String="[&amp;&gt;&lt;=:+\-*\/|]().,;" />
++        <DetectChar attribute="Attribute" context="attribute" char="'" />
++      </context>
++      
++      <!-- process environment -->
++      <context name="process1" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <StringDetect attribute="Process" context="process2" String="%2" dynamic="true" />
++        <RegExpr attribute="Process" context="#pop" String="^(|\s.*)end\s+process(\s+%4)?\s*;" endRegion="ProcessRegion1" insensitive="true" dynamic="true" />
++      </context>
++      <context name="process2" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
++        <RegExpr attribute="Process" context="#pop" String="^(|\s.*)end\s+process" insensitive="true" lookAhead="true" />
++        <StringDetect attribute="Process" context="#stay" String="begin" insensitive="true" />
++        <IncludeRules context="processContext" />
++      </context>
++
++      <context name="processContext" attribute="Normal Text" lineEndContext="#stay">
++        <IncludeRules context="preDetection" />
++        <RegExpr attribute="Control" context="case1" String="&bos;&label;(case)&eos;" beginRegion="CaseRegion1" insensitive="true" />
++        <RegExpr attribute="Control" context="if" String="&bos;&label;(if)&eos;" beginRegion="IfRegion1" insensitive="true" />
++        <RegExpr attribute="Control" context="forOrWhile" String="&bos;&label;((for|while)\s+.+\s+)?loop&eos;" beginRegion="ForOrWhileRegion1" insensitive="true" />
++        <IncludeRules context="generalDetection" />
++      </context>
++      <context name="case1" attribute="Normal Text" lineEndContext="#stay">
++        <StringDetect attribute="Keyword" context="case2" String="is" insensitive="true" />
++      </context>
++      <context name="case2" attribute="Normal Text" lineEndContext="#stay">
++        <RegExpr attribute="Control" context="#pop#pop" String="&bos;end\s+case(\s+&varname;)?\s*;" endRegion="CaseRegion1" insensitive="true" />
++        <RegExpr attribute="Control" context="caseWhen" String="&bos;when&eos;" beginRegion="CaseWhenRegion1" insensitive="true" />
++        <IncludeRules context="processContext" />
++      </context>
++      <context name="caseWhen" attribute="Normal Text" lineEndContext="#stay">
++        <RegExpr attribute="Control" context="#pop" String="&bos;when&eos;" endRegion="CaseWhenRegion1" lookAhead="true" insensitive="true" />
++        <RegExpr attribute="Control" context="#pop" String="&bos;end\s+case(\s+&varname;)?\s*;" endRegion="CaseWhenRegion1" lookAhead="true" insensitive="true" />
++        <IncludeRules context="process2" />
++      </context>
++      <context name="if" attribute="Normal Text" lineEndContext="#stay">
++        <RegExpr attribute="Control" context="#pop" String="&bos;end\s+if(\s+&varname;)?\s*;" endRegion="IfRegion1" insensitive="true" />
++        <keyword attribute="Control" context="#stay"  String="if"/>
++        <IncludeRules context="processContext" />
++      </context>
++      <context name="forOrWhile" attribute="Normal Text" lineEndContext="#stay">
++        <RegExpr attribute="Control" context="#pop" String="&bos;end\s+loop(\s+&varname;)?\s*;" endRegion="ForOrWhileRegion1" insensitive="true" />
++        <keyword attribute="Control" context="#stay"  String="forOrWhile"/>
++        <IncludeRules context="processContext" />
++      </context>
++      
++      <!-- other environments -->
++      <context name="comment" attribute="Comment" lineEndContext="#pop" />
++      <context name="string" attribute="Vector" lineEndContext="#stay" >
++        <DetectChar attribute="Vector" context="#pop" char="&quot;" />
++      </context>
++      <context name="attribute" attribute="Attribute" lineEndContext="#pop">
++        <DetectChar attribute="Attribute" context="quot in att" char="&quot;" />
++        <DetectChar attribute="Normal Text" context="#pop" char=" " />
++        <AnyChar attribute="Attribute" context="#pop" String=")=&lt;&gt;" />
++      </context>
++      <context name="quot in att" attribute="Attribute" lineEndContext="#stay">
++        <DetectChar attribute="Attribute" context="#pop" char="&quot;" />
++      </context>
++    </contexts>
++    <itemDatas>
++      <itemData name="Normal Text" defStyleNum="dsNormal" />
++      <itemData name="Keyword" defStyleNum="dsKeyword" />
++      <itemData name="Data Type" defStyleNum="dsDataType" />
++      <itemData name="Comment" defStyleNum="dsComment" />
++      <itemData name="Integer" defStyleNum="dsDecVal" />
++      <itemData name="Bit" defStyleNum="dsChar" />
++      <itemData name="Vector" defStyleNum="dsString" />
++      <itemData name="Operator" defStyleNum="dsOthers" />
++      <itemData name="Attribute" defStyleNum="dsBaseN" />
++      <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
++      <itemData name="Signal" defStyleNum="dsOthers"/>
++      <itemData name="Redirection" defStyleNum="dsKeyword" color="#238" />
++      <itemData name="Process" defStyleNum="dsKeyword" color="#09A" />
++      <itemData name="Control" defStyleNum="dsKeyword" color="#008" />
++    </itemDatas>
++  </highlighting>
+   <general>
+     <comments>
+       <comment name="singleLine" start="--" />
+     </comments>
+-    <keywords casesensitive="1" />
++    <keywords casesensitive="0" />
+   </general>
+-</language>
+-
++</language>
+\ No newline at end of file
+--- a/kate/syntax/data/xml.xml
++++ b/kate/syntax/data/xml.xml
+@@ -4,7 +4,7 @@
+ 	<!ENTITY name    "[A-Za-z_:][\w.:_-]*">
+ 	<!ENTITY entref  "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
+ ]>
+-<language name="XML" version="1.96" kateversion="2.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf" mimetype="text/xml;text/book;text/daml;text/rdf" casesensitive="1" author="Wilbert Berendsen (wilbert at kde.nl)" license="LGPL">
++<language name="XML" version="1.97" kateversion="2.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml" casesensitive="1" author="Wilbert Berendsen (wilbert at kde.nl)" license="LGPL">
+ 
+ <highlighting>
+ <contexts>
+--- a/kate/syntax/data/cpp.xml
++++ b/kate/syntax/data/cpp.xml
+@@ -1,6 +1,13 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE language SYSTEM "language.dtd">
+-<language name="C++" version="1.38" kateversion="2.4" section="Sources" extensions="*.c++;*.cxx;*.cpp;*.cc;*.C;*.h;*.hh;*.H;*.h++;*.hxx;*.hpp;*.hcc;*.moc" mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr" priority="9">
++<language name="C++" version="1.41" kateversion="2.4" section="Sources" extensions="*.c++;*.cxx;*.cpp;*.cc;*.C;*.h;*.hh;*.H;*.h++;*.hxx;*.hpp;*.hcc;*.moc" mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr" priority="9">
++<!--
++##########################################################################
++## Fixes by Sebastian Pipping (webmaster at hartwork.org)
++##
++## NOTE: Keep in sync with C highlighter! (c.xml)
++##########################################################################
++-->
+   <highlighting>
+     <list name="keywords">
+       <item> asm </item>
+@@ -153,8 +160,8 @@
+     <contexts>
+       <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+         <DetectSpaces />
+-	<RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" />
+-        <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" />
++	<RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="PP" firstNonSpace="true" />
++        <DetectChar context="AfterHash" char="#" firstNonSpace="true" lookAhead="true" />
+         <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
+         <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
+         <keyword attribute="Keyword" context="#stay" String="keywords" />
+@@ -185,42 +192,58 @@
+         <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+         <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]{|}~^&#59;"/>
+       </context>
++
+       <context attribute="String" lineEndContext="#pop" name="String">
+         <LineContinue attribute="String" context="#stay"/>
+         <HlCStringChar attribute="String Char" context="#stay"/>
+         <DetectChar attribute="String" context="#pop" char="&quot;"/>
+       </context>
++
+       <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
+       </context>
++
+       <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+         <DetectSpaces />
+         <IncludeRules context="##Alerts" />
+         <DetectIdentifier />
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+         <DetectSpaces />
+         <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+         <IncludeRules context="##Alerts" />
+         <DetectIdentifier />
+       </context>
++
++      <context attribute="Error" lineEndContext="#pop" name="AfterHash">
++        <!-- define, elif, else, endif, error, if, ifdef, ifndef, include, include_next, line, pragma, undef, warning -->
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*if(?:def|ndef)?(?=\s+\S)" insensitive="true" beginRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*endif" insensitive="true" endRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Define" String="#\s*define.*((?=\\))" insensitive="true" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*(?:el(?:se|if)|include(?:_next)?|define|undef|line|error|warning|pragma)" insensitive="true" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s+[0-9]+" insensitive="true" firstNonSpace="true" />
++      </context>
++
+       <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+         <LineContinue attribute="Preprocessor" context="#stay"/>
+-        <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
+-        <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
+         <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+         <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+         <IncludeRules context="##Doxygen" />
++        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2" />
++
+         <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+-        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*"/>
+       </context>
++
+       <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
+         <LineContinue attribute="Preprocessor" context="#stay"/>
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
+         <DetectSpaces />
+-        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
++        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
+         <DetectIdentifier />
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
+         <DetectSpaces />
+         <IncludeRules context="##Alerts" />
+@@ -229,9 +252,11 @@
+         <IncludeRules context="##Doxygen" />
+         <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+         <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+-        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+-        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" />
++        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*el(?:se|if)" firstNonSpace="true" />
++        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
+       </context>
++
+       <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
+         <DetectSpaces />
+         <IncludeRules context="##Alerts" />
+@@ -240,8 +265,8 @@
+         <IncludeRules context="##Doxygen" />
+         <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+         <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+-        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true"/>
+-        <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true"/>
++        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
++        <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
+       </context>
+     </contexts>
+     <itemDatas>
+@@ -261,6 +286,7 @@
+       <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+       <itemData name="Prep. Lib"    defStyleNum="dsOthers"/>
+       <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
++      <itemData name="Error"        defStyleNum="dsError" />
+     </itemDatas>
+   </highlighting>
+   <general>
+--- a/kate/syntax/data/language.dtd
++++ b/kate/syntax/data/language.dtd
+@@ -154,10 +154,10 @@
+ -->
+ <!ELEMENT keywords EMPTY>
+ <!ATTLIST keywords
+-  casesensitive         CDATA   #IMPLIED
+-  weakDeliminator       CDATA   #IMPLIED
+-  additionalDeliminator CDATA   #IMPLIED
+-  wordWrapDeliminator   CDATA   #IMPLIED
++  casesensitive         (%boolean;) #IMPLIED
++  weakDeliminator       CDATA       #IMPLIED
++  additionalDeliminator CDATA       #IMPLIED
++  wordWrapDeliminator   CDATA       #IMPLIED
+ >
+ 
+ <!-- Indentation options
+@@ -261,9 +261,13 @@
+ 
+ <!-- Detect members of a keyword list
+   commonAttributes: Common attributes
++  insensitive:      Is this list case-insensitive? [boolean, optional, see note]
+   String:           Name of the list
+   weakDelimiter:    Use weak deliminator
+ 
++  By default, case sensitivity is determined from <keywords casesensitive> in
++  <general> (default=true), but can be overridden per-list with 'insensitive'.
++
+ TODO:
+   - Should be weakDeliminator
+   - Explain deliminator
+@@ -272,7 +276,8 @@
+ <!ELEMENT keyword EMPTY>
+ <!ATTLIST keyword
+   %commonAttributes;
+-  String    CDATA   #REQUIRED
++  insensitive   CDATA #IMPLIED
++  String        CDATA #REQUIRED
+   weakDelimiter CDATA #IMPLIED
+ >
+ 
+--- /dev/null
++++ b/kate/syntax/data/abap.xml
+@@ -0,0 +1,285 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE language SYSTEM "language.dtd">
++<language name="ABAP" version="1.00" kateversion="2.4" section="Sources" extensions="*.abap;*.ABAP" mimetype="text/x-abap-src" priority="5" author="Marcos Antonio Alvarez Costales (busgosin at hotmail.com)" license="GPL">
++  <highlighting>
++
++    <list name="keywords">
++    <!-- compiler directives and structures -->
++      <item> ADD </item>
++      <item> ADJACENT </item>
++      <item> ALL </item>
++      <item> AND </item>
++      <item> APPEND </item>
++      <item> APPENDING </item>
++      <item> AS </item>
++      <item> ASCENDING </item>
++      <item> AT </item>
++      <item> BEGIN </item>
++      <item> BETWEEN </item>
++      <item> BINARY </item>
++      <item> BLOCK </item>
++      <item> BY </item>
++      <item> CASE </item>
++      <item> CENTERED </item>
++      <item> CHAIN </item>
++      <item> CHANGING </item>
++      <item> CHECK </item>
++      <item> CHECKBOX </item>
++      <item> CLEAR </item>
++      <item> COL_BACKGROUND </item>
++      <item> COL_HEADING </item>
++      <item> COL_NORMAL </item>
++      <item> COL_TOTAL </item>
++      <item> COLOR </item>
++      <item> COMMENT </item>
++      <item> COMMIT </item>
++      <item> COMPARING </item>
++      <item> COMPUTE </item>
++      <item> CONCATENATE </item>
++      <item> CONDENSE </item>
++      <item> CONSTANTS </item>
++      <item> CONTINUE </item>
++      <item> CONTROLS </item>
++      <item> COUNTRY </item>
++      <item> DATA </item>
++      <item> DECIMALS </item>
++      <item> DEFAULT </item>
++      <item> DELETE </item>
++      <item> DELETING </item>
++      <item> DESCENDING </item>
++      <item> DESCRIBE </item>
++      <item> DO </item>
++      <item> DUPLICATES </item>
++      <item> EDIT </item>
++      <item> ELSE </item>
++      <item> ELSEIF </item>
++      <item> END </item>
++      <item> ENDCASE </item>
++      <item> ENDCHAIN </item>
++      <item> ENDDO </item>
++      <item> ENDIF </item>
++      <item> ENDLOOP </item>
++      <item> ENDMODULE </item>
++      <item> ENDSELECT </item>
++      <item> ENDWHILE </item>
++      <item> ENTRIES </item>
++      <item> EQ </item>
++      <item> EXCEPTIONS </item>
++      <item> EXCLUDING </item>
++      <item> EXIT </item>
++      <item> EXIT-COMMAND </item>
++      <item> EXPORT </item>
++      <item> EXPORTING </item>
++      <item> FIELD </item>
++      <item> FIRST </item>
++      <item> FOR </item>
++      <item> FORMAT </item>
++      <item> FRAME </item>
++      <item> FREE </item>
++      <item> FROM </item>
++      <item> GE </item>
++      <item> GROUP </item>
++      <item> GT </item>
++      <item> HEADER </item>
++      <item> HEADING </item>
++      <item> HIDE </item>
++      <item> HOTSPOT </item>
++      <item> ID </item>
++      <item> IF </item>
++      <item> IMPORT </item>
++      <item> IMPORTING </item>
++      <item> IN </item>
++      <item> INDEX </item>
++      <item> INITIAL </item>
++      <item> INNER </item>
++      <item> INPUT </item>
++      <item> INSERT </item>
++      <item> INTENSIFIED </item>
++      <item> INTERVALS </item>
++      <item> INTO </item>
++      <item> IS </item>
++      <item> JOIN </item>
++      <item> KEY </item>
++      <item> LE </item>
++      <item> LEAVE </item>
++      <item> LEFT </item>
++      <item> LEFT-JUSTIFIED </item>
++      <item> LIKE </item>
++      <item> LINE </item>
++      <item> LINE-COUNT </item>
++      <item> LINES </item>
++      <item> LINES  </item>
++      <item> LINE-SIZE </item>
++      <item> LIST-PROCESSING </item>
++      <item> LOOP </item>
++      <item> LT </item>
++      <item> MASK </item>
++      <item> MEMORY </item>
++      <item> MESSAGE </item>
++      <item> MESSAGE-ID </item>
++      <item> MOD </item>
++      <item> MODIFY </item>
++      <item> MODULE </item>
++      <item> MOVE </item>
++      <item> MOVE-CORRESPONDING </item>
++      <item> NE </item>
++      <item> NEW-LINE </item>
++      <item> NEW-PAGE </item>
++      <item> NO </item>
++      <item> NO-EXTENSION </item>
++      <item> NO-GAP </item>
++      <item> NO-SCROLLING </item>
++      <item> NOT </item>
++      <item> NO-ZERO </item>
++      <item> NUMBER </item>
++      <item> OBLIGATORY </item>
++      <item> OCCURS </item>
++      <item> OF </item>
++      <item> OFF </item>
++      <item> ON </item>
++      <item> OR </item>
++      <item> OTHERS </item>
++      <item> OUTPUT </item>
++      <item> PAGE </item>
++      <item> PARAMETER </item>
++      <item> PARAMETERS </item>
++      <item> PERFORM </item>
++      <item> PF-STATUS </item>
++      <item> POS_HIGH </item>
++      <item> POS_LOW </item>
++      <item> POSITION </item>
++      <item> PROGRAM </item>
++      <item> RADIOBUTTON </item>
++      <item> RANGES </item>
++      <item> READ </item>
++      <item> REFRESH </item>
++      <item> REPORT </item>
++      <item> RESERVE </item>
++      <item> RESET </item>
++      <item> RIGHT </item>
++      <item> RIGHT-JUSTIFIED </item>
++      <item> ROLLBACK </item>
++      <item> ROWS </item>
++      <item> SCREEN </item>
++      <item> SCREEN-GROUP1 </item>
++      <item> SCREEN-GROUP2 </item>
++      <item> SCREEN-GROUP3 </item>
++      <item> SCREEN-GROUP4 </item>
++      <item> SCREEN-GROUP5 </item>
++      <item> SCREEN-INPUT </item>
++      <item> SCREEN-INTENSIFIED </item>
++      <item> SEARCH </item>
++      <item> SELECT </item>
++      <item> SELECTION </item>
++      <item> SELECTION-SCREEN </item>
++      <item> SELECT-OPTIONS </item>
++      <item> SEPARATED </item>
++      <item> SET </item>
++      <item> SHIFT </item>
++      <item> SINGLE </item>
++      <item> SKIP </item>
++      <item> SORT </item>
++      <item> SPACE </item>
++      <item> SPLIT </item>
++      <item> STANDARD </item>
++      <item> STARTING </item>
++      <item> STOP </item>
++      <item> STRLEN </item>
++      <item> STRUCTURE </item>
++      <item> SUBTRACT </item>
++      <item> SY-CUCOL </item>
++      <item> SY-DATUM </item>
++      <item> SY-DYNNR </item>
++      <item> SY-LINSZ </item>
++      <item> SY-LOOPC </item>
++      <item> SY-LSIND </item>
++      <item> SY-MSGID </item>
++      <item> SY-MSGTY </item>
++      <item> SY-MSGV1 </item>
++      <item> SY-MSGV2 </item>
++      <item> SY-MSGV3 </item>
++      <item> SY-MSGV4 </item>
++      <item> SY-PAGNO </item>
++      <item> SY-REPID </item>
++      <item> SY-STEPL </item>
++      <item> SY-SUBRC </item>
++      <item> SY-TABIX </item>
++      <item> SY-TCODE </item>
++      <item> SY-TMAXL </item>
++      <item> SY-UCOMM </item>
++      <item> SY-ULINE </item>
++      <item> SY-UNAME </item>
++      <item> SY-UZEIT </item>
++      <item> SY-VLINE </item>
++      <item> TABLE </item>
++      <item> TABLES </item>
++      <item> TABLEVIEW </item>
++      <item> TIMES </item>
++      <item> TITLE </item>
++      <item> TITLEBAR </item>
++      <item> TO </item>
++      <item> TRAILING </item>
++      <item> TRANSPORTING </item>
++      <item> TYPE </item>
++      <item> TYPE-POOLS </item>
++      <item> TYPES </item>
++      <item> ULINE </item>
++      <item> UP </item>
++      <item> UPDATE </item>
++      <item> USING </item>
++      <item> VALUE </item>
++      <item> WHEN </item>
++      <item> WHERE </item>
++      <item> WHILE </item>
++      <item> WITH </item>
++      <item> WORK </item>
++      <item> WRITE </item>
++      <item> AFTER </item>
++      <item> BEFORE </item>
++      <item> CALL </item>
++      <item> DURING </item>
++      <item> ENDFORM </item>
++      <item> END-OF-SELECTION </item>
++      <item> FORM </item>
++      <item> FUNCTION </item>
++      <item> INCLUDE </item>
++      <item> LINE-SELECTION </item>
++      <item> PROCESS </item>
++      <item> START-OF-SELECTION </item>
++      <item> TOP-OF-PAGE </item>
++      <item> TRANSACTION </item>
++      <item> USER-COMMAND </item>
++    </list>
++
++    <contexts>
++	    <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
++		    <keyword attribute="Keyword" context="#stay" String="keywords"/>
++		    <DetectChar attribute="Comment" context="Comment" char="&quot;"/>
++		    <DetectChar attribute="Comment" context="Comment" char="*"/>
++		    <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;:=&gt;[]^~"/>
++	    </context>
++	    <context attribute="Comment" lineEndContext="#pop" name="Comment">
++		       <DetectChar attribute="Comment" context="#pop" char="&quot;"/>
++		       <DetectChar attribute="Comment" context="#pop" char="*"/>
++	    </context>
++    </contexts>
++    
++    <itemDatas>
++	    <itemData name="Normal Text" 	defStyleNum="dsNormal"/>
++	    <itemData name="Keyword"  		defStyleNum="dsKeyword"/>
++	    <itemData name="Comment"  		defStyleNum="dsComment"/>
++	    <itemData name="Symbol"  		defStyleNum="dsNormal"/>
++    </itemDatas>
++
++  </highlighting>
++  
++  <general>
++    <comments>
++      <comment name="singleLine" start="&quot;" />
++      <comment name="singleLine" start="*" />
++      <comment name="multiLine" start="*" />
++    </comments>
++    <keywords casesensitive="0" />
++  </general>
++  
++</language>
+--- /dev/null
++++ b/kate/syntax/data/erlang.xml
+@@ -0,0 +1,249 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE language SYSTEM "language.dtd"
++[
++          <!ENTITY atomstr    "\b[a-z][a-zA-Z0-9@]*\b" >
++          <!ENTITY varstr    "\b[A-Z][a-zA-Z0-9@]*\b" >
++          <!-- pragmas defined here, because "keyword" can't handle the leading '-' -->
++          <!ENTITY pragmas 
++             "^(?:-module|-export|-define|-undef|-ifdef|-ifndef|-else|-endif|-include|-include_lib)" >
++          <!--  same with separators: (from s3.9 p 24 of erlang spec) -->
++          <!ENTITY separators "(?:\(|\)|\{|\}|\[|\]|\.|\:|\||\|\||;|\,|\?|-&gt;|\#)" >
++          <!--  and operators - although words are dealt with separately -->
++          <!ENTITY opsymbols 
++                   "(?:\+|-|\*|\/|==|\/=|=:=|=\/=|&lt;|=&lt;|&gt;|&gt;=|\+\+|--|=|!|&lt;-)" >
++]
++>
++<!--
++    Copyright (C) 2007 Bill Ross <bill at emailme.net.au>
++
++    
++    This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License version 2 as published by the Free Software Foundation.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++  
++   TODO
++   - '@' at the end of an atom or variable gets coded as normal text - fix this!! 
++-->
++
++<language name="Erlang" version="1.01" kateversion="2.5" section="Scripts" extensions="*.erl" mimetype="" author="Bill Ross (bill at emailme.net)" license="LGPL">
++  <highlighting>
++    <list name="keywords">
++      <!-- ====== s3.8 p 24 of erlang spec ===== -->
++      <item> after </item>
++      <item> begin </item>
++      <item> case </item>
++      <item> catch </item>
++      <item> cond </item>
++      <item> end </item>
++      <item> fun </item>
++      <item> if </item>
++      <item> let </item>
++      <item> of </item>
++      <item> query </item>
++      <item> receive </item>
++      <item> all_true </item>
++      <item> some_true </item>
++    </list>
++    <list name="operators">
++      <!-- operators: s3.9 p 24 of erlang spec -->
++      <!-- see also opsymbols for the symbols -->
++      <item> div </item>
++      <item> rem </item>
++      <item> or </item>
++      <item> xor </item>
++      <item> bor </item>
++      <item> bxor </item>
++      <item> bsl </item>
++      <item> bsr </item>
++      <item> and </item>
++      <item> band </item>
++      <item> not </item>
++      <item> bnot </item>
++    </list>
++    <list name="functions">
++      <!-- all standard (erlang) functions are here, -->
++      <!-- except those defined as erlang:function (those will show as functions anyway -->
++      <item>abs</item>
++      <item>accept</item>
++      <item>alarm</item>
++      <item>apply</item>
++      <item>atom_to_list</item>
++      <item>binary_to_list</item>
++      <item>binary_to_term</item>
++      <item>check_process_code</item>
++      <item>concat_binary</item>
++      <item>date</item>
++      <item>delete_module</item>
++      <item>disconnect_node</item>
++      <item>element</item>
++      <item>erase</item>
++      <item>exit</item>
++      <item>float</item>
++      <item>float_to_list</item>
++      <item>garbage_collect</item>
++      <item>get</item>
++      <item>get_keys</item>
++      <item>group_leader</item>
++      <item>halt</item>
++      <item>hd</item>
++      <item>integer_to_list</item>
++      <item>is_alive</item>
++      <item>is_atom</item>
++      <item>is_binary</item>
++      <item>is_boolean</item>
++      <item>is_float</item>
++      <item>is_function</item>
++      <item>is_integer</item>
++      <item>is_list</item>
++      <item>is_number</item>
++      <item>is_pid</item>
++      <item>is_port</item>
++      <item>is_process_alive</item>
++      <item>is_record</item>
++      <item>is_reference</item>
++      <item>is_tuple</item>
++      <item>length</item>
++      <item>link</item>
++      <item>list_to_atom</item>
++      <item>list_to_binary</item>
++      <item>list_to_float</item>
++      <item>list_to_integer</item>
++      <item>list_to_pid</item>
++      <item>list_to_tuple</item>
++      <item>load_module</item>
++      <item>loaded</item>
++      <item>localtime</item>
++      <item>make_ref</item>
++      <item>module_loaded</item>
++      <item>node</item>
++      <item>nodes</item>
++      <item>now</item>
++      <item>open_port</item>
++      <item>pid_to_list</item>
++      <item>port_close</item>
++      <item>port_command</item>
++      <item>port_connect</item>
++      <item>port_control</item>
++      <item>ports</item>
++      <item>pre_loaded</item>
++      <item>process_flag</item>
++      <item>process_info</item>
++      <item>processes</item>
++      <item>purge_module</item>
++      <item>put</item>
++      <item>register</item>
++      <item>registered</item>
++      <item>round</item>
++      <item>self</item>
++      <item>setelement</item>
++      <item>size</item>
++      <item>spawn</item>
++      <item>spawn_link</item>
++      <item>spawn_opt</item>
++      <item>split_binary</item>
++      <item>statistics</item>
++      <item>term_to_binary</item>
++      <item>throw</item>
++      <item>time</item>
++      <item>tl</item>
++      <item>trunc</item>
++      <item>tuple_to_list</item>
++      <item>unlink</item>
++      <item>unregister</item>
++      <item>whereis</item>
++   </list>
++    <contexts>
++      <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text" >
++        <RegExpr attribute="Pragma" context="#stay" column="0" String="&pragmas;" />
++        <keyword attribute="Keyword" context="#stay" String="keywords" />
++        <keyword attribute="Operator" context="#stay" String="operators" />
++        <RegExpr attribute="Operator" context="#stay" String="&opsymbols;" />
++        <keyword attribute="Function" context="#stay" String="functions" />
++        <RegExpr attribute="Separator" context="#stay" String="&separators;" />
++        <DetectSpaces />
++        <DetectChar attribute="Comment" context="comment" char="%" />
++
++        <!-- Functions (in addition to named functions dealt with above) -->
++        <!-- simple version - got to be in form module:function -->
++        <RegExpr attribute="Function" context="#pop" String="&atomstr;:&atomstr;" />
++        <RegExpr attribute="Functon" context="isfunction" String="&atomstr;\(" lookAhead="true" />
++
++        <!-- Variables - begin with upper case, or between single quotes -->
++        <RegExpr attribute="Variable" context="#pop" String="&varstr;" />
++
++        <!-- atoms - begin with lower case (letters, numbers, @), 
++             or anything between single quotes -->
++        <DetectChar attribute="Atom" context="atomquote" char="'" /> 
++        <RegExpr attribute="Atom" context="#pop" String="&atomstr;" />
++        
++        <DetectChar attribute="String" context="stringquote" char="&quot;" />
++        
++        <!-- numbers - these work -->
++        <!-- integers have three forms 7, 3#22, $A -->
++        <!-- float must have a number after the decimal point, or it doesn't count -->
++        <RegExpr attribute="Float" context="#pop" String="[0-9]+\.[0-9]+(?:[eE][+-]?[0-9]+)?" />
++        <RegExpr attribute="Number" context="#pop" String="\d+#[a-zA-Z0-9]+" />
++        <RegExpr attribute="Integer" context="#pop" String="\$\S" />
++        <RegExpr attribute="Integer" context="#pop" String="[0-9]+" />
++
++      </context>
++
++      <!-- isfunction -->
++      <!-- confirm that this is a function and capture name for formatting -->
++      <!-- lookahead for '(' already performed by the time we are here -->
++      <context name="isfunction" attribute="Function" lineEndContext="#pop"  >
++        <RegExpr attribute="Function" context="#pop" String="&atomstr;" />
++      </context>
++
++      <!-- finish off the atom in quoted string (allow for escaped single quotes -->
++      <context name="atomquote" attribute="Atom" lineEndContext="#pop">
++        <RegExpr attribute="Atom" context="#pop" String="(?:(?:\\')?[^']*)*'" />
++      </context>
++
++      <!-- finish off the atom in quoted string (allow for escaped single quotes -->
++      <context name="stringquote" attribute="String" lineEndContext="#pop">
++        <RegExpr attribute="String" context="#pop" String="(?:(?:\\&quot;)?[^&quot;]*)*&quot;" />
++      </context>
++      
++      <!-- finish off the comment (allows for alerts) -->
++      <context name="comment" attribute="Comment" lineEndContext="#pop">
++        <DetectSpaces />
++        <IncludeRules context="##Alerts" />
++        <DetectIdentifier />
++      </context>
++
++    </contexts>
++    <itemDatas>
++      <itemData name="Normal Text"               defStyleNum="dsNormal" />
++      <itemData name="Keyword"                   defStyleNum="dsKeyword" />
++      <itemData name="Pragma"                    defStyleNum="dsKeyword" />
++      <itemData name="Function"                  defStyleNum="dsFunction" />
++      <itemData name="Separator"                 defStyleNum="dsFunction" />
++      <itemData name="Operator"                  defStyleNum="dsKeyword"  />
++      <itemData name="Variable"                  defStyleNum="dsDataType" />
++      <itemData name="Integer"                   defStyleNum="dsDecVal" />
++      <itemData name="Number"                    defStyleNum="dsBaseN" />
++      <itemData name="Float"                     defStyleNum="dsFloat" />
++      <itemData name="Atom"                      defStyleNum="dsChar" />
++      <itemData name="String"                    defStyleNum="dsString" />
++      <itemData name="Comment"                   defStyleNum="dsComment" />
++    </itemDatas>
++  </highlighting>
++  <general>
++    <comments>
++      <comment name="singleLine" start="%" />
++    </comments>
++    <keywords casesensitive="1" />
++  </general>
++</language>
++<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
+--- /dev/null
++++ b/kate/syntax/data/noweb.xml
+@@ -0,0 +1,52 @@
++<?xml version="1.0" encoding="UTF-8" ?>
++<!DOCTYPE language SYSTEM "language.dtd">
++<language name="noweb" version="1.0" kateversion="2.4" section="Sources" extensions="*.w;*.nw" author="Scott Collins (scc at scottcollins.net)">
++<!-- 
++#########################################################################
++# First version added to repository was 0.4, added as 1.0 .
++#
++# Article about this highlighter:
++#   http://scottcollins.net/articles/Kate.html
++# 
++# Indirect source file:
++#   http://scottcollins.net/articles/Kate.w
++# 
++# Command used for extraction:
++#   $ notangle Kate.w -R"noweb.xml" > syntax/data/noweb.xml
++#########################################################################
++-->
++  <highlighting>
++    <contexts>
++      <context name="RawDocumentation" attribute="Prose" lineEndContext="#stay">
++        <RegExpr String="^&lt;&lt;.*&gt;&gt;=$" attribute="SectionName" context="CodeSection" beginRegion="CodeSection" />
++        <Detect2Chars char="@" char1="[" context="#stay" />
++        <Detect2Chars char="[" char1="[" attribute="Punctuation" context="CodeQuote" />
++        <IncludeRules context="##HTML" includeAttrib="true" />
++      </context>
++      <context name="CodeQuote" attribute="Code" lineEndContext="#stay">
++        <Detect2Chars char="@" char1="]" context="#stay" />
++        <RegExpr String="\]\](?!\])" minimal="true" attribute="Punctuation" context="#pop" />
++        <IncludeRules context="SectionNames" />
++        <IncludeRules context="##C++" includeAttrib="true" />
++      </context>
++      <context name="CodeSection" attribute="Code" lineEndContext="#stay">
++        <RegExpr String="^@$" attribute="Punctuation" context="RawDocumentation" endRegion="CodeSection" />
++        <RegExpr String="^@(?=[\s%])" attribute="Punctuation" context="RawDocumentation" endRegion="CodeSection" />
++        <RegExpr String="^&lt;&lt;.*&gt;&gt;=$" context="RawDocumentation" lookAhead="true" endRegion="CodeSection" />
++        <IncludeRules context="SectionNames" />
++        <IncludeRules context="##C++" includeAttrib="true" />
++      </context>
++      <context name="SectionNames" attribute="Prose" lineEndContext="#stay">
++        <RegExpr String="@&lt;&lt;" context="#stay" />
++        <RegExpr String="&lt;&lt;.*[^@]&gt;&gt;(?!=)" minimal="true" attribute="SectionName" />
++      </context>
++    </contexts>
++    <itemDatas>
++      <itemData name="Prose"        defStyleNum="dsNormal" />
++      <itemData name="Code"         defStyleNum="dsNormal" />
++      <itemData name="Punctuation"  defStyleNum="dsRegionMarker" bold="true" />
++      <itemData name="SectionName"  defStyleNum="dsRegionMarker" italic="true" />
++    </itemDatas>
++  </highlighting>
++</language>
++
+--- a/kate/syntax/katehighlight.cpp
++++ b/kate/syntax/katehighlight.cpp
+@@ -74,7 +74,7 @@
+   {
+     noHl = true;
+     iName = "None"; // not translated internal name (for config and more)
+-    iNameTranslated = i18n("None"); // user visible name
++    iNameTranslated = i18nc("Syntax highlighting", "None"); // user visible name
+     iSection = "";
+     iHidden = false;
+     m_additionalData.insert( "none", new HighlightPropertyBag );
+--- a/kate/utils/kateglobal.cpp
++++ b/kate/utils/kateglobal.cpp
+@@ -294,7 +294,7 @@
+       return new KateSaveConfigTab (parent);
+ 
+     case 4:
+-      return new KateEditKeyConfiguration (parent, 0);
++      return new KateEditKeyConfiguration (parent);
+ 
+     case 5:
+       return new KatePartPluginConfigPage (parent);
+@@ -381,7 +381,7 @@
+       return KIcon("document-save");
+ 
+     case 4:
+-      return KIcon("browser-go");
++      return KIcon("go-jump-locationbar");
+ 
+     case 5:
+       return KIcon("connection-established");
+--- a/kate/utils/katenamespace.h
++++ b/kate/utils/katenamespace.h
+@@ -28,6 +28,8 @@
+     CloseFileEdit,
+     /// Editing performed by the user
+     UserInputEdit,
++    /// Editing performed by the user within an input method context
++    InputMethodContextEdit,
+     /// Editing from cutting, copying and pasting
+     CutCopyPasteEdit,
+     /// Editing from search + replace algorithms
+--- a/kate/utils/katepartpluginmanager.cpp
++++ b/kate/utils/katepartpluginmanager.cpp
+@@ -44,7 +44,7 @@
+ 
+ KatePartPluginManager::KatePartPluginManager()
+   : QObject(),
+-    m_config(new KConfig("katepartpluginsrc", KConfig::CascadeConfig))
++    m_config(new KConfig("katepartpluginsrc", KConfig::NoGlobals))
+ {
+   setupPluginList ();
+   loadConfig ();
+--- a/kate/utils/katestyletreewidget.cpp
++++ b/kate/utils/katestyletreewidget.cpp
+@@ -129,7 +129,7 @@
+   setItemDelegate(new KateStyleTreeDelegate(this));
+ 
+   QStringList headers;
+-  headers << i18n("Context") << QString() << QString() << QString() << QString() << i18n("Normal") << i18n("Selected") << i18n("Background") << i18n("Background Selected");
++  headers << i18nc("@title:column Meaning of text in editor", "Context") << QString() << QString() << QString() << QString() << i18nc("@title:column Text style", "Normal") << i18nc("@title:column Text style", "Selected") << i18nc("@title:column Text style", "Background") << i18nc("@title:column Text style", "Background Selected");
+   if(showUseDefaults) {
+     headers << i18n("Use Default Style");
+   }
+--- a/kate/utils/kateprinter.h
++++ b/kate/utils/kateprinter.h
+@@ -21,12 +21,11 @@
+ #ifndef __KATE_PRINTER_H__
+ #define __KATE_PRINTER_H__
+ 
+-#include <kprintdialogpage.h>
++#include <QtGui/QWidget>
+ 
+ class KateDocument;
+ 
+ class KColorButton;
+-class KPrinter;
+ class QCheckBox;
+ class QComboBox;
+ class QGroupBox;
+@@ -40,7 +39,6 @@
+     static bool print (KateDocument *doc);
+ };
+ 
+-#ifndef Q_WS_WIN //TODO: reenable
+ //BEGIN Text settings
+ /*
+   Text settings page:
+@@ -48,21 +46,22 @@
+   - Print Line Numbers
+     () Smart () Yes () No
+ */
+-class KatePrintTextSettings : public KPrintDialogPage
++class KatePrintTextSettings : public QWidget
+ {
+   Q_OBJECT
+   public:
+-    explicit KatePrintTextSettings( KPrinter *printer, QWidget *parent=0 );
++    explicit KatePrintTextSettings( QWidget *parent=0 );
+     ~KatePrintTextSettings(){}
+ 
+-    void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+-    void setOptions(const QMap<QString,QString>& opts);
++//     bool printSelection();
++    bool printLineNumbers();
++    bool printGuide();
+ 
+     /* call if view has a selection, enables the seelction checkbox according to the arg */
+-    void enableSelection( bool );
++//     void enableSelection( bool );
+ 
+   private:
+-    QCheckBox *cbSelection, *cbLineNumbers, *cbGuide;
++    QCheckBox /* *cbSelection,*/ *cbLineNumbers, *cbGuide;
+ };
+ //END Text Settings
+ 
+@@ -75,15 +74,26 @@
+     o colors
+ */
+ 
+-class KatePrintHeaderFooter : public KPrintDialogPage
++class KatePrintHeaderFooter : public QWidget
+ {
+   Q_OBJECT
+   public:
+-    explicit KatePrintHeaderFooter( KPrinter *printer, QWidget *parent=0 );
++    explicit KatePrintHeaderFooter( QWidget *parent=0 );
+     ~KatePrintHeaderFooter(){}
+ 
+-    void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+-    void setOptions(const QMap<QString,QString>& opts);
++    QFont font();
++
++    bool useHeader();
++    QStringList headerFormat();
++    QColor headerForeground();
++    QColor headerBackground();
++    bool useHeaderBackground();
++
++    bool useFooter();
++    QStringList footerFormat();
++    QColor footerForeground();
++    QColor footerBackground();
++    bool useFooterBackground();
+ 
+   public Q_SLOTS:
+     void setHFFont();
+@@ -91,7 +101,6 @@
+   private:
+     QCheckBox *cbEnableHeader, *cbEnableFooter;
+     QLabel *lFontPreview;
+-    QString strFont;
+     QGroupBox *gbHeader, *gbFooter;
+     QLineEdit *leHeaderLeft, *leHeaderCenter, *leHeaderRight;
+     KColorButton *kcbtnHeaderFg, *kcbtnHeaderBg;
+@@ -113,15 +122,19 @@
+     o Margin
+     o Color
+ */
+-class KatePrintLayout : public KPrintDialogPage
++class KatePrintLayout : public QWidget
+ {
+   Q_OBJECT
+   public:
+-    explicit KatePrintLayout( KPrinter *printer, QWidget *parent=0 );
++    explicit KatePrintLayout( QWidget *parent=0 );
+     ~KatePrintLayout(){}
+ 
+-    void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+-    void setOptions(const QMap<QString,QString>& opts);
++    QString colorScheme();
++    bool useBackground();
++    bool useBox();
++    int boxWidth();
++    int boxMargin();
++    QColor boxColor();
+ 
+   private:
+     QComboBox *cmbSchema;
+@@ -131,6 +144,5 @@
+     KColorButton* kcbtnBoxColor;
+ };
+ //END Layout
+-#endif //!Q_WS_WIN
+ 
+ #endif
+--- a/kate/utils/katebookmarks.cpp
++++ b/kate/utils/katebookmarks.cpp
+@@ -95,14 +95,14 @@
+ 
+     m_goNext = new KAction( i18n("Next Bookmark"), this);
+     ac->addAction("bookmarks_next", m_goNext);
+-    m_goNext->setIcon( KIcon( "find-next" ) );
++    m_goNext->setIcon( KIcon( "edit-find-next" ) );
+     m_goNext->setShortcut( Qt::ALT + Qt::Key_PageDown );
+     m_goNext->setWhatsThis(i18n("Go to the next bookmark."));
+     connect( m_goNext, SIGNAL( triggered() ), this, SLOT(goNext()) );
+ 
+     m_goPrevious = new KAction( i18n("Previous Bookmark"), this);
+     ac->addAction("bookmarks_previous", m_goPrevious);
+-    m_goPrevious->setIcon( KIcon( "find-previous" ) );
++    m_goPrevious->setIcon( KIcon( "edit-find-previous" ) );
+     m_goPrevious->setShortcut( Qt::ALT + Qt::Key_PageUp );
+     m_goPrevious->setWhatsThis(i18n("Go to the previous bookmark."));
+     connect( m_goPrevious, SIGNAL( triggered() ), this, SLOT(goPrevious()) );
+--- a/kate/utils/kateschema.cpp
++++ b/kate/utils/kateschema.cpp
+@@ -81,7 +81,7 @@
+ }
+ 
+ KateSchemaManager::KateSchemaManager ()
+-    : m_config ("kateschemarc", KConfig::CascadeConfig)
++    : m_config ("kateschemarc", KConfig::NoGlobals)
+ {
+   update ();
+ }
+--- a/kate/utils/kateconfig.cpp
++++ b/kate/utils/kateconfig.cpp
+@@ -701,12 +701,12 @@
+ 
+     // Read search pattern history
+     QStringListModel * const patternHistoryModel = KateHistoryModel::getPatternHistoryModel();
+-    QStringList patternHistory = config.readEntry(KEY_PATTERN_HISTORY, empty, ',');
++    QStringList patternHistory = config.readEntry(KEY_PATTERN_HISTORY, empty);
+     patternHistoryModel->setStringList(patternHistory);
+ 
+     // Read replacement text history
+     QStringListModel * const replacementHistoryModel = KateHistoryModel::getReplacementHistoryModel();
+-    QStringList replacementHistory = config.readEntry(KEY_REPLACEMENT_HISTORY, empty, ',');
++    QStringList replacementHistory = config.readEntry(KEY_REPLACEMENT_HISTORY, empty);
+     replacementHistoryModel->setStringList(replacementHistory);
+   }
+ 
+--- a/kate/utils/katefactory.cpp
++++ b/kate/utils/katefactory.cpp
+@@ -61,16 +61,14 @@
+     {
+       QByteArray classname( _classname );
+ 
+-      // match both :: and /
+-
+       // default to the kparts::* behavior of having one single widget() if the user don't requested a pure document
+-      bool bWantSingleView = !(( classname == "KTextEditor/Document" ) || ( classname == "KTextEditor::Document" ));
++      bool bWantSingleView = ( classname != "KTextEditor::Document" );
+ 
+       // does user want browserview?
+-      bool bWantBrowserView = ( classname == "Browser/View" ) || ( classname == "Browser::View" );
++      bool bWantBrowserView = false;
+ 
+       // should we be readonly?
+-      bool bWantReadOnly = (bWantBrowserView || ( classname == "KParts/ReadOnlyPart" ) || ( classname == "KParts::ReadOnlyPart" ));
++      bool bWantReadOnly = (bWantBrowserView || ( classname == "KParts::ReadOnlyPart" ));
+ 
+       KParts::ReadWritePart *part = new KateDocument (bWantSingleView, bWantBrowserView, bWantReadOnly, parentWidget, parent);
+       part->setReadWrite( !bWantReadOnly );
+--- a/kate/utils/kateautoindent.cpp
++++ b/kate/utils/kateautoindent.cpp
+@@ -68,10 +68,10 @@
+ QString KateAutoIndent::modeDescription (int mode)
+ {
+   if (mode == 0 || mode >= modeCount ())
+-    return i18n ("None");
++    return i18nc ("Autoindent mode", "None");
+ 
+   if (mode == 1)
+-    return i18n ("Normal");
++    return i18nc ("Autoindent mode", "Normal");
+ 
+   return KateGlobal::self()->jscriptManager()->indentationScriptByIndex(mode-2)->info()->name;
+ }
+--- a/kate/utils/kateprinter.cpp
++++ b/kate/utils/kateprinter.cpp
+@@ -29,6 +29,7 @@
+ #include "katerenderer.h"
+ #include "kateschema.h"
+ #include "katetextline.h"
++#include "kateview.h"
+ 
+ #include <kapplication.h>
+ #include <kcolorbutton.h>
+@@ -36,7 +37,7 @@
+ #include <kdialog.h> // for spacingHint()
+ #include <kfontdialog.h>
+ #include <klocale.h>
+-#include <kprinter.h>
++#include <kdeprintdialog.h>
+ #include <kurl.h>
+ #include <kuser.h> // for loginName
+ 
+@@ -44,6 +45,8 @@
+ #include <QtGui/QCheckBox>
+ #include <QtGui/QComboBox>
+ #include <QtGui/QGroupBox>
++#include <QtGui/QPrintDialog>
++#include <QtGui/QPrinter>
+ 
+ #include <QtGui/QLabel>
+ #include <QtGui/QLayout>
+@@ -55,618 +58,595 @@
+ //BEGIN KatePrinter
+ bool KatePrinter::print (KateDocument *doc)
+ {
+-#if 0
+-  KPrinter printer;
++
++  QPrinter printer;
+ 
+   // docname is now always there, including the right Untitled name
+   printer.setDocName(doc->documentName());
+ 
+-  KatePrintTextSettings *kpts = new KatePrintTextSettings(&printer, NULL);
+-
+-#ifdef __GNUC__
+-#warning fixme later
+-#endif
+-  //kpts->enableSelection( doc->hasSelection() );
+-
+-  printer.addDialogPage( kpts );
+-  printer.addDialogPage( new KatePrintHeaderFooter(&printer, NULL) );
+-  printer.addDialogPage( new KatePrintLayout(&printer, NULL) );
+-
+-   if ( printer.setup( doc->widget(), i18n("Print %1", printer.docName()) ) )
+-   {
+-     KateRenderer renderer(doc);
+-     //renderer.config()->setSchema (1);
+-     renderer.setPrinterFriendly(true);
++  KatePrintTextSettings *kpts = new KatePrintTextSettings;
++  KatePrintHeaderFooter *kphf = new KatePrintHeaderFooter;
++  KatePrintLayout *kpl = new KatePrintLayout;
+ 
+-     QPainter paint( &printer );
+-     /*
+-        We work in tree cycles:
+-        1) initialize variables and retrieve print settings
+-        2) prepare data according to those settings
+-        3) draw to the printer
+-     */
+-     uint pdmWidth = printer.width();
+-     uint pdmHeight = printer.height();
+-     uint y = 0;
+-     uint xstart = 0; // beginning point for painting lines
+-     uint lineCount = 0;
+-     uint maxWidth = pdmWidth;
+-     uint headerWidth = pdmWidth;
+-     int startCol = 0;
+-     int endCol = 0;
+-     bool needWrap = true;
+-     bool pageStarted = true;
+-
+-     // Text Settings Page
+-     bool selectionOnly = false;
+-
+-#ifdef __GNUC__
+-  #warning fixme later
+-#endif
+-     //( doc->hasSelection() &&
+-       //                    ( printer.option("app-kate-printselection") == "true" ) );
++  QList<QWidget*> tabs;
++  tabs << kpts;
++  tabs << kphf;
++  tabs << kpl;
+ 
+-     int selStartCol = 0;
+-     int selEndCol = 0;
++  QPrintDialog *printDialog = KdePrint::createPrintDialog(&printer, tabs, doc->widget());
+ 
+-     bool useGuide = ( printer.option("app-kate-printguide") == "true" );
+-     int guideHeight = 0;
+-     int guideCols = 0;
+-
+-     bool printLineNumbers = ( printer.option("app-kate-printlinenumbers") == "true" );
+-     uint lineNumberWidth( 0 );
+-
+-     // Header/Footer Page
+-     QFont headerFont; // used for header/footer
+-     QString f = printer.option("app-kate-hffont");
+-     if (!f.isEmpty())
+-       headerFont.fromString( f );
+-
+-     bool useHeader = (printer.option("app-kate-useheader") == "true");
+-     QColor headerBgColor(printer.option("app-kate-headerbg"));
+-     QColor headerFgColor(printer.option("app-kate-headerfg"));
+-     uint headerHeight( 0 ); // further init only if needed
+-     QStringList headerTagList; // do
+-     bool headerDrawBg = false; // do
+-
+-     bool useFooter = (printer.option("app-kate-usefooter") == "true");
+-     QColor footerBgColor(printer.option("app-kate-footerbg"));
+-     QColor footerFgColor(printer.option("app-kate-footerfg"));
+-     uint footerHeight( 0 ); // further init only if needed
+-     QStringList footerTagList; // do
+-     bool footerDrawBg = false; // do
+-
+-     // Layout Page
+-     renderer.config()->setSchema( printer.option("app-kate-colorscheme") );
+-     bool useBackground = ( printer.option("app-kate-usebackground") == "true" );
+-     bool useBox = (printer.option("app-kate-usebox") == "true");
+-     int boxWidth(printer.option("app-kate-boxwidth").toInt());
+-     QColor boxColor(printer.option("app-kate-boxcolor"));
+-     int innerMargin = useBox ? printer.option("app-kate-boxmargin").toInt() : 6;
+-
+-     // Post initialization
+-     uint maxHeight = (useBox ? pdmHeight-innerMargin : pdmHeight);
+-     uint currentPage( 1 );
+-     uint lastline = doc->lastLine(); // necessary to print selection only
+-     uint firstline( 0 );
++  if ( doc->activeView()->selection() )
++    printDialog->addEnabledOption(QAbstractPrintDialog::PrintSelection);
+ 
+-     QList<KateExtendedAttribute::Ptr> ilist;
+-
+-     if (useGuide)
+-       doc->highlight()->getKateExtendedAttributeListCopy (renderer.config()->schema(), ilist);
+-
+-     /*
+-        Now on for preparations...
+-        during preparations, variable names starting with a "_" means
+-        those variables are local to the enclosing block.
++  if ( printDialog->exec() )
++  {
++    KateRenderer renderer(doc, doc->activeKateView());
++    renderer.config()->setSchema (kpl->colorScheme());
++    renderer.setPrinterFriendly(true);
++
++    QPainter paint( &printer );
++    /*
++     *        We work in tree cycles:
++     *        1) initialize variables and retrieve print settings
++     *        2) prepare data according to those settings
++     *        3) draw to the printer
+      */
+-     {
+-       if ( selectionOnly )
+-       {
+-#ifdef __GNUC__
+-#warning fixme later
+-#endif
+-         // set a line range from the first selected line to the last
+-    //     firstline = doc->selectionStartLine();
+-      //   selStartCol = doc->selectionStartColumn();
+-       //  lastline = doc->selectionEndLine();
+-       //  selEndCol = doc->selectionEndColumn();
+-
+-         lineCount = firstline;
+-       }
+-
+-       if ( printLineNumbers )
+-       {
+-         // figure out the horiizontal space required
+-         QString s( QString("%1 ").arg( doc->lines() ) );
+-         s.fill('5', -1); // some non-fixed fonts haven't equally wide numbers
+-                          // FIXME calculate which is actually the widest...
+-         lineNumberWidth = renderer.currentFontMetrics().width( s );
+-         // a small space between the line numbers and the text
+-         int _adj = renderer.currentFontMetrics().width( "5" );
+-         // adjust available width and set horizontal start point for data
+-         maxWidth -= (lineNumberWidth + _adj);
+-         xstart += lineNumberWidth + _adj;
+-       }
+-
+-       if ( useHeader || useFooter )
+-       {
+-         // Set up a tag map
+-         // This retrieves all tags, ued or not, but
+-         // none of theese operations should be expensive,
+-         // and searcing each tag in the format strings is avoided.
+-         QDateTime dt = QDateTime::currentDateTime();
+-         QMap<QString,QString> tags;
+-
+-         KUser u (KUser::UseRealUserID);
+-         tags["u"] = u.loginName();
+-
+-         tags["d"] = KGlobal::locale()->formatDateTime(dt, KLocale::ShortDate);
+-         tags["D"] =  KGlobal::locale()->formatDateTime(dt, KLocale::LongDate);
+-         tags["h"] =  KGlobal::locale()->formatTime(dt.time(), false);
+-         tags["y"] =  KGlobal::locale()->formatDate(dt.date(), KLocale::ShortDate);
+-         tags["Y"] =  KGlobal::locale()->formatDate(dt.date(), KLocale::LongDate);
+-         tags["f"] =  doc->url().fileName();
+-         tags["U"] =  doc->url().prettyUrl();
+-         if ( selectionOnly )
+-         {
+-           QString s( i18n("(Selection of) ") );
+-           tags["f"].prepend( s );
+-           tags["U"].prepend( s );
+-         }
+-
+-         QRegExp reTags( "%([dDfUhuyY])" ); // TODO tjeck for "%%<TAG>"
+-
+-         if (useHeader)
+-         {
+-           headerDrawBg = ( printer.option("app-kate-headerusebg") == "true" );
+-           headerHeight = QFontMetrics( headerFont ).height();
+-           if ( useBox || headerDrawBg )
+-             headerHeight += innerMargin * 2;
+-           else
+-             headerHeight += 1 + QFontMetrics( headerFont ).leading();
+-
+-           QString headerTags = printer.option("app-kate-headerformat");
+-           int pos = reTags.indexIn( headerTags );
+-           QString rep;
+-           while ( pos > -1 )
+-           {
+-             rep = tags[reTags.cap( 1 )];
+-             headerTags.replace( (uint)pos, 2, rep );
+-             pos += rep.length();
+-             pos = reTags.indexIn( headerTags, pos );
+-           }
+-           headerTagList = headerTags.split('|');
+-
+-           if (!headerBgColor.isValid())
+-             headerBgColor = Qt::lightGray;
+-           if (!headerFgColor.isValid())
+-             headerFgColor = Qt::black;
+-         }
+-
+-         if (useFooter)
+-         {
+-           footerDrawBg = ( printer.option("app-kate-footerusebg") == "true" );
+-           footerHeight = QFontMetrics( headerFont ).height();
+-           if ( useBox || footerDrawBg )
+-             footerHeight += 2*innerMargin;
+-           else
+-             footerHeight += 1; // line only
+-
+-           QString footerTags = printer.option("app-kate-footerformat");
+-           int pos = reTags.indexIn( footerTags );
+-           QString rep;
+-           while ( pos > -1 )
+-           {
+-             rep = tags[reTags.cap( 1 )];
+-             footerTags.replace( (uint)pos, 2, rep );
+-             pos += rep.length();
+-             pos = reTags.indexIn( footerTags, pos );
+-           }
+-
+-           footerTagList = footerTags.split('|');
+-           if (!footerBgColor.isValid())
+-             footerBgColor = Qt::lightGray;
+-           if (!footerFgColor.isValid())
+-             footerFgColor = Qt::black;
+-           // adjust maxheight, so we can know when/where to print footer
+-           maxHeight -= footerHeight;
+-         }
+-       } // if ( useHeader || useFooter )
+-
+-       if ( useBackground )
+-       {
+-         if ( ! useBox )
+-         {
+-           xstart += innerMargin;
+-           maxWidth -= innerMargin * 2;
+-         }
+-       }
+-
+-       if ( useBox )
+-       {
+-         if (!boxColor.isValid())
+-           boxColor = Qt::black;
+-         if (boxWidth < 1) // shouldn't be pssible no more!
+-           boxWidth = 1;
+-         // set maxwidth to something sensible
+-         maxWidth -= ( ( boxWidth + innerMargin )  * 2 );
+-         xstart += boxWidth + innerMargin;
+-         // maxheight too..
+-         maxHeight -= boxWidth;
+-       }
+-       else
+-         boxWidth = 0;
+-
++    uint pdmWidth = printer.width();
++    uint pdmHeight = printer.height();
++    int y = 0;
++    uint xstart = 0; // beginning point for painting lines
++    uint lineCount = 0;
++    uint maxWidth = pdmWidth;
++    int headerWidth = pdmWidth;
++    int startCol = 0;
++    int endCol = 0;
++    bool pageStarted = true;
++    int remainder = 0; // remaining sublines from a wrapped line (for the top of a new page)
++
++    // Text Settings Page
++    bool selectionOnly = (printDialog->printRange() == QAbstractPrintDialog::Selection);
++    bool useGuide = kpts->printGuide();
++
++    bool printLineNumbers = kpts->printLineNumbers();
++    uint lineNumberWidth( 0 );
++
++    // Header/Footer Page
++    QFont headerFont(kphf->font()); // used for header/footer
++
++    bool useHeader = kphf->useHeader();
++    QColor headerBgColor(kphf->headerBackground());
++    QColor headerFgColor(kphf->headerForeground());
++    uint headerHeight( 0 ); // further init only if needed
++    QStringList headerTagList; // do
++    bool headerDrawBg = false; // do
++
++    bool useFooter = kphf->useFooter();
++    QColor footerBgColor(kphf->footerBackground());
++    QColor footerFgColor(kphf->footerForeground());
++    uint footerHeight( 0 ); // further init only if needed
++    QStringList footerTagList; // do
++    bool footerDrawBg = false; // do
++
++    // Layout Page
++    renderer.config()->setSchema( kpl->colorScheme() );
++    bool useBackground = kpl->useBackground();
++    bool useBox = kpl->useBox();
++    int boxWidth(kpl->boxWidth());
++    QColor boxColor(kpl->boxColor());
++    int innerMargin = useBox ? kpl->boxMargin() : 6;
++
++    // Post initialization
++    int maxHeight = (useBox ? pdmHeight-innerMargin : pdmHeight);
++    uint currentPage( 1 );
++    uint lastline = doc->lastLine(); // necessary to print selection only
++    uint firstline( 0 );
++    int fontHeight = renderer.fontHeight();
++    KTextEditor::Range selectionRange;
++
++    /*
++    *        Now on for preparations...
++    *        during preparations, variable names starting with a "_" means
++    *        those variables are local to the enclosing block.
++    */
++    {
++      if ( selectionOnly )
++      {
++        // set a line range from the first selected line to the last
++        selectionRange = doc->activeView()->selectionRange();
++        firstline = selectionRange.start().line();
++        lastline = selectionRange.end().line();
++        lineCount = firstline;
++      }
++
++      if ( printLineNumbers )
++      {
++        // figure out the horiizontal space required
++        QString s( QString("%1 ").arg( doc->lines() ) );
++        s.fill('5', -1); // some non-fixed fonts haven't equally wide numbers
++        // FIXME calculate which is actually the widest...
++        lineNumberWidth = renderer.currentFontMetrics().width( s );
++        // a small space between the line numbers and the text
++        int _adj = renderer.currentFontMetrics().width( "5" );
++        // adjust available width and set horizontal start point for data
++        maxWidth -= (lineNumberWidth + _adj);
++        xstart += lineNumberWidth + _adj;
++      }
++
++      if ( useHeader || useFooter )
++      {
++        // Set up a tag map
++        // This retrieves all tags, ued or not, but
++        // none of theese operations should be expensive,
++        // and searcing each tag in the format strings is avoided.
++        QDateTime dt = QDateTime::currentDateTime();
++        QMap<QString,QString> tags;
++
++        KUser u (KUser::UseRealUserID);
++        tags["u"] = u.loginName();
++
++        tags["d"] = KGlobal::locale()->formatDateTime(dt, KLocale::ShortDate);
++        tags["D"] =  KGlobal::locale()->formatDateTime(dt, KLocale::LongDate);
++        tags["h"] =  KGlobal::locale()->formatTime(dt.time(), false);
++        tags["y"] =  KGlobal::locale()->formatDate(dt.date(), KLocale::ShortDate);
++        tags["Y"] =  KGlobal::locale()->formatDate(dt.date(), KLocale::LongDate);
++        tags["f"] =  doc->url().fileName();
++        tags["U"] =  doc->url().prettyUrl();
++        if ( selectionOnly )
++        {
++          QString s( i18n("(Selection of) ") );
++          tags["f"].prepend( s );
++          tags["U"].prepend( s );
++        }
++
++        QRegExp reTags( "%([dDfUhuyY])" ); // TODO tjeck for "%%<TAG>"
++
++        if (useHeader)
++        {
++          headerDrawBg = kphf->useHeaderBackground();
++          headerHeight = QFontMetrics( headerFont ).height();
++          if ( useBox || headerDrawBg )
++            headerHeight += innerMargin * 2;
++          else
++            headerHeight += 1 + QFontMetrics( headerFont ).leading();
++
++          headerTagList = kphf->headerFormat();
++          QMutableStringListIterator it(headerTagList);
++          while ( it.hasNext() ) {
++            QString tag = it.next();
++            int pos = reTags.indexIn( tag );
++            QString rep;
++            while ( pos > -1 )
++            {
++              rep = tags[reTags.cap( 1 )];
++              tag.replace( (uint)pos, 2, rep );
++              pos += rep.length();
++              pos = reTags.indexIn( tag, pos );
++            }
++            it.setValue( tag );
++          }
++
++          if (!headerBgColor.isValid())
++            headerBgColor = Qt::lightGray;
++          if (!headerFgColor.isValid())
++            headerFgColor = Qt::black;
++        }
++
++        if (useFooter)
++        {
++          footerDrawBg = kphf->useFooterBackground();
++          footerHeight = QFontMetrics( headerFont ).height();
++          if ( useBox || footerDrawBg )
++            footerHeight += 2*innerMargin;
++          else
++            footerHeight += 1; // line only
++
++          footerTagList = kphf->footerFormat();
++          QMutableStringListIterator it(footerTagList);
++          while ( it.hasNext() ) {
++            QString tag = it.next();
++            int pos = reTags.indexIn( tag );
++            QString rep;
++            while ( pos > -1 )
++            {
++              rep = tags[reTags.cap( 1 )];
++              tag.replace( (uint)pos, 2, rep );
++              pos += rep.length();
++              pos = reTags.indexIn( tag, pos );
++            }
++            it.setValue( tag );
++          }
++
++          if (!footerBgColor.isValid())
++            footerBgColor = Qt::lightGray;
++          if (!footerFgColor.isValid())
++            footerFgColor = Qt::black;
++          // adjust maxheight, so we can know when/where to print footer
++          maxHeight -= footerHeight;
++        }
++      } // if ( useHeader || useFooter )
++
++      if ( useBackground )
++      {
++        if ( ! useBox )
++        {
++          xstart += innerMargin;
++          maxWidth -= innerMargin * 2;
++        }
++      }
++
++      if ( useBox )
++      {
++        if (!boxColor.isValid())
++          boxColor = Qt::black;
++        if (boxWidth < 1) // shouldn't be pssible no more!
++          boxWidth = 1;
++        // set maxwidth to something sensible
++        maxWidth -= ( ( boxWidth + innerMargin )  * 2 );
++        xstart += boxWidth + innerMargin;
++        // maxheight too..
++        maxHeight -= boxWidth;
++      }
++      else
++        boxWidth = 0;
++
++      // now that we know the vertical amount of space needed,
++      // it is possible to calculate the total number of pages
++      // if needed, that is if any header/footer tag contains "%P".
+ #if 0
+-       if ( useGuide )
+-       {
+-         // calculate the height required
+-         // the number of columns is a side effect, saved for drawing time
+-         // first width is needed
+-         int _w = pdmWidth - innerMargin * 2;
+-         if ( useBox )
+-           _w -= boxWidth * 2;
+-         else
+-         {
+-           if ( useBackground )
+-             _w -= ( innerMargin * 2 );
+-           _w -= 2; // 1 px line on each side
+-         }
+-
+-         // base of height: margins top/bottom, above and below tetle sep line
+-         guideHeight = ( innerMargin * 4 ) + 1;
+-
+-         // get a title and add the height required to draw it
+-         QString _title = i18n("Typographical Conventions for %1", doc->highlight()->name());
+-         guideHeight += paint.boundingRect( 0, 0, _w, 1000, Qt::AlignTop|Qt::AlignHCenter, _title ).height();
+-
+-         // see how many columns we can fit in
+-         int _widest( 0 );
+-
+-         int _items ( 0 );
+-         for (int i = 0; i < ilist.size(); ++i)
+-         {
+-           KateExtendedAttribute::Ptr _d = ilist[i];
+-           _widest = qMax( _widest, ((QFontMetrics)(
+-                                _d->fontWeight() == QFont::Bold ?
+-                                  _d->fontItalic() ?
+-                                    renderer.config()->fontStruct()->myFontMetricsBI :
+-                                    renderer.config()->fontStruct()->myFontMetricsBold :
+-                                  _d->fontItalic() ?
+-                                    renderer.config()->fontStruct()->myFontMetricsItalic :
+-                                    renderer.config()->fontStruct()->myFontMetrics
+-                                    ) ).width( _d->name() ) );
+-           _items++;
+-         }
+-         guideCols = _w/( _widest + innerMargin );
+-         // add height for required number of lines needed given columns
+-         guideHeight += renderer.fontHeight() * ( _items/guideCols );
+-         if ( _items%guideCols )
+-           guideHeight += renderer.fontHeight();
+-       }
++      if ( !headerTagList.filter("%P").isEmpty() || !footerTagList.filter("%P").isEmpty() )
++      {
++        kDebug(13020)<<"'%P' found! calculating number of pages...";
++        uint _pages = 0;
++        uint _ph = maxHeight;
++        if ( useHeader )
++          _ph -= ( headerHeight + innerMargin );
++        if ( useFooter )
++          _ph -= innerMargin;
++        int _lpp = _ph / fontHeight;
++        uint _lt = 0, _c=0;
++
++        // add space for guide if required
++//         if ( useGuide )
++//           _lt += (guideHeight + (fontHeight /2)) / fontHeight;
++        long _lw;
++        for ( uint i = firstline; i < lastline; i++ )
++        {
++          //FIXME: _lw = renderer.textWidth( doc->kateTextLine( i ), -1 );
++          _lw = 80 * renderer.spaceWidth(); //FIXME: just a stand-in
++          while ( _lw >= 0 )
++          {
++            _c++;
++            _lt++;
++            if ( (int)_lt  == _lpp )
++            {
++              _pages++;
++              _lt = 0;
++            }
++            _lw -= maxWidth;
++            if ( ! _lw ) _lw--; // skip lines matching exactly!
++          }
++        }
++        if ( _lt ) _pages++; // last page
++
++        // substitute both tag lists
++        QString re("%P");
++        QStringList::Iterator it;
++        for ( it=headerTagList.begin(); it!=headerTagList.end(); ++it )
++          (*it).replace( re, QString( "%1" ).arg( _pages ) );
++        for ( it=footerTagList.begin(); it!=footerTagList.end(); ++it )
++          (*it).replace( re, QString( "%1" ).arg( _pages ) );
++      }
+ #endif
+-
+-       // now that we know the vertical amount of space needed,
+-       // it is possible to calculate the total number of pages
+-       // if needed, that is if any header/footer tag contains "%P".
+-       if ( !headerTagList.filter("%P").isEmpty() || !footerTagList.filter("%P").isEmpty() )
+-       {
+-         kDebug(13020)<<"'%P' found! calculating number of pages...";
+-         uint _pages = 0;
+-         uint _ph = maxHeight;
+-         if ( useHeader )
+-           _ph -= ( headerHeight + innerMargin );
+-         if ( useFooter )
+-           _ph -= innerMargin;
+-         int _lpp = _ph / renderer.fontHeight();
+-         uint _lt = 0, _c=0;
+-
+-         // add space for guide if required
+-         if ( useGuide )
+-           _lt += (guideHeight + (renderer.fontHeight() /2)) / renderer.fontHeight();
+-         long _lw;
+-         for ( uint i = firstline; i < lastline; i++ )
+-         {
+-           _lw = renderer.textWidth( doc->kateTextLine( i ), -1 );
+-           while ( _lw >= 0 )
+-           {
+-             _c++;
+-             _lt++;
+-             if ( (int)_lt  == _lpp )
+-             {
+-               _pages++;
+-               _lt = 0;
+-             }
+-             _lw -= maxWidth;
+-             if ( ! _lw ) _lw--; // skip lines matching exactly!
+-           }
+-         }
+-         if ( _lt ) _pages++; // last page
+-
+-         // substitute both tag lists
+-         QString re("%P");
+-         QStringList::Iterator it;
+-         for ( it=headerTagList.begin(); it!=headerTagList.end(); ++it )
+-           (*it).replace( re, QString( "%1" ).arg( _pages ) );
+-         for ( it=footerTagList.begin(); it!=footerTagList.end(); ++it )
+-           (*it).replace( re, QString( "%1" ).arg( _pages ) );
+-       }
+-     } // end prepare block
++    } // end prepare block
+ 
+      /*
+         On to draw something :-)
+      */
+-     uint _count = 0;
+-     while (  lineCount <= lastline  )
+-     {
+-       startCol = 0;
+-       endCol = 0;
+-       needWrap = true;
+-
+-       while (needWrap)
+-       {
+-         if ( y + renderer.fontHeight() >= (uint)(maxHeight) )
+-         {
+-           kDebug(13020)<<"Starting new page, "<<_count<<" lines up to now.";
+-           printer.newPage();
+-           currentPage++;
+-           pageStarted = true;
+-           y=0;
+-         }
+-
+-         if ( pageStarted )
+-         {
+-
+-           if ( useHeader )
+-           {
+-             paint.setPen(headerFgColor);
+-             paint.setFont(headerFont);
+-             if ( headerDrawBg )
+-                paint.fillRect(0, 0, headerWidth, headerHeight, headerBgColor);
+-             if (headerTagList.count() == 3)
+-             {
+-               int valign = ( (useBox||headerDrawBg||useBackground) ?
+-                              Qt::AlignVCenter : Qt::AlignTop );
+-               int align = valign|Qt::AlignLeft;
+-               int marg = ( useBox || headerDrawBg ) ? innerMargin : 0;
+-               if ( useBox ) marg += boxWidth;
+-               QString s;
+-               for (int i=0; i<3; i++)
+-               {
+-                 s = headerTagList[i];
+-                 if (s.indexOf("%p") != -1) s.replace("%p", QString::number(currentPage));
+-                 paint.drawText(marg, 0, headerWidth-(marg*2), headerHeight, align, s);
+-                 align = valign|(i == 0 ? Qt::AlignHCenter : Qt::AlignRight);
+-               }
+-             }
+-             if ( ! ( headerDrawBg || useBox || useBackground ) ) // draw a 1 px (!?) line to separate header from contents
+-             {
+-               paint.drawLine( 0, headerHeight-1, headerWidth, headerHeight-1 );
+-               //y += 1; now included in headerHeight
+-             }
+-             y += headerHeight + innerMargin;
+-           }
+-
+-           if ( useFooter )
+-           {
+-             if ( ! ( footerDrawBg || useBox || useBackground ) ) // draw a 1 px (!?) line to separate footer from contents
+-               paint.drawLine( 0, maxHeight + innerMargin - 1, headerWidth, maxHeight + innerMargin - 1 );
+-             if ( footerDrawBg )
+-                paint.fillRect(0, maxHeight+innerMargin+boxWidth, headerWidth, footerHeight, footerBgColor);
+-             if (footerTagList.count() == 3)
+-             {
+-               int align = Qt::AlignVCenter|Qt::AlignLeft;
+-               int marg = ( useBox || footerDrawBg ) ? innerMargin : 0;
+-               if ( useBox ) marg += boxWidth;
+-               QString s;
+-               for (int i=0; i<3; i++)
+-               {
+-                 s = footerTagList[i];
+-                 if (s.indexOf("%p") != -1) s.replace("%p", QString::number(currentPage));
+-                 paint.drawText(marg, maxHeight+innerMargin, headerWidth-(marg*2), footerHeight, align, s);
+-                 align = Qt::AlignVCenter|(i == 0 ? Qt::AlignHCenter : Qt::AlignRight);
+-               }
+-             }
+-           } // done footer
+-
+-           if ( useBackground )
+-           {
+-             // If we have a box, or the header/footer has backgrounds, we want to paint
+-             // to the border of those. Otherwise just the contents area.
+-             int _y = y, _h = maxHeight - y;
+-             if ( useBox )
+-             {
+-               _y -= innerMargin;
+-               _h += 2 * innerMargin;
+-             }
+-             else
+-             {
+-               if ( headerDrawBg )
+-               {
+-                 _y -= innerMargin;
+-                 _h += innerMargin;
+-               }
+-               if ( footerDrawBg )
+-               {
+-                 _h += innerMargin;
+-               }
+-             }
+-             paint.fillRect( 0, _y, pdmWidth, _h, renderer.config()->backgroundColor());
+-           }
+-
+-           if ( useBox )
+-           {
+-             paint.setPen(QPen(boxColor, boxWidth));
+-             paint.drawRect(0, 0, pdmWidth, pdmHeight);
+-             if (useHeader)
+-               paint.drawLine(0, headerHeight, headerWidth, headerHeight);
+-             else
+-               y += innerMargin;
+-
+-             if ( useFooter ) // drawline is not trustable, grr.
+-               paint.fillRect( 0, maxHeight+innerMargin, headerWidth, boxWidth, boxColor );
+-           }
++    while (  lineCount <= lastline  )
++    {
++      startCol = 0;
++      endCol = 0;
++
++      if ( y + fontHeight >= maxHeight )
++      {
++        kDebug(13020)<<"Starting new page,"<<lineCount<<"lines up to now.";
++        printer.newPage();
++        paint.resetTransform();
++        currentPage++;
++        pageStarted = true;
++        y=0;
++      }
++
++      if ( pageStarted )
++      {
++        if ( useHeader )
++        {
++          paint.setPen(headerFgColor);
++          paint.setFont(headerFont);
++          if ( headerDrawBg )
++            paint.fillRect(0, 0, headerWidth, headerHeight, headerBgColor);
++          if (headerTagList.count() == 3)
++          {
++            int valign = ( (useBox||headerDrawBg||useBackground) ?
++            Qt::AlignVCenter : Qt::AlignTop );
++            int align = valign|Qt::AlignLeft;
++            int marg = ( useBox || headerDrawBg ) ? innerMargin : 0;
++            if ( useBox ) marg += boxWidth;
++            QString s;
++            for (int i=0; i<3; i++)
++            {
++              s = headerTagList[i];
++              if (s.indexOf("%p") != -1) s.replace("%p", QString::number(currentPage));
++              paint.drawText(marg, 0, headerWidth-(marg*2), headerHeight, align, s);
++              align = valign|(i == 0 ? Qt::AlignHCenter : Qt::AlignRight);
++            }
++          }
++          if ( ! ( headerDrawBg || useBox || useBackground ) ) // draw a 1 px (!?) line to separate header from contents
++          {
++            paint.drawLine( 0, headerHeight-1, headerWidth, headerHeight-1 );
++            //y += 1; now included in headerHeight
++          }
++          y += headerHeight + innerMargin;
++        }
++
++        if ( useFooter )
++        {
++          paint.setPen(footerFgColor);
++          if ( ! ( footerDrawBg || useBox || useBackground ) ) // draw a 1 px (!?) line to separate footer from contents
++            paint.drawLine( 0, maxHeight + innerMargin - 1, headerWidth, maxHeight + innerMargin - 1 );
++          if ( footerDrawBg )
++            paint.fillRect(0, maxHeight+innerMargin+boxWidth, headerWidth, footerHeight, footerBgColor);
++          if (footerTagList.count() == 3)
++          {
++            int align = Qt::AlignVCenter|Qt::AlignLeft;
++            int marg = ( useBox || footerDrawBg ) ? innerMargin : 0;
++            if ( useBox ) marg += boxWidth;
++            QString s;
++            for (int i=0; i<3; i++)
++            {
++              s = footerTagList[i];
++              if (s.indexOf("%p") != -1) s.replace("%p", QString::number(currentPage));
++              paint.drawText(marg, maxHeight+innerMargin, headerWidth-(marg*2), footerHeight, align, s);
++              align = Qt::AlignVCenter|(i == 0 ? Qt::AlignHCenter : Qt::AlignRight);
++            }
++          }
++        } // done footer
++
++        if ( useBackground )
++        {
++          // If we have a box, or the header/footer has backgrounds, we want to paint
++          // to the border of those. Otherwise just the contents area.
++          int _y = y, _h = maxHeight - y;
++          if ( useBox )
++          {
++            _y -= innerMargin;
++            _h += 2 * innerMargin;
++          }
++          else
++          {
++            if ( headerDrawBg )
++            {
++              _y -= innerMargin;
++              _h += innerMargin;
++            }
++            if ( footerDrawBg )
++            {
++              _h += innerMargin;
++            }
++          }
++          paint.fillRect( 0, _y, pdmWidth, _h, renderer.config()->backgroundColor());
++        }
++
++        if ( useBox )
++        {
++          paint.setPen(QPen(boxColor, boxWidth));
++          paint.drawRect(0, 0, pdmWidth, pdmHeight);
++          if (useHeader)
++            paint.drawLine(0, headerHeight, headerWidth, headerHeight);
++          else
++            y += innerMargin;
++
++          if ( useFooter ) // drawline is not trustable, grr.
++            paint.fillRect( 0, maxHeight+innerMargin, headerWidth, boxWidth, boxColor );
++        }
++
++        if ( useGuide && currentPage == 1 )
++        {  // FIXME - this may span more pages...
++          // draw a box unless we have boxes, in which case we end with a box line
++          int _ystart = y;
++          QString _hlName = doc->highlight()->name();
++
++          QList<KateExtendedAttribute::Ptr> _attributes; // list of highlight attributes for the legend
++          doc->highlight()->getKateExtendedAttributeList(kpl->colorScheme(), _attributes);
++
++          KateAttributeList _defaultAttributes;
++          KateHlManager::self()->getDefaults ( renderer.config()->schema(), _defaultAttributes );
++
++          QColor _defaultPen = _defaultAttributes.at(0)->foreground().color();
++          paint.setPen(_defaultPen);
++          paint.setBrush(_defaultPen);
++
++          int _marg = 0;
++          if ( useBox )
++            _marg += (2*boxWidth) + (2*innerMargin);
++          else
++          {
++            if ( useBackground )
++              _marg += 2*innerMargin;
++            _marg += 1;
++            y += 1 + innerMargin;
++          }
++
++          // draw a title string
++          QFont _titleFont = renderer.config()->font();
++          _titleFont.setBold(true);
++          paint.setFont( _titleFont );
++          QRect _r;
++          paint.drawText( QRect(_marg, y, pdmWidth-(2*_marg), maxHeight - y),
++            Qt::AlignTop|Qt::AlignHCenter,
++            i18n("Typographical Conventions for %1", _hlName ), &_r );
++          int _w = pdmWidth - (_marg*2) - (innerMargin*2);
++          int _x = _marg + innerMargin;
++          y += _r.height() + innerMargin;
++          paint.drawLine( _x, y, _x + _w, y );
++          y += 1 + innerMargin;
++
++          int _widest( 0 );
++          foreach (KateExtendedAttribute::Ptr attribute, _attributes)
++            _widest = qMax(QFontMetrics(attribute->font()).width(attribute->name().section(':',1,1)), _widest);
++
++          int _guideCols = _w/( _widest + innerMargin );
++
++          // draw attrib names using their styles
++          int _cw = _w/_guideCols;
++          int _i(0);
++
++          _titleFont.setUnderline(true);
++          QString _currentHlName;
++          foreach (KateExtendedAttribute::Ptr attribute, _attributes)
++          {
++            QString _hl = attribute->name().section(':',0,0);
++            QString _name = attribute->name().section(':',1,1);
++            if ( _hl != _hlName && _hl != _currentHlName ) {
++              _currentHlName = _hl;
++              if ( _i%_guideCols )
++                y += fontHeight;
++              y += innerMargin;
++              paint.setFont(_titleFont);
++              paint.setPen(_defaultPen);
++              paint.drawText( _x, y, _w, fontHeight, Qt::AlignTop, _hl + " " + i18n("text") );
++              y += fontHeight;
++              _i = 0;
++            }
++
++            KTextEditor::Attribute _attr =  *_defaultAttributes[attribute->defaultStyleIndex()];
++            _attr += *attribute;
++            paint.setPen( _attr.foreground().color() );
++            paint.setFont( _attr.font() );
++
++            if (_attr.hasProperty(QTextFormat::BackgroundBrush) ) {
++              QRect _rect = QFontMetrics(_attr.font()).boundingRect(_name);
++              _rect.moveTo(_x + ((_i%_guideCols)*_cw), y);
++               paint.fillRect(_rect, _attr.background() );
++            }
++
++            paint.drawText(( _x + ((_i%_guideCols)*_cw)), y, _cw, fontHeight, Qt::AlignTop, _name );
++
++            _i++;
++            if ( _i && ! ( _i%_guideCols ) )
++              y += fontHeight;
++          }
++
++          if ( _i%_guideCols )
++            y += fontHeight;// last row not full
++
++          // draw a box around the legend
++          paint.setPen ( _defaultPen );
++          if ( useBox )
++            paint.fillRect( 0, y+innerMargin, headerWidth, boxWidth, boxColor );
++          else
++          {
++            _marg -=1;
++            paint.setBrush(QBrush());
++            paint.drawRect( _marg, _ystart, pdmWidth-(2*_marg), y-_ystart+innerMargin );
++          }
++
++          y += ( useBox ? boxWidth : 1 ) + (innerMargin*2);
++        } // useGuide
++
++        paint.translate(xstart,y);
++        pageStarted = false;
++      } // pageStarted; move on to contents:)
++
++      if ( printLineNumbers /*&& ! startCol*/ ) // don't repeat!
++      {
++        paint.setFont( renderer.config()->font() );
++        paint.setPen( renderer.config()->lineNumberColor() );
++        paint.drawText( (( useBox || useBackground ) ? innerMargin : 0)-xstart, 0,
++                    lineNumberWidth, fontHeight,
++                    Qt::AlignRight, QString("%1").arg( lineCount + 1 ) );
++      }
++
++      // HA! this is where we print [part of] a line ;]]
++      // FIXME Convert this function + related functionality to a separate KatePrintView
++      KateLineLayout range(doc);
++      range.setLine(lineCount);
++      KateLineLayoutPtr *rangeptr = new KateLineLayoutPtr(&range);
++      renderer.layoutLine(*rangeptr, (int)maxWidth, false);
++
++      // selectionOnly: clip non-selection parts and adjust painter position if needed
++      int _xadjust = 0;
++      if (selectionOnly) {
++        if (doc->activeView()->blockSelection()) {
++          int _x = renderer.cursorToX((*rangeptr)->viewLine(0), selectionRange.start());
++          int _x1 = renderer.cursorToX((*rangeptr)->viewLine((*rangeptr)->viewLineCount()-1), selectionRange.end());
++           _xadjust = _x;
++           paint.translate(-_xadjust, 0);
++          paint.setClipRegion(QRegion( _x, 0, _x1 - _x, (*rangeptr)->viewLineCount()*fontHeight));
++        }
++
++        else if (lineCount == firstline || lineCount == lastline) {
++          QRegion region(0, 0, maxWidth, (*rangeptr)->viewLineCount()*fontHeight);
++
++          if ( lineCount == firstline) {
++            region = region.subtracted(QRegion(0, 0, renderer.cursorToX((*rangeptr)->viewLine(0), selectionRange.start()), fontHeight));
++          }
++
++          if (lineCount == lastline) {
++            int _x = renderer.cursorToX((*rangeptr)->viewLine((*rangeptr)->viewLineCount()-1), selectionRange.end());
++            region = region.subtracted(QRegion(_x, 0, maxWidth-_x, fontHeight));
++          }
++
++          paint.setClipRegion(region);
++        }
++      }
++
++      // If the line is too long (too many 'viewlines') to fit the remaining vertical space,
++      // clip and adjust the painter position as nessecary
++      int _lines = (*rangeptr)->viewLineCount()-remainder; // number of "sublines" to paint.
++      int _yadjust = remainder * fontHeight; // if we need to clip at the start of the line, it's this much.
++      bool _needWrap = (fontHeight*_lines > maxHeight-y);
++
++      if (remainder || _needWrap) {
++        remainder = _needWrap? _lines - ((maxHeight-y)/fontHeight) : 0;
++        paint.translate(0, -_yadjust);
++        paint.setClipRect(0,_yadjust,maxWidth,((_lines-remainder)*fontHeight)-1); //### drop the crosspatch in printerfriendly mode???
++      }
++
++      renderer.paintTextLine(paint, *rangeptr, 0, (int)maxWidth);
++
++      paint.setClipping(false);
++      paint.translate(_xadjust, (fontHeight * _lines)+_yadjust);
++
++      y += fontHeight*_lines;
++
++      if ( ! remainder )
++      lineCount++;
++    } // done lineCount <= lastline
+ 
+-#if 0
+-           if ( useGuide && currentPage == 1 )
+-           {  // FIXME - this may span more pages...
+-             // draw a box unless we have boxes, in which case we end with a box line
+-
+-             // use color of dsNormal for the title string and the hline
+-             KateAttributeList _dsList;
+-             KateHlManager::self()->getDefaults ( renderer.config()->schema(), _dsList );
+-             paint.setBrush ( _dsList.at(0)->foreground() );
+-             int _marg = 0; // this could be available globally!??
+-             if ( useBox )
+-             {
+-               _marg += (2*boxWidth) + (2*innerMargin);
+-               paint.fillRect( 0, y+guideHeight-innerMargin-boxWidth, headerWidth, boxWidth, boxColor );
+-             }
+-             else
+-             {
+-               if ( useBackground )
+-                 _marg += 2*innerMargin;
+-               paint.drawRect( _marg, y, pdmWidth-(2*_marg), guideHeight );
+-               _marg += 1;
+-               y += 1 + innerMargin;
+-             }
+-             // draw a title string
+-             paint.setFont( renderer.config()->fontStruct()->myFontBold );
+-             QRect _r;
+-             paint.drawText( _marg, y, pdmWidth-(2*_marg), maxHeight - y,
+-                Qt::AlignTop|Qt::AlignHCenter,
+-                i18n("Typographical Conventions for %1", doc->highlight()->name()), -1, &_r );
+-             int _w = pdmWidth - (_marg*2) - (innerMargin*2);
+-             int _x = _marg + innerMargin;
+-             y += _r.height() + innerMargin;
+-             paint.drawLine( _x, y, _x + _w, y );
+-             y += 1 + innerMargin;
+-             // draw attrib names using their styles
+-
+-             QListIterator<KateExtendedAttribute> _it( ilist );
+-             KateExtendedAttribute::Ptr _d;
+-             int _cw = _w/guideCols;
+-             int _i(0);
+-
+-             while ( ( _d = _it.current() ) != 0 )
+-             {
+-               paint.setPen( renderer.attribute(_i)->foreground() );
+-               paint.setFont( renderer.attribute(_i)->font( *renderer.currentFont() ) );
+-               paint.drawText(( _x + ((_i%guideCols)*_cw)), y, _cw, renderer.fontHeight(),
+-                        Qt::AlignVCenter|Qt::AlignLeft, _d->name, -1, &_r );
+-               _i++;
+-               if ( _i && ! ( _i%guideCols ) ) y += renderer.fontHeight();
+-               ++_it;
+-             }
+-             if ( _i%guideCols ) y += renderer.fontHeight();// last row not full
+-             y += ( useBox ? boxWidth : 1 ) + (innerMargin*2);
+-           }
+-#endif
+-
+-           pageStarted = false;
+-         } // pageStarted; move on to contents:)
+-
+-#if 0
+-         if ( printLineNumbers && ! startCol ) // don't repeat!
+-         {
+-           paint.setFont( renderer.config()->fontStruct()->font( false, false ) );
+-           paint.setPen( renderer.config()->lineNumberColor() );
+-           paint.drawText( (( useBox || useBackground ) ? innerMargin : 0), y,
+-                        lineNumberWidth, renderer.fontHeight(),
+-                        Qt::AlignRight, QString("%1").arg( lineCount + 1 ) );
+-         }
+-#endif
+-         endCol = renderer.textWidth(doc->kateTextLine(lineCount), startCol, maxWidth, &needWrap);
+-
+-         if ( endCol < startCol )
+-         {
+-           //kDebug(13020)<<"--- Skipping garbage, line: "<<lineCount<<" start: "<<startCol<<" end: "<<endCol<<" real EndCol; "<< buffer->line(lineCount)->length()<< " !?";
+-           lineCount++;
+-           continue; // strange case...
+-                     // Happens if the line fits exactly.
+-                     // When it happens, a line of garbage would be printed.
+-                     // FIXME Most likely this is an error in textWidth(),
+-                     // failing to correctly set needWrap to false in this case?
+-         }
+-
+-         // if we print only selection:
+-         // print only selected range of chars.
+-         bool skip = false;
+-         if ( selectionOnly )
+-         {
+-#ifdef __GNUC__
+-#warning fixme later
+-#endif
+-         /*
+-           bool inBlockSelection = ( doc->blockSelectionMode() && lineCount >= firstline && lineCount <= lastline );
+-           if ( lineCount == firstline || inBlockSelection )
+-           {
+-             if ( startCol < selStartCol )
+-               startCol = selStartCol;
+-           }
+-           if ( lineCount == lastline  || inBlockSelection )
+-           {
+-             if ( endCol > selEndCol )
+-             {
+-               endCol = selEndCol;
+-               skip = true;
+-             }
+-           }*/
+-         }
+-
+-         // HA! this is where we print [part of] a line ;]]
+-         // FIXME Convert this function + related functionality to a separate KatePrintView
+-         KateLineLayout range(doc);
+-         range.setLine(lineCount);
+-#if 0
+-         range.setStartCol(startCol);
+-         range.setEndCol(endCol);
+-         range.setWrap(needWrap);
+-#endif
+-         paint.translate(xstart, y);
+-         renderer.paintTextLine(paint, &range, 0, maxWidth);
+-         paint.resetXForm();
+-         if ( skip )
+-         {
+-           needWrap = false;
+-           startCol = 0;
+-         }
+-         else
+-         {
+-           startCol = endCol;
+-         }
+-
+-         y += renderer.fontHeight();
+-         _count++;
+-       } // done while ( needWrap )
+-
+-       lineCount++;
+-     } // done lineCount <= lastline
+-     return true;
++    paint.end();
++    return true;
+   }
+-#endif
+   return false;
+ }
+ //END KatePrinter
+ 
+-#ifndef Q_WS_WIN //TODO: reenable
+ //BEGIN KatePrintTextSettings
+-KatePrintTextSettings::KatePrintTextSettings( KPrinter * /*printer*/, QWidget *parent )
+-  : KPrintDialogPage( parent )
++KatePrintTextSettings::KatePrintTextSettings( QWidget *parent )
++  : QWidget( parent )
+ {
+-  setTitle( i18n("Te&xt Settings") );
++  setWindowTitle( i18n("Te&xt Settings") );
+ 
+   QVBoxLayout *lo = new QVBoxLayout ( this );
+   lo->setSpacing( KDialog::spacingHint() );
+ 
+-  cbSelection = new QCheckBox( i18n("Print &selected text only"), this );
+-  lo->addWidget( cbSelection );
++//   cbSelection = new QCheckBox( i18n("Print &selected text only"), this );
++//   lo->addWidget( cbSelection );
+ 
+-  cbLineNumbers = new QCheckBox( i18n("Print &line numbers"), this );
++  cbLineNumbers = new QCheckBox( i18n("Print line &numbers"), this );
+   lo->addWidget( cbLineNumbers );
+ 
+-  cbGuide = new QCheckBox( i18n("Print syntax &guide"), this );
++  cbGuide = new QCheckBox( i18n("Print &legend"), this );
+   lo->addWidget( cbGuide );
+ 
+   lo->addStretch( 1 );
+@@ -674,9 +654,9 @@
+   // set defaults - nothing to do :-)
+ 
+   // whatsthis
+-  cbSelection->setWhatsThis(i18n(
+-        "<p>This option is only available if some text is selected in the document.</p>"
+-        "<p>If available and enabled, only the selected text is printed.</p>") );
++//   cbSelection->setWhatsThis(i18n(
++//         "<p>This option is only available if some text is selected in the document.</p>"
++//         "<p>If available and enabled, only the selected text is printed.</p>") );
+   cbLineNumbers->setWhatsThis(i18n(
+         "<p>If enabled, line numbers will be printed on the left side of the page(s).</p>") );
+   cbGuide->setWhatsThis(i18n(
+@@ -684,39 +664,33 @@
+         "defined by the syntax highlighting being used.</p>") );
+ }
+ 
+-void KatePrintTextSettings::getOptions( QMap<QString,QString>& opts, bool )
+-{
+-  opts["app-kate-printselection"] = cbSelection->isChecked() ? "true" : "false";
+-  opts["app-kate-printlinenumbers"] = cbLineNumbers->isChecked() ? "true" : "false";
+-  opts["app-kate-printguide"] = cbGuide->isChecked() ? "true" : "false" ;
+-}
++// bool KatePrintTextSettings::printSelection()
++// {
++//     return cbSelection->isChecked();
++// }
+ 
+-void KatePrintTextSettings::setOptions( const QMap<QString,QString>& opts )
++bool KatePrintTextSettings::printLineNumbers()
+ {
+-  QString v;
+-  v = opts["app-kate-printselection"];
+-  if ( ! v.isEmpty() )
+-    cbSelection->setChecked( v == "true" );
+-  v = opts["app-kate-printlinenumbers"];
+-  if ( ! v.isEmpty() )
+-    cbLineNumbers->setChecked( v == "true" );
+-  v = opts["app-kate-printguide"];
+-  if ( ! v.isEmpty() )
+-    cbGuide->setChecked( v == "true" );
++  return cbLineNumbers->isChecked();
+ }
+ 
+-void KatePrintTextSettings::enableSelection( bool enable )
++bool KatePrintTextSettings::printGuide()
+ {
+-  cbSelection->setEnabled( enable );
++  return cbGuide->isChecked();
+ }
+ 
++// void KatePrintTextSettings::enableSelection( bool enable )
++// {
++//   cbSelection->setEnabled( enable );
++// }
++
+ //END KatePrintTextSettings
+ 
+ //BEGIN KatePrintHeaderFooter
+-KatePrintHeaderFooter::KatePrintHeaderFooter( KPrinter * /*printer*/, QWidget *parent )
+-  : KPrintDialogPage( parent )
++KatePrintHeaderFooter::KatePrintHeaderFooter( QWidget *parent )
++  : QWidget( parent )
+ {
+-  setTitle( i18n("Hea&der && Footer") );
++  setWindowTitle( i18n("Hea&der && Footer") );
+ 
+   QVBoxLayout *lo = new QVBoxLayout ( this );
+   uint sp = KDialog::spacingHint();
+@@ -752,7 +726,7 @@
+   grid->addWidget(lHeaderFormat, 0, 0);
+ 
+   KHBox *hbHeaderFormat = new KHBox( gbHeader );
+-  grid->addWidget(lHeaderFormat, 0, 1);
++  grid->addWidget(hbHeaderFormat, 0, 1);
+ 
+   hbHeaderFormat->setSpacing( sp );
+   leHeaderLeft = new QLineEdit( hbHeaderFormat );
+@@ -816,13 +790,13 @@
+   leHeaderCenter->setText( "%f" );
+   leHeaderRight->setText( "%p" );
+   kcbtnHeaderFg->setColor( QColor("black") );
+-  cbHeaderEnableBgColor->setChecked( true );
++  cbHeaderEnableBgColor->setChecked( false );
+   kcbtnHeaderBg->setColor( QColor("lightgrey") );
+ 
+   cbEnableFooter->setChecked( true );
+   leFooterRight->setText( "%U" );
+   kcbtnFooterFg->setColor( QColor("black") );
+-  cbFooterEnableBgColor->setChecked( true );
++  cbFooterEnableBgColor->setChecked( false );
+   kcbtnFooterBg->setColor( QColor("lightgrey") );
+ 
+   // whatsthis
+@@ -837,8 +811,7 @@
+       "<li><tt>%f</tt>: file name</li>"
+       "<li><tt>%U</tt>: full URL of the document</li>"
+       "<li><tt>%p</tt>: page number</li>"
+-      "</ul><br />"
+-      "<u>Note:</u> Do <b>not</b> use the '|' (vertical bar) character.");
++      "</ul><br />");
+   leHeaderRight->setWhatsThis(s + s1 );
+   leHeaderCenter->setWhatsThis(s + s1 );
+   leHeaderLeft->setWhatsThis(s + s1 );
+@@ -846,83 +819,65 @@
+   leFooterRight->setWhatsThis(s + s1 );
+   leFooterCenter->setWhatsThis(s + s1 );
+   leFooterLeft->setWhatsThis(s + s1 );
++}
+ 
++QFont KatePrintHeaderFooter::font()
++{
++    return lFontPreview->font();
++}
+ 
++bool KatePrintHeaderFooter::useHeader()
++{
++  return cbEnableHeader->isChecked();
+ }
+ 
+-void KatePrintHeaderFooter::getOptions(QMap<QString,QString>& opts, bool )
++QStringList KatePrintHeaderFooter::headerFormat()
+ {
+-  opts["app-kate-hffont"] = strFont;
++  QStringList l;
++  l << leHeaderLeft->text() << leHeaderCenter->text() << leHeaderRight->text();
++  return l;
++}
+ 
+-  opts["app-kate-useheader"] = (cbEnableHeader->isChecked() ? "true" : "false");
+-  opts["app-kate-headerfg"] = kcbtnHeaderFg->color().name();
+-  opts["app-kate-headerusebg"] = (cbHeaderEnableBgColor->isChecked() ? "true" : "false");
+-  opts["app-kate-headerbg"] = kcbtnHeaderBg->color().name();
+-  opts["app-kate-headerformat"] = leHeaderLeft->text() + '|' + leHeaderCenter->text() + '|' + leHeaderRight->text();
+-
+-  opts["app-kate-usefooter"] = (cbEnableFooter->isChecked() ? "true" : "false");
+-  opts["app-kate-footerfg"] = kcbtnFooterFg->color().name();
+-  opts["app-kate-footerusebg"] = (cbFooterEnableBgColor->isChecked() ? "true" : "false");
+-  opts["app-kate-footerbg"] = kcbtnFooterBg->color().name();
+-  opts["app-kate-footerformat"] = leFooterLeft->text() + '|' + leFooterCenter->text() + '|' + leFooterRight->text();
+-}
+-
+-void KatePrintHeaderFooter::setOptions( const QMap<QString,QString>& opts )
+-{
+-  QString v;
+-  v = opts["app-kate-hffont"];
+-  strFont = v;
+-  QFont f = font();
+-  if ( ! v.isEmpty() )
+-  {
+-    if (!strFont.isEmpty())
+-      f.fromString( strFont );
++QColor KatePrintHeaderFooter::headerForeground()
++{
++  return kcbtnHeaderFg->color();
++}
+ 
+-    lFontPreview->setFont( f );
+-  }
+-  lFontPreview->setText( (f.family() + ", %1pt").arg( f.pointSize() ) );
++QColor KatePrintHeaderFooter::headerBackground()
++{
++  return kcbtnHeaderBg->color();
++}
+ 
+-  v = opts["app-kate-useheader"];
+-  if ( ! v.isEmpty() )
+-    cbEnableHeader->setChecked( v == "true" );
+-  v = opts["app-kate-headerfg"];
+-  if ( ! v.isEmpty() )
+-    kcbtnHeaderFg->setColor( QColor( v ) );
+-  v = opts["app-kate-headerusebg"];
+-  if ( ! v.isEmpty() )
+-    cbHeaderEnableBgColor->setChecked( v == "true" );
+-  v = opts["app-kate-headerbg"];
+-  if ( ! v.isEmpty() )
+-    kcbtnHeaderBg->setColor( QColor( v ) );
++bool KatePrintHeaderFooter::useHeaderBackground()
++{
++  return cbHeaderEnableBgColor->isChecked();
++}
+ 
+-  QStringList tags = opts["app-kate-headerformat"].split('|');
+-  if (tags.count() == 3)
+-  {
+-    leHeaderLeft->setText(tags[0]);
+-    leHeaderCenter->setText(tags[1]);
+-    leHeaderRight->setText(tags[2]);
+-  }
++bool KatePrintHeaderFooter::useFooter()
++{
++  return cbEnableFooter->isChecked();
++}
+ 
+-  v = opts["app-kate-usefooter"];
+-  if ( ! v.isEmpty() )
+-    cbEnableFooter->setChecked( v == "true" );
+-  v = opts["app-kate-footerfg"];
+-  if ( ! v.isEmpty() )
+-    kcbtnFooterFg->setColor( QColor( v ) );
+-  v = opts["app-kate-footerusebg"];
+-  if ( ! v.isEmpty() )
+-    cbFooterEnableBgColor->setChecked( v == "true" );
+-  v = opts["app-kate-footerbg"];
+-  if ( ! v.isEmpty() )
+-    kcbtnFooterBg->setColor( QColor( v ) );
++QStringList KatePrintHeaderFooter::footerFormat()
++{
++  QStringList l;
++  l<< leFooterLeft->text() << leFooterCenter->text() << leFooterRight->text();
++  return l;
++}
+ 
+-  tags = opts["app-kate-footerformat"].split('|');
+-  if (tags.count() == 3)
+-  {
+-    leFooterLeft->setText(tags[0]);
+-    leFooterCenter->setText(tags[1]);
+-    leFooterRight->setText(tags[2]);
+-  }
++QColor KatePrintHeaderFooter::footerForeground()
++{
++  return kcbtnFooterFg->color();
++}
++
++QColor KatePrintHeaderFooter::footerBackground()
++{
++  return kcbtnFooterBg->color();
++}
++
++bool KatePrintHeaderFooter::useFooterBackground()
++{
++  return cbFooterEnableBgColor->isChecked();
+ }
+ 
+ void KatePrintHeaderFooter::setHFFont()
+@@ -931,8 +886,6 @@
+   // display a font dialog
+   if ( KFontDialog::getFont( fnt, false, this ) == KFontDialog::Accepted )
+   {
+-    // change strFont
+-    strFont = fnt.toString();
+     // set preview
+     lFontPreview->setFont( fnt );
+     lFontPreview->setText( (fnt.family() + ", %1pt").arg( fnt.pointSize() ) );
+@@ -943,10 +896,10 @@
+ 
+ //BEGIN KatePrintLayout
+ 
+-KatePrintLayout::KatePrintLayout( KPrinter * /*printer*/, QWidget *parent)
+-  : KPrintDialogPage( parent )
++KatePrintLayout::KatePrintLayout( QWidget *parent)
++  : QWidget( parent )
+ {
+-  setTitle( i18n("L&ayout") );
++  setWindowTitle( i18n("L&ayout") );
+ 
+   QVBoxLayout *lo = new QVBoxLayout ( this );
+   lo->setSpacing( KDialog::spacingHint() );
+@@ -978,7 +931,7 @@
+   lBoxWidth->setBuddy( sbBoxWidth );
+ 
+   QLabel *lBoxMargin = new QLabel( i18n("&Margin:"), gbBoxProps );
+-  grid->addWidget(lBoxWidth, 1, 0);
++  grid->addWidget(lBoxMargin, 1, 0);
+   sbBoxMargin = new QSpinBox( gbBoxProps );
+   sbBoxMargin->setRange( 0, 100 );
+   sbBoxMargin->setSingleStep( 1 );
+@@ -988,7 +941,7 @@
+   QLabel *lBoxColor = new QLabel( i18n("Co&lor:"), gbBoxProps );
+   grid->addWidget(lBoxColor, 2, 0);
+   kcbtnBoxColor = new KColorButton( gbBoxProps );
+-  grid->addWidget(lBoxWidth, 2, 1);
++  grid->addWidget(kcbtnBoxColor, 2, 1);
+   lBoxColor->setBuddy( kcbtnBoxColor );
+ 
+   connect( cbEnableBox, SIGNAL(toggled(bool)), gbBoxProps, SLOT(setEnabled(bool)) );
+@@ -1001,9 +954,8 @@
+   cmbSchema->setCurrentIndex( 1 );
+ 
+   // whatsthis
+-  // FIXME uncomment when string freeze is over
+-//   QWhatsThis::add ( cmbSchema, i18n(
+-//         "Select the color scheme to use for the print." ) );
++  cmbSchema->setWhatsThis(i18n(
++        "Select the color scheme to use for the print." ) );
+   cbDrawBackground->setWhatsThis(i18n(
+         "<p>If enabled, the background color of the editor will be used.</p>"
+         "<p>This may be useful if your color scheme is designed for a dark background.</p>") );
+@@ -1019,41 +971,37 @@
+         "The line color to use for boxes") );
+ }
+ 
+-void KatePrintLayout::getOptions(QMap<QString,QString>& opts, bool )
++QString KatePrintLayout::colorScheme()
++{
++  return cmbSchema->currentText();
++}
++
++bool KatePrintLayout::useBackground()
++{
++  return cbDrawBackground->isChecked();
++}
++
++bool KatePrintLayout::useBox()
++{
++  return cbEnableBox->isChecked();
++}
++
++int KatePrintLayout::boxWidth()
++{
++  return sbBoxWidth->value();
++}
++
++int KatePrintLayout::boxMargin()
++{
++  return sbBoxMargin->value();
++}
++
++QColor KatePrintLayout::boxColor()
+ {
+-  opts["app-kate-colorscheme"] = cmbSchema->currentText();
+-  opts["app-kate-usebackground"] = cbDrawBackground->isChecked() ? "true" : "false";
+-  opts["app-kate-usebox"] = cbEnableBox->isChecked() ? "true" : "false";
+-  opts["app-kate-boxwidth"] = sbBoxWidth->cleanText();
+-  opts["app-kate-boxmargin"] = sbBoxMargin->cleanText();
+-  opts["app-kate-boxcolor"] = kcbtnBoxColor->color().name();
+-}
+-
+-void KatePrintLayout::setOptions( const QMap<QString,QString>& opts )
+-{
+-  QString v;
+-  v = opts["app-kate-colorscheme"];
+-  if ( ! v.isEmpty() )
+-    cmbSchema->setCurrentIndex( KateGlobal::self()->schemaManager()->number( v ) );
+-  v = opts["app-kate-usebackground"];
+-  if ( ! v.isEmpty() )
+-    cbDrawBackground->setChecked( v == "true" );
+-  v = opts["app-kate-usebox"];
+-  if ( ! v.isEmpty() )
+-    cbEnableBox->setChecked( v == "true" );
+-  v = opts["app-kate-boxwidth"];
+-  if ( ! v.isEmpty() )
+-    sbBoxWidth->setValue( v.toInt() );
+-  v = opts["app-kate-boxmargin"];
+-  if ( ! v.isEmpty() )
+-    sbBoxMargin->setValue( v.toInt() );
+-  v = opts["app-kate-boxcolor"];
+-  if ( ! v.isEmpty() )
+-    kcbtnBoxColor->setColor( QColor( v ) );
++  return kcbtnBoxColor->color();
+ }
+ //END KatePrintLayout
+ 
+ #include "kateprinter.moc"
+-#endif //!Q_WS_WIN
+ 
+ // kate: space-indent on; indent-width 2; replace-tabs on;
+--- a/kate/tests/arbitraryhighlighttest.h
++++ b/kate/tests/arbitraryhighlighttest.h
+@@ -25,6 +25,7 @@
+   class Document;
+   class SmartInterface;
+   class SmartRange;
++  class View;
+ }
+ 
+ /**
+@@ -47,6 +48,10 @@
+     void slotRangeChanged(KTextEditor::SmartRange* range, KTextEditor::SmartRange* mostSpecificChild);
+     void slotRangeDeleted(KTextEditor::SmartRange* range);
+     void slotCreateTopRange();
++    void slotMouseEnteredRange(KTextEditor::SmartRange* range, KTextEditor::View* view);
++    void slotMouseExitedRange(KTextEditor::SmartRange* range, KTextEditor::View* view);
++    void slotCaretEnteredRange(KTextEditor::SmartRange* range, KTextEditor::View* view);
++    void slotCaretExitedRange(KTextEditor::SmartRange* range, KTextEditor::View* view);
+ 
+   private:
+     void outputRange(KTextEditor::SmartRange* range, KTextEditor::SmartRange * mostSpecific);
+--- a/kate/tests/arbitraryhighlighttest.cpp
++++ b/kate/tests/arbitraryhighlighttest.cpp
+@@ -106,6 +106,11 @@
+     for (int i = 0; i < string.length(); ++i) {
+       if (string.at(i) == openBrace) {
+         currentRange = smart()->newSmartRange(current, currentRange->end(), currentRange);
++        connect(currentRange->primaryNotifier(), SIGNAL(mouseEnteredRange(KTextEditor::SmartRange*, KTextEditor::View*)), SLOT(slotMouseEnteredRange(KTextEditor::SmartRange*, KTextEditor::View*)));
++        connect(currentRange->primaryNotifier(), SIGNAL(mouseExitedRange(KTextEditor::SmartRange*, KTextEditor::View*)), SLOT(slotMouseExitedRange(KTextEditor::SmartRange*, KTextEditor::View*)));
++        connect(currentRange->primaryNotifier(), SIGNAL(caretEnteredRange(KTextEditor::SmartRange*, KTextEditor::View*)), SLOT(slotCaretEnteredRange(KTextEditor::SmartRange*, KTextEditor::View*)));
++        connect(currentRange->primaryNotifier(), SIGNAL(caretExitedRange(KTextEditor::SmartRange*, KTextEditor::View*)), SLOT(slotCaretExitedRange(KTextEditor::SmartRange*, KTextEditor::View*)));
++
+         if (currentRange->depth() < 10)
+           currentRange->setAttribute(ranges[currentRange->depth()]);
+ 
+@@ -145,4 +150,24 @@
+   slotRangeChanged(m_topRange, m_topRange);
+ }
+ 
++void ArbitraryHighlightTest::slotMouseEnteredRange(KTextEditor::SmartRange* range, KTextEditor::View* view)
++{
++  kDebug() << k_funcinfo << *range;
++}
++
++void ArbitraryHighlightTest::slotMouseExitedRange(KTextEditor::SmartRange* range, KTextEditor::View* view)
++{
++  kDebug() << k_funcinfo << *range;
++}
++
++void ArbitraryHighlightTest::slotCaretEnteredRange(KTextEditor::SmartRange* range, KTextEditor::View* view)
++{
++  kDebug() << k_funcinfo << *range;
++}
++
++void ArbitraryHighlightTest::slotCaretExitedRange(KTextEditor::SmartRange* range, KTextEditor::View* view)
++{
++  kDebug() << k_funcinfo << *range;
++}
++
+ #include "arbitraryhighlighttest.moc"
+--- a/kate/tests/katetest.cpp
++++ b/kate/tests/katetest.cpp
+@@ -113,7 +113,7 @@
+     docList.append(doc);
+   }
+ 
+-  //new ArbitraryHighlightTest(doc);
++  new ArbitraryHighlightTest(doc);
+ 
+   m_view = qobject_cast<KTextEditor::View*>(doc->createView (this));
+ 
+--- a/kate/TODO
++++ b/kate/TODO
+@@ -19,16 +19,11 @@
+   * current highlighter not selected (regression)
+   * controls seem to need to be clicked twice?
+ 
+-* reimplement bracket matching
+-
+ * since KDE4 we have a Mode for every Highlighting file. Opening a file leads to a
+   call of QString KateModeManager::wildcardsFind (const QString &fileName), which is
+   very slow. Opening 50 files in the Kate Application is *very* slow. Needs to be
+   vastly improved ...somehow...
+ 
+-* try not to repaint the whole view on every keystroke. according to fredrikh,
+-  this makes kate almost unusable with EXA.
+-
+ **** Refactoring/Cleanups ****
+ * code cleanups wherever needed ;)
+ 
+@@ -116,12 +111,12 @@
+       * show/hide/reorder/merge columns
+       * sorting list
+       * filtering list
+-  * in progress:
+-    * implement sorting of items based on metadata, and sorted group headers
+-      * needs to react to model changes
+     * automatic invocation of code completion
+     * multiple code completion providers
+     * api improvement: generic way to detect when a completion could be offered, and possibly replaceable with a plugin, so that multiple model completion can be offered
++  * in progress:
++    * implement sorting of items based on metadata, and sorted group headers
++      * needs to react to model changes
+     * connect signals from source model to katecompletionmodel and vice-versa
+   * todo
+     * provide a way to have a small/tiny box? e.g. the word-completion plugin does not need much...
+@@ -188,10 +183,10 @@
+   * needed? probably not
+ 
+ * improved block selection with tabs
+-  * block selection on tabs selects too much of the line that contains the tab, because the tab 
+-    counts as one character but is rendered as multiple visible spaces. There are several possible 
++  * block selection on tabs selects too much of the line that contains the tab, because the tab
++    counts as one character but is rendered as multiple visible spaces. There are several possible
+     solutions:
+-    * expand the whole blockselection to include the whole width of the tab 
++    * expand the whole blockselection to include the whole width of the tab
+     * cut the tab into multiple spaces
+     * implement both and make it configurable :)
+ 
+--- a/kate/data/katepart.desktop
++++ b/kate/data/katepart.desktop
+@@ -17,7 +17,7 @@
+ Name[et]=Põimitud võimas tekstiredaktor
+ Name[eu]=Kapsulatutako testu-editore aurreratua
+ Name[fa]=ویرایشگر متن پیشرفتۀ نهفته
+-Name[fi]=Upotettava kehittynyt tekstieditori
++Name[fi]=Upotettava monipuolisempi tekstieditori
+ Name[fr]=Éditeur de texte avancé intégré
+ Name[fy]=Ynsletten avansearre tekstbewurker
+ Name[ga]=Ard-eagarthóir téacs leabaithe
+@@ -50,8 +50,8 @@
+ Name[ru]=Встроенный текстовый редактор
+ Name[se]=Nana buorre vuojuhanláhkái čállinprográmma
+ Name[sl]=Vgrajeni napredni urejevalnik besedil
+-Name[sr]=Уграђени напредни уређивач текста
+-Name[sr at latin]=Ugrađeni napredni uređivač teksta
++Name[sr]=Угњеждени напредни уређивач текста
++Name[sr at latin]=Ugnježdeni napredni uređivač teksta
+ Name[sv]=Inbäddningsbar avancerad texteditor
+ Name[ta]=உட்பொதிந்த மேம்பட்ட உரை தொகுப்பாளர்
+ Name[te]=ఆధునిక పొదగిన వాచకం సరిచేయునది
+--- a/kate/completion/katecompletionmodel.cpp
++++ b/kate/completion/katecompletionmodel.cpp
+@@ -484,7 +484,7 @@
+       at = "Private";
+ 
+     if (accessIncludeStatic() && attribute & KTextEditor::CodeCompletionModel::Static)
+-      at.append(i18n(" Static"));
++      at.append(" Static");
+ 
+     if (accessIncludeConst() && attribute & KTextEditor::CodeCompletionModel::Const)
+       at.append(" Const");
+@@ -573,13 +573,11 @@
+ 
+     int row = m_rowTable.indexOf(g);
+ 
+-    /**
+-     * Workaround for crash caused by the assertion that I don't know how to fix, any better fix is encouraged.
+-     * It happens when I click setup
+-     * */
+-    if( row == -1 )
++    if (row == -1) {
++      kWarning() << k_funcinfo << "Couldn't find parent for index" << index;
+       return QModelIndex();
+-//     Q_ASSERT(row != -1);
++    }
++    
+     return createIndex(row, 0, 0);
+   }
+ 
+@@ -706,7 +704,7 @@
+ 
+     updateBestMatches();
+   }
+-  
++
+   clearExpanding(); //We need to do this, or be aware of expanding-widgets while filtering.
+ }
+ 
+@@ -1070,15 +1068,26 @@
+   if (m_columnMerges.isEmpty())
+     return sourceColumn;
+ 
++  /* Debugging - dump column merge list
++
++  QString columnMerge;
++  foreach (const QList<int>& list, m_columnMerges) {
++    columnMerge += '[';
++    foreach (int column, list) {
++      columnMerge += QString::number(column) + " ";
++    }
++    columnMerge += "] ";
++  }
++
++  kDebug() << k_funcinfo << columnMerge;*/
++
+   int c = 0;
+   foreach (const QList<int>& list, m_columnMerges) {
+     foreach (int column, list) {
+       if (column == sourceColumn)
+-        ///@todo Ugly workaround: "return c" is correct here. This is a workaround for a bug I don't understand, which you can notice in katecompletionwidget.cpp:
+-        ///For some reason, the name-column is mapped to the post-fix column when column-merging is enabled, so the widget is not positioned correctly.
+-        return c > 0 ? c-1 : c;
+-      c++;
++        return c;
+     }
++    c++;
+   }
+   return -1;
+ }
+@@ -1241,7 +1250,7 @@
+   , matchFilters(true)
+ {
+   inheritanceDepth = m_sourceRow.first->index(m_sourceRow.second, 0).data(CodeCompletionModel::InheritanceDepth).toInt();
+-  
++
+   filter();
+   match();
+ }
+@@ -1279,11 +1288,12 @@
+ void KateCompletionModel::Group::addItem( Item i )
+ {
+   if (model->isSortingEnabled()) {
+-    QList<Item>::Iterator it = model->isSortingReverse() ? qUpperBound(--prefilter.end(), prefilter.end(), i) : qUpperBound(prefilter.begin(), prefilter.end(), i);
++    QList<Item>::Iterator it = model->isSortingReverse() ? qLowerBound(prefilter.begin(), prefilter.end(), i) : qUpperBound(prefilter.begin(), prefilter.end(), i);
+     if (it != prefilter.end()) {
++      const Item& item = *it;
+       prefilter.insert(it, i);
+       if (i.isVisible()) {
+-        int index = rows.indexOf(it->sourceRow());
++        int index = rows.indexOf(item.sourceRow());
+         if (index != -1)
+           rows.append(i.sourceRow());
+         else
+@@ -1292,7 +1302,10 @@
+     } else {
+       prefilter.append(i);
+       if (i.isVisible())
+-        rows.append(i.sourceRow());
++        if (model->isSortingReverse())
++          rows.prepend(i.sourceRow());
++        else
++          rows.append(i.sourceRow());
+     }
+ 
+   } else {
+@@ -1430,7 +1443,7 @@
+     g->refilter();
+ 
+   updateBestMatches();
+-  
++
+   clearExpanding(); //We need to do this, or be aware of expanding-widgets while filtering.
+ }
+ 
+--- a/kate/completion/katecompletiondelegate.cpp
++++ b/kate/completion/katecompletiondelegate.cpp
+@@ -33,7 +33,7 @@
+ #include "katecompletiontree.h"
+ 
+ KateCompletionDelegate::KateCompletionDelegate(ExpandingWidgetModel* model, KateCompletionWidget* parent) :
+-    ExpandingDelegate(model, parent)
++    ExpandingDelegate(model, parent), m_cachedRow(-1)
+ {
+ }
+ 
+@@ -58,8 +58,7 @@
+ }
+ 
+ QList<QTextLayout::FormatRange> KateCompletionDelegate::createHighlighting(const QModelIndex& index, QStyleOptionViewItem& option) const {
+-    // Which highlighting to use?
+-  //model()->index(index.row(), KTextEditor::CodeCompletionModel::Name, index.parent())
++    
+     QVariant highlight = model()->data(index, KTextEditor::CodeCompletionModel::HighlightingMethod);
+ 
+     // TODO: config enable specifying no highlight as default
+@@ -67,7 +66,20 @@
+     if (highlight.canConvert(QVariant::Int))
+       highlightMethod = highlight.toInt();
+     
+-
++    if( index.row() == m_cachedRow && highlightMethod & KTextEditor::CodeCompletionModel::InternalHighlighting ) {
++        
++        if( index.column() < m_cachedColumnStarts.size() ) {
++            m_currentColumnStart = m_cachedColumnStarts[index.column()];
++        } else {
++            kWarning() << "Column-count does not match";
++        }
++        
++        return m_cachedHighlights;
++    }
++    
++    ///@todo reset the cache when the model changed
++    m_cachedRow = index.row();
++    
+     KTextEditor::Cursor completionStart = widget()->completionRange()->start();
+ 
+     QString startText = document()->text(KTextEditor::Range(completionStart.line(), 0, completionStart.line(), completionStart.column()));
+@@ -76,6 +88,13 @@
+     thisLine->insertText(0, startText);
+ 
+     int len = completionStart.column();
++    m_cachedColumnStarts.clear();
++    
++    if (highlightMethod & KTextEditor::CodeCompletionModel::CustomHighlighting) {
++        m_currentColumnStart = 0;
++        return highlightingFromVariantList(model()->data(index, KTextEditor::CodeCompletionModel::CustomHighlight).toList());
++    }
++    
+     for (int i = 0; i < KTextEditor::CodeCompletionModel::ColumnCount; ++i) {
+       m_cachedColumnStarts.append(len);
+       QString text = model()->data(model()->index(index.row(), i, index.parent()), Qt::DisplayRole).toString();
+@@ -97,10 +116,7 @@
+       document()->highlight()->doHighlight(previousLine.data(), thisLine.data(), foldingList, ctxChanged);
+     }
+ 
+-  if (highlightMethod & KTextEditor::CodeCompletionModel::CustomHighlighting)
+-    return highlightingFromVariantList(model()->data(index, KTextEditor::CodeCompletionModel::CustomHighlight).toList());
+-
+-  m_cachedColumnStart = m_cachedColumnStarts[index.column()];
++  m_currentColumnStart = m_cachedColumnStarts[index.column()];
+   
+   NormalRenderRange rr;
+   QList<QTextLayout::FormatRange> ret = renderer()->decorationsForLine(thisLine, 0, false, &rr, option.state & QStyle::State_Selected);
+--- a/kate/completion/expandingtree/expandingdelegate.cpp
++++ b/kate/completion/expandingtree/expandingdelegate.cpp
+@@ -28,8 +28,6 @@
+ 
+ ExpandingDelegate::ExpandingDelegate(ExpandingWidgetModel* model, QObject* parent)
+   : QItemDelegate(parent)
+-  , m_cachedRow(-1)
+-  , m_cachedRowSelected(false)
+   , m_model(model)
+ {
+ }
+@@ -44,29 +42,21 @@
+     model()->placeExpandingWidget(index);
+ 
+   //Make sure the decorations are painted at the top, because the center of expanded items will be filled with the embedded widget.
+-  option.decorationAlignment = Qt::AlignTop | option.decorationAlignment;
++  option.decorationAlignment = Qt::AlignTop;
+   
+   //kDebug() << "Painting row " << index.row() << ", column " << index.column() << ", internal " << index.internalPointer() << ", drawselected " << option.showDecorationSelected << ", selected " << (option.state & QStyle::State_Selected);
+ 
+-  if ((index.row() != m_cachedRow) || ( ( option.state & QStyle::State_Selected  ) == QStyle::State_Selected ) != m_cachedRowSelected) {
+-    m_cachedColumnStarts.clear();
+-    m_cachedHighlights.clear();
+-    m_cachedColumnStart = 0;
++  m_cachedHighlights.clear();
+ 
+-    if (!model()->indexIsItem(index) ) {
+-      m_cachedRow = -1;
++  if (!model()->indexIsItem(index) )
+       return QItemDelegate::paint(painter, option, index);
+-    }
+ 
+-    m_cachedHighlights = createHighlighting(index, option);
++  m_currentColumnStart = 0;
++  m_cachedHighlights = createHighlighting(index, option);
+ 
+-/*    kDebug() << "Highlights for line:";
+-    foreach (const QTextLayout::FormatRange& fr, m_cachedHighlights)
+-      kDebug() << fr.start << " len " << fr.length << " format ";*/
+-    
+-    m_cachedRow = index.row();
+-    m_cachedRowSelected = option.state & QStyle::State_Selected;
+-  }
++  /*kDebug() << "Highlights for line:";
++  foreach (const QTextLayout::FormatRange& fr, m_cachedHighlights)
++    kDebug() << fr.start << " len " << fr.length << " format ";*/
+ 
+   QItemDelegate::paint(painter, option, index);
+ }
+@@ -106,9 +96,9 @@
+ 
+ void ExpandingDelegate::drawDisplay( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, const QString & text ) const
+ {
+-  if (m_cachedRow == -1)
++/*  if (m_cachedRow == -1)
+     return QItemDelegate::drawDisplay(painter, option, rect, text);
+-
++*/
+   QTextLayout layout(text, option.font, painter->device());
+ 
+   QRect textRect = rect.adjusted(1, 0, -1, 0); // remove width padding
+@@ -116,21 +106,21 @@
+   QList<QTextLayout::FormatRange> additionalFormats;
+ 
+   for (int i = 0; i < m_cachedHighlights.count(); ++i) {
+-    if (m_cachedHighlights[i].start + m_cachedHighlights[i].length <= m_cachedColumnStart)
++    if (m_cachedHighlights[i].start + m_cachedHighlights[i].length <= m_currentColumnStart)
+       continue;
+ 
+     if (!additionalFormats.count())
+-      if (i != 0 && m_cachedHighlights[i - 1].start + m_cachedHighlights[i - 1].length > m_cachedColumnStart) {
++      if (i != 0 && m_cachedHighlights[i - 1].start + m_cachedHighlights[i - 1].length > m_currentColumnStart) {
+         QTextLayout::FormatRange before;
+         before.start = 0;
+-        before.length = m_cachedHighlights[i - 1].start + m_cachedHighlights[i - 1].length - m_cachedColumnStart;
++        before.length = m_cachedHighlights[i - 1].start + m_cachedHighlights[i - 1].length - m_currentColumnStart;
+         before.format = m_cachedHighlights[i - 1].format;
+         additionalFormats.append(before);
+       }
+ 
+       
+     QTextLayout::FormatRange format;
+-    format.start = m_cachedHighlights[i].start - m_cachedColumnStart;
++    format.start = m_cachedHighlights[i].start - m_currentColumnStart;
+     format.length = m_cachedHighlights[i].length;
+     format.format = m_cachedHighlights[i].format;
+ 
+@@ -139,9 +129,19 @@
+     additionalFormats.append(format);
+   }
+ 
+-  /*kDebug() << "Highlights for text [" << text << "] col start " << m_cachedColumnStart << ":";
+-  foreach (const QTextLayout::FormatRange& fr, m_cachedHighlights)
+-    kDebug() << fr.start << " len " << fr.length << " format " << fr.format.fontWeight();*/
++  if (additionalFormats.isEmpty()) {
++    QTextLayout::FormatRange format;
++    format.start = 0;
++    format.length = text.length();
++    QTextCharFormat fm;
++    fm.setForeground(option.palette.text());
++    format.format = fm;
++    additionalFormats.append(format);
++  }
++
++  /*kDebug() << "Highlights for text [" << text << "] col start " << m_currentColumnStart << ":";
++  foreach (const QTextLayout::FormatRange& fr, additionalFormats)
++    kDebug() << fr.start << " len " << fr.length << "foreground" << fr.format.foreground() << "background" << fr.format.background();*/
+ 
+   layout.setAdditionalFormats(additionalFormats);
+ 
+--- a/kate/completion/expandingtree/expandingdelegate.h
++++ b/kate/completion/expandingtree/expandingdelegate.h
+@@ -69,10 +69,8 @@
+     //Called when an item was expanded/unexpanded and the height changed
+     virtual void heightChanged() const;
+   
+-    mutable int m_cachedRow;
+-    mutable bool m_cachedRowSelected;
+-    mutable int m_cachedColumnStart; //Text-offset for custom highlighting, will be applied to m_cachedHighlights(Only highlights starting after this will be used). Shoult be zero of the highlighting is not taken from kate.
+-    mutable QList<int> m_cachedColumnStarts;
++    mutable int m_currentColumnStart; //Text-offset for custom highlighting, will be applied to m_cachedHighlights(Only highlights starting after this will be used). Shoult be zero of the highlighting is not taken from kate.
++    mutable QList<int> m_currentColumnStarts;
+     mutable QList<QTextLayout::FormatRange> m_cachedHighlights;
+   
+   private:
+--- a/kate/completion/katecompletiondelegate.h
++++ b/kate/completion/katecompletiondelegate.h
+@@ -29,6 +29,8 @@
+     KateCompletionWidget* widget() const;
+     KateDocument* document() const;
+   protected:
++    mutable int m_cachedRow;
++    mutable QList<int> m_cachedColumnStarts;
+     virtual void heightChanged() const;
+     QList<QTextLayout::FormatRange> createHighlighting(const QModelIndex& index, QStyleOptionViewItem& option) const;
+     
+--- a/kate/completion/katecompletionwidget.cpp
++++ b/kate/completion/katecompletionwidget.cpp
+@@ -104,7 +104,7 @@
+   m_updateFocusTimer = new QTimer(this);
+   m_updateFocusTimer->setSingleShot(true);
+   connect(m_updateFocusTimer, SIGNAL(timeout()), this, SLOT(updateFocus()));
+-  
++
+   QSizeGrip* sg = new QSizeGrip(m_statusBar);
+ 
+   QHBoxLayout* statusLayout = new QHBoxLayout(m_statusBar);
+@@ -142,7 +142,7 @@
+ 
+   //We need to do this, because else the focus goes to nirvana without any control when the completion-widget is clicked.
+   setFocusPolicy(Qt::ClickFocus);
+-  
++
+   foreach (QWidget* childWidget, findChildren<QWidget*>())
+     childWidget->setFocusPolicy(Qt::NoFocus);
+ }
+@@ -218,7 +218,7 @@
+   m_isSuspended = false;
+ 
+   m_dontShowArgumentHints = true;
+-  
++
+   if (!word.isValid()) {
+     kWarning(13035) << "Invalid range given to start code completion!";
+     return;
+@@ -242,7 +242,7 @@
+   m_completionRange = view()->doc()->smartManager()->newSmartRange(word);
+   m_completionRange->setInsertBehavior(KTextEditor::SmartRange::ExpandRight);
+   if(!m_completionRange->isValid()) {
+-    kWarning(13035) << "Could not construct valid smart-range from " << word;
++    kWarning(13035) << "Could not construct valid smart-range from" << word << "instead got" << *m_completionRange;
+     abortCompletion();
+     return;
+   }
+@@ -257,7 +257,7 @@
+     m_presentationModel->setCompletionModels(m_sourceModels);
+ 
+   setUpdatesEnabled(false);
+-  
++
+   updatePosition(true);
+ 
+   if (!m_presentationModel->completionModels().isEmpty()) {
+@@ -277,7 +277,7 @@
+       updateArgumentHintGeometry();
+     }
+   }
+-  
++
+   setUpdatesEnabled(true);
+ }
+ 
+@@ -466,12 +466,20 @@
+     return abortCompletion();
+ 
+   toExecute = m_presentationModel->mapToSource(toExecute);
++
++  if (!toExecute.isValid()) {
++    kWarning() << k_funcinfo << "Could not map index" << m_entryList->selectionModel()->currentIndex() << "to source index.";
++    return abortCompletion();
++  }
++
+   KTextEditor::Cursor start = m_completionRange->start();
+ 
+   // encapsulate all editing as being from the code completion, and undo-able in one step.
+   view()->doc()->editStart(true, Kate::CodeCompletionEdit);
+ 
+   KTextEditor::CodeCompletionModel* model = static_cast<KTextEditor::CodeCompletionModel*>(const_cast<QAbstractItemModel*>(toExecute.model()));
++  Q_ASSERT(model);
++
+   model->executeCompletionItem(view()->document(), *m_completionRange, toExecute.row());
+ 
+   view()->doc()->editEnd();
+--- a/kate/view/kateview.cpp
++++ b/kate/view/kateview.cpp
+@@ -259,20 +259,21 @@
+ void KateView::setupActions()
+ {
+   KActionCollection *ac = this->actionCollection ();
+-  QAction *a;
++  ac->setAssociatedWidget(m_viewInternal);
++  KAction *a;
+ 
+   m_toggleWriteLock = 0;
+ 
+-  m_cut = a = ac->addAction(KStandardAction::Cut, this, SLOT(cut()));
++  m_cut = a = static_cast<KAction*>(ac->addAction(KStandardAction::Cut, this, SLOT(cut())));
+   a->setWhatsThis(i18n("Cut the selected text and move it to the clipboard"));
+ 
+-  m_paste = a = ac->addAction(KStandardAction::PasteText, this, SLOT(paste()));
++  m_paste = a = static_cast<KAction*>(ac->addAction(KStandardAction::PasteText, this, SLOT(paste())));
+   a->setWhatsThis(i18n("Paste previously copied or cut clipboard contents"));
+ 
+-  m_copy = a = ac->addAction(KStandardAction::Copy, this, SLOT(copy()));
++  m_copy = a = static_cast<KAction*>(ac->addAction(KStandardAction::Copy, this, SLOT(copy())));
+   a->setWhatsThis(i18n( "Use this command to copy the currently selected text to the system clipboard."));
+ 
+-  m_copyHTML = a = ac->addAction("edit_copy_html");
++  m_copyHTML = a = static_cast<KAction*>(ac->addAction("edit_copy_html"));
+   m_copyHTML->setIcon(KIcon("edit-copy"));
+   m_copyHTML->setText(i18n("Copy as &HTML"));
+   connect(a, SIGNAL(triggered(bool)), SLOT(copyHTML()));
+@@ -280,16 +281,16 @@
+ 
+   if (!m_doc->readOnly())
+   {
+-    a = ac->addAction(KStandardAction::Save, m_doc, SLOT(documentSave()));
++    a = static_cast<KAction*>(ac->addAction(KStandardAction::Save, m_doc, SLOT(documentSave())));
+     a->setWhatsThis(i18n("Save the current document"));
+ 
+-    a = m_editUndo = ac->addAction(KStandardAction::Undo, m_doc, SLOT(undo()));
++    a = m_editUndo = static_cast<KAction*>(ac->addAction(KStandardAction::Undo, m_doc, SLOT(undo())));
+     a->setWhatsThis(i18n("Revert the most recent editing actions"));
+ 
+-    a = m_editRedo = ac->addAction(KStandardAction::Redo, m_doc, SLOT(redo()));
++    a = m_editRedo = static_cast<KAction*>(ac->addAction(KStandardAction::Redo, m_doc, SLOT(redo())));
+     a->setWhatsThis(i18n("Revert the most recent undo operation"));
+ 
+-    a = ac->addAction("tools_apply_wordwrap");
++    a = static_cast<KAction*>(ac->addAction("tools_apply_wordwrap"));
+     a->setText(i18n("&Word Wrap Document"));
+     a->setWhatsThis(i18n("Use this command to wrap all lines of the current document which are longer than the width of the"
+     " current view, to fit into this view.<br /><br /> This is a static word wrap, meaning it is not updated"
+@@ -297,7 +298,7 @@
+     connect(a, SIGNAL(triggered(bool)), SLOT(applyWordWrap()));
+ 
+     // setup Tools menu
+-    a = ac->addAction("tools_indent");
++    a = static_cast<KAction*>(ac->addAction("tools_indent"));
+     a->setIcon(KIcon("format-indent-more"));
+     a->setText(i18n("&Indent"));
+     a->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_I));
+@@ -305,33 +306,33 @@
+         "You can configure whether tabs should be honored and used or replaced with spaces, in the configuration dialog."));
+     connect(a, SIGNAL(triggered(bool)), SLOT(indent()));
+ 
+-    a = ac->addAction("tools_unindent");
++    a = static_cast<KAction*>(ac->addAction("tools_unindent"));
+     a->setIcon(KIcon("format-indent-less"));
+     a->setText(i18n("&Unindent"));
+     a->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_I));
+     a->setWhatsThis(i18n("Use this to unindent a selected block of text."));
+     connect(a, SIGNAL(triggered(bool)), SLOT(unIndent()));
+ 
+-    a = ac->addAction("tools_cleanIndent");
++    a = static_cast<KAction*>(ac->addAction("tools_cleanIndent"));
+     a->setText(i18n("&Clean Indentation"));
+     a->setWhatsThis(i18n("Use this to clean the indentation of a selected block of text (only tabs/only spaces)<br /><br />"
+         "You can configure whether tabs should be honored and used or replaced with spaces, in the configuration dialog."));
+     connect(a, SIGNAL(triggered(bool)), SLOT(cleanIndent()));
+ 
+ 
+-    a = ac->addAction("tools_align");
++    a = static_cast<KAction*>(ac->addAction("tools_align"));
+     a->setText(i18n("&Align"));
+     a->setWhatsThis(i18n("Use this to align the current line or block of text to its proper indent level."));
+     connect(a, SIGNAL(triggered(bool)), SLOT(align()));
+ 
+-    a = ac->addAction("tools_comment");
++    a = static_cast<KAction*>(ac->addAction("tools_comment"));
+     a->setText(i18n("C&omment"));
+     a->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_D));
+     a->setWhatsThis(i18n("This command comments out the current line or a selected block of text.<br /><br />"
+         "The characters for single/multiple line comments are defined within the language's highlighting."));
+     connect(a, SIGNAL(triggered(bool)), SLOT(comment()));
+ 
+-    a = ac->addAction("tools_uncomment");
++    a = static_cast<KAction*>(ac->addAction("tools_uncomment"));
+     a->setText(i18n("Unco&mment"));
+     a->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_D));
+     a->setWhatsThis(i18n("This command removes comments from the current line or a selected block of text.<br /><br />"
+@@ -343,33 +344,33 @@
+     connect(a, SIGNAL(triggered(bool)), SLOT( toggleWriteLock() ));
+     ac->addAction("tools_toggle_write_lock", a);
+ 
+-    a = ac->addAction("tools_uppercase");
++    a = static_cast<KAction*>(ac->addAction("tools_uppercase"));
+     a->setText(i18n("Uppercase"));
+     a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U));
+     a->setWhatsThis( i18n("Convert the selection to uppercase, or the character to the "
+       "right of the cursor if no text is selected.") );
+     connect(a, SIGNAL(triggered(bool)), SLOT(uppercase()));
+ 
+-    a = ac->addAction( "tools_lowercase" );
++    a = static_cast<KAction*>(ac->addAction( "tools_lowercase" ));
+     a->setText( i18n("Lowercase") );
+     a->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_U));
+     a->setWhatsThis( i18n("Convert the selection to lowercase, or the character to the "
+       "right of the cursor if no text is selected.") );
+     connect(a, SIGNAL(triggered(bool)), SLOT(lowercase()));
+ 
+-    a = ac->addAction( "tools_capitalize" );
++    a = static_cast<KAction*>(ac->addAction( "tools_capitalize" ));
+     a->setText( i18n("Capitalize") );
+     a->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_U));
+     a->setWhatsThis( i18n("Capitalize the selection, or the word under the "
+       "cursor if no text is selected.") );
+     connect(a, SIGNAL(triggered(bool)), SLOT(capitalize()));
+ 
+-    a = ac->addAction( "tools_join_lines" );
++    a = static_cast<KAction*>(ac->addAction( "tools_join_lines" ));
+     a->setText( i18n("Join Lines") );
+     a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_J));
+     connect(a, SIGNAL(triggered(bool)), SLOT( joinLines() ));
+ 
+-    a = ac->addAction( "tools_invoke_code_completion" );
++    a = static_cast<KAction*>(ac->addAction( "tools_invoke_code_completion" ));
+     a->setText( i18n("Invoke Code Completion") );
+     a->setWhatsThis(i18n("Manually invoke command completion, usually by using a shortcut bound to this action."));
+     a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Space));
+@@ -383,23 +384,23 @@
+     m_editRedo = 0;
+   }
+ 
+-  a = ac->addAction( KStandardAction::Print, m_doc, SLOT(print()) );
++  a = static_cast<KAction*>(ac->addAction( KStandardAction::Print, m_doc, SLOT(print()) ));
+   a->setWhatsThis(i18n("Print the current document."));
+ 
+-  a = ac->addAction( "file_reload" );
++  a = static_cast<KAction*>(ac->addAction( "file_reload" ));
+   a->setIcon(KIcon("view-refresh"));
+   a->setText(i18n("Reloa&d"));
+   a->setShortcuts(KStandardShortcut::reload());
+   a->setWhatsThis(i18n("Reload the current document from disk."));
+   connect(a, SIGNAL(triggered(bool)), SLOT(reloadFile()));
+ 
+-  a = ac->addAction( KStandardAction::SaveAs, m_doc, SLOT(documentSaveAs()) );
++  a = static_cast<KAction*>(ac->addAction( KStandardAction::SaveAs, m_doc, SLOT(documentSaveAs()) ));
+   a->setWhatsThis(i18n("Save the current document to disk, with a name of your choice."));
+ 
+-  a = ac->addAction( KStandardAction::GotoLine, this, SLOT(gotoLine()) );
++  a = static_cast<KAction*>(ac->addAction( KStandardAction::GotoLine, this, SLOT(gotoLine()) ));
+   a->setWhatsThis(i18n("This command opens a dialog and lets you choose a line that you want the cursor to move to."));
+ 
+-  a = ac->addAction("set_confdlg");
++  a = static_cast<KAction*>(ac->addAction("set_confdlg"));
+   a->setText(i18n("&Configure Editor..."));
+   a->setWhatsThis(i18n("Configure various aspects of this editor."));
+   connect(a, SIGNAL(triggered(bool)), SLOT(slotConfigDialog()));
+@@ -423,25 +424,25 @@
+   ac->addAction("tools_indentation", indentMenu);
+ 
+   // html export
+-  a = ac->addAction("file_export_html");
++  a = static_cast<KAction*>(ac->addAction("file_export_html"));
+   a->setText(i18n("E&xport as HTML..."));
+   a->setWhatsThis(i18n("This command allows you to export the current document"
+                       " with all highlighting information into a HTML document."));
+   connect(a, SIGNAL(triggered(bool)), SLOT(exportAsHTML()));
+ 
+-  m_selectAll = a= ac->addAction( KStandardAction::SelectAll, this, SLOT(selectAll()) );
++  m_selectAll = a= static_cast<KAction*>(ac->addAction( KStandardAction::SelectAll, this, SLOT(selectAll()) ));
+   a->setWhatsThis(i18n("Select the entire text of the current document."));
+ 
+-  m_deSelect = a= ac->addAction( KStandardAction::Deselect, this, SLOT(clearSelection()) );
++  m_deSelect = a= static_cast<KAction*>(ac->addAction( KStandardAction::Deselect, this, SLOT(clearSelection()) ));
+   a->setWhatsThis(i18n("If you have selected something within the current document, this will no longer be selected."));
+ 
+-  a = ac->addAction("incFontSizes");
++  a = static_cast<KAction*>(ac->addAction("incFontSizes"));
+   a->setIcon(KIcon("zoom-in"));
+   a->setText(i18n("Enlarge Font"));
+   a->setWhatsThis(i18n("This increases the display font size."));
+   connect(a, SIGNAL(triggered(bool)), m_viewInternal, SLOT(slotIncFontSizes()));
+ 
+-  a = ac->addAction("decFontSizes");
++  a = static_cast<KAction*>(ac->addAction("decFontSizes"));
+   a->setIcon(KIcon("zoom-out"));
+   a->setText(i18n("Shrink Font"));
+   a->setWhatsThis(i18n("This decreases the display font size."));
+@@ -507,7 +508,7 @@
+         "wrap column as defined in the editing properties" ));
+   connect(a, SIGNAL(triggered(bool)), SLOT( toggleWWMarker() ));
+ 
+-  a = m_switchCmdLine = ac->addAction("switch_to_cmd_line");
++  a = m_switchCmdLine = static_cast<KAction*>(ac->addAction("switch_to_cmd_line"));
+   a->setText(i18n("Switch to Command Line"));
+   a->setShortcut(QKeySequence(Qt::Key_F7));
+   a->setWhatsThis(i18n("Show/hide the command line on the bottom of the view."));
+@@ -528,31 +529,31 @@
+   KateViewEncodingAction *encodingAction = new KateViewEncodingAction(m_doc, this, i18n("E&ncoding"), this);
+   ac->addAction("set_encoding", encodingAction);
+ 
+-  a = ac->addAction( KStandardAction::Find, this, SLOT(find()) );
++  a = static_cast<KAction*>(ac->addAction( KStandardAction::Find, this, SLOT(find()) ));
+   a->setWhatsThis(i18n("Look up the first occurrence of a piece of text or regular expression."));
+   addAction(a);
+ 
+-  a = ac->addAction("edit_find_selected");
++  a = static_cast<KAction*>(ac->addAction("edit_find_selected"));
+   a->setText(i18n("Find Selected"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H));
+   a->setWhatsThis(i18n("Finds next occurrence of selected text."));
+   connect(a, SIGNAL(triggered(bool)), SLOT(findSelectedForwards()));
+ 
+-  a = ac->addAction("edit_find_selected_backwards");
++  a = static_cast<KAction*>(ac->addAction("edit_find_selected_backwards"));
+   a->setText(i18n("Find Selected Backwards"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H));
+   a->setWhatsThis(i18n("Finds previous occurrence of selected text."));
+   connect(a, SIGNAL(triggered(bool)), SLOT(findSelectedBackwards()));
+ 
+-  a = ac->addAction( KStandardAction::FindNext, this, SLOT(findNext()) );
++  a = static_cast<KAction*>(ac->addAction( KStandardAction::FindNext, this, SLOT(findNext()) ));
+   a->setWhatsThis(i18n("Look up the next occurrence of the search phrase."));
+   addAction(a);
+ 
+-  a = ac->addAction( KStandardAction::FindPrev, "edit_find_prev", this, SLOT(findPrevious()) );
++  a = static_cast<KAction*>(ac->addAction( KStandardAction::FindPrev, "edit_find_prev", this, SLOT(findPrevious()) ));
+   a->setWhatsThis(i18n("Look up the previous occurrence of the search phrase."));
+   addAction(a);
+ 
+-  a = ac->addAction( KStandardAction::Replace, this, SLOT(replace()) );
++  a = static_cast<KAction*>(ac->addAction( KStandardAction::Replace, this, SLOT(replace()) ));
+   a->setWhatsThis(i18n("Look up a piece of text or regular expression and replace the result with some given text."));
+ 
+   m_spell->createActions( ac );
+@@ -575,173 +576,173 @@
+   m_editActions->setAssociatedWidget(m_viewInternal);
+   KActionCollection* ac = m_editActions;
+ 
+-  QAction* a = ac->addAction("word_left");
++  KAction* a = static_cast<KAction*>(ac->addAction("word_left"));
+   a->setText(i18n("Move Word Left"));
+   a->setShortcuts(KStandardShortcut::backwardWord());
+   connect(a, SIGNAL(triggered(bool)),  SLOT(wordLeft()));
+ 
+-  a = ac->addAction("select_char_left");
++  a = static_cast<KAction*>(ac->addAction("select_char_left"));
+   a->setText(i18n("Select Character Left"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Left));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftCursorLeft()));
+ 
+-  a = ac->addAction("select_word_left");
++  a = static_cast<KAction*>(ac->addAction("select_word_left"));
+   a->setText(i18n("Select Word Left"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_Left));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftWordLeft()));
+ 
+ 
+-  a = ac->addAction("word_right");
++  a = static_cast<KAction*>(ac->addAction("word_right"));
+   a->setText(i18n("Move Word Right"));
+   a->setShortcuts(KStandardShortcut::forwardWord());
+   connect(a, SIGNAL(triggered(bool)), SLOT(wordRight()));
+ 
+-  a = ac->addAction("select_char_right");
++  a = static_cast<KAction*>(ac->addAction("select_char_right"));
+   a->setText(i18n("Select Character Right"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Right));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftCursorRight()));
+ 
+-  a = ac->addAction("select_word_right");
++  a = static_cast<KAction*>(ac->addAction("select_word_right"));
+   a->setText(i18n("Select Word Right"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_Right));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftWordRight()));
+ 
+ 
+-  a = ac->addAction("beginning_of_line");
++  a = static_cast<KAction*>(ac->addAction("beginning_of_line"));
+   a->setText(i18n("Move to Beginning of Line"));
+-  a->setShortcut(QKeySequence(Qt::Key_Home));
++  a->setShortcuts(KStandardShortcut::beginningOfLine());
+   connect(a, SIGNAL(triggered(bool)), SLOT(home()));
+ 
+-  a = ac->addAction("beginning_of_document");
++  a = static_cast<KAction*>(ac->addAction("beginning_of_document"));
+   a->setText(i18n("Move to Beginning of Document"));
+-  a->setShortcuts(KStandardShortcut::home());
++  a->setShortcuts(KStandardShortcut::begin());
+   connect(a, SIGNAL(triggered(bool)), SLOT(top()));
+ 
+-  a = ac->addAction("select_beginning_of_line");
++  a = static_cast<KAction*>(ac->addAction("select_beginning_of_line"));
+   a->setText(i18n("Select to Beginning of Line"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Home));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftHome()));
+ 
+-  a = ac->addAction("select_beginning_of_document");
++  a = static_cast<KAction*>(ac->addAction("select_beginning_of_document"));
+   a->setText(i18n("Select to Beginning of Document"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_Home));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftTop()));
+ 
+ 
+-  a = ac->addAction("end_of_line");
++  a = static_cast<KAction*>(ac->addAction("end_of_line"));
+   a->setText(i18n("Move to End of Line"));
+-  a->setShortcut(QKeySequence(Qt::Key_End));
++  a->setShortcuts(KStandardShortcut::endOfLine());
+   connect(a, SIGNAL(triggered(bool)), SLOT(end()));
+ 
+-  a = ac->addAction("end_of_document");
++  a = static_cast<KAction*>(ac->addAction("end_of_document"));
+   a->setText(i18n("Move to End of Document"));
+   a->setShortcuts(KStandardShortcut::end());
+   connect(a, SIGNAL(triggered(bool)), SLOT(bottom()));
+ 
+-  a = ac->addAction("select_end_of_line");
++  a = static_cast<KAction*>(ac->addAction("select_end_of_line"));
+   a->setText(i18n("Select to End of Line"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_End));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftEnd()));
+ 
+-  a = ac->addAction("select_end_of_document");
++  a = static_cast<KAction*>(ac->addAction("select_end_of_document"));
+   a->setText(i18n("Select to End of Document"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_End));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftBottom()));
+ 
+ 
+-  a = ac->addAction("select_line_up");
++  a = static_cast<KAction*>(ac->addAction("select_line_up"));
+   a->setText(i18n("Select to Previous Line"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Up));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftUp()));
+ 
+-  a = ac->addAction("scroll_line_up");
++  a = static_cast<KAction*>(ac->addAction("scroll_line_up"));
+   a->setText(i18n("Scroll Line Up"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up));
+   connect(a, SIGNAL(triggered(bool)), SLOT(scrollUp()));
+ 
+ 
+-  a = ac->addAction("move_line_down");
++  a = static_cast<KAction*>(ac->addAction("move_line_down"));
+   a->setText(i18n("Move to Next Line"));
+   a->setShortcut(QKeySequence(Qt::Key_Down));
+   connect(a, SIGNAL(triggered(bool)), SLOT(down()));
+ 
+ 
+-  a = ac->addAction("move_line_up");
++  a = static_cast<KAction*>(ac->addAction("move_line_up"));
+   a->setText(i18n("Move to Previous Line"));
+   a->setShortcut(QKeySequence(Qt::Key_Up));
+   connect(a, SIGNAL(triggered(bool)), SLOT(up()));
+ 
+ 
+-  a = ac->addAction("move_cursor_right");
++  a = static_cast<KAction*>(ac->addAction("move_cursor_right"));
+   a->setText(i18n("Move Character Right"));
+   a->setShortcut(QKeySequence(Qt::Key_Right));
+   connect(a, SIGNAL(triggered(bool)), SLOT(cursorRight()));
+ 
+ 
+-  a = ac->addAction("move_cusor_left");
++  a = static_cast<KAction*>(ac->addAction("move_cusor_left"));
+   a->setText(i18n("Move Character Left"));
+   a->setShortcut(QKeySequence(Qt::Key_Left));
+   connect(a, SIGNAL(triggered(bool)), SLOT(cursorLeft()));
+ 
+ 
+-  a = ac->addAction("select_line_down");
++  a = static_cast<KAction*>(ac->addAction("select_line_down"));
+   a->setText(i18n("Select to Next Line"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Down));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftDown()));
+ 
+-  a = ac->addAction("scroll_line_down");
++  a = static_cast<KAction*>(ac->addAction("scroll_line_down"));
+   a->setText(i18n("Scroll Line Down"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down));
+   connect(a, SIGNAL(triggered(bool)), SLOT(scrollDown()));
+ 
+ 
+-  a = ac->addAction("scroll_page_up");
++  a = static_cast<KAction*>(ac->addAction("scroll_page_up"));
+   a->setText(i18n("Scroll Page Up"));
+   a->setShortcuts(KStandardShortcut::prior());
+   connect(a, SIGNAL(triggered(bool)), SLOT(pageUp()));
+ 
+-  a = ac->addAction("select_page_up");
++  a = static_cast<KAction*>(ac->addAction("select_page_up"));
+   a->setText(i18n("Select Page Up"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_PageUp));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftPageUp()));
+ 
+-  a = ac->addAction("move_top_of_view");
++  a = static_cast<KAction*>(ac->addAction("move_top_of_view"));
+   a->setText(i18n("Move to Top of View"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_PageUp));
+   connect(a, SIGNAL(triggered(bool)), SLOT(topOfView()));
+ 
+-  a = ac->addAction("select_top_of_view");
++  a = static_cast<KAction*>(ac->addAction("select_top_of_view"));
+   a->setText(i18n("Select to Top of View"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT +  Qt::Key_PageUp));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftTopOfView()));
+ 
+ 
+-  a = ac->addAction("scroll_page_down");
++  a = static_cast<KAction*>(ac->addAction("scroll_page_down"));
+   a->setText(i18n("Scroll Page Down"));
+   a->setShortcuts(KStandardShortcut::next());
+   connect(a, SIGNAL(triggered(bool)), SLOT(pageDown()));
+ 
+-  a = ac->addAction("select_page_down");
++  a = static_cast<KAction*>(ac->addAction("select_page_down"));
+   a->setText(i18n("Select Page Down"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_PageDown));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftPageDown()));
+ 
+-  a = ac->addAction("move_bottom_of_view");
++  a = static_cast<KAction*>(ac->addAction("move_bottom_of_view"));
+   a->setText(i18n("Move to Bottom of View"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_PageDown));
+   connect(a, SIGNAL(triggered(bool)), SLOT(bottomOfView()));
+ 
+-  a = ac->addAction("select_bottom_of_view");
++  a = static_cast<KAction*>(ac->addAction("select_bottom_of_view"));
+   a->setText(i18n("Select to Bottom of View"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_PageDown));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftBottomOfView()));
+ 
+-  a = ac->addAction("to_matching_bracket");
++  a = static_cast<KAction*>(ac->addAction("to_matching_bracket"));
+   a->setText(i18n("Move to Matching Bracket"));
+   a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_6));
+   connect(a, SIGNAL(triggered(bool)), SLOT(toMatchingBracket()));
+ 
+-  a = ac->addAction("select_matching_bracket");
++  a = static_cast<KAction*>(ac->addAction("select_matching_bracket"));
+   a->setText(i18n("Select to Matching Bracket"));
+   a->setShortcut(QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_6));
+   connect(a, SIGNAL(triggered(bool)), SLOT(shiftToMatchingBracket()));
+@@ -750,32 +751,32 @@
+   // anders: shortcuts doing any changes should not be created in browserextension
+   if ( !m_doc->readOnly() )
+   {
+-    a = ac->addAction("transpose_char");
++    a = static_cast<KAction*>(ac->addAction("transpose_char"));
+     a->setText(i18n("Transpose Characters"));
+     a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_T));
+     connect(a, SIGNAL(triggered(bool)), SLOT(transpose()));
+ 
+-    a = ac->addAction("delete_line");
++    a = static_cast<KAction*>(ac->addAction("delete_line"));
+     a->setText(i18n("Delete Line"));
+     a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_K));
+     connect(a, SIGNAL(triggered(bool)), SLOT(killLine()));
+ 
+-    a = ac->addAction("delete_word_left");
++    a = static_cast<KAction*>(ac->addAction("delete_word_left"));
+     a->setText(i18n("Delete Word Left"));
+     a->setShortcuts(KStandardShortcut::deleteWordBack());
+     connect(a, SIGNAL(triggered(bool)), SLOT(deleteWordLeft()));
+ 
+-    a = ac->addAction("delete_word_right");
++    a = static_cast<KAction*>(ac->addAction("delete_word_right"));
+     a->setText(i18n("Delete Word Right"));
+     a->setShortcuts(KStandardShortcut::deleteWordForward());
+     connect(a, SIGNAL(triggered(bool)), SLOT(deleteWordRight()));
+ 
+-    a = ac->addAction("delete_next_character");
++    a = static_cast<KAction*>(ac->addAction("delete_next_character"));
+     a->setText(i18n("Delete Next Character"));
+     a->setShortcut(QKeySequence(Qt::Key_Delete));
+     connect(a, SIGNAL(triggered(bool)), SLOT(keyDelete()));
+ 
+-    a = ac->addAction("backspace");
++    a = static_cast<KAction*>(ac->addAction("backspace"));
+     a->setText(i18n("Backspace"));
+     QList<QKeySequence> scuts;
+     scuts << QKeySequence(Qt::Key_Backspace)
+@@ -788,7 +789,7 @@
+ #warning REMOVE THIS IN THE RELEASE
+ #endif
+ 
+-//     a = ac->addAction("debug_template_code");
++//     a = static_cast<KAction*>(ac->addAction("debug_template_code");
+ //     a->setText(i18n("Debug TemplateCode"));
+ //     a->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_1));
+ //     connect(a, SIGNAL(triggered(bool)), m_doc,SLOT(testTemplateCode()));
+@@ -808,22 +809,22 @@
+ {
+   KActionCollection *ac=this->actionCollection();
+ 
+-  QAction* a = ac->addAction("folding_toplevel");
++  KAction* a = static_cast<KAction*>(ac->addAction("folding_toplevel"));
+   a->setText(i18n("Collapse Toplevel"));
+   a->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Minus));
+   connect(a, SIGNAL(triggered(bool)), m_doc->foldingTree(), SLOT(collapseToplevelNodes()));
+ 
+-  a = ac->addAction("folding_expandtoplevel");
++  a = static_cast<KAction*>(ac->addAction("folding_expandtoplevel"));
+   a->setText(i18n("Expand Toplevel"));
+   a->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Plus));
+   connect(a, SIGNAL(triggered(bool)), SLOT(slotExpandToplevel()));
+ 
+-  a = ac->addAction("folding_collapselocal");
++  a = static_cast<KAction*>(ac->addAction("folding_collapselocal"));
+   a->setText(i18n("Collapse One Local Level"));
+   a->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_Minus));
+   connect(a, SIGNAL(triggered(bool)), SLOT(slotCollapseLocal()));
+ 
+-  a = ac->addAction("folding_expandlocal");
++  a = static_cast<KAction*>(ac->addAction("folding_expandlocal"));
+   a->setText(i18n("Expand One Local Level"));
+   a->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_Plus));
+   connect(a, SIGNAL(triggered(bool)), SLOT(slotExpandLocal()));
+@@ -1251,6 +1252,8 @@
+ 
+   m_toggleWWMarker->setChecked( m_renderer->config()->wordWrapMarker()  );
+ 
++  m_viewInternal->updateBracketMarkAttributes();
++
+   // update the text area
+   m_viewInternal->updateView (true);
+   m_viewInternal->repaint ();
+@@ -1867,24 +1870,6 @@
+ 
+ //END
+ 
+-//BEGIN IM INPUT STUFF
+-void KateView::setIMSelectionValue( const KTextEditor::Range& imRange, const KTextEditor::Range& imSelection, bool imComposeEvent )
+-{
+-  m_imRange = imRange;
+-  m_imSelection = imSelection;
+-  m_imComposeEvent = imComposeEvent;
+-}
+-
+-const KTextEditor::Range& KateView::imSelection() const
+-{
+-  return m_imSelection;
+-}
+-
+-const KTextEditor::Range& KateView::imEdit() const
+-{
+-  return m_imRange;
+-}
+-//END IM INPUT STUFF
+ 
+ void KateView::slotTextInserted ( KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text)
+ {
+--- a/kate/view/kateviewinternal.h
++++ b/kate/view/kateviewinternal.h
+@@ -3,6 +3,7 @@
+    Copyright (C) 2002 John Firebaugh <jfirebaugh at kde.org>
+    Copyright (C) 2002 Joseph Wenninger <jowenn at kde.org>
+    Copyright (C) 2002 Christoph Cullmann <cullmann at kde.org>
++   Copyright (C) 2007 Mirko Stocker <me at misto.ch>
+ 
+    Based on:
+      KWriteView : Copyright (C) 1999 Jochen Wilhelmy <digisnap at cs.tu-berlin.de>
+@@ -71,9 +72,6 @@
+     KateViewInternal ( KateView *view, KateDocument *doc );
+     ~KateViewInternal ();
+ 
+-    // Return the correct micro focus hint
+-    virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+-
+   //BEGIN EDIT STUFF
+   public:
+     void editStart ();
+@@ -262,7 +260,8 @@
+     bool m_possibleTripleClick;
+ 
+     // Bracket mark and corresponding decorative ranges
+-    //KateSmartRange *m_bm, *m_bmStart, *m_bmEnd;
++    KateSmartRange *m_bm, *m_bmStart, *m_bmEnd;
++    void updateBracketMarkAttributes();
+ 
+     enum DragState { diNone, diPending, diDragging };
+ 
+@@ -386,19 +385,14 @@
+    int m_textHintMouseX;
+    int m_textHintMouseY;
+ 
+-#if 0
+   /**
+    * IM input stuff
+    */
+-  protected:
+-    void imStartEvent( QIMEvent *e );
+-    void imComposeEvent( QIMEvent *e );
+-    void imEndEvent( QIMEvent *e );
+-#endif
++  public:
++    virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+ 
+   private:
+-    KTextEditor::Range m_imPreedit;
+-    KTextEditor::Cursor m_imPreeditSelStart;
++    KTextEditor::SmartRange* m_imPreedit;
+ 
+   // Arbitrary highlighting
+   public:
+--- a/kate/view/kateview.h
++++ b/kate/view/kateview.h
+@@ -522,8 +522,8 @@
+     void setupCodeFolding();
+ 
+     KActionCollection*     m_editActions;
+-    QAction*               m_editUndo;
+-    QAction*               m_editRedo;
++    KAction*               m_editUndo;
++    KAction*               m_editRedo;
+     KRecentFilesAction*    m_fileRecent;
+     KToggleAction*         m_toggleFoldingMarkers;
+     KToggleAction*         m_toggleIconBar;
+@@ -532,7 +532,7 @@
+     KToggleAction*         m_toggleDynWrap;
+     KSelectAction*         m_setDynWrapIndicators;
+     KToggleAction*         m_toggleWWMarker;
+-    QAction*               m_switchCmdLine;
++    KAction*               m_switchCmdLine;
+ 
+     KSelectAction*         m_setEndOfLine;
+ 
+@@ -591,19 +591,17 @@
+    * IM input stuff
+    */
+   public:
+-    void setIMSelectionValue( const KTextEditor::Range& imRange, const KTextEditor::Range& imSelection, bool imComposeEvent );
+-    const KTextEditor::Range& imSelection() const;
+-    const KTextEditor::Range& imEdit() const;
++    void setImComposeEvent( bool imComposeEvent ) { m_imComposeEvent = imComposeEvent; }
+     bool imComposeEvent () const { return m_imComposeEvent; }
+ 
+-  ///Template stuff
+-  virtual bool insertTemplateTextImplementation ( const KTextEditor::Cursor&, const QString &templateString, const QMap<QString,QString> &initialValues);
+-
+-
+   private:
+-    KTextEditor::Range m_imRange, m_imSelection;
+     bool m_imComposeEvent;
+ 
++  ///Template stuff
++  public:
++    virtual bool insertTemplateTextImplementation ( const KTextEditor::Cursor&, const QString &templateString, const QMap<QString,QString> &initialValues);
++
++
+   /**
+    * Accessors to the bars...
+    */
+--- a/kate/view/kateviewinternal.cpp
++++ b/kate/view/kateviewinternal.cpp
+@@ -38,6 +38,7 @@
+ #include "katedynamicanimation.h"
+ #include "katesmartmanager.h"
+ #include "katecompletionwidget.h"
++#include "katenamespace.h"
+ 
+ #include <kcursor.h>
+ #include <kdebug.h>
+@@ -54,6 +55,8 @@
+ #include <QtCore/QMutex>
+ #include <QtCore/QThread>
+ 
++static const bool debugPainting = false;
++
+ KateViewInternal::KateViewInternal(KateView *view, KateDocument *doc)
+   : QWidget (view)
+   , editSessionNumber (0)
+@@ -63,11 +66,9 @@
+   , m_cursor(doc)
+   , m_mouse()
+   , m_possibleTripleClick (false)
+-#if 0
+   , m_bm(doc->smartManager()->newSmartRange())
+-  , m_bmStart(doc->smartManager()->newSmartRange(KTextEditor::Range()/*, m_bm*/))
+-  , m_bmEnd(doc->smartManager()->newSmartRange(KTextEditor::Range()/*, m_bm*/))
+-#endif
++  , m_bmStart(doc->smartManager()->newSmartRange(KTextEditor::Range(), m_bm))
++  , m_bmEnd(doc->smartManager()->newSmartRange(KTextEditor::Range(), m_bm))
+   , m_dummy (0)
+ 
+   // stay on cursor will avoid that the view scroll around on press return at beginning
+@@ -79,7 +80,7 @@
+   , m_selChangedByUser (false)
+   , m_selectAnchor (-1, -1)
+   , m_selectionMode( Default )
+-  , m_layoutCache(new KateLayoutCache(renderer()))
++  , m_layoutCache(new KateLayoutCache(renderer(), this))
+   , m_preserveMaxX(false)
+   , m_currentMaxX(0)
+   , m_usePlainLines(false)
+@@ -92,29 +93,14 @@
+   , m_textHintEnabled(false)
+   , m_textHintMouseX(-1)
+   , m_textHintMouseY(-1)
++  , m_imPreedit(0L)
+   , m_smartDirty(false)
+ {
+-#if 0
+-  // Set up bracket marking
+-  static KTextEditor::Attribute::Ptr bracketOutline, bracketFill;
+-  if (!bracketOutline) {
+-    bracketOutline = KTextEditor::Attribute::Ptr(new KTextEditor::Attribute());
+-    bracketOutline->setOutline(m_view->m_renderer->config()->highlightedBracketColor());
+-  }
+-  if (!bracketFill) {
+-    bracketFill = KTextEditor::Attribute::Ptr(new KTextEditor::Attribute());
+-    bracketFill->setBackground(m_view->m_renderer->config()->highlightedBracketColor());
+-    bracketFill->setBackgroundFillWhitespace(false);
+-    bracketFill->setFontBold();
+-  }
+-
+-  m_bm->setAttribute(bracketOutline);
+-  m_bmStart->setAttribute(bracketFill);
+-  m_bmEnd->setAttribute(bracketFill);
+-#endif
+-
++  updateBracketMarkAttributes();
++  
+   setMinimumSize (0,0);
+   setAttribute(Qt::WA_OpaquePaintEvent);
++  //setAttribute(Qt::WA_InputMethodEnabled);
+ 
+   // cursor
+   m_cursor.setInsertBehavior (KTextEditor::SmartCursor::MoveOnInsert);
+@@ -307,7 +293,7 @@
+ 
+     if (thisLine.line() == -1) continue;
+ 
+-    if (thisLine.virtualLine() >= (int)m_doc->numVisLines()) {
++    if (thisLine.virtualLine() >= m_doc->numVisLines()) {
+       // Cache is too out of date
+       return KTextEditor::Cursor(m_doc->numVisLines() - 1, m_doc->lineLength(m_doc->getRealLine(m_doc->numVisLines() - 1)));
+     }
+@@ -405,12 +391,12 @@
+ 
+ void KateViewInternal::scrollNextPage()
+ {
+-  scrollViewLines(qMax( (int)linesDisplayed() - 1, 0 ));
++  scrollViewLines(qMax( linesDisplayed() - 1, 0 ));
+ }
+ 
+ void KateViewInternal::scrollPrevPage()
+ {
+-  scrollViewLines(-qMax( (int)linesDisplayed() - 1, 0 ));
++  scrollViewLines(-qMax( linesDisplayed() - 1, 0 ));
+ }
+ 
+ void KateViewInternal::scrollPrevLine()
+@@ -431,7 +417,7 @@
+   {
+     KTextEditor::Cursor end(m_doc->numVisLines() - 1, m_doc->lineLength(m_doc->getRealLine(m_doc->numVisLines() - 1)));
+ 
+-    m_cachedMaxStartPos = viewLineOffset(end, -((int)linesDisplayed() - 1));
++    m_cachedMaxStartPos = viewLineOffset(end, -(linesDisplayed() - 1));
+   }
+ 
+   m_usePlainLines = false;
+@@ -442,7 +428,7 @@
+ // c is a virtual cursor
+ void KateViewInternal::scrollPos(KTextEditor::Cursor& c, bool force, bool calledExternally)
+ {
+-  if (!force && ((!m_view->dynWordWrap() && c.line() == (int)startLine()) || c == startPos()))
++  if (!force && ((!m_view->dynWordWrap() && c.line() == startLine()) || c == startPos()))
+     return;
+ 
+   if (c.line() < 0)
+@@ -453,7 +439,7 @@
+     c = limit;
+ 
+     // Re-check we're not just scrolling to the same place
+-    if (!force && ((!m_view->dynWordWrap() && c.line() == (int)startLine()) || c == startPos()))
++    if (!force && ((!m_view->dynWordWrap() && c.line() == startLine()) || c == startPos()))
+       return;
+   }
+ 
+@@ -463,8 +449,8 @@
+   // for larger scrolls this makes 2-4 seconds difference on my xeon with dyn. word wrap on
+   // try to get it really working ;)
+   bool viewLinesScrolledUsable = !force
+-                                 && (c.line() >= (int)startLine()-(int)linesDisplayed()-1)
+-                                 && (c.line() <= (int)endLine()+(int)linesDisplayed()+1);
++                                 && (c.line() >= startLine() - linesDisplayed() - 1)
++                                 && (c.line() <= endLine() + linesDisplayed() + 1);
+ 
+   if (viewLinesScrolledUsable)
+     viewLinesScrolled = cache()->displayViewLine(c);
+@@ -477,9 +463,9 @@
+   if (viewLinesScrolledUsable)
+   {
+     int lines = linesDisplayed();
+-    if ((int)m_doc->numVisLines() < lines) {
++    if (m_doc->numVisLines() < lines) {
+       KTextEditor::Cursor end(m_doc->numVisLines() - 1, m_doc->lineLength(m_doc->getRealLine(m_doc->numVisLines() - 1)));
+-      lines = qMin((int)linesDisplayed(), cache()->displayViewLine(end) + 1);
++      lines = qMin(linesDisplayed(), cache()->displayViewLine(end) + 1);
+     }
+ 
+     Q_ASSERT(lines >= 0);
+@@ -488,17 +474,11 @@
+     {
+       updateView(false, viewLinesScrolled);
+ 
+-      int scrollHeight = -(viewLinesScrolled * (int)renderer()->fontHeight());
+-      //int scrollbarWidth = m_lineScroll->width();
++      int scrollHeight = -(viewLinesScrolled * renderer()->fontHeight());
+ 
+-      //
+-      // updates are for working around the scrollbar leaving blocks in the view
+-      //
+       scroll(0, scrollHeight);
+-      //update(0, height()+scrollHeight-scrollbarWidth, width(), 2*scrollbarWidth);
+-
+       m_leftBorder->scroll(0, scrollHeight);
+-      //m_leftBorder->update(0, m_leftBorder->height()+scrollHeight-scrollbarWidth, m_leftBorder->width(), 2*scrollbarWidth);
++
+       emit m_view->verticalScrollPositionChanged( m_view, c );
+       return;
+     }
+@@ -554,9 +534,6 @@
+ 
+   m_updatingView = true;
+ 
+-  if (changed)
+-    cache()->clear();
+-
+   bool blocked = m_lineScroll->blockSignals(true);
+ 
+   if (width() != cache()->viewWidth())
+@@ -633,7 +610,7 @@
+   }
+   else if ( c > viewLineOffset(endPos(), -m_minLinesVisible) )
+   {
+-    KTextEditor::Cursor scroll = viewLineOffset(c, -((int)linesDisplayed() - m_minLinesVisible - 1));
++    KTextEditor::Cursor scroll = viewLineOffset(c, -(linesDisplayed() - m_minLinesVisible - 1));
+     scrollPos(scroll, false, calledExternally);
+   }
+   else if ( c < viewLineOffset(startPos(), m_minLinesVisible) )
+@@ -729,32 +706,6 @@
+   return cursorToCoordinate(m_displayCursor, false);
+ }
+ 
+-QVariant KateViewInternal::inputMethodQuery ( Qt::InputMethodQuery query ) const
+-{
+-  /*switch (query) {
+-    case Qt::ImMicroFocus: {
+-      int line = cache()->displayViewLine(m_displayCursor, true);
+-      if (line < 0 || line >= cache()->viewLineCount)
+-          return QWidget::inputMethodQuery(query);
+-
+-      KateRenderer *renderer = renderer();
+-
+-      // Cursor placement code is changed for Asian input method that
+-      // shows candidate window. This behavior is same as Qt/E 2.3.7
+-      // which supports Asian input methods. Asian input methods need
+-      // start point of IM selection text to place candidate window as
+-      // adjacent to the selection text.
+-      uint preeditStrLen = renderer->textWidth(textLine(m_imPreeditStartLine), cursor.column()) - renderer->textWidth(textLine(m_imPreeditStartLine), m_imPreeditSelStart);
+-      uint x = m_cursorX - m_startX - lineRanges[line].startX() + lineRanges[line].xOffset() - preeditStrLen;
+-      uint y = line * renderer->fontHeight();
+-
+-      return QRect(x, y, 0, renderer->fontHeight());
+-    }
+-    default:*/
+-      return QWidget::inputMethodQuery(query);
+-  //}
+-}
+-
+ void KateViewInternal::doReturn()
+ {
+   m_doc->newLine( view() );
+@@ -1411,7 +1362,7 @@
+     return;
+   }
+ 
+-  if ((m_displayCursor.line() >= (int)m_doc->numVisLines() - 1) && (!m_view->dynWordWrap() || cache()->viewLine(m_cursor) == cache()->lastViewLine(m_cursor.line())))
++  if ((m_displayCursor.line() >= m_doc->numVisLines() - 1) && (!m_view->dynWordWrap() || cache()->viewLine(m_cursor) == cache()->lastViewLine(m_cursor.line())))
+     return;
+ 
+   m_preserveMaxX = true;
+@@ -1439,19 +1390,23 @@
+ 
+ void KateViewInternal::cursorToMatchingBracket( bool sel )
+ {
+-  KTextEditor::Range range(m_cursor, m_cursor);
+-
+-  if( !m_doc->findMatchingBracket( range ) )
++  if (!m_bm->isValid())
+     return;
+ 
+-  // The cursor is now placed just to the left of the matching bracket.
+-  // If it's an ending bracket, put it to the right (so we can easily
+-  // get back to the original bracket).
+-  if( range.end() > range.start() )
+-    range.end().setColumn(range.end().column() + 1);
++  KTextEditor::Cursor c;
+ 
+-  updateSelection( range.end(), sel );
+-  updateCursor( range.end() );
++  if (m_bmStart->contains(m_cursor) || m_bmStart->end() == m_cursor) {
++    c = m_bm->end();
++  } else if (m_bmEnd->contains(m_cursor) || m_bmEnd->end() == m_cursor) {
++    c = m_bm->start();
++  } else {
++    // should never happen: a range exists, but the cursor position is
++    // neither at the start nor at the end...
++    return;
++  }
++
++  updateSelection( c, sel );
++  updateCursor( c );
+ }
+ 
+ void KateViewInternal::topOfView( bool sel )
+@@ -1519,7 +1474,7 @@
+   if (cursorStart < m_minLinesVisible)
+     lineadj -= m_minLinesVisible - cursorStart;
+ 
+-  int linesToScroll = -qMax( ((int)linesDisplayed() - 1) - lineadj, 0 );
++  int linesToScroll = -qMax( (linesDisplayed() - 1) - lineadj, 0 );
+   m_preserveMaxX = true;
+ 
+   if (!m_doc->pageUpDownMovesCursor () && !atTop) {
+@@ -1564,7 +1519,7 @@
+   if (cursorStart > 0)
+     lineadj -= cursorStart;
+ 
+-  int linesToScroll = qMax( ((int)linesDisplayed() - 1) - lineadj, 0 );
++  int linesToScroll = qMax( (linesDisplayed() - 1) - lineadj, 0 );
+   m_preserveMaxX = true;
+ 
+   if (!m_doc->pageUpDownMovesCursor () && !atEnd) {
+@@ -1793,9 +1748,9 @@
+   {
+     int oldSelectionStartLine = m_view->selectionRange().start().line();
+     int oldSelectionEndLine = m_view->selectionRange().end().line();
+-    
++
+     m_view->clearSelection();
+-    
++
+     cache()->relayoutLines(oldSelectionStartLine, oldSelectionEndLine);
+     cache()->updateViewCache(startPos());
+ 
+@@ -1864,18 +1819,27 @@
+   emit m_view->cursorPositionChanged(m_view, m_cursor);
+ }
+ 
++void KateViewInternal::updateBracketMarkAttributes()
++{
++  KTextEditor::Attribute::Ptr bracketFill = KTextEditor::Attribute::Ptr(new KTextEditor::Attribute());
++  bracketFill->setBackground(m_view->m_renderer->config()->highlightedBracketColor());
++  bracketFill->setBackgroundFillWhitespace(false);
++  bracketFill->setFontBold();
++  
++  m_bmStart->setAttribute(bracketFill);
++  m_bmEnd->setAttribute(bracketFill);
++}
++
+ void KateViewInternal::updateBracketMarks()
+ {
+-#if 0
++  m_doc->removeHighlightFromView(m_view, m_bmStart);
++  m_doc->removeHighlightFromView(m_view, m_bmEnd);
++
+   if ( m_bm->isValid() ) {
+-    tagRange(*m_bm, true);
+     tagRange(*m_bmStart, true);
+     tagRange(*m_bmEnd, true);
+   }
+ 
+-  //m_bmStart->setValid(false);
+-  //m_bmEnd->setValid(false);
+-
+   // add some limit to this, this is really endless on big files without limit
+   int maxLines = linesDisplayed () * 3;
+   m_doc->newBracketMark( m_cursor, *m_bm, maxLines );
+@@ -1883,19 +1847,16 @@
+   if ( m_bm->isValid() ) {
+     m_bmStart->start() = m_bm->start();
+     m_bmStart->end().setPosition(m_bm->start().line(), m_bm->start().column() + 1);
+-    //m_bmStart->setValid(true);
+ 
+     m_bmEnd->start() = m_bm->end();
+-    m_bmEnd->end().setPosition(m_bm->end().line(), m_bmEnd->end().column() + 1);
+-    //m_bmEnd->setValid(true);
+-
+-    m_bm->end().setColumn(m_bm->end().column() + 1);
++    m_bmEnd->end().setPosition(m_bm->end().line(), m_bm->end().column() + 1);
+ 
+-    tagRange(*m_bm, true);
+     tagRange(*m_bmStart, true);
+     tagRange(*m_bmEnd, true);
++
++    m_doc->addHighlightToView(m_view, m_bmStart, true);
++    m_doc->addHighlightToView(m_view, m_bmEnd, true);
+   }
+-#endif
+ }
+ 
+ bool KateViewInternal::tagLine(const KTextEditor::Cursor& virtualCursor)
+@@ -1933,9 +1894,11 @@
+     //kDebug(13030)<<"end<startLine";
+     return false;
+   }
+-  if (start.line() > endLine())
++  // Used to be > endLine(), but cache may not be valid when checking, so use a
++  // less optimal but still adequate approximation (potential overestimation but minimal performance difference)
++  if (start.line() > startLine() + cache()->viewCacheLineCount())
+   {
+-    //kDebug(13030)<<"start> endLine"<<start<<" "<<((int)endLine());
++    //kDebug(13030)<<"start> endLine"<<start<<" "<<(endLine());
+     return false;
+   }
+ 
+@@ -1959,7 +1922,7 @@
+     int y = lineToY( start.line() );
+     // FIXME is this enough for when multiple lines are deleted
+     int h = (end.line() - start.line() + 2) * renderer()->fontHeight();
+-    if (end.line() == (int)m_doc->numVisLines() - 1)
++    if (end.line() == m_doc->numVisLines() - 1)
+       h = height();
+ 
+     m_leftBorder->update (0, y, m_leftBorder->width(), h);
+@@ -1970,7 +1933,10 @@
+     //bool justTagged = false;
+     for (int z = 0; z < cache()->viewCacheLineCount(); z++)
+     {
+-      if ((cache()->viewLine(z).virtualLine() > start.line() || (cache()->viewLine(z).virtualLine() == start.line() && cache()->viewLine(z).endCol() >= start.column() && start.column() != -1)) && (cache()->viewLine(z).virtualLine() < end.line() || (cache()->viewLine(z).virtualLine() == end.line() && (cache()->viewLine(z).startCol() <= end.column() || end.column() == -1))))
++      KateTextLayout& line = cache()->viewLine(z);
++      if (!line.isValid() ||
++          ((line.virtualLine() > start.line() || (line.virtualLine() == start.line() && line.endCol() >= start.column() && start.column() != -1)) &&
++           (line.virtualLine() < end.line() || (line.virtualLine() == end.line() && (line.startCol() <= end.column() || end.column() == -1)))))
+       {
+         //justTagged = true;
+         m_leftBorder->update (0, z * renderer()->fontHeight(), m_leftBorder->width(), m_leftBorder->height());
+@@ -2014,7 +1980,7 @@
+ {
+   KateTextLayout thisLine = yToKateTextLayout(p.y());
+   KTextEditor::Cursor c;
+-  
++
+   if (!thisLine.isValid()) // probably user clicked below the last line -> use the last line
+     thisLine = cache()->textLayout(m_doc->lines() - 1, -1);
+ 
+@@ -2076,7 +2042,8 @@
+       }
+       else if ( !((k->modifiers() & Qt::ControlModifier) || (k->modifiers() & Qt::AltModifier)) )
+       {
+-        return false;
++        keyPressEvent( k );
++        return k->isAccepted();
+       }
+ 
+     } break;
+@@ -2153,7 +2120,7 @@
+     int pos = line->firstChar();
+     if (pos > m_cursor.column()) pos = m_cursor.column();
+     if (pos != -1) {
+-      while ((int)line->length() > pos &&
++      while (line->length() > pos &&
+              !line->at(pos).isLetterOrNumber() &&
+              pos < m_cursor.column()) ++pos;
+     } else {
+@@ -2526,15 +2493,16 @@
+ 
+       if (m_selChangedByUser)
+       {
+-        if (m_view->selection())
++        if (m_view->selection()) {
+           QApplication::clipboard()->setText(m_view->selectionText (), QClipboard::Selection);
+ 
+-        // Set cursor to edge of selection... which edge depends on what
+-        // "direction" the selection was made in
+-        if ( m_view->selectionRange().start() < m_selectAnchor )
+-          updateCursor( m_view->selectionRange().start() );
+-        else
+-          updateCursor( m_view->selectionRange().end() );
++          // Set cursor to edge of selection... which edge depends on what
++          // "direction" the selection was made in
++          if ( m_view->selectionRange().start() < m_selectAnchor )
++            updateCursor( m_view->selectionRange().start() );
++          else
++            updateCursor( m_view->selectionRange().end() );
++        }
+ 
+         m_selChangedByUser = false;
+       }
+@@ -2688,7 +2656,7 @@
+     updateRegion += QRect(0, currentRectStart, width(), currentRectEnd);
+ 
+   if (!updateRegion.isEmpty()) {
+-    //kDebug() << "Requesting update to " << updateRegion.boundingRect();
++    if (debugPainting) kDebug() << k_funcinfo << "Update dirty region " << updateRegion;
+     update(updateRegion);
+   }
+ }
+@@ -2702,14 +2670,15 @@
+     doUpdateView();
+ #endif
+ 
+-  //kDebug (13030) << "GOT PAINT EVENT: x: " << e->rect().x() << " y: " << e->rect().y()
+-  //  << " width: " << e->rect().width() << " height: " << e->rect().height() << endl;
++  if (debugPainting) kDebug (13030) << "GOT PAINT EVENT: Region" << e->region();
+ 
+-  int xStart = startX() + e->rect().x();
+-  int xEnd = xStart + e->rect().width();
++  const QRect& unionRect = e->rect();
++
++  int xStart = startX() + unionRect.x();
++  int xEnd = xStart + unionRect.width();
+   uint h = renderer()->fontHeight();
+-  uint startz = (e->rect().y() / h);
+-  uint endz = startz + 1 + (e->rect().height() / h);
++  uint startz = (unionRect.y() / h);
++  uint endz = startz + 1 + (unionRect.height() / h);
+   uint lineRangesSize = cache()->viewCacheLineCount();
+ 
+   QPainter paint(this);
+@@ -2721,7 +2690,7 @@
+   renderer()->setShowTrailingSpaces(m_doc->config()->configFlags() & KateDocumentConfig::cfShowSpaces);
+ 
+   int sy = startz * h;
+-  paint.translate(e->rect().x(), startz * h);
++  paint.translate(unionRect.x(), startz * h);
+ 
+   for (uint z=startz; z <= endz; z++)
+   {
+@@ -2730,16 +2699,19 @@
+       if (!(z >= lineRangesSize))
+         cache()->viewLine(z).setDirty(false);
+ 
+-      paint.fillRect( 0, 0, e->rect().width(), h, renderer()->config()->backgroundColor() );
++      paint.fillRect( 0, 0, unionRect.width(), h, renderer()->config()->backgroundColor() );
+     }
+     else
+     {
+       //kDebug()<<"KateViewInternal::paintEvent(QPaintEvent *e):cache()->viewLine"<<z;
+       KateTextLayout& thisLine = cache()->viewLine(z);
+-      thisLine.setDirty(false);
+ 
+       if (!thisLine.viewLine() || z == startz) {
+-        //kDebug (13030) << "paint text: line: " << thisLine.line() << " viewLine " << thisLine.viewLine() << " x: " << e->rect().x() << " y: " << sy
++        // Don't bother if we're not in the requested update region
++        if (!e->region().contains(QRect(unionRect.x(), startz * h, unionRect.width(), h)))
++          continue;
++
++        //kDebug (13030) << "paint text: line: " << thisLine.line() << " viewLine " << thisLine.viewLine() << " x: " << unionRect.x() << " y: " << sy
+         //  << " width: " << xEnd-xStart << " height: " << h << endl;
+ 
+         if (thisLine.viewLine())
+@@ -2754,6 +2726,8 @@
+ 
+         if (thisLine.viewLine())
+           paint.translate(0, h * thisLine.viewLine());
++
++        thisLine.setDirty(false);
+       }
+     }
+ 
+@@ -2824,15 +2798,17 @@
+ {
+   if (m_scrollX || m_scrollY)
+   {
+-    scrollLines (startPos().line() + (m_scrollY / (int)renderer()->fontHeight()));
++    scrollLines (startPos().line() + (m_scrollY / renderer()->fontHeight()));
+     placeCursor( QPoint( m_mouseX, m_mouseY ), true );
+   }
+ }
+ 
+ void KateViewInternal::cursorTimeout ()
+ {
+-  renderer()->setDrawCaret(!renderer()->drawCaret());
+-  paintCursor();
++  if (!debugPainting) {
++    renderer()->setDrawCaret(!renderer()->drawCaret());
++    paintCursor();
++  }
+ }
+ 
+ void KateViewInternal::textHintTimeout ()
+@@ -2994,10 +2970,6 @@
+         scrollNextPage();
+     } else {
+       scrollViewLines(-((e->delta() / 120) * QApplication::wheelScrollLines()));
+-      // maybe a menu was opened or a bubbled window title is on us -> we shall erase it
+-      // FIXME this is the wrong place for this "fix"
+-      update();
+-      m_leftBorder->update();
+     }
+ 
+   } else if (columnScrollingPossible()) {
+@@ -3089,15 +3061,15 @@
+   if (tagFrom && (editTagLineStart <= int(m_doc->getRealLine(startLine()))))
+     tagAll();
+   else
+-    tagLines (editTagLineStart, tagFrom ? m_doc->lastLine() : editTagLineEnd, true);
++    tagLines (editTagLineStart, tagFrom ? qMax(m_doc->lastLine() + 1, editTagLineEnd) : editTagLineEnd, true);
+ 
+   if (editOldCursor == m_cursor)
+     updateBracketMarks();
+ 
+-  if (m_imPreedit.start() >= m_imPreedit.end())
++  if (!m_imPreedit)
+     updateView(true);
+ 
+-  if ((editOldCursor != m_cursor) && (m_imPreedit.start() >= m_imPreedit.end()))
++  if ((editOldCursor != m_cursor) && (!m_imPreedit))
+   {
+     m_madeVisible = false;
+     updateCursor ( m_cursor, true );
+@@ -3134,33 +3106,6 @@
+   }
+ }
+ 
+-void KateViewInternal::inputMethodEvent(QInputMethodEvent* e)
+-{
+-  if ( m_doc->readOnly() ) {
+-    e->ignore();
+-    return;
+-  }
+-
+-  if ( m_view->selection() )
+-    m_view->removeSelectedText();
+-
+-  if ( !e->commitString().isEmpty() ) {
+-      m_doc->insertText( m_cursor, e->commitString() );
+-  }
+-
+-#if 0
+-  if ( m_view->selection() )
+-    m_view->removeSelectedText();
+-
+-  m_imPreedit.setRange(m_cursor, m_cursor);
+-  m_imPreeditSelStart = m_cursor;
+-
+-  m_view->setIMSelectionValue( m_imPreedit, m_imPreedit, true );
+-
+-  QWidget::inputMethodEvent(e);
+-#endif
+-}
+-
+ KateLayoutCache* KateViewInternal::cache( ) const
+ {
+   return m_layoutCache;
+@@ -3305,11 +3250,15 @@
+       if (newRange && !oldRange)
+         enterStack.prepend(newRange);
+ 
+-      foreach (KTextEditor::SmartRange* exitedRange, exitStack)
++      foreach (KTextEditor::SmartRange* exitedRange, exitStack) {
+         endDynamic(hl, static_cast<KateSmartRange*>(exitedRange), mouse ? KTextEditor::Attribute::ActivateMouseIn : KTextEditor::Attribute::ActivateCaretIn);
++        static_cast<KateSmartRange*>(exitedRange)->feedbackMouseCaretChange(m_view, mouse, false);
++      }
+ 
+-      foreach (KTextEditor::SmartRange* enteredRange, enterStack)
++      foreach (KTextEditor::SmartRange* enteredRange, enterStack) {
++        static_cast<KateSmartRange*>(enteredRange)->feedbackMouseCaretChange(m_view, mouse, true);
+         startDynamic(hl, static_cast<KateSmartRange*>(enteredRange), mouse ? KTextEditor::Attribute::ActivateMouseIn : KTextEditor::Attribute::ActivateCaretIn);
++      }
+ 
+       if (mouse)
+         hl->mouseOver = static_cast<KateSmartRange*>(newRange);
+@@ -3404,89 +3353,117 @@
+   removeWatcher(range, this);
+ }
+ 
+-#if 0
+ //BEGIN IM INPUT STUFF
+-void KateViewInternal::imStartEvent( QIMEvent *e )
++QVariant KateViewInternal::inputMethodQuery ( Qt::InputMethodQuery query ) const
+ {
+-  if ( m_doc->m_bReadOnly ) {
+-    e->ignore();
+-    return;
+-  }
++  switch (query) {
++    case Qt::ImMicroFocus:
++      // Cursor placement code is changed for Asian input method that
++      // shows candidate window. This behavior is same as Qt/E 2.3.7
++      // which supports Asian input methods. Asian input methods need
++      // start point of IM selection text to place candidate window as
++      // adjacent to the selection text.
++      if (m_imPreedit)
++        return QRect(cursorToCoordinate(m_imPreedit->start()), QSize(0, renderer()->fontHeight()));
++      break;
+ 
+-  if ( m_view->selection() )
+-    m_view->removeSelectedText();
++    case Qt::ImFont:
++      return renderer()->currentFont();
++
++    case Qt::ImCursorPosition:
++      return cursorToCoordinate(m_cursor);
++
++    case Qt::ImSurroundingText:
++      if (KateTextLine::Ptr l = textLine(m_cursor.line()))
++        return l->string();
++      else
++        return QString();
+ 
+-  m_imPreeditStartLine = m_cursor.line();
+-  m_imPreeditStart = m_cursor.column();
+-  m_imPreeditLength = 0;
+-  m_imPreeditSelStart = m_imPreeditStart;
++    case Qt::ImCurrentSelection:
++      if (m_imPreedit)
++        return view()->doc()->text(*m_imPreedit);
++      else
++        return QString();
++  }
+ 
+-  m_view->setIMSelectionValue( m_imPreeditStartLine, m_imPreeditStart, 0, 0, 0, true );
++  return QWidget::inputMethodQuery(query);
+ }
+ 
+-void KateViewInternal::imComposeEvent( QIMEvent *e )
++void KateViewInternal::inputMethodEvent(QInputMethodEvent* e)
+ {
+-  if ( m_doc->m_bReadOnly ) {
++  if ( m_doc->readOnly() ) {
+     e->ignore();
+     return;
+   }
+ 
+-  // remove old preedit
+-  if ( m_imPreeditLength > 0 ) {
+-    m_cursor.setPosition( m_imPreeditStartLine, m_imPreeditStart );
+-    m_doc->removeText( m_imPreeditStartLine, m_imPreeditStart,
+-                       m_imPreeditStartLine, m_imPreeditStart + m_imPreeditLength );
+-  }
++  bool committing = !e->commitString().isEmpty() || e->replacementLength();
+ 
+-  m_imPreeditLength = e->text().length();
+-  m_imPreeditSelStart = m_imPreeditStart + e->cursorPos();
++  m_view->doc()->editStart(committing, committing ? Kate::UserInputEdit : Kate::InputMethodContextEdit);
+ 
+-  // update selection
+-  m_view->setIMSelectionValue( m_imPreeditStartLine, m_imPreeditStart, m_imPreeditStart + m_imPreeditLength,
+-                              m_imPreeditSelStart, m_imPreeditSelStart + e->selectionLength(),
+-                              true );
++  if ( m_view->selection() )
++    m_view->removeSelectedText();
+ 
+-  // insert new preedit
+-  m_doc->insertText( m_imPreeditStartLine, m_imPreeditStart, e->text() );
++  if (!m_imPreedit) {
++    m_imPreedit = m_view->doc()->smartManager()->newSmartRange(KTextEditor::Range(m_cursor, m_cursor), 0L, KTextEditor::SmartRange::ExpandRight);
++    m_view->addInternalHighlight(m_imPreedit);
++  }
+ 
++  if (!e->commitString().isEmpty() || e->replacementLength()) {
++    KTextEditor::Cursor start(m_imPreedit->start().line(), m_imPreedit->start().column() + e->replacementStart());
++    KTextEditor::Cursor removeEnd = start + KTextEditor::Cursor(0, e->replacementLength());
++    m_view->doc()->removeText(KTextEditor::Range(start, removeEnd));
++    m_view->doc()->insertText(start, e->commitString());
++
++    m_view->removeInternalHighlight(m_imPreedit);
++    delete m_imPreedit;
++    m_imPreedit = 0L;
+ 
+-  // update cursor
+-  m_cursor.setPosition( m_imPreeditStartLine, m_imPreeditSelStart );
+-  updateCursor( cursor, true );
++  } else {
++    m_view->doc()->removeText(*m_imPreedit);
++    m_view->doc()->insertText(m_imPreedit->start(), e->preeditString());
++  }
+ 
+-  updateView( true );
+-}
++  KTextEditor::Cursor newCursor = m_cursor;
++  bool hideCursor = false;
++  QColor caretColor;
+ 
+-void KateViewInternal::imEndEvent( QIMEvent *e )
+-{
+-  if ( m_doc->m_bReadOnly ) {
+-    e->ignore();
+-    return;
+-  }
++  if (m_imPreedit) {
++    m_imPreedit->clearAndDeleteChildRanges();
+ 
+-  if ( m_imPreeditLength > 0 ) {
+-    m_cursor.setPosition( m_imPreeditStartLine, m_imPreeditStart );
+-    m_doc->removeText( m_imPreeditStartLine, m_imPreeditStart,
+-                       m_imPreeditStartLine, m_imPreeditStart + m_imPreeditLength );
+-  }
++    int decorationColumn = 0;
++    foreach (const QInputMethodEvent::Attribute &a, e->attributes()) {
++      if (a.type == QInputMethodEvent::Cursor) {
++        newCursor = m_imPreedit->start() + KTextEditor::Cursor(0, a.start);
++        hideCursor = !a.length;
++        QColor c = qvariant_cast<QColor>(a.value);
++        if (c.isValid())
++          caretColor = c;
+ 
+-  m_view->setIMSelectionValue( m_imPreeditStartLine, m_imPreeditStart, 0, 0, 0, false );
++      } else if (a.type == QInputMethodEvent::TextFormat) {
++        QTextCharFormat f = qvariant_cast<QTextFormat>(a.value).toCharFormat();
++        if (f.isValid() && decorationColumn <= a.start) {
++          KTextEditor::Range fr(m_imPreedit->start().line(),  m_imPreedit->start().column() + a.start, m_imPreedit->start().line(), a.length);
++          KTextEditor::SmartRange* formatRange = m_view->doc()->smartManager()->newSmartRange(fr, m_imPreedit);
++          KTextEditor::Attribute::Ptr attribute(new KTextEditor::Attribute());
++          attribute->merge(f);
++          formatRange->setAttribute(attribute);
++          decorationColumn = a.start + a.length;
++        }
++      }
++    }
++  }
+ 
+-  if ( e->text().length() > 0 ) {
+-    m_doc->insertText( m_cursor.line(), m_cursor.column(), e->text() );
++  renderer()->setDrawCaret(hideCursor);
++  renderer()->setCaretOverrideColor(caretColor);
+ 
+-    if ( !m_cursorTimer.isActive() && KApplication::cursorFlashTime() > 0 )
+-      m_cursorTimer.start ( KApplication::cursorFlashTime() / 2 );
++  m_view->doc()->editEnd();
+ 
+-    updateView( true );
+-    updateCursor( cursor, true );
+-  }
++  if (newCursor != m_cursor)
++    updateCursor(newCursor);
+ 
+-  m_imPreeditStart = 0;
+-  m_imPreeditLength = 0;
+-  m_imPreeditSelStart = 0;
++  e->accept();
+ }
++
+ //END IM INPUT STUFF
+-#endif
+ 
+ // kate: space-indent on; indent-width 2; replace-tabs on;
+--- a/kate/CMakeLists.txt
++++ b/kate/CMakeLists.txt
+@@ -25,7 +25,6 @@
+   ${CMAKE_CURRENT_SOURCE_DIR}/syntax
+   ${CMAKE_CURRENT_SOURCE_DIR}/utils
+   ${CMAKE_CURRENT_SOURCE_DIR}/view
+-  ${CMAKE_SOURCE_DIR}/kdeprint
+   ${CMAKE_SOURCE_DIR}/kde3support
+   ${CMAKE_SOURCE_DIR}/kde3support/kdeui
+   ${CMAKE_SOURCE_DIR}/kjsembed
+@@ -36,7 +35,7 @@
+ set(CREATE_HASH_TABLE ${CMAKE_SOURCE_DIR}/kjs/create_hash_table )
+ 
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/katejscript.lut.h
+-   COMMAND ${PERL_EXECUTABLE} ${CREATE_HASH_TABLE} ${CMAKE_CURRENT_SOURCE_DIR}/jscript/katejscript.cpp >
++   COMMAND ${PERL_EXECUTABLE} ${CREATE_HASH_TABLE} ${CMAKE_CURRENT_SOURCE_DIR}/jscript/katejscript.cpp -n Kate >
+    ${CMAKE_CURRENT_BINARY_DIR}/katejscript.lut.h
+    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/jscript/katejscript.cpp
+ )
+@@ -74,6 +73,7 @@
+ mode/katemodemanager.cpp
+ mode/katemodeconfigpage.cpp
+ mode/katemodemenu.cpp
++mode/katewildcardmatcher.cpp
+ 
+ # rendering stuff (katerenderer  and helpers)
+ render/katerenderer.cpp
+@@ -145,7 +145,7 @@
+ kde4_add_plugin(katepart ${katepart_PART_SRCS})
+ 
+ # linking
+-target_link_libraries(katepart ${KDE4_KDECORE_LIBS} kutils ktexteditor kdeprint kjs kde3support )
++target_link_libraries(katepart ${KDE4_KDECORE_LIBS} kutils ktexteditor kjs kde3support )
+ 
+ if(KDE4_ENABLE_FINAL)
+ 	macro_add_file_dependencies(${CMAKE_CURRENT_BINARY_DIR}/katepart_final_cpp.cpp ${CMAKE_CURRENT_BINARY_DIR}/katejscript.lut.h )
+@@ -174,7 +174,7 @@
+ 
+ kde4_add_executable(testkateregression NOGUI RUN_UNINSTALLED ${testkateregression_SRCS})
+ 
+-target_link_libraries(testkateregression  ${KDE4_KDECORE_LIBS} kutils ktexteditor kdeprint kjs kde3support )
++target_link_libraries(testkateregression  ${KDE4_KDECORE_LIBS} kutils ktexteditor kjs kde3support )
+ 
+ #add_dependencies(check testkateregression)
+ 
+--- a/kate/jscript/katejscript.cpp
++++ b/kate/jscript/katejscript.cpp
+@@ -146,8 +146,6 @@
+ 
+ //BEGIN JS API STUFF
+ 
+-using namespace KJS;
+-
+ //BEGIN global methods
+ class KateJSGlobalFunctions : public KJS::JSObject
+ {
+@@ -168,10 +166,10 @@
+ 
+ KateJSGlobalFunctions::KateJSGlobalFunctions(int i, int length) : KJS::JSObject(), id(i)
+ {
+-  putDirect(Identifier("length"),length,KJS::DontDelete|KJS::ReadOnly|KJS::DontEnum);
++    putDirect(KJS::Identifier("length"),length,KJS::DontDelete|KJS::ReadOnly|KJS::DontEnum);
+ }
+ 
+-JSValue* KateJSGlobalFunctions::callAsFunction (KJS::ExecState *exec, KJS::JSObject *thisObj, const KJS::List &args)
++KJS::JSValue* KateJSGlobalFunctions::callAsFunction (KJS::ExecState *exec, KJS::JSObject *thisObj, const KJS::List &args)
+ {
+   switch (id) {
+     case Debug:
+@@ -613,13 +611,14 @@
+ @end
+ */
+ 
++using namespace Kate;
+ KJS_DEFINE_PROTOTYPE(KateJSDocumentProto)
+ KJS_IMPLEMENT_PROTOFUNC(KateJSDocumentProtoFunc)
+ KJS_IMPLEMENT_PROTOTYPE("KateJSDocument", KateJSDocumentProto, KateJSDocumentProtoFunc)
+ 
+ const KJS::ClassInfo KateJSDocument::info = { "KateJSDocument", 0, 0, 0 };
+ 
+-JSValue* KateJSDocumentProtoFunc::callAsFunction(KJS::ExecState *exec,
++KJS::JSValue* KateJSDocumentProtoFunc::callAsFunction(KJS::ExecState *exec,
+                                                  KJS::JSObject *thisObj,
+                                                  const KJS::List &args)
+ {
+@@ -1609,7 +1608,7 @@
+                                                         const QString& resourceDir,
+                                                         const QStringList &keys)
+ {
+-  KConfig cfgFile(rcFile, KConfig::CascadeConfig);
++  KConfig cfgFile(rcFile, KConfig::NoGlobals);
+   KConfigGroup config = cfgFile.group("General");
+ 
+   bool force = false;
+--- a/kate/document/kateedit.h
++++ b/kate/document/kateedit.h
+@@ -173,7 +173,7 @@
+ 
+   Q_SIGNALS:
+     void editDone(KateEditInfo* edit);
+-    void editUndone(KateEditInfo* edit);
++    //void editUndone(KateEditInfo* edit);
+ 
+   private:
+     KateDocument* m_doc;
+--- a/kate/document/katecursor.cpp
++++ b/kate/document/katecursor.cpp
+@@ -107,7 +107,7 @@
+   int nbCharLeft = nbChar - nbCharsOnLineAfter();
+ 
+   if(nbCharLeft > 0) {
+-    return gotoNextLine() && moveForward((uint)nbCharLeft);
++    return gotoNextLine() && moveForward((uint)nbCharLeft - 1);
+   } else {
+     m_column += nbChar;
+     return true;
+@@ -118,7 +118,7 @@
+ {
+   int nbCharLeft = nbChar - m_column;
+   if(nbCharLeft > 0) {
+-    return gotoEndOfPreviousLine() && moveBackward((uint)nbCharLeft);
++    return gotoEndOfPreviousLine() && moveBackward((uint)nbCharLeft - 1);
+   } else {
+     m_column -= nbChar;
+     return true;
+--- a/kate/document/katedocument.cpp
++++ b/kate/document/katedocument.cpp
+@@ -3,6 +3,7 @@
+    Copyright (C) 2001 Joseph Wenninger <jowenn at kde.org>
+    Copyright (C) 1999 Jochen Wilhelmy <digisnap at cs.tu-berlin.de>
+    Copyright (C) 2006 Hamish Rodda <rodda at kde.org>
++   Copyright (C) 2007 Mirko Stocker <me at misto.ch>
+ 
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+@@ -438,6 +439,11 @@
+ 
+ QString KateDocument::text( const KTextEditor::Range& range, bool blockwise ) const
+ {
++  if (!range.isValid()) {
++    kWarning() << k_funcinfo << "Text requested for invalid range" << range;
++    return QString();
++  }
++  
+   if ( blockwise && (range.start().column() > range.end().column()) )
+     return QString ();
+ 
+@@ -501,8 +507,10 @@
+ {
+   QStringList ret;
+ 
+-  if (!range.isValid())
++  if (!range.isValid()) {
++    kWarning() << k_funcinfo << "Text requested for invalid range" << range;
+     return ret;
++  }
+ 
+   if ( blockwise && (range.start().column() > range.end().column()) )
+     return ret;
+@@ -1558,7 +1566,9 @@
+ 
+   KTextEditor::Range rangeRemoved(line, 0, line, oldText.length());
+ 
+-  if (line) {
++  if (line < lastLine()) {
++    rangeRemoved.end().setPosition(line + 1, 0);
++  } else if (line) {
+     KateTextLine::Ptr prevLine = plainKateTextLine(line - 1);
+     rangeRemoved.start().setPosition(line - 1, prevLine->length());
+   }
+@@ -3421,12 +3431,12 @@
+   if (!suppressOpeningErrorDialogs())
+   {
+     if (!success)
+-      KMessageBox::error (widget(), i18n ("The file %1 could not be loaded, as it was not possible to read from it.\n\nCheck if you have read access to this file.", this->url().url()));
++      KMessageBox::error (widget(), i18n ("The file %1 could not be loaded, as it was not possible to read from it.\n\nCheck if you have read access to this file.", this->url().pathOrUrl()));
+   }
+ 
+   if (!success) {
+     setOpeningError(true);
+-    setOpeningErrorMessage(i18n ("The file %1 could not be loaded, as it was not possible to read from it.\n\nCheck if you have read access to this file.",this->url().url()));
++    setOpeningErrorMessage(i18n ("The file %1 could not be loaded, as it was not possible to read from it.\n\nCheck if you have read access to this file.",this->url().pathOrUrl()));
+   }
+ 
+   // warn -> opened binary file!!!!!!!
+@@ -3437,12 +3447,12 @@
+ 
+     if(!suppressOpeningErrorDialogs())
+       KMessageBox::information (widget()
+-        , i18n ("The file %1 is a binary, saving it will result in a corrupt file.", this->url().url())
++        , i18n ("The file %1 is a binary, saving it will result in a corrupt file.", this->url().pathOrUrl())
+         , i18n ("Binary File Opened")
+         , "Binary File Opened Warning");
+ 
+     setOpeningError(true);
+-    setOpeningErrorMessage(i18n ("The file %1 is a binary, saving it will result in a corrupt file.", this->url().url()));
++    setOpeningErrorMessage(i18n ("The file %1 is a binary, saving it will result in a corrupt file.", this->url().pathOrUrl()));
+   }
+ 
+   // warn: opened broken utf-8 file...
+@@ -3455,13 +3465,13 @@
+       KMessageBox::information (widget()
+         , i18n ("The file %1 was opened with UTF-8 encoding but contained invalid characters."
+                 " It is set to read-only mode, as saving might destroy it's content."
+-                " Either reopen the file with the correct encoding chosen or enable the read-write mode again in the menu to be able to edit it.", this->url().url())
++                " Either reopen the file with the correct encoding chosen or enable the read-write mode again in the menu to be able to edit it.", this->url().pathOrUrl())
+         , i18n ("Broken UTF-8 File Opened")
+         , "Broken UTF-8 File Opened Warning");
+     setOpeningError(true);
+     setOpeningErrorMessage(i18n ("The file %1 was opened with UTF-8 encoding but contained invalid characters."
+               " It is set to read-only mode, as saving might destroy it's content."
+-              " Either reopen the file with the correct encoding chosen or enable the read-write mode again in the menu to be able to edit it.", this->url().url()));
++              " Either reopen the file with the correct encoding chosen or enable the read-write mode again in the menu to be able to edit it.", this->url().pathOrUrl()));
+   }
+ 
+   //
+@@ -3476,7 +3486,7 @@
+   // warn -> try to save binary file!!!!!!!
+   //
+   if (m_buffer->binary() && (KMessageBox::warningContinueCancel (widget()
+-        , i18n ("The file %1 is a binary, saving it will result in a corrupt file.", url().url())
++        , i18n ("The file %1 is a binary, saving it will result in a corrupt file.", url().pathOrUrl())
+         , i18n ("Trying to Save Binary File")
+         , KGuiItem(i18n("Save Nevertheless"))
+         , KStandardGuiItem::cancel(), "Binary File Save Warning") != KMessageBox::Continue))
+@@ -3575,7 +3585,7 @@
+     if (!backupSuccess && (KMessageBox::warningContinueCancel (widget()
+         , i18n ("For file %1 no backup copy could be created before saving."
+                 " If an error occurs while saving, you might lose the data of this file."
+-                " A reason could be that the media you write to is full or the directory of the file is read-only for you.", url().url())
++                " A reason could be that the media you write to is full or the directory of the file is read-only for you.", url().pathOrUrl())
+         , i18n ("Failed to create backup copy.")
+         , KGuiItem(i18n("Try to Save Nevertheless"))
+         , KStandardGuiItem::cancel(), "Backup Failed Warning") != KMessageBox::Continue))
+@@ -3608,7 +3618,7 @@
+     // add m_file again to dirwatch
+     activateDirWatch (oldPath);
+ 
+-    KMessageBox::error (widget(), i18n ("The document could not be saved, as it was not possible to write to %1.\n\nCheck that you have write access to this file or that enough disk space is available.", this->url().url()));
++    KMessageBox::error (widget(), i18n ("The document could not be saved, as it was not possible to write to %1.\n\nCheck that you have write access to this file or that enough disk space is available.", this->url().pathOrUrl()));
+ 
+     return false;
+   }
+@@ -5012,54 +5022,48 @@
+   }
+ 
+   bool forward = isStartBracket( bracket );
+-  int startAttr = textLine->attribute( range.start().column() );
+-  uint count = 0;
+-  int lines = 0;
+-  range.end() = range.start();
++  uint nesting = 0;
+ 
+-  while( true ) {
+-    /* Increment or decrement, check base cases */
+-    if( forward ) {
+-      if( range.end().column() + 1 < lineLength( range.end().line() ) ) {
+-        range.end().setColumn(range.end().column() + 1);
++  int minLine = qMax( range.start().line() - maxLines, 0 );
++  int maxLine = qMin( range.start().line() + maxLines, documentEnd().line() );
++  
++  range.end() = range.start();
++  KateDocCursor cursor(range.start(), this);
++  uchar validAttr = cursor.currentAttrib();
++  
++  while( cursor.line() >= minLine && cursor.line() <= maxLine ) {
+ 
+-      } else {
+-        if( range.end().line() >= (int)lastLine() )
+-          return false;
+-        range.end().setPosition(range.end().line() + 1, 0);
+-        textLine = m_buffer->plainLine( range.end().line() );
+-        lines++;
+-      }
+-    } else {
+-      if( range.end().column() > 0 ) {
+-        range.end().setColumn(range.end().column() - 1);
++    if( forward )
++      cursor.moveForward(1);
++    else
++      cursor.moveBackward(1);
+ 
+-      } else {
+-        if( range.end().line() <= 0 )
+-          return false;
+-        range.end().setPosition(range.end().line() - 1, lineLength( range.end().line() ) - 1);
+-        textLine = m_buffer->plainLine( range.end().line() );
+-        lines++;
++    if( !cursor.validPosition() )
++      return false;
++    
++    if( cursor.currentAttrib() == validAttr )
++    {
++      /* Check for match */
++      QChar c = cursor.currentChar();
++      if( c == bracket ) {
++        nesting++;
++      } else if( c == opposite ) {
++        if( nesting == 0 ) {
++          if( forward ) 
++            range.end() = cursor;
++          else
++            range.start() = cursor;
++          return true;
++        }
++        nesting--;
+       }
+     }
+ 
+-    if ((maxLines != -1) && (lines > maxLines))
++    if(cursor == KTextEditor::Cursor(0,0) || cursor >= documentEnd())
+       return false;
+-
+-    /* Easy way to skip comments */
+-    if( textLine->attribute( range.end().column() ) != startAttr )
+-      continue;
+-
+-    /* Check for match */
+-    QChar c = textLine->at( range.end().column() );
+-    if( c == bracket ) {
+-      count++;
+-    } else if( c == opposite ) {
+-      if( count == 0 )
+-        return true;
+-      count--;
+-    }
+   }
++
++  return false;
+ }
+ 
+ void KateDocument::guiActivateEvent( KParts::GUIActivateEvent *ev )
+@@ -5790,13 +5794,13 @@
+   switch( m_modOnHdReason )
+   {
+     case OnDiskModified:
+-      return i18n("The file '%1' was modified by another program.",  url().prettyUrl() );
++      return i18n("The file '%1' was modified by another program.",  url().pathOrUrl() );
+       break;
+     case OnDiskCreated:
+-      return i18n("The file '%1' was created by another program.",  url().prettyUrl() );
++      return i18n("The file '%1' was created by another program.",  url().pathOrUrl() );
+       break;
+     case OnDiskDeleted:
+-      return i18n("The file '%1' was deleted by another program.",  url().prettyUrl() );
++      return i18n("The file '%1' was deleted by another program.",  url().pathOrUrl() );
+       break;
+     default:
+       return QString();
+--- a/kjsembed/kjsembed/slotproxy.h
++++ b/kjsembed/kjsembed/slotproxy.h
+@@ -57,6 +57,7 @@
+             QByteArray m_stringData;
+             KJS::Interpreter *m_interpreter;
+             KJS::JSObject *m_object;
++            QVariant m_tmpResult;
+     };
+ }
+ #endif
+--- a/kjsembed/kjsembed/slotproxy.cpp
++++ b/kjsembed/kjsembed/slotproxy.cpp
+@@ -34,7 +34,6 @@
+ //#define DEBUG_SLOTPROXY 1
+ 
+ using namespace KJSEmbed;
+-using namespace KJS;
+ 
+ SlotProxy::SlotProxy(KJS::JSObject *obj, KJS::Interpreter *interpreter, QObject *parent, const QByteArray &signature)
+     : QObject(parent), m_interpreter(interpreter), m_object(obj)
+@@ -110,19 +109,25 @@
+     KJS::JSValue *retValue;
+     if ( !fun->implementsCall() )
+     {
++#ifdef DEBUG_SLOTPROXY
++        qDebug() << "SlotProxy::callMethod got bad handler";
++#endif
+         QString msg = i18n( "Bad slot handler: Object %1 Identifier %2 Method %3 Signature: %4.",
+                             m_object->className().ascii(),
+                             id.ascii(),
+                             methodName.data(),
+                             QString(m_signature));
+-        
++
+         retValue = throwError(exec, KJS::TypeError, msg);
+     }
+     else
+         retValue = fun->call(exec, m_object, args);
+-    
++
+     if( exec->hadException() )
+     {
++#ifdef DEBUG_SLOTPROXY
++        qDebug() << "SlotProxy::callMethod had exception";
++#endif
+         if (m_interpreter->shouldPrintExceptions())
+         {
+             KJS::JSLock lock;
+@@ -137,7 +142,7 @@
+ 
+         // clear it so it doesn't stop other things
+         exec->clearException();
+-        
++
+         return KJS::jsNull();
+     }
+     else
+@@ -289,7 +294,7 @@
+ 
+ int SlotProxy::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+ {
+-#if defined(DEBUG_SLOTPROXY) && (DEBUG_SLOTPROXY > 1)
++#ifdef DEBUG_SLOTPROXY
+ 	qDebug("SlotProxy::qt_metacall(_c=%d, _id=%d, _a=%p _a[0]=%p _a[1]=%p) obj=", _c, _id, _a, _a[0], _a[1], this);
+ #endif
+     _id = QObject::qt_metacall(_c, _id, _a);
+@@ -299,11 +304,16 @@
+     {
+         switch (_id)
+         {
+-            case 0:
++            case 0: {
+                 // invoke js method here
+                 QByteArray method = m_signature.left(m_signature.indexOf('('));
+-                callMethod(method, _a);
+-                break;
++                KJS::JSValue *result = callMethod(method, _a);
++                m_tmpResult = convertToVariant(m_interpreter->globalExec(), result);
++#ifdef DEBUG_SLOTPROXY
++                qDebug()<<"SlotProxy::qt_metacall result="<<m_tmpResult.toString();
++#endif
++                _a[0] = &(m_tmpResult);
++            } break;
+         }
+         _id -= 1;
+     }
+--- a/kjsembed/kjsembed/builtins.h
++++ b/kjsembed/kjsembed/builtins.h
+@@ -21,8 +21,8 @@
+ */
+ 
+ 
+-#ifndef BUILTINS_H
+-#define BUILTINS_h
++#ifndef KJSEMBED_BUILTINS_H
++#define KJSEMBED_BUILTINS_H
+ 
+ #include <kjs/object.h>
+ #include <kjsembed/object_binding.h>
+--- a/kjsembed/CMakeLists.txt
++++ b/kjsembed/CMakeLists.txt
+@@ -1,5 +1,3 @@
+-KDE4_NO_ENABLE_FINAL(kjsembed)
+-
+ include_directories(
+     ${CMAKE_SOURCE_DIR}
+     ${CMAKE_SOURCE_DIR}/kjsembed 
+--- a/kjs/interpreter.cpp
++++ b/kjs/interpreter.cpp
+@@ -214,15 +214,17 @@
+ }
+     
+ Interpreter::Interpreter(JSObject* globalObject)
+-    : m_globalExec(this, 0)
+-    , m_globalObject(globalObject)
++    : m_globalExec(this, 0),
++      m_globalObject(globalObject),
++      globPkg(0)
+ {
+     init();
+ }
+ 
+ Interpreter::Interpreter()
+-    : m_globalExec(this, 0)
+-    , m_globalObject(new JSObject())
++    : m_globalExec(this, 0),
++      m_globalObject(new JSObject()),
++      globPkg(0)
+ {
+     init();
+ }
+--- a/kjs/value.cpp
++++ b/kjs/value.cpp
+@@ -97,6 +97,11 @@
+     return KJS::toUInt16(const_cast<JSValue*>(this)->toNumber(exec));
+ }
+ 
++float JSValue::toFloat(ExecState* exec) const
++{
++    return static_cast<float>(toNumber(exec));
++}
++
+ bool JSCell::getNumber(double &numericValue) const
+ {
+     if (!isNumber())
+--- a/kjs/lexer.cpp
++++ b/kjs/lexer.cpp
+@@ -137,6 +137,8 @@
+ 
+ void Lexer::shift(unsigned int p)
+ {
++  // Here would be a good place to strip Cf characters, but that has caused compatibility problems:
++  // <http://bugs.webkit.org/show_bug.cgi?id=10183>.
+   while (p--) {
+     current = next1;
+     next1 = next2;
+--- a/kjs/wtf/Platform.h
++++ b/kjs/wtf/Platform.h
+@@ -117,8 +117,15 @@
+ 
+ #if defined(arm)
+ #define WTF_PLATFORM_ARM 1
++#if defined(__ARMEB__)
++#define WTF_PLATFORM_BIG_ENDIAN 1
++#elif !defined(__ARM_EABI__) && !defined(__ARMEB__)
+ #define WTF_PLATFORM_MIDDLE_ENDIAN 1
+ #endif
++#if !defined(__ARM_EABI__)
++#define WTF_PLATFORM_FORCE_PACK 1
++#endif
++#endif
+ 
+ /* PLATFORM(X86) */
+ #if   defined(__i386__) \
+--- a/kjs/regexp_object.cpp
++++ b/kjs/regexp_object.cpp
+@@ -208,11 +208,21 @@
+ @end
+ */
+ 
++struct KJS::RegExpObjectImpPrivate {
++  // Global search cache / settings
++  RegExpObjectImpPrivate() : lastInput(""), lastNumSubPatterns(0), multiline(false) { }
++  UString lastInput;
++  OwnArrayPtr<int> lastOvector;
++  unsigned lastNumSubPatterns : 31;
++  bool multiline              : 1;
++};
++
+ RegExpObjectImp::RegExpObjectImp(ExecState* exec,
+                                  FunctionPrototype *funcProto,
+                                  RegExpPrototype *regProto)
+ 
+-  : InternalFunctionImp(funcProto), lastInput(""), lastNumSubPatterns(0), multiline(false)
++  : InternalFunctionImp(funcProto),
++    d(new RegExpObjectImpPrivate)
+ {
+   // ECMA 15.10.5.1 RegExp.prototype
+   putDirect(exec->propertyNames().prototype, regProto, DontEnum | DontDelete | ReadOnly);
+@@ -240,9 +250,9 @@
+   if (!match.isNull()) {
+     ASSERT(tmpOvector);
+     
+-    lastInput = s;
+-    lastOvector.set(tmpOvector);
+-    lastNumSubPatterns = r->subPatterns();
++    d->lastInput = s;
++    d->lastOvector.set(tmpOvector);
++    d->lastNumSubPatterns = r->subPatterns();
+   }
+   
+   return match;
+@@ -253,27 +263,27 @@
+   List list;
+   // The returned array contains 'result' as first item, followed by the list of matches
+   list.append(jsString(result));
+-  if ( lastOvector )
+-    for ( unsigned int i = 1 ; i < lastNumSubPatterns + 1 ; ++i )
++  if ( d->lastOvector )
++    for ( unsigned int i = 1 ; i < d->lastNumSubPatterns + 1 ; ++i )
+     {
+-      int start = lastOvector[2*i];
++      int start = d->lastOvector[2*i];
+       if (start == -1)
+         list.append(jsUndefined());
+       else {
+-        UString substring = lastInput.substr( start, lastOvector[2*i+1] - start );
++        UString substring = d->lastInput.substr( start, d->lastOvector[2*i+1] - start );
+         list.append(jsString(substring));
+       }
+     }
+   JSObject *arr = exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
+-  arr->put(exec, "index", jsNumber(lastOvector[0]));
+-  arr->put(exec, "input", jsString(lastInput));
++  arr->put(exec, "index", jsNumber(d->lastOvector[0]));
++  arr->put(exec, "input", jsString(d->lastInput));
+   return arr;
+ }
+ 
+ JSValue *RegExpObjectImp::getBackref(int i) const
+ {
+-  if (lastOvector && i < int(lastNumSubPatterns + 1)) {
+-    UString substring = lastInput.substr(lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i] );
++  if (d->lastOvector && i < int(d->lastNumSubPatterns + 1)) {
++    UString substring = d->lastInput.substr(d->lastOvector[2*i], d->lastOvector[2*i+1] - d->lastOvector[2*i] );
+     return jsString(substring);
+   } 
+ 
+@@ -282,8 +292,8 @@
+ 
+ JSValue *RegExpObjectImp::getLastMatch() const
+ {
+-  if (lastOvector) {
+-    UString substring = lastInput.substr(lastOvector[0], lastOvector[1] - lastOvector[0]);
++  if (d->lastOvector) {
++    UString substring = d->lastInput.substr(d->lastOvector[0], d->lastOvector[1] - d->lastOvector[0]);
+     return jsString(substring);
+   }
+   
+@@ -292,10 +302,10 @@
+ 
+ JSValue *RegExpObjectImp::getLastParen() const
+ {
+-  int i = lastNumSubPatterns;
++  int i = d->lastNumSubPatterns;
+   if (i > 0) {
+-    ASSERT(lastOvector);
+-    UString substring = lastInput.substr(lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i]);
++    ASSERT(d->lastOvector);
++    UString substring = d->lastInput.substr(d->lastOvector[2*i], d->lastOvector[2*i+1] - d->lastOvector[2*i]);
+     return jsString(substring);
+   }
+     
+@@ -304,8 +314,8 @@
+ 
+ JSValue *RegExpObjectImp::getLeftContext() const
+ {
+-  if (lastOvector) {
+-    UString substring = lastInput.substr(0, lastOvector[0]);
++  if (d->lastOvector) {
++    UString substring = d->lastInput.substr(0, d->lastOvector[0]);
+     return jsString(substring);
+   }
+   
+@@ -314,9 +324,9 @@
+ 
+ JSValue *RegExpObjectImp::getRightContext() const
+ {
+-  if (lastOvector) {
+-    UString s = lastInput;
+-    UString substring = s.substr(lastOvector[1], s.size() - lastOvector[1]);
++  if (d->lastOvector) {
++    UString s = d->lastInput;
++    UString substring = s.substr(d->lastOvector[1], s.size() - d->lastOvector[1]);
+     return jsString(substring);
+   }
+   
+@@ -350,9 +360,9 @@
+     case Dollar9:
+       return getBackref(9);
+     case Input:
+-      return jsString(lastInput);
++      return jsString(d->lastInput);
+     case Multiline:
+-      return jsBoolean(multiline);
++      return jsBoolean(d->multiline);
+     case LastMatch:
+       return getLastMatch();
+     case LastParen:
+@@ -377,10 +387,10 @@
+ {
+   switch (token) {
+     case Input:
+-      lastInput = value->toString(exec);
++      d->lastInput = value->toString(exec);
+       break;
+     case Multiline:
+-      multiline = value->toBoolean(exec);
++      d->multiline = value->toBoolean(exec);
+       break;
+     default:
+       ASSERT(0);
+--- a/kjs/nodes2string.cpp
++++ b/kjs/nodes2string.cpp
+@@ -466,12 +466,12 @@
+ 
+ void UnaryPlusNode::streamTo(SourceStream &s) const
+ {
+-  s << '+' << expr;
++  s << "+ " << expr;
+ }
+ 
+ void NegateNode::streamTo(SourceStream &s) const
+ {
+-  s << '-' << expr;
++  s << "- " << expr;
+ }
+ 
+ void BitwiseNotNode::streamTo(SourceStream &s) const
+@@ -664,14 +664,14 @@
+ 
+ void VarDeclListNode::streamTo(SourceStream &s) const
+ {
+-  s << var;
++  s << "var " << var;
+   for (VarDeclListNode *n = next.get(); n; n = n->next.get())
+     s << ", " << n->var;
+ }
+ 
+ void VarStatementNode::streamTo(SourceStream &s) const
+ {
+-  s << SourceStream::Endl << "var " << next << ';';
++  s << SourceStream::Endl << next << ';';
+ }
+ 
+ void StaticVarStatementNode::streamTo(SourceStream &s) const
+@@ -720,7 +720,7 @@
+ void ForNode::streamTo(SourceStream &s) const
+ {
+   s << SourceStream::Endl << "for ("
+-    << expr1  // TODO: doesn't properly do "var i = 0"
++    << expr1
+     << "; " << expr2
+     << "; " << expr3
+     << ')' << SourceStream::Indent << statement << SourceStream::Unindent;
+@@ -734,8 +734,6 @@
+   else
+     s << lexpr;
+ 
+-  if (init)
+-    s << " = " << init;
+   s << " in " << expr << ')' << SourceStream::Indent
+     << statement << SourceStream::Unindent;
+ }
+--- a/kjs/grammar.cpp
++++ b/kjs/grammar.cpp
+@@ -313,7 +313,7 @@
+   PropertyNameNode   *pname;
+   PackageNameNode     *pkgn;
+ }
+-/* Line 193 of yacc.c.  */
++/* Line 187 of yacc.c.  */
+ #line 318 "grammar.tab.c"
+ 	YYSTYPE;
+ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
+@@ -556,7 +556,7 @@
+ /* YYFINAL -- State number of the termination state.  */
+ #define YYFINAL  212
+ /* YYLAST -- Last index in YYTABLE.  */
+-#define YYLAST   1480
++#define YYLAST   1479
+ 
+ /* YYNTOKENS -- Number of terminals.  */
+ #define YYNTOKENS  89
+@@ -565,7 +565,7 @@
+ /* YYNRULES -- Number of rules.  */
+ #define YYNRULES  311
+ /* YYNRULES -- Number of states.  */
+-#define YYNSTATES  547
++#define YYNSTATES  546
+ 
+ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+ #define YYUNDEFTOK  2
+@@ -640,14 +640,14 @@
+      646,   648,   650,   652,   654,   656,   658,   660,   662,   664,
+      667,   671,   675,   679,   681,   685,   687,   691,   693,   696,
+      698,   701,   705,   709,   711,   715,   717,   720,   723,   726,
+-     728,   731,   734,   740,   748,   756,   764,   770,   780,   791,
+-     799,   808,   818,   819,   821,   822,   824,   827,   830,   834,
+-     838,   841,   844,   848,   852,   855,   858,   862,   866,   872,
+-     878,   882,   888,   889,   891,   893,   896,   900,   905,   908,
+-     912,   916,   920,   924,   929,   937,   947,   950,   953,   955,
+-     959,   965,   971,   975,   979,   985,   991,   997,  1004,  1009,
+-    1015,  1021,  1028,  1030,  1034,  1037,  1041,  1042,  1044,  1046,
+-    1049,  1051
++     728,   731,   734,   740,   748,   756,   763,   769,   779,   790,
++     798,   807,   817,   818,   820,   821,   823,   826,   829,   833,
++     837,   840,   843,   847,   851,   854,   857,   861,   865,   871,
++     877,   881,   887,   888,   890,   892,   895,   899,   904,   907,
++     911,   915,   919,   923,   928,   936,   946,   949,   952,   954,
++     958,   964,   970,   974,   978,   984,   990,   996,  1003,  1008,
++    1014,  1020,  1027,  1029,  1033,  1036,  1040,  1041,  1043,  1045,
++    1048,  1050
+ };
+ 
+ /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+@@ -729,36 +729,36 @@
+       -1,   151,     1,    -1,    18,    67,   149,    68,   152,    -1,
+       18,    67,   149,    68,   152,    35,   152,    -1,    20,   152,
+       21,    67,   149,    68,    88,    -1,    20,   152,    21,    67,
+-     149,    68,     1,    -1,    21,    67,   149,    68,   152,    -1,
+-       9,    67,   169,    88,   168,    88,   168,    68,   152,    -1,
+-       9,    67,    11,   156,    88,   168,    88,   168,    68,   152,
+-      -1,     9,    67,   108,    22,   149,    68,   152,    -1,     9,
+-      67,    11,    62,    22,   149,    68,   152,    -1,     9,    67,
+-      11,    62,   163,    22,   149,    68,   152,    -1,    -1,   149,
+-      -1,    -1,   150,    -1,    13,    88,    -1,    13,     1,    -1,
+-      13,    62,    88,    -1,    13,    62,     1,    -1,     6,    88,
+-      -1,     6,     1,    -1,     6,    62,    88,    -1,     6,    62,
+-       1,    -1,    15,    88,    -1,    15,     1,    -1,    15,   149,
+-      88,    -1,    15,   149,     1,    -1,    26,    67,   149,    68,
+-     152,    -1,    25,    67,   149,    68,   175,    -1,    70,   176,
+-      71,    -1,    70,   176,   179,   176,    71,    -1,    -1,   177,
+-      -1,   178,    -1,   177,   178,    -1,     7,   149,    66,    -1,
+-       7,   149,    66,   191,    -1,     8,    66,    -1,     8,    66,
+-     191,    -1,    62,    66,   152,    -1,    28,   149,    88,    -1,
+-      28,   149,     1,    -1,    29,   153,    31,   153,    -1,    29,
+-     153,    30,    67,    62,    68,   153,    -1,    29,   153,    30,
+-      67,    62,    68,   153,    31,   153,    -1,    32,    88,    -1,
+-      32,     1,    -1,    62,    -1,   184,    74,    62,    -1,    33,
+-     184,    74,    79,    88,    -1,    33,   184,    74,    79,     1,
+-      -1,    33,   184,    88,    -1,    33,   184,     1,    -1,    33,
+-      62,    87,   184,    88,    -1,    33,    62,    87,   184,     1,
+-      -1,    14,    62,    67,    68,   189,    -1,    14,    62,    67,
+-     188,    68,   189,    -1,    14,    67,    68,   189,    -1,    14,
+-      67,   188,    68,   189,    -1,    14,    62,    67,    68,   189,
+-      -1,    14,    62,    67,   188,    68,   189,    -1,    62,    -1,
+-     188,    69,    62,    -1,    70,    71,    -1,    70,   191,    71,
+-      -1,    -1,   191,    -1,   192,    -1,   191,   192,    -1,   186,
+-      -1,   152,    -1
++     149,    68,    -1,    21,    67,   149,    68,   152,    -1,     9,
++      67,   169,    88,   168,    88,   168,    68,   152,    -1,     9,
++      67,    11,   156,    88,   168,    88,   168,    68,   152,    -1,
++       9,    67,   108,    22,   149,    68,   152,    -1,     9,    67,
++      11,    62,    22,   149,    68,   152,    -1,     9,    67,    11,
++      62,   163,    22,   149,    68,   152,    -1,    -1,   149,    -1,
++      -1,   150,    -1,    13,    88,    -1,    13,     1,    -1,    13,
++      62,    88,    -1,    13,    62,     1,    -1,     6,    88,    -1,
++       6,     1,    -1,     6,    62,    88,    -1,     6,    62,     1,
++      -1,    15,    88,    -1,    15,     1,    -1,    15,   149,    88,
++      -1,    15,   149,     1,    -1,    26,    67,   149,    68,   152,
++      -1,    25,    67,   149,    68,   175,    -1,    70,   176,    71,
++      -1,    70,   176,   179,   176,    71,    -1,    -1,   177,    -1,
++     178,    -1,   177,   178,    -1,     7,   149,    66,    -1,     7,
++     149,    66,   191,    -1,     8,    66,    -1,     8,    66,   191,
++      -1,    62,    66,   152,    -1,    28,   149,    88,    -1,    28,
++     149,     1,    -1,    29,   153,    31,   153,    -1,    29,   153,
++      30,    67,    62,    68,   153,    -1,    29,   153,    30,    67,
++      62,    68,   153,    31,   153,    -1,    32,    88,    -1,    32,
++       1,    -1,    62,    -1,   184,    74,    62,    -1,    33,   184,
++      74,    79,    88,    -1,    33,   184,    74,    79,     1,    -1,
++      33,   184,    88,    -1,    33,   184,     1,    -1,    33,    62,
++      87,   184,    88,    -1,    33,    62,    87,   184,     1,    -1,
++      14,    62,    67,    68,   189,    -1,    14,    62,    67,   188,
++      68,   189,    -1,    14,    67,    68,   189,    -1,    14,    67,
++     188,    68,   189,    -1,    14,    62,    67,    68,   189,    -1,
++      14,    62,    67,   188,    68,   189,    -1,    62,    -1,   188,
++      69,    62,    -1,    70,    71,    -1,    70,   191,    71,    -1,
++      -1,   191,    -1,   192,    -1,   191,   192,    -1,   186,    -1,
++     152,    -1
+ };
+ 
+ /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+@@ -929,7 +929,7 @@
+        1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
+        3,     3,     3,     1,     3,     1,     3,     1,     2,     1,
+        2,     3,     3,     1,     3,     1,     2,     2,     2,     1,
+-       2,     2,     5,     7,     7,     7,     5,     9,    10,     7,
++       2,     2,     5,     7,     7,     6,     5,     9,    10,     7,
+        8,     9,     0,     1,     0,     1,     2,     2,     3,     3,
+        2,     2,     3,     3,     2,     2,     3,     3,     5,     5,
+        3,     5,     0,     1,     1,     2,     3,     4,     2,     3,
+@@ -994,11 +994,11 @@
+      246,   272,   269,   268,     0,   295,     0,   294,   291,   290,
+       28,    30,    59,   177,     0,   238,     0,   229,   226,     0,
+        0,     0,   252,   300,     0,   304,     0,   299,   303,     0,
+-       0,   297,   173,     0,     0,     0,     0,   273,   274,     0,
++       0,   297,   173,     0,   245,     0,     0,   273,   274,     0,
+        0,     0,   230,   252,   249,   175,     0,   301,   305,    13,
+-       0,   243,   245,   244,     0,     0,   270,   272,   275,   284,
+-     250,     0,     0,     0,    14,   276,   278,     0,     0,   251,
+-       0,   247,   277,   279,   271,   285,   248
++       0,   243,   244,     0,     0,   270,   272,   275,   284,   250,
++       0,     0,     0,    14,   276,   278,     0,     0,   251,     0,
++     247,   277,   279,   271,   285,   248
+ };
+ 
+ /* YYDEFGOTO[NTERM-NUM].  */
+@@ -1013,86 +1013,86 @@
+      451,   228,    64,    65,    66,    67,   101,   345,   102,   346,
+       68,   104,   105,   245,   429,    69,    70,    71,    72,   452,
+      229,    73,    74,    75,    76,    77,   472,   506,   507,   508,
+-     527,    78,    79,    80,    81,   146,    82,    83,    99,   370,
++     526,    78,    79,    80,    81,   146,    82,    83,    99,   370,
+      456,    84,    85,    86
+ };
+ 
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+    STATE-NUM.  */
+-#define YYPACT_NINF -423
++#define YYPACT_NINF -379
+ static const yytype_int16 yypact[] =
+ {
+-     942,  -423,  -423,  -423,     9,   -54,   372,   -35,    -5,    16,
+-      48,   206,  1402,  1402,   -28,  -423,  1022,    55,  1402,    69,
+-      84,  1402,    -1,    25,   135,  1402,  1402,  -423,  -423,  -423,
+-     136,  1402,  1402,  -423,  1402,   569,   155,  1402,  1402,  1402,
+-    1402,  -423,  -423,  -423,  -423,   145,  -423,   223,   642,  -423,
+-    -423,  -423,   106,    98,   283,   158,   302,    -4,   169,   187,
+-     232,    60,  -423,  -423,    11,  -423,  -423,  -423,  -423,  -423,
+-    -423,  -423,  -423,  -423,  -423,  -423,  -423,  -423,  -423,  -423,
+-    -423,  -423,  -423,  -423,   274,   942,  -423,  -423,    27,  -423,
+-    1098,   372,    10,  -423,    70,  -423,  -423,   233,  -423,  -423,
+-     199,    13,  -423,   199,    17,  -423,  -423,    31,  -423,   221,
+-    -423,  -423,   233,  -423,   261,  1079,  -423,  -423,  -423,   124,
+-     117,   319,   160,   306,   215,   218,   219,   327,    66,  -423,
+-    -423,    23,   201,  -423,  -423,  1402,   325,  1402,  -423,  1402,
+-    1402,    24,   231,  -423,  -423,   293,    29,  -423,  -423,  1022,
+-    -423,  -423,   211,  -423,   702,  -423,   174,  1174,   258,  -423,
+-    -423,  -423,  -423,  1250,  1402,   323,  -423,  1402,   337,  -423,
+-    -423,  -423,  -423,  -423,  -423,  -423,  -423,  -423,  -423,  -423,
+-    -423,  -423,  -423,  -423,  1402,  1402,  1402,  1402,  1402,  1402,
+-    1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,
+-    1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  -423,
+-    1402,  -423,  -423,  -423,  -423,  -423,   339,   616,   319,   147,
+-     312,   304,   322,   330,   365,    67,  -423,  -423,   340,   329,
+-     233,  -423,   344,    76,  -423,  -423,   351,  -423,   352,  -423,
+-      94,  1402,   358,  -423,  1402,  -423,  -423,   -35,  -423,  -423,
+-    -423,    -5,  -423,  -423,  -423,   122,  -423,  1402,   359,  -423,
+-    -423,  -423,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,
+-    1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,
+-    1402,  1402,  1402,  1402,  1402,  1402,  1402,  -423,  1402,  -423,
+-     240,   355,   284,   294,   300,  -423,  -423,   356,    -1,   366,
+-    -423,   -17,  -423,  -423,  -423,  -423,   155,  -423,  -423,  -423,
+-    -423,  -423,   303,  -423,   175,  -423,   190,  -423,  -423,  -423,
+-    -423,  -423,   124,   124,   117,   117,   117,   319,   319,   319,
+-     319,   319,   319,   160,   160,   160,   160,   306,   215,   218,
+-     219,   327,   364,  -423,    41,     7,  -423,  1402,  1402,  1402,
+-    1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,  1402,
+-    1402,  1402,  1402,  1402,  1402,  1402,  -423,   159,  -423,   361,
+-     305,   369,  1402,   134,  -423,   191,  -423,  -423,  -423,  -423,
+-     361,   310,   216,  -423,  -423,  -423,  -423,  -423,   124,   124,
+-     117,   117,   117,   319,   319,   319,   319,   319,   319,   160,
+-     160,   160,   160,   306,   215,   218,   219,   327,   374,  -423,
+-    1022,  1402,  1022,   373,  1022,   383,  -423,  -423,    33,  -423,
+-      32,  1326,  -423,  1402,  -423,  -423,  1402,  1402,  1402,   424,
+-     385,  1402,   315,  1079,  -423,   319,   319,   319,   319,   319,
+-     147,   147,   147,   147,   312,   304,   322,   330,   365,   382,
+-    -423,   380,   362,   361,   320,   782,  -423,   361,   389,   164,
+-    -423,  -423,  -423,  -423,  -423,   361,  -423,  1402,   417,   324,
+-    -423,   449,  -423,  -423,   390,  -423,   395,  -423,  -423,  -423,
+-    -423,  -423,  -423,  -423,   326,  -423,  1402,   377,  -423,   378,
+-    1022,  1402,  1402,  -423,   361,  -423,   862,  -423,  -423,   361,
+-     328,  -423,  -423,  1022,    35,  1402,    12,   449,  -423,    -1,
+-    1022,   335,  -423,  1402,  -423,  -423,   392,  -423,  -423,  -423,
+-     361,  -423,  -423,  -423,   230,   399,  -423,   449,  -423,   430,
+-    -423,  1022,   400,  1022,  -423,   942,   942,   396,    -1,  -423,
+-    1022,  -423,   942,   942,  -423,  -423,  -423
++     941,  -379,  -379,  -379,    11,   -11,   309,     7,    98,    16,
++     108,   180,  1401,  1401,   112,  -379,  1021,   142,  1401,   162,
++     168,  1401,   169,     8,   184,  1401,  1401,  -379,  -379,  -379,
++     -17,  1401,  1401,  -379,  1401,   568,    14,  1401,  1401,  1401,
++    1401,  -379,  -379,  -379,  -379,   128,  -379,   131,   615,  -379,
++    -379,  -379,    93,   116,   246,   326,   288,   165,   167,   190,
++     220,    71,  -379,  -379,    10,  -379,  -379,  -379,  -379,  -379,
++    -379,  -379,  -379,  -379,  -379,  -379,  -379,  -379,  -379,  -379,
++    -379,  -379,  -379,  -379,   284,   941,  -379,  -379,    27,  -379,
++    1097,   309,   -26,  -379,   166,  -379,  -379,   134,  -379,  -379,
++     182,    13,  -379,   182,    17,  -379,  -379,    29,  -379,   263,
++    -379,  -379,   134,  -379,   164,   641,  -379,  -379,  -379,    96,
++     178,   274,   395,   304,   204,   250,   267,   311,    80,  -379,
++    -379,    20,   228,  -379,  -379,  1401,   335,  1401,  -379,  1401,
++    1401,    21,   248,  -379,  -379,   245,    19,  -379,  -379,  1021,
++    -379,  -379,   213,  -379,   701,  -379,    -2,  1173,   293,  -379,
++    -379,  -379,  -379,  1249,  1401,   306,  -379,  1401,   310,  -379,
++    -379,  -379,  -379,  -379,  -379,  -379,  -379,  -379,  -379,  -379,
++    -379,  -379,  -379,  -379,  1401,  1401,  1401,  1401,  1401,  1401,
++    1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,
++    1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  -379,
++    1401,  -379,  -379,  -379,  -379,  -379,   334,   333,   274,   236,
++     308,   290,   314,   317,   362,    88,  -379,  -379,   340,   323,
++     134,  -379,   346,   -14,  -379,  -379,   353,  -379,   360,  -379,
++      84,  1401,   359,  -379,  1401,  -379,  -379,     7,  -379,  -379,
++    -379,    98,  -379,  -379,  -379,    35,  -379,  1401,   366,  -379,
++    -379,  -379,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,
++    1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,
++    1401,  1401,  1401,  1401,  1401,  1401,  1401,  -379,  1401,  -379,
++     247,   367,   269,   282,   289,  -379,  -379,   372,   169,   389,
++    -379,    -3,  -379,  -379,  -379,  -379,    14,  -379,  -379,  -379,
++    -379,  -379,   296,  -379,    22,  -379,    94,  -379,  -379,  -379,
++    -379,  -379,    96,    96,   178,   178,   178,   274,   274,   274,
++     274,   274,   274,   395,   395,   395,   395,   304,   204,   250,
++     267,   311,   386,  -379,    65,    -7,  -379,  1401,  1401,  1401,
++    1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,  1401,
++    1401,  1401,  1401,  1401,  1401,  1401,  -379,   100,  -379,   384,
++     325,   390,  1401,   200,  -379,   109,  -379,  -379,  -379,  -379,
++     384,   332,   201,  -379,  -379,  -379,  -379,  -379,    96,    96,
++     178,   178,   178,   274,   274,   274,   274,   274,   274,   395,
++     395,   395,   395,   304,   204,   250,   267,   311,   393,  -379,
++    1021,  1401,  1021,   394,  1021,   398,  -379,  -379,    28,  -379,
++      31,  1325,  -379,  1401,  -379,  -379,  1401,  1401,  1401,   434,
++     401,  1401,   355,   641,  -379,   274,   274,   274,   274,   274,
++     236,   236,   236,   236,   308,   290,   314,   317,   362,   399,
++    -379,   397,   380,   384,   373,   781,  -379,   384,   405,   103,
++    -379,  -379,  -379,  -379,  -379,   384,  -379,  1401,   436,   375,
++    -379,   462,  -379,  -379,   404,  -379,   411,  -379,  -379,  -379,
++    -379,  -379,  -379,  -379,   377,  -379,  1401,   387,  -379,   391,
++    1021,  1401,  1401,  -379,   384,  -379,   861,  -379,  -379,   384,
++     379,  -379,  -379,  1021,   392,  1401,    39,   462,  -379,   169,
++    1021,   381,  -379,  1401,  -379,  -379,   413,  -379,  -379,  -379,
++     384,  -379,  -379,   111,   417,  -379,   462,  -379,   454,  -379,
++    1021,   418,  1021,  -379,   941,   941,   416,   169,  -379,  1021,
++    -379,   941,   941,  -379,  -379,  -379
+ };
+ 
+ /* YYPGOTO[NTERM-NUM].  */
+ static const yytype_int16 yypgoto[] =
+ {
+-    -423,  -423,  -423,    96,  -423,  -423,     0,  -423,  -423,   165,
+-    -423,     5,  -423,    38,  -423,  -423,  -423,   -39,  -423,   197,
+-    -423,  -423,  -423,    15,    28,  -423,  -133,  -423,  -143,  -423,
+-     -38,  -423,   -23,     2,  -423,  -200,   114,  -423,  -166,   115,
+-    -423,  -144,   113,  -423,  -122,   116,  -423,  -118,   118,  -423,
+-    -423,  -423,  -423,  -423,  -423,  -423,  -120,  -341,  -423,     3,
+-       8,  -423,  -423,   -12,   -21,  -423,  -423,  -423,   228,    46,
+-    -423,  -423,   235,   376,    -6,  -423,  -423,  -423,  -423,  -422,
+-    -423,  -423,  -423,  -423,  -423,  -423,  -423,   -45,  -423,   -20,
+-    -423,  -423,  -423,  -423,  -423,   185,  -423,  -423,  -423,  -253,
+-    -359,  -423,   -29,   -80
++    -379,  -379,  -379,   119,  -379,  -379,     0,  -379,  -379,   183,
++    -379,    34,  -379,    37,  -379,  -379,  -379,   -37,  -379,   196,
++    -379,  -379,  -379,    15,    26,  -379,  -155,  -379,   -54,  -379,
++     -53,  -379,   -13,    76,  -379,  -161,   135,  -379,  -159,   139,
++    -379,  -150,   140,  -379,  -145,   133,  -379,  -139,   137,  -379,
++    -379,  -379,  -379,  -379,  -379,  -379,  -138,  -340,  -379,   -21,
++      -8,  -379,  -379,   -15,   -18,  -379,  -379,  -379,   257,    77,
++    -379,  -379,   255,   406,    25,  -379,  -379,  -379,  -379,  -378,
++    -379,  -379,  -379,  -379,  -379,  -379,  -379,   -12,  -379,     1,
++    -379,  -379,  -379,  -379,  -379,   214,  -379,  -379,  -379,  -249,
++    -373,  -379,   -33,   -80
+ };
+ 
+ /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+@@ -1102,308 +1102,306 @@
+ #define YYTABLE_NINF -1
+ static const yytype_uint16 yytable[] =
+ {
+-      43,   142,   381,   337,   136,   213,   154,   434,   169,   489,
+-      87,    97,   209,    90,   246,    50,    43,   106,   250,   131,
+-     525,   464,   449,   450,   287,   295,   143,   100,   214,   141,
+-     300,    50,   253,   478,   475,    43,   522,   309,   338,   135,
+-     133,   134,   152,   313,    98,   419,   138,   324,   325,   326,
+-      50,   184,   218,   147,   148,   322,   323,   103,   243,   150,
+-     151,   339,   420,   427,   318,   159,   160,   161,   162,    35,
+-     516,    88,   232,   256,   213,   259,   430,   233,   107,   203,
+-     210,   403,   247,   526,   340,    43,   251,   485,   342,   341,
+-     343,   532,   288,   288,   493,   431,   230,    89,   497,   211,
+-      50,   248,   207,   301,   108,   252,   501,   476,   285,   362,
+-     109,   289,   296,   144,   454,   215,   404,   302,   262,   254,
+-     479,   477,   137,   523,   377,   390,   391,   392,   428,   231,
+-     234,   235,   236,   388,   389,   517,   139,   303,   368,   405,
+-     519,   237,   384,   290,   369,   292,   208,   293,   294,    43,
+-     515,   140,   286,   363,    43,   327,   328,   329,   330,   331,
+-     332,   534,   406,   373,    50,   374,   408,   407,   409,    50,
+-     349,   185,   314,   188,   189,   316,   333,   334,   335,   336,
+-     193,   194,   271,   272,   368,   186,   187,   350,   351,   263,
+-     380,   366,   266,   267,   234,   235,   236,   145,   195,   196,
+-     273,   274,   149,   264,   265,   461,   500,   110,   115,     1,
+-       2,     3,   163,   319,   320,   321,    91,   164,   115,   165,
+-      92,   368,    12,    13,   155,    15,   368,   453,   352,   353,
+-      18,   115,   499,   393,   394,   395,   396,   397,   398,   197,
+-     198,   275,   276,   306,   288,   260,   261,   307,   424,   375,
+-      25,    26,   460,   204,   399,   400,   401,   402,    27,   288,
+-     288,   297,   298,   425,   463,   382,    28,    29,    93,    31,
+-      32,    33,   205,    34,   212,   206,    94,   416,    36,   304,
+-     288,    37,    38,    39,    40,   288,   244,   217,   255,   466,
+-     163,   385,   386,   387,   111,   167,   535,   168,   281,   288,
+-     163,   481,   282,   482,   283,   241,   483,   242,   410,   288,
+-     218,   435,   436,   437,   438,   439,   218,   218,   218,   218,
+-     218,   218,   218,   218,   218,   218,   218,   310,   163,   190,
+-     191,   192,   115,   257,   115,   258,   115,   115,   199,   200,
+-     201,   202,   277,   278,   279,   280,   291,   502,   354,   355,
+-     356,   357,   412,   288,   115,   432,   440,   441,   442,   443,
+-     115,   115,   413,   288,   115,   268,   269,   270,   414,   288,
+-     284,   422,   423,   457,   458,     1,     2,     3,   465,   458,
+-     299,   115,    91,   490,   288,   315,    92,   358,   494,   458,
+-     218,    15,   504,   288,   510,   288,   520,   458,   468,   317,
+-     470,   344,   473,   531,   288,   115,   359,   115,   361,   364,
+-      43,   367,    43,   371,    43,   360,   213,   365,   372,   469,
+-     376,   383,   411,   415,    27,    50,   496,    50,   417,    50,
+-     426,   455,    28,    29,    93,   484,   459,    33,   115,    34,
+-     467,   115,    94,   471,    36,   474,   486,   487,   491,   288,
+-     492,   498,   503,   218,   115,    43,   505,   419,   509,   115,
+-     533,   538,   213,   213,   428,   536,   513,   544,   540,   462,
+-      50,   421,   444,   446,   445,   378,   488,   447,   514,   249,
+-     448,   512,   537,   115,   418,   115,   379,   528,   529,     0,
+-      43,   521,     0,     0,   511,     0,    43,     0,   530,     0,
+-       0,     0,     0,    43,     0,    50,   542,   543,     0,     0,
+-      43,    50,     0,   524,     0,     0,     0,   545,    50,   539,
+-       0,   541,     0,     0,     0,    50,     0,     0,   546,     0,
+-       0,    43,     0,    43,     0,    43,    43,     0,     0,     0,
+-      43,     0,    43,    43,   115,   433,    50,     0,    50,     0,
+-      50,    50,     0,     0,     0,    50,     0,    50,    50,     0,
+-     433,   433,   115,     0,     0,     0,     0,     0,     0,   115,
+-       0,     0,     1,     2,     3,     4,     0,     0,     5,     6,
+-       7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
+-      17,     0,     0,    18,    19,    20,     0,    21,    22,     0,
+-       0,    23,    24,     0,     0,     0,     0,     0,   115,     0,
+-       0,     0,     0,    25,    26,     0,     0,     0,   115,     0,
+-     115,    27,     0,   115,   115,   433,     0,     0,   115,    28,
+-      29,    30,    31,    32,    33,     0,    34,     0,   347,    35,
+-     153,    36,     0,     0,    37,    38,    39,    40,     0,     0,
+-       0,     0,     0,     0,     0,     0,     0,    41,     0,     0,
+-     260,   261,     0,     0,   115,   172,   173,   174,   175,   176,
+-     177,   178,   179,   180,   181,   182,     0,     0,     0,     0,
+-       0,     0,     0,   115,     0,     0,   170,   171,   433,   115,
+-       0,   172,   173,   174,   175,   176,   177,   178,   179,   180,
+-     181,   182,   115,   183,     0,     1,     2,     3,     4,     0,
+-     115,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+-      14,    15,    16,    17,     0,     0,    18,    19,    20,   183,
+-      21,    22,     0,     0,    23,    24,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
+-       0,     0,     0,     0,    27,     0,     0,     0,     0,     0,
+-       0,     0,    28,    29,    30,    31,    32,    33,     0,    34,
+-       0,     0,    35,   305,    36,     0,     0,    37,    38,    39,
+-      40,     0,     0,     0,     0,     1,     2,     3,     4,     0,
+-      41,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+-      14,    15,    16,    17,     0,     0,    18,    19,    20,     0,
+-      21,    22,     0,     0,    23,    24,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
+-       0,     0,     0,     0,    27,     0,     0,     0,     0,     0,
+-       0,     0,    28,    29,    30,    31,    32,    33,     0,    34,
+-       0,     0,    35,   495,    36,     0,     0,    37,    38,    39,
+-      40,     0,     0,     0,     0,     1,     2,     3,     4,     0,
+-      41,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+-      14,    15,    16,    17,     0,     0,    18,    19,    20,     0,
+-      21,    22,     0,     0,    23,    24,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
+-       0,     0,     0,     0,    27,     0,     0,     0,     0,     0,
+-       0,     0,    28,    29,    30,    31,    32,    33,     0,    34,
+-       0,     0,    35,   518,    36,     0,     0,    37,    38,    39,
+-      40,     0,     0,     0,     0,     1,     2,     3,     4,     0,
+-      41,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+-      14,    15,    16,    17,     0,     0,    18,    19,    20,     0,
+-      21,    22,     0,     0,    23,    24,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
+-       0,     0,     0,     0,    27,     0,     0,     0,     0,     0,
+-       0,     0,    28,    29,    30,    31,    32,    33,     0,    34,
+-       0,     0,    35,     0,    36,     0,     0,    37,    38,    39,
+-      40,     0,     0,     0,     0,     1,     2,     3,     4,     0,
+-      41,     5,     6,     7,     8,     9,     0,    11,    12,    13,
+-      14,    15,    16,    17,     0,     0,    18,    19,    20,     0,
+-      21,    22,     0,     0,    23,    24,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
+-       0,     0,     0,     0,    27,     0,     0,     0,     0,     0,
+-       0,     0,    28,    29,    30,    31,    32,    33,     0,    34,
+-       0,     0,    35,     0,    36,     0,     0,    37,    38,    39,
+-      40,     1,     2,     3,     0,     0,     0,     0,    91,   216,
+-      41,     0,    92,     0,    12,    13,     0,    15,     0,     0,
+-       0,     0,    18,   260,   261,     0,     0,     0,   172,   173,
+-     174,   175,   176,   177,   178,   179,   180,   181,   182,     0,
+-       0,     0,    25,    26,     0,     0,     0,     0,     0,     0,
+-      27,     0,     0,     0,     0,     0,     0,     0,    28,    29,
+-      93,    31,    32,    33,     0,    34,   183,     0,    94,     0,
+-      36,     0,     0,    37,    38,    39,    40,     1,     2,     3,
+-       0,     0,     0,     0,    91,     0,     0,     0,    92,     0,
+-      12,    13,     0,    15,     0,     0,     0,     0,    18,     0,
++      43,   136,   154,   131,   142,   213,   381,   464,   434,   143,
++     169,   209,    87,   141,   246,    50,    43,   106,   250,   309,
++     300,   287,   295,   449,   450,   313,   152,   184,   214,   475,
++     253,    50,   478,   322,   323,    43,   232,   218,   133,   134,
++      97,   233,   337,    98,   138,   338,   318,   524,   368,   149,
++      50,   147,   148,   489,   369,   339,    90,   150,   151,   419,
++     243,   340,   430,   159,   160,   161,   162,   306,   341,   100,
++     342,   307,   343,    88,   213,   256,   420,   259,   107,   210,
++     493,   431,   247,   155,   497,    43,   251,   427,   485,   288,
++     288,   288,   501,   301,   262,   424,   144,   368,   211,    89,
++      50,   248,   476,   380,   108,   252,   377,   302,   289,   296,
++     525,   388,   389,   207,   516,   215,   477,   254,   454,   479,
++     403,   517,   285,   404,   384,   230,   519,   290,   231,   292,
++     362,   293,   294,   405,   303,   531,   324,   325,   326,   406,
++     327,   328,   329,   330,   331,   332,   407,   533,   408,    43,
++     409,   515,   428,   373,    43,   374,   314,   208,   185,   316,
++     103,   263,   368,   288,    50,   368,   286,   425,   453,    50,
++     109,   499,   186,   187,   363,   264,   265,   534,   288,   135,
++     288,   110,   463,     1,     2,     3,   333,   334,   335,   336,
++      91,   188,   189,   366,    92,   163,    12,    13,   163,    15,
++     164,   163,   165,   167,    18,   168,   241,   115,   242,   137,
++     500,   319,   320,   321,   390,   391,   392,   115,   393,   394,
++     395,   396,   397,   398,    25,    26,   234,   235,   236,   139,
++     115,   163,    27,   375,   460,   140,   257,   237,   258,    35,
++      28,    29,    93,    31,    32,    33,   145,    34,   203,   382,
++      94,   204,    36,   266,   267,    37,    38,    39,    40,   349,
++     234,   235,   236,   206,   399,   400,   401,   402,   111,   244,
++     288,   461,   260,   261,   466,   205,   350,   351,   297,   298,
++     416,   304,   288,   481,   212,   482,   217,   281,   483,   385,
++     386,   387,   190,   191,   192,   218,   435,   436,   437,   438,
++     439,   218,   218,   218,   218,   218,   218,   218,   218,   218,
++     218,   218,     1,     2,     3,   410,   288,   352,   353,    91,
++     268,   269,   270,    92,   199,   200,   201,   202,    15,   502,
++     255,   115,   299,   115,   282,   115,   115,   412,   288,   432,
++     277,   278,   279,   280,   354,   355,   356,   357,   193,   194,
++     413,   288,   283,   115,   284,   347,   291,   414,   288,   115,
++     115,    27,   310,   115,   422,   423,   195,   196,   315,    28,
++      29,    93,   317,   358,    33,   218,    34,   260,   261,    94,
++     115,    36,   172,   173,   174,   175,   176,   177,   178,   179,
++     180,   181,   182,   457,   458,   468,   344,   470,   359,   473,
++     465,   458,   360,   469,   115,   361,   115,   197,   198,   364,
++      43,   365,    43,   367,    43,   371,   213,   271,   272,   484,
++     183,   376,   496,   490,   288,    50,   372,    50,   383,    50,
++     440,   441,   442,   443,   411,   273,   274,   115,   218,   415,
++     115,   494,   458,   504,   288,   510,   288,   520,   458,   530,
++     288,   417,   426,   115,   455,    43,   486,   459,   115,   467,
++     474,   213,   213,   487,   471,   491,   288,   498,   492,   505,
++      50,   503,   509,   419,   428,   514,   275,   276,   511,   513,
++     522,   532,   115,   535,   115,   537,   539,   543,   521,   421,
++      43,   528,   462,   444,   447,   529,    43,   523,   445,   448,
++     446,   541,   542,    43,   378,    50,   379,   488,   527,   249,
++      43,    50,   512,   418,   536,   538,     0,   540,    50,   544,
++       0,     0,     0,     0,   545,    50,     0,     0,     0,     0,
++      43,     0,    43,     0,    43,    43,     0,     0,     0,    43,
++       0,    43,    43,   115,   433,    50,     0,    50,     0,    50,
++      50,     0,     0,     0,    50,     0,    50,    50,     0,   433,
++     433,   115,     0,     0,     0,     0,     0,     0,   115,     0,
++       0,     1,     2,     3,     4,     0,     0,     5,     6,     7,
++       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
++       0,     0,    18,    19,    20,     0,    21,    22,     0,     0,
++      23,    24,     0,     0,     0,     0,     0,   115,     0,     0,
++       0,     0,    25,    26,     0,     0,     0,   115,     0,   115,
++      27,     0,   115,   115,   433,     0,     0,   115,    28,    29,
++      30,    31,    32,    33,     0,    34,     0,     0,    35,   153,
++      36,     0,     0,    37,    38,    39,    40,     0,     0,     0,
++       0,     0,     0,     0,     0,     0,    41,     0,     0,   170,
++     171,     0,     0,   115,   172,   173,   174,   175,   176,   177,
++     178,   179,   180,   181,   182,     0,     0,     0,     0,     0,
++       0,     0,   115,     0,     0,   260,   261,   433,   115,     0,
++     172,   173,   174,   175,   176,   177,   178,   179,   180,   181,
++     182,   115,   183,     0,     1,     2,     3,     4,     0,   115,
++       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
++      15,    16,    17,     0,     0,    18,    19,    20,   183,    21,
++      22,     0,     0,    23,    24,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
++       0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
++       0,    28,    29,    30,    31,    32,    33,     0,    34,     0,
++       0,    35,   305,    36,     0,     0,    37,    38,    39,    40,
++       0,     0,     0,     0,     1,     2,     3,     4,     0,    41,
++       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
++      15,    16,    17,     0,     0,    18,    19,    20,     0,    21,
++      22,     0,     0,    23,    24,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
++       0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
++       0,    28,    29,    30,    31,    32,    33,     0,    34,     0,
++       0,    35,   495,    36,     0,     0,    37,    38,    39,    40,
++       0,     0,     0,     0,     1,     2,     3,     4,     0,    41,
++       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
++      15,    16,    17,     0,     0,    18,    19,    20,     0,    21,
++      22,     0,     0,    23,    24,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
++       0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
++       0,    28,    29,    30,    31,    32,    33,     0,    34,     0,
++       0,    35,   518,    36,     0,     0,    37,    38,    39,    40,
++       0,     0,     0,     0,     1,     2,     3,     4,     0,    41,
++       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
++      15,    16,    17,     0,     0,    18,    19,    20,     0,    21,
++      22,     0,     0,    23,    24,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
++       0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
++       0,    28,    29,    30,    31,    32,    33,     0,    34,     0,
++       0,    35,     0,    36,     0,     0,    37,    38,    39,    40,
++       0,     0,     0,     0,     1,     2,     3,     4,     0,    41,
++       5,     6,     7,     8,     9,     0,    11,    12,    13,    14,
++      15,    16,    17,     0,     0,    18,    19,    20,     0,    21,
++      22,     0,     0,    23,    24,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
++       0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
++       0,    28,    29,    30,    31,    32,    33,     0,    34,     0,
++       0,    35,     0,    36,     0,     0,    37,    38,    39,    40,
++       1,     2,     3,     0,     0,     0,     0,    91,   216,    41,
++       0,    92,     0,    12,    13,     0,    15,     0,     0,     0,
++       0,    18,     0,     0,     0,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
++       0,    25,    26,     0,     0,     0,     0,     0,     0,    27,
++       0,     0,     0,     0,     0,     0,     0,    28,    29,    93,
++      31,    32,    33,     0,    34,     0,     0,    94,     0,    36,
++       0,     0,    37,    38,    39,    40,     1,     2,     3,     0,
++       0,     0,     0,    91,     0,     0,     0,    92,     0,    12,
++      13,     0,    15,     0,     0,     0,     0,    18,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,     0,     0,    25,    26,
+-       0,     0,     0,     0,     0,     0,    27,     0,     0,     0,
+-       0,     0,     0,     0,    28,    29,    93,    31,    32,    33,
+-       0,    34,     0,     0,    94,     0,    36,   308,     0,    37,
+-      38,    39,    40,     1,     2,     3,     0,     0,     0,     0,
+-      91,     0,     0,     0,    92,     0,    12,    13,     0,    15,
+-       0,     0,     0,     0,    18,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,     0,     0,    25,    26,     0,
++       0,     0,     0,     0,     0,    27,     0,     0,     0,     0,
++       0,     0,     0,    28,    29,    93,    31,    32,    33,     0,
++      34,     0,     0,    94,     0,    36,   308,     0,    37,    38,
++      39,    40,     1,     2,     3,     0,     0,     0,     0,    91,
++       0,     0,     0,    92,     0,    12,    13,     0,    15,     0,
++       0,     0,     0,    18,     0,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+-       0,     0,     0,     0,    25,    26,     0,     0,     0,     0,
+-       0,     0,    27,     0,     0,     0,     0,     0,     0,     0,
+-      28,    29,    93,    31,    32,    33,     0,    34,   311,     0,
+-      94,     0,    36,     0,     0,    37,    38,    39,    40,     1,
+-       2,     3,     0,     0,     0,     0,    91,     0,     0,     0,
+-      92,     0,    12,    13,     0,    15,     0,     0,     0,     0,
+-      18,     0,     0,     0,     0,     0,     0,     0,     0,     0,
++       0,     0,     0,    25,    26,     0,     0,     0,     0,     0,
++       0,    27,     0,     0,     0,     0,     0,     0,     0,    28,
++      29,    93,    31,    32,    33,     0,    34,   311,     0,    94,
++       0,    36,     0,     0,    37,    38,    39,    40,     1,     2,
++       3,     0,     0,     0,     0,    91,     0,     0,     0,    92,
++       0,    12,    13,     0,    15,     0,     0,     0,     0,    18,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+-      25,    26,     0,     0,     0,     0,     0,     0,    27,     0,
+-       0,     0,     0,     0,     0,     0,    28,    29,    93,    31,
+-      32,    33,     0,    34,     0,     0,    94,     0,    36,   480,
+-       0,    37,    38,    39,    40,     1,     2,     3,     0,     0,
+-       0,     0,    91,     0,     0,     0,    92,     0,    12,    13,
+-       0,    15,     0,     0,     0,     0,    18,     0,     0,     0,
++       0,     0,     0,     0,     0,     0,     0,     0,     0,    25,
++      26,     0,     0,     0,     0,     0,     0,    27,     0,     0,
++       0,     0,     0,     0,     0,    28,    29,    93,    31,    32,
++      33,     0,    34,     0,     0,    94,     0,    36,   480,     0,
++      37,    38,    39,    40,     1,     2,     3,     0,     0,     0,
++       0,    91,     0,     0,     0,    92,     0,    12,    13,     0,
++      15,     0,     0,     0,     0,    18,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
+-       0,     0,     0,     0,    27,     0,     0,     0,     0,     0,
+-       0,     0,    28,    29,    93,    31,    32,    33,     0,    34,
+-       0,     0,    94,     0,    36,     0,     0,    37,    38,    39,
+-      40
++       0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
++       0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
++       0,    28,    29,    93,    31,    32,    33,     0,    34,     0,
++       0,    94,     0,    36,     0,     0,    37,    38,    39,    40
+ };
+ 
+ static const yytype_int16 yycheck[] =
+ {
+-       0,    22,   255,   203,    16,    85,    35,   348,    47,   431,
+-       1,     6,     1,    67,     1,     0,    16,     1,     1,    11,
+-       8,   380,   363,   364,     1,     1,     1,    62,     1,    21,
+-       1,    16,     1,     1,     1,    35,     1,   157,   204,    67,
+-      12,    13,    34,   163,     6,    62,    18,   190,   191,   192,
+-      35,    48,    90,    25,    26,   188,   189,    62,    97,    31,
+-      32,   205,    79,    22,   184,    37,    38,    39,    40,    70,
+-     492,    62,    62,   112,   154,   114,    69,    67,    62,    83,
+-      69,   281,    69,    71,   206,    85,    69,   428,   208,   207,
+-     210,   513,    69,    69,   453,    88,    91,    88,   457,    88,
+-      85,    88,    42,    74,    88,    88,   465,    74,    42,    42,
+-      62,    88,    88,    88,   367,    88,   282,    88,   115,    88,
+-      88,    88,    67,    88,   244,   268,   269,   270,    87,    91,
+-      60,    61,    62,   266,   267,   494,    67,   149,    62,   283,
+-     499,    71,   262,   135,    68,   137,    86,   139,   140,   149,
+-     491,    67,    86,    86,   154,   193,   194,   195,   196,   197,
+-     198,   520,   284,    69,   149,    71,   286,   285,   288,   154,
+-      23,    65,   164,    75,    76,   167,   199,   200,   201,   202,
+-      22,    23,    22,    23,    62,    79,    80,    40,    41,    65,
+-      68,   230,    75,    76,    60,    61,    62,    62,    40,    41,
+-      40,    41,    66,    79,    80,    71,   459,     1,    11,     3,
+-       4,     5,    67,   185,   186,   187,    10,    72,    21,    74,
+-      14,    62,    16,    17,    69,    19,    62,    68,    81,    82,
+-      24,    34,    68,   271,   272,   273,   274,   275,   276,    81,
+-      82,    81,    82,    69,    69,    44,    45,    73,    73,   241,
+-      44,    45,   372,    84,   277,   278,   279,   280,    52,    69,
+-      69,    30,    31,    73,    73,   257,    60,    61,    62,    63,
+-      64,    65,    85,    67,     0,    43,    70,   298,    72,    68,
+-      69,    75,    76,    77,    78,    69,    87,    90,    67,    73,
+-      67,   263,   264,   265,    88,    72,    66,    74,    83,    69,
+-      67,   421,    84,   423,    85,    72,   426,    74,    68,    69,
+-     348,   349,   350,   351,   352,   353,   354,   355,   356,   357,
+-     358,   359,   360,   361,   362,   363,   364,    69,    67,    46,
+-      47,    48,   135,    72,   137,    74,   139,   140,    36,    37,
+-      38,    39,    36,    37,    38,    39,    21,   467,    36,    37,
+-      38,    39,    68,    69,   157,   347,   354,   355,   356,   357,
+-     163,   164,    68,    69,   167,    46,    47,    48,    68,    69,
+-      43,    68,    69,    68,    69,     3,     4,     5,    68,    69,
+-      87,   184,    10,    68,    69,    62,    14,    83,    68,    69,
+-     428,    19,    68,    69,    68,    69,    68,    69,   410,    62,
+-     412,    62,   414,    68,    69,   208,    84,   210,    43,    69,
+-     410,    67,   412,    62,   414,    85,   496,    88,    66,   411,
+-      62,    62,    67,    67,    52,   410,   455,   412,    62,   414,
+-      66,    70,    60,    61,    62,   427,    67,    65,   241,    67,
+-      66,   244,    70,    70,    72,    62,    22,    62,    66,    69,
+-      88,    62,    35,   491,   257,   455,     7,    62,    68,   262,
+-      68,    31,   542,   543,    87,    66,    88,    71,    68,   373,
+-     455,   306,   358,   360,   359,   247,   430,   361,   490,   103,
+-     362,   487,   527,   286,   299,   288,   251,   507,   509,    -1,
+-     490,   503,    -1,    -1,   486,    -1,   496,    -1,   510,    -1,
+-      -1,    -1,    -1,   503,    -1,   490,   535,   536,    -1,    -1,
+-     510,   496,    -1,   505,    -1,    -1,    -1,   538,   503,   531,
+-      -1,   533,    -1,    -1,    -1,   510,    -1,    -1,   540,    -1,
+-      -1,   531,    -1,   533,    -1,   535,   536,    -1,    -1,    -1,
+-     540,    -1,   542,   543,   347,   348,   531,    -1,   533,    -1,
+-     535,   536,    -1,    -1,    -1,   540,    -1,   542,   543,    -1,
+-     363,   364,   365,    -1,    -1,    -1,    -1,    -1,    -1,   372,
+-      -1,    -1,     3,     4,     5,     6,    -1,    -1,     9,    10,
+-      11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+-      21,    -1,    -1,    24,    25,    26,    -1,    28,    29,    -1,
+-      -1,    32,    33,    -1,    -1,    -1,    -1,    -1,   411,    -1,
+-      -1,    -1,    -1,    44,    45,    -1,    -1,    -1,   421,    -1,
+-     423,    52,    -1,   426,   427,   428,    -1,    -1,   431,    60,
+-      61,    62,    63,    64,    65,    -1,    67,    -1,    22,    70,
+-      71,    72,    -1,    -1,    75,    76,    77,    78,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    88,    -1,    -1,
+-      44,    45,    -1,    -1,   467,    49,    50,    51,    52,    53,
+-      54,    55,    56,    57,    58,    59,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,   486,    -1,    -1,    44,    45,   491,   492,
+-      -1,    49,    50,    51,    52,    53,    54,    55,    56,    57,
+-      58,    59,   505,    87,    -1,     3,     4,     5,     6,    -1,
+-     513,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+-      18,    19,    20,    21,    -1,    -1,    24,    25,    26,    87,
+-      28,    29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,
+-      -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    60,    61,    62,    63,    64,    65,    -1,    67,
+-      -1,    -1,    70,    71,    72,    -1,    -1,    75,    76,    77,
+-      78,    -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,
+-      88,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+-      18,    19,    20,    21,    -1,    -1,    24,    25,    26,    -1,
+-      28,    29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,
+-      -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    60,    61,    62,    63,    64,    65,    -1,    67,
+-      -1,    -1,    70,    71,    72,    -1,    -1,    75,    76,    77,
+-      78,    -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,
+-      88,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+-      18,    19,    20,    21,    -1,    -1,    24,    25,    26,    -1,
+-      28,    29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,
+-      -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    60,    61,    62,    63,    64,    65,    -1,    67,
+-      -1,    -1,    70,    71,    72,    -1,    -1,    75,    76,    77,
+-      78,    -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,
+-      88,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+-      18,    19,    20,    21,    -1,    -1,    24,    25,    26,    -1,
+-      28,    29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,
+-      -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    60,    61,    62,    63,    64,    65,    -1,    67,
+-      -1,    -1,    70,    -1,    72,    -1,    -1,    75,    76,    77,
+-      78,    -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,
+-      88,     9,    10,    11,    12,    13,    -1,    15,    16,    17,
+-      18,    19,    20,    21,    -1,    -1,    24,    25,    26,    -1,
+-      28,    29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,
+-      -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    60,    61,    62,    63,    64,    65,    -1,    67,
+-      -1,    -1,    70,    -1,    72,    -1,    -1,    75,    76,    77,
+-      78,     3,     4,     5,    -1,    -1,    -1,    -1,    10,    11,
+-      88,    -1,    14,    -1,    16,    17,    -1,    19,    -1,    -1,
+-      -1,    -1,    24,    44,    45,    -1,    -1,    -1,    49,    50,
+-      51,    52,    53,    54,    55,    56,    57,    58,    59,    -1,
+-      -1,    -1,    44,    45,    -1,    -1,    -1,    -1,    -1,    -1,
+-      52,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    60,    61,
+-      62,    63,    64,    65,    -1,    67,    87,    -1,    70,    -1,
+-      72,    -1,    -1,    75,    76,    77,    78,     3,     4,     5,
+-      -1,    -1,    -1,    -1,    10,    -1,    -1,    -1,    14,    -1,
+-      16,    17,    -1,    19,    -1,    -1,    -1,    -1,    24,    -1,
++       0,    16,    35,    11,    22,    85,   255,   380,   348,     1,
++      47,     1,     1,    21,     1,     0,    16,     1,     1,   157,
++       1,     1,     1,   363,   364,   163,    34,    48,     1,     1,
++       1,    16,     1,   188,   189,    35,    62,    90,    12,    13,
++       6,    67,   203,     6,    18,   204,   184,     8,    62,    66,
++      35,    25,    26,   431,    68,   205,    67,    31,    32,    62,
++      97,   206,    69,    37,    38,    39,    40,    69,   207,    62,
++     208,    73,   210,    62,   154,   112,    79,   114,    62,    69,
++     453,    88,    69,    69,   457,    85,    69,    22,   428,    69,
++      69,    69,   465,    74,   115,    73,    88,    62,    88,    88,
++      85,    88,    74,    68,    88,    88,   244,    88,    88,    88,
++      71,   266,   267,    42,   492,    88,    88,    88,   367,    88,
++     281,   494,    42,   282,   262,    91,   499,   135,    91,   137,
++      42,   139,   140,   283,   149,   513,   190,   191,   192,   284,
++     193,   194,   195,   196,   197,   198,   285,   520,   286,   149,
++     288,   491,    87,    69,   154,    71,   164,    86,    65,   167,
++      62,    65,    62,    69,   149,    62,    86,    73,    68,   154,
++      62,    68,    79,    80,    86,    79,    80,    66,    69,    67,
++      69,     1,    73,     3,     4,     5,   199,   200,   201,   202,
++      10,    75,    76,   230,    14,    67,    16,    17,    67,    19,
++      72,    67,    74,    72,    24,    74,    72,    11,    74,    67,
++     459,   185,   186,   187,   268,   269,   270,    21,   271,   272,
++     273,   274,   275,   276,    44,    45,    60,    61,    62,    67,
++      34,    67,    52,   241,   372,    67,    72,    71,    74,    70,
++      60,    61,    62,    63,    64,    65,    62,    67,    83,   257,
++      70,    84,    72,    75,    76,    75,    76,    77,    78,    23,
++      60,    61,    62,    43,   277,   278,   279,   280,    88,    87,
++      69,    71,    44,    45,    73,    85,    40,    41,    30,    31,
++     298,    68,    69,   421,     0,   423,    90,    83,   426,   263,
++     264,   265,    46,    47,    48,   348,   349,   350,   351,   352,
++     353,   354,   355,   356,   357,   358,   359,   360,   361,   362,
++     363,   364,     3,     4,     5,    68,    69,    81,    82,    10,
++      46,    47,    48,    14,    36,    37,    38,    39,    19,   467,
++      67,   135,    87,   137,    84,   139,   140,    68,    69,   347,
++      36,    37,    38,    39,    36,    37,    38,    39,    22,    23,
++      68,    69,    85,   157,    43,    22,    21,    68,    69,   163,
++     164,    52,    69,   167,    68,    69,    40,    41,    62,    60,
++      61,    62,    62,    83,    65,   428,    67,    44,    45,    70,
++     184,    72,    49,    50,    51,    52,    53,    54,    55,    56,
++      57,    58,    59,    68,    69,   410,    62,   412,    84,   414,
++      68,    69,    85,   411,   208,    43,   210,    81,    82,    69,
++     410,    88,   412,    67,   414,    62,   496,    22,    23,   427,
++      87,    62,   455,    68,    69,   410,    66,   412,    62,   414,
++     354,   355,   356,   357,    67,    40,    41,   241,   491,    67,
++     244,    68,    69,    68,    69,    68,    69,    68,    69,    68,
++      69,    62,    66,   257,    70,   455,    22,    67,   262,    66,
++      62,   541,   542,    62,    70,    66,    69,    62,    88,     7,
++     455,    35,    68,    62,    87,   490,    81,    82,   486,    88,
++      88,    68,   286,    66,   288,    31,    68,    71,   503,   306,
++     490,   509,   373,   358,   361,   510,   496,   505,   359,   362,
++     360,   534,   535,   503,   247,   490,   251,   430,   507,   103,
++     510,   496,   487,   299,   526,   530,    -1,   532,   503,   537,
++      -1,    -1,    -1,    -1,   539,   510,    -1,    -1,    -1,    -1,
++     530,    -1,   532,    -1,   534,   535,    -1,    -1,    -1,   539,
++      -1,   541,   542,   347,   348,   530,    -1,   532,    -1,   534,
++     535,    -1,    -1,    -1,   539,    -1,   541,   542,    -1,   363,
++     364,   365,    -1,    -1,    -1,    -1,    -1,    -1,   372,    -1,
++      -1,     3,     4,     5,     6,    -1,    -1,     9,    10,    11,
++      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
++      -1,    -1,    24,    25,    26,    -1,    28,    29,    -1,    -1,
++      32,    33,    -1,    -1,    -1,    -1,    -1,   411,    -1,    -1,
++      -1,    -1,    44,    45,    -1,    -1,    -1,   421,    -1,   423,
++      52,    -1,   426,   427,   428,    -1,    -1,   431,    60,    61,
++      62,    63,    64,    65,    -1,    67,    -1,    -1,    70,    71,
++      72,    -1,    -1,    75,    76,    77,    78,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    -1,    88,    -1,    -1,    44,
++      45,    -1,    -1,   467,    49,    50,    51,    52,    53,    54,
++      55,    56,    57,    58,    59,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,   486,    -1,    -1,    44,    45,   491,   492,    -1,
++      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
++      59,   505,    87,    -1,     3,     4,     5,     6,    -1,   513,
++       9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
++      19,    20,    21,    -1,    -1,    24,    25,    26,    87,    28,
++      29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,    -1,
++      -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    60,    61,    62,    63,    64,    65,    -1,    67,    -1,
++      -1,    70,    71,    72,    -1,    -1,    75,    76,    77,    78,
++      -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,    88,
++       9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
++      19,    20,    21,    -1,    -1,    24,    25,    26,    -1,    28,
++      29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,    -1,
++      -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    60,    61,    62,    63,    64,    65,    -1,    67,    -1,
++      -1,    70,    71,    72,    -1,    -1,    75,    76,    77,    78,
++      -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,    88,
++       9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
++      19,    20,    21,    -1,    -1,    24,    25,    26,    -1,    28,
++      29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,    -1,
++      -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    60,    61,    62,    63,    64,    65,    -1,    67,    -1,
++      -1,    70,    71,    72,    -1,    -1,    75,    76,    77,    78,
++      -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,    88,
++       9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
++      19,    20,    21,    -1,    -1,    24,    25,    26,    -1,    28,
++      29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,    -1,
++      -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    60,    61,    62,    63,    64,    65,    -1,    67,    -1,
++      -1,    70,    -1,    72,    -1,    -1,    75,    76,    77,    78,
++      -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,    88,
++       9,    10,    11,    12,    13,    -1,    15,    16,    17,    18,
++      19,    20,    21,    -1,    -1,    24,    25,    26,    -1,    28,
++      29,    -1,    -1,    32,    33,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,    -1,
++      -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    60,    61,    62,    63,    64,    65,    -1,    67,    -1,
++      -1,    70,    -1,    72,    -1,    -1,    75,    76,    77,    78,
++       3,     4,     5,    -1,    -1,    -1,    -1,    10,    11,    88,
++      -1,    14,    -1,    16,    17,    -1,    19,    -1,    -1,    -1,
++      -1,    24,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    44,    45,    -1,    -1,    -1,    -1,    -1,    -1,    52,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    60,    61,    62,
++      63,    64,    65,    -1,    67,    -1,    -1,    70,    -1,    72,
++      -1,    -1,    75,    76,    77,    78,     3,     4,     5,    -1,
++      -1,    -1,    -1,    10,    -1,    -1,    -1,    14,    -1,    16,
++      17,    -1,    19,    -1,    -1,    -1,    -1,    24,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    44,    45,
+-      -1,    -1,    -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    60,    61,    62,    63,    64,    65,
+-      -1,    67,    -1,    -1,    70,    -1,    72,    73,    -1,    75,
+-      76,    77,    78,     3,     4,     5,    -1,    -1,    -1,    -1,
+-      10,    -1,    -1,    -1,    14,    -1,    16,    17,    -1,    19,
+-      -1,    -1,    -1,    -1,    24,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    44,    45,    -1,
++      -1,    -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    60,    61,    62,    63,    64,    65,    -1,
++      67,    -1,    -1,    70,    -1,    72,    73,    -1,    75,    76,
++      77,    78,     3,     4,     5,    -1,    -1,    -1,    -1,    10,
++      -1,    -1,    -1,    14,    -1,    16,    17,    -1,    19,    -1,
++      -1,    -1,    -1,    24,    -1,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    44,    45,    -1,    -1,    -1,    -1,
+-      -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+-      60,    61,    62,    63,    64,    65,    -1,    67,    68,    -1,
+-      70,    -1,    72,    -1,    -1,    75,    76,    77,    78,     3,
+-       4,     5,    -1,    -1,    -1,    -1,    10,    -1,    -1,    -1,
+-      14,    -1,    16,    17,    -1,    19,    -1,    -1,    -1,    -1,
+-      24,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    44,    45,    -1,    -1,    -1,    -1,    -1,
++      -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    60,
++      61,    62,    63,    64,    65,    -1,    67,    68,    -1,    70,
++      -1,    72,    -1,    -1,    75,    76,    77,    78,     3,     4,
++       5,    -1,    -1,    -1,    -1,    10,    -1,    -1,    -1,    14,
++      -1,    16,    17,    -1,    19,    -1,    -1,    -1,    -1,    24,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+-      44,    45,    -1,    -1,    -1,    -1,    -1,    -1,    52,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    60,    61,    62,    63,
+-      64,    65,    -1,    67,    -1,    -1,    70,    -1,    72,    73,
+-      -1,    75,    76,    77,    78,     3,     4,     5,    -1,    -1,
+-      -1,    -1,    10,    -1,    -1,    -1,    14,    -1,    16,    17,
+-      -1,    19,    -1,    -1,    -1,    -1,    24,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    44,
++      45,    -1,    -1,    -1,    -1,    -1,    -1,    52,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    60,    61,    62,    63,    64,
++      65,    -1,    67,    -1,    -1,    70,    -1,    72,    73,    -1,
++      75,    76,    77,    78,     3,     4,     5,    -1,    -1,    -1,
++      -1,    10,    -1,    -1,    -1,    14,    -1,    16,    17,    -1,
++      19,    -1,    -1,    -1,    -1,    24,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,
+-      -1,    -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    60,    61,    62,    63,    64,    65,    -1,    67,
+-      -1,    -1,    70,    -1,    72,    -1,    -1,    75,    76,    77,
+-      78
++      -1,    -1,    -1,    -1,    -1,    44,    45,    -1,    -1,    -1,
++      -1,    -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    60,    61,    62,    63,    64,    65,    -1,    67,    -1,
++      -1,    70,    -1,    72,    -1,    -1,    75,    76,    77,    78
+ };
+ 
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+@@ -1462,9 +1460,9 @@
+       68,    66,    88,   189,    68,    71,   191,   189,    62,    68,
+      188,   189,   145,    35,    68,     7,   176,   177,   178,    68,
+       68,   149,   163,    88,   152,   146,   168,   189,    71,   189,
+-      68,   152,     1,    88,   149,     8,    71,   179,   178,   153,
+-     152,    68,   168,    68,   189,    66,    66,   176,    31,   152,
+-      68,   152,   191,   191,    71,   153,   152
++      68,   152,    88,   149,     8,    71,   179,   178,   153,   152,
++      68,   168,    68,   189,    66,    66,   176,    31,   152,    68,
++     152,   191,   191,    71,   153,   152
+ };
+ 
+ #define yyerrok		(yyerrstatus = 0)
+@@ -3170,7 +3168,7 @@
+ 
+   case 245:
+ #line 702 "grammar.y"
+-    { (yyval.stat) = new DoWhileNode((yyvsp[(2) - (7)].stat), (yyvsp[(5) - (7)].node)); DBG((yyval.stat), (yylsp[(1) - (7)]), (yylsp[(3) - (7)])); AUTO_SEMICOLON; ;}
++    { (yyval.stat) = new DoWhileNode((yyvsp[(2) - (6)].stat), (yyvsp[(5) - (6)].node)); DBG((yyval.stat), (yylsp[(1) - (6)]), (yylsp[(3) - (6)])); ;}
+     break;
+ 
+   case 246:
+@@ -3502,7 +3500,7 @@
+ 
+ 
+ /* Line 1267 of yacc.c.  */
+-#line 3506 "grammar.tab.c"
++#line 3504 "grammar.tab.c"
+       default: break;
+     }
+   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+--- a/kjs/function.h
++++ b/kjs/function.h
+@@ -53,6 +53,10 @@
+ 
+   private:
+     Identifier m_name;
++#ifdef WIN32
++    InternalFunctionImp(const InternalFunctionImp&);
++    InternalFunctionImp& operator=(const InternalFunctionImp&);
++#endif
+   };
+ 
+   /**
+@@ -136,13 +140,14 @@
+ 
+     virtual void mark();
+     virtual bool isActivation() const { return true; }
++    void releaseArguments() { _arguments.reset(); }
+ 
+     void setupLocals();
+     void setupFunctionLocals(ExecState *exec);
+   private:
+     static PropertySlot::GetValueFunc getArgumentsGetter();
+     static JSValue *argumentsGetter(ExecState *exec, JSObject *, const Identifier &, const PropertySlot& slot);
+-    void createArgumentsObject(ExecState *exec) const;
++    void createArgumentsObject(ExecState *exec);
+ 
+     struct Local {
+       JSValue* value;
+--- a/kjs/string_object.cpp
++++ b/kjs/string_object.cpp
+@@ -364,7 +364,9 @@
+     if (lastIndex < source.size())
+       pushSourceRange(sourceRanges, sourceRangeCount, sourceRangeCapacity, UString::Range(lastIndex, source.size() - lastIndex));
+ 
+-    UString result = source.spliceSubstringsWithSeparators(sourceRanges, sourceRangeCount, replacements, replacementCount);
++    UString result;
++    if (sourceRanges)
++        result = source.spliceSubstringsWithSeparators(sourceRanges, sourceRangeCount, replacements, replacementCount);
+ 
+     delete [] sourceRanges;
+     delete [] replacements;
+--- a/kjs/object.cpp
++++ b/kjs/object.cpp
+@@ -213,8 +213,10 @@
+   if (propertyName == exec->propertyNames().underscoreProto) {
+     JSObject* proto = value->getObject();
+     while (proto) {
+-      if (proto == this)
++      if (proto == this) {
+         throwError(exec, GeneralError, "cyclic __proto__ value");
++        return;
++      }
+       proto = proto->prototype() ? proto->prototype()->getObject() : 0;
+     }
+     
+--- a/kjs/array_instance.h
++++ b/kjs/array_instance.h
+@@ -61,9 +61,11 @@
+     
+     void resizeStorage(unsigned);
+ 
++    // store capacity in extra space at the beginning of the storage array to save space
++    size_t capacity() { return storage ? reinterpret_cast<size_t>(storage[-1]) : 0; }
++
+     unsigned length;
+     unsigned storageLength;
+-    unsigned capacity;
+     JSValue **storage;
+   };
+ 
+--- a/kjs/list.h
++++ b/kjs/list.h
+@@ -48,10 +48,9 @@
+     class KJS_EXPORT List {
+     public:
+         List();
+-	explicit List(bool needsMarking);
+         ~List() { deref(); }
+ 
+-        List(const List &b) : _impBase(b._impBase), _needsMarking(false) {
++        List(const List &b) : _impBase(b._impBase) {
+ 	    ++_impBase->refCount; 
+ 	    ++_impBase->valueRefCount; 
+ 	}
+@@ -63,11 +62,18 @@
+          * @param val Pointer to object.
+          */
+         void append(JSValue *val);
++
+         /**
+          * Remove all elements from the list.
+          */
+         void clear();
+ 
++        /*
++         * Resets this List to point to the default empty list
++         */
++        void reset() { deref(); ++(_impBase = empty()._impBase)->refCount; }
++
++
+         /**
+          * Make a copy of the list
+          */
+@@ -121,14 +127,11 @@
+          */
+         static const List &empty();
+         
+-	void mark() { if (_impBase->valueRefCount == 0) markValues(); }
+-
+         static void markProtectedLists();
+     private:
+         ListImpBase *_impBase;
+-	bool _needsMarking;
+         
+-        void deref() { if (!_needsMarking) --_impBase->valueRefCount; if (--_impBase->refCount == 0) release(); }
++        void deref() { --_impBase->valueRefCount; if (--_impBase->refCount == 0) release(); }
+ 
+         void release();
+         void markValues();
+--- a/kjs/value.h
++++ b/kjs/value.h
+@@ -26,6 +26,8 @@
+ 
+ #include "JSImmediate.h"
+ #include "ustring.h"
++#include "collector.h"
++#include <wtf/Noncopyable.h>
+ #include <stddef.h> // for size_t
+ 
+ #ifndef NDEBUG // protection against problems if committing with KJS_VERBOSE on
+@@ -52,7 +54,7 @@
+  * only (all of which are provided internally by KJS). Instead, inherit from
+  * JSObject.
+  */
+-class KJS_EXPORT JSValue {
++class KJS_EXPORT JSValue : Noncopyable {
+     friend class JSCell; // so it can derive from this class
+     friend class Collector; // so it can call asCell()
+ 
+@@ -99,6 +101,9 @@
+     uint32_t toUInt32(ExecState *exec) const;
+     uint16_t toUInt16(ExecState *exec) const;
+ 
++    // Floating point conversions.
++    float toFloat(ExecState*) const;
++
+     // Garbage collection.
+     void mark();
+     bool marked() const;
+@@ -124,7 +129,7 @@
+     friend class JSObject;
+     friend class GetterSetterImp;
+ private:
+-    explicit JSCell(bool destructorIsThreadSafe = true);
++    explicit JSCell();
+     virtual ~JSCell();
+ public:
+     // Querying the type.
+@@ -156,15 +161,6 @@
+     void *operator new(size_t);
+     virtual void mark();
+     bool marked() const;
+-
+-    bool isLocalInjected()  const { return m_localInjected; }
+-    void setLocalInjected()       { m_localInjected = true; }
+-
+-private:
+-    bool m_destructorIsThreadSafe : 1;
+-    bool m_marked : 1;
+-    bool m_localInjected : 1; // Used when this object is the active scope,
+-                              // to denote dynamic addition of local variables
+ };
+ 
+ KJS_EXPORT JSValue *jsNumberCell(double);
+@@ -213,10 +209,7 @@
+ {
+ }
+ 
+-inline JSCell::JSCell(bool destructorIsThreadSafe)
+-    : m_destructorIsThreadSafe(destructorIsThreadSafe)
+-    , m_marked(false)
+-    , m_localInjected(false)
++inline JSCell::JSCell()
+ {
+ }
+ 
+@@ -241,12 +234,12 @@
+ 
+ inline bool JSCell::marked() const
+ {
+-    return m_marked;
++    return Collector::isCellMarked(this);
+ }
+ 
+ inline void JSCell::mark()
+ {
+-    m_marked = true;
++    return Collector::markCell(this);
+ }
+ 
+ inline JSCell *JSValue::asCell()
+--- a/kjs/Context.cpp
++++ b/kjs/Context.cpp
+@@ -3,7 +3,8 @@
+  *  This file is part of the KDE libraries
+  *  Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+  *  Copyright (C) 2001 Peter Kelly (pmk at post.com)
+- *  Copyright (C) 2003, 2006 Apple Computer, Inc.
++ *  Copyright (C) 2003, 2006, 2007 Apple Computer, Inc.
++ *  Copyright (C) 2007 Christopher E. Hyde <C.Hyde at parableuk.force9.co.uk>
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Library General Public
+@@ -76,6 +77,14 @@
+ Context::~Context()
+ {
+     m_interpreter->setContext(m_callingContext);
++
++    // The arguments list is only needed to potentially create the  arguments object,
++    // which isn't accessible from nested scopes so we can discard the list as soon
++    // as the function is done running.
++    // This prevents lists of Lists from building up, waiting to be garbage collected
++    ActivationImp* activation = static_cast<ActivationImp*>(m_activation);
++    if (activation)
++        activation->releaseArguments();
+ }
+ 
+ void Context::mark()
+--- a/kjs/function.cpp
++++ b/kjs/function.cpp
+@@ -172,7 +172,7 @@
+ 
+   // The debugger may have been deallocated by now if the WebFrame
+   // we were running in has been destroyed, so refetch it.
+-  // See http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
++  // See http://bugs.webkit.org/show_bug.cgi?id=9477
+   dbg = exec->dynamicInterpreter()->debugger();
+ 
+   if (dbg) {
+@@ -512,9 +512,8 @@
+ 
+ // ECMA 10.1.6
+ ActivationImp::ActivationImp(FunctionImp *function, const List &arguments)
+-    : _function(function), _arguments(true), _locals(0)
++    : _function(function), _arguments(arguments), _locals(0)
+ {
+-  _arguments.copyFrom(arguments);
+   // FIXME: Do we need to support enumerating the arguments property?
+ }
+ 
+@@ -615,7 +614,6 @@
+ {
+     if (_function && !_function->marked())
+         _function->mark();
+-    _arguments.mark();
+     for (int pos = 0; pos < numLocals(); ++pos) {
+       JSValue *val = _locals[pos].value;
+       if (val && !val->marked())
+@@ -629,9 +627,11 @@
+     delete[] _locals;
+ }
+ 
+-void ActivationImp::createArgumentsObject(ExecState *exec) const
++void ActivationImp::createArgumentsObject(ExecState *exec)
+ {
+     _locals[0].value = new Arguments(exec, _function, _arguments, const_cast<ActivationImp*>(this));
++     // The arguments list is only needed to create the arguments object, so discard it now
++    _arguments.reset();
+ }
+ 
+ // ------------------------------ GlobalFunc -----------------------------------
+--- a/kjs/regexp_object.h
++++ b/kjs/regexp_object.h
+@@ -63,6 +63,8 @@
+     RegExp *reg;
+   };
+ 
++  struct RegExpObjectImpPrivate;
++
+   class RegExpObjectImp : public InternalFunctionImp {
+   public:
+     enum { Dollar1, Dollar2, Dollar3, Dollar4, Dollar5, Dollar6, Dollar7, Dollar8, Dollar9, 
+@@ -97,11 +99,7 @@
+     JSValue *getLeftContext() const;
+     JSValue *getRightContext() const;
+ 
+-    // Global search cache / settings
+-    UString lastInput;
+-    OwnArrayPtr<int> lastOvector;
+-    unsigned lastNumSubPatterns : 31;
+-    bool multiline              : 1;
++    OwnPtr<RegExpObjectImpPrivate> d;
+     
+     static const ClassInfo info;
+   };
+--- a/kjs/property_map.h
++++ b/kjs/property_map.h
+@@ -1,7 +1,8 @@
+ // -*- c-basic-offset: 2 -*-
+ /*
+  *  This file is part of the KDE libraries
+- *  Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
++ *  Copyright (C) 2004, 2005, 2006, 2007 Apple Computer, Inc.
++ *  Copyright (C) 2007 Christopher E. Hyde <C.Hyde at parableuk.force9.co.uk>
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Library General Public
+@@ -57,8 +58,7 @@
+         PropertyMapHashTableEntry() : key(0) { }
+         UString::Rep *key;
+         JSValue *value;
+-        short attributes;
+-        short globalGetterSetterFlag;
++        int attributes;
+         int index;
+     };
+ 
+@@ -66,6 +66,7 @@
+ * Javascript Property Map.
+ */
+     class KJS_EXPORT PropertyMap {
++        friend class JSObject;
+     public:
+         PropertyMap();
+         ~PropertyMap();
+@@ -87,9 +88,13 @@
+ 
+         bool isEmpty() const;
+ 
+-        bool hasGetterSetterProperties() const { return (_singleEntry.globalGetterSetterFlag != 0); }
+-        void setHasGetterSetterProperties(bool f) { _singleEntry.globalGetterSetterFlag = f; }
++        bool hasGetterSetterProperties() const { return m_getterSetterFlag; }
++        void setHasGetterSetterProperties(bool f) { m_getterSetterFlag = f; }
+ 
++        // This /computes/ whether the table has getters or setters, while the above is
++        // used to cache the result. In other words, one usually does
++        // setHasGetterSetterProperties(containsGettersOrSetters()) whenver
++        // there is a reason to believe that the result has changed
+         bool containsGettersOrSetters() const;
+     private:
+         static bool keysMatch(const UString::Rep *, const UString::Rep *);
+@@ -104,16 +109,29 @@
+         typedef PropertyMapHashTableEntry Entry;
+         typedef PropertyMapHashTable Table;
+ 
+-        Table *_table;
+-        
+-        Entry _singleEntry;
+-    };
++        UString::Rep* m_singleEntryKey;
++        union {
++          JSValue* singleEntryValue;
++          Table* table;
++        } m_u;
++
+ 
+-inline PropertyMap::PropertyMap() : _table(0)
+-{
+-    _singleEntry.globalGetterSetterFlag = 0;
+-}
++        short m_singleEntryAttributes;
++
++        bool m_getterSetterFlag : 1;
++        bool m_usingTable       : 1;
++
++        // We also stick some of the object's
++        // bitflags here. Kind of ugly, but saves memory...
++        bool m_objLocalInjected : 1;
++    };
+ 
++    inline PropertyMap::PropertyMap() :
++          m_singleEntryKey(0), 
++          m_getterSetterFlag(false),
++          m_usingTable(false),
++          m_objLocalInjected(false)
++    {}
+ } // namespace
+ 
+ #endif // _KJS_PROPERTY_MAP_H_
+--- a/kjs/ExecState.h
++++ b/kjs/ExecState.h
+@@ -32,7 +32,6 @@
+     class Context;
+     class Interpreter;
+     class FunctionImp;
+-    class RuntimeMethodImp;
+     class GlobalFuncImp;
+     
+   /**
+@@ -43,7 +42,6 @@
+   class KJS_EXPORT ExecState {
+     friend class Interpreter;
+     friend class FunctionImp;
+-    friend class RuntimeMethodImp;
+     friend class GlobalFuncImp;
+   public:
+     /**
+--- a/kjs/grammar.h
++++ b/kjs/grammar.h
+@@ -201,7 +201,7 @@
+   PropertyNameNode   *pname;
+   PackageNameNode     *pkgn;
+ }
+-/* Line 1529 of yacc.c.  */
++/* Line 1489 of yacc.c.  */
+ #line 206 "grammar.tab.h"
+ 	YYSTYPE;
+ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
+--- a/kjs/ustring.h
++++ b/kjs/ustring.h
+@@ -30,10 +30,19 @@
+ #include <wtf/RefPtr.h>
+ #include <wtf/PassRefPtr.h>
+ 
++#include <assert.h>
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+ 
++/* On some ARM platforms GCC won't pack structures by default so sizeof(UChar)
++   will end up being != 2 which causes crashes since the code depends on that. */
++#if COMPILER(GCC) && PLATFORM(FORCE_PACK)
++#define PACK_STRUCT __attribute__((packed))
++#else
++#define PACK_STRUCT
++#endif
++
+ /**
+  * @internal
+  */
+@@ -89,7 +98,7 @@
+     unsigned short unicode() const { return uc; }
+ 
+     unsigned short uc;
+-  };
++  } PACK_STRUCT;
+ 
+   inline UChar::UChar() { }
+   inline UChar::UChar(unsigned char h , unsigned char l) : uc(h << 8 | l) { }
+@@ -458,8 +467,8 @@
+     static void globalClear();
+ #endif
+ 
+-    Rep *rep() const { return m_rep.get(); }
+-    UString(PassRefPtr<Rep> r) : m_rep(r) { }
++    Rep* rep() const { return m_rep.get(); }
++    UString(PassRefPtr<Rep> r) : m_rep(r) { assert(m_rep); }
+ 
+     void copyForWriting();
+ 
+--- a/kjs/list.cpp
++++ b/kjs/list.cpp
+@@ -1,6 +1,5 @@
+ /*
+- *  This file is part of the KDE libraries
+- *  Copyright (C) 2003 Apple Computer, Inc.
++ *  Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Library General Public
+@@ -33,7 +32,7 @@
+ 
+ // tunable parameters
+ const int poolSize = 512;
+-const int inlineValuesSize = 4;
++const int inlineValuesSize = 5;
+ 
+ enum ListImpState { unusedInPool = 0, usedInPool, usedOnHeap, immortal };
+ 
+@@ -163,7 +162,7 @@
+     return imp;
+ }
+ 
+-List::List() : _impBase(allocateListImp()), _needsMarking(false)
++List::List() : _impBase(allocateListImp())
+ {
+     ListImp *imp = static_cast<ListImp *>(_impBase);
+     imp->size = 0;
+@@ -179,21 +178,6 @@
+ #endif
+ }
+ 
+-List::List(bool needsMarking) : _impBase(allocateListImp()), _needsMarking(needsMarking)
+-{
+-    ListImp *imp = static_cast<ListImp *>(_impBase);
+-    imp->size = 0;
+-    imp->refCount = 1;
+-    imp->valueRefCount = !needsMarking;
+-    imp->capacity = 0;
+-    imp->overflow = 0;
+-
+-#if DUMP_STATISTICS
+-    if (++numLists > numListsHighWaterMark)
+-        numListsHighWaterMark = numLists;
+-    imp->sizeHighWaterMark = 0;
+-#endif
+-}
+ 
+ void List::markValues()
+ {
+@@ -341,8 +325,7 @@
+ {
+     ListImpBase *bImpBase = b._impBase;
+     ++bImpBase->refCount;
+-    if (!_needsMarking)
+-        ++bImpBase->valueRefCount;
++    ++bImpBase->valueRefCount;
+     deref();
+     _impBase = bImpBase;
+     return *this;
+--- a/kjs/object.h
++++ b/kjs/object.h
+@@ -97,7 +97,7 @@
+       
+   private:
+     JSObject *getter;
+-    JSObject *setter;  
++    JSObject *setter;
+   };
+   
+   class KJS_EXPORT JSObject : public JSCell {
+@@ -107,13 +107,13 @@
+      *
+      * @param proto The prototype
+      */
+-    explicit JSObject(JSValue* proto, bool destructorIsThreadSafe = true);
++    explicit JSObject(JSValue* proto);
+ 
+     /**
+      * Creates a new JSObject with a prototype of jsNull()
+      * (that is, the ECMAScript "null" value, not a null object pointer).
+      */
+-    explicit JSObject(bool destructorIsThreadSafe = true);
++    explicit JSObject();
+ 
+     virtual void mark();
+     virtual JSType type() const;
+@@ -457,11 +457,23 @@
+     void restoreProperties(const SavedProperties &p) { _prop.restore(p); }
+ 
+     virtual bool isActivation() const { return false; }
++
++    // This is used to keep track of whether scope object have local
++    // variables introduced by something other than 'var'
++    bool isLocalInjected()  const { return _prop.m_objLocalInjected; }
++    void setLocalInjected()       { _prop.m_objLocalInjected = true; }
++
+   protected:
+     PropertyMap _prop;
+   private:
++
++  
+     const HashEntry* findPropertyHashEntry( const Identifier& propertyName ) const;
+     JSValue *_proto;
++#ifdef WIN32
++    JSObject(const JSObject&);
++    JSObject& operator=(const JSObject&);
++#endif
+   };
+ 
+   /**
+@@ -505,18 +517,15 @@
+ KJS_EXPORT JSObject *throwError(ExecState *, ErrorType, const char *message);
+ KJS_EXPORT JSObject *throwError(ExecState *, ErrorType);
+ 
+-inline JSObject::JSObject(JSValue* proto, bool destructorIsThreadSafe)
+-    : JSCell(destructorIsThreadSafe)
+-    , _proto(proto)
++inline JSObject::JSObject(JSValue* proto)
++    : _proto(proto)
+ {
+     assert(proto);
+ }
+ 
+-inline JSObject::JSObject(bool destructorIsThreadSafe)
+-    : JSCell(destructorIsThreadSafe)
+-    , _proto(jsNull())
+-{
+-}
++inline JSObject::JSObject()
++    :_proto(jsNull())
++{}
+ 
+ inline JSValue *JSObject::prototype() const
+ {
+@@ -584,7 +593,7 @@
+ 
+     // non-standard Netscape extension
+     if (propertyName == exec->propertyNames().underscoreProto) {
+-        slot.setValueSlot(this, &_proto, PropertySlot::PermitDirectWrite);
++        slot.setValueSlot(this, &_proto, PropertySlot::ForbidDirectWrite);
+         return true;
+     }
+ 
+--- a/kjs/grammar.y
++++ b/kjs/grammar.y
+@@ -699,7 +699,7 @@
+ 
+ IterationStatement:
+     DO Statement WHILE '(' Expr ')' ';' { $$ = new DoWhileNode($2, $5); DBG($$, @1, @3);}
+-  | DO Statement WHILE '(' Expr ')' error { $$ = new DoWhileNode($2, $5); DBG($$, @1, @3); AUTO_SEMICOLON; }
++  | DO Statement WHILE '(' Expr ')' { $$ = new DoWhileNode($2, $5); DBG($$, @1, @3); }
+   | WHILE '(' Expr ')' Statement        { $$ = new WhileNode($3, $5); DBG($$, @1, @4); }
+   | FOR '(' ExprNoInOpt ';' ExprOpt ';' ExprOpt ')' Statement
+                                         { $$ = new ForNode($3, $5, $7, $9); DBG($$, @1, @8); }
+--- a/kjs/property_map.cpp
++++ b/kjs/property_map.cpp
+@@ -39,8 +39,6 @@
+ // 2/28/2006 ggaren: super accurate JS iBench says that USE_SINGLE_ENTRY is a
+ // 3.2% performance boost.
+ 
+-// FIXME: _singleEntry.index is unused.
+-
+ #if !DO_CONSISTENCY_CHECK
+ #define checkConsistency() ((void)0)
+ #endif
+@@ -105,22 +103,22 @@
+ // Returns true if the key is not null or the deleted sentinel, false otherwise
+ static inline bool isValid(UString::Rep* key)
+ {
+-    return ((reinterpret_cast<uintptr_t>(key) & ~0x1) != 0);
++    return !!(reinterpret_cast<uintptr_t>(key) & ~0x1);
+ }
+ 
+ PropertyMap::~PropertyMap()
+ {
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        UString::Rep *key = _singleEntry.key;
++        UString::Rep *key = m_singleEntryKey;
+         if (key)
+             key->deref();
+ #endif
+         return;
+     }
+     
+-    int minimumKeysToProcess = _table->keyCount + _table->sentinelCount;
+-    Entry *entries = _table->entries;
++    int minimumKeysToProcess = m_u.table->keyCount + m_u.table->sentinelCount;
++    Entry *entries = m_u.table->entries;
+     for (int i = 0; i < minimumKeysToProcess; i++) {
+         UString::Rep *key = entries[i].key;
+         if (key) {
+@@ -129,24 +127,24 @@
+         } else
+             ++minimumKeysToProcess;
+     }
+-    fastFree(_table);
++    fastFree(m_u.table);
+ }
+ 
+ void PropertyMap::clear()
+ {
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        UString::Rep *key = _singleEntry.key;
++        UString::Rep *key = m_singleEntryKey;
+         if (key) {
+             key->deref();
+-            _singleEntry.key = 0;
++            m_singleEntryKey = 0;
+         }
+ #endif
+         return;
+     }
+ 
+-    int size = _table->size;
+-    Entry *entries = _table->entries;
++    int size = m_u.table->size;
++    Entry *entries = m_u.table->entries;
+     for (int i = 0; i < size; i++) {
+         UString::Rep *key = entries[i].key;
+         if (isValid(key)) {
+@@ -155,16 +153,16 @@
+             entries[i].value = 0;
+         }
+     }
+-    _table->keyCount = 0;
+-    _table->sentinelCount = 0;
++    m_u.table->keyCount = 0;
++    m_u.table->sentinelCount = 0;
+ }
+ 
+ bool PropertyMap::isEmpty() const
+ {
+-    if (!_table)
+-        return !_singleEntry.key;
++    if (!m_usingTable)
++        return !m_singleEntryKey;
+     else
+-        return !_table->keyCount;
++        return !m_u.table->keyCount;
+ }
+ 
+ JSValue *PropertyMap::get(const Identifier &name, unsigned &attributes) const
+@@ -173,20 +171,20 @@
+     
+     UString::Rep *rep = name._ustring.rep();
+     
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        UString::Rep *key = _singleEntry.key;
++        UString::Rep *key = m_singleEntryKey;
+         if (rep == key) {
+-            attributes = _singleEntry.attributes;
+-            return _singleEntry.value;
++            attributes = m_singleEntryAttributes;
++            return m_u.singleEntryValue;
+         }
+ #endif
+         return 0;
+     }
+     
+     unsigned h = rep->hash();
+-    int sizeMask = _table->sizeMask;
+-    Entry *entries = _table->entries;
++    int sizeMask = m_u.table->sizeMask;
++    Entry *entries = m_u.table->entries;
+     int i = h & sizeMask;
+     int k = 0;
+ #if DUMP_STATISTICS
+@@ -214,18 +212,18 @@
+     
+     UString::Rep *rep = name._ustring.rep();
+ 
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        UString::Rep *key = _singleEntry.key;
++        UString::Rep *key = m_singleEntryKey;
+         if (rep == key)
+-            return _singleEntry.value;
++            return m_u.singleEntryValue;
+ #endif
+         return 0;
+     }
+     
+     unsigned h = rep->hash();
+-    int sizeMask = _table->sizeMask;
+-    Entry *entries = _table->entries;
++    int sizeMask = m_u.table->sizeMask;
++    Entry *entries = m_u.table->entries;
+     int i = h & sizeMask;
+     int k = 0;
+ #if DUMP_STATISTICS
+@@ -251,19 +249,18 @@
+     
+     UString::Rep *rep = name._ustring.rep();
+ 
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        UString::Rep *key = _singleEntry.key;
+-        if (rep == key) {
+-            return &_singleEntry.value;
+-        }
++        UString::Rep *key = m_singleEntryKey;
++        if (rep == key)
++            return &m_u.singleEntryValue;
+ #endif
+         return 0;
+     }
+     
+     unsigned h = rep->hash();
+-    int sizeMask = _table->sizeMask;
+-    Entry *entries = _table->entries;
++    int sizeMask = m_u.table->sizeMask;
++    Entry *entries = m_u.table->entries;
+     int i = h & sizeMask;
+     int k = 0;
+ #if DUMP_STATISTICS
+@@ -271,9 +268,8 @@
+     numCollisions += entries[i].key && entries[i].key != rep;
+ #endif
+     while (UString::Rep *key = entries[i].key) {
+-        if (rep == key) {
++        if (rep == key)
+             return &entries[i].value;
+-        }
+         if (k == 0)
+             k = 1 | (h % sizeMask);
+         i = (i + k) & sizeMask;
+@@ -320,30 +316,30 @@
+ #endif
+     
+ #if USE_SINGLE_ENTRY
+-    if (!_table) {
+-        UString::Rep *key = _singleEntry.key;
++    if (!m_usingTable) {
++        UString::Rep *key = m_singleEntryKey;
+         if (key) {
+-            if (rep == key && !(roCheck && (_singleEntry.attributes & ReadOnly))) {
+-                _singleEntry.value = value;
++            if (rep == key && !(roCheck && (m_singleEntryAttributes & ReadOnly))) {
++                m_u.singleEntryValue = value;
+                 return;
+             }
+         } else {
+             rep->ref();
+-            _singleEntry.key = rep;
+-            _singleEntry.value = value;
+-            _singleEntry.attributes = attributes;
++            m_singleEntryKey = rep;
++            m_u.singleEntryValue = value;
++            m_singleEntryAttributes = static_cast<short>(attributes);
+             checkConsistency();
+             return;
+         }
+     }
+ #endif
+ 
+-    if (!_table || _table->keyCount * 2 >= _table->size)
++    if (!m_usingTable || m_u.table->keyCount * 2 >= m_u.table->size)
+         expand();
+     
+     unsigned h = rep->hash();
+-    int sizeMask = _table->sizeMask;
+-    Entry *entries = _table->entries;
++    int sizeMask = m_u.table->sizeMask;
++    Entry *entries = m_u.table->entries;
+     int i = h & sizeMask;
+     int k = 0;
+     bool foundDeletedElement = false;
+@@ -354,7 +350,7 @@
+ #endif
+     while (UString::Rep *key = entries[i].key) {
+         if (rep == key) {
+-            if (roCheck && (_table->entries[i].attributes & ReadOnly)) 
++            if (roCheck && (entries[i].attributes & ReadOnly))
+                 return;
+             // Put a new value in an existing hash table entry.
+             entries[i].value = value;
+@@ -377,7 +373,7 @@
+     // Use either the deleted element or the 0 at the end of the chain.
+     if (foundDeletedElement) {
+         i = deletedElementIndex;
+-        --_table->sentinelCount;
++        --m_u.table->sentinelCount;
+     }
+ 
+     // Create a new hash table entry.
+@@ -385,19 +381,19 @@
+     entries[i].key = rep;
+     entries[i].value = value;
+     entries[i].attributes = attributes;
+-    entries[i].index = ++_table->lastIndexUsed;
+-    ++_table->keyCount;
++    entries[i].index = ++m_u.table->lastIndexUsed;
++    ++m_u.table->keyCount;
+ 
+     checkConsistency();
+ }
+ 
+ void PropertyMap::insert(UString::Rep *key, JSValue *value, int attributes, int index)
+ {
+-    assert(_table);
++    assert(m_u.table);
+ 
+     unsigned h = key->hash();
+-    int sizeMask = _table->sizeMask;
+-    Entry *entries = _table->entries;
++    int sizeMask = m_u.table->sizeMask;
++    Entry *entries = m_u.table->entries;
+     int i = h & sizeMask;
+     int k = 0;
+ #if DUMP_STATISTICS
+@@ -422,40 +418,45 @@
+ 
+ void PropertyMap::expand()
+ {
+-    Table *oldTable = _table;
+-    int oldTableSize = oldTable ? oldTable->size : 0;    
++    Table *oldTable = m_u.table;
++    int oldTableSize = m_usingTable ? oldTable->size : 0;
+     rehash(oldTableSize ? oldTableSize * 2 : 16);
+ }
+ 
+ void PropertyMap::rehash()
+ {
+-    assert(_table);
+-    assert(_table->size);
+-    rehash(_table->size);
++    assert(m_u.table);
++    assert(m_u.table->size);
++    rehash(m_u.table->size);
+ }
+ 
+ void PropertyMap::rehash(int newTableSize)
+ {
+     checkConsistency();
+-    
+-    Table *oldTable = _table;
+-    int oldTableSize = oldTable ? oldTable->size : 0;
+-    int oldTableKeyCount = oldTable ? oldTable->keyCount : 0;
+-    
+-    _table = (Table *)fastCalloc(1, sizeof(Table) + (newTableSize - 1) * sizeof(Entry) );
+-    _table->size = newTableSize;
+-    _table->sizeMask = newTableSize - 1;
+-    _table->keyCount = oldTableKeyCount;
+ 
+ #if USE_SINGLE_ENTRY
+-    UString::Rep *key = _singleEntry.key;
++    JSValue* oldSingleEntryValue = m_u.singleEntryValue;
++#endif
++
++    Table *oldTable = m_usingTable ? m_u.table : 0;
++    int oldTableSize = m_usingTable ? oldTable->size : 0;
++    int oldTableKeyCount = m_usingTable ? oldTable->keyCount : 0;
++
++    m_u.table = (Table *)fastCalloc(1, sizeof(Table) + (newTableSize - 1) * sizeof(Entry) );
++    m_u.table->size = newTableSize;
++    m_u.table->sizeMask = newTableSize - 1;
++    m_u.table->keyCount = oldTableKeyCount;
++    m_usingTable = true;
++
++#if USE_SINGLE_ENTRY
++    UString::Rep *key = m_singleEntryKey;
+     if (key) {
+-        insert(key, _singleEntry.value, _singleEntry.attributes, 0);
+-        _singleEntry.key = 0;
++        insert(key, oldSingleEntryValue, m_singleEntryAttributes, 0);
++        m_singleEntryKey = 0;
+         // update the count, because single entries don't count towards
+         // the table key count
+-        ++_table->keyCount;
+-        assert(_table->keyCount == 1);
++        ++m_u.table->keyCount;
++        assert(m_u.table->keyCount == 1);
+     }
+ #endif
+     
+@@ -469,7 +470,7 @@
+             insert(key, entry.value, entry.attributes, index);
+         }
+     }
+-    _table->lastIndexUsed = lastIndexUsed;
++    m_u.table->lastIndexUsed = lastIndexUsed;
+ 
+     fastFree(oldTable);
+ 
+@@ -486,12 +487,12 @@
+ 
+     UString::Rep *key;
+ 
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        key = _singleEntry.key;
++        key = m_singleEntryKey;
+         if (rep == key) {
+             key->deref();
+-            _singleEntry.key = 0;
++            m_singleEntryKey = 0;
+             checkConsistency();
+         }
+ #endif
+@@ -500,8 +501,8 @@
+ 
+     // Find the thing to remove.
+     unsigned h = rep->hash();
+-    int sizeMask = _table->sizeMask;
+-    Entry *entries = _table->entries;
++    int sizeMask = m_u.table->sizeMask;
++    Entry *entries = m_u.table->entries;
+     int i = h & sizeMask;
+     int k = 0;
+ #if DUMP_STATISTICS
+@@ -529,11 +530,11 @@
+     entries[i].key = key;
+     entries[i].value = 0;
+     entries[i].attributes = DontEnum;
+-    assert(_table->keyCount >= 1);
+-    --_table->keyCount;
+-    ++_table->sentinelCount;
++    assert(m_u.table->keyCount >= 1);
++    --m_u.table->keyCount;
++    ++m_u.table->sentinelCount;
+     
+-    if (_table->sentinelCount * 4 >= _table->size)
++    if (m_u.table->sentinelCount * 4 >= m_u.table->size)
+         rehash();
+ 
+     checkConsistency();
+@@ -541,24 +542,24 @@
+ 
+ void PropertyMap::mark() const
+ {
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        if (_singleEntry.key) {
+-            JSValue *v = _singleEntry.value;
++        if (m_singleEntryKey) {
++            JSValue *v = m_u.singleEntryValue;
+             if (!v->marked())
+-                v->mark();
++              v->mark();
+         }
+ #endif
+         return;
+     }
+ 
+-    int minimumKeysToProcess = _table->keyCount;
+-    Entry *entries = _table->entries;
++    int minimumKeysToProcess = m_u.table->keyCount;
++    Entry *entries = m_u.table->entries;
+     for (int i = 0; i < minimumKeysToProcess; i++) {
+         JSValue *v = entries[i].value;
+         if (v) {
+             if (!v->marked())
+-                v->mark();
++              v->mark();
+         } else {
+             ++minimumKeysToProcess;
+         }
+@@ -578,15 +579,16 @@
+ 
+ bool PropertyMap::containsGettersOrSetters() const
+ {
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        return ((_singleEntry.attributes & GetterSetter) != 0);
+-#endif
++        return !!(m_singleEntryAttributes & GetterSetter);
++#else
+         return false;
++#endif
+     }
+ 
+-    for (int i = 0; i != _table->size; ++i) {
+-        if (_table->entries[i].attributes & GetterSetter)
++    for (int i = 0; i != m_u.table->size; ++i) {
++        if (m_u.table->entries[i].attributes & GetterSetter)
+             return true;
+     }
+     
+@@ -595,22 +597,22 @@
+ 
+ void PropertyMap::getEnumerablePropertyNames(PropertyNameArray& propertyNames) const
+ {
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        UString::Rep *key = _singleEntry.key;
+-        if (key && !(_singleEntry.attributes & DontEnum))
++        UString::Rep *key = m_singleEntryKey;
++        if (key && !(m_singleEntryAttributes & DontEnum))
+             propertyNames.add(Identifier(key));
+ #endif
+         return;
+     }
+ 
+     // Allocate a buffer to use to sort the keys.
+-    Vector<Entry*, smallMapThreshold> sortedEnumerables(_table->keyCount);
++    Vector<Entry*, smallMapThreshold> sortedEnumerables(m_u.table->keyCount);
+ 
+     // Get pointers to the enumerable entries in the buffer.
+     Entry** p = sortedEnumerables.data();
+-    int size = _table->size;
+-    Entry* entries = _table->entries;
++    int size = m_u.table->size;
++    Entry* entries = m_u.table->entries;
+     for (int i = 0; i != size; ++i) {
+         Entry* e = &entries[i];
+         if (e->key && !(e->attributes & DontEnum))
+@@ -627,9 +629,9 @@
+ 
+ void PropertyMap::getSparseArrayPropertyNames(PropertyNameArray& propertyNames) const
+ {
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        UString::Rep *key = _singleEntry.key;
++        UString::Rep *key = m_singleEntryKey;
+         if (key) {
+             UString k(key);
+             bool fitsInUInt32;
+@@ -641,8 +643,8 @@
+         return;
+     }
+ 
+-    int size = _table->size;
+-    Entry *entries = _table->entries;
++    int size = m_u.table->size;
++    Entry *entries = m_u.table->entries;
+     for (int i = 0; i != size; ++i) {
+         UString::Rep *key = entries[i].key;
+         if (isValid(key)) {
+@@ -659,14 +661,14 @@
+ {
+     int count = 0;
+ 
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        if (_singleEntry.key && !(_singleEntry.attributes & (ReadOnly | Function)))
++        if (m_singleEntryKey && !(m_singleEntryAttributes & (ReadOnly | Function)))
+             ++count;
+ #endif
+     } else {
+-        int size = _table->size;
+-        Entry *entries = _table->entries;
++        int size = m_u.table->size;
++        Entry *entries = m_u.table->entries;
+         for (int i = 0; i != size; ++i)
+             if (isValid(entries[i].key) && !(entries[i].attributes & (ReadOnly | Function)))
+                 ++count;
+@@ -682,12 +684,12 @@
+     
+     SavedProperty *prop = p._properties.get();
+     
+-    if (!_table) {
++    if (!m_usingTable) {
+ #if USE_SINGLE_ENTRY
+-        if (_singleEntry.key && !(_singleEntry.attributes & (ReadOnly | Function))) {
+-            prop->key = Identifier(_singleEntry.key);
+-            prop->value = _singleEntry.value;
+-            prop->attributes = _singleEntry.attributes;
++        if (m_singleEntryKey && !(m_singleEntryAttributes & (ReadOnly | Function))) {
++            prop->key = Identifier(m_singleEntryKey);
++            prop->value = m_u.singleEntryValue;
++            prop->attributes = m_singleEntryAttributes;
+             ++prop;
+         }
+ #endif
+@@ -700,8 +702,8 @@
+ 
+         // Get pointers to the entries in the buffer.
+         Entry** p = sortedEntries.data();
+-        int size = _table->size;
+-        Entry* entries = _table->entries;
++        int size = m_u.table->size;
++        Entry* entries = m_u.table->entries;
+         for (int i = 0; i != size; ++i) {
+             Entry *e = &entries[i];
+             if (isValid(e->key) && !(e->attributes & (ReadOnly | Function)))
+@@ -732,13 +734,13 @@
+ 
+ void PropertyMap::checkConsistency()
+ {
+-    if (!_table)
++    if (!m_usingTable)
+         return;
+ 
+     int count = 0;
+     int sentinelCount = 0;
+-    for (int j = 0; j != _table->size; ++j) {
+-        UString::Rep *rep = _table->entries[j].key;
++    for (int j = 0; j != m_u.table->size; ++j) {
++        UString::Rep *rep = m_u.table->entries[j].key;
+         if (!rep)
+             continue;
+         if (rep == deletedSentinel()) {
+@@ -746,23 +748,23 @@
+             continue;
+         }
+         unsigned h = rep->hash();
+-        int i = h & _table->sizeMask;
++        int i = h & m_u.table->sizeMask;
+         int k = 0;
+-        while (UString::Rep *key = _table->entries[i].key) {
++        while (UString::Rep *key = m_u.table->entries[i].key) {
+             if (rep == key)
+                 break;
+             if (k == 0)
+-                k = 1 | (h % _table->sizeMask);
+-            i = (i + k) & _table->sizeMask;
++                k = 1 | (h % m_u.table->sizeMask);
++            i = (i + k) & m_u.table->sizeMask;
+         }
+         assert(i == j);
+         ++count;
+     }
+-    assert(count == _table->keyCount);
+-    assert(sentinelCount == _table->sentinelCount);
+-    assert(_table->size >= 16);
+-    assert(_table->sizeMask);
+-    assert(_table->size == _table->sizeMask + 1);
++    assert(count == m_u.table->keyCount);
++    assert(sentinelCount == m_u.table->sentinelCount);
++    assert(m_u.table->size >= 16);
++    assert(m_u.table->sizeMask);
++    assert(m_u.table->size == m_u.table->sizeMask + 1);
+ }
+ 
+ #endif // DO_CONSISTENCY_CHECK
+--- a/kjs/global.h.cmake
++++ b/kjs/global.h.cmake
+@@ -86,4 +86,7 @@
+ #cmakedefine HAVE_STDINT_H 1
+ #endif
+ 
++/* Valgrind memcheck presence */
++#cmakedefine HAVE_VALGRIND_MEMCHECK_H 1
++
+ #endif
+--- a/kjs/collector.cpp
++++ b/kjs/collector.cpp
+@@ -1,7 +1,8 @@
+ // -*- mode: c++; c-basic-offset: 4 -*-
+ /*
+  *  This file is part of the KDE libraries
+- *  Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
++ *  Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Computer, Inc.
++ *  Copyright (C) 2007 Maksim Orlovich <maksim at kde.org>
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Lesser General Public
+@@ -35,8 +36,10 @@
+ 
+ #include <pthread.h>
+ #include <mach/mach_port.h>
++#include <mach/mach_init.h>
+ #include <mach/task.h>
+ #include <mach/thread_act.h>
++#include <mach/vm_map.h>
+ 
+ #elif PLATFORM(WIN_OS)
+ 
+@@ -44,7 +47,11 @@
+ 
+ #elif PLATFORM(UNIX)
+ 
++#include <stdlib.h>
++#include <sys/types.h>
++#include <sys/mman.h>
+ #include <pthread.h> //krazy:exclude=includes (yes, it's duplicate, but in a different #if branch)
++#include <unistd.h>
+ 
+ #if HAVE(PTHREAD_NP_H)
+ #include <pthread_np.h>
+@@ -54,94 +61,254 @@
+ 
+ #define DEBUG_COLLECTOR 0
+ 
++#if HAVE(VALGRIND_MEMCHECK_H) && !defined(NDEBUG)
++
++#include <valgrind/memcheck.h>
++#define VG_DEFINED(p) VALGRIND_MAKE_MEM_DEFINED(&p, sizeof(void*))
++
++#else
++
++#define VG_DEFINED(p)
++
++#endif
++
++
+ using std::max;
+ 
+ namespace KJS {
+ 
+ // tunable parameters
+-const size_t MINIMUM_CELL_SIZE = 48;
+-const size_t BLOCK_SIZE = (8 * 4096);
+ const size_t SPARE_EMPTY_BLOCKS = 2;
+ const size_t MIN_ARRAY_SIZE = 14;
+ const size_t GROWTH_FACTOR = 2;
+ const size_t LOW_WATER_FACTOR = 4;
+-const size_t ALLOCATIONS_PER_COLLECTION = 1000;
++const size_t ALLOCATIONS_PER_COLLECTION = 4000;
+ 
+-// derived constants
+-const size_t CELL_ARRAY_LENGTH = (MINIMUM_CELL_SIZE / sizeof(double)) + (MINIMUM_CELL_SIZE % sizeof(double) != 0 ? sizeof(double) : 0);
+-const size_t CELL_SIZE = CELL_ARRAY_LENGTH * sizeof(double);
+-const size_t CELLS_PER_BLOCK = ((BLOCK_SIZE * 8 - sizeof(uint32_t) * 8 - sizeof(void *) * 8) / (CELL_SIZE * 8));
+ 
++// A whee bit like a WTF::Vector, but perfectly POD, so can be used in global context
++// w/o worries. 
++struct BlockList {
++    CollectorBlock** m_data;
++    size_t m_used;
++    size_t m_capacity;
+ 
++    CollectorBlock* operator[](int pos) {
++        return m_data[pos];
++    }
+ 
+-struct CollectorCell {
+-  union {
+-    double memory[CELL_ARRAY_LENGTH];
+-    struct {
+-      void *zeroIfFree;
+-      ptrdiff_t next;
+-    } freeCell;
+-  } u;
+-};
++    size_t used() const {
++        return m_used;
++    }
+ 
++    void append(CollectorBlock* block) {
++        if (m_used == m_capacity) {
++            m_capacity = max(MIN_ARRAY_SIZE, m_capacity * GROWTH_FACTOR);
++            m_data = static_cast<CollectorBlock **>(fastRealloc(m_data, m_capacity * sizeof(CollectorBlock *)));
++        }
++        m_data[m_used] = block;
++        ++m_used;
++    }
+ 
+-struct CollectorBlock {
+-  CollectorCell cells[CELLS_PER_BLOCK];
+-  uint32_t usedCells;
+-  CollectorCell *freeList;
++    void remove(CollectorBlock* block) {
++        size_t c;
++        for (c = 0; c < m_used; ++c)
++            if (m_data[c] == block)
++                break;
++
++        if (c == m_used)
++            return;
++
++        // Move things up, and shrink..
++        --m_used;
++        for (; c < m_used; ++c)
++            m_data[c] = m_data[c+1];
++    }
+ };
+ 
+ struct CollectorHeap {
+-  CollectorBlock **blocks;
+-  size_t numBlocks;
+-  size_t usedBlocks;
++  // This contains the list of both normal and oversize blocks
++  BlockList allBlocks;
++
++  // Just the normal blocks
++  BlockList blocks;
++
+   size_t firstBlockWithPossibleSpace;
+ 
+-  CollectorCell **oversizeCells;
+-  size_t numOversizeCells;
+-  size_t usedOversizeCells;
++  // The oversize block handling is a bit tricky, since we do not wish to slow down
++  // the usual paths. Hence, we do the following:
++  // 1) We set the marked bits for any extension portions of the block.
++  //    this way the stack GC doesn't have to do anything special if a pointer
++  //    happens to go that way.
++  // 2) We keep track of an allBlocks list to help the stack GC tests things.
++  //
++  // The oversize heap itself represents blocks as follows:
++  // 1) free: marked = false, allocd = false, trailer = false, zeroIfFree = 0
++  // 2) alloc'd, head: marked = depends, allocd = true, trailer = false, zeroIfFree is uncertain
++  // 3) alloc'd, trailer: marked = true (see above), allocd = true, trailer = true, zeroIfFree is uncertain
++  //
++  // For now, we don't use a freelist, so performance may be quite bad if
++  // this is used heavily; this is just because the cell does not have
++  // back and forward links; which we need since we can pick a non-first cell
++  // ### actually, it may be possible to shuffle the list. Not now, though
++  BlockList oversizeBlocks;
+ 
+   size_t numLiveObjects;
+   size_t numLiveObjectsAtLastCollect;
+ };
+ 
+-static CollectorHeap heap = {NULL, 0, 0, 0, NULL, 0, 0, 0, 0};
++static CollectorHeap heap;
+ 
+ bool Collector::memoryFull = false;
+ 
++static CollectorBlock* allocateBlock()
++{
++#if PLATFORM(DARWIN)
++    vm_address_t address = 0;
++    vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT);
++#elif PLATFORM(WIN_OS)
++     // windows virtual address granularity is naturally 64k
++    LPVOID address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
++#elif HAVE(POSIX_MEMALIGN)
++    void* address;
++    posix_memalign(address, BLOCK_SIZE, BLOCK_SIZE);
++    memset(reinterpret_cast<void*>(address), 0, BLOCK_SIZE);
++#else
++    static size_t pagesize = getpagesize();
++
++    size_t extra = 0;
++    if (BLOCK_SIZE > pagesize)
++        extra = BLOCK_SIZE - pagesize;
++
++    void* mmapResult = mmap(NULL, BLOCK_SIZE + extra, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
++    uintptr_t address = reinterpret_cast<uintptr_t>(mmapResult);
++
++    size_t adjust = 0;
++    if ((address & BLOCK_OFFSET_MASK) != 0)
++        adjust = BLOCK_SIZE - (address & BLOCK_OFFSET_MASK);
++
++    if (adjust > 0)
++        munmap(reinterpret_cast<void*>(address), adjust);
++
++    if (adjust < extra)
++        munmap(reinterpret_cast<void*>(address + adjust + BLOCK_SIZE), extra - adjust);
++
++    address += adjust;
++    memset(reinterpret_cast<void*>(address), 0, BLOCK_SIZE);
++#endif
++    CollectorBlock* ptr = reinterpret_cast<CollectorBlock*>(address);
++    heap.allBlocks.append(ptr); // Register with the heap
++    return ptr;
++}
++
++static void freeBlock(CollectorBlock* block)
++{
++    // Unregister the block first
++    heap.allBlocks.remove(block);
++    
++#if PLATFORM(DARWIN)
++    vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE);
++#elif PLATFORM(WIN_OS)
++    VirtualFree(block, BLOCK_SIZE, MEM_RELEASE);
++#elif HAVE(POSIX_MEMALIGN)
++    free(block);
++#else
++    munmap(block, BLOCK_SIZE);
++#endif
++}
++
++static void* allocOversize(size_t s)
++{
++  size_t cellsNeeded = (s + (CELL_SIZE - 1)) / CELL_SIZE;
++
++  // printf("allocOversize, size:%d, cellsNeeded:%d\n", s, cellsNeeded);
++
++  // We are not oversize enough to deal with things close to 64K in size
++  assert(cellsNeeded <= CELLS_PER_BLOCK);
++
++  // Look through the blocks, see if one has enough, and where.
++  CollectorBlock* sufficientBlock = 0;
++  size_t startOffset = -1;
++  for (size_t b = 0; b < heap.oversizeBlocks.used() && !sufficientBlock; ++b) {
++    CollectorBlock* candidate = heap.oversizeBlocks[b];
++    if (cellsNeeded <= CELLS_PER_BLOCK - candidate->usedCells) {
++      // Well, there is a chance we will fit.. Let's see if we can find a batch long enough..
++      for (size_t i = 0; i < CELLS_PER_BLOCK; i++) {
++        if (i % 32 == 0 && candidate->allocd.bits[i/32] == 0xFFFFFFFF) {
++          // Can skip this and 31 other cells
++          i += 31;
++          continue;
++        }
++
++        if (candidate->allocd.get(i))
++            continue;
++
++        // This cell is free -- are there enough free cells after it?
++        startOffset = i;
++        size_t last = i + cellsNeeded - 1;
++
++        if (last >= CELLS_PER_BLOCK) // No way it will fit
++          break;
++        
++        ++i;
++        while (i <= last && !candidate->allocd.get(i))
++          ++i;
++
++        // Did we get through enough?
++        if (i == last + 1) {
++          sufficientBlock = candidate;
++          break;
++        }
++
++        // Not enough room -- and the current entry has a non-zero zeroIfFree,
++        // so we should go on at i + 1 on next iteration
++
++      } // for each cell per block.
++    } // if enough room in block
++  } // for each block
++
++  if (!sufficientBlock) {
++    sufficientBlock = allocateBlock();
++    startOffset     = 0;
++    heap.oversizeBlocks.append(sufficientBlock);
++  }
++
++  sufficientBlock->usedCells += cellsNeeded;
++  
++  // Set proper bits for trailers and the head
++  sufficientBlock->allocd.set(startOffset);
++  for (size_t t = startOffset + 1; t < startOffset + cellsNeeded; ++t) {
++    sufficientBlock->trailer.set(t);
++    sufficientBlock->marked.set(t);
++    sufficientBlock->allocd.set(t);
++  }
++
++  void* result = sufficientBlock->cells + startOffset;
++  memset(result, 0, s);
++  heap.numLiveObjects = heap.numLiveObjects + 1;
++  return result;
++}
++
+ void* Collector::allocate(size_t s)
+ {
+   assert(JSLock::lockCount() > 0);
+ 
+   // collect if needed
+   size_t numLiveObjects = heap.numLiveObjects;
+-  if (numLiveObjects - heap.numLiveObjectsAtLastCollect >= ALLOCATIONS_PER_COLLECTION) {
++  size_t numLiveObjectsAtLastCollect = heap.numLiveObjectsAtLastCollect;  
++  size_t numNewObjects = numLiveObjects - numLiveObjectsAtLastCollect;
++
++  if (numNewObjects >= ALLOCATIONS_PER_COLLECTION && numNewObjects >= numLiveObjectsAtLastCollect) {
+     collect();
+     numLiveObjects = heap.numLiveObjects;
+   }
+ 
+   if (s > CELL_SIZE) {
+-    // oversize allocator
+-    size_t usedOversizeCells = heap.usedOversizeCells;
+-    size_t numOversizeCells = heap.numOversizeCells;
+-
+-    if (usedOversizeCells == numOversizeCells) {
+-      numOversizeCells = max(MIN_ARRAY_SIZE, numOversizeCells * GROWTH_FACTOR);
+-      heap.numOversizeCells = numOversizeCells;
+-      heap.oversizeCells = static_cast<CollectorCell **>(fastRealloc(heap.oversizeCells, numOversizeCells * sizeof(CollectorCell *)));
+-    }
+-    
+-    void *newCell = fastCalloc(s, 1);
+-    heap.oversizeCells[usedOversizeCells] = static_cast<CollectorCell *>(newCell);
+-    heap.usedOversizeCells = usedOversizeCells + 1;
+-    heap.numLiveObjects = numLiveObjects + 1;
+-
+-    return newCell;
++    return allocOversize(s);
+   }
+ 
+   // slab allocator
+ 
+-  size_t usedBlocks = heap.usedBlocks;
++  size_t usedBlocks = heap.blocks.used();
+ 
+   size_t i = heap.firstBlockWithPossibleSpace;
+   CollectorBlock *targetBlock;
+@@ -161,19 +328,11 @@
+   } else {
+ allocateNewBlock:
+     // didn't find one, need to allocate a new block
+-    size_t numBlocks = heap.numBlocks;
+-    if (usedBlocks == numBlocks) {
+-      numBlocks = max(MIN_ARRAY_SIZE, numBlocks * GROWTH_FACTOR);
+-      heap.numBlocks = numBlocks;
+-      heap.blocks = static_cast<CollectorBlock **>(fastRealloc(heap.blocks, numBlocks * sizeof(CollectorBlock *)));
+-    }
+-
+-    targetBlock = static_cast<CollectorBlock *>(fastCalloc(1, sizeof(CollectorBlock)));
++    targetBlock = allocateBlock();
+     targetBlock->freeList = targetBlock->cells;
+     targetBlockUsedCells = 0;
+-    heap.blocks[usedBlocks] = targetBlock;
+-    heap.usedBlocks = usedBlocks + 1;
+-    heap.firstBlockWithPossibleSpace = usedBlocks;
++    heap.blocks.append(targetBlock);
++    heap.firstBlockWithPossibleSpace = usedBlocks; // previous usedBlocks -> new one's index
+   }
+ 
+   // find a free spot in the block and detach it from the free list
+@@ -200,6 +359,7 @@
+ 
+ pthread_key_t registeredThreadKey;
+ pthread_once_t registeredThreadKeyOnce = PTHREAD_ONCE_INIT;
++
+ Collector::Thread *registeredThreads;
+ 
+ static void destroyRegisteredThread(void *data)
+@@ -245,8 +405,8 @@
+ 
+ #define IS_POINTER_ALIGNED(p) (((intptr_t)(p) & (sizeof(char *) - 1)) == 0)
+ 
+-// cells are 8-byte aligned
+-#define IS_CELL_ALIGNED(p) (((intptr_t)(p) & 7) == 0)
++// cell size needs to be a power of two for this to be valid
++#define IS_CELL_ALIGNED(p) (((intptr_t)(p) & CELL_MASK) == 0)
+ 
+ void Collector::markStackObjectsConservatively(void *start, void *end)
+ {
+@@ -263,34 +423,30 @@
+   char **p = (char **)start;
+   char **e = (char **)end;
+ 
+-  size_t usedBlocks = heap.usedBlocks;
+-  CollectorBlock **blocks = heap.blocks;
+-  size_t usedOversizeCells = heap.usedOversizeCells;
+-  CollectorCell **oversizeCells = heap.oversizeCells;
++  // We use allBlocks here since we want to mark oversize cells as well.
++  // Their trailers will have the mark bit set already, to avoid trouble.
++  size_t usedBlocks = heap.allBlocks.used();
++  CollectorBlock **blocks = heap.allBlocks.m_data;
+ 
+   const size_t lastCellOffset = sizeof(CollectorCell) * (CELLS_PER_BLOCK - 1);
+ 
+   while (p != e) {
+     char *x = *p++;
++    VG_DEFINED(x);
+     if (IS_CELL_ALIGNED(x) && x) {
++      uintptr_t offset = reinterpret_cast<uintptr_t>(x) & BLOCK_OFFSET_MASK;
++      CollectorBlock* blockAddr = reinterpret_cast<CollectorBlock*>(x - offset);
+       for (size_t block = 0; block < usedBlocks; block++) {
+-        size_t offset = x - reinterpret_cast<char *>(blocks[block]);
+-        if (offset <= lastCellOffset && offset % sizeof(CollectorCell) == 0)
+-          goto gotGoodPointer;
+-      }
+-      for (size_t i = 0; i != usedOversizeCells; i++)
+-        if (x == reinterpret_cast<char *>(oversizeCells[i]))
+-          goto gotGoodPointer;
+-      continue;
+-
+-gotGoodPointer:
+-      if (((CollectorCell *)x)->u.freeCell.zeroIfFree != 0) {
+-        JSCell *imp = reinterpret_cast<JSCell *>(x);
+-        if (!imp->marked())
+-          imp->mark();
+-      }
+-    }
+-  }
++        if ((blocks[block] == blockAddr) & (offset <= lastCellOffset)) {
++          if (((CollectorCell *)x)->u.freeCell.zeroIfFree != 0) {
++            JSCell *imp = reinterpret_cast<JSCell *>(x);
++            if (!imp->marked())
++              imp->mark();
++          }
++        } // if valid block
++      } // for each block
++    } // if cell-aligned
++  } // for each pointer
+ }
+ 
+ void Collector::markCurrentThreadConservatively()
+@@ -482,13 +638,21 @@
+   markStackObjectsConservatively();
+   markProtectedObjects();
+   List::markProtectedLists();
++#if USE(MULTIPLE_THREADS)
++  if (!currentThreadIsMainThread)
++    markMainThreadOnlyObjects();
++#endif
+ 
+   // SWEEP: delete everything with a zero refcount (garbage) and unmark everything else
+ 
++  // Note: if a cell has zeroIfFree == 0, it is either free,
++  // or in the middle of being constructed and has not yet
++  // had its vtable filled. Hence, such cells should not be cleaned up
++
+   size_t emptyBlocks = 0;
+   size_t numLiveObjects = heap.numLiveObjects;
+ 
+-  for (size_t block = 0; block < heap.usedBlocks; block++) {
++  for (size_t block = 0; block < heap.blocks.used(); block++) {
+     CollectorBlock *curBlock = heap.blocks[block];
+ 
+     size_t usedCells = curBlock->usedCells;
+@@ -499,9 +663,7 @@
+       for (size_t i = 0; i < CELLS_PER_BLOCK; i++) {
+         CollectorCell *cell = curBlock->cells + i;
+         JSCell *imp = reinterpret_cast<JSCell *>(cell);
+-        if (imp->m_marked) {
+-          imp->m_marked = false;
+-        } else if (currentThreadIsMainThread || imp->m_destructorIsThreadSafe) {
++        if (!curBlock->marked.get(i) && currentThreadIsMainThread) {
+           // special case for allocated but uninitialized object 
+           // (We don't need this check earlier because nothing prior this point assumes the object has a valid vptr.) 
+           if (cell->u.freeCell.zeroIfFree == 0)
+@@ -524,9 +686,7 @@
+           ++minimumCellsToProcess;
+         } else {
+           JSCell *imp = reinterpret_cast<JSCell *>(cell);
+-          if (imp->m_marked) {
+-            imp->m_marked = false;
+-          } else if (currentThreadIsMainThread || imp->m_destructorIsThreadSafe) {
++          if (!curBlock->marked.get(i) && currentThreadIsMainThread) {
+             imp->~JSCell();
+             --usedCells;
+             --numLiveObjects;
+@@ -540,6 +700,7 @@
+       }
+     }
+ 
++    curBlock->marked.clearAll();
+     curBlock->usedCells = usedCells;
+     curBlock->freeList = freeList;
+ 
+@@ -547,17 +708,12 @@
+       emptyBlocks++;
+       if (emptyBlocks > SPARE_EMPTY_BLOCKS) {
+ #if !DEBUG_COLLECTOR
+-        fastFree(curBlock);
++        freeBlock(curBlock);
+ #endif
+         // swap with the last block so we compact as we go
+-        heap.blocks[block] = heap.blocks[heap.usedBlocks - 1];
+-        heap.usedBlocks--;
++        heap.blocks.m_data[block] = heap.blocks[heap.blocks.used() - 1];
++        heap.blocks.m_used--;
+         block--; // Don't move forward a step in this case
+-
+-        if (heap.numBlocks > MIN_ARRAY_SIZE && heap.usedBlocks < heap.numBlocks / LOW_WATER_FACTOR) {
+-          heap.numBlocks = heap.numBlocks / GROWTH_FACTOR;
+-          heap.blocks = (CollectorBlock **)fastRealloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock *));
+-        }
+       }
+     }
+   }
+@@ -565,36 +721,75 @@
+   if (heap.numLiveObjects != numLiveObjects)
+     heap.firstBlockWithPossibleSpace = 0;
+ 
+-  size_t cell = 0;
+-  while (cell < heap.usedOversizeCells) {
+-    JSCell *imp = (JSCell *)heap.oversizeCells[cell];
++  // Now sweep oversize blocks.
++  emptyBlocks = 0;
++  for (size_t ob = 0; ob < heap.oversizeBlocks.used(); ++ob) {
++    CollectorBlock* curBlock = heap.oversizeBlocks[ob];
++    CollectorCell *freeList = curBlock->freeList;
++    size_t usedCells = curBlock->usedCells;
+ 
+-    if (!imp->m_marked && (currentThreadIsMainThread || imp->m_destructorIsThreadSafe)) {
+-      if (heap.oversizeCells[cell]->u.freeCell.zeroIfFree == 0) //If partly initialized, better don't touch it!
++    // Go through the cells
++    for (size_t i = 0; i < CELLS_PER_BLOCK; i++) {
++      if (i % 32 == 0 && curBlock->allocd.bits[i/32] == 0) {
++        // Nothing used around here, skip this and 31 next cells
++        i += 31;
++        continue;
++      }
++
++      CollectorCell *cell = curBlock->cells + i;
++      if (cell->u.freeCell.zeroIfFree == 0)
++        continue;
++
++      if (!curBlock->allocd.get(i))
+         continue;
+-      imp->~JSCell();
+-#if DEBUG_COLLECTOR
+-      heap.oversizeCells[cell]->u.freeCell.zeroIfFree = 0;
+-#else
+-      fastFree(imp);
+-#endif
+ 
+-      // swap with the last oversize cell so we compact as we go
+-      heap.oversizeCells[cell] = heap.oversizeCells[heap.usedOversizeCells - 1];
++      JSCell *imp = reinterpret_cast<JSCell *>(cell);
+ 
+-      heap.usedOversizeCells--;
+-      numLiveObjects--;
++      // Live and trailer cells will all have the mark set,
++      // so we only have to collect with it clear --
++      // and we already took care of those that are
++      // already free (or being initialized) above
++      if (!curBlock->marked.get(i)) {
++        // Free this block...
++        imp->~JSCell();
++        --numLiveObjects;
++        --usedCells;
++
++        // Mark the block and the trailers as available
++        cell->u.freeCell.zeroIfFree = 0;
++        curBlock->allocd.clear(i);
+ 
+-      if (heap.numOversizeCells > MIN_ARRAY_SIZE && heap.usedOversizeCells < heap.numOversizeCells / LOW_WATER_FACTOR) {
+-        heap.numOversizeCells = heap.numOversizeCells / GROWTH_FACTOR;
+-        heap.oversizeCells = (CollectorCell **)fastRealloc(heap.oversizeCells, heap.numOversizeCells * sizeof(CollectorCell *));
++        ++i; // Go to the potential trailer..
++        while (curBlock->trailer.get(i) && i < CELLS_PER_BLOCK) {
++          --usedCells;
++          curBlock->allocd.clear(i);
++          curBlock->trailer.clear(i);
++          curBlock->marked.clear (i);
++          curBlock->cells[i].u.freeCell.zeroIfFree = 0;
++          ++i;
++        }
++        --i; // Last item we processed.
++      } else {
++        // If this is not a trailer cell, clear the mark
++        if (!curBlock->trailer.get(i))
++          curBlock->marked.clear(i);
+       }
+-    } else {
+-      imp->m_marked = false;
+-      cell++;
+-    }
+-  }
++    } // each cell
++    curBlock->usedCells = usedCells;
++    curBlock->freeList = freeList;
++    if (usedCells == 0) {
++      emptyBlocks++;
++      if (emptyBlocks > SPARE_EMPTY_BLOCKS) {
++        freeBlock(curBlock);
+ 
++        // swap with the last block so we compact as we go
++        heap.oversizeBlocks.m_data[ob] = heap.oversizeBlocks[heap.oversizeBlocks.used() - 1];
++        heap.oversizeBlocks.m_used--;
++        ob--; // Don't move forward a step in this case
++      }
++    }
++  } // each oversize block
++    
+   bool deleted = heap.numLiveObjects != numLiveObjects;
+ 
+   heap.numLiveObjects = numLiveObjects;
+--- a/kjs/identifier.h
++++ b/kjs/identifier.h
+@@ -87,6 +87,7 @@
+         bool isEmpty() const { return _ustring.isEmpty(); }
+ 
+         uint32_t toUInt32(bool* ok) const { return _ustring.toUInt32(ok); }
++        uint32_t toUInt32(bool* ok, bool tolerateEmptyString) const { return _ustring.toUInt32(ok, tolerateEmptyString); };
+         uint32_t toStrictUInt32(bool* ok) const { return _ustring.toStrictUInt32(ok); }
+         unsigned toArrayIndex(bool* ok) const { return _ustring.toArrayIndex(ok); }
+         double toDouble() const { return _ustring.toDouble(); }
+--- a/kjs/operations.h
++++ b/kjs/operations.h
+@@ -73,10 +73,10 @@
+   inline bool isPosInf(double d) { return isinf(d) && d > 0; }
+   inline bool isNegInf(double d) { return isinf(d) && d < 0; }
+ #else
+-  bool isNaN(double d);
+-  bool isInf(double d);
+-  bool isPosInf(double d);
+-  bool isNegInf(double d);
++  KJS_EXPORT bool isNaN(double d);
++  KJS_EXPORT bool isInf(double d);
++  KJS_EXPORT bool isPosInf(double d);
++  KJS_EXPORT bool isNegInf(double d);
+ #endif
+ 
+   bool equal(ExecState *exec, JSValue *v1, JSValue *v2);
+--- a/kjs/ustring.cpp
++++ b/kjs/ustring.cpp
+@@ -1451,7 +1451,7 @@
+   }
+ 
+   // Return the result as a C string.
+-  CString result(buffer, p - buffer);
++  CString result(buffer.data(), p - buffer.data());
+ 
+   return result;
+ }
+--- a/kjs/CMakeLists.txt
++++ b/kjs/CMakeLists.txt
+@@ -21,6 +21,7 @@
+ endif(NOT WIN32)
+ check_function_exists(_finite    HAVE_FUNC__FINITE)
+ check_function_exists(finite     HAVE_FUNC_FINITE)
++check_function_exists(posix_memalign     HAVE_FUNC_POSIX_MEMALIGN)
+ check_symbol_exists(isnan   "math.h" HAVE_FUNC_ISNAN)
+ check_symbol_exists(isinf   "math.h" HAVE_FUNC_ISINF)
+ MACRO_POP_REQUIRED_VARS()
+--- a/kjs/date_object.cpp
++++ b/kjs/date_object.cpp
+@@ -1104,7 +1104,7 @@
+     }
+ 
+     // Missing delimiter between month and day (like "January29")?
+-    if (month == -1 && dateString && wordStart != dateString)
++    if (month == -1 && wordStart != dateString)
+         month = findMonth(wordStart);
+ 
+     dateString = skipSpacesAndComments(dateString);
+--- a/kjs/array_object.cpp
++++ b/kjs/array_object.cpp
+@@ -49,12 +49,40 @@
+ 
+ const ClassInfo ArrayInstance::info = {"Array", 0, 0, 0};
+ 
++static inline JSValue** allocateStorage(size_t capacity)
++{
++  if (capacity == 0)
++      return 0;
++
++  // store capacity in extra space before the beginning of the storage array to save space
++  JSValue** storage = static_cast<JSValue**>(fastCalloc(capacity + 1, sizeof(JSValue *))) + 1;
++  storage[-1] = reinterpret_cast<JSValue*>(capacity);
++  return storage;
++}
++
++static inline void reallocateStorage(JSValue**& storage, size_t newCapacity)
++{
++  if (!storage) {
++    storage =  allocateStorage(newCapacity);
++    return;
++  }
++
++  // store capacity in extra space before the beginning of the storage array to save space
++  storage = static_cast<JSValue**>(fastRealloc(storage - 1, (newCapacity + 1) * sizeof (JSValue*))) + 1;
++  storage[-1] = reinterpret_cast<JSValue*>(newCapacity);
++}
++
++static inline void freeStorage(JSValue** storage)
++{
++  if (storage)
++    fastFree(storage - 1);
++}
++
+ ArrayInstance::ArrayInstance(JSObject *proto, unsigned initialLength)
+   : JSObject(proto)
+   , length(initialLength)
+   , storageLength(initialLength < sparseArrayCutoff ? initialLength : 0)
+-  , capacity(storageLength)
+-  , storage(capacity ? (JSValue **)fastCalloc(capacity, sizeof(JSValue *)) : 0)
++  , storage(allocateStorage(storageLength))
+ {
+ }
+ 
+@@ -62,8 +90,7 @@
+   : JSObject(proto)
+   , length(list.size())
+   , storageLength(length)
+-  , capacity(storageLength)
+-  , storage(capacity ? (JSValue **)fastMalloc(sizeof(JSValue *) * capacity) : 0)
++  , storage(allocateStorage(storageLength))
+ {
+   ListIterator it = list.begin();
+   unsigned l = length;
+@@ -74,7 +101,7 @@
+ 
+ ArrayInstance::~ArrayInstance()
+ {
+-  fastFree(storage);
++  freeStorage(storage);
+ }
+ 
+ JSValue* ArrayInstance::getItem(unsigned i) const
+@@ -106,7 +133,7 @@
+       return false;
+     if (index < storageLength) {
+       JSValue *v = storage[index];
+-      if (!v || v->isUndefined())
++      if (!v)
+         return false;      
+       slot.setValueSlot(this, &storage[index]);
+       return true;
+@@ -125,7 +152,7 @@
+     return false;
+   if (index < storageLength) {
+     JSValue *v = storage[index];
+-    if (!v || v->isUndefined())
++    if (!v)
+       return false;
+     slot.setValueSlot(this, &storage[index]);
+     return true;
+@@ -236,7 +263,8 @@
+     if (newLength < storageLength) {
+       memset(storage + newLength, 0, sizeof(JSValue *) * (storageLength - newLength));
+     }
+-    if (newLength > capacity) {
++    size_t cap = capacity();
++    if (newLength > cap) {
+       unsigned newCapacity;
+       if (newLength > sparseArrayCutoff) {
+         newCapacity = newLength;
+@@ -246,9 +274,9 @@
+           newCapacity = sparseArrayCutoff;
+         }
+       }
+-      storage = (JSValue **)fastRealloc(storage, newCapacity * sizeof (JSValue *));
+-      memset(storage + capacity, 0, sizeof(JSValue *) * (newCapacity - capacity));
+-      capacity = newCapacity;
++      
++      reallocateStorage(storage, newCapacity);
++      memset(storage + cap, 0, sizeof(JSValue*) * (newCapacity - cap));
+     }
+     storageLength = newLength;
+ }
+@@ -289,7 +317,7 @@
+   }
+ }
+ 
+-static ExecState *execForCompareByStringForQSort;
++static ExecState* execForCompareByStringForQSort;
+ 
+ static int compareByStringForQSort(const void *a, const void *b)
+ {
+@@ -305,13 +333,14 @@
+     return compare(va->toString(exec), vb->toString(exec));
+ }
+ 
+-void ArrayInstance::sort(ExecState *exec)
++void ArrayInstance::sort(ExecState* exec)
+ {
+     int lengthNotIncludingUndefined = pushUndefinedObjectsToEnd(exec);
+-    
++
++    ExecState* oldExec = execForCompareByStringForQSort;
+     execForCompareByStringForQSort = exec;
+-    qsort(storage, lengthNotIncludingUndefined, sizeof(JSValue *), compareByStringForQSort);
+-    execForCompareByStringForQSort = 0;
++    qsort(storage, lengthNotIncludingUndefined, sizeof(JSValue*), compareByStringForQSort);
++    execForCompareByStringForQSort = oldExec;
+ }
+ 
+ struct CompareWithCompareFunctionArguments {
+@@ -330,7 +359,7 @@
+     JSObject *globalObject;
+ };
+ 
+-static CompareWithCompareFunctionArguments *compareWithCompareFunctionArguments;
++static CompareWithCompareFunctionArguments* compareWithCompareFunctionArguments;
+ 
+ static int compareWithCompareFunctionForQSort(const void *a, const void *b)
+ {
+@@ -353,14 +382,15 @@
+     return compareResult < 0 ? -1 : compareResult > 0 ? 1 : 0;
+ }
+ 
+-void ArrayInstance::sort(ExecState *exec, JSObject *compareFunction)
++void ArrayInstance::sort(ExecState* exec, JSObject* compareFunction)
+ {
+     int lengthNotIncludingUndefined = pushUndefinedObjectsToEnd(exec);
+-    
++
++    CompareWithCompareFunctionArguments* oldArgs = compareWithCompareFunctionArguments;
+     CompareWithCompareFunctionArguments args(exec, compareFunction);
+     compareWithCompareFunctionArguments = &args;
+-    qsort(storage, lengthNotIncludingUndefined, sizeof(JSValue *), compareWithCompareFunctionForQSort);
+-    compareWithCompareFunctionArguments = 0;
++    qsort(storage, lengthNotIncludingUndefined, sizeof(JSValue*), compareWithCompareFunctionForQSort);
++    compareWithCompareFunctionArguments = oldArgs;
+ }
+ 
+ unsigned ArrayInstance::pushUndefinedObjectsToEnd(ExecState *exec)
+@@ -856,7 +886,7 @@
+     if (id == Some || id == Every)
+       result = jsBoolean(id == Every);
+     else
+-      result = thisObj;
++      result = jsUndefined();
+     
+     for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
+       PropertySlot slot;
+@@ -903,7 +933,7 @@
+     for (; index < length; ++index) {
+         JSValue* e = getProperty(exec, thisObj, index);
+         if (!e)
+-            e = jsUndefined();
++            continue;
+         if (strictEqual(exec, searchElement, e))
+             return jsNumber(index);
+     }
+@@ -929,7 +959,7 @@
+     for (; index >= 0; --index) {
+         JSValue* e = getProperty(exec, thisObj, index);
+         if (!e)
+-            e = jsUndefined();
++            continue;
+         if (strictEqual(exec, searchElement, e))
+             return jsNumber(index);
+     }
+--- a/kjs/keywords.table
++++ b/kjs/keywords.table
+@@ -43,7 +43,7 @@
+ super           RESERVED
+ 
+ # these words are reserved for future use in the ECMA spec, but not in WinIE
+-# (see http://bugzilla.opendarwin.org/show_bug.cgi?id=6179)
++# (see http://bugs.webkit.org/show_bug.cgi?id=6179)
+ # abstract      RESERVED
+ # boolean       RESERVED
+ # byte          RESERVED
+--- a/kjs/lookup.h
++++ b/kjs/lookup.h
+@@ -331,8 +331,8 @@
+     ClassProto(KJS::ExecState *exec) \
+       : KJS::JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { } \
+     \
+-    static Identifier* s_name; \
+-    static Identifier* name(); \
++    static KJS::Identifier* s_name;           \
++    static KJS::Identifier* name(); \
+   };
+ 
+ #define KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(ClassProto, ClassProtoProto) \
+@@ -347,40 +347,40 @@
+         ClassProto(KJS::ExecState* exec) \
+             : KJS::JSObject(ClassProtoProto::self(exec)) { } \
+     \
+-    static Identifier* s_name; \
+-    static Identifier* name(); \
++    static KJS::Identifier* s_name; \
++    static KJS::Identifier* name(); \
+     };
+ 
+ 
+ #define KJS_IMPLEMENT_PROTOTYPE(ClassName, ClassProto,ClassFunc) \
+-    const ClassInfo ClassProto::info = { ClassName, 0, &ClassProto##Table, 0 }; \
+-    Identifier* ClassProto::s_name = 0; \
+-    JSObject *ClassProto::self(ExecState *exec) \
++    const KJS::ClassInfo ClassProto::info = { ClassName, 0, &ClassProto##Table, 0 }; \
++    KJS::Identifier* ClassProto::s_name = 0; \
++    KJS::JSObject *ClassProto::self(ExecState *exec) \
+     { \
+       return ::cacheGlobalObject<ClassProto>(exec, *name()); \
+     } \
+-    bool ClassProto::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) \
++    bool ClassProto::getOwnPropertySlot(KJS::ExecState *exec, const KJS::Identifier& propertyName, KJS::PropertySlot& slot) \
+     { \
+-      return getStaticFunctionSlot<ClassFunc, JSObject>(exec, &ClassProto##Table, this, propertyName, slot); \
++      return getStaticFunctionSlot<ClassFunc, KJS::JSObject>(exec, &ClassProto##Table, this, propertyName, slot); \
+     } \
+-    Identifier* ClassProto::name() \
++    KJS::Identifier* ClassProto::name() \
+     { \
+-      if (!s_name) s_name = new Identifier("[[" ClassName ".prototype]]"); \
++      if (!s_name) s_name = new KJS::Identifier("[[" ClassName ".prototype]]"); \
+       return s_name; \
+     }
+ 
+ 
+ #define KJS_IMPLEMENT_PROTOFUNC(ClassFunc) \
+-  class ClassFunc : public InternalFunctionImp { \
++  class ClassFunc : public KJS::InternalFunctionImp {   \
+   public: \
+-    ClassFunc(ExecState* exec, int i, int len, const Identifier& name) \
+-      : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name) \
++    ClassFunc(KJS::ExecState* exec, int i, int len, const KJS::Identifier& name) \
++      : InternalFunctionImp(static_cast<KJS::FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name) \
+       , id(i) \
+     { \
+-       put(exec, exec->propertyNames().length, jsNumber(len), DontDelete|ReadOnly|DontEnum); \
++       put(exec, exec->propertyNames().length, KJS::jsNumber(len), KJS::DontDelete|KJS::ReadOnly|KJS::DontEnum); \
+     } \
+     /* Macro user needs to implement the callAsFunction function. */ \
+-    virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args); \
++      virtual KJS::JSValue *callAsFunction(KJS::ExecState *exec, KJS::JSObject *thisObj, const KJS::List &args); \
+   private: \
+     int id; \
+   };
+--- a/kjs/number_object.cpp
++++ b/kjs/number_object.cpp
+@@ -95,13 +95,13 @@
+         Vector<char, 1024> buf(decimalPoint + 1);
+ 
+         if (static_cast<int>(length) <= decimalPoint) {
+-            strcpy(buf, result);
+-            memset(buf + length, '0', decimalPoint - length);
++            strcpy(buf.data(), result);
++            memset(buf.data() + length, '0', decimalPoint - length);
+         } else
+-            strncpy(buf, result, decimalPoint);
++	    strncpy(buf.data(), result, decimalPoint);
+ 
+         buf[decimalPoint] = '\0';
+-        str += UString(buf);
++        str += UString(buf.data());
+     }
+ 
+     kjs_freedtoa(result);
+@@ -114,7 +114,7 @@
+     Vector<char, 2048> buf(count + 1, c);
+     buf[count] = '\0';
+ 
+-    return UString(buf);
++    return UString(buf.data());
+ }
+ 
+ static double intPow10(int e)
+--- a/kjs/config.h.cmake
++++ b/kjs/config.h.cmake
+@@ -32,3 +32,4 @@
+ #cmakedefine HAVE_FUNC_FINITE 1
+ #cmakedefine HAVE_FUNC_ISINF 1
+ #cmakedefine HAVE_FUNC_ISNAN 1
++#cmakedefine HAVE_FUNC_POSIX_MEMALIGN 1
+--- a/kjs/collector.h
++++ b/kjs/collector.h
+@@ -3,7 +3,8 @@
+  *  This file is part of the KDE libraries
+  *  Copyright (C) 1999-2000 Harri Porten (porten at kde.org)
+  *  Copyright (C) 2001 Peter Kelly (pmk at post.com)
+- *  Copyright (C) 2003 Apple Computer, Inc.
++ *  Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
++ *  Copyright (C) 2007 Maksim Orlovich (maksim at kde.org)
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Lesser General Public
+@@ -24,12 +25,15 @@
+ #ifndef KJSCOLLECTOR_H_
+ #define KJSCOLLECTOR_H_
+ 
+-#include "value.h"
+ #include <wtf/HashCountedSet.h>
++#include <cstring>
+ 
+ #define KJS_MEM_LIMIT 500000
+ 
+ namespace KJS {
++  class JSCell;
++  class JSValue;
++  class CollectorBlock;
+ 
+   /**
+    * @short Garbage collector.
+@@ -74,7 +78,14 @@
+     class Thread;
+     static void registerThread();
+ 
++    static bool isCellMarked(const JSCell*);
++    static void markCell(JSCell*);
++
+   private:
++    static const CollectorBlock* cellBlock(const JSCell*);
++    static CollectorBlock* cellBlock(JSCell*);
++    static size_t cellOffset(const JSCell*);
++
+ 
+     static void markProtectedObjects();
+     static void markCurrentThreadConservatively();
+@@ -85,6 +96,86 @@
+     static bool memoryFull;
+   };
+ 
++  // tunable parameters
++  template<size_t bytesPerWord> struct CellSize;
++
++  // cell size needs to be a power of two for certain optimizations in collector.cpp
++  // below also assume it's divisible by 8, and that block size is divisible by it
++  template<> struct CellSize<4> { static const size_t m_value = 32; }; // 32-bit
++  template<> struct CellSize<8> { static const size_t m_value = 64; }; // 64-bit
++  const size_t BLOCK_SIZE = 16 * 4096; // 64k
++
++  const size_t BLOCK_OFFSET_MASK = BLOCK_SIZE - 1;
++  const size_t BLOCK_MASK = ~BLOCK_OFFSET_MASK;
++  
++  const size_t CELL_SIZE = CellSize<sizeof(void*)>::m_value;
++  const size_t CELL_ARRAY_LENGTH = (CELL_SIZE / sizeof(double));
++  const size_t CELL_MASK = CELL_SIZE - 1;
++
++  // For each block, we can have at /most/ BLOCK_SIZE/CELL_SIZE entries.
++  // Sice the bitmap accordingly, don't try to be fancy
++  const size_t BITMAP_SIZE = (BLOCK_SIZE / CELL_SIZE + 7) / 8;
++  const size_t BITMAP_WORDS = (BITMAP_SIZE + 3) / sizeof(uint32_t);
++
++  // In each block, we have 3 bitmaps (mark for all blocks, extension + allocd for oversize cell blocks),
++  // as well as an int and a pointer
++  const size_t BLOCK_METADATA_SIZE = 3 * 4 * BITMAP_WORDS + sizeof(uint32_t) + sizeof(void*);
++  const size_t CELLS_PER_BLOCK     = (BLOCK_SIZE - BLOCK_METADATA_SIZE) / CELL_SIZE;
++
++  struct CollectorBitmap {
++    uint32_t bits[BITMAP_WORDS];
++    bool get(size_t n) const { return !!(bits[n >> 5] & (1 << (n & 0x1F))); } 
++    void set(size_t n) { bits[n >> 5] |= (1 << (n & 0x1F)); } 
++    void clear(size_t n) { bits[n >> 5] &= ~(1 << (n & 0x1F)); } 
++    void clearAll() { memset(bits, 0, sizeof(bits)); }
++  };
++
++  struct CollectorCell {
++    union {
++      double memory[CELL_ARRAY_LENGTH];
++      struct {
++        void* zeroIfFree;
++        ptrdiff_t next;
++      } freeCell;
++    } u;
++  };
++
++  class CollectorBlock {
++  public:
++    CollectorCell cells[CELLS_PER_BLOCK];
++    uint32_t usedCells;
++    CollectorCell* freeList;
++    CollectorBitmap marked;
++    CollectorBitmap allocd;
++    CollectorBitmap trailer;
++  };
++
++  inline const CollectorBlock* Collector::cellBlock(const JSCell* cell)
++  {
++    return reinterpret_cast<const CollectorBlock*>(reinterpret_cast<uintptr_t>(cell) & BLOCK_MASK);
++  }
++
++  inline CollectorBlock* Collector::cellBlock(JSCell* cell)
++  {
++    return const_cast<CollectorBlock*>(cellBlock(const_cast<const JSCell*>(cell)));
++  }
++
++  inline size_t Collector::cellOffset(const JSCell* cell)
++  {
++    return (reinterpret_cast<uintptr_t>(cell) & BLOCK_OFFSET_MASK) / CELL_SIZE;
++  }
++
++  inline bool Collector::isCellMarked(const JSCell* cell)
++  {
++    return cellBlock(cell)->marked.get(cellOffset(cell));
++  }
++
++  inline void Collector::markCell(JSCell* cell)
++  {
++    cellBlock(cell)->marked.set(cellOffset(cell));
++  }
++
++
+ }
+ 
+ #endif /* _KJSCOLLECTOR_H_ */
+--- a/kjs/create_hash_table
++++ b/kjs/create_hash_table
+@@ -29,17 +29,17 @@
+ shift;
+ my $findSize = 0;
+ my $includelookup = 0;
++my $useNameSpace;
+ 
+ # Use -s as second argument to make it try many hash sizes
+-$findSize = 1 if (defined($ARGV[0]) && $ARGV[0] eq "-s");
++if (defined($ARGV[0]) && $ARGV[0] eq "-s") { $findSize = 1; shift; }
+ 
+ # Use -i as second argument to make it include "lookup.h"
+-$includelookup = 1 if (defined($ARGV[0]) && $ARGV[0] eq "-i");
++if (defined($ARGV[0]) && $ARGV[0] eq "-i") { $includelookup = 1; shift; }
+ 
+ # Use -n as second argument to make it use the third argument as namespace parameter ie. -n KDOM
+-my $useNameSpace = $ARGV[1] if (defined($ARGV[0]) && $ARGV[0] eq "-n");
++if (defined($ARGV[0]) && $ARGV[0] eq "-n") { $useNameSpace = $ARGV[1]; shift; shift; }
+ 
+-print STDERR "Creating hashtable for $file\n";
+ open(IN, $file) or die "No such file $file";
+ 
+ my @keys = ();
+--- a/kfile/kfilewidget.cpp
++++ b/kfile/kfilewidget.cpp
+@@ -110,7 +110,7 @@
+      * Returns the URL which represents the directory of \a url. If
+      * \a url already is a directory, then just \a url is returned.
+      */
+-    KUrl directoryUrl(const KUrl& url) const;
++    static KUrl directoryUrl(const KUrl& url);
+ 
+     /**
+      * Returns the absolute version of the URL specified in locationEdit.
+@@ -238,46 +238,40 @@
+     d->urlNavigator->setPlacesSelectorVisible(false);
+ 
+     KUrl u;
+-    QString text;
+     KUrlComboBox *pathCombo = d->urlNavigator->editor();
+ #ifdef Q_WS_WIN
+     foreach( const QFileInfo &drive,QFSFileEngine::drives() )
+     {
+         u.setPath( drive.filePath() );
+-        text = i18n("Drive: %1",  u.toLocalFile() );
+-        pathCombo->addDefaultUrl( u,
+-                                  KIO::pixmapForUrl( u, 0, KIconLoader::Small ),
+-                                  text );
++        pathCombo->addDefaultUrl(u,
++                                 KIO::pixmapForUrl( u, 0, KIconLoader::Small ),
++                                 i18n("Drive: %1",  u.toLocalFile()));
+     }
+ #else
+-    u.setPath( QDir::rootPath() );
+-    text = i18n("Root Folder: %1",  u.toLocalFile() );
+-    pathCombo->addDefaultUrl( u,
+-                              KIO::pixmapForUrl( u, 0, KIconLoader::Small ),
+-                              text );
++    u.setPath(QDir::rootPath());
++    pathCombo->addDefaultUrl(u,
++                             KIO::pixmapForUrl(u, 0, KIconLoader::Small),
++                             u.toLocalFile());
+ #endif
+ 
+-    u.setPath( QDir::homePath() );
+-    text = i18n("Home Folder: %1",  u.path( KUrl::AddTrailingSlash ) );
+-    pathCombo->addDefaultUrl( u, KIO::pixmapForUrl( u, 0, KIconLoader::Small ),
+-                              text );
++    u.setPath(QDir::homePath());
++    pathCombo->addDefaultUrl(u, KIO::pixmapForUrl(u, 0, KIconLoader::Small),
++                             u.path(KUrl::AddTrailingSlash));
+ 
+     KUrl docPath;
+     docPath.setPath( KGlobalSettings::documentPath() );
+     if ( (u.path(KUrl::AddTrailingSlash) != docPath.path(KUrl::AddTrailingSlash)) &&
+           QDir(docPath.path(KUrl::AddTrailingSlash)).exists() )
+     {
+-      text = i18n("Documents: %1",  docPath.path( KUrl::AddTrailingSlash ) );
+         pathCombo->addDefaultUrl( docPath,
+                                   KIO::pixmapForUrl( docPath, 0, KIconLoader::Small ),
+-                                  text );
++                                  docPath.path(KUrl::AddTrailingSlash));
+     }
+ 
+     u.setPath( KGlobalSettings::desktopPath() );
+-    text = i18n("Desktop: %1",  u.path( KUrl::AddTrailingSlash ) );
+-    pathCombo->addDefaultUrl( u,
+-                              KIO::pixmapForUrl( u, 0, KIconLoader::Small ),
+-                              text );
++    pathCombo->addDefaultUrl(u,
++                             KIO::pixmapForUrl(u, 0, KIconLoader::Small),
++                             u.path(KUrl::AddTrailingSlash));
+ 
+     d->url = getStartUrl( startDir, d->fileClass );
+     d->selection = d->url.url();
+@@ -982,8 +976,10 @@
+     setLocationText( text.trimmed() );
+ }
+ 
+-KUrl KFileWidgetPrivate::directoryUrl(const KUrl& url) const
++KUrl KFileWidgetPrivate::directoryUrl(const KUrl& url)
+ {
++    if (!url.isValid())
++        return url;
+     KFileItem item(S_IFDIR, KFileItem::Unknown, url);
+     item.refresh();
+     return item.isDir() ? url : url.upUrl();
+@@ -1036,7 +1032,6 @@
+     placesView = new KFilePlacesView( q );
+     placesView->setModel(new KFilePlacesModel(placesView));
+     placesView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
+-    placesView->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
+ 
+     placesView->setObjectName( QLatin1String( "url bar" ) );
+     QObject::connect( placesView, SIGNAL( urlChanged( const KUrl& )),
+@@ -1457,7 +1452,7 @@
+     ops->readConfig(configGroup);
+ 
+     KUrlComboBox *combo = urlNavigator->editor();
+-    combo->setUrls( configGroup.readPathListEntry( RecentURLs ), KUrlComboBox::RemoveTop );
++    combo->setUrls( configGroup.readPathEntry( RecentURLs, QStringList() ), KUrlComboBox::RemoveTop );
+     combo->setMaxItems( configGroup.readEntry( RecentURLsNumber,
+                                        DefaultRecentURLsNumber ) );
+     combo->setUrl( ops->url() );
+@@ -1514,6 +1509,8 @@
+     configGroup.writeEntry( ShowBookmarks, bookmarkHandler != 0 );
+     configGroup.writeEntry( AutoSelectExtChecked, autoSelectExtChecked );
+     configGroup.writeEntry( BreadcrumbNavigation, !urlNavigator->isUrlEditable() );
++
++    ops->writeConfig(configGroup);
+ }
+ 
+ 
+@@ -1523,7 +1520,7 @@
+ 
+     locationEdit->setMaxItems( cg.readEntry( RecentFilesNumber,
+                                              DefaultRecentURLsNumber ) );
+-    locationEdit->setUrls( cg.readPathListEntry( RecentFiles ),
++    locationEdit->setUrls( cg.readPathEntry( RecentFiles, QStringList() ),
+                            KUrlComboBox::RemoveBottom );
+     locationEdit->insertItem(0, QString()); // dummy item without pixmap
+     locationEdit->setCurrentIndex( 0 );
+--- a/kfile/kdiroperator.cpp
++++ b/kfile/kdiroperator.cpp
+@@ -370,7 +370,8 @@
+ 
+ void KDirOperator::resetCursor()
+ {
+-    QApplication::restoreOverrideCursor();
++    if (qApp)
++        QApplication::restoreOverrideCursor();
+     d->progressBar->hide();
+ }
+ 
+@@ -750,14 +751,14 @@
+                     i18n("<qt>Do you really want to trash\n <b>'%1'</b>?</qt>" ,
+                          files.first()),
+                     i18n("Trash File"),
+-                    KGuiItem(i18nc("to trash", "&Trash"), "edit-trash"),
++                    KGuiItem(i18nc("to trash", "&Trash"), "user-trash"),
+                     KStandardGuiItem::cancel(), "AskForTrash");
+         } else
+             ret = KMessageBox::warningContinueCancelList(parent,
+                     i18np("translators: not called for n == 1", "Do you really want to trash these %1 items?", items.count()),
+                     files,
+                     i18n("Trash Files"),
+-                    KGuiItem(i18nc("to trash", "&Trash"), "edit-trash"),
++                    KGuiItem(i18nc("to trash", "&Trash"), "user-trash"),
+                     KStandardGuiItem::cancel(), "AskForTrash");
+         doIt = (ret == KMessageBox::Continue);
+     }
+@@ -1393,13 +1394,15 @@
+     }
+ 
+     QItemSelectionModel *selModel = d->itemView->selectionModel();
+-    selModel->clear();
+-    if (!item.isNull()) {
+-        const QModelIndex dirIndex = d->dirModel->indexForItem(item);
+-        const QModelIndex proxyIndex = d->proxyModel->mapFromSource(dirIndex);
+-        selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::Select);
+-        selModel->select(proxyIndex, QItemSelectionModel::Select);
+-        d->_k_assureVisibleSelection();
++    if (selModel) {
++        selModel->clear();
++        if (!item.isNull()) {
++            const QModelIndex dirIndex = d->dirModel->indexForItem(item);
++            const QModelIndex proxyIndex = d->proxyModel->mapFromSource(dirIndex);
++            selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::Select);
++            selModel->select(proxyIndex, QItemSelectionModel::Select);
++            d->_k_assureVisibleSelection();
++        }
+     }
+ }
+ 
+@@ -1479,7 +1482,7 @@
+ 
+     KAction* trash = new KAction(i18n("Move to Trash"), this);
+     d->actionCollection->addAction("trash", trash);
+-    trash->setIcon(KIcon("edit-trash"));
++    trash->setIcon(KIcon("user-trash"));
+     trash->setShortcuts(KShortcut(Qt::Key_Delete));
+     connect(trash, SIGNAL(triggered(bool)), SLOT(trashSelected()));
+ 
+--- a/kfile/kfileplacesmodel.h
++++ b/kfile/kfileplacesmodel.h
+@@ -130,8 +130,10 @@
+     void setupDone(const QModelIndex &index, bool success);
+ 
+ private:
+-    Q_PRIVATE_SLOT(d, void _k_devicesInserted(const QModelIndex&, int, int))
+-    Q_PRIVATE_SLOT(d, void _k_devicesRemoved(const QModelIndex&, int, int))
++    Q_PRIVATE_SLOT(d, void _k_initDeviceList())
++    Q_PRIVATE_SLOT(d, void _k_deviceAdded(const QString&))
++    Q_PRIVATE_SLOT(d, void _k_deviceRemoved(const QString&))
++    Q_PRIVATE_SLOT(d, void _k_deviceChanged(const QString&))
+     Q_PRIVATE_SLOT(d, void _k_reloadBookmarks())
+     Q_PRIVATE_SLOT(d, void _k_storageSetupDone(Solid::ErrorType, QVariant))
+     Q_PRIVATE_SLOT(d, void _k_storageTeardownDone(Solid::ErrorType, QVariant))
+--- a/kfile/kdirselectdialog.cpp
++++ b/kfile/kdirselectdialog.cpp
+@@ -92,7 +92,7 @@
+     m_urlCombo->clear();
+ 
+     KConfigGroup conf( config, group );
+-    m_urlCombo->setHistoryItems( conf.readPathListEntry( "History Items" ));
++    m_urlCombo->setHistoryItems( conf.readPathEntry( "History Items", QStringList() ));
+ 
+     m_parent->resize( conf.readEntry( "DirSelectDialog Size", QSize( 400, 450 ) ) );
+ }
+@@ -101,7 +101,7 @@
+ {
+     KConfigGroup conf( config, group );
+     KConfigGroup::WriteConfigFlags flags(KConfigGroup::Persistent|KConfigGroup::Global);
+-    conf.writePathEntry( "History Items", m_urlCombo->historyItems(), ',', flags );
++    conf.writePathEntry( "History Items", m_urlCombo->historyItems(), flags );
+     conf.writeEntry( "DirSelectDialog Size", m_parent->size(), flags );
+ 
+     config->sync();
+--- a/kfile/kfileplacesview.cpp
++++ b/kfile/kfileplacesview.cpp
+@@ -22,6 +22,7 @@
+ #include <QtCore/QTimeLine>
+ #include <QtCore/QTimer>
+ #include <QtGui/QMenu>
++#include <QtGui/QPainter>
+ #include <QtGui/QItemDelegate>
+ #include <QtGui/QKeyEvent>
+ 
+@@ -55,7 +56,9 @@
+     void setIconSize(int newSize);
+ 
+     void addAppearingItem(const QModelIndex &index);
+-    void setAppearingIconSize(int newSize);
++    void setAppearingItemProgress(qreal value);
++    void addDisappearingItem(const QModelIndex &index);
++    void setDisappearingItemProgress(qreal value);
+ 
+ private:
+     KFilePlacesView *m_view;
+@@ -63,6 +66,11 @@
+ 
+     QList<QPersistentModelIndex> m_appearingItems;
+     int m_appearingIconSize;
++    qreal m_appearingOpacity;
++
++    QList<QPersistentModelIndex> m_disappearingItems;
++    int m_disappearingIconSize;
++    qreal m_disappearingOpacity;
+ };
+ 
+ KFilePlacesViewDelegate::KFilePlacesViewDelegate(KFilePlacesView *parent) :
+@@ -81,6 +89,8 @@
+     int iconSize = m_iconSize;
+     if (m_appearingItems.contains(index)) {
+         iconSize = m_appearingIconSize;
++    } else if (m_disappearingItems.contains(index)) {
++        iconSize = m_disappearingIconSize;
+     }
+ 
+     size.setHeight(iconSize + KDialog::marginHint());
+@@ -89,14 +99,20 @@
+ 
+ void KFilePlacesViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+ {
+-    int iconSize = m_iconSize;
++    painter->save();
++
+     if (m_appearingItems.contains(index)) {
+-        iconSize = m_appearingIconSize;
++        painter->setOpacity(m_appearingOpacity);
++    } else if (m_disappearingItems.contains(index)) {
++        painter->setOpacity(m_disappearingOpacity);
+     }
+ 
+     QStyleOptionViewItem opt = option;
+-    opt.decorationSize = QSize(iconSize, iconSize);
++    opt.decorationSize = QSize(m_iconSize, m_iconSize);
++    opt.state|= QStyle::State_Active;
+     QItemDelegate::paint(painter, opt, index);
++
++    painter->restore();
+ }
+ 
+ int KFilePlacesViewDelegate::iconSize() const
+@@ -114,13 +130,48 @@
+     m_appearingItems << index;
+ }
+ 
+-void KFilePlacesViewDelegate::setAppearingIconSize(int newSize)
++void KFilePlacesViewDelegate::setAppearingItemProgress(qreal value)
+ {
+-    m_appearingIconSize = newSize;
++    if (value<=0.25) {
++        m_appearingOpacity = 0.0;
++        m_appearingIconSize = iconSize()*value*4;
+ 
+-    if (m_appearingIconSize>=m_iconSize) {
+-        m_appearingItems.clear();
++        if (m_appearingIconSize>=m_iconSize) {
++            m_appearingIconSize = m_iconSize;
++        }
++    } else {
+         m_appearingIconSize = m_iconSize;
++        m_appearingOpacity = (value-0.25)*4/3;
++
++        if (value>=1.0) {
++            m_appearingItems.clear();
++        }
++    }
++}
++
++void KFilePlacesViewDelegate::addDisappearingItem(const QModelIndex &index)
++{
++    m_disappearingItems << index;
++}
++
++void KFilePlacesViewDelegate::setDisappearingItemProgress(qreal value)
++{
++    value = 1.0 - value;
++
++    if (value<=0.25) {
++        m_disappearingOpacity = 0.0;
++        m_disappearingIconSize = iconSize()*value*4;
++
++        if (m_disappearingIconSize>=m_iconSize) {
++            m_disappearingIconSize = m_iconSize;
++        }
++
++        if (value<=0.0) {
++            m_disappearingItems.clear();
++        }
++    } else {
++        m_disappearingIconSize = m_iconSize;
++        m_disappearingOpacity = (value-0.25)*4/3;
+     }
+ }
+ 
+@@ -146,12 +197,14 @@
+     void _k_storageSetupDone(const QModelIndex &index, bool success);
+     void _k_adaptItemsUpdate(qreal value);
+     void _k_itemAppearUpdate(qreal value);
++    void _k_itemDisappearUpdate(qreal value);
+     void _k_enableSmoothItemResizing();
+ 
+     QTimeLine adaptItemsTimeline;
+     int oldSize, endSize;
+ 
+     QTimeLine itemAppearTimeline;
++    QTimeLine itemDisappearTimeline;
+ };
+ 
+ KFilePlacesView::KFilePlacesView(QWidget *parent)
+@@ -185,15 +238,21 @@
+ 
+     connect(&d->adaptItemsTimeline, SIGNAL(valueChanged(qreal)),
+             this, SLOT(_k_adaptItemsUpdate(qreal)));
+-    d->adaptItemsTimeline.setDuration(150);
+-    d->adaptItemsTimeline.setUpdateInterval(30);
++    d->adaptItemsTimeline.setDuration(500);
++    d->adaptItemsTimeline.setUpdateInterval(5);
+     d->adaptItemsTimeline.setCurveShape(QTimeLine::EaseInOutCurve);
+ 
+     connect(&d->itemAppearTimeline, SIGNAL(valueChanged(qreal)),
+             this, SLOT(_k_itemAppearUpdate(qreal)));
+-    d->itemAppearTimeline.setDuration(150);
+-    d->itemAppearTimeline.setUpdateInterval(30);
+-    d->itemAppearTimeline.setCurveShape(QTimeLine::EaseOutCurve);
++    d->itemAppearTimeline.setDuration(500);
++    d->itemAppearTimeline.setUpdateInterval(5);
++    d->itemAppearTimeline.setCurveShape(QTimeLine::EaseInOutCurve);
++
++    connect(&d->itemDisappearTimeline, SIGNAL(valueChanged(qreal)),
++            this, SLOT(_k_itemDisappearUpdate(qreal)));
++    d->itemDisappearTimeline.setDuration(500);
++    d->itemDisappearTimeline.setUpdateInterval(5);
++    d->itemDisappearTimeline.setCurveShape(QTimeLine::EaseInOutCurve);
+ }
+ 
+ KFilePlacesView::~KFilePlacesView()
+@@ -203,6 +262,7 @@
+ 
+ void KFilePlacesView::setUrl(const KUrl &url)
+ {
++    KUrl oldUrl = d->currentUrl;
+     KFilePlacesModel *placesModel = qobject_cast<KFilePlacesModel*>(model());
+ 
+     if (placesModel==0) return;
+@@ -215,7 +275,7 @@
+             delegate->addAppearingItem(index);
+ 
+             if (d->itemAppearTimeline.state()!=QTimeLine::Running) {
+-                delegate->setAppearingIconSize(1);
++                delegate->setAppearingItemProgress(0.0);
+                 d->itemAppearTimeline.start();
+             }
+         }
+@@ -226,6 +286,7 @@
+         d->currentUrl = KUrl();
+         selectionModel()->clear();
+     }
++
+     d->updateHiddenRows();
+ }
+ 
+@@ -236,7 +297,6 @@
+     if (placesModel==0) return;
+ 
+     d->showAll = showAll;
+-    d->updateHiddenRows();
+ 
+     KFilePlacesViewDelegate *delegate = dynamic_cast<KFilePlacesViewDelegate*>(itemDelegate());
+ 
+@@ -244,6 +304,8 @@
+     QModelIndex current = placesModel->closestItem(d->currentUrl);
+ 
+     if (showAll) {
++        d->updateHiddenRows();
++
+         for (int i=0; i<rowCount; ++i) {
+             QModelIndex index = placesModel->index(i, 0);
+             if (index!=current && placesModel->isHidden(index)) {
+@@ -252,16 +314,28 @@
+         }
+ 
+         if (d->itemAppearTimeline.state()!=QTimeLine::Running) {
+-            delegate->setAppearingIconSize(1);
++            delegate->setAppearingItemProgress(0.0);
+             d->itemAppearTimeline.start();
+         }
+-    }
++    } else {
++        for (int i=0; i<rowCount; ++i) {
++            QModelIndex index = placesModel->index(i, 0);
++            if (index!=current && placesModel->isHidden(index)) {
++                delegate->addDisappearingItem(index);
++            }
++        }
+ 
++        if (d->itemDisappearTimeline.state()!=QTimeLine::Running) {
++            delegate->setDisappearingItemProgress(0.0);
++            d->itemDisappearTimeline.start();
++        }
++    }
+ }
+ 
+ void KFilePlacesView::contextMenuEvent(QContextMenuEvent *event)
+ {
+     KFilePlacesModel *placesModel = qobject_cast<KFilePlacesModel*>(model());
++    KFilePlacesViewDelegate *delegate = dynamic_cast<KFilePlacesViewDelegate*>(itemDelegate());
+ 
+     if (placesModel==0) return;
+ 
+@@ -327,13 +401,23 @@
+         placesModel->removePlace(index);
+     } else if (hide != 0 && result == hide) {
+         placesModel->setPlaceHidden(index, hide->isChecked());
++
++        if (!d->showAll && hide->isChecked()) {
++            delegate->addDisappearingItem(index);
++
++            if (d->itemDisappearTimeline.state()!=QTimeLine::Running) {
++                delegate->setDisappearingItemProgress(0.0);
++                d->itemDisappearTimeline.start();
++            }
++        }
+     } else if (showAll != 0 && result == showAll) {
+         setShowAll(showAll->isChecked());
+     } else if (teardown != 0 && result == teardown) {
+         placesModel->requestTeardown(index);
+     }
+ 
+-    setUrl(d->currentUrl);
++    index = placesModel->closestItem(d->currentUrl);
++    selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
+ }
+ 
+ void KFilePlacesView::resizeEvent(QResizeEvent *event)
+@@ -359,19 +443,18 @@
+     QListView::rowsInserted(parent, start, end);
+     setUrl(d->currentUrl);
+ 
+-#if 0 // Disable until the model is fixed and sane again signals wise
+     KFilePlacesViewDelegate *delegate = dynamic_cast<KFilePlacesViewDelegate*>(itemDelegate());
++    KFilePlacesModel *placesModel = qobject_cast<KFilePlacesModel*>(model());
+ 
+     for (int i=start; i<=end; ++i) {
+-        QModelIndex index = model()->index(i, 0, parent);
++        QModelIndex index = placesModel->index(i, 0, parent);
+         delegate->addAppearingItem(index);
+     }
+ 
+     if (d->itemAppearTimeline.state()!=QTimeLine::Running) {
+-        delegate->setAppearingIconSize(1);
++        delegate->setAppearingItemProgress(0.0);
+         d->itemAppearTimeline.start();
+     }
+-#endif
+ }
+ 
+ QSize KFilePlacesView::sizeHint() const
+@@ -493,22 +576,7 @@
+ 
+ void KFilePlacesView::Private::_k_placeClicked(const QModelIndex &index)
+ {
+-    KFilePlacesModel *placesModel = qobject_cast<KFilePlacesModel*>(q->model());
+-
+-    if (placesModel==0) return;
+-
+-    lastClickedIndex = QPersistentModelIndex();
+-
+-    if (placesModel->setupNeeded(index)) {
+-        QObject::connect(placesModel, SIGNAL(setupDone(const QModelIndex &, bool)),
+-                         q, SLOT(_k_storageSetupDone(const QModelIndex &, bool)));
+-
+-        lastClickedIndex = index;
+-        placesModel->requestSetup(index);
+-        return;
+-    }
+-
+-    setCurrentIndex(index);
++    _k_placeActivated(index);
+ }
+ 
+ void KFilePlacesView::Private::_k_placeActivated(const QModelIndex &index)
+@@ -519,7 +587,7 @@
+ 
+     lastClickedIndex = QPersistentModelIndex();
+ 
+-    if (placesModel->isDevice(index)) {
++    if (placesModel->setupNeeded(index)) {
+         QObject::connect(placesModel, SIGNAL(setupDone(const QModelIndex &, bool)),
+                          q, SLOT(_k_storageSetupDone(const QModelIndex &, bool)));
+ 
+@@ -565,9 +633,21 @@
+ void KFilePlacesView::Private::_k_itemAppearUpdate(qreal value)
+ {
+     KFilePlacesViewDelegate *delegate = dynamic_cast<KFilePlacesViewDelegate*>(q->itemDelegate());
+-    int size = delegate->iconSize()*value;
+ 
+-    delegate->setAppearingIconSize(size);
++    delegate->setAppearingItemProgress(value);
++    q->scheduleDelayedItemsLayout();
++}
++
++void KFilePlacesView::Private::_k_itemDisappearUpdate(qreal value)
++{
++    KFilePlacesViewDelegate *delegate = dynamic_cast<KFilePlacesViewDelegate*>(q->itemDelegate());
++
++    delegate->setDisappearingItemProgress(value);
++
++    if (value>=1.0) {
++        updateHiddenRows();
++    }
++
+     q->scheduleDelayedItemsLayout();
+ }
+ 
+@@ -576,9 +656,9 @@
+     smoothItemResizing = true;
+ }
+ 
+-void KFilePlacesView::dataChanged(const QModelIndex &/*topLeft*/, const QModelIndex &/*bottomRight*/)
++void KFilePlacesView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
+ {
+-    d->updateHiddenRows();
++    QListView::dataChanged(topLeft, bottomRight);
+ }
+ 
+ #include "kfileplacesview.moc"
+--- /dev/null
++++ b/kfile/tests/kfileplacesmodeltest.cpp
+@@ -0,0 +1,605 @@
++/*  This file is part of the KDE project
++    Copyright (C) 2007 Kevin Ottens <ervin at kde.org>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License version 2
++    as published by the Free Software Foundation.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License
++    along with this program; if not, write to the Free Software
++    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++    02110-1301, USA.
++
++*/
++
++#include <QtCore/QObject>
++#include <QtDBus/QDBusInterface>
++
++#include <kbookmarkmanager.h>
++#include <kbookmark.h>
++#include <kdebug.h>
++#include <kfileplacesmodel.h>
++#include <kstandarddirs.h>
++#include <kuser.h>
++#include <solid/device.h>
++
++#include <qtest_kde.h>
++
++#include <stdlib.h>
++
++#ifndef TEST_DATA
++    #error "TEST_DATA not set. An XML file describing a computer is required for this test"
++#endif
++
++#ifdef Q_OS_WIN
++    //c:\ as root for windows
++    #define KDE_ROOT_PATH "C:\\"
++#else
++    #define KDE_ROOT_PATH "/"
++#endif
++
++class KFilePlacesModelTest : public QObject
++{
++    Q_OBJECT
++
++private Q_SLOTS:
++    void initTestCase();
++    void cleanupTestCase();
++
++    void testInitialState();
++    void testInitialList();
++    void testInternalBookmarksHaveIds();
++    void testHiding();
++    void testMove();
++    void testPlacesLifecycle();
++    void testDevicePlugging();
++    void testDragAndDrop();
++    void testDeviceSetupTeardown();
++
++private:
++    QDBusInterface *fakeManager();
++    QDBusInterface *fakeDevice(const QString &udi);
++
++    KFilePlacesModel *m_places;
++    KFilePlacesModel *m_places2; // To check that they always stay in sync
++                                 // actually supposed to work accross processes,
++                                 // but much harder to test
++
++    QMap<QString, QDBusInterface*> m_interfacesMap;
++};
++
++Q_DECLARE_METATYPE(QModelIndex)
++
++void KFilePlacesModelTest::initTestCase()
++{
++    // Ensure we'll have a clean bookmark file to start
++    const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
++    QFile f(file);
++    f.remove();
++
++    qRegisterMetaType<QModelIndex>();
++    setenv("SOLID_FAKEHW", TEST_DATA, 1);
++    m_places = new KFilePlacesModel();
++    m_places2 = new KFilePlacesModel();
++}
++
++void KFilePlacesModelTest::cleanupTestCase()
++{
++    delete m_places;
++    delete m_places2;
++    qDeleteAll(m_interfacesMap);
++}
++
++#define CHECK_PLACES_URLS(urls)                                              \
++    for (int row = 0; row < urls.size(); ++row) {                            \
++        QModelIndex index = m_places->index(row, 0);                         \
++                                                                             \
++        QCOMPARE(m_places->url(index).url(), KUrl(urls[row]).url());         \
++        QCOMPARE(m_places->data(index, KFilePlacesModel::UrlRole).toUrl(),   \
++                 QUrl(m_places->url(index)));                                \
++                                                                             \
++        index = m_places2->index(row, 0);                                    \
++                                                                             \
++        QCOMPARE(m_places2->url(index).url(), KUrl(urls[row]).url());        \
++        QCOMPARE(m_places2->data(index, KFilePlacesModel::UrlRole).toUrl(),  \
++                 QUrl(m_places2->url(index)));                               \
++    }                                                                        \
++                                                                             \
++    QCOMPARE(urls.size(), m_places->rowCount());                             \
++    QCOMPARE(urls.size(), m_places2->rowCount());
++
++
++QDBusInterface *KFilePlacesModelTest::fakeManager()
++{
++    return fakeDevice("/org/kde/solid/fakehw");
++}
++
++QDBusInterface *KFilePlacesModelTest::fakeDevice(const QString &udi)
++{
++    if (m_interfacesMap.contains(udi)) {
++        return m_interfacesMap[udi];
++    }
++
++    QDBusInterface *iface = new QDBusInterface(QDBusConnection::sessionBus().baseService(), udi);
++    m_interfacesMap[udi] = iface;
++
++    return iface;
++}
++
++void KFilePlacesModelTest::testInitialState()
++{
++    QCOMPARE(m_places->rowCount(), 4);
++    QCoreApplication::processEvents(); // Devices have a delayed loading
++    QCOMPARE(m_places->rowCount(), 7);
++}
++
++void KFilePlacesModelTest::testInitialList()
++{
++    QList<QString> urls;
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "trash:/"
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++
++    CHECK_PLACES_URLS(urls);
++}
++
++void KFilePlacesModelTest::testInternalBookmarksHaveIds()
++{
++    const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
++    KBookmarkManager *bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
++    KBookmarkGroup root = bookmarkManager->root();
++
++    // Verify every entry has an id or an udi
++    KBookmark bookmark = root.first();
++    while (!bookmark.isNull()) {
++        QVERIFY(!bookmark.metaDataItem("ID").isEmpty() || !bookmark.metaDataItem("UDI").isEmpty());
++        // It's mutualy exclusive though
++        QVERIFY(bookmark.metaDataItem("ID").isEmpty() || bookmark.metaDataItem("UDI").isEmpty());
++
++        bookmark = root.next(bookmark);
++    }
++
++
++    // Verify that adding a bookmark behind its back the model gives it an id
++    // (in real life it requires the user to modify the file by hand,
++    // unlikely but better safe than sorry).
++    // It induces a small race condition which means several ids will be
++    // successively set on the same bookmark but no big deal since it won't
++    // break the system
++    KBookmark foo = root.addBookmark("Foo", KUrl("file:/foo"), "red-folder");
++    QCOMPARE(foo.text(), QString("Foo"));
++    QVERIFY(foo.metaDataItem("ID").isEmpty());
++    bookmarkManager->emitChanged(root);
++    QCOMPARE(foo.text(), QString("Foo"));
++    QVERIFY(!foo.metaDataItem("ID").isEmpty());
++
++
++    // Verify that all the ids are different
++    bookmark = root.first();
++    QSet<QString> ids;
++    while (!bookmark.isNull()) {
++        QString id;
++        if (!bookmark.metaDataItem("UDI").isEmpty()) {
++            id = bookmark.metaDataItem("UDI");
++        } else {
++            id = bookmark.metaDataItem("ID");
++        }
++
++        QVERIFY2(!ids.contains(id), "Duplicated ID found!");
++        ids << id;
++        bookmark = root.next(bookmark);
++    }
++
++    // Cleanup foo
++    root.deleteBookmark(foo);
++    bookmarkManager->emitChanged(root);
++}
++
++void KFilePlacesModelTest::testHiding()
++{
++    // Verify that nothing is hidden
++    for (int row = 0; row < m_places->rowCount(); ++row) {
++        QModelIndex index = m_places->index(row, 0);
++        QVERIFY(!m_places->isHidden(index));
++    }
++
++    QModelIndex a = m_places->index(2, 0);
++    QModelIndex b = m_places->index(6, 0);
++
++    QList<QVariant> args;
++    QSignalSpy spy(m_places, SIGNAL(dataChanged(QModelIndex, QModelIndex)));
++
++    // Verify that hidden is taken into account and is not global
++    m_places->setPlaceHidden(a, true);
++    QVERIFY(m_places->isHidden(a));
++    QVERIFY(m_places->data(a, KFilePlacesModel::HiddenRole).toBool());
++    QVERIFY(!m_places->isHidden(b));
++    QVERIFY(!m_places->data(b, KFilePlacesModel::HiddenRole).toBool());
++    QCOMPARE(spy.count(), 1);
++    args = spy.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), a);
++    QCOMPARE(args.at(1).value<QModelIndex>(), a);
++
++    m_places->setPlaceHidden(b, true);
++    QVERIFY(m_places->isHidden(a));
++    QVERIFY(m_places->data(a, KFilePlacesModel::HiddenRole).toBool());
++    QVERIFY(m_places->isHidden(b));
++    QVERIFY(m_places->data(b, KFilePlacesModel::HiddenRole).toBool());
++    QCOMPARE(spy.count(), 1);
++    args = spy.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), b);
++    QCOMPARE(args.at(1).value<QModelIndex>(), b);
++
++    m_places->setPlaceHidden(a, false);
++    m_places->setPlaceHidden(b, false);
++    QVERIFY(!m_places->isHidden(a));
++    QVERIFY(!m_places->data(a, KFilePlacesModel::HiddenRole).toBool());
++    QVERIFY(!m_places->isHidden(b));
++    QVERIFY(!m_places->data(b, KFilePlacesModel::HiddenRole).toBool());
++    QCOMPARE(spy.count(), 2);
++    args = spy.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), a);
++    QCOMPARE(args.at(1).value<QModelIndex>(), a);
++    args = spy.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), b);
++    QCOMPARE(args.at(1).value<QModelIndex>(), b);
++}
++
++void KFilePlacesModelTest::testMove()
++{
++    QList<QVariant> args;
++    QSignalSpy spy_inserted(m_places, SIGNAL(rowsInserted(QModelIndex, int, int)));
++    QSignalSpy spy_removed(m_places, SIGNAL(rowsRemoved(QModelIndex, int, int)));
++
++    const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
++    KBookmarkManager *bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
++    KBookmarkGroup root = bookmarkManager->root();
++    KBookmark trash = m_places->bookmarkForIndex(m_places->index(3, 0));
++    KBookmark before_trash = m_places->bookmarkForIndex(m_places->index(2, 0));
++
++    // Move the trash at the end of the list
++    KBookmark last = root.first();
++    while (!root.next(last).isNull()) last = root.next(last);
++    root.moveBookmark(trash, last);
++    bookmarkManager->emitChanged(root);
++
++    QList<QString> urls;
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4" << "trash:/";
++
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 6);
++    QCOMPARE(args.at(2).toInt(), 6);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++
++    // Move the trash at the beginning of the list
++    root.moveBookmark(trash, KBookmark());
++    bookmarkManager->emitChanged(root);
++
++    urls.clear();
++    urls << "trash:/" << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 0);
++    QCOMPARE(args.at(2).toInt(), 0);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 7);
++    QCOMPARE(args.at(2).toInt(), 7);
++
++    // Move the trash in the list (at its original place)
++    root.moveBookmark(trash, before_trash);
++    bookmarkManager->emitChanged(root);
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "trash:/"
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 0);
++    QCOMPARE(args.at(2).toInt(), 0);
++}
++
++void KFilePlacesModelTest::testDragAndDrop()
++{
++    QList<QVariant> args;
++    QSignalSpy spy_inserted(m_places, SIGNAL(rowsInserted(QModelIndex, int, int)));
++    QSignalSpy spy_removed(m_places, SIGNAL(rowsRemoved(QModelIndex, int, int)));
++
++    // Move the trash at the end of the list
++    QModelIndexList indexes;
++    indexes << m_places->index(3, 0);
++    QMimeData *mimeData = m_places->mimeData(indexes);
++    QVERIFY(m_places->dropMimeData(mimeData, Qt::MoveAction, -1, 0, QModelIndex()));
++
++    QList<QString> urls;
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4" << "trash:/";
++    CHECK_PLACES_URLS(urls);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 6);
++    QCOMPARE(args.at(2).toInt(), 6);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++
++    // Move the trash at the beginning of the list
++    indexes.clear();
++    indexes << m_places->index(6, 0);
++    mimeData = m_places->mimeData(indexes);
++    QVERIFY(m_places->dropMimeData(mimeData, Qt::MoveAction, 0, 0, QModelIndex()));
++
++    urls.clear();
++    urls << "trash:/" << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 0);
++    QCOMPARE(args.at(2).toInt(), 0);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 7);
++    QCOMPARE(args.at(2).toInt(), 7);
++
++    // Move the trash in the list (at its original place)
++    indexes.clear();
++    indexes << m_places->index(0, 0);
++    mimeData = m_places->mimeData(indexes);
++    QVERIFY(m_places->dropMimeData(mimeData, Qt::MoveAction, 4, 0, QModelIndex()));
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "trash:/"
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 0);
++    QCOMPARE(args.at(2).toInt(), 0);
++
++    // Dropping on an item is not allowed
++    indexes.clear();
++    indexes << m_places->index(4, 0);
++    mimeData = m_places->mimeData(indexes);
++    QVERIFY(!m_places->dropMimeData(mimeData, Qt::MoveAction, -1, 0, m_places->index(2, 0)));
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 0);
++    QCOMPARE(spy_removed.count(), 0);
++}
++
++void KFilePlacesModelTest::testPlacesLifecycle()
++{
++    QList<QVariant> args;
++    QSignalSpy spy_inserted(m_places, SIGNAL(rowsInserted(QModelIndex, int, int)));
++    QSignalSpy spy_removed(m_places, SIGNAL(rowsRemoved(QModelIndex, int, int)));
++    QSignalSpy spy_changed(m_places, SIGNAL(dataChanged(QModelIndex, QModelIndex)));
++
++    m_places->addPlace("Foo", KUrl("/home/foo"));
++
++    QList<QString> urls;
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "trash:/"
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4" << "/home/foo";
++
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 7);
++    QCOMPARE(args.at(2).toInt(), 7);
++    QCOMPARE(spy_removed.count(), 0);
++
++
++    const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
++    KBookmarkManager *bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
++    KBookmarkGroup root = bookmarkManager->root();
++    KBookmark before_trash = m_places->bookmarkForIndex(m_places->index(2, 0));
++    KBookmark foo = m_places->bookmarkForIndex(m_places->index(7, 0));
++
++
++    root.moveBookmark(foo, before_trash);
++    bookmarkManager->emitChanged(root);
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "/home/foo"
++         << "trash:/" << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 8);
++    QCOMPARE(args.at(2).toInt(), 8);
++
++    m_places->editPlace(m_places->index(3, 0), "Foo", KUrl("/mnt/foo"));
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "/mnt/foo"
++         << "trash:/" << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 0);
++    QCOMPARE(spy_removed.count(), 0);
++    QCOMPARE(spy_changed.count(), 1);
++    args = spy_changed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), m_places->index(3, 0));
++    QCOMPARE(args.at(1).value<QModelIndex>(), m_places->index(3, 0));
++
++    m_places->removePlace(m_places->index(3, 0));
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "trash:/"
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 0);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++}
++
++void KFilePlacesModelTest::testDevicePlugging()
++{
++    QList<QVariant> args;
++    QSignalSpy spy_inserted(m_places, SIGNAL(rowsInserted(QModelIndex, int, int)));
++    QSignalSpy spy_removed(m_places, SIGNAL(rowsRemoved(QModelIndex, int, int)));
++
++    fakeManager()->call("unplug", "/org/kde/solid/fakehw/volume_part1_size_993284096");
++
++    QList<QString> urls;
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "trash:/"
++         << "/media/floppy0" << "/foreign";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 0);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 6);
++    QCOMPARE(args.at(2).toInt(), 6);
++
++    fakeManager()->call("plug", "/org/kde/solid/fakehw/volume_part1_size_993284096");
++
++    urls << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 6);
++    QCOMPARE(args.at(2).toInt(), 6);
++    QCOMPARE(spy_removed.count(), 0);
++
++    // Move the device in the list, and check that it memorizes the position across plug/unplug
++
++    const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
++    KBookmarkManager *bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
++    KBookmarkGroup root = bookmarkManager->root();
++    KBookmark before_trash = m_places->bookmarkForIndex(m_places->index(2, 0));
++    KBookmark device = root.first(); // The device we'll move is the last bookmark
++    while (!root.next(device).isNull()) device = root.next(device);
++
++
++    root.moveBookmark(device, before_trash);
++    bookmarkManager->emitChanged(root);
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "/media/XO-Y4"
++         << "trash:/" << "/media/floppy0" << "/foreign";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 7);
++    QCOMPARE(args.at(2).toInt(), 7);
++
++    fakeManager()->call("unplug", "/org/kde/solid/fakehw/volume_part1_size_993284096");
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH
++         << "trash:/" << "/media/floppy0" << "/foreign";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 0);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++
++    fakeManager()->call("plug", "/org/kde/solid/fakehw/volume_part1_size_993284096");
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "/media/XO-Y4"
++         << "trash:/" << "/media/floppy0" << "/foreign";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++    QCOMPARE(spy_removed.count(), 0);
++
++    KBookmark last = root.first();
++    while (!root.next(last).isNull()) last = root.next(last);
++    root.moveBookmark(device, last);
++    bookmarkManager->emitChanged(root);
++
++    urls.clear();
++    urls << KUser().homeDir() << "remote:/" << KDE_ROOT_PATH << "trash:/"
++         << "/media/floppy0" << "/foreign" << "/media/XO-Y4";
++    CHECK_PLACES_URLS(urls);
++    QCOMPARE(spy_inserted.count(), 1);
++    args = spy_inserted.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 6);
++    QCOMPARE(args.at(2).toInt(), 6);
++    QCOMPARE(spy_removed.count(), 1);
++    args = spy_removed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>(), QModelIndex());
++    QCOMPARE(args.at(1).toInt(), 3);
++    QCOMPARE(args.at(2).toInt(), 3);
++}
++
++void KFilePlacesModelTest::testDeviceSetupTeardown()
++{
++    QList<QVariant> args;
++    QSignalSpy spy_changed(m_places, SIGNAL(dataChanged(QModelIndex, QModelIndex)));
++
++    fakeDevice("/org/kde/solid/fakehw/volume_part1_size_993284096/StorageAccess")->call("teardown");
++
++    QCOMPARE(spy_changed.count(), 1);
++    args = spy_changed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>().row(), 6);
++    QCOMPARE(args.at(1).value<QModelIndex>().row(), 6);
++
++    fakeDevice("/org/kde/solid/fakehw/volume_part1_size_993284096/StorageAccess")->call("setup");
++
++    QCOMPARE(spy_changed.count(), 1);
++    args = spy_changed.takeFirst();
++    QCOMPARE(args.at(0).value<QModelIndex>().row(), 6);
++    QCOMPARE(args.at(1).value<QModelIndex>().row(), 6);
++}
++
++
++QTEST_KDEMAIN_CORE(KFilePlacesModelTest)
++
++#include "kfileplacesmodeltest.moc"
+--- a/kfile/tests/CMakeLists.txt
++++ b/kfile/tests/CMakeLists.txt
+@@ -19,3 +19,9 @@
+   kfiletreeviewtest
+ )
+ 
++add_definitions(-DTEST_DATA="\\"${CMAKE_SOURCE_DIR}/solid/solid/backends/fakehw/fakecomputer.xml\\"")
++
++KFILE_UNIT_TESTS(
++  kfileplacesmodeltest
++)
++
+--- a/kfile/kurlnavigatorbutton.cpp
++++ b/kfile/kurlnavigatorbutton.cpp
+@@ -22,6 +22,7 @@
+ #include <assert.h>
+ 
+ #include "kurlnavigator.h"
++#include "kdirsortfilterproxymodel.h"
+ 
+ #include <kio/job.h>
+ #include <kio/jobclasses.h>
+@@ -346,8 +347,14 @@
+ 
+         ++it;
+     }
++}
+ 
+-    m_subdirs.sort();
++/**
++ * Helper function for listJobFinished
++ */
++static bool naturalLessThan(const QString& s1, const QString& s2)
++{
++    return KDirSortFilterProxyModel::naturalCompare(s1.toLower(), s2.toLower()) < 0;
+ }
+ 
+ void KUrlNavigatorButton::listJobFinished(KJob* job)
+@@ -362,6 +369,7 @@
+         return;
+     }
+ 
++    qSort(m_subdirs.begin(), m_subdirs.end(), naturalLessThan);
+     setDisplayHintEnabled(PopupActiveHint, true);
+     update(); // ensure the button is drawn highlighted
+ 
+--- a/kfile/kfileplacesitem.cpp
++++ b/kfile/kfileplacesitem.cpp
+@@ -18,39 +18,180 @@
+ */
+ 
+ #include "kfileplacesitem_p.h"
++#include "kfileplacesmodel.h"
+ 
+-KFilePlacesItem::KFilePlacesItem()
+-    : m_isDevice(false)
++#include <QtCore/QDateTime>
++
++#include <kbookmarkmanager.h>
++#include <solid/storageaccess.h>
++#include <solid/storagevolume.h>
++
++
++
++KFilePlacesItem::KFilePlacesItem(KBookmarkManager *manager,
++                                 const QString &address,
++                                 const QString &udi)
++    : m_manager(manager)
+ {
++    m_bookmark = m_manager->findByAddress(address);
++
++    if (udi.isEmpty() && m_bookmark.metaDataItem("ID").isEmpty()) {
++        m_bookmark.setMetaDataItem("ID", generateNewId());
++    } else if (!udi.isEmpty()) {
++        Solid::Device dev(udi);
++        connect(dev.as<Solid::StorageAccess>(), SIGNAL(accessibilityChanged(bool)),
++                this, SLOT(onAccessibilityChanged()));
++    }
+ }
+ 
+ KFilePlacesItem::~KFilePlacesItem()
+ {
+ }
+ 
++QString KFilePlacesItem::id() const
++{
++    if (isDevice()) {
++        return bookmark().metaDataItem("UDI");
++    } else {
++        return bookmark().metaDataItem("ID");
++    }
++}
++
+ bool KFilePlacesItem::isDevice() const
+ {
+-    return m_isDevice;
++    return !bookmark().metaDataItem("UDI").isEmpty();
+ }
+ 
+-QString KFilePlacesItem::bookmarkAddress() const
++KBookmark KFilePlacesItem::bookmark() const
+ {
+-    return m_bookmarkAddress;
++    return m_bookmark;
+ }
+ 
+-void KFilePlacesItem::setBookmarkAddress(const QString &address)
++Solid::Device KFilePlacesItem::device() const
+ {
+-    m_bookmarkAddress = address;
++    return Solid::Device(bookmark().metaDataItem("UDI"));
+ }
+ 
+-QPersistentModelIndex KFilePlacesItem::deviceIndex() const
++QVariant KFilePlacesItem::data(int role) const
+ {
+-    return m_deviceIndex;
++    QVariant returnData;
++
++    if (isDevice() && role!=KFilePlacesModel::HiddenRole && role!=Qt::BackgroundRole) {
++        returnData = deviceData(role);
++    } else {
++        returnData = bookmarkData(role);
++    }
++
++    return returnData;
++}
++
++QVariant KFilePlacesItem::bookmarkData(int role) const
++{
++    KBookmark b = bookmark();
++
++    if (b.isNull()) return QVariant();
++
++    switch (role)
++    {
++    case Qt::DisplayRole:
++        return b.text();
++    case Qt::DecorationRole:
++        return KIcon(b.icon());
++    case Qt::BackgroundRole:
++        if (b.metaDataItem("IsHidden")=="true") {
++            return Qt::lightGray;
++        } else {
++            return QVariant();
++        }
++    case KFilePlacesModel::UrlRole:
++        return QUrl(b.url());
++    case KFilePlacesModel::SetupNeededRole:
++        return false;
++    case KFilePlacesModel::HiddenRole:
++        return b.metaDataItem("IsHidden")=="true";
++    default:
++        return QVariant();
++    }
++}
++
++QVariant KFilePlacesItem::deviceData(int role) const
++{
++    Solid::Device d = device();
++
++    if (d.isValid()) {
++        const Solid::StorageAccess *access = d.as<Solid::StorageAccess>();
++        const Solid::StorageVolume *volume = d.as<Solid::StorageVolume>();
++        QStringList overlays;
++
++        switch (role)
++        {
++        case Qt::DisplayRole:
++            return d.product();
++        case Qt::DecorationRole:
++            if (access->isAccessible()) {
++                overlays << "emblem-mounted";
++            } else {
++                overlays << QString(); // We have to guarantee the placement of the next emblem
++            }
++            if (volume && volume->usage()==Solid::StorageVolume::Encrypted) {
++                overlays << "security-high";
++            }
++            return KIcon(d.icon(), 0, overlays);
++        case KFilePlacesModel::UrlRole:
++            if (access) {
++                return QUrl(KUrl(access->filePath()));
++            } else {
++                return QVariant();
++            }
++        case KFilePlacesModel::SetupNeededRole:
++            if (access) {
++                return !access->isAccessible();
++            } else {
++                return QVariant();
++            }
++        default:
++            return QVariant();
++        }
++    } else {
++        return QVariant();
++    }
++}
++
++KBookmark KFilePlacesItem::createBookmark(KBookmarkManager *manager,
++                                          const QString &label,
++                                          const KUrl &url,
++                                          const QString &iconName)
++{
++    KBookmarkGroup root = manager->root();
++    KBookmark bookmark = root.addBookmark(label, url, iconName);
++    bookmark.setMetaDataItem("ID", generateNewId());
++
++    return bookmark;
++}
++
++KBookmark KFilePlacesItem::createDeviceBookmark(KBookmarkManager *manager,
++                                                const QString &udi)
++{
++    KBookmarkGroup root = manager->root();
++    KBookmark bookmark = root.createNewSeparator();
++    bookmark.setMetaDataItem("UDI", udi);
++
++    return bookmark;
++}
++
++QString KFilePlacesItem::generateNewId()
++{
++    static int count = 0;
++
++    return QString::number(count++);
++
++//    return QString::number(QDateTime::currentDateTime().toTime_t())
++//         + '/' + QString::number(qrand());
+ }
+ 
+-void KFilePlacesItem::setDeviceIndex(const QPersistentModelIndex &index)
++void KFilePlacesItem::onAccessibilityChanged()
+ {
+-    m_deviceIndex = index;
+-    m_isDevice = index.isValid();
++    emit deviceChanged(id());
+ }
+ 
++#include "kfileplacesitem_p.moc"
+--- a/kfile/kfileplacesmodel.cpp
++++ b/kfile/kfileplacesmodel.cpp
+@@ -21,6 +21,7 @@
+ #include "kfileplacesitem_p.h"
+ 
+ #include <QtCore/QMimeData>
++#include <QtCore/QTimer>
+ #include <QtGui/QColor>
+ #include <QtGui/QAction>
+ 
+@@ -33,37 +34,39 @@
+ #include <kmimetype.h>
+ #include <kdebug.h>
+ 
+-#include <kdevicelistmodel.h>
+ #include <kbookmarkmanager.h>
+ #include <kbookmark.h>
+ 
++#include <solid/devicenotifier.h>
+ #include <solid/storageaccess.h>
+ #include <solid/storagedrive.h>
+ #include <solid/storagevolume.h>
+ #include <solid/opticaldrive.h>
+ #include <solid/opticaldisc.h>
++#include <solid/predicate.h>
+ 
+ class KFilePlacesModel::Private
+ {
+ public:
+-    Private(KFilePlacesModel *self) : q(self), deviceModel(0), bookmarkManager(0) {}
++    Private(KFilePlacesModel *self) : q(self), bookmarkManager(0) {}
+ 
+ 
+     KFilePlacesModel *q;
+ 
+     QList<KFilePlacesItem*> items;
+-    QMap<QString, QPersistentModelIndex> availableDevices;
++    QSet<QString> availableDevices;
+     QMap<QObject*, QPersistentModelIndex> setupInProgress;
+ 
+-    KDeviceListModel *deviceModel;
++    Solid::Predicate predicate;
+     KBookmarkManager *bookmarkManager;
+ 
+-    QVariant bookmarkData(const QString &address, int role) const;
+-    QVariant deviceData(const QPersistentModelIndex &index, int role) const;
+     void reloadAndSignal();
++    QList<KFilePlacesItem *> loadBookmarkList();
+ 
+-    void _k_devicesInserted(const QModelIndex &parent, int start, int end);
+-    void _k_devicesRemoved(const QModelIndex &parent, int start, int end);
++    void _k_initDeviceList();
++    void _k_deviceAdded(const QString &udi);
++    void _k_deviceRemoved(const QString &udi);
++    void _k_deviceChanged(const QString &udi);
+     void _k_reloadBookmarks();
+     void _k_storageSetupDone(Solid::ErrorType error, QVariant errorData);
+     void _k_storageTeardownDone(Solid::ErrorType error, QVariant errorData);
+@@ -78,29 +81,34 @@
+     // Let's put some places in there if it's empty
+     KBookmarkGroup root = d->bookmarkManager->root();
+     if (root.first().isNull()) {
+-        root.addBookmark( i18n("Home"), KUrl(KUser().homeDir()), "user-home");
+-        root.addBookmark( i18n("Network"), KUrl("remote:/"), "network-local");
++        KFilePlacesItem::createBookmark(d->bookmarkManager,
++                                        i18n("Home"), KUrl(KUser().homeDir()), "user-home");
++        KFilePlacesItem::createBookmark(d->bookmarkManager,
++                                        i18n("Network"), KUrl("remote:/"), "network-local");
+ #ifdef Q_OS_WIN
+ 	//c:\ as root for windows
+-	root.addBookmark( i18n("Root"), KUrl("C:\\"), "folder-red");
++        KFilePlacesItem::createBookmark(d->bookmarkManager,
++                                        i18n("Root"), KUrl("C:\\"), "folder-red");
+ #else
+-        root.addBookmark( i18n("Root"), KUrl("/"), "folder-red");
++        KFilePlacesItem::createBookmark(d->bookmarkManager,
++                                        i18n("Root"), KUrl("/"), "folder-red");
+ #endif
+-        root.addBookmark( i18n("Trash"), KUrl("trash:/"), "user-trash");
++        KFilePlacesItem::createBookmark(d->bookmarkManager,
++                                        i18n("Trash"), KUrl("trash:/"), "user-trash");
+     }
+ 
+-    d->deviceModel = new KDeviceListModel("[[ StorageVolume.ignored == false AND [ StorageVolume.usage == 'FileSystem' OR StorageVolume.usage == 'Encrypted' ]]"
+-                                          " OR "
+-                                          "[ IS StorageAccess AND StorageDrive.driveType == 'Floppy' ]]", this);
++    d->predicate = Solid::Predicate::fromString(
++        "[[ StorageVolume.ignored == false AND [ StorageVolume.usage == 'FileSystem' OR StorageVolume.usage == 'Encrypted' ]]"
++        " OR "
++        "[ IS StorageAccess AND StorageDrive.driveType == 'Floppy' ]]");
+ 
+-    connect(d->deviceModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
+-            this, SLOT(_k_devicesInserted(const QModelIndex&, int, int)));
+-    connect(d->deviceModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)),
+-            this, SLOT(_k_devicesRemoved(const QModelIndex&, int, int)));
+     connect(d->bookmarkManager, SIGNAL(changed(const QString&, const QString&)),
+             this, SLOT(_k_reloadBookmarks()));
++    connect(d->bookmarkManager, SIGNAL(bookmarksChanged(const QString&)),
++            this, SLOT(_k_reloadBookmarks()));
+ 
+     d->_k_reloadBookmarks();
++    QTimer::singleShot(0, this, SLOT(_k_initDeviceList()));
+ }
+ 
+ KFilePlacesModel::~KFilePlacesModel()
+@@ -151,7 +159,7 @@
+     KFilePlacesItem *item = static_cast<KFilePlacesItem*>(index.internalPointer());
+ 
+     if (item->isDevice()) {
+-        return d->deviceModel->deviceForIndex(item->deviceIndex());
++        return item->device();
+     } else {
+         return Solid::Device();
+     }
+@@ -165,7 +173,7 @@
+     KFilePlacesItem *item = static_cast<KFilePlacesItem*>(index.internalPointer());
+ 
+     if (!item->isDevice()) {
+-        return d->bookmarkManager->findByAddress(item->bookmarkAddress());
++        return item->bookmark();
+     } else {
+         return KBookmark();
+     }
+@@ -179,14 +187,7 @@
+     QVariant returnData;
+ 
+     KFilePlacesItem *item = static_cast<KFilePlacesItem*>(index.internalPointer());
+-
+-    if (item->isDevice() && role!=HiddenRole && role!=Qt::BackgroundRole) {
+-        returnData = d->deviceData(item->deviceIndex(), role);
+-    } else {
+-        returnData = d->bookmarkData(item->bookmarkAddress(), role);
+-    }
+-
+-    return returnData;
++    return item->data(role);
+ }
+ 
+ QModelIndex KFilePlacesModel::index(int row, int column, const QModelIndex &parent) const
+@@ -230,13 +231,7 @@
+     // which covers the bigger range of the URL.
+     for (int row = 0; row<d->items.size(); ++row) {
+         KFilePlacesItem *item = d->items[row];
+-        KUrl itemUrl;
+-
+-        if (item->isDevice()) {
+-            itemUrl = KUrl(d->deviceData(item->deviceIndex(), UrlRole).toUrl());
+-        } else {
+-            itemUrl = KUrl(d->bookmarkData(item->bookmarkAddress(), UrlRole).toUrl());
+-        }
++        KUrl itemUrl = KUrl(item->data(UrlRole).toUrl());
+ 
+         if (itemUrl.isParentOf(url)) {
+             const int length = itemUrl.prettyUrl().length();
+@@ -253,146 +248,168 @@
+         return createIndex(foundRow, 0, d->items[foundRow]);
+ }
+ 
+-QVariant KFilePlacesModel::Private::bookmarkData(const QString &address, int role) const
++void KFilePlacesModel::Private::_k_initDeviceList()
+ {
+-    KBookmark bookmark = bookmarkManager->findByAddress(address);
++    Solid::DeviceNotifier *notifier = Solid::DeviceNotifier::instance();
+ 
+-    if (bookmark.isNull()) return QVariant();
++    connect(notifier, SIGNAL(deviceAdded(const QString&)),
++            q, SLOT(_k_deviceAdded(const QString&)));
++    connect(notifier, SIGNAL(deviceRemoved(const QString&)),
++            q, SLOT(_k_deviceRemoved(const QString&)));
+ 
+-    switch (role)
+-    {
+-    case Qt::DisplayRole:
+-        return bookmark.text();
+-    case Qt::DecorationRole:
+-        return KIcon(bookmark.icon());
+-    case Qt::BackgroundRole:
+-        if (bookmark.metaDataItem("IsHidden")=="true") {
+-            return Qt::lightGray;
+-        } else {
+-            return QVariant();
+-        }
+-    case UrlRole:
+-        return QUrl(bookmark.url());
+-    case SetupNeededRole:
+-        return false;
+-    case HiddenRole:
+-        return bookmark.metaDataItem("IsHidden")=="true";
+-    default:
+-        return QVariant();
++    const QList<Solid::Device> &deviceList = Solid::Device::listFromQuery(predicate);
++
++    foreach(Solid::Device device, deviceList) {
++        availableDevices << device.udi();
+     }
++
++    _k_reloadBookmarks();
+ }
+ 
+-QVariant KFilePlacesModel::Private::deviceData(const QPersistentModelIndex &index, int role) const
++void KFilePlacesModel::Private::_k_deviceAdded(const QString &udi)
+ {
+-    if (index.isValid()) {
+-        Solid::Device device = deviceModel->deviceForIndex(index);
+-        Solid::StorageAccess *access = 0;
+-
+-        if (device.isValid()) access = device.as<Solid::StorageAccess>();
+-
+-        switch (role)
+-        {
+-        case UrlRole:
+-            if (access) {
+-                return QUrl(KUrl(access->filePath()));
+-            } else {
+-                return QVariant();
+-            }
+-        case SetupNeededRole:
+-            if (access) {
+-                return !access->isAccessible();
+-            } else {
+-                return QVariant();
+-            }
+-        default:
+-            return deviceModel->data(index, role);
+-        }
+-    } else {
+-        return QVariant();
++    Solid::Device d(udi);
++
++    if (predicate.matches(d)) {
++        availableDevices << udi;
++        _k_reloadBookmarks();
+     }
+ }
+ 
+-void KFilePlacesModel::Private::_k_devicesInserted(const QModelIndex &parent, int start, int end)
++void KFilePlacesModel::Private::_k_deviceRemoved(const QString &udi)
+ {
+-    for (int i = start; i<=end; ++i) {
+-        QModelIndex index = parent.child(i, 0);
+-        QString udi = deviceModel->deviceForIndex(index).udi();
+-
+-        availableDevices[udi] = index;
++    if (availableDevices.contains(udi)) {
++        availableDevices.remove(udi);
++        _k_reloadBookmarks();
+     }
++}
+ 
+-    _k_reloadBookmarks();
++void KFilePlacesModel::Private::_k_deviceChanged(const QString &udi)
++{
++    if (availableDevices.contains(udi)) {
++        for (int row = 0; row<items.size(); ++row) {
++            Solid::Device dev = items.at(row)->device();
++            if (dev.isValid() && dev.udi()==udi) {
++                QModelIndex index = q->index(row, 0);
++                emit q->dataChanged(index, index);
++            }
++        }
++    }
+ }
+ 
+-void KFilePlacesModel::Private::_k_devicesRemoved(const QModelIndex &parent, int start, int end)
++void KFilePlacesModel::Private::_k_reloadBookmarks()
+ {
+-    for (int i = start; i<=end; ++i) {
+-        QModelIndex index = parent.child(i, 0);
+-        // Can't find by UDI since the device is already invalid.
+-        availableDevices.remove(availableDevices.key(index));
++    QList<KFilePlacesItem*> currentItems = loadBookmarkList();
++
++    QList<KFilePlacesItem*>::Iterator it_i = items.begin();
++    QList<KFilePlacesItem*>::Iterator it_c = currentItems.begin();
++
++    QList<KFilePlacesItem*>::Iterator end_i = items.end();
++    QList<KFilePlacesItem*>::Iterator end_c = currentItems.end();
++
++    while (it_i!=end_i || it_c!=end_c) {
++        if (it_i==end_i && it_c!=end_c) {
++            int row = items.count();
++
++            q->beginInsertRows(QModelIndex(), row, row);
++            it_i = items.insert(it_i, *it_c);
++            ++it_i;
++            it_c = currentItems.erase(it_c);
++
++            end_i = items.end();
++            end_c = currentItems.end();
++            q->endInsertRows();
++
++        } else if (it_i!=end_i && it_c==end_c) {
++            int row = items.indexOf(*it_i);
++
++            q->beginRemoveRows(QModelIndex(), row, row);
++            delete *it_i;
++            it_i = items.erase(it_i);
++
++            end_i = items.end();
++            end_c = currentItems.end();
++            q->endRemoveRows();
++
++        } else if ((*it_i)->id()==(*it_c)->id()) {
++            ++it_i;
++            ++it_c;
++        } else if ((*it_i)->id()!=(*it_c)->id()) {
++            int row = items.indexOf(*it_i);
++
++            if (it_i+1!=end_i && (*(it_i+1))->id()==(*it_c)->id()) { // if the next one matches, it's a remove
++                q->beginRemoveRows(QModelIndex(), row, row);
++                delete *it_i;
++                it_i = items.erase(it_i);
++
++                end_i = items.end();
++                end_c = currentItems.end();
++                q->endRemoveRows();
++            } else {
++                q->beginInsertRows(QModelIndex(), row, row);
++                it_i = items.insert(it_i, *it_c);
++                ++it_i;
++                it_c = currentItems.erase(it_c);
++
++                end_i = items.end();
++                end_c = currentItems.end();
++                q->endInsertRows();
++            }
++        }
+     }
+ 
+-    _k_reloadBookmarks();
++    qDeleteAll(currentItems);
++    currentItems.clear();
+ }
+ 
+-void KFilePlacesModel::Private::_k_reloadBookmarks()
++QList<KFilePlacesItem *> KFilePlacesModel::Private::loadBookmarkList()
+ {
+-    qDeleteAll(items);
+-    items.clear();
+-    q->reset();
++    QList<KFilePlacesItem*> items;
+ 
+     KBookmarkGroup root = bookmarkManager->root();
+     KBookmark bookmark = root.first();
+-    QMap<QString, QPersistentModelIndex> devices = availableDevices;
++    QSet<QString> devices = availableDevices;
+ 
+     while (!bookmark.isNull()) {
+         QString udi = bookmark.metaDataItem("UDI");
+         QString appName = bookmark.metaDataItem("OnlyInApp");
+-        QPersistentModelIndex index = devices.take(udi);
++        bool deviceAvailable = devices.remove(udi);
+ 
+         bool allowedHere = appName.isEmpty() || (appName==KGlobal::mainComponent().componentName());
+ 
+-        if ((udi.isEmpty() && allowedHere) || index.isValid()) {
+-            q->beginInsertRows(QModelIndex(), items.size(), items.size());
+-
+-            KFilePlacesItem *item = new KFilePlacesItem();
+-            item->setBookmarkAddress(bookmark.address());
+-            if (index.isValid()) {
+-                item->setDeviceIndex(index);
++        if ((udi.isEmpty() && allowedHere) || deviceAvailable) {
++            KFilePlacesItem *item;
++            if (deviceAvailable) {
++                item = new KFilePlacesItem(bookmarkManager, bookmark.address(), udi);
++                connect(item, SIGNAL(deviceChanged(const QString&)),
++                        q, SLOT(_k_deviceChanged(const QString&)));
+                 // TODO: Update bookmark internal element
++            } else {
++                item = new KFilePlacesItem(bookmarkManager, bookmark.address());
+             }
+             items << item;
+-
+-            q->endInsertRows();
+         }
+ 
+         bookmark = root.next(bookmark);
+     }
+ 
+     // Add bookmarks for the remaining devices, they were previously unknown
+-    foreach (QString udi, devices.keys()) {
+-        bookmark = root.createNewSeparator();
+-        bookmark.setMetaDataItem("UDI", udi);
+-
+-        q->beginInsertRows(QModelIndex(), items.size(), items.size());
+-
+-        KFilePlacesItem *item = new KFilePlacesItem();
+-        item->setBookmarkAddress(bookmark.address());
+-        item->setDeviceIndex(devices[udi]);
++    foreach (QString udi, devices) {
++        bookmark = KFilePlacesItem::createDeviceBookmark(bookmarkManager, udi);
++
++        KFilePlacesItem *item = new KFilePlacesItem(bookmarkManager,
++                                                    bookmark.address(), udi);
++        connect(item, SIGNAL(deviceChanged(const QString&)),
++                q, SLOT(_k_deviceChanged(const QString&)));
+         // TODO: Update bookmark internal element
+         items << item;
+-
+-        q->endInsertRows();
+     }
++
++    return items;
+ }
+ 
+ void KFilePlacesModel::Private::reloadAndSignal()
+ {
+-    bool signalsBlocked = q->blockSignals(true); // Avoid too much signaling...
+-    // We reload here to avoid a transitional
+-    // period where devices are seen as separators
+-    _k_reloadBookmarks();
+-    q->blockSignals(signalsBlocked);
+     bookmarkManager->emitChanged(bookmarkManager->root()); // ... we'll get relisted anyway
+ }
+ 
+@@ -475,14 +492,14 @@
+         // The dropped item is moved or added to the last position
+ 
+         KFilePlacesItem *lastItem = d->items.last();
+-        afterBookmark = d->bookmarkManager->findByAddress(lastItem->bookmarkAddress());
++        afterBookmark = lastItem->bookmark();
+ 
+     } else {
+         // The dropped item is moved or added before position 'row', ie after position 'row-1'
+ 
+         if (row>0) {
+             KFilePlacesItem *afterItem = d->items[row-1];
+-            afterBookmark = d->bookmarkManager->findByAddress(afterItem->bookmarkAddress());
++            afterBookmark = afterItem->bookmark();
+         }
+     }
+ 
+@@ -495,7 +512,7 @@
+         stream >> itemRow;
+ 
+         KFilePlacesItem *item = d->items[itemRow];
+-        KBookmark bookmark = d->bookmarkManager->findByAddress(item->bookmarkAddress());
++        KBookmark bookmark = item->bookmark();
+ 
+         d->bookmarkManager->root().moveBookmark(bookmark, afterBookmark);
+ 
+@@ -513,8 +530,9 @@
+                 continue;
+             }
+ 
+-            KBookmark bookmark = group.addBookmark(url.fileName(), url,
+-                                                   mimetype->iconName());
++            KBookmark bookmark = KFilePlacesItem::createBookmark(d->bookmarkManager,
++                                                                 url.fileName(), url,
++                                                                 mimetype->iconName());
+             group.moveBookmark(bookmark, afterBookmark);
+             afterBookmark = bookmark;
+         }
+@@ -533,7 +551,8 @@
+ void KFilePlacesModel::addPlace(const QString &text, const KUrl &url,
+                                 const QString &iconName, const QString &appName)
+ {
+-    KBookmark bookmark = d->bookmarkManager->root().addBookmark(text, url, iconName);
++    KBookmark bookmark = KFilePlacesItem::createBookmark(d->bookmarkManager,
++                                                         text, url, iconName);
+ 
+     if (!appName.isEmpty()) {
+         bookmark.setMetaDataItem("OnlyInApp", appName);
+@@ -551,7 +570,7 @@
+ 
+     if (item->isDevice()) return;
+ 
+-    KBookmark bookmark = d->bookmarkManager->findByAddress(item->bookmarkAddress());
++    KBookmark bookmark = item->bookmark();
+ 
+     if (bookmark.isNull()) return;
+ 
+@@ -561,6 +580,7 @@
+     bookmark.setMetaDataItem("OnlyInApp", appName);
+ 
+     d->reloadAndSignal();
++    emit dataChanged(index, index);
+ }
+ 
+ void KFilePlacesModel::removePlace(const QModelIndex &index) const
+@@ -571,7 +591,7 @@
+ 
+     if (item->isDevice()) return;
+ 
+-    KBookmark bookmark = d->bookmarkManager->findByAddress(item->bookmarkAddress());
++    KBookmark bookmark = item->bookmark();
+ 
+     if (bookmark.isNull()) return;
+ 
+@@ -585,14 +605,13 @@
+ 
+     KFilePlacesItem *item = static_cast<KFilePlacesItem*>(index.internalPointer());
+ 
+-    KBookmark bookmark = d->bookmarkManager->findByAddress(item->bookmarkAddress());
++    KBookmark bookmark = item->bookmark();
+ 
+     if (bookmark.isNull()) return;
+ 
+     bookmark.setMetaDataItem("IsHidden", (hidden ? "true" : "false"));
+ 
+-    d->bookmarkManager->save();
+-
++    d->reloadAndSignal();
+     emit dataChanged(index, index);
+ }
+ 
+--- a/kfile/kfilefiltercombo.cpp
++++ b/kfile/kfilefiltercombo.cpp
+@@ -130,7 +130,7 @@
+ 
+ void KFileFilterCombo::setCurrentFilter( const QString& filter )
+ {
+-    setEditText( filter );
++    setCurrentIndex(d->m_filters.indexOf(filter));
+     filterChanged();
+ }
+ 
+--- a/kfile/kfileplacesview.h
++++ b/kfile/kfileplacesview.h
+@@ -62,6 +62,7 @@
+     Q_PRIVATE_SLOT(d, void _k_storageSetupDone(const QModelIndex &, bool))
+     Q_PRIVATE_SLOT(d, void _k_adaptItemsUpdate(qreal))
+     Q_PRIVATE_SLOT(d, void _k_itemAppearUpdate(qreal))
++    Q_PRIVATE_SLOT(d, void _k_itemDisappearUpdate(qreal))
+     Q_PRIVATE_SLOT(d, void _k_enableSmoothItemResizing())
+ 
+     class Private;
+--- a/kfile/kfileplacesitem_p.h
++++ b/kfile/kfileplacesitem_p.h
+@@ -20,26 +20,48 @@
+ #define KFILEPLACESITEM_P_H
+ 
+ 
++#include <QtCore/QObject>
+ #include <QtCore/QModelIndex>
++#include <kbookmark.h>
++#include <solid/device.h>
+ 
+-class KFilePlacesItem
++class KFilePlacesItem : public QObject
+ {
++    Q_OBJECT
+ public:
+-    KFilePlacesItem();
++    KFilePlacesItem(KBookmarkManager *manager,
++                    const QString &address,
++                    const QString &udi = QString());
+     ~KFilePlacesItem();
+ 
++    QString id() const;
++
+     bool isDevice() const;
++    KBookmark bookmark() const;
++    Solid::Device device() const;
++    QVariant data(int role) const;
++
++    static KBookmark createBookmark(KBookmarkManager *manager,
++                                    const QString &label,
++                                    const KUrl &url,
++                                    const QString &iconName);
++    static KBookmark createDeviceBookmark(KBookmarkManager *manager,
++                                          const QString &udi);
+ 
+-    QString bookmarkAddress() const;
+-    void setBookmarkAddress(const QString &address);
++Q_SIGNALS:
++    void deviceChanged(const QString &udi);
+ 
+-    QPersistentModelIndex deviceIndex() const;
+-    void setDeviceIndex(const QPersistentModelIndex &index);
++private Q_SLOTS:
++    void onAccessibilityChanged();
+ 
+ private:
+-    bool m_isDevice;
+-    QString m_bookmarkAddress;
+-    QPersistentModelIndex m_deviceIndex;
++    QVariant bookmarkData(int role) const;
++    QVariant deviceData(int role) const;
++
++    static QString generateNewId();
++
++    KBookmarkManager *m_manager;
++    KBookmark m_bookmark;
+ };
+ 
+ #endif
+--- a/kdoctools/kio_help.h
++++ b/kdoctools/kio_help.h
+@@ -1,6 +1,27 @@
+ #ifndef __help_h__
+ #define __help_h__
+ 
++/* This file is part of the KDE libraries
++   Copyright (C) 2000 Matthias Hoelzer-Kluepfel <hoelzer at kde.org>
++   Copyright (C) 2001 Stephan Kulow <coolo at kde.org>
++   Copyright (C) 2003 Cornelius Schumacher <schumacher at kde.org>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License as published by the Free Software Foundation; either
++   version 2 of the License, or (at your option) any later version.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++
+ 
+ #include <sys/types.h>
+ #include <sys/stat.h>
+--- a/kdoctools/genshortcutents.cpp
++++ b/kdoctools/genshortcutents.cpp
+@@ -34,60 +34,7 @@
+ #include <QtCore/QTextStream>
+ #include <QtCore/QStringList>
+ 
+-static KStandardShortcut::StandardShortcut accelerators[] = {
+-	KStandardShortcut::Open,
+-	KStandardShortcut::New,
+-	KStandardShortcut::Close,
+-	KStandardShortcut::Save,
+-	KStandardShortcut::Print,
+-	KStandardShortcut::Quit,
+-	KStandardShortcut::Undo,
+-	KStandardShortcut::Redo,
+-	KStandardShortcut::Cut,
+-	KStandardShortcut::Copy,
+-	KStandardShortcut::Paste,
+-	KStandardShortcut::SelectAll,
+-	KStandardShortcut::Deselect,
+-	KStandardShortcut::DeleteWordBack,
+-	KStandardShortcut::DeleteWordForward,
+-	KStandardShortcut::Find,
+-	KStandardShortcut::FindNext,
+-	KStandardShortcut::FindPrev,
+-	KStandardShortcut::Replace,
+-	KStandardShortcut::Home,
+-	KStandardShortcut::End,
+-	KStandardShortcut::Prior,
+-	KStandardShortcut::Next,
+-	KStandardShortcut::GotoLine,
+-	KStandardShortcut::AddBookmark,
+-	KStandardShortcut::ZoomIn,
+-	KStandardShortcut::ZoomOut,
+-	KStandardShortcut::Up,
+-	KStandardShortcut::Back,
+-	KStandardShortcut::Forward,
+-	KStandardShortcut::Reload,
+-	KStandardShortcut::PopupMenuContext,
+-	KStandardShortcut::ShowMenubar,
+-	KStandardShortcut::Help,
+-	KStandardShortcut::WhatsThis,
+-	KStandardShortcut::TextCompletion,
+-	KStandardShortcut::PrevCompletion,
+-	KStandardShortcut::NextCompletion,
+-	KStandardShortcut::SubstringCompletion,
+-	KStandardShortcut::RotateUp,
+-	KStandardShortcut::RotateDown,
+-	KStandardShortcut::TabNext,
+-	KStandardShortcut::TabPrev,
+-	KStandardShortcut::FullScreen,
+-	KStandardShortcut::BackwardWord,
+-	KStandardShortcut::ForwardWord,
+-	KStandardShortcut::BeginningOfLine,
+-	KStandardShortcut::EndOfLine,
+-	KStandardShortcut::PasteSelection
+-};
+-static const unsigned int numAccelerators = sizeof( accelerators ) / sizeof( accelerators[ 0 ] );
+-
+-QString keyAsMarkup( const QString &key )
++static QString keyAsMarkup( const QString &key )
+ {
+ 	if ( key == "Alt" || key == "Ctrl" || key == "Enter" || key == "Esc" ||
+ 	     key == "Shift" || key == "Tab" ) {
+@@ -108,7 +55,7 @@
+ 	return QString("<keycap>" + key + "</keycap>");
+ }
+ 
+-QString entityForAccel( KStandardShortcut::StandardShortcut accel )
++static QString entityForAccel( KStandardShortcut::StandardShortcut accel )
+ {
+ 	QString markup = "<!ENTITY KeyCombo_";
+ 
+@@ -179,6 +126,9 @@
+ 		case KStandardShortcut::Home:
+ 			markup += "Home";
+ 			break;
++		case KStandardShortcut::Begin:
++			markup += "Begin";
++			break;
+ 		case KStandardShortcut::End:
+ 			markup += "End";
+ 			break;
+@@ -266,6 +216,8 @@
+ 		case KStandardShortcut::PasteSelection:
+ 			markup += "PastSelection";
+ 			break;
++		case KStandardShortcut::StandardShortcutCount:
++			break;
+ 	}
+ 
+ 	markup += "\t\"";
+@@ -329,8 +281,8 @@
+ 	       << "     overwritten as soon as the file is regenerated. -->\n";
+ 	stream << "\n";
+ 
+-	for ( unsigned int i = 0; i < numAccelerators; ++i ) {
+-		stream << entityForAccel( accelerators[ i ] ) << "\n";
++	for ( unsigned int i = 0; i < KStandardShortcut::StandardShortcutCount; ++i ) {
++            stream << entityForAccel( static_cast<KStandardShortcut::StandardShortcut>(i)  ) << "\n";
+ 	}
+ }
+ 
+--- a/kdoctools/customization/ja/entities/underGPL.docbook
++++ b/kdoctools/customization/ja/entities/underGPL.docbook
+@@ -1,2 +1,2 @@
+-<para>This program is licensed under the terms of the <ulink
+-url="common/gpl-translated.html">GNU General Public License</ulink>.</para>
++<para>このプログラムのライセンスは <ulink
++url="common/gpl-translated.html">GNU General Public License </ulink> です。</para>
+--- a/kdoctools/customization/ja/entities/underArtisticLicense.docbook
++++ b/kdoctools/customization/ja/entities/underArtisticLicense.docbook
+@@ -1,2 +1 @@
+-<para>This program is licensed under the terms of the <ulink
+-url="common/artistic-license.html">Artistic License</ulink>.</para>
++<para>このプログラムのライセンスは <ulink url="common/artistic-license.html">Artistic License</ulink> です。</para>
+--- a/kdoctools/customization/ja/entities/underFDL.docbook
++++ b/kdoctools/customization/ja/entities/underFDL.docbook
+@@ -1,3 +1,3 @@
+-<para id="gnu-fdl" xreflabel="the section entitled &quot;GNU Free Documentation License&quot;">This documentation is licensed under the terms of the <ulink
++<para id="gnu-fdl" xreflabel="the section entitled &quot;GNU Free Documentation License&quot;">このドキュメンテーションのライセンスは <ulink
+ url="common/fdl-license.html">GNU Free Documentation
+-License</ulink>.</para>
++License</ulink> です。</para>
+--- a/kdoctools/customization/ja/entities/underBSDLicense.docbook
++++ b/kdoctools/customization/ja/entities/underBSDLicense.docbook
+@@ -1,2 +1 @@
+-<para>This program is licensed under the terms of the <ulink
+-url="common/bsd-license.html">BSD License</ulink>.</para>
++<para>このプログラムのライセンスは <ulink url="common/bsd-license.html">BSD License</ulink> です。</para>
+--- a/kdoctools/customization/ja/entities/help-menu.docbook
++++ b/kdoctools/customization/ja/entities/help-menu.docbook
+@@ -1,58 +1,93 @@
+ <variablelist>
+ <varlistentry>
+ <term>
+-<menuchoice>
+-<shortcut>
+-<keycombo action="simul"><keycap>F1</keycap></keycombo>
+-</shortcut>
+-<guimenu>Help</guimenu>
+-<guimenuitem>Contents...</guimenuitem>
+-</menuchoice>
++<menuchoice
++><shortcut
++> <keycombo action="simul"
++><keycap
++>F1</keycap
++></keycombo
++> </shortcut
++> <guimenu
++>ヘルプ</guimenu
++> <guimenuitem
++>&kappname; ハンドブック</guimenuitem
++> </menuchoice>
+ </term>
+-<listitem><para><action>Invokes the KDE Help system</action> starting at the
+-&kappname; help pages. (this document).</para></listitem>
++<listitem
++><para
++>KDE のヘルプシステムを起動して &kappname; のヘルプページ (このドキュメント) を開きます。</para
++></listitem>
+ </varlistentry>
+ 
+ <varlistentry>
+-<term><menuchoice>
+-<shortcut>
+-<keycombo action="simul">&Shift;<keycap>F1</keycap></keycombo>
+-</shortcut>
+-<guimenu>Help</guimenu>
+-<guimenuitem>What's This?</guimenuitem>
+-</menuchoice>
++<term
++><menuchoice
++><shortcut
++> <keycombo action="simul"
++>&Shift;<keycap
++>F1</keycap
++></keycombo
++> </shortcut
++> <guimenu
++>ヘルプ</guimenu
++> <guimenuitem
++>これは何?</guimenuitem
++> </menuchoice>
+ </term>
+-<listitem><para><action>Changes the mouse cursor to a combination arrow and
+-question mark.</action>  Clicking on items within &kappname; will open a help
+-window (if one exists for the particular item) explaining the item's
+-function.</para></listitem>
++<listitem
++><para
++>これを選択するとマウスカーソルの形が矢印とクエスチョンマークに変わります。その状態で &kappname; のユーザインターフェースの要素をクリックすると、それぞれの機能を説明するヘルプウィンドウが表示されます (その要素にヘルプがある場合のみ)。</para
++></listitem>
+ </varlistentry>
+ 
+ 
+ <varlistentry>
+-<term><menuchoice>
+-<guimenu>Help</guimenu>
+-<guimenuitem>Report Bug...</guimenuitem>
+-</menuchoice></term>
+-<listitem><para><action>Opens the Bug report dialog</action> where you can
+-report a bug or request a <quote>wishlist</quote> feature.</para></listitem>
++<term
++><menuchoice
++><guimenu
++>ヘルプ</guimenu
++> <guimenuitem
++>バグを報告...</guimenuitem
++> </menuchoice
++></term>
++<listitem
++><para
++>バグレポート用のダイアログを開きます。これを使ってプログラムの不具合を報告したり、要望を送ったりすることができます。</para
++></listitem>
+ </varlistentry>
+ 
+ <varlistentry>
+-<term><menuchoice>
+-<guimenu>Help</guimenu>
+-<guimenuitem>About &kappname;</guimenuitem>
+-</menuchoice></term>
+-<listitem><para><action>This will display version and author
+-information.</action></para></listitem>
++<term
++><menuchoice
++><guimenu
++>ヘルプ</guimenu
++> <guimenuitem
++>&kappname; について</guimenuitem
++> </menuchoice
++></term>
++<listitem
++><para
++><action
++>プログラムのバージョンと作者を表示します。</action
++></para
++></listitem>
+ </varlistentry>
+ 
+ <varlistentry>
+-<term><menuchoice>
+-<guimenu>Help</guimenu>
+-<guimenuitem>About KDE</guimenuitem>
+-</menuchoice></term>
+-<listitem><para><action>This displays the KDE version and other basic
+-information.</action></para></listitem>
++<term
++><menuchoice
++><guimenu
++>ヘルプ</guimenu
++> <guimenuitem
++>KDE について</guimenuitem
++> </menuchoice
++></term>
++<listitem
++><para
++><action
++>KDE のバージョンと基本的な情報を表示します。</action
++></para
++></listitem>
+ </varlistentry>
+ </variablelist>
+--- a/kdoctools/customization/ja/entities/underX11License.docbook
++++ b/kdoctools/customization/ja/entities/underX11License.docbook
+@@ -1,2 +1 @@
+-<para>This program is licensed under the terms of the <ulink
+-url="common/x11-license.html">X11 License</ulink>.</para>
++<para>このプログラムのライセンスは <ulink url="common/x11-license.html">X11 License</ulink> です。</para>
+--- a/kdoctools/customization/ja/entities/install-compile.docbook
++++ b/kdoctools/customization/ja/entities/install-compile.docbook
+@@ -1,12 +1,8 @@
+-<para>In order to compile and install &kappname; on your system, type the
+-following in the base directory of the &kappname; distribution:</para>
++<para>&kappname; をコンパイルしてインストールするには、&kappname; ディストリビューションのベースディレクトリで次のようにタイプします。</para>
+ 
+ <screen><prompt>%</prompt> <userinput><command>./configure</command></userinput>
+ <prompt>%</prompt> <userinput><command>make</command></userinput>
+ <prompt>%</prompt> <userinput><command>make</command> install</userinput>
+ </screen>
+ 
+-<para>Since &kappname; uses <command>autoconf</command> and
+-<command>automake</command> you should have no trouble compiling it. Should you
+-run into problems please report them to the &kde; mailing lists.</para>
+-
++<para>&kappname; は <command>autoconf</command> と <command>automake</command> を使っているので容易にコンパイルできるはずです。問題にぶつかった場合は、&kde; のメーリングリストに報告してください。</para>
+--- a/kdoctools/customization/ja/entities/install-intro.docbook
++++ b/kdoctools/customization/ja/entities/install-intro.docbook
+@@ -1,6 +1,4 @@
+ <!-- requires that packagename is defined in the documentation prologue -->
+-<para>&kappname; is part of the &kde; project &kde-http;.</para>
++<para>&kappname; は &kde; プロジェクト &kde-http; の一部です。</para>
+ 
+-<para>&kappname; can be found in the &package; package on 
+-&kde-ftp;, the main &FTP; site of the &kde;
+-project.</para>
++<para>&kappname; は &kde; プロジェクトのメイン &FTP; サイトである &kde-ftp; にある &package; パッケージに含まれています。</para>
+--- a/kdoctools/customization/fr/user.entities
++++ b/kdoctools/customization/fr/user.entities
+@@ -86,6 +86,9 @@
+ <!ENTITY traducteurGuillaumeDuweltzRebert     '<othercredit role="translator"><firstname>Guillaume</firstname><surname>Duweltz</surname><affiliation><address><email>gduwelz-rebert.cs at clearstream.com</email></address></affiliation><contrib>Traduction française&nbsp;</contrib></othercredit>'>
+ <!ENTITY relecteurGuillaumeDuweltzRebert      '<othercredit role="relecteur"><firstname>Guillaume</firstname><surname>Duweltz</surname><affiliation><address><email>gduwelz-rebert.cs at clearstream.com</email></address></affiliation><contrib>Relecture de la documentation française&nbsp;</contrib></othercredit>'>
+ 
++<!ENTITY traducteurGuillaumeFahrner     '<othercredit role="translator"><firstname>Guillaume</firstname><surname>Fahrner</surname><affiliation><address><email>Admin at SecurityHack.Org</email></address></affiliation><contrib>Traduction française&nbsp;</contrib></othercredit>'>
++<!ENTITY relecteurGuillaumeFahrner      '<othercredit role="relecteur"><firstname>Guillaume</firstname><surname>Fahrner</surname><affiliation><address><email>Admin at SecurityHack.Org</email></address></affiliation><contrib>Relecture de la documentation française&nbsp;</contrib></othercredit>'>
++
+ <!ENTITY traducteurSamiFantar    '<othercredit role="translator"><firstname>Sami</firstname><surname>Fantar</surname><affiliation><address><email>sami.fantar at laposte.net</email></address></affiliation><contrib>Traduction française&nbsp;</contrib></othercredit>'>
+ <!ENTITY relecteurSamiFantar     '<othercredit role="reviewer"><firstname>Sami</firstname><surname>Fantar</surname><affiliation><address><email>sami.fantar at laposte.net</email></address></affiliation><contrib>Relecture de la documentation française&nbsp;</contrib></othercredit>'>
+ 
+@@ -243,6 +246,7 @@
+ <!ENTITY NicolasDupuis     'Nicolas Dupuis <email>ndupuis at tiscali.be</email>'>
+ <!ENTITY HeleneDuwelzRebert 'Hélène Duwelz-Rebert <email>helened at herbalife.com</email>'>
+ <!ENTITY GuillaumeDuwelzRebert 'Guillaume Duwelz-Rebert <email>gduwelz-rebert.cs at clearstream.com</email>'>
++<!ENTITY GuillaumeFahrner 'Guillaume Fahrner <email>Admin at SecurityHack.Org</email>'>
+ <!ENTITY SamiFantar          'Sami Fantar <email>sami.fantar at laposte.net</email>'>
+ <!ENTITY NilsSergioFernandez 'Nils Sergio Fernandez Rönningen <email>nilsfernandez at yahoo.fr</email>'>
+ <!ENTITY JeanJacquesFinazzi 'Jean-Jacques Finazzi <email>jj.finazzi at club.fr</email>'>
+--- a/kdoctools/customization/entities/general.entities
++++ b/kdoctools/customization/entities/general.entities
+@@ -119,7 +119,8 @@
+ <!ENTITY artswrapper	"<application>artswrapper</application>">
+ <!ENTITY ATAPI	"<acronym>ATAPI</acronym>">
+ <!ENTITY atlantik	"<application>Atlantik</application>">
+-<!ENTITY blinken	"<application>blinKen</application>">
++<!ENTITY blinken	"<application>Blinken</application>">
++<!ENTITY bovo	"<application>Bovo</application>">
+ <!ENTITY catalogmanager	"<application>Catalog Manager</application>">
+ <!ENTITY CD	"<acronym>CD</acronym>">
+ <!ENTITY CDE	"<acronym>CDE</acronym>">
+@@ -257,6 +258,7 @@
+ <!ENTITY kmouth "<application>KMouth</application>">
+ <!ENTITY kmousetool "<application>KMouseTool</application>">
+ <!ENTITY knetattach     "<application>KNetAttach</application>">
++<!ENTITY knetwalk       "<application>KNetWalk</application>">
+ <!ENTITY knewsticker	"<application>KNewsTicker</application>">
+ <!ENTITY knode	"<application>KNode</application>">
+ <!ENTITY knotes	"<application>KNotes</application>">
+@@ -371,6 +373,7 @@
+ <!ENTITY Netscape	'<trademark class="registered">Netscape</trademark>'>
+ <!ENTITY NeXTSTEP	"<trademark>NeXTSTEP</trademark>">
+ <!ENTITY noatun	"<application>Noatun</application>">
++<!ENTITY okular	"<application>okular</application>">
+ <!ENTITY PalmOS	'<trademark class="registered">Palm OS</trademark>'>
+ <!ENTITY PalmPilot	"<productname><trademark>PalmPilot</trademark></productname>">
+ <!ENTITY parley	"<application>Parley</application>">
+--- a/kdoctools/customization/entities/contributor.entities
++++ b/kdoctools/customization/entities/contributor.entities
+@@ -66,6 +66,8 @@
+ <!ENTITY Stephan.Binner.mail '<email>binner at kde.org</email>'>
+ <!ENTITY Eric.Bischoff '<personname><firstname>Éric</firstname><surname>Bischoff</surname></personname>'>
+ <!ENTITY Eric.Bischoff.mail '<email>e.bischoff at noos.fr</email>'>
++<!ENTITY Aron.Bostrom '<personname><firstname>Aron</firstname><surname>Boström</surname></personname>'>
++<!ENTITY Aron.Bostrom.mail '<email>aron.bostrom at gmail.com</email>'>
+ <!ENTITY Michael.Brade '<personname><firstname>Michael</firstname><surname>Brade</surname></personname>'>
+ <!ENTITY Michael.Brade.mail '<email>brade at kde.org</email>'>
+ <!ENTITY Preston.Brown '<personname><firstname>Preston</firstname><surname>Brown</surname></personname>'>
+--- a/kdoctools/kio_help.cpp
++++ b/kdoctools/kio_help.cpp
+@@ -1,3 +1,25 @@
++/* This file is part of the KDE libraries
++   Copyright (C) 2000 Matthias Hoelzer-Kluepfel <hoelzer at kde.org>
++   Copyright (C) 2001 Stephan Kulow <coolo at kde.org>
++   Copyright (C) 2003 Cornelius Schumacher <schumacher at kde.org>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License as published by the Free Software Foundation; either
++   version 2 of the License, or (at your option) any later versio
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++
++
+ #include "kio_help.h"
+ 
+ #include <config.h>
+@@ -60,7 +82,7 @@
+     {
+         QStringList::ConstIterator lang;
+         for (lang = langs.begin(); lang != langs.end(); ++lang)
+-            search.append(QString("%1%2/%3").arg(localDoc[id]).arg(*lang).arg(fname));
++            search.append(QString("%1%2/%3").arg(localDoc[id], *lang, fname));
+     }
+ 
+     // try to locate the file
+--- a/kross/kjs/kjsscript.cpp
++++ b/kross/kjs/kjsscript.cpp
+@@ -78,10 +78,17 @@
+     class KjsScriptPrivate
+     {
+         public:
+-            /// One engine per script to have them clean separated.
++            /**
++            * One engine per script to have them clean separated.
++            */
+             KJSEmbed::Engine* m_engine;
+ 
+             /**
++            * The KJS objects that got published.
++            */
++            QList< KJS::JSObject* > m_publishedObjects;
++
++            /**
+             * List of QObject instances that should be
+             * auto connected on execution.
+             * \see ChildrenInterface::AutoConnectSignals
+@@ -115,15 +122,16 @@
+             }
+ 
+             /// Publish a QObject to a KJSEmbed::Engine.
+-            void publishObject(KJS::ExecState* exec, const QString &name, QObject* object)
++            bool publishObject(KJS::ExecState* exec, const QString &name, QObject* object)
+             {
+                 Q_UNUSED(exec);
+ 
+                 KJS::JSObject* obj = m_engine->addObject(object, name.isEmpty() ? object->objectName() : name);
+                 if( ! obj ) {
+                     krosswarning( QString("Failed to publish the QObject name=\"%1\" objectName=\"%2\"").arg(name).arg(object ? object->objectName() : "NULL") );
+-                    return;
++                    return false;
+                 }
++                m_publishedObjects << obj;
+ 
+                 /*
+                 bool restricted = interpreter()->interpreterInfo()->optionValue("restricted", true).toBool();
+@@ -143,6 +151,7 @@
+                     );
+                 }
+                 */
++                return true;
+             }
+ 
+     };
+@@ -215,8 +224,24 @@
+ 
+ void KjsScript::finalize()
+ {
++    KJS::Interpreter* kjsinterpreter = d->m_engine->interpreter();
++    KJS::ExecState* exec = kjsinterpreter->globalExec();
++
++    foreach(KJS::JSObject* kjsobj, d->m_publishedObjects) {
++        KJSEmbed::QObjectBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::QObjectBinding>(exec, kjsobj);
++        Q_ASSERT(imp);
++        QObject* obj = imp->object<QObject>();
++        Q_ASSERT(obj);
++        foreach(QObject* child, obj->children())
++            if( KJSEmbed::SlotProxy* proxy = dynamic_cast< KJSEmbed::SlotProxy* >( child ) )
++                delete proxy;
++        delete kjsobj;
++    }
++    d->m_publishedObjects.clear();
++
+     d->m_autoconnect.clear();
+     d->m_defaultFunctionNames.clear();
++
+     delete d->m_engine;
+     d->m_engine = 0;
+ }
+@@ -320,24 +345,26 @@
+ 
+ QVariant KjsScript::callFunction(const QString& name, const QVariantList& args)
+ {
++    //if( hadError() ) return QVariant(); // check if we had a prev error and abort if that's the case
++
+     KJS::Interpreter* kjsinterpreter = d->m_engine->interpreter();
+     KJS::ExecState* exec = kjsinterpreter->globalExec();
+     KJS::JSObject* kjsglobal = kjsinterpreter->globalObject();
+-    if( ! exec->hadException() ) {
+-        //setError()
++    if( exec->hadException() ) {
++        ErrorInterface error = extractError(d->m_engine->completion(), exec);
++        //setError(&error);
++        krossdebug(QString("KjsScript::callFunction(\"%1\") Prev error: %2").arg(name).arg(error.errorMessage()));
+         return QVariant();
+     }
+ 
+     KJS::Identifier id = KJS::Identifier( KJS::UString(name.toLatin1().data()) );
+     KJS::JSValue *functionvalue = kjsglobal->get(exec, id);
+-    if( exec->hadException() ) {
+-        //setError()
+-        return QVariant();
+-    }
++    Q_ASSERT( ! exec->hadException() );
+ 
+     KJS::JSObject *function = functionvalue->toObject(exec);
+     if ( ! function || ! function->implementsCall() ) {
+-        //setError()
++        krossdebug(QString("KjsScript::callFunction(\"%1\") No such function").arg(name));
++        setError(QString("No such function \"%1\"").arg(name));
+         return QVariant();
+     }
+ 
+@@ -350,7 +377,10 @@
+ 
+     KJS::JSValue *retValue = function->call(exec, kjsglobal, kjsargs);
+     if( exec->hadException() ) {
+-        //setError()
++        ErrorInterface error = extractError(d->m_engine->completion(), exec);
++        //exec->clearException();
++        krossdebug(QString("KjsScript::callFunction(\"%1\") Call failed: %2").arg(name).arg(error.errorMessage()));
++        setError(&error);
+         return QVariant();
+     }
+ 
+--- a/phonon/phonon.notifyrc
++++ /dev/null
+@@ -1,125 +0,0 @@
+-[Global]
+-IconName=phonon
+-Comment=Phonon: KDE's Multimedia Library
+-Comment[ca]=Phonon: biblioteca multimèdia del KDE
+-Comment[cs]=Phonon: multimediální knihovna KDE
+-Comment[el]=Phonon: Βιβλιοθήκη πολυμέσων του KDE
+-Comment[ga]=Phonon: Leabharlann Il-mheán KDE
+-Comment[hu]=Phonon: a KDE multimédia modulja
+-Comment[it]=Phonon: Libreria multimediale di KDE
+-Comment[ja]=Phonon: KDE のマルチメディアライブラリ
+-Comment[km]=Phonon ៖ បណ្ណាល័យ​ពហុព័ត៌មាន​របស់ KDE
+-Comment[nds]=Phonon: KDE sien Multimedia-Bibliotheek
+-Comment[nl]=Phonon: KDE's multimediabibliotheek
+-Comment[pt]=Phonon: A Biblioteca Multimédia do KDE
+-Comment[pt_BR]=Phonon: Biblioteca Multimídia do KDE
+-Comment[sv]=Phonon: KDE:s multimediabibliotek
+-Comment[x-test]=xxPhonon: KDE's Multimedia Libraryxx
+-Comment[zh_CN]=Phonon:KDE 的多媒体库
+-Comment[zh_TW]=Phonon:KDE 的多媒體函式庫
+-
+-[Context/Application]
+-Name=Application
+-Name[af]=Program
+-Name[ar]=تطبيق
+-Name[be]=Праграма
+-Name[br]=Arload
+-Name[ca]=Aplicació
+-Name[cs]=Aplikace
+-Name[csb]=Programa
+-Name[cy]=Cymhwysiad
+-Name[da]=Program
+-Name[de]=Programm
+-Name[el]=Εφαρμογή
+-Name[eo]=Aplikaĵo
+-Name[es]=Aplicación
+-Name[et]=Rakendus
+-Name[eu]=Aplikazioa
+-Name[fa]=کاربرد
+-Name[fi]=Sovellus
+-Name[fy]=Applikaasje
+-Name[ga]=Feidhmchlár
+-Name[gl]=Aplicación
+-Name[he]=תוכנית
+-Name[hr]=Aplikacija
+-Name[hu]=alkalmazás
+-Name[is]=Forrit
+-Name[it]=Applicazione
+-Name[ja]=アプリケーション
+-Name[kk]=Қолданба
+-Name[km]=កម្មវិធី
+-Name[kn]=ಅನ್ವಯ
+-Name[ko]=응용 프로그램
+-Name[lb]=Programm
+-Name[lt]=Programa
+-Name[lv]=Aplikācija
+-Name[mk]=Апликација
+-Name[ms]=Aplikasi
+-Name[nb]=Program
+-Name[nds]=Programm
+-Name[ne]=अनुप्रयोग
+-Name[nl]=Toepassing
+-Name[nn]=Program
+-Name[pa]=ਕਾਰਜ
+-Name[pl]=Program
+-Name[pt]=Aplicação
+-Name[pt_BR]=Aplicativo
+-Name[ro]=Aplicaţie
+-Name[ru]=Приложение
+-Name[se]=Prográmma
+-Name[sl]=Program
+-Name[sr]=Програм
+-Name[sr at latin]=Program
+-Name[sv]=Program
+-Name[ta]=பயன்பாடு
+-Name[te]=కార్యక్రమం
+-Name[tg]=Гузориш
+-Name[th]=แอพพลิเคชัน
+-Name[tr]=Uygulama
+-Name[uk]=Програма
+-Name[uz]=Дастур
+-Name[vi]=Ứng dụng
+-Name[wa]=Programe
+-Name[x-test]=xxApplicationxx
+-Name[xh]=Isicelo
+-Name[zh_CN]=应用程序
+-Name[zh_HK]=應用程式
+-Name[zh_TW]=應用程式
+-#Comment=The name of the group of the contact
+-
+-[Event/AudioDeviceFallback]
+-Name=Audio Device Fallback
+-Name[ca]=Dispositiu d'àudio de reserva
+-Name[cs]=Záložní zvukové zařízení
+-Name[el]=Εφεδρική συσκευή ήχου
+-Name[ga]=Gléas Tacachumais Fuaime
+-Name[hu]=Másodlagos hangeszköz
+-Name[it]=Ripristino dispositivo audio
+-Name[ja]=オーディオデバイスのフォールバック
+-Name[km]=ឧបករណ៍​អូឌីយ៉ូ Fallback
+-Name[nds]=Opback-Klangreedschap
+-Name[nl]=Terugvalapparaat voor geluid
+-Name[pa]=ਆਡੀਓ ਜੰਤਰ ਫਾਲਬੈਕ
+-Name[pt]=Dispositivo Áudio Alternativo
+-Name[pt_BR]=Dispositivo de Áudio Alternativo
+-Name[sv]=Reservenhet för ljud vald
+-Name[x-test]=xxAudio Device Fallbackxx
+-Name[zh_CN]=默认音频设备
+-Name[zh_TW]=預設音效裝置
+-Comment=Notification on automatic fallback if the preferred devices in unavailable
+-Comment[ca]=Notificació del funcionament automàtic del de reserva si el dispositiu preferit no és disponible
+-Comment[el]=Ειδοποίηση όταν γίνει αυτόματη αλλαγή στην εφεδρική συσκευή ήχου, αν η προκαθορισμένη δεν είναι διαθέσιμη
+-Comment[ga]=Fógairt maidir le gléas tacachumais nuair nach bhfuil do rogha gléis ar fáil
+-Comment[hu]=Értesítés a másodlagos hangeszköz aktiválásáról, ha az elsődleges eszköz nem használható
+-Comment[it]=Notifica dopo il ripristino automatico se il dispositivo preferito non è disponibile
+-Comment[ja]=優先デバイスが利用できないために自動的にフォールバックしたときの通知
+-Comment[nds]=Bescheed, wenn de vörtrocken Reedschap nich verföögbor is un ansteed de Opbackreedschap bruukt warrt
+-Comment[nl]=Melding van automatische terugval als het apparaat van voorkeur niet beschikbaar is
+-Comment[pt]=Notificação automática de último recurso se os dispositivos preferidos estiverem indisponíveis
+-Comment[pt_BR]=Notificação de 'fallback' automático se os dispositivos preferidos estiverem indisponíveis
+-Comment[sv]=Underrättelse vid automatisk val av reservenhet om önskad enhet inte är tillgänglig
+-Comment[x-test]=xxNotification on automatic fallback if the preferred devices in unavailablexx
+-Comment[zh_CN]=如果首选的设备不可用,在默认设备上通知
+-Comment[zh_TW]=如果選用的裝置無法使用,則自動在預設的裝置上通知
+-Contexts=Application
+-Action=Popup
+--- a/phonon/path.h
++++ b/phonon/path.h
+@@ -98,7 +98,7 @@
+          * You may insert effects of the same class as often as you like,
+          * but if you insert the same object, the call will fail.
+          *
+-         * \param newEffect An Effect object.
++         * \param desc The EffectDescription object for the effect to be inserted.
+          *
+          * \param insertBefore If you already inserted an effect you can
+          * tell with this parameter in which order the data gets
+@@ -106,8 +106,8 @@
+          * the processing list. If the effect has not been inserted before
+          * the method will do nothing and return \c false.
+          *
+-         * \return Returns whether the effect could be inserted at the
+-         * specified position. If \c false is returned the effect was not
++         * \return Returns a pointer to the effect object if it could be inserted
++         * at the specified position. If \c 0 is returned the effect was not
+          * inserted.
+          *
+          * \see removeEffect
+@@ -153,7 +153,7 @@
+          * \see insertEffect
+          * \see effects
+          */
+-        bool removeEffect(Effect *);
++        bool removeEffect(Effect *effect);
+ 
+         /**
+          * Returns a list of Effect objects that are currently
+--- a/phonon/effectwidget.h
++++ b/phonon/effectwidget.h
+@@ -53,6 +53,7 @@
+             Q_PRIVATE_SLOT(k_func(), void _k_setToggleParameter(bool checked))
+             Q_PRIVATE_SLOT(k_func(), void _k_setIntParameter(int value))
+             Q_PRIVATE_SLOT(k_func(), void _k_setDoubleParameter(double value))
++            Q_PRIVATE_SLOT(k_func(), void _k_setStringParameter(const QString &))
+     };
+ } // namespace Phonon
+ #endif // PHONON_UI_EFFECTWIDGET_H
+--- a/phonon/factory.cpp
++++ b/phonon/factory.cpp
+@@ -89,7 +89,11 @@
+             if (pluginLib.load()) {
+                 pDebug() << Q_FUNC_INFO << "trying to load " << pluginLib.fileName();
+                 QPluginLoader pluginLoader(pluginLib.fileName());
+-                Q_ASSERT(pluginLoader.load());
++                if (!pluginLoader.load()) {
++                    pDebug() << Q_FUNC_INFO << "  load failed:"
++                             << pluginLoader.errorString();
++                    continue;
++                }
+                 pDebug() << pluginLoader.instance();
+                 m_backendObject = pluginLoader.instance();
+                 if (m_backendObject) {
+--- a/phonon/volumeslider.cpp
++++ b/phonon/volumeslider.cpp
+@@ -132,6 +132,10 @@
+         d->slider.setValue(qRound(100 * output->volume()));
+         d->slider.setEnabled(true);
+         d->muteButton.setEnabled(true);
++
++        d->_k_volumeChanged(output->volume());
++        d->_k_mutedChanged(output->isMuted());
++
+         connect(output, SIGNAL(volumeChanged(qreal)), SLOT(_k_volumeChanged(qreal)));
+         connect(output, SIGNAL(mutedChanged(bool)), SLOT(_k_mutedChanged(bool)));
+     } else {
+--- a/phonon/Mainpage.dox
++++ b/phonon/Mainpage.dox
+@@ -21,7 +21,7 @@
+ \li \ref phonon_tut1 "a simple audio player"
+ 
+ \section phonon_frontend The Frontend API
+-\li for simple playback tasks use \ref Phonon::AudioPlayer or \ref Phonon::VideoPlayer
++\li for simple playback tasks use \ref Phonon::createPlayer or \ref Phonon::VideoPlayer
+ \li \ref Frontend
+ 
+ \section phonon_backend_development Backend Development
+@@ -159,7 +159,7 @@
+ // DOXYGEN_SET_HIDE_SCOPE_NAMES = YES
+ // DOXYGEN_SET_HIDE_FRIEND_COMPOUNDS = YES
+ // DOXYGEN_SET_PROJECT_NAME = Phonon
+-// DOXYGEN_EXCLUDE += examples kcm DESIGN experimental factory.h globalconfig.h basedestructionhandler.h audiooutputadaptor.h iodevicestream.h kdepluginfactory.h kiomediastream.h pluginfactory.h *.cpp
++// DOXYGEN_EXCLUDE += examples kcm DESIGN experimental factory.h globalconfig.h basedestructionhandler.h audiooutputadaptor.h iodevicestream.h kdepluginfactory.h kiomediastream.h pluginfactory.h *.cpp libkaudiodevicelist *interface.h
+ // DOXYGEN_SET_EXAMPLE_PATH += @topdir@/phonon/examples
+ // DOXYGEN_SET_EXTRACT_ALL = NO
+ // DOXYGEN_SET_HIDE_UNDOC_MEMBERS = YES
+--- a/phonon/libkaudiodevicelist/audiodevice.cpp
++++ b/phonon/libkaudiodevicelist/audiodevice.cpp
+@@ -154,9 +154,15 @@
+             groupName = QLatin1String("AudioIODevice_");
+         }
+     }
+-    groupName += d->cardName;
++    {
++        const QString oldGroupName = groupName + d->cardName;
++        if (config->hasGroup(oldGroupName)) {
++            config->deleteGroup(oldGroupName);
++        }
++    }
++    groupName += d->udi;
+ 
+-    KConfigGroup deviceGroup(config.data(), groupName);
++    KConfigGroup deviceGroup(config, groupName);
+     if (config->hasGroup(groupName)) {
+         d->index = deviceGroup.readEntry("index", -1);
+     }
+@@ -210,6 +216,7 @@
+     d->driver = Solid::AudioInterface::Alsa;
+     d->deviceIds << alsaDeviceName;
+     d->cardName = alsaDeviceName;
++    d->udi = alsaDeviceName;
+     d->deviceInfoFromPcmDevice(alsaDeviceName);
+ 
+     KConfigGroup deviceGroup(config.data(), alsaDeviceName);
+@@ -452,7 +459,7 @@
+         return false; // you cannot remove devices that are plugged in
+     }
+     d->valid = false;
+-    KSharedConfig::Ptr config = KSharedConfig::openConfig("phonondevicesrc", KConfig::CascadeConfig);
++    KSharedConfig::Ptr config = KSharedConfig::openConfig("phonondevicesrc", KConfig::NoGlobals);
+     QString groupName;
+     if (d->captureDevice) {
+         if (d->playbackDevice) {
+@@ -463,7 +470,7 @@
+     } else {
+         groupName = QLatin1String("AudioOutputDevice_");
+     }
+-    groupName += d->cardName;
++    groupName += d->udi;
+     config->deleteGroup(groupName);
+     config->sync();
+     return true;
+--- a/phonon/libkaudiodevicelist/audiodeviceenumerator.cpp
++++ b/phonon/libkaudiodevicelist/audiodeviceenumerator.cpp
+@@ -50,7 +50,7 @@
+ AudioDeviceEnumeratorPrivate::AudioDeviceEnumeratorPrivate()
+     : q(this)
+ {
+-    config = KSharedConfig::openConfig("phonondevicesrc", KConfig::CascadeConfig);
++    config = KSharedConfig::openConfig("phonondevicesrc", KConfig::NoGlobals);
+     findDevices();
+     QObject::connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(const QString &)), &q, SLOT(_k_deviceAdded(const QString &)));
+     QObject::connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(const QString &)), &q, SLOT(_k_deviceRemoved(const QString &)));
+@@ -63,31 +63,31 @@
+ 
+ void AudioDeviceEnumeratorPrivate::findDevices()
+ {
+-    // ask Solid for the available audio hardware
+     QSet<QString> alreadyFoundCards;
+ 
+-    QList<Solid::Device> devices = Solid::Device::listFromQuery("AudioInterface.deviceType  & 'AudioInput|AudioOutput'");
+-    foreach (Solid::Device device, devices) {
++    // ask Solid for the available audio hardware
++    const QList<Solid::Device> devices = Solid::Device::listFromQuery("AudioInterface.deviceType  & 'AudioInput|AudioOutput'");
++    foreach (const Solid::Device &device, devices) {
+         AudioDevice dev(device, config);
+         if (dev.isValid()) {
+             if (dev.isCaptureDevice()) {
+                 capturedevicelist << dev;
+                 if (dev.isPlaybackDevice()) {
+                     playbackdevicelist << dev;
+-                    alreadyFoundCards << QLatin1String("AudioIODevice_") + dev.cardName();
++                    alreadyFoundCards << QLatin1String("AudioIODevice_") + dev.udi();
+                 } else {
+-                    alreadyFoundCards << QLatin1String("AudioCaptureDevice_") + dev.cardName();
++                    alreadyFoundCards << QLatin1String("AudioCaptureDevice_") + dev.udi();
+                 }
+             } else {
+                 playbackdevicelist << dev;
+-                alreadyFoundCards << QLatin1String("AudioOutputDevice_") + dev.cardName();
++                alreadyFoundCards << QLatin1String("AudioOutputDevice_") + dev.udi();
+             }
+         }
+     }
+ 
+     // now look in the config file for disconnected devices
+     QStringList groupList = config->groupList();
+-    foreach (QString groupName, groupList) {
++    foreach (const QString &groupName, groupList) {
+         if (alreadyFoundCards.contains(groupName) || !groupName.startsWith(QLatin1String("Audio"))) {
+             continue;
+         }
+@@ -376,8 +376,30 @@
+ {
+ }
+ 
++QDebug operator<<(QDebug &s, const Solid::AudioInterface::AudioDriver &driver)
++{
++    switch (driver) {
++    case Solid::AudioInterface::Alsa:
++        s.nospace() << "ALSA";
++        break;
++    case Solid::AudioInterface::OpenSoundSystem:
++        s.nospace() << "OSS";
++        break;
++    case Solid::AudioInterface::UnknownAudioDriver:
++        s.nospace() << "unknown driver";
++        break;
++    }
++    return s.space();
++}
++QDebug operator<<(QDebug &s, const AudioDevice &dev)
++{
++    s.space() << "\n-" << dev.cardName() << dev.driver() << dev.deviceIds() << "index:" << dev.index() << "preference:" << dev.initialPreference() << "avail:" << dev.isAvailable();
++    return s.space();
++}
++
+ QList<AudioDevice> AudioDeviceEnumerator::availablePlaybackDevices()
+ {
++    kDebug(603) << audioDeviceEnumeratorPrivate->playbackdevicelist;
+     return audioDeviceEnumeratorPrivate->playbackdevicelist;
+ }
+ 
+--- /dev/null
++++ b/phonon/libkaudiodevicelist/TODO
+@@ -0,0 +1 @@
++- put the icon logic from AudioDevice into Solid and use Device::icon() then
+--- a/phonon/videowidget.h
++++ b/phonon/videowidget.h
+@@ -36,8 +36,9 @@
+      * This widget shows the video signal.
+      *
+      * \code
+-     * VideoWidget *vwidget = new VideoWidget(this);
+-     * videoPath->addOutput(vwidget);
++     * MediaObject *media = new MediaObject(parent);
++     * VideoWidget *vwidget = new VideoWidget(parent);
++     * Phonon::createPath(media, vwidget);
+      * \endcode
+      *
+      * \ingroup PhononVideo
+--- a/phonon/effectwidget_p.h
++++ b/phonon/effectwidget_p.h
+@@ -41,6 +41,7 @@
+             void _k_setToggleParameter(bool checked);
+             void _k_setIntParameter(int value);
+             void _k_setDoubleParameter(double value);
++            void _k_setStringParameter(const QString &);
+ 
+             void autogenerateUi();
+     };
+--- a/phonon/platform_kde/CMakeLists.txt
++++ b/phonon/platform_kde/CMakeLists.txt
+@@ -7,5 +7,6 @@
+ target_link_libraries(kde ${KDE4_PHONON_LIBS} ${KDE4_KIO_LIBS})
+ set_target_properties(kde PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE  SKIP_BUILD_RPATH TRUE BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH ${LIB_INSTALL_DIR})
+ install(TARGETS kde DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/phonon_platform)
++install(FILES phonon.notifyrc DESTINATION ${DATA_INSTALL_DIR}/phonon)
+ 
+ # vim: noet
+--- /dev/null
++++ b/phonon/platform_kde/phonon.notifyrc
+@@ -0,0 +1,130 @@
++[Global]
++IconName=phonon
++Comment=Phonon: KDE's Multimedia Library
++Comment[ca]=Phonon: biblioteca multimèdia del KDE
++Comment[cs]=Phonon: multimediální knihovna KDE
++Comment[de]=Phonon: Die Multimedia-Bibliothek von KDE
++Comment[el]=Phonon: Βιβλιοθήκη πολυμέσων του KDE
++Comment[et]=Phonon: KDE multimeediateek
++Comment[fi]=Phonon: KDE:n multimediakirjasto
++Comment[ga]=Phonon: Leabharlann Il-mheán KDE
++Comment[hu]=Phonon: a KDE multimédia modulja
++Comment[it]=Phonon: Libreria multimediale di KDE
++Comment[ja]=Phonon: KDE のマルチメディアライブラリ
++Comment[kk]=Phonon: KDE-нің мультимедиа жиыны
++Comment[km]=Phonon ៖ បណ្ណាល័យ​ពហុព័ត៌មាន​របស់ KDE
++Comment[lv]=Phonon: KDE multimedijas bibliotēka
++Comment[nb]=Phonon: KDEs multimedia-bibliotek
++Comment[nds]=Phonon: KDE sien Multimedia-Bibliotheek
++Comment[nl]=Phonon: KDE's multimediabibliotheek
++Comment[pt]=Phonon: A Biblioteca Multimédia do KDE
++Comment[pt_BR]=Phonon: Biblioteca Multimídia do KDE
++Comment[sr]=Фонон: КДЕ-ова мултимедијска библиотека
++Comment[sr at latin]=Phonon: KDE-ova multimedijska biblioteka
++Comment[sv]=Phonon: KDE:s multimediabibliotek
++Comment[th]=Phonon: ไลบรารีมัลติมีเดียสำหรับ KDE
++Comment[uk]=Phonon: бібліотека мультимедії KDE
++Comment[x-test]=xxPhonon: KDE's Multimedia Libraryxx
++Comment[zh_CN]=Phonon:KDE 的多媒体库
++Comment[zh_TW]=Phonon:KDE 的多媒體函式庫
++
++[Context/Application]
++Name=Application
++Name[af]=Program
++Name[ar]=تطبيق
++Name[be]=Праграма
++Name[br]=Arload
++Name[ca]=Aplicació
++Name[cs]=Aplikace
++Name[csb]=Programa
++Name[cy]=Cymhwysiad
++Name[da]=Program
++Name[de]=Programm
++Name[el]=Εφαρμογή
++Name[eo]=Aplikaĵo
++Name[es]=Aplicación
++Name[et]=Rakendus
++Name[eu]=Aplikazioa
++Name[fa]=کاربرد
++Name[fi]=Sovellus
++Name[fy]=Applikaasje
++Name[ga]=Feidhmchlár
++Name[gl]=Aplicación
++Name[he]=תוכנית
++Name[hr]=Aplikacija
++Name[hu]=alkalmazás
++Name[is]=Forrit
++Name[it]=Applicazione
++Name[ja]=アプリケーション
++Name[kk]=Қолданба
++Name[km]=កម្មវិធី
++Name[kn]=ಅನ್ವಯ
++Name[ko]=응용 프로그램
++Name[lb]=Programm
++Name[lt]=Programa
++Name[lv]=Aplikācija
++Name[mk]=Апликација
++Name[ms]=Aplikasi
++Name[nb]=Program
++Name[nds]=Programm
++Name[ne]=अनुप्रयोग
++Name[nl]=Toepassing
++Name[nn]=Program
++Name[oc]=Aplicacion
++Name[pa]=ਕਾਰਜ
++Name[pl]=Program
++Name[pt]=Aplicação
++Name[pt_BR]=Aplicativo
++Name[ro]=Aplicaţie
++Name[ru]=Приложение
++Name[se]=Prográmma
++Name[sl]=Program
++Name[sr]=Програм
++Name[sr at latin]=Program
++Name[sv]=Program
++Name[ta]=பயன்பாடு
++Name[te]=కార్యక్రమం
++Name[tg]=Гузориш
++Name[th]=แอพพลิเคชัน
++Name[tr]=Uygulama
++Name[uk]=Програма
++Name[uz]=Дастур
++Name[vi]=Ứng dụng
++Name[wa]=Programe
++Name[x-test]=xxApplicationxx
++Name[xh]=Isicelo
++Name[zh_CN]=应用程序
++Name[zh_HK]=應用程式
++Name[zh_TW]=應用程式
++#Comment=The name of the group of the contact
++
++[Event/AudioDeviceFallback]
++Name=Audio Device Fallback
++Name[ca]=Dispositiu d'àudio de reserva
++Name[cs]=Záložní zvukové zařízení
++Name[de]=Ausweichgerät für Audio
++Name[el]=Εφεδρική συσκευή ήχου
++Name[et]=Heliseadme varuvariant
++Name[ga]=Gléas Tacachumais Fuaime
++Name[hu]=Másodlagos hangeszköz
++Name[it]=Ripristino dispositivo audio
++Name[ja]=オーディオデバイスのフォールバック
++Name[kk]=Қосалқы аудио құрылғысы
++Name[km]=ឧបករណ៍​អូឌីយ៉ូ Fallback
++Name[lv]=Audioiekārtas atkāpsistēma
++Name[nb]=Overgang til lydenhet
++Name[nds]=Opback-Klangreedschap
++Name[nl]=Terugvalapparaat voor geluid
++Name[pa]=ਆਡੀਓ ਜੰਤਰ ਫਾਲਬੈਕ
++Name[pt]=Dispositivo Áudio Alternativo
++Name[pt_BR]=Dispositivo de Áudio Alternativo
++Name[sr]=Спадање аудио уређаја
++Name[sr at latin]=Spadanje audio uređaja
++Name[sv]=Reservenhet för ljud vald
++Name[th]=อุปกรณ์เสียงสำรอง
++Name[x-test]=xxAudio Device Fallbackxx
++Name[zh_CN]=默认音频设备
++Name[zh_TW]=預設音效裝置
++Comment=Notification on automatic fallback if the preferred device is unavailable
++Contexts=Application
++Action=Popup
+--- a/phonon/tests/guitest/videowidgetitem.h
++++ b/phonon/tests/guitest/videowidgetitem.h
+@@ -33,6 +33,7 @@
+             : SinkItem(pos, widget)
+         {
+             setBrush(QColor(100, 100, 255, 150));
++            setTitle("Video Widget");
+ 
+             QVBoxLayout *layout = new QVBoxLayout(m_frame);
+             layout->setMargin(0);
+--- a/phonon/tests/guitest/audiooutputitem.cpp
++++ b/phonon/tests/guitest/audiooutputitem.cpp
+@@ -23,43 +23,51 @@
+ #include <QtGui/QListView>
+ 
+ #include <Phonon/AudioOutputDevice>
+-#include <Phonon/AudioOutputDeviceModel>
+ #include <Phonon/BackendCapabilities>
++#include <kdebug.h>
+ 
+ using Phonon::AudioOutputDevice;
+-using Phonon::AudioOutputDeviceModel;
+ 
+ AudioOutputItem::AudioOutputItem(const QPoint &pos, QGraphicsView *widget)
+     : SinkItem(pos, widget),
+     m_output(Phonon::MusicCategory)
+ {
+     setBrush(QColor(100, 255, 100, 150));
++    setTitle("Audio Output");
+ 
+     m_output.setName("GUI-Test");
+ 
+     QHBoxLayout *hlayout = new QHBoxLayout(m_frame);
+     hlayout->setMargin(0);
+ 
+-    QListView *deviceListView = new QListView(m_frame);
+-    hlayout->addWidget(deviceListView);
++    m_deviceListView = new QListView(m_frame);
++    hlayout->addWidget(m_deviceListView);
+     QList<AudioOutputDevice> deviceList = Phonon::BackendCapabilities::availableAudioOutputDevices();
+-    AudioOutputDeviceModel *model = new AudioOutputDeviceModel(deviceList, deviceListView);
+-    deviceListView->setModel(model);
+-    deviceListView->setCurrentIndex(model->index(deviceList.indexOf(m_output.outputDevice()), 0));
+-    connect(deviceListView, SIGNAL(activated(const QModelIndex &)), SLOT(deviceChange(const QModelIndex &)));
++    m_model = new AudioOutputDeviceModel(deviceList, m_deviceListView);
++    m_deviceListView->setModel(m_model);
++    m_deviceListView->setCurrentIndex(m_model->index(deviceList.indexOf(m_output.outputDevice()), 0));
++    connect(m_deviceListView, SIGNAL(activated(const QModelIndex &)), SLOT(deviceChange(const QModelIndex &)));
+ 
+     m_volslider = new VolumeSlider(m_frame);
+     m_volslider->setOrientation(Qt::Vertical);
+     m_volslider->setAudioOutput(&m_output);
+     hlayout->addWidget(m_volslider);
++
++    connect(Phonon::BackendCapabilities::notifier(), SIGNAL(availableAudioOutputDevicesChanged()),
++            SLOT(availableDevicesChanged()));
+ }
+ 
+-void AudioOutputItem::deviceChange(const QModelIndex &modelIndex)
++void AudioOutputItem::availableDevicesChanged()
+ {
+-    const int row = modelIndex.row();
+     QList<AudioOutputDevice> deviceList = Phonon::BackendCapabilities::availableAudioOutputDevices();
+-    if (row >= 0 && row < deviceList.size()) {
+-        m_output.setOutputDevice(deviceList[row]);
+-    }
++    Q_ASSERT(m_model);
++    m_model->setModelData(deviceList);
++    m_deviceListView->setCurrentIndex(m_model->index(deviceList.indexOf(m_output.outputDevice()), 0));
+ }
+ 
++void AudioOutputItem::deviceChange(const QModelIndex &modelIndex)
++{
++    Q_ASSERT(m_model);
++    AudioOutputDevice device = m_model->modelData(modelIndex);
++    m_output.setOutputDevice(device);
++}
+--- a/phonon/tests/guitest/audiooutputitem.h
++++ b/phonon/tests/guitest/audiooutputitem.h
+@@ -22,12 +22,15 @@
+ 
+ #include "sinkitem.h"
+ #include <Phonon/AudioOutput>
++#include <Phonon/AudioOutputDeviceModel>
+ #include <Phonon/VolumeSlider>
+ 
+ class QModelIndex;
++class QListView;
+ 
+ using Phonon::AudioOutput;
+ using Phonon::VolumeSlider;
++using Phonon::AudioOutputDeviceModel;
+ 
+ class AudioOutputItem : public SinkItem
+ {
+@@ -42,11 +45,14 @@
+         virtual const MediaNode *mediaNode() const { return &m_output; }
+ 
+     private slots:
++        void availableDevicesChanged();
+         void deviceChange(const QModelIndex &modelIndex);
+ 
+     private:
+         AudioOutput m_output;
+         VolumeSlider *m_volslider;
++        AudioOutputDeviceModel *m_model;
++        QListView *m_deviceListView;
+ };
+ 
+ #endif // AUDIOOUTPUTITEM_H
+--- /dev/null
++++ b/phonon/tests/guitest/effectitem.cpp
+@@ -0,0 +1,62 @@
++/*  This file is part of the KDE project
++    Copyright (C) 2007 Matthias Kretz <kretz at kde.org>
++
++    This library is free software; you can redistribute it and/or
++    modify it under the terms of the GNU Library General Public
++    License version 2 as published by the Free Software Foundation.
++
++    This library is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++    Library General Public License for more details.
++
++    You should have received a copy of the GNU Library General Public License
++    along with this library; see the file COPYING.LIB.  If not, write to
++    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++    Boston, MA 02110-1301, USA.
++
++*/
++
++#include "effectitem.h"
++#include <QtCore/QModelIndex>
++#include <QtGui/QHBoxLayout>
++#include <QtGui/QVBoxLayout>
++#include <QtGui/QLabel>
++#include <QtGui/QListView>
++
++#include <Phonon/BackendCapabilities>
++#include <Phonon/EffectWidget>
++#include "pathitem.h"
++
++using Phonon::EffectWidget;
++
++EffectItem::EffectItem(const EffectDescription &desc, PathItem *pathItem, QGraphicsView *widget)
++    : SinkItem(pathItem, widget),
++    m_effect(desc)
++{
++    setupUi(desc);
++    pathItem->path().insertEffect(&m_effect);
++    pathItem->updateChildrenPositions();
++}
++
++EffectItem::EffectItem(const EffectDescription &desc, const QPoint &pos, QGraphicsView *widget)
++    : SinkItem(pos, widget),
++    m_effect(desc)
++{
++    setupUi(desc);
++}
++
++void EffectItem::setupUi(const EffectDescription &desc)
++{
++    setBrush(QColor(255, 200, 0, 150));
++    setTitle(desc.name());
++
++    QVBoxLayout *hlayout = new QVBoxLayout(m_frame);
++    hlayout->setMargin(0);
++
++    QLabel *label = new QLabel(desc.description(), m_frame);
++    label->setWordWrap(true);
++    hlayout->addWidget(label);
++    EffectWidget *w = new EffectWidget(&m_effect, m_frame);
++    hlayout->addWidget(w);
++}
+--- a/phonon/tests/guitest/pathitem.cpp
++++ b/phonon/tests/guitest/pathitem.cpp
+@@ -18,25 +18,60 @@
+ */
+ 
+ #include "pathitem.h"
++#include <QtGui/QLinearGradient>
++#include <QtGui/QPainterPath>
++#include <QtGui/QPen>
+ 
+-PathItem::PathItem(WidgetRectItem *start, WidgetRectItem *end, const Path &path)
+-    : m_path(path)
++PathItem::PathItem(WidgetRectItem *start, WidgetRectItem *end, const Path &_path)
++    : m_path(_path)
+ {
+-    setLine(QLineF(start->sceneBoundingRect().center(), end->sceneBoundingRect().center()));
++    m_startPos.setX(start->sceneBoundingRect().right());
++    m_startPos.setY(start->sceneBoundingRect().center().y());
++    m_endPos.setX(end->sceneBoundingRect().left());
++    m_endPos.setY(end->sceneBoundingRect().center().y());
++    updatePainterPath();
++
+     setZValue(-1.0);
+-    connect(start->qObject(), SIGNAL(itemMoved(const QPointF &)), SLOT(startMoved(const QPointF &)));
+-    connect(end->qObject(), SIGNAL(itemMoved(const QPointF &)), SLOT(endMoved(const QPointF &)));
++    connect(start->qObject(), SIGNAL(itemMoved(const QRectF &)), SLOT(startMoved(const QRectF &)));
++    connect(end->qObject(), SIGNAL(itemMoved(const QRectF &)), SLOT(endMoved(const QRectF &)));
++}
++
++void PathItem::startMoved(const QRectF &pos)
++{
++    m_startPos.setX(pos.right());
++    m_startPos.setY(pos.center().y());
++    updatePainterPath();
+ }
+ 
+-void PathItem::startMoved(const QPointF &pos)
++void PathItem::endMoved(const QRectF &pos)
+ {
+-    const QLineF old = line();
+-    setLine(QLineF(pos, old.p2()));
++    m_endPos.setX(pos.left());
++    m_endPos.setY(pos.center().y());
++    updatePainterPath();
+ }
+ 
+-void PathItem::endMoved(const QPointF &pos)
++void PathItem::updatePainterPath()
+ {
+-    const QLineF old = line();
+-    setLine(QLineF(old.p1(), pos));
++    QPainterPath path;
++    path.moveTo(m_startPos);
++    path.cubicTo(m_startPos + QPointF(150.0, 0.0),
++            m_endPos - QPointF(150.0, 0.0),
++            m_endPos);
++    setPath(path);
++
++    QLinearGradient gradient(m_startPos, m_endPos);
++    gradient.setColorAt(0, QColor(64, 0, 0, 200));
++    gradient.setColorAt(1, QColor(0, 64, 0, 200));
++    setPen(QPen(gradient, 3.0));
++
++    updateChildrenPositions();
+ }
+ 
++void PathItem::updateChildrenPositions()
++{
++    const qreal divisor = QGraphicsItem::children().count() + 1;
++    int positionOnLine = 0;
++    foreach (QGraphicsItem *item, QGraphicsItem::children()) {
++        item->setPos(QGraphicsPathItem::path().pointAtPercent(++positionOnLine / divisor) - item->boundingRect().center());
++    }
++}
+--- /dev/null
++++ b/phonon/tests/guitest/effectitem.h
+@@ -0,0 +1,52 @@
++/*  This file is part of the KDE project
++    Copyright (C) 2007 Matthias Kretz <kretz at kde.org>
++
++    This library is free software; you can redistribute it and/or
++    modify it under the terms of the GNU Library General Public
++    License version 2 as published by the Free Software Foundation.
++
++    This library is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++    Library General Public License for more details.
++
++    You should have received a copy of the GNU Library General Public License
++    along with this library; see the file COPYING.LIB.  If not, write to
++    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++    Boston, MA 02110-1301, USA.
++
++*/
++
++#ifndef EFFECTITEM_H
++#define EFFECTITEM_H
++
++#include "sinkitem.h"
++#include <Phonon/Effect>
++#include <Phonon/EffectDescription>
++
++class QModelIndex;
++class PathItem;
++
++using Phonon::Effect;
++using Phonon::EffectDescription;
++
++class EffectItem : public SinkItem
++{
++    Q_OBJECT
++    public:
++        EffectItem(const EffectDescription &, PathItem *pathItem, QGraphicsView *widget);
++        EffectItem(const EffectDescription &, const QPoint &pos, QGraphicsView *widget);
++
++        enum { Type = UserType + 10 };
++        int type() const { return Type; }
++
++        virtual MediaNode *mediaNode() { return &m_effect; }
++        virtual const MediaNode *mediaNode() const { return &m_effect; }
++
++    private:
++        void setupUi(const EffectDescription &desc);
++
++        Effect m_effect;
++};
++
++#endif // EFFECTITEM_H
+--- a/phonon/tests/guitest/pathitem.h
++++ b/phonon/tests/guitest/pathitem.h
+@@ -21,24 +21,35 @@
+ #define PATHITEM_H
+ 
+ #include <QtCore/QObject>
+-#include <QtGui/QGraphicsLineItem>
++#include <QtGui/QGraphicsPathItem>
+ #include "widgetrectitem.h"
+ #include <Phonon/Path>
+ 
+ using Phonon::Path;
+ 
+-class PathItem : public QObject, public QGraphicsLineItem
++class PathItem : public QObject, public QGraphicsPathItem
+ {
+     Q_OBJECT
+     public:
+         PathItem(WidgetRectItem *start, WidgetRectItem *end, const Path &path);
+ 
++        enum { Type = UserType + 20 };
++        int type() const { return Type; }
++
++        Path path() const { return m_path; }
++
++    public slots:
++        void updateChildrenPositions();
++
+     private slots:
+-        void startMoved(const QPointF &pos);
+-        void endMoved(const QPointF &pos);
++        void startMoved(const QRectF &pos);
++        void endMoved(const QRectF &pos);
+ 
+     private:
++        void updatePainterPath();
++
+         Path m_path;
++        QPointF m_startPos, m_endPos;
+ };
+ 
+ #endif // PATHITEM_H
+--- a/phonon/tests/guitest/widgetrectitem.cpp
++++ b/phonon/tests/guitest/widgetrectitem.cpp
+@@ -18,6 +18,17 @@
+ */
+ 
+ #include "widgetrectitem.h"
++#include <QtCore/QEvent>
++#include "pathitem.h"
++
++WidgetRectItem::WidgetRectItem(QGraphicsItem *parent, QGraphicsView *widget)
++    : QObject(widget), QGraphicsRectItem(parent), m_view(widget)
++{
++    m_frame = new QWidget(m_view);
++    m_frame->setAutoFillBackground(true);
++    m_frame->show();
++    m_frame->installEventFilter(this);
++}
+ 
+ WidgetRectItem::WidgetRectItem(const QPoint &pos, QGraphicsView *widget)
+     : QObject(widget), m_view(widget)
+@@ -26,32 +37,55 @@
+ 
+     m_frame = new QWidget(m_view);
+     m_frame->setAutoFillBackground(true);
+-    //QPalette palette = m_frame->palette();
+-    //QColor background = QApplication::palette().color(QPalette::Window);
+-    //kDebug() << background;
+-    //background.setAlpha(128);
+-    //palette.setColor(QPalette::Window, background);
+-    //m_frame->setPalette(palette);
+     m_frame->show();
+ 
++    m_frame->installEventFilter(this);
+     setPos(m_view->mapToScene(pos));
+ }
+ 
++WidgetRectItem::~WidgetRectItem()
++{
++    delete m_frame;
++}
++
+ QVariant WidgetRectItem::itemChange(GraphicsItemChange change, const QVariant &value)
+ {
+     if (change == QGraphicsItem::ItemPositionHasChanged) {
+-        emit itemMoved(sceneBoundingRect().center());
++        emit itemMoved(sceneBoundingRect());
+     }
+     return QGraphicsRectItem::itemChange(change, value);
+ }
+ 
++void WidgetRectItem::setTitle(const QString &title)
++{
++    m_title = title;
++    update();
++}
++
+ void WidgetRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ {
+     const QSize size(m_frame->sizeHint());
+-    setRect(0.0, 0.0, size.width() + 1.0, size.height() + 30.0);
++    setRect(0.0, 0.0, size.width() + 31.0, size.height() + 30.0);
+     QGraphicsRectItem::paint(painter, option, widget);
++    painter->drawText(rect(), Qt::AlignTop | Qt::AlignHCenter, m_title);
+ 
+     const QPoint mapped = m_view->mapFromScene(pos());
+-    m_frame->setGeometry(mapped.x() + 3, mapped.y() + 32, size.width(), size.height());
++    const QRect frameGeometry(mapped.x() + 18, mapped.y() + 17, size.width(), size.height());
++    if (m_frame->geometry() != frameGeometry) {
++        m_frame->setGeometry(frameGeometry);
++        emit itemMoved(sceneBoundingRect());
++        PathItem *pathItem = qgraphicsitem_cast<PathItem *>(parentItem());
++        if (pathItem) {
++            pathItem->updateChildrenPositions();
++        }
++    }
++}
++
++bool WidgetRectItem::eventFilter(QObject *obj, QEvent *e)
++{
++    if (obj == m_frame && e->type() == QEvent::LayoutRequest) {
++        update();
++    }
++    return QObject::eventFilter(obj, e);
+ }
+ 
+--- a/phonon/tests/guitest/mygraphicsscene.cpp
++++ b/phonon/tests/guitest/mygraphicsscene.cpp
+@@ -23,6 +23,13 @@
+ #include "redrectitem.h"
+ #include "sinkitem.h"
+ #include "pathitem.h"
++#include "effectitem.h"
++
++#include <QtGui/QMenu>
++
++#include <Phonon/BackendCapabilities>
++
++#include <kdebug.h>
+ 
+ using Phonon::Path;
+ 
+@@ -37,26 +44,66 @@
+ 
+ void MyGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
+ {
+-    if (mouseEvent->button() == Qt::LeftButton && 0 == itemAt(mouseEvent->scenePos())) {
+-        const QPointF offset(12.0, 12.0);
+-        QList<QGraphicsItem *> startItems = items(QRectF(mouseEvent->scenePos() - offset, mouseEvent->scenePos() + offset));
+-        if (startItems.isEmpty()) {
+-            const QPointF offset(25.0, 25.0);
+-            startItems = items(QRectF(mouseEvent->scenePos() - offset, mouseEvent->scenePos() + offset));
++    kDebug() << mouseEvent->button() << mouseEvent->scenePos();
++    if (mouseEvent->button() == Qt::LeftButton) {
++        QGraphicsItem *itemUnderMouse = itemAt(mouseEvent->scenePos());
++        PathItem *pathItem = qgraphicsitem_cast<PathItem *>(itemUnderMouse);
++        if (!pathItem && !itemUnderMouse) {
++            const QPointF offset(12.0, 12.0);
++            QList<QGraphicsItem *> startItems = items(QRectF(mouseEvent->scenePos() - offset, mouseEvent->scenePos() + offset));
++            if (startItems.isEmpty()) {
++                const QPointF offset(25.0, 25.0);
++                startItems = items(QRectF(mouseEvent->scenePos() - offset, mouseEvent->scenePos() + offset));
++            }
++            if (startItems.size() == 1) {
++                m_startItem = qgraphicsitem_cast<MediaObjectItem *>(startItems.first());
++                if (!m_startItem) {
++                    m_startItem = qgraphicsitem_cast<EffectItem *>(startItems.first());
++                }
++                if (m_startItem) {
++                    m_lineItem = new QGraphicsLineItem(QLineF(mouseEvent->scenePos(), mouseEvent->scenePos()));
++                    addItem(m_lineItem);
++                    return;
++                }
++                pathItem = qgraphicsitem_cast<PathItem *>(startItems.first());
++            }
++            if (!pathItem) {
++                addItem(new RedRectItem(mouseEvent->scenePos()));
++                return;
++            }
+         }
+-        if (startItems.size() == 1) {
+-            m_startItem = qgraphicsitem_cast<MediaObjectItem *>(startItems.first());
+-            if (!m_startItem) {
+-                m_startItem = qgraphicsitem_cast<SinkItem *>(startItems.first());
+-            }
+-            if (m_startItem) {
+-                m_lineItem = new QGraphicsLineItem(QLineF(mouseEvent->scenePos(), mouseEvent->scenePos()));
+-                addItem(m_lineItem);
++        if (pathItem) {
++            // allow to disconnect or add an effect
++            QMenu popupMenu;
++            QAction *disconnectAction = popupMenu.addAction("disconnect");
++            popupMenu.addSeparator();
++
++            //QMenu *effectMenu = popupMenu.addMenu("add Effect");
++            QList<EffectDescription> effectList = Phonon::BackendCapabilities::availableAudioEffects();
++            QHash<QAction *, EffectDescription> actionHash;
++            foreach (const EffectDescription &d, effectList) {
++                QAction *subAction = popupMenu.addAction("add " + d.name());
++                actionHash.insert(subAction, d);
++            }
++
++            QAction *triggeredAction = popupMenu.exec(mouseEvent->screenPos());
++            if (triggeredAction) {
++                kDebug() << "popupMenu exec triggered action" << triggeredAction->metaObject()->className();
++                if (actionHash.contains(triggeredAction)) {
++                    EffectDescription d = actionHash[triggeredAction];
++                    Q_ASSERT(m_view);
++                    new EffectItem(d, pathItem, m_view);
++                } else {
++                    // disconnect
++                    Q_ASSERT(triggeredAction == disconnectAction);
++                    pathItem->path().disconnect();
++                    delete pathItem;
++                }
+                 return;
++            } else {
++                kDebug() << "popupMenu no action";
+             }
+         }
+-        addItem(new RedRectItem(mouseEvent->scenePos()));
+-        return;
+     }
+     QGraphicsScene::mousePressEvent(mouseEvent);
+ }
+@@ -76,22 +123,43 @@
+                 endItems = items(QRectF(mouseEvent->scenePos() - offset, mouseEvent->scenePos() + offset));
+             }
+         }
+-        if (endItems.size() == 1) {
++        if (endItems.size() == 1 && endItems.first() != m_startItem) {
+             QGraphicsItem *endItem = endItems.first();
++            MediaNode *sourceNode = 0;
++            MediaNode *sinkNode = 0;
++            WidgetRectItem *sourceItem = 0;
++            WidgetRectItem *sinkItem = 0;
++
+             MediaObjectItem *source = qgraphicsitem_cast<MediaObjectItem *>(m_startItem);
+-            SinkItem *sink = 0;
+-            if (!source) {
+-                source = qgraphicsitem_cast<MediaObjectItem *>(endItem);
+-                sink = qgraphicsitem_cast<SinkItem *>(m_startItem);
++            if (source) {
++                sourceNode = source->mediaNode();
++                sourceItem = source;
+             } else {
+-                sink = qgraphicsitem_cast<SinkItem *>(endItem);
++                EffectItem *source= qgraphicsitem_cast<EffectItem *>(m_startItem);
++                if (source) {
++                    sourceNode = source->mediaNode();
++                    sourceItem = source;
++                }
+             }
+-            if (source && sink && endItem != m_startItem) {
+-                Path p = Phonon::createPath(source->mediaNode(), sink->mediaNode());
+-                if (p.isValid()) {
+-                    addItem(new PathItem(source, sink, p));
+-                    m_startItem = 0;
+-                    return;
++            if (sourceItem && sourceNode) {
++                SinkItem *sink = qgraphicsitem_cast<SinkItem *>(endItem);
++                if (sink) {
++                    sinkNode = sink->mediaNode();
++                    sinkItem = sink;
++                } else {
++                    EffectItem *sink = qgraphicsitem_cast<EffectItem *>(endItem);
++                    if (sink) {
++                        sinkNode = sink->mediaNode();
++                        sinkItem = sink;
++                    }
++                }
++                if (sinkItem && sinkNode) {
++                    Path p = Phonon::createPath(sourceNode, sinkNode);
++                    if (p.isValid()) {
++                        addItem(new PathItem(sourceItem, sinkItem, p));
++                        m_startItem = 0;
++                        return;
++                    }
+                 }
+             }
+         }
+--- a/phonon/tests/guitest/main.cpp
++++ b/phonon/tests/guitest/main.cpp
+@@ -17,9 +17,11 @@
+ 
+ */
+ 
++#include <QtCore/QSignalMapper>
+ #include <QtGui/QAction>
+ #include <QtGui/QGraphicsView>
+ #include <QtGui/QMainWindow>
++#include <QtGui/QMenu>
+ #include "mediaobjectitem.h"
+ #include "mygraphicsscene.h"
+ #include <kaboutdata.h>
+@@ -30,6 +32,8 @@
+ #include "audiooutputitem.h"
+ #include "videowidgetitem.h"
+ #include "pathitem.h"
++#include "effectitem.h"
++#include <Phonon/BackendCapabilities>
+ 
+ class MainWindow : public QMainWindow
+ {
+@@ -40,6 +44,7 @@
+     private slots:
+         void init();
+         void addMediaObject();
++        void addEffect(int);
+         void addAudioOutput();
+         void addVideoWidget();
+ 
+@@ -148,11 +153,26 @@
+     setWindowIcon(KIcon("phonon"));
+     m_scene = new MyGraphicsScene(this);
+     m_view = new QGraphicsView(m_scene);
++    m_scene->setView(m_view);
++    //m_view->setRenderHints(QPainter::Antialiasing);
+     setCentralWidget(m_view);
+     QAction *action;
+     action = new QAction(i18n("add MediaObject"), m_view);
+     connect(action, SIGNAL(triggered()), SLOT(addMediaObject()));
+     m_view->addAction(action);
++
++    action = new QAction(i18n("add Effect"), m_view);
++    QMenu *menu = new QMenu("Title", m_view);
++    QList<EffectDescription> effectList = Phonon::BackendCapabilities::availableAudioEffects();
++    QSignalMapper *mapper = new QSignalMapper(menu);
++    connect(mapper, SIGNAL(mapped(int)), SLOT(addEffect(int)));
++    foreach (const EffectDescription &d, effectList) {
++        QAction *subAction = menu->addAction(d.name(), mapper, SLOT(map()));
++        mapper->setMapping(subAction, d.index());
++    }
++    action->setMenu(menu);
++    m_view->addAction(action);
++
+     action = new QAction(i18n("add AudioOutput"), m_view);
+     connect(action, SIGNAL(triggered()), SLOT(addAudioOutput()));
+     m_view->addAction(action);
+@@ -180,19 +200,21 @@
+ 
+ void MainWindow::addMediaObject()
+ {
+-    kDebug();
+     m_scene->addItem(new MediaObjectItem(QCursor::pos(), m_view));
+ }
+ 
++void MainWindow::addEffect(int effectIndex)
++{
++    m_scene->addItem(new EffectItem(EffectDescription::fromIndex(effectIndex), QCursor::pos(), m_view));
++}
++
+ void MainWindow::addAudioOutput()
+ {
+-    kDebug();
+     m_scene->addItem(new AudioOutputItem(QCursor::pos(), m_view));
+ }
+ 
+ void MainWindow::addVideoWidget()
+ {
+-    kDebug();
+     m_scene->addItem(new VideoWidgetItem(QCursor::pos(), m_view));
+ }
+ 
+--- a/phonon/tests/guitest/mediaobjectitem.cpp
++++ b/phonon/tests/guitest/mediaobjectitem.cpp
+@@ -38,105 +38,136 @@
+     m_navigationWidget(0)
+ {
+     setBrush(QColor(255, 100, 100, 150));
++    setTitle("Media Object");
+ 
+     QVBoxLayout *topLayout = new QVBoxLayout(m_frame);
+     topLayout->setMargin(0);
+ 
++    // as wide as possible:
+     KLineEdit *file = new KLineEdit(m_frame);
+     file->setCompletionObject(new KUrlCompletion(KUrlCompletion::FileCompletion));
+     connect(file, SIGNAL(returnPressed(const QString &)), SLOT(loadUrl(const QString &)));
+     topLayout->addWidget(file);
+ 
+-    QHBoxLayout *mediaLayout = new QHBoxLayout(m_frame);
+-    topLayout->addLayout(mediaLayout);
+-    QPushButton *audiocdButton = new QPushButton("CD", m_frame);
+-    QPushButton *dvdButton = new QPushButton("DVD", m_frame);
++    m_seekslider = new SeekSlider(m_frame);
++    topLayout->addWidget(m_seekslider);
++
++    // not much need for horizontal space:
++    QHBoxLayout *subLayout = new QHBoxLayout();
++    subLayout->setMargin(0);
++    subLayout->setSpacing(4);
++    topLayout->addLayout(subLayout);
++
++    QVBoxLayout *mediaLayout = new QVBoxLayout();
++    mediaLayout->setMargin(0);
++    mediaLayout->setSpacing(4);
++    subLayout->addLayout(mediaLayout);
++
++    QToolButton *audiocdButton = new QToolButton(m_frame);
++    audiocdButton->setIconSize(QSize(32, 32));
++    audiocdButton->setToolTip("CD");
++    audiocdButton->setIcon(KIcon("media-optical-audio"));
+     mediaLayout->addWidget(audiocdButton);
+-    mediaLayout->addWidget(dvdButton);
+     connect(audiocdButton, SIGNAL(clicked()), SLOT(openCD()));
++
++    QToolButton *dvdButton = new QToolButton(m_frame);
++    dvdButton->setIconSize(QSize(32, 32));
++    dvdButton->setToolTip("DVD");
++    dvdButton->setIcon(KIcon("media-optical-dvd"));
++    mediaLayout->addWidget(dvdButton);
+     connect(dvdButton,     SIGNAL(clicked()), SLOT(openDVD()));
+ 
+-    m_seekslider = new SeekSlider(m_frame);
+-    topLayout->addWidget(m_seekslider);
++    mediaLayout->addStretch();
+ 
+-    QFrame *frame0 = new QFrame(m_frame);
+-    topLayout->addWidget(frame0);
+-    QHBoxLayout *hlayout = new QHBoxLayout(frame0);
+-    hlayout->setMargin(0);
+-
+-    QFrame *frame1 = new QFrame(frame0);
+-    hlayout->addWidget(frame1);
+-    QHBoxLayout *vlayout = new QHBoxLayout(frame1);
+-    vlayout->setMargin(0);
++    QVBoxLayout *buttonLayout = new QVBoxLayout();
++    buttonLayout->setMargin(0);
++    buttonLayout->setSpacing(4);
++    subLayout->addLayout(buttonLayout);
++
++    QHBoxLayout *mediaControlsLayout = new QHBoxLayout();
++    mediaControlsLayout->setMargin(0);
++    mediaControlsLayout->setSpacing(2);
++    buttonLayout->addLayout(mediaControlsLayout);
+ 
+     // playback controls
+-    m_play = new QToolButton(frame1);
++    m_play = new QToolButton(m_frame);
+     m_play->setIconSize(QSize(32, 32));
+-    m_play->setText("play");
++    m_play->setFixedSize(36, 36);
++    m_play->setToolTip("play");
+     m_play->setIcon(KIcon("media-playback-start"));
+-    vlayout->addWidget(m_play);
++    mediaControlsLayout->addWidget(m_play);
+ 
+-    m_pause = new QToolButton(frame1);
++    m_pause = new QToolButton(m_frame);
+     m_pause->setIconSize(QSize(32, 32));
+-    m_pause->setText("pause");
++    m_pause->setFixedSize(36, 36);
++    m_pause->setToolTip("pause");
+     m_pause->setIcon(KIcon("media-playback-pause"));
+-    vlayout->addWidget(m_pause);
++    mediaControlsLayout->addWidget(m_pause);
+ 
+-    m_stop = new QToolButton(frame1);
++    m_stop = new QToolButton(m_frame);
+     m_stop->setIconSize(QSize(32, 32));
+-    m_stop->setText("stop");
++    m_stop->setFixedSize(36, 36);
++    m_stop->setToolTip("stop");
+     m_stop->setIcon(KIcon("media-playback-stop"));
+-    vlayout->addWidget(m_stop);
++    mediaControlsLayout->addWidget(m_stop);
+ 
+-    m_titleButton = new QToolButton(frame1);
++    m_titleButton = new QPushButton(m_frame);
+     m_titleButton->setText("Title");
+     m_titleButton->setCheckable(true);
+-    vlayout->addWidget(m_titleButton);
+-    m_chapterButton = new QToolButton(frame1);
++    buttonLayout->addWidget(m_titleButton);
++    m_chapterButton = new QPushButton(m_frame);
+     m_chapterButton->setText("Chapter");
+     m_chapterButton->setCheckable(true);
+-    vlayout->addWidget(m_chapterButton);
+-    m_angleButton = new QToolButton(frame1);
++    buttonLayout->addWidget(m_chapterButton);
++    m_angleButton = new QPushButton(m_frame);
+     m_angleButton->setText("Angle");
+     m_angleButton->setCheckable(true);
+-    vlayout->addWidget(m_angleButton);
+-    m_navigationButton = new QToolButton(frame1);
++    buttonLayout->addWidget(m_angleButton);
++    m_navigationButton = new QPushButton(m_frame);
+     m_navigationButton->setText("Navigation");
+     m_navigationButton->setCheckable(true);
+-    vlayout->addWidget(m_navigationButton);
++    buttonLayout->addWidget(m_navigationButton);
+     connect(m_titleButton, SIGNAL(toggled(bool)), SLOT(showTitleWidget(bool)));
+     connect(m_chapterButton, SIGNAL(toggled(bool)), SLOT(showChapterWidget(bool)));
+     connect(m_angleButton, SIGNAL(toggled(bool)), SLOT(showAngleWidget(bool)));
+     connect(m_navigationButton, SIGNAL(toggled(bool)), SLOT(showNavigationWidget(bool)));
+ 
+-    QFrame *frame2 = new QFrame(frame0);
+-    hlayout->addWidget(frame2);
+-    QVBoxLayout *vlayout2 = new QVBoxLayout(frame2);
+-    vlayout2->setMargin(0);
++    QVBoxLayout *infoLayout = new QVBoxLayout();
++    infoLayout->setMargin(0);
++    infoLayout->setSpacing(4);
++    subLayout->addLayout(infoLayout);
+ 
+     // state label
+-    m_statelabel = new QLabel(frame2);
+-    vlayout2->addWidget(m_statelabel);
++    m_statelabel = new QLabel(m_frame);
++    infoLayout->addWidget(m_statelabel);
+ 
+     // buffer progressbar
+-    m_bufferProgress = new QProgressBar(frame2);
++    m_bufferProgress = new QProgressBar(m_frame);
+     m_bufferProgress->setMaximumSize(100, 16);
+     m_bufferProgress->setTextVisible(false);
+-    vlayout2->addWidget(m_bufferProgress);
++    infoLayout->addWidget(m_bufferProgress);
+ 
+     // time info
+-    m_totaltime = new QLabel(frame2);
+-    vlayout2->addWidget(m_totaltime);
++    m_totaltime = new QLabel(m_frame);
++    infoLayout->addWidget(m_totaltime);
+ 
+-    m_currenttime = new QLabel(frame2);
+-    vlayout2->addWidget(m_currenttime);
++    m_currenttime = new QLabel(m_frame);
++    infoLayout->addWidget(m_currenttime);
+ 
+-    m_remainingtime = new QLabel(frame2);
+-    vlayout2->addWidget(m_remainingtime);
++    m_remainingtime = new QLabel(m_frame);
++    infoLayout->addWidget(m_remainingtime);
++    infoLayout->addStretch();
+ 
+     // meta data
+     m_metaDataLabel = new QLabel(m_frame);
+-    topLayout->addWidget(m_metaDataLabel);
++    m_metaDataLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
++    m_metaDataLabel->setWordWrap(true);
++    {
++        QFont f = m_metaDataLabel->font();
++        f.setPointSizeF(f.pointSizeF() * 0.85);
++        m_metaDataLabel->setFont(f);
++    }
++    subLayout->addWidget(m_metaDataLabel);
+ 
+     connect(&m_media, SIGNAL(metaDataChanged()), SLOT(updateMetaData()));
+     m_seekslider->setMediaObject(&m_media);
+--- a/phonon/tests/guitest/widgetrectitem.h
++++ b/phonon/tests/guitest/widgetrectitem.h
+@@ -29,9 +29,13 @@
+ class WidgetRectItem : public QObject, public QGraphicsRectItem
+ {
+     Q_OBJECT
+-    public:
++    protected:
++        WidgetRectItem(QGraphicsItem *parent, QGraphicsView *widget);
+         WidgetRectItem(const QPoint &pos, QGraphicsView *widget);
+ 
++    public:
++        ~WidgetRectItem();
++
+         void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+ 
+         enum { Type = UserType + 1 };
+@@ -40,15 +44,20 @@
+         QObject *qObject() { return this; }
+         const QObject *qObject() const { return this; }
+ 
++        bool eventFilter(QObject *obj, QEvent *e);
++
+     signals:
+-        void itemMoved(const QPointF &newSceneCenterPos);
++        void itemMoved(const QRectF &newSceneCenterPos);
+ 
+     protected:
++        void setTitle(const QString &title);
++
+         QVariant itemChange(GraphicsItemChange change, const QVariant &value);
+         QWidget *m_frame;
+ 
+     private:
+         QGraphicsView *m_view;
++        QString m_title;
+ };
+ 
+ #endif // WIDGETRECTITEM_H
+--- a/phonon/tests/guitest/sinkitem.h
++++ b/phonon/tests/guitest/sinkitem.h
+@@ -29,15 +29,19 @@
+ class SinkItem : public WidgetRectItem
+ {
+     public:
+-        SinkItem(const QPoint &pos, QGraphicsView *widget)
+-            : WidgetRectItem(pos, widget)
+-        {}
+-
+         enum { Type = UserType + 3 };
+         int type() const { return Type; }
+ 
+         virtual MediaNode *mediaNode() = 0;
+         virtual const MediaNode *mediaNode() const = 0;
++
++    protected:
++        SinkItem(QGraphicsItem *parent, QGraphicsView *widget)
++            : WidgetRectItem(parent, widget)
++        {}
++        SinkItem(const QPoint &pos, QGraphicsView *widget)
++            : WidgetRectItem(pos, widget)
++        {}
+ };
+ 
+ #endif // SINKITEM_H
+--- a/phonon/tests/guitest/mygraphicsscene.h
++++ b/phonon/tests/guitest/mygraphicsscene.h
+@@ -31,9 +31,11 @@
+     Q_OBJECT
+     public:
+         MyGraphicsScene(QObject *parent)
+-            : QGraphicsScene(parent),  m_lineItem(0)
++            : QGraphicsScene(parent),  m_lineItem(0), m_view(0)
+         {}
+ 
++        void setView(QGraphicsView *v) { m_view = v; }
++
+     protected:
+         void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
+         void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
+@@ -42,6 +44,7 @@
+     private:
+         QGraphicsLineItem *m_lineItem;
+         WidgetRectItem *m_startItem;
++        QGraphicsView *m_view;
+ };
+ 
+ #endif // MYGRAPHICSSCENE_H
+--- a/phonon/tests/guitest/mediaobjectitem.h
++++ b/phonon/tests/guitest/mediaobjectitem.h
+@@ -32,6 +32,7 @@
+ #include <QtGui/QLabel>
+ #include <QtGui/QProgressBar>
+ #include <QtGui/QToolButton>
++class QPushButton;
+ 
+ using Phonon::MediaNode;
+ using Phonon::SeekSlider;
+@@ -69,10 +70,10 @@
+         QToolButton *m_play;
+         QToolButton *m_pause;
+         QToolButton *m_stop;
+-        QToolButton *m_titleButton;
+-        QToolButton *m_chapterButton;
+-        QToolButton *m_angleButton;
+-        QToolButton *m_navigationButton;
++        QPushButton *m_titleButton;
++        QPushButton *m_chapterButton;
++        QPushButton *m_angleButton;
++        QPushButton *m_navigationButton;
+         QLabel *m_statelabel;
+         QProgressBar *m_bufferProgress;
+         QLabel *m_totaltime;
+--- a/phonon/tests/guitest/CMakeLists.txt
++++ b/phonon/tests/guitest/CMakeLists.txt
+@@ -4,6 +4,7 @@
+    anglewidget.cpp
+    audiooutputitem.cpp
+    chapterwidget.cpp
++   effectitem.cpp
+    main.cpp
+    mediaobjectitem.cpp
+    mygraphicsscene.cpp
+--- a/phonon/tests/fakebackend/volumefadereffect.cpp
++++ b/phonon/tests/fakebackend/volumefadereffect.cpp
+@@ -24,8 +24,7 @@
+ {
+ namespace Fake
+ {
+-static const int SAMPLE_RATE = 44100;
+-static const float SAMPLE_RATE_FLOAT = 44100.0f;
++static const int VOLUMEFADEREFFECT_SAMPLE_RATE = 44100;
+ 
+ VolumeFaderEffect::VolumeFaderEffect(QObject *parent)
+     : Effect(-1, parent), m_fadeTime(0)
+@@ -76,7 +75,7 @@
+     m_fadeTime = fadeTime;
+     m_endvolume = volume;
+     m_fadePosition = 0;
+-    m_fadeLength = fadeTime * SAMPLE_RATE;
++    m_fadeLength = fadeTime * VOLUMEFADEREFFECT_SAMPLE_RATE;
+ }
+ 
+ void VolumeFaderEffect::processBuffer(QVector<float> &buffer)
+--- a/phonon/tests/fakebackend/fake.desktop
++++ b/phonon/tests/fakebackend/fake.desktop
+@@ -13,18 +13,23 @@
+ Name[csb]=Sztëczny
+ Name[el]=Πλασματικό
+ Name[es]=Falso
++Name[et]=Liba
+ Name[ga]=Bréag
+ Name[he]=זיוף
+ Name[hu]=Hamis
+ Name[it]=Falso
++Name[km]=បន្លំ
+ Name[kn]=ಫೇಕ್
+ Name[ko]=가짜
++Name[lv]=Neīsts
+ Name[nds]=Namaakt
+ Name[ne]=झुटा
+ Name[pa]=ਫ਼ਰਜ਼ੀ
+ Name[pt]=Falsa
+ Name[pt_BR]=Falso
+ Name[sl]=Ponaredek
++Name[sr]=Лажна
++Name[sr at latin]=Lažna
+ Name[sv]=Test
+ Name[vi]=Giả
+ Name[wa]=Fås
+@@ -36,6 +41,7 @@
+ Comment[de]=Test-Backend
+ Comment[el]=Δοκιμαστικό σύστημα υποστήριξης
+ Comment[es]=Motor de pruebas
++Comment[et]=Testtaustaprogramm
+ Comment[fa]=پایانه پشتیبانی آزمون
+ Comment[ga]=Inneall Tástála
+ Comment[he]=ממשק בדיקה
+@@ -43,8 +49,11 @@
+ Comment[it]=Prova motore
+ Comment[ja]=テストバックエンド
+ Comment[kk]=Сынақ тетігі
++Comment[km]=កម្មវិធី​ខាងក្រោយ​ការ​សាកល្បង
+ Comment[kn]=ಪರೀಕ್ಷಣಾ ಹಿಂಬದಿ (ಬಾಕ್ ಎಂಡ್)
+ Comment[ko]=테스트 백엔드
++Comment[lv]=Aizmugures testēšana
++Comment[nb]=Tester bakstykke
+ Comment[nds]=Utprobeer-Hülpprogramm
+ Comment[ne]=परीक्षण ब्याकइन्ड
+ Comment[nl]=Test-backend
+@@ -52,8 +61,11 @@
+ Comment[pt]=Infra-Estrutura de Testes
+ Comment[pt_BR]=Testando backend
+ Comment[sl]=Ogrodje za testiranje
++Comment[sr]=Пробна позадина
++Comment[sr at latin]=Probna pozadina
+ Comment[sv]=Testgränssnitt
+ Comment[th]=โปรแกรมเบื้องหลังสำหรับทดสอบ
++Comment[uk]=Програма тестування
+ Comment[vi]=Đang thử ra hậu phương
+ Comment[wa]=Saye do programe fondmint
+ Comment[x-test]=xxTesting Backendxx
+--- a/phonon/kcm/kcm_phonon.desktop
++++ b/phonon/kcm/kcm_phonon.desktop
+@@ -1,6 +1,6 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+-Exec=kcmshell kcm_phonon
++Exec=kcmshell4 kcm_phonon
+ Icon=preferences-desktop-sound
+ Type=Service
+ ServiceTypes=KCModule
+@@ -13,25 +13,35 @@
+ 
+ Name=Sound
+ Name[be]=Гук
++Name[br]=Son
+ Name[ca]=So
+ Name[cs]=Zvuk
+ Name[el]=Ήχος
+ Name[eo]=Sono
+ Name[es]=Sonido
++Name[et]=Heli
++Name[fi]=Ääni
+ Name[ga]=Fuaim
+ Name[hu]=Hang
+ Name[it]=Suono
+ Name[ja]=サウンド
++Name[kk]=Дыбыс
+ Name[km]=សំឡេង
++Name[lv]=Skaņa
++Name[nb]=Lyd
+ Name[nds]=Klang
+ Name[nl]=Geluid
++Name[oc]=Son
+ Name[pa]=ਸਾਊਂਡ
+ Name[pt]=Som
+ Name[pt_BR]=Som
+ Name[ru]=Звук
+ Name[sl]=Zvok
++Name[sr]=Звук
++Name[sr at latin]=Zvuk
+ Name[sv]=Ljud
+ Name[th]=เสียง
++Name[uk]=Звук
+ Name[wa]=Son
+ Name[x-test]=xxSoundxx
+ Name[zh_CN]=声音
+@@ -39,6 +49,7 @@
+ Comment=Sound System Configuration
+ Comment[ar]=ضبط نظام الصوت
+ Comment[be]=Настаўленні гукавай сістэмы
++Comment[br]=Kefluniadur ar reizhiad son
+ Comment[ca]=Configuració del sistema de so
+ Comment[cs]=Nastavení zvukového systému
+ Comment[csb]=Systemòwé òdkôzanié w KDE
+@@ -46,7 +57,9 @@
+ Comment[el]=Ρύθμιση συστήματος ήχου
+ Comment[eo]=Sonsistema Agordo
+ Comment[es]=Configuración del sistema de sonido
++Comment[et]=Helisüsteemi seadistamine
+ Comment[fa]=پیکربندی سیستم صوت
++Comment[fi]=Äänijärjestelmän hallinta
+ Comment[ga]=Cumraíocht an Chórais Fuaime
+ Comment[he]=הגדרות מערכת הצליל
+ Comment[hu]=Hangrendszer-beállítás
+@@ -57,6 +70,7 @@
+ Comment[kn]=ಧ್ವನಿ ವ್ಯವಸ್ಥೆಯ ಸಂರಚನೆ
+ Comment[ko]=사운드 시스템 설정
+ Comment[lv]=Skaņas sistēmas konfigurācija
++Comment[nb]=Oppsett av lydsystemet
+ Comment[nds]=Klangsysteem instellen
+ Comment[ne]=ध्वनि प्रणाली कन्फिगरेसन
+ Comment[nl]=Geluidssysteem instellen
+@@ -65,9 +79,12 @@
+ Comment[pt_BR]=Configurações do Sistema de Som
+ Comment[ru]=Настройка звуковой подсистемы
+ Comment[sl]=Nastavitev zvočnega sistema
++Comment[sr]=Подешавање звучног система
++Comment[sr at latin]=Podešavanje zvučnog sistema
+ Comment[sv]=Ljudsysteminställning
+ Comment[te]=శబ్ద వ్యవస్థ అమరిక
+ Comment[th]=การปรับแต่งระบบเสียง
++Comment[uk]=Налаштування системи звуку
+ Comment[vi]=Cấu hình Hệ thống Âm thanh
+ Comment[wa]=Apontiaedje do sistinme di son
+ Comment[x-test]=xxSound System Configurationxx
+@@ -78,6 +95,7 @@
+ Keywords[ca]=So,Phonon,Àudio,Vídeo,Sortida,Dispositiu,Notificació,Música,Comunicació,Suport,NMM,GStreamer,Xine
+ Keywords[el]=Ήχος,Βίντεο,Έξοδος,Συσκευή,Ειδοποίηση,Μουσική,Μέσα,Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine
+ Keywords[es]=Sonido,Phonon,Audio,Vídeo,Salida,Dispositivo,Notificación,Música,Comunicación,Medios,NMM,GStreamer,Xine
++Keywords[et]=Heli,Phonon,Audio,Video,Väljund,Seade,Märguanne,Muusika,Suhtlemine,Meedia,NMM,GStreamer,Xine
+ Keywords[fa]=صوت، Phonon، صوتی، ویدئویی، خروجی، دستگاه، اخطار، موسیقی، ارتباط، رسانه، NMM، GStreamer، Xine
+ Keywords[ga]=Fuaim,Phonon,Fís,Aschur,Gléas,Fógairt,Ceol,Cumarsáid,Meáin,NMM,GStreamer,Xine
+ Keywords[he]=צליל,Phonon,שמע,וידאו,פלט,התקן,הודעות,מוזיקה,תקשורת,מדיה,NMM,GStreamer,Xine
+@@ -85,11 +103,15 @@
+ Keywords[it]=Suono,Phonon,Audio,Video,Output,Dispositivo,Notifica,Musica,Comunicazione,Supporto,Media,NMM,GStreamer,Xine
+ Keywords[ja]=サウンド,Phonon,オーディオ,ビデオ,動画,出力,デバイス,通知,音楽,通信,メディア,NMM,GStreamer,Xine
+ Keywords[ko]=소리,Phonon,오디오,비디오,출력,알림,음악,미디어,Xine,GStreamer
++Keywords[lv]=Skaņa,Phonon,Audio,Video,Izvade,Iekārta,Paziņojums,Mūzika,Komunikācijas,Mēdiji,NMM,GStreamer,Xine
++Keywords[nb]=Lyd,Phonon,Audio,Video,Utgang,Enhet,Varsling,Musikk,Kommunikasjon,Media,NMM,GStreamer,Xine
+ Keywords[nds]=Klang,Phonon,Audio,Video,Utgaav,Reedschap,Bescheed,Musik,Kommunikatschoon,Medien,NMM,GStreamer,Xine
+ Keywords[nl]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,Geluid,Muziek,Communicatie,Uitvoer
+ Keywords[pt]=Som,Phonon,Áudio,Vídeo,Saída,Dispositivo,Notificação,Música,Comunicação,Multimédia,NMM,GStreamer,Xine
+ Keywords[pt_BR]=Som,Phonon,Audio,Vídeo,Saída,Dispositivo,Notificação,Música,Comunicação,Mídia,NMM,GStreamer,Xine
+ Keywords[sl]=zvok,Phonon,audio,avdio,video,izhod,naprava,glasba,komunikacija,NMM,GStreamer,Xine,obvestila
++Keywords[sr]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,Фонон,звук,аудио,видео,излаз,уређај,обавештења,музика,комуникација,медија,Ксине,Гстример
++Keywords[sr at latin]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,Phonon,zvuk,audio,video,izlaz,uređaj,obaveštenja,muzika,komunikacija,medija,Xine,GStreamer
+ Keywords[sv]=Ljud,Phonon,video,utmatning,enhet,underrättelse,musik,kommunikation,media,NMM,GStreamer,Xine
+ Keywords[th]=เสียง,Phonon,เสียง,วิดีโอ,แสดงผล,อุปกรณ์,การแจ้งเตือน,ดนตรี,การสื่อสาร, สื่อ,NMM,Gstreamer,Xine
+ Keywords[vi]=Sound,Âm thanh,Phonon,Phô-non,Audio,Video,Ảnh động,Output,Xuất,Device,Thiết bị,Notification,Thông báo,Music,Nhạc,Communication,Liên lạc,Giao thông,Media,Vật chứa,Phương tiện,NMM,GStreamer,Xine
+--- a/phonon/kcm/outputdevicechoice.cpp
++++ b/phonon/kcm/outputdevicechoice.cpp
+@@ -204,7 +204,7 @@
+         QHash<int, Phonon::AudioOutputDevice> hashCopy(hash);
+         QList<Phonon::AudioOutputDevice> orderedList;
+         if (model->rowCount() > 0) {
+-            QList<int> order = m_outputModel.value(i)->tupleIndexOrder();
++            QList<int> order = model->tupleIndexOrder();
+             foreach (int idx, order) {
+                 if (hashCopy.contains(idx)) {
+                     orderedList << hashCopy.take(idx);
+--- a/phonon/CMakeLists.txt
++++ b/phonon/CMakeLists.txt
+@@ -90,4 +90,3 @@
+ 	DESTINATION ${INCLUDE_INSTALL_DIR}/phonon)
+ install( FILES  phononbackend.desktop  DESTINATION  ${SERVICETYPES_INSTALL_DIR} )
+ install( FILES org.kde.Phonon.AudioOutput.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
+-install(FILES phonon.notifyrc DESTINATION ${DATA_INSTALL_DIR}/phonon)
+--- a/phonon/path.cpp
++++ b/phonon/path.cpp
+@@ -115,6 +115,7 @@
+         //append
+         rightNode = d->sinkNode->k_ptr->backendObject();
+     } else {
++        Q_ASSERT(insertBefore);
+         rightNode = insertBefore->k_ptr->backendObject();
+     }
+ 
+--- a/phonon/effectwidget.cpp
++++ b/phonon/effectwidget.cpp
+@@ -30,6 +30,7 @@
+ #include <QtGui/QLabel>
+ #include <QtGui/QSpinBox>
+ #include <QtGui/QCheckBox>
++#include <QtGui/QComboBox>
+ 
+ namespace Phonon
+ {
+@@ -72,6 +73,7 @@
+ {
+     Q_Q(EffectWidget);
+     QVBoxLayout *mainLayout = new QVBoxLayout(q);
++    mainLayout->setMargin(0);
+     foreach (EffectParameter para, effect->parameters()) {
+         QVariant value = effect->parameterValue(para);
+         QHBoxLayout *pLayout = new QHBoxLayout;
+@@ -83,8 +85,25 @@
+         label->setToolTip(para.description());
+ 
+         QWidget *control;
+-        if (para.type() == QVariant::Bool)
+-        {
++        if (para.type() == QVariant::List) {
++            QComboBox *cb = new QComboBox(q);
++            control = cb;
++            if (value.type() == QVariant::Int) {
++                foreach (const QVariant &item, para.possibleValues()) {
++                    cb->addItem(item.toString());
++                }
++                cb->setCurrentIndex(value.toInt());
++                QObject::connect(cb, SIGNAL(currentIndexChanged(int)), q, SLOT(_k_setIntParameter(int)));
++            } else {
++                foreach (const QVariant &item, para.possibleValues()) {
++                    cb->addItem(item.toString());
++                    if (item == value) {
++                        cb->setCurrentIndex(cb->count() - 1);
++                    }
++                }
++                QObject::connect(cb, SIGNAL(currentIndexChanged(QString)), q, SLOT(_k_setStringParameter(QString)));
++            }
++        } else if (para.type() == QVariant::Bool) {
+             QCheckBox *cb = new QCheckBox(q);
+             control = cb;
+             cb->setChecked(value.toBool());
+@@ -153,6 +172,14 @@
+     }
+ }
+ 
++void EffectWidgetPrivate::_k_setStringParameter(const QString &value)
++{
++    Q_Q(EffectWidget);
++    if (parameterForObject.contains(q->sender())) {
++        effect->setParameterValue(parameterForObject[q->sender()], value);
++    }
++}
++
+ } // namespace Phonon
+ 
+ #include "moc_effectwidget.cpp"
+--- a/phonon/phononbackend.desktop
++++ b/phonon/phononbackend.desktop
+@@ -10,6 +10,7 @@
+ Name[el]=Σύστημα υποστήριξης πολυμέσων του KDE
+ Name[eo]=KDE Multmedia Ilo
+ Name[es]=Motor multimedia de KDE
++Name[et]=KDE multimeedia taustaprogramm
+ Name[fa]=پایانۀ پشتیبانی چندرسانه‌ای KDE
+ Name[ga]=Inneall Il-mheán KDE
+ Name[he]=ממשק מולטימדיה של KDE
+@@ -17,9 +18,11 @@
+ Name[it]=Motore multimediale KDE
+ Name[ja]=KDE マルチメディアバックエンド
+ Name[kk]=KDE мультимедиа тетігі
++Name[km]=កម្មវិធី​ខាងក្រោយ​ពហុព័ត៌មាន​របស់ KDE
+ Name[kn]=ಕೆಡಿಇ ಬಹುಮಾಧ್ಯಮ (ಮಲ್ಟಿಮೀಡಿಯಾ) ಹಿಂಬದಿ (ಬಾಕ್ ಎಂಡ್)
+ Name[ko]=KDE 멀티미디어 백엔드
+ Name[lv]=KDE multimēdijas aizmugure
++Name[nb]=KDE Multimedia bakstykke
+ Name[nds]=KDE-Multimedia-Hülpprogramm
+ Name[ne]=केडीई मल्टिमिडिया ब्याकइन्ड
+ Name[nl]=KDE-multimedia-backend
+@@ -27,6 +30,8 @@
+ Name[pt]=Infra-Estrutura Multimédia do KDE
+ Name[pt_BR]=Backend do KDE Multimída
+ Name[sl]=KDE-jevo ogrodje za večpredstavnost
++Name[sr]=КДЕ-ова мултимедијска позадина
++Name[sr at latin]=KDE-ova multimedijska pozadina
+ Name[sv]=KDE:s multimediagränssnitt
+ Name[te]=కెడిఈ బహుళ మాద్యమం బేక్ ఎండ్
+ Name[th]=โปรแกรมเบื้องหลังเกี่ยวกับมัลติมีเดียของ KDE
+--- a/kconf_update/kconf_update.cpp
++++ b/kconf_update/kconf_update.cpp
+@@ -500,7 +500,7 @@
+ 
+    if (!oldFile.isEmpty())
+    {
+-      oldConfig2 = new KConfig(oldFile, KConfig::CascadeConfig);
++      oldConfig2 = new KConfig(oldFile, KConfig::NoGlobals);
+       QString cfg_id = currentFilename + ':' + id;
+       KConfigGroup cg(oldConfig2, "$Version");
+       QStringList ids = cg.readEntry("update_info", QStringList());
+@@ -513,7 +513,7 @@
+ 
+       if (!newFile.isEmpty())
+       {
+-         newConfig = new KConfig(newFile, KConfig::CascadeConfig);
++         newConfig = new KConfig(newFile, KConfig::NoGlobals);
+          KConfigGroup cg(newConfig, "$Version");
+          ids = cg.readEntry("update_info", QStringList());
+          if (ids.contains(cfg_id))
+@@ -527,7 +527,7 @@
+          newConfig = oldConfig2;
+       }
+ 
+-      oldConfig1 = new KConfig(oldFile, KConfig::CascadeConfig);
++      oldConfig1 = new KConfig(oldFile, KConfig::NoGlobals);
+    }
+    else
+    {
+@@ -918,7 +918,7 @@
+      KConfig *saveOldConfig1 = oldConfig1;
+      QString saveOldGroup = oldGroup;
+      QString saveNewGroup = newGroup;
+-     oldConfig1 = new KConfig(tmp2.fileName(), KConfig::CascadeConfig);
++     oldConfig1 = new KConfig(tmp2.fileName(), KConfig::NoGlobals);
+ 
+      // For all groups...
+      QStringList grpList = oldConfig1->groupList();
+--- a/kparts/krop.desktop
++++ b/kparts/krop.desktop
+@@ -37,7 +37,7 @@
+ Comment[ko]=KDE 구성 요소
+ Comment[lb]=KDE-Komponent
+ Comment[lt]=KDE komponentas
+-Comment[lv]=KDE Komponente
++Comment[lv]=KDE komponente
+ Comment[mk]=KDE компонента
+ Comment[ms]=Komponen KDE
+ Comment[nb]=KDE-komponent
+@@ -53,8 +53,8 @@
+ Comment[ru]=Компонент KDE
+ Comment[se]=KDE oassi
+ Comment[sl]=Komponenta KDE
+-Comment[sr]=KDE-ова компонента
+-Comment[sr at latin]=KDE-ova komponenta
++Comment[sr]=КДЕ компонента
++Comment[sr at latin]=KDE komponenta
+ Comment[sv]=KDE-komponent
+ Comment[ta]=கேடிஇ பகுதி
+ Comment[te]=కెడిఈ అంశం
+--- a/kparts/krwp.desktop
++++ b/kparts/krwp.desktop
+@@ -37,7 +37,7 @@
+ Comment[ko]=KDE 구성 요소
+ Comment[lb]=KDE-Komponent
+ Comment[lt]=KDE komponentas
+-Comment[lv]=KDE Komponente
++Comment[lv]=KDE komponente
+ Comment[mk]=KDE компонента
+ Comment[ms]=Komponen KDE
+ Comment[nb]=KDE-komponent
+@@ -53,8 +53,8 @@
+ Comment[ru]=Компонент KDE
+ Comment[se]=KDE oassi
+ Comment[sl]=Komponenta KDE
+-Comment[sr]=KDE-ова компонента
+-Comment[sr at latin]=KDE-ova komponenta
++Comment[sr]=КДЕ компонента
++Comment[sr at latin]=KDE komponenta
+ Comment[sv]=KDE-komponent
+ Comment[ta]=கேடிஇ பகுதி
+ Comment[te]=కెడిఈ అంశం
+--- a/kparts/browserview.desktop
++++ b/kparts/browserview.desktop
+@@ -37,7 +37,7 @@
+ Name[ko]=탐색기 보기
+ Name[lb]=Browser-Siicht
+ Name[lt]=Rodyti naršyklėje
+-Name[lv]=Pārlūka Skatījums
++Name[lv]=Pārlūka skatījums
+ Name[mk]=Разгледување
+ Name[ms]=Pelihat Pelayar
+ Name[nb]=Nettleservisning
+@@ -53,8 +53,8 @@
+ Name[ru]=Вид страницы
+ Name[se]=Fierpmádatlogana čájeheapmi
+ Name[sl]=Pogled brskalnika
+-Name[sr]=Претраживачев приказ
+-Name[sr at latin]=Pretraživačev prikaz
++Name[sr]=Прегледачки приказ
++Name[sr at latin]=Pregledački prikaz
+ Name[sv]=Surfvy
+ Name[ta]=உலாவிக் காட்சி
+ Name[te]=అన్వేషి వీక్షణం
+--- a/kparts/kpart.desktop
++++ b/kparts/kpart.desktop
+@@ -36,7 +36,7 @@
+ Comment[ko]=KDE 구성 요소
+ Comment[lb]=KDE-Komponent
+ Comment[lt]=KDE komponentas
+-Comment[lv]=KDE Komponente
++Comment[lv]=KDE komponente
+ Comment[mk]=KDE компонента
+ Comment[ms]=Komponen KDE
+ Comment[nb]=KDE-komponent
+@@ -52,8 +52,8 @@
+ Comment[ru]=Компонент KDE
+ Comment[se]=KDE oassi
+ Comment[sl]=Komponenta KDE
+-Comment[sr]=KDE-ова компонента
+-Comment[sr at latin]=KDE-ova komponenta
++Comment[sr]=КДЕ компонента
++Comment[sr at latin]=KDE komponenta
+ Comment[sv]=KDE-komponent
+ Comment[ta]=கேடிஇ பகுதி
+ Comment[te]=కెడిఈ అంశం
+--- a/kparts/browserrun.cpp
++++ b/kparts/browserrun.cpp
+@@ -177,7 +177,7 @@
+       // assumed it was a file.
+       kDebug(1000) << "It is in fact a directory!";
+       // Update our URL in case of a redirection
+-      KRun::url() = static_cast<KIO::TransferJob *>(job)->url();
++      KRun::setUrl( static_cast<KIO::TransferJob *>(job)->url() );
+       setJob( 0 );
+       foundMimeType( "inode/directory" );
+   }
+@@ -197,7 +197,7 @@
+   // Update our URL in case of a redirection
+   //kDebug(1000) << "old URL=" << KRun::url();
+   //kDebug(1000) << "new URL=" << job->url();
+-  KRun::url() = job->url();
++  setUrl( job->url() );
+   kDebug(1000) << "slotBrowserMimetype: found" << type << "for" << KRun::url();
+ 
+   // Suggested filename given by the server (e.g. HTTP content-disposition)
+@@ -393,8 +393,8 @@
+     // only use the downloadmanager for non-local urls
+     if ( !url.isLocalFile() )
+     {
+-        KConfigGroup cfg = KSharedConfig::openConfig("konquerorrc", KConfig::CascadeConfig)->group("HTML Settings");
+-        QString downloadManger = cfg.readPathEntry("DownloadManager");
++        KConfigGroup cfg = KSharedConfig::openConfig("konquerorrc", KConfig::NoGlobals)->group("HTML Settings");
++        QString downloadManger = cfg.readPathEntry("DownloadManager", QString());
+         if (!downloadManger.isEmpty())
+         {
+             // then find the download manager location
+@@ -488,11 +488,12 @@
+     KUrl newURL(QString("error:/?error=%1&errText=%2")
+                 .arg( error )
+                 .arg( QString::fromUtf8( QUrl::toPercentEncoding( errorText ) ) ) );
+-    KRun::url().setPass( QString() ); // don't put the password in the error URL
++    KUrl runURL = KRun::url();
++    runURL.setPass( QString() ); // don't put the password in the error URL
+ 
+     KUrl::List lst;
+-    lst << newURL << KRun::url();
+-    KRun::url() = KUrl::join( lst );
++    lst << newURL << runURL;
++    KRun::setUrl( KUrl::join( lst ) );
+     //kDebug(1202) << "BrowserRun::handleError KRun::url()=" << ;
+ 
+     setJob( 0 );
+--- a/includes/KPrintAction
++++ /dev/null
+@@ -1 +0,0 @@
+-#include "../kprintaction.h"
+--- a/includes/KPReloadObject
++++ /dev/null
+@@ -1 +0,0 @@
+-#include "../kdeprint/kpreloadobject.h"
+--- a/includes/KPrintDialog
++++ /dev/null
+@@ -1 +0,0 @@
+-#include "../kdeprint/kprintdialog.h"
+--- a/includes/KPrintDialogPage
++++ /dev/null
+@@ -1 +0,0 @@
+-#include "../kdeprint/kprintdialogpage.h"
+--- a/includes/KPrinter
++++ /dev/null
+@@ -1 +0,0 @@
+-#include "../kprinter.h"
+--- a/includes/CMakeLists.txt
++++ b/includes/CMakeLists.txt
+@@ -264,7 +264,6 @@
+   KOperaBookmarkExporterImpl
+   KOperaBookmarkImporter
+   KOperaBookmarkImporterImpl
+-  KPReloadObject
+   KPageDialog
+   KPageModel
+   KPageView
+@@ -289,10 +288,6 @@
+   KPluginSelector
+   KPopupFrame
+   KPreviewWidgetBase
+-  KPrintAction
+-  KPrintDialog
+-  KPrintDialogPage
+-  KPrinter
+   KProcess
+   KProgressDialog
+   KPropertiesDialog
+--- a/sonnet/plugins/aspell/kspell_aspell.desktop
++++ b/sonnet/plugins/aspell/kspell_aspell.desktop
+@@ -16,6 +16,8 @@
+ Name[ar]=أسبل
+ Name[it]=Aspell
+ Name[kn]=ಎಸ್ಪೆಲ್
++Name[sr]=Аспел
++Name[sr at latin]=Aspell
+ Name[sv]=Aspell
+ Name[ta]=psதேர்ந்தெடு
+ Name[te]=ఏస్పెల్
+--- a/sonnet/plugins/enchant/kspell_enchant.desktop
++++ b/sonnet/plugins/enchant/kspell_enchant.desktop
+@@ -16,5 +16,6 @@
+ Name[ar]=إنشنت
+ Name[kn]=ಎಂಚಾಂಟ್
+ Name[ne]=मोहीत पार्नु
++Name[sr]=Енчант
+ Name[x-test]=xxEnchantxx
+ Name[zh_CN]=增强
+--- a/sonnet/plugins/enchant/enchantclient.h
++++ b/sonnet/plugins/enchant/enchantclient.h
+@@ -25,7 +25,7 @@
+ 
+ #include <QtCore/QSet>
+ #include <QtCore/QVariantList>
+-#include <enchant/enchant.h>
++#include <enchant.h>
+ 
+ namespace Sonnet {
+     class SpellerPlugin;
+--- a/sonnet/plugins/enchant/enchantdict.h
++++ b/sonnet/plugins/enchant/enchantdict.h
+@@ -22,7 +22,7 @@
+ 
+ #include "spellerplugin_p.h"
+ 
+-#include <enchant/enchant.h>
++#include <enchant.h>
+ 
+ class QSpellEnchantDict : public Sonnet::SpellerPlugin
+ {
+--- a/sonnet/plugins/hspell/kspell_hspell.desktop
++++ b/sonnet/plugins/hspell/kspell_hspell.desktop
+@@ -16,6 +16,8 @@
+ Name[ar]=ه‍ سبل
+ Name[kn]=ಎಚ್ ಸ್ಪೆಲ್
+ Name[ne]=एच स्पेल
++Name[sr]=Хспел
++Name[sr at latin]=Hspell
+ Name[sv]=Hspell
+ Name[te]=హెచ్ స్పెల్
+ Name[x-test]=xxHSpellxx
+--- a/kded/test/test.desktop
++++ b/kded/test/test.desktop
+@@ -41,7 +41,7 @@
+ Name[ko]=KDED 테스트 모듈
+ Name[lb]=KDED-Testmodul
+ Name[lt]=KDED testinis modulis
+-Name[lv]=KDED Testa Modulis
++Name[lv]=KDED testa modulis
+ Name[mk]=KDED Тест модул
+ Name[ms]=Modul Uji KDED
+ Name[nb]=KDED-testmodul
+@@ -56,7 +56,7 @@
+ Name[ru]=Тестовая служба KDED
+ Name[se]=KDED-geahččalanmoduvla
+ Name[sl]=Preizkusni modul KDED
+-Name[sr]=KDED пробни модул
++Name[sr]=КДЕД пробни модул
+ Name[sr at latin]=KDED probni modul
+ Name[sv]=KDED-testmodul
+ Name[ta]=KDED சோதனைக் கூறு
+@@ -106,7 +106,7 @@
+ Comment[ko]=KDED 테스트 모듈
+ Comment[lb]=En Testmodul fir KDED
+ Comment[lt]=KDED testinis modulis
+-Comment[lv]=KDED Testa Modulis
++Comment[lv]=KDED testa modulis
+ Comment[mk]=Тест модул за KDED
+ Comment[ms]=Modul Uji untuk KDED
+ Comment[nb]=En test-modul for KDED
+@@ -122,7 +122,7 @@
+ Comment[ru]=Тестовая служба KDED
+ Comment[se]=Geahččalanmoduvla KDED:a várás
+ Comment[sl]=Preizkusni modul za KDED
+-Comment[sr]=Пробни модул за KDED
++Comment[sr]=Пробни модул за КДЕД
+ Comment[sr at latin]=Probni modul za KDED
+ Comment[sv]=Testmodul för KDED
+ Comment[ta]=KDED சோதனைக் கூறு
+--- a/kded/kdedmodule.desktop
++++ b/kded/kdedmodule.desktop
+@@ -36,7 +36,7 @@
+ Comment[ko]=KDED 모듈
+ Comment[lb]=KDED-Modul
+ Comment[lt]=KDED modulis
+-Comment[lv]=KDED Modulis
++Comment[lv]=KDED modulis
+ Comment[mk]=KDED модул
+ Comment[ms]=Modul KDED
+ Comment[nb]=KDED-modul
+@@ -51,7 +51,7 @@
+ Comment[ru]=Служба KDED
+ Comment[se]=KDED-moduvla
+ Comment[sl]=Modul KDED
+-Comment[sr]=KDED модул
++Comment[sr]=КДЕД модул
+ Comment[sr at latin]=KDED modul
+ Comment[sv]=KDED-modul
+ Comment[ta]=KDED கூறு
+--- a/kded/DESIGN
++++ b/kded/DESIGN
+@@ -2,9 +2,9 @@
+ ====
+ 
+ kded is responsible for creating the sycoca file, i.e. the binary 
+-cache of servicetypes, mimetypes and services, for a particular user.
++cache of servicetypes, mimetypes, and services for a particular user.
+ 
+-It uses KDirWatch to monitor the directories contain the .desktop files.
++It uses KDirWatch to monitor the directories containing .desktop files.
+ When a file is added/removed, it waits 5 seconds (in case of series of
+ updates), and then launches kbuildsycoca.
+ 
+--- a/Mainpage.dox
++++ b/Mainpage.dox
+@@ -136,11 +136,6 @@
+         [ <a href="dnssd/html/index.html">Documentation</a> |
+           <a href="dnssd/html/classes.html">Classes</a> ]</dd>
+ 
+-    <dt>KDEfx</dt>
+-    <dd>KDE's graphic effects library.<br>
+-        [ <a href="kdefx/html/index.html">Documentation</a> |
+-          <a href="kdefx/html/classes.html">Classes</a> ]</dd>
+-
+     <dt>KJS</dt>
+     <dd>JavaScript (aka. ECMAScript and JScript) support.<br>
+         [ <a href="kjs/html/index.html">Documentation</a> |
+--- a/solid/tests/solidhwtest.h
++++ b/solid/tests/solidhwtest.h
+@@ -46,6 +46,7 @@
+     void testDeviceInterfaceIntrospectionCornerCases();
+     void testDeviceInterfaces();
+     void testPredicate();
++    void testSetupTeardown();
+ 
+     void slotPropertyChanged(const QMap<QString,int> &changes);
+ private:
+--- a/solid/tests/solidhwtest.cpp
++++ b/solid/tests/solidhwtest.cpp
+@@ -25,6 +25,7 @@
+ #include <solid/device.h>
+ #include <solid/genericinterface.h>
+ #include <solid/processor.h>
++#include <solid/storageaccess.h>
+ #include <solid/storagevolume.h>
+ #include <solid/predicate.h>
+ #include "solid/managerbase_p.h"
+@@ -444,10 +445,36 @@
+     QCOMPARE(list.size(), 0);
+ }
+ 
++void SolidHwTest::testSetupTeardown()
++{
++    Solid::StorageAccess *access;
++    {
++        Solid::Device device("/org/kde/solid/fakehw/volume_part1_size_993284096");
++        access = device.as<Solid::StorageAccess>();
++    }
++
++    QList<QVariant> args;
++    QSignalSpy spy(access, SIGNAL(accessibilityChanged(bool)));
++
++    access->teardown();
++
++    QCOMPARE(spy.count(), 1);
++    args = spy.takeFirst();
++    QCOMPARE(args.at(0).toBool(), false);
++
++    access->setup();
++
++    QCOMPARE(spy.count(), 1);
++    args = spy.takeFirst();
++    QCOMPARE(args.at(0).toBool(), true);
++
++}
++
+ void SolidHwTest::slotPropertyChanged(const QMap<QString,int> &changes)
+ {
+     m_changesList << changes;
+ }
+ 
++
+ #include "solidhwtest.moc"
+ 
+--- a/solid/solid/CMakeLists.txt
++++ b/solid/solid/CMakeLists.txt
+@@ -107,6 +107,7 @@
+    backends/fakehw/fakeportablemediaplayer.cpp
+    backends/fakehw/fakeprocessor.cpp
+    backends/fakehw/fakestorage.cpp
++   backends/fakehw/fakestorageaccess.cpp
+    backends/fakehw/fakevolume.cpp
+ )
+ 
+--- a/solid/solid/backends/hal/haldevice.cpp
++++ b/solid/solid/backends/hal/haldevice.cpp
+@@ -139,10 +139,14 @@
+ 
+     } else if (category=="storage") {
+ 
+-        if (property("storage.hotpluggable").toBool()) {
++        if (property("storage.drive_type").toString()=="floppy") {
++            return "media-floppy";
++        } else if (property("storage.drive_type").toString()=="cdrom") {
++            return "drive-optical";
++        } else if (property("storage.hotpluggable").toBool()) {
+             if (property("storage.bus").toString()=="usb") {
+                 if (property("storage.no_partitions_hint").toBool()
+-                 || property("storage.removable.media_size").toLongLong()<1000000000) {
++                 || property("storage.removable.media_size").toLongLong()<4000000000LL) {
+                     return "drive-removable-media-usb-pendrive";
+                 } else {
+                     return "drive-removable-media-usb";
+@@ -190,6 +194,9 @@
+             return "drive-harddisk";
+         }
+ 
++    } else if (category=="camera") {
++        return "camera-photo";
++
+     } else if (category=="input") {
+         QStringList capabilities = property("info.capabilities").toStringList();
+ 
+--- a/solid/solid/backends/fakehw/fakecomputer.xml
++++ b/solid/solid/backends/fakehw/fakecomputer.xml
+@@ -118,7 +118,7 @@
+                 <!-- A (generally) virtual volume tracking the floppy drive state -->
+                 <device udi="/org/kde/solid/fakehw/platform_floppy_0_storage_virt_volume">
+                     <property key="name">Floppy Disk</property>
+-                    <property key="interfaces">Block,StorageVolume</property>
++                    <property key="interfaces">Block,StorageVolume,StorageAccess</property>
+                     <property key="parent">/org/kde/solid/fakehw/platform_floppy_0_storage</property>
+ 
+                     <property key="minor">0</property>
+@@ -173,14 +173,14 @@
+                     -->
+                     <device udi="/org/kde/solid/fakehw/volume_uuid_feedface">
+                         <property key="name">/</property>
+-                        <property key="interfaces">Block,StorageVolume</property>
++                        <property key="interfaces">Block,StorageVolume,StorageAccess</property>
+                         <property key="parent">/org/kde/solid/fakehw/storage_serial_HD56890I</property>
+ 
+                         <property key="minor">1</property>
+                         <property key="major">3</property>
+                         <property key="device">/dev/hda1</property>
+ 
+-                        <property key="isIgnored">false</property>
++                        <property key="isIgnored">true</property>
+                         <property key="isMounted">true</property>
+                         <property key="mountPoint">/</property>
+                         <property key="usage">filesystem</property>
+@@ -191,14 +191,14 @@
+                     </device>
+                     <device udi="/org/kde/solid/fakehw/volume_uuid_c0ffee">
+                         <property key="name">/home</property>
+-                        <property key="interfaces">Block,StorageVolume</property>
++                        <property key="interfaces">Block,StorageVolume,StorageAccess</property>
+                         <property key="parent">/org/kde/solid/fakehw/storage_serial_HD56890I</property>
+ 
+                         <property key="minor">6</property>
+                         <property key="major">3</property>
+                         <property key="device">/dev/hda6</property>
+ 
+-                        <property key="isIgnored">false</property>
++                        <property key="isIgnored">true</property>
+                         <property key="isMounted">true</property>
+                         <property key="mountPoint">/home</property>
+                         <property key="usage">filesystem</property>
+@@ -209,7 +209,7 @@
+                     </device>
+                     <device udi="/org/kde/solid/fakehw/volume_uuid_f00ba7">
+                         <property key="name">/foreign</property>
+-                        <property key="interfaces">Block,StorageVolume</property>
++                        <property key="interfaces">Block,StorageVolume,StorageAccess</property>
+                         <property key="parent">/org/kde/solid/fakehw/storage_serial_HD56890I</property>
+ 
+                         <property key="minor">7</property>
+@@ -227,7 +227,7 @@
+                     </device>
+                     <device udi="/org/kde/solid/fakehw/volume_part2_size_1024">
+                         <property key="name">StorageVolume</property>
+-                        <property key="interfaces">Block,StorageVolume</property>
++                        <property key="interfaces">Block,StorageVolume,StorageAccess</property>
+                         <property key="parent">/org/kde/solid/fakehw/storage_serial_HD56890I</property>
+ 
+                         <property key="minor">2</property>
+@@ -241,7 +241,7 @@
+                     </device>
+                     <device udi="/org/kde/solid/fakehw/volume_part5_size_1048576">
+                         <property key="name">StorageVolume (swap)</property>
+-                        <property key="interfaces">Block,StorageVolume</property>
++                        <property key="interfaces">Block,StorageVolume,StorageAccess</property>
+                         <property key="parent">/org/kde/solid/fakehw/storage_serial_HD56890I</property>
+ 
+                         <property key="minor">5</property>
+@@ -295,7 +295,7 @@
+                     <!-- ... with a cd-r in it -->
+                     <device udi="/org/kde/solid/fakehw/volume_uuid_5011">
+                         <property key="name">FooDistro i386</property>
+-                        <property key="interfaces">Block,StorageVolume,OpticalDisc</property>
++                        <property key="interfaces">Block,StorageVolume,OpticalDisc,StorageAccess</property>
+                         <property key="parent">/org/kde/solid/fakehw/storage_model_solid_writer</property>
+ 
+                         <property key="discType">cd_rw</property>
+@@ -339,7 +339,7 @@
+                     <!-- ... with a DVD Video in it -->
+                     <device udi="/org/kde/solid/fakehw/volume_label_SOLIDMAN_BEGINS">
+                         <property key="name">SolidMan Begins</property>
+-                        <property key="interfaces">Block,StorageVolume,OpticalDisc</property>
++                        <property key="interfaces">Block,StorageVolume,OpticalDisc,StorageAccess</property>
+                         <property key="parent">/org/kde/solid/fakehw/storage_model_solid_reader</property>
+ 
+                         <property key="discType">dvd_rom</property>
+@@ -414,7 +414,7 @@
+                                     <!-- ... with a partition since it's a USB Mass Storage device -->
+                                     <device udi="/org/kde/solid/fakehw/volume_part1_size_993284096">
+                                         <property key="name">StorageVolume (vfat)</property>
+-                                        <property key="interfaces">Block,StorageVolume</property>
++                                        <property key="interfaces">Block,StorageVolume,StorageAccess</property>
+                                         <property key="parent">/org/kde/solid/fakehw/storage_serial_XOY4_5206</property>
+ 
+                                         <property key="minor">1</property>
+--- /dev/null
++++ b/solid/solid/backends/fakehw/fakestorageaccess.h
+@@ -0,0 +1,59 @@
++/*  This file is part of the KDE project
++    Copyright (C) 2007 Kevin Ottens <ervin at kde.org>
++
++    This library is free software; you can redistribute it and/or
++    modify it under the terms of the GNU Library General Public
++    License version 2 as published by the Free Software Foundation.
++
++    This library is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++    Library General Public License for more details.
++
++    You should have received a copy of the GNU Library General Public License
++    along with this library; see the file COPYING.LIB.  If not, write to
++    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++    Boston, MA 02110-1301, USA.
++
++*/
++
++#ifndef SOLID_BACKENDS_FAKEHW_STORAGEACCESS_H
++#define SOLID_BACKENDS_FAKEHW_STORAGEACCESS_H
++
++#include <solid/ifaces/storageaccess.h>
++#include "fakedeviceinterface.h"
++
++namespace Solid
++{
++namespace Backends
++{
++namespace Fake
++{
++class FakeStorageAccess : public FakeDeviceInterface, virtual public Solid::Ifaces::StorageAccess
++{
++    Q_OBJECT
++    Q_INTERFACES(Solid::Ifaces::StorageAccess)
++
++public:
++    FakeStorageAccess(FakeDevice *device);
++    virtual ~FakeStorageAccess();
++
++    virtual bool isAccessible() const;
++    virtual QString filePath() const;
++public Q_SLOTS:
++    virtual bool setup();
++    virtual bool teardown();
++
++Q_SIGNALS:
++    void accessibilityChanged(bool accessible);
++    void setupDone(Solid::ErrorType error, QVariant errorData);
++    void teardownDone(Solid::ErrorType error, QVariant errorData);
++
++private Q_SLOTS:
++    void onPropertyChanged(const QMap<QString,int> &changes);
++};
++}
++}
++}
++
++#endif // SOLID_BACKENDS_FAKEHW_STORAGEACCESS_H
+--- /dev/null
++++ b/solid/solid/backends/fakehw/fakestorageaccess.cpp
+@@ -0,0 +1,76 @@
++/*  This file is part of the KDE project
++    Copyright (C) 2007 Kevin Ottens <ervin at kde.org>
++
++    This library is free software; you can redistribute it and/or
++    modify it under the terms of the GNU Library General Public
++    License version 2 as published by the Free Software Foundation.
++
++    This library is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++    Library General Public License for more details.
++
++    You should have received a copy of the GNU Library General Public License
++    along with this library; see the file COPYING.LIB.  If not, write to
++    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++    Boston, MA 02110-1301, USA.
++
++*/
++
++#include "fakestorageaccess.h"
++
++using namespace Solid::Backends::Fake;
++
++FakeStorageAccess::FakeStorageAccess(FakeDevice *device)
++    : FakeDeviceInterface(device)
++{
++    connect(device, SIGNAL(propertyChanged(const QMap<QString, int>&)),
++            this, SLOT(onPropertyChanged(const QMap<QString, int>&)));
++}
++
++FakeStorageAccess::~FakeStorageAccess()
++{
++
++}
++
++
++bool FakeStorageAccess::isAccessible() const
++{
++    return fakeDevice()->property("isMounted").toBool();
++}
++
++QString FakeStorageAccess::filePath() const
++{
++    return fakeDevice()->property("mountPoint").toString();
++}
++
++bool FakeStorageAccess::setup()
++{
++    if (fakeDevice()->isBroken() || isAccessible()) {
++        return false;
++    } else {
++        fakeDevice()->setProperty("isMounted", true);
++        return true;
++    }
++}
++
++bool FakeStorageAccess::teardown()
++{
++    if (fakeDevice()->isBroken() || !isAccessible()) {
++        return false;
++    } else {
++        fakeDevice()->setProperty("isMounted", false);
++        return true;
++    }
++}
++
++void Solid::Backends::Fake::FakeStorageAccess::onPropertyChanged(const QMap<QString,int> &changes)
++{
++    foreach (QString property, changes.keys()) {
++        if (property=="isMounted") {
++            emit accessibilityChanged(fakeDevice()->property("isMounted").toBool());
++        }
++    }
++}
++
++#include "backends/fakehw/fakestorageaccess.moc"
+--- a/solid/solid/backends/fakehw/fakedevice.cpp
++++ b/solid/solid/backends/fakehw/fakedevice.cpp
+@@ -26,6 +26,7 @@
+ #include "fakecdrom.h"
+ #include "fakevolume.h"
+ #include "fakeopticaldisc.h"
++#include "fakestorageaccess.h"
+ #include "fakecamera.h"
+ #include "fakeportablemediaplayer.h"
+ #include "fakenetworkinterface.h"
+@@ -253,6 +254,9 @@
+     case Solid::DeviceInterface::OpticalDisc:
+         iface = new FakeOpticalDisc(this);
+         break;
++    case Solid::DeviceInterface::StorageAccess:
++        iface = new FakeStorageAccess(this);
++        break;
+     case Solid::DeviceInterface::Camera:
+         iface = new FakeCamera(this);
+         break;
+--- a/solid/CMakeLists.txt
++++ b/solid/CMakeLists.txt
+@@ -1,6 +1,11 @@
+ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}
+                      ${CMAKE_CURRENT_BINARY_DIR}
+                      ${QT_INCLUDE_DIR} )
++
++# Cannot compile with enable-final because of too many "using namespace" in
++# .cpp files, leading to conflicts e.g. between
++# Solid::Backends::Hal::AcAdapter and Solid::Ifaces::AcAdapter
+ KDE4_NO_ENABLE_FINAL(solid)
++
+ add_subdirectory( solid )
+ add_subdirectory( tests )
+--- a/mimetypes/kde.xml
++++ b/mimetypes/kde.xml
+@@ -47,6 +47,9 @@
+   <mime-type type="application/x-java-applet">
+     <comment>Java applet</comment>
+   </mime-type>
++  <mime-type type="application/x-khtml-adaptor">
++    <comment>KHTML Extension Adaptor</comment>
++  </mime-type>
+   <mime-type type="application/x-kcsrc">
+     <comment>KDE color scheme</comment>
+     <acronym>KDE</acronym>
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,10 +2,10 @@
+ 
+ # set version
+ set (KDE_VERSION_MAJOR 3)
+-set (KDE_VERSION_MINOR 94)
++set (KDE_VERSION_MINOR 95)
+ set (KDE_VERSION_RELEASE 00)
+ set (KDE_VERSION "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}" )
+-set (KDE_VERSION_STRING "${KDE_VERSION} (KDE 4.0 Beta3)")
++set (KDE_VERSION_STRING "${KDE_VERSION} (KDE 4.0 Beta4)")
+ 
+ # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
+@@ -181,7 +181,6 @@
+ add_subdirectory( mimetypes  )
+ add_subdirectory( doc  )
+ add_subdirectory( kinit  )
+-add_subdirectory( kdeprint  )
+ add_subdirectory( threadweaver )
+ add_subdirectory( sonnet  )
+ add_subdirectory( khtml  )
+--- a/kioslave/http/kcookiejar/kcookiejar.desktop
++++ b/kioslave/http/kcookiejar/kcookiejar.desktop
+@@ -34,7 +34,7 @@
+ Name[ko]=KDED 쿠키병 모듈
+ Name[lb]=KDED-Modul fir d'Verwaltung vun de Cookien
+ Name[lt]=KDED slapukų rinkinio modulis
+-Name[lv]=KDED Cepumu Jar modulis
++Name[lv]=KDED cepumu Jar modulis
+ Name[mk]=KDED модул Тегла со колачиња
+ Name[ms]=Modul Balang Cecikut KDED
+ Name[nb]=KDEDs modul for informasjonskapsler (Cookie Jar)
+@@ -50,7 +50,7 @@
+ Name[ru]=Служба cookie
+ Name[se]=KDED gáhkošlihtti-moduvla
+ Name[sl]=Modul posode za piškotke KDED
+-Name[sr]=KDED модул тегле за колачиће
++Name[sr]=КДЕД модул тегле за колачиће
+ Name[sr at latin]=KDED modul tegle za kolačiće
+ Name[sv]=KDED-kakburksmodul
+ Name[ta]=KDED தற்காலிக நினைவக சாடி பகுதி
+--- a/kioslave/http/kcookiejar/kcookiejar.cpp
++++ b/kioslave/http/kcookiejar/kcookiejar.cpp
+@@ -250,7 +250,7 @@
+     m_configChanged = false;
+     m_cookiesChanged = false;
+ 
+-    KConfig cfg( "khtml/domain_info", KConfig::CascadeConfig, "data" );
++    KConfig cfg( "khtml/domain_info", KConfig::NoGlobals, "data" );
+     KConfigGroup group( &cfg, QString() );
+     QStringList countries = group.readEntry( "twoLevelTLD", QStringList() );
+     foreach ( const QString& country, countries ) {
+--- a/kioslave/http/http.cpp
++++ b/kioslave/http/http.cpp
+@@ -247,7 +247,7 @@
+   m_bChunked = false;
+   m_iSize = NO_SIZE;
+ 
+-  m_responseHeader.clear();
++  m_responseHeaders.clear();
+   m_qContentEncodings.clear();
+   m_qTransferEncodings.clear();
+   m_sContentMD5.clear();
+@@ -284,7 +284,7 @@
+   m_request.bUseCache = config()->readEntry("UseCache", true);
+   m_request.bErrorPage = config()->readEntry("errorPage", true);
+   m_request.bNoAuth = config()->readEntry("no-auth", false);
+-  m_strCacheDir = config()->readPathEntry("CacheDir");
++  m_strCacheDir = config()->readPathEntry("CacheDir", QString());
+   m_maxCacheAge = config()->readEntry("MaxCacheAge", DEFAULT_MAX_CACHE_AGE);
+   m_request.window = config()->readEntry("window-id");
+ 
+@@ -2564,86 +2564,92 @@
+   // Send the response header if it was requested
+   if ( config()->readEntry("PropagateHttpHeader", false) )
+   {
+-    setMetaData("HTTP-Headers", m_responseHeader);
++    setMetaData("HTTP-Headers", m_responseHeaders.join("\n"));
+     sendMetaData();
+   }
+-  m_responseHeader.clear();
+ }
+ 
+-/**
+- * This function will read in the return header from the server.  It will
+- * not read in the body of the return message.  It will also not transmit
+- * the header to our client as the client doesn't need to know the gory
+- * details of HTTP headers.
+- */
+-bool HTTPProtocol::readHeader()
+-{
+-try_again:
+-  kDebug(7113);
++bool HTTPProtocol::readHeaderFromCache() {
++    m_responseHeaders.clear();
+ 
+-  // Check
+-  if (m_request.bCachedRead)
+-  {
+-     m_responseHeader = QString::fromLatin1("HTTP-CACHE");
+-     forwardHttpResponseHeader();
++    // Read header from cache...
++    char buffer[4097];
++    if (!gzgets(m_request.fcache, buffer, 4096) )
++    {
++    // Error, delete cache entry
++    kDebug(7113) << "Could not access cache to obtain mimetype!";
++    error( ERR_CONNECTION_BROKEN, m_state.hostname );
++    return false;
++    }
+ 
+-     // Read header from cache...
+-     char buffer[4097];
+-     if (!gzgets(m_request.fcache, buffer, 4096) )
+-     {
++    m_strMimeType = QString::fromUtf8( buffer).trimmed();
++
++    kDebug(7113) << "cached data mimetype: " << m_strMimeType;
++
++    // read http-headers, first the response code
++    if (!gzgets(m_request.fcache, buffer, 4096) )
++    {
+         // Error, delete cache entry
+-        kDebug(7113) << "Could not access cache to obtain mimetype!";
++        kDebug(7113) << "Could not access cached data! ";
+         error( ERR_CONNECTION_BROKEN, m_state.hostname );
+         return false;
+-     }
+-
+-     m_strMimeType = QString::fromUtf8( buffer).trimmed();
+-
+-     kDebug(7113) << "cached data mimetype: " << m_strMimeType;
+-
+-     // read optional http-headers
+-     while(true) {
+-        if (!gzgets(m_request.fcache, buffer, 4096) )
++    }
++    m_responseHeaders << buffer;
++    // then the headers
++    while(true) {
++        if (!gzgets(m_request.fcache, buffer, 8192) )
+         {
+             // Error, delete cache entry
+             kDebug(7113) << "Could not access cached data! ";
+             error( ERR_CONNECTION_BROKEN, m_state.hostname );
+             return false;
+         }
++        m_responseHeaders << buffer;
+         QString header = QString::fromUtf8( buffer).trimmed().toLower();
+         if (header.isEmpty()) break;
+-        if (header.startsWith("content-type-charset: ")) {
+-            QString value = header.mid(22);
+-            m_request.strCharset = value;
+-            setMetaData("charset", value);
++        if (header.startsWith("content-type: ")) {
++            int pos = header.indexOf("charset=");
++            if (pos != -1) {
++                QString value = header.mid(pos+8);
++                m_request.strCharset = value;
++                setMetaData("charset", value);
++            }
+         } else
+         if (header.startsWith("content-language: ")) {
+             QString value = header.mid(18);
+-            m_request.strLanguage = value;
+             setMetaData("content-language", value);
+         } else
+-        if (header.startsWith("content-disposition-type: ")) {
+-            QString value = header.mid(26);
+-            m_request.strDisposition = value;
+-            setMetaData("content-disposition-type", value);
+-        } else
+-        if (header.startsWith("content-disposition-filename: ")) {
+-            QString value = header.mid(30);
+-            m_request.strFilename = value;
+-            setMetaData("content-disposition-filename", value);
++        if (header.startsWith("content-disposition: ")) {
++            parseContentDisposition(header.mid(21));
+         }
+-     }
++    }
++    forwardHttpResponseHeader();
+ 
+-     if (!m_request.lastModified.isEmpty())
+-         setMetaData("modified", m_request.lastModified);
+-     QString tmp;
+-     tmp.setNum(m_request.expireDate);
+-     setMetaData("expire-date", tmp);
+-     tmp.setNum(m_request.creationDate);
+-     setMetaData("cache-creation-date", tmp);
+-     mimeType(m_strMimeType);
+-     return true;
+-  }
++    if (!m_request.lastModified.isEmpty())
++        setMetaData("modified", m_request.lastModified);
++    QString tmp;
++    tmp.setNum(m_request.expireDate);
++    setMetaData("expire-date", tmp);
++    tmp.setNum(m_request.creationDate);
++    setMetaData("cache-creation-date", tmp);
++    mimeType(m_strMimeType);
++    return true;
++}
++
++/**
++ * This function will read in the return header from the server.  It will
++ * not read in the body of the return message.  It will also not transmit
++ * the header to our client as the client doesn't need to know the gory
++ * details of HTTP headers.
++ */
++bool HTTPProtocol::readHeader()
++{
++try_again:
++  kDebug(7113);
++
++  // Check
++  if (m_request.bCachedRead)
++      return readHeaderFromCache();
+ 
+   QByteArray locationStr; // In case we get a redirect.
+   QByteArray cookieStr; // In case we get a cookie.
+@@ -2663,6 +2669,7 @@
+   m_request.etag.clear();
+   m_request.lastModified.clear();
+   m_request.strCharset.clear();
++  m_responseHeaders.clear();
+ 
+   time_t dateHeader = 0;
+   time_t expireDate = 0; // 0 = no info, 1 = already expired, > 1 = actual date
+@@ -2670,9 +2677,9 @@
+   int maxAge = -1; // -1 = no max age, 0 already expired, > 0 = actual time
+   int maxHeaderSize = 64*1024; // 64Kb to catch DOS-attacks
+ 
+-  // read in 4096 bytes at a time (HTTP cookies can be quite large.)
++  // read in 8192 bytes at a time (HTTP cookies can be quite large.)
+   int len = 0;
+-  char buffer[4097];
++  char buffer[8193];
+   bool cont = false;
+   bool cacheValidated = false; // Revalidation was successful
+   bool mayCache = true;
+@@ -2773,7 +2780,7 @@
+ 
+     // Store the the headers so they can be passed to the
+     // calling application later
+-    m_responseHeader += QString::fromLatin1(buf);
++    m_responseHeaders << QString::fromLatin1(buf);
+ 
+     if ((strncasecmp(buf, "HTTP", 4) == 0) ||
+         (strncasecmp(buf, "ICY ", 4) == 0)) // Shoutcast support
+@@ -3047,6 +3054,7 @@
+           {
+             mediaValue = mediaValue.toLower();
+             m_request.strCharset = mediaValue;
++            setMetaData("charset", mediaValue);
+           }
+           else
+           {
+@@ -3150,68 +3158,11 @@
+     }
+     // Refer to RFC 2616 sec 15.5/19.5.1 and RFC 2183
+     else if(strncasecmp(buf, "Content-Disposition:", 20) == 0) {
+-      char* dispositionBuf = trimLead(buf + 20);
+-      while ( *dispositionBuf )
+-      {
+-        if ( strncasecmp( dispositionBuf, "filename", 8 ) == 0 )
+-        {
+-          dispositionBuf += 8;
+-
+-          while ( *dispositionBuf == ' ' || *dispositionBuf == '=' )
+-            dispositionBuf++;
+-
+-          char* bufStart = dispositionBuf;
+-
+-          while ( *dispositionBuf && *dispositionBuf != ';' )
+-            dispositionBuf++;
+-
+-          if ( dispositionBuf > bufStart )
+-          {
+-            // Skip any leading quotes...
+-            while ( *bufStart == '"' )
+-              bufStart++;
+-
+-            // Skip any trailing quotes as well as white spaces...
+-            while ( *(dispositionBuf-1) == ' ' || *(dispositionBuf-1) == '"')
+-              dispositionBuf--;
+-
+-            if ( dispositionBuf > bufStart )
+-              m_request.strFilename = QString::fromLatin1( bufStart, dispositionBuf-bufStart );
+-
+-            break;
+-          }
+-        }
+-        else
+-        {
+-          char *bufStart = dispositionBuf;
+-
+-          while ( *dispositionBuf && *dispositionBuf != ';' )
+-            dispositionBuf++;
+-
+-          if ( dispositionBuf > bufStart )
+-            m_request.strDisposition = QString::fromLatin1( bufStart, dispositionBuf-bufStart ).trimmed();
+-
+-          while ( *dispositionBuf == ';' || *dispositionBuf == ' ' )
+-            dispositionBuf++;
+-        }
+-      }
+-
+-      // Content-Dispostion is not allowed to dictate directory
+-      // path, thus we extract the filename only.
+-      if ( !m_request.strFilename.isEmpty() )
+-      {
+-        int pos = m_request.strFilename.lastIndexOf( '/' );
+-
+-        if( pos > -1 )
+-          m_request.strFilename = m_request.strFilename.mid(pos+1);
+-
+-        kDebug(7113) << "Content-Disposition: filename=" << m_request.strFilename;
+-      }
++        parseContentDisposition(QString::fromLatin1(trimLead(buf+20)));
+     }
+     else if(strncasecmp(buf, "Content-Language:", 17) == 0) {
+         QString language = QString::fromLatin1(trimLead(buf+17)).trimmed();
+         if (!language.isEmpty()) {
+-            m_request.strLanguage = language;
+             setMetaData("content-language", language);
+         }
+     }
+@@ -3339,10 +3290,6 @@
+ 
+   } while (!m_bEOF && (len || noHeader) && (headerSize < maxHeaderSize) && (gets(buffer, sizeof(buffer)-1)));
+ 
+-  // Send the current response before processing starts or it
+-  // might never get sent...
+-  forwardHttpResponseHeader();
+-
+   // Now process the HTTP/1.1 upgrade
+   QStringList::Iterator opt = upgradeOffers.begin();
+   for( ; opt != upgradeOffers.end(); ++opt) {
+@@ -3364,8 +3311,6 @@
+      }
+   }
+ 
+-  setMetaData("charset", m_request.strCharset);
+-
+   // If we do not support the requested authentication method...
+   if ( (m_responseCode == 401 && Authentication == AUTH_None) ||
+        (m_responseCode == 407 && ProxyAuthentication == AUTH_None) )
+@@ -3670,19 +3615,6 @@
+         m_strMimeType = QString::fromLatin1("video/x-ms-wmv");
+   }
+ 
+-  if( !m_request.strDisposition.isEmpty() )
+-  {
+-    kDebug(7113) << "Setting Content-Disposition type to: "
+-                  << m_request.strDisposition;
+-    setMetaData("content-disposition-type", m_request.strDisposition);
+-  }
+-  if( !m_request.strFilename.isEmpty() )
+-  {
+-    kDebug(7113) << "Setting Content-Disposition filename to: "
+-                 << m_request.strFilename;
+-    setMetaData("content-disposition-filename", m_request.strFilename);
+-  }
+-
+   if (!m_request.lastModified.isEmpty())
+     setMetaData("modified", m_request.lastModified);
+ 
+@@ -3709,6 +3641,10 @@
+     mimeType( m_strMimeType );
+   }
+ 
++  // Do not move send response header before any redirection as it seems
++  // to screw up some sites. See BR# 150904.
++  forwardHttpResponseHeader();
++
+   if (m_request.method == HTTP_HEAD)
+      return true;
+ 
+@@ -3734,6 +3670,42 @@
+   return true;
+ }
+ 
++void HTTPProtocol::parseContentDisposition(const QString &disposition)
++{
++    QString strDisposition;
++    QString strFilename;
++
++    QStringList parts = disposition.split(';');
++
++    bool first = true;
++    foreach(QString part, parts) {
++        part = part.trimmed();
++        if (first) {
++            strDisposition = part;
++            first = false;
++        } else
++        if (part.startsWith("filename")) {
++            int i = part.indexOf('=');
++            if (i == -1) break;
++            strFilename = part.mid(i);
++        }
++    }
++
++    // Content-Dispostion is not allowed to dictate directory
++    // path, thus we extract the filename only.
++    if ( !strFilename.isEmpty() )
++    {
++        int pos = strFilename.lastIndexOf( '/' );
++
++        if( pos > -1 )
++            strFilename = strFilename.mid(pos+1);
++
++        kDebug(7113) << "Content-Disposition: filename=" << strFilename;
++    }
++    setMetaData("content-disposition-type", strDisposition);
++    if (!strFilename.isEmpty())
++        setMetaData("content-disposition-filename", strFilename);
++}
+ 
+ void HTTPProtocol::addEncoding(const QString &_encoding, QStringList &encs)
+ {
+@@ -4768,26 +4740,9 @@
+    gzputs(m_request.fcache, mimetype.toLatin1());  // Mimetype
+    gzputc(m_request.fcache, '\n');
+ 
+-   if (!m_request.strCharset.isEmpty()) {
+-      gzputs(m_request.fcache, "content-type-charset: ");
+-      gzputs(m_request.fcache, m_request.strCharset.toLatin1());     // Charset
+-      gzputc(m_request.fcache, '\n');
+-   }
+-   if (!m_request.strLanguage.isEmpty()) {
+-      gzputs(m_request.fcache, "content-language: ");
+-      gzputs(m_request.fcache, m_request.strLanguage.toLatin1());    // Content-language
+-      gzputc(m_request.fcache, '\n');
+-   }
+-   if (!m_request.strDisposition.isEmpty()) {
+-      gzputs(m_request.fcache, "content-disposition-type: ");
+-      gzputs(m_request.fcache, m_request.strDisposition.toLatin1()); // Content-Disposition
+-      gzputc(m_request.fcache, '\n');
+-   }
+-   if (!m_request.strFilename.isEmpty()) {
+-      gzputs(m_request.fcache, "content-disposition-filename: ");
+-      gzputs(m_request.fcache, m_request.strFilename.toLatin1());    // Content-Disposition: filename
+-      gzputc(m_request.fcache, '\n');
+-   }
++   gzputs(m_request.fcache, m_responseHeaders.join("\n").toLatin1());
++   gzputc(m_request.fcache, '\n');
++
+    gzputc(m_request.fcache, '\n');
+ 
+    return;
+--- a/kioslave/http/http_cache_cleaner.desktop
++++ b/kioslave/http/http_cache_cleaner.desktop
+@@ -35,7 +35,7 @@
+ Name[ko]=HTTP 캐시 청소기
+ Name[lb]=Opraumer fir den HTTP-Zwëschespäicher
+ Name[lt]=HTTP krepšio ištuštintojas
+-Name[lv]=HTTP Kešatmiņas tīrītājs
++Name[lv]=HTTP kešatmiņas tīrītājs
+ Name[mk]=Бришење на HTTP-кешот
+ Name[ms]=Pembersih Penyimpan HTTP
+ Name[nb]=HTTP Mellomlagerrenser
+@@ -51,7 +51,7 @@
+ Name[ru]=Очистка кэша HTTP
+ Name[se]=HTTP gaskarádjosa buhtisteaddji
+ Name[sl]=Čistilnik predpomnilnika HTTP
+-Name[sr]=Чистач HTTP кеша
++Name[sr]=Чистач ХТТП кеша
+ Name[sr at latin]=Čistač HTTP keša
+ Name[sv]=HTTP-cacherensare
+ Name[ta]=HTTP தற்காலிக நினைவகத்தை சுத்தம் செய்தல்
+@@ -119,7 +119,7 @@
+ Comment[ru]=Удаление устаревших элементов из кэша HTTP
+ Comment[se]=Buhtista boares merko3/4iid HTTP gaskarádjosis
+ Comment[sl]=Zbriše stare vnose iz pomnilnika HTTP
+-Comment[sr]=Чисти старе ставке из HTTP кеша
++Comment[sr]=Чисти старе ставке из ХТТП кеша
+ Comment[sr at latin]=Čisti stare stavke iz HTTP keša
+ Comment[sv]=Rensar bort gamla poster från HTTP-cachen
+ Comment[ta]=HTTP நினைவத்திலிருந்து பழைய உள்ளீடுகளை சுத்தம் செய்கிறது
+--- a/kioslave/http/http.h
++++ b/kioslave/http/http.h
+@@ -164,10 +164,7 @@
+     long bytesCached;
+     time_t expireDate; // Date when the cache entry will expire
+     time_t creationDate; // Date when the cache entry was created
+-    QString strCharset; // Charset
+-    QString strLanguage; // Language
+-    QString strDisposition;
+-    QString strFilename;
++    QString strCharset;
+ 
+     // Cookie flags
+     enum { CookiesAuto, CookiesManual, CookiesNone } cookieMode;
+@@ -299,6 +296,8 @@
+   void forwardHttpResponseHeader();
+ 
+   bool readHeader();
++  bool readHeaderFromCache();
++  void parseContentDisposition(const QString &disposition);
+ 
+   bool sendBody();
+ 
+@@ -480,7 +479,7 @@
+   KIO::filesize_t m_iContentLeft; // # of content bytes left
+   QByteArray m_bufReceive; // Receive buffer
+   char m_lineBuf[1024];
+-  char m_rewindBuf[4096];
++  char m_rewindBuf[8192];
+   size_t m_rewindCount;
+   size_t m_lineCount;
+   size_t m_lineCountUnget;
+@@ -499,7 +498,7 @@
+ 
+ //--- Settings related to a single response only
+   bool m_bRedirect; // Indicates current request is a redirection
+-  QString m_responseHeader; // All response headers
++  QStringList m_responseHeaders; // All headers
+ 
+ 
+   // Language/Encoding related
+--- a/kinit/klauncher.cpp
++++ b/kinit/klauncher.cpp
+@@ -944,9 +944,9 @@
+   for(QStringList::ConstIterator it = params.begin();
+       it != params.end(); ++it)
+   {
+-     request->arg_list.append((*it).toLocal8Bit());
++     request->arg_list.append(*it);
+   }
+-  request->cwd = QFile::encodeName(service->path());
++  request->cwd = service->path();
+ }
+ 
+ ///// IO-Slave functions
+--- a/kinit/autostart.cpp
++++ b/kinit/autostart.cpp
+@@ -85,7 +85,7 @@
+   if (list[0].isEmpty() || list[2].isEmpty())
+      return true;
+ 
+-  KConfig config(list[0], KConfig::CascadeConfig);
++  KConfig config(list[0], KConfig::NoGlobals);
+   KConfigGroup cg(&config, list[1]);
+ 
+   bool defaultValue = (list[3].toLower() == "true");
+@@ -113,12 +113,12 @@
+ 
+        if (grp.hasKey("OnlyShowIn"))
+        {
+-          if (!grp.readEntry("OnlyShowIn",QStringList(), ';').contains("KDE"))
++          if (!grp.readXdgListEntry("OnlyShowIn").contains("KDE"))
+               continue;
+        }
+        if (grp.hasKey("NotShowIn"))
+        {
+-           if (grp.readEntry("NotShowIn", QStringList(),';').contains("KDE"))
++           if (grp.readXdgListEntry("NotShowIn").contains("KDE"))
+                continue;
+        }
+ 
+--- a/nepomuk/ontologies/dcq.desktop
++++ b/nepomuk/ontologies/dcq.desktop
+@@ -7,6 +7,7 @@
+ Name[de]=Die Dublin Core Terme
+ Name[el]=Οι όροι Dublin Core
+ Name[es]=Los términos de Dublin Core
++Name[et]=Dublin Core Terms
+ Name[fa]=اصطلاحات هسته Dublin
+ Name[ga]=Téarmaí de chuid Dublin Core
+ Name[he]=מונחים של Dublin Core
+@@ -15,12 +16,15 @@
+ Name[km]=ពាក្យ​ស្នូល​ Dublin
+ Name[kn]=ಡಬ್ಲಿನ್ ಕೋರ್ ಪಾರಿಭಾಷಿಕ ಶಬ್ದಗಳು
+ Name[ko]=더블린 코어 용어
++Name[nb]=Dublin Core-termer
+ Name[nds]=De Dublin-Core-Begrepen
+ Name[ne]=डब्लिन मुख्य शर्त
+ Name[nl]=De Dublin Core Termen
+ Name[pt]=Os Termos do Dublin Core
+ Name[pt_BR]=Termos do Dublin Core
+ Name[sl]=Izrazi Dublin Core
++Name[sr]=Чиниоци Даблинског језгра
++Name[sr at latin]=Činioci Dablinskog jezgra
+ Name[sv]=Dublin-kärntermer
+ Name[th]=ชุดคำหลักของ Dublin
+ Name[vi]=Điều kiện Lõi Dublin
+@@ -34,6 +38,7 @@
+ Comment[de]=Die Dublin Core Terme
+ Comment[el]=Οι όροι Dublin Core
+ Comment[es]=Los términos de Dublin Core
++Comment[et]=Dublin Core Terms
+ Comment[fa]=اصطلاحات هسته Dublin
+ Comment[ga]=Téarmaí de chuid Dublin Core
+ Comment[he]=מונחים של Dublin Core
+@@ -42,12 +47,15 @@
+ Comment[km]=ពាក្យ​​ស្នូល​ Dublin
+ Comment[kn]=ಡಬ್ಲಿನ್ ಕೋರ್ ಪಾರಿಭಾಷಿಕ ಶಬ್ದಗಳು
+ Comment[ko]=더블린 코어 용어
++Comment[nb]=Dublin Core-termene
+ Comment[nds]=De Dublin-Core-Begrepen
+ Comment[ne]=डब्लिन मुख्य शर्त
+ Comment[nl]=De Dublin Core Termen
+ Comment[pt]=Os Termos do Dublin Core
+ Comment[pt_BR]=Termos do Dublin Core
+ Comment[sl]=Izrazi Dublin Core
++Comment[sr]=Чиниоци Даблинског језгра
++Comment[sr at latin]=Činioci Dablinskog jezgra
+ Comment[sv]=Dublin-kärntermer
+ Comment[th]=ชุดคำหลักของ Dublin
+ Comment[vi]=Điều kiện Lõi Dublin
+--- a/nepomuk/ontologies/rdf.desktop
++++ b/nepomuk/ontologies/rdf.desktop
+@@ -2,6 +2,7 @@
+ Encoding=UTF-8
+ Version=1.0
+ Name=RDF
++Name[sr]=РДФ
+ Name[x-test]=xxRDFxx
+ Comment=RDF Vocabulary Description Language 1.0
+ Comment[ar]=لغة وصف المفردات RDF 1.0
+@@ -15,12 +16,17 @@
+ Comment[km]=ភាសា​ពិពណ៌នា​វាក្យ​ស័ព្ទ RDF ១.០
+ Comment[kn]=RDF ಪದಪಟ್ಟಿ (ವೊಕಾಬುಲರಿ) ವಿವರಣಾ ಭಾಷೆ ೧.೦
+ Comment[ko]=RDF 어휘 설명 언어 1.0
++Comment[lv]=RDF vārdnīcas apraksta valoda 1.0
++Comment[nb]=RDF-språk for ordlistebeskrivelse 1.0
+ Comment[nds]=Woortsett-Beschrievspraak RDF 1.0
+ Comment[ne]=RDF शब्दकोश वर्णन भाषा 1.0
+ Comment[nl]=RDF Vocabulaire Beschrijvingstaal 1.0
+ Comment[pt_BR]=Linguagem de Descrição de Vocabulário RDF 1.0
++Comment[sr]=РДФ језик за опис речника 1.0
++Comment[sr at latin]=RDF jezik za opis rečnika 1.0
+ Comment[sv]=RDF-ordförrådsbeskrivningsspråk 1.0
+ Comment[th]=ภาษาสำหรับอธิบายคำศัพท์ RDF 1.0
++Comment[uk]=Мова RDF опису слів 1.0
+ Comment[vi]=Ngôn ngữ Diễn tả Từ vựng RDF 1.0
+ Comment[wa]=Lingaedje di discrijhaedje di vocabulaire RDF 1.0
+ Comment[x-test]=xxRDF Vocabulary Description Language 1.0xx
+--- a/nepomuk/ontologies/nao.desktop
++++ b/nepomuk/ontologies/nao.desktop
+@@ -6,8 +6,9 @@
+ Name[ca]=Ontologia de notes del Nepomuk
+ Name[csb]=Ontologijo dopòwiescë Napomuk
+ Name[de]=Nepomuk Vermerk-Ontologie
+-Name[el]=Οντολογία επισήμανσης Nepomuk
++Name[el]=Οντολογία σημείωσης Nepomuk
+ Name[es]=Ontología de anotaciones Nepomuk
++Name[et]=Nepomuki annotatsiooniontoloogia
+ Name[fa]=هستی‌شناسی حاشیه‌نویسی Nepomuk
+ Name[ga]=Ointeolaíocht Anótála Nepomuk
+ Name[he]=אונטולוגיית הערות של Nepomuk
+@@ -21,8 +22,11 @@
+ Name[nl]=Nepomuk Annotatie Ontologie
+ Name[pt]=Ontologia de Anotações do Nepomuk
+ Name[pt_BR]=Ontologia de Anotação Nepomuk 
++Name[sr]=Непомукова онтологија тумачењâ
++Name[sr at latin]=Nepomukova ontologija tumačenjâ
+ Name[sv]=Nepomuks beteckningsontologi
+ Name[th]=คำศัพท์กำกับหมายเหตุของ Nepomuk
++Name[uk]=Онтологія анотації Nepomuk
+ Name[vi]=Bản thể học cách ghi Nepomuk
+ Name[wa]=Ontolodjeye di notåcion nepomuk
+ Name[x-test]=xxNepomuk Annotation Ontologyxx
+@@ -32,8 +36,9 @@
+ Comment[ca]=L'ontologia de notes del Nepomuk defineix les propietats bàsiques de les notes com l'etiquetatge o la puntuació.
+ Comment[csb]=Òntologija dopòwiescë Nepomuk definëjë pòdspòdla swòjiznów jak tagòwanié czë taksowanié.
+ Comment[de]=Die Nepomuk Vermerk-Ontologie legt die grundlegenden Vermerk-Eigenschaften wie Marker oder Wertung fest.
+-Comment[el]=Η οντολογία επισήμανσης Nepomuk ορίζει τις ιδιότητες βασικών επισημάνσεων όπως οι ετικέτες ή η βαθμολόγηση.
++Comment[el]=Η οντολογία σημείωσης Nepomuk ορίζει τις ιδιότητες βασικών σημειώσεων όπως οι ετικέτες ή η βαθμολόγηση.
+ Comment[es]=La ontología de anotaciones Nepomuk define las propiedades de anotación básicas como etiquetado o calificación.
++Comment[et]=Nepomuki annotatsiooniontoloogia määrab põhilised annoteerimise omadused, näiteks sildistamise ja hindamise.
+ Comment[fa]=هستی‌شناسی حاشیه‌نویسی Nepomuk، ویژگیهای حاشیه‌نویسی پایه‌ای نظیر برچسب‌گذاری یا درجه‌بندی را تعریف می‌کند.
+ Comment[ga]=Sainmhíníonn Ointeolaíocht Anótála Nepomuk na bunairíonna anótála cosúil le clibeáil nó rátáil.
+ Comment[he]=אונטולוגיית ההערות של Nepomuk מגדירה את מאפייני ההערות הבסיסיים כגון תגיות או דירוג.
+@@ -42,11 +47,14 @@
+ Comment[km]=ប្រាណ​វិទ្យា​ចំណា Nepomuk កំណត់​លក្ខណៈសម្បត្តិ​ចំណារ​មូលដ្ឋាន​ ដូចជា​ការ​ដាក់ស្លាក ឬ​វាយ​តម្លៃ ។
+ Comment[kn]=ನೆಪೋಮುಕ್ ವ್ಯಾಖ್ಯಾನ ಸತ್ತಾಶಾಸ್ತ್ರವು (ಅನೋಟೇಶನ್ ಆಂಟಾಲಜಿ) ತಲೆಚೀಟಿಗಳನ್ನು ಅಂಟಿಸುವುದು (ಟಾಗಿಂಗ್) ಮತ್ತು ಗುಣನಿಶ್ಚಯ (ರೇಟಿಂಗ್) ನಂತಹ ಮೂಲಭೂತ ವ್ಯಾಖ್ಯಾನಸಂಬಂಧೀ ಗುಣಗಳನ್ನು ನಿಷ್ಕೃಷ್ಟಗೊಳಿಸುತ್ತದೆ.
+ Comment[ko]=Nepomuk 어노테이션 온톨로지는 꼬리표 달기 및 점수 매기기와 같은 기본 어노테이션 속성을 정의합니다.
++Comment[nb]=Nepomuk Annotation Ontology definerer grunnleggende kommentaregenskaper slik som tagging eller rangering.
+ Comment[nds]=Dat Anmarkenweeswark Nepomuk stellt de Grundegenschappen vun Anmarken as Steekwöör oder Beweerten praat.
+ Comment[ne]=नेपोमक एनोटेसन ओन्टोलोजीले ट्याग लगाउने र योग्यता निर्धारण गर्ने जस्ता आधारभूत गुण परिभाषित गर्दछ ।
+ Comment[nl]=De Nepomuk Annotatie Ontologie definieert de basis annotatie-eigenschappen zoals tagging en waardering.
+ Comment[pt]=A Ontologia de Anotações do Nepomuk define as propriedades de anotação básicas como a marcação ou a classificação.
+ Comment[pt_BR]=A Ontologia de Anotação Nepomuk define as propriedades básicas de anotação como tags e avaliações
++Comment[sr]=Непомукова онтологија тумачењâ дефинише основна својства тумачењâ, попут означавања и оцењивања.
++Comment[sr at latin]=Nepomukova ontologija tumačenjâ definiše osnovna svojstva tumačenjâ, poput označavanja i ocenjivanja.
+ Comment[sv]=Nepomuks beteckningsontologi definierar de grundläggande beteckningarna för egenskaper som taggning eller betygsättning.
+ Comment[th]=คำศัพท์กำกับหมายเหตุของ Nepomuk จะนิยามคุณสมบัติของหมายเหตุอย่างเช่น การแท็ก หรือการให้เรตติ้ง
+ Comment[vi]=Bản thể học cách ghi Nepomuk thì xác định những thuộc tính cách ghi cơ bản, v.d. đặt thẻ hay đánh giá.
+--- a/nepomuk/ontologies/dces.desktop
++++ b/nepomuk/ontologies/dces.desktop
+@@ -7,6 +7,7 @@
+ Name[de]=Der Dublin Core Element Set
+ Name[el]=Σύνολο στοιχείων Dublin Core
+ Name[es]=El conjunto de elementos Dublin Core
++Name[et]=Dublin Core Element Set
+ Name[fa]=مجموعه عنصر هسته Dublin
+ Name[ga]=Eilimintí de chuid Dublin Core
+ Name[he]=קבוצת המרכיבים Dublin Core
+@@ -15,12 +16,16 @@
+ Name[km]=សំណុំ​ធាតុ​ស្នូល Dublin
+ Name[kn]=ಡಬ್ಲಿನ್ ಕೋರ್ ಮೂಲಾಂಶ ಸಮೂಹ
+ Name[ko]=더블린 코어 기초 집합
++Name[lt]=Nustatytas Dublin branduolio elementas
++Name[nb]=Dublin Core-elementene
+ Name[nds]=De Dublin-Core-Elementensett
+ Name[ne]=डब्लिन मुख्य तत्व सेट
+ Name[nl]=De Dublin Core Elementset
+ Name[pt]=O Conjunto de Elementos do Dublin Core
+ Name[pt_BR]=Conjunto Elementos "Dublin Core"
+ Name[sl]=Nabor elementov Dublin Core
++Name[sr]=Скуп елемената Даблинског језгра
++Name[sr at latin]=Skup elemenata Dablinskog jezgra
+ Name[sv]=Dublin-kärnelementmängden
+ Name[th]=ชุดมูลฐาน Dublin
+ Name[vi]=Bộ yếu tố lõi Dublin
+@@ -35,6 +40,7 @@
+ Comment[de]=Der Namensraum des Dublin Core Element Set v1.1, der den Zugriff auf seine Inhalte über ein RDF-Schema anbietet.
+ Comment[el]=O χώρος ονομάτων συνόλου στοιχείων Dublin Core v1.1 προσφέρει πρόσβαση στο περιεχόμενό του μέσω ενός σχήματος RDF
+ Comment[es]=El espacio de nombres del conjunto de elementos Dublin Core versión 1.1 que proporciona acceso a su contenido por medio de un esquema RDF.
++Comment[et]=Dublin Core Element Set v. 1.1 nimeruum tagab ligipääsu selle sisule RDF-skeemi vahendusel
+ Comment[fa]=فضای نام مجموعه عنصر هسته Dublin نسخه ۱.۱، دستیابی به محتوایش را بوسیله یک طرحواره RDF فراهم می‌کند
+ Comment[ga]=Eilimintí de chuid Dublin Core (v1.1) in ainmspás atá ar fáil trí scéimre RDF
+ Comment[he]=תחום השמות של גירסת 1.1 של קבוצת המרכיבים Dublin Core מספקת גישה לתוכן שלה באמצעות סכמת RDF
+@@ -43,12 +49,15 @@
+ Comment[km]=ចន្លោះ​ឈ្មោះ​សំណុំ​ធាតុ​ស្នូល​ Dublin v1.1 ផ្តល់​នូវ​ការ​ចូល​ដំណើរការ​ទៅ​មាតិកា​របស់​វា​ តាមគ្រោងការណ៍​​ RDF
+ Comment[kn]=RDF ರೂಪರೇಖೆ (ಸ್ಕೀಮಾ) ಮೂಲಕ ತನ್ನ ಒಳಪಿಡಿಗಳಿಗೆ ನಿಲುಕಣೆಯನ್ನು ನೀಡುವ ಡಬ್ಲಿನ್ ಕೋರ್ ಮೂಲಾಂಶ ಸಮೂಹ ಆವೃತ್ತಿ ೧.೧ ನಾಮವ್ಯೋಮ (ನೇಮ್ ಸ್ಪೇಸ್)
+ Comment[ko]=더블린 코어 기초 집합 1.1 네임스페이스는 RDF 스키마 형식으로 내용물에 접근할 수 있도록 지원합니다
++Comment[nb]=Dublin Core Element Set v1.1 navnerom, som gir tilgang til innholdet ved hjelp av et RDF-skjema
+ Comment[nds]=De Naamruum vun den Dublin-Core-Elementensett, op den sien Inholt Een över en RDF-Schema togriepen kann
+ Comment[ne]=डब्लिन मुख्य तत्व Set v1.1 नेमस्पेसले RDF स्किमाको उद्धेश्य अनुरुप यसका सामाग्रीमा पहुँच उपलब्धता
+ Comment[nl]=De Dublin Core Elementset v1.1 namespace levert toegang tot diens inhoud via een RDF-schema
+ Comment[pt]=O espaço de nmes do Conjunto de Elementos Dublin Core v1.1, que oferece o acesso ao seu conteúdo através de um Esquema de RDF
+ Comment[pt_BR]=Espaço de nomes do Conjunto de Elementos "Dublin Core" v1.1, que fornece acesso ao seu conteúdo através de um RDF Schema
+ Comment[sl]=Naslovni prostor nabora elementov Dublin Core različice 1.1 omogoča dostop do svoje vsebine z uporabo sheme RDF
++Comment[sr]=Именски простор скупа елемената Даблинског језгра (в1.1) који омогућава приступ свом садржају РДФ шеме
++Comment[sr at latin]=Imenski prostor skupa elemenata Dablinskog jezgra (v1.1) koji omogućava pristup svom sadržaju RDF šeme
+ Comment[sv]=Dublin-kärnelementmängdens namnrymd version 1.1 som ger tillgång till sitt innehåll via ett RDF-schema
+ Comment[th]=รูปแบบชื่อสำหรับชุดมูลฐาน Dublin รุ่น 1.1 ที่ให้การเข้าถึงเนื้อหาโดยวิธีของ RDF Scema
+ Comment[vi]=Miền tên Bộ yếu tố lõi Dublin phiên bản 1.1 thì cung cấp truy cập cho nội dung thông qua giản đồ RDF.
+--- a/nepomuk/ontologies/nfo.desktop
++++ b/nepomuk/ontologies/nfo.desktop
+@@ -8,6 +8,7 @@
+ Name[de]=Nepomuk Datei-Ontologie
+ Name[el]=Οντολογία αρχείων Nepomuk
+ Name[es]=Ontología de ficheros Nepomuk
++Name[et]=Nepomuki failiontoloogia
+ Name[fa]=هستی‌شناسی پرونده Nepomuk
+ Name[ga]=Ointeolaíocht Comhad Nepomuk
+ Name[he]=אונטולוגיית קובץ של Nepomuk
+@@ -21,8 +22,11 @@
+ Name[nl]=Nepomuk Bestandsontologie
+ Name[pt]=Ontologia de Ficheiros do Nepomuk
+ Name[pt_BR]=Ontologia de Arquivo Nepomuk
++Name[sr]=Непомукова онтологија фајлова
++Name[sr at latin]=Nepomukova ontologija fajlova
+ Name[sv]=Nepomuks filontologi
+ Name[th]=คำศัพท์กำกับแฟ้มของ Nepomuk
++Name[uk]=Онтологія файла Nepomuk
+ Name[vi]=Bản thể học tập tin Nepomuk
+ Name[wa]=Ontolodjeye di fitchîs nepomuk
+ Name[x-test]=xxNepomuk File Ontologyxx
+@@ -34,6 +38,7 @@
+ Comment[de]=Die Nepomuk Datei-Ontologie legt grundlegende Dateitypen fest.
+ Comment[el]=Η οντολογία αρχείων Nepomuk ορίζει τους βασικούς τύπους αρχείων
+ Comment[es]=La ontología de ficheros Nepomuk define tipos básicos de ficheros
++Comment[et]=Nepomuki failiontoloogia määrab põhilised failitüübid
+ Comment[fa]=هستی‌شناسی پرونده Nepomuk، انواع پرونده پایه‌ای را تعریف می‌کند
+ Comment[ga]=Sainmhíníonn Ointeolaíocht Comhad Nepomuk bunchineálacha comhaid
+ Comment[he]=אונטולוגיית הקובץ של Nepomuk מגדירה את סוגי הקבצים הבסיסיים
+@@ -42,11 +47,14 @@
+ Comment[km]=ប្រាណវិទ្យា​ឯកសារ Nepomuk កំណត់​ប្រភេទ​ឯកសារ​មូលដ្ឋាន
+ Comment[kn]=ನೆಪೋಮುಕ್ ಕಡತ ಸತ್ತಾಶಾಸ್ತ್ರವು (ಆಂಟಾಲಜಿ) ಮೂಲಭೂತ ಕಡತ ಬಗೆಗಳನ್ನು ನಿಷ್ಕೃಷ್ಟಗೊಳಿಸುತ್ತದೆ
+ Comment[ko]=Nepomuk 파일 온톨로지는 기본 파일 형식을 정의합니다
++Comment[nb]=Nepomuk fil-ontologien definerer grunnlegtgende filtyper
+ Comment[nds]=Dat Dateiweeswark Nepomuk leggt Dateigrundtypen fast
+ Comment[ne]=नेपोमक फाइल ओन्टोलोजीले आधारभूत फाइल प्रकार परिभाषित गर्दछ
+ Comment[nl]=De Nepomuk Bestandsontologie definieert basis bestandstypen
+ Comment[pt]=A Ontologia de Ficheiros do Nepomuk define os tipos básicos de ficheiros
+ Comment[pt_BR]=A Ontologia de Arquivos Nepomuk define os tipos básicos de arquivos
++Comment[sr]=Непомукова онтологија фајлова дефинише основне типове фајлова
++Comment[sr at latin]=Nepomukova ontologija fajlova definiše osnovne tipove fajlova
+ Comment[sv]=Nepomuks filontologi definerar grundläggande filtyper
+ Comment[th]=คำศัพท์กำกับแฟ้มของ Nepomuk จะนิยามชนิดแฟ้มพื้นฐาน
+ Comment[vi]=Bản thể học tập tin Nepomuk thì xác định các kiểu tập tin cơ bản
+--- a/nepomuk/ontologies/dctype.desktop
++++ b/nepomuk/ontologies/dctype.desktop
+@@ -8,6 +8,7 @@
+ Name[de]=Die DCMI-Typen
+ Name[el]=Οι τύποι DCMI
+ Name[es]=Los tipos DCMI
++Name[et]=DCMI Types
+ Name[fa]=انواع DCMI
+ Name[ga]=Na Cineálacha DCMI
+ Name[he]=טיפוסים של DCMI
+@@ -17,6 +18,8 @@
+ Name[km]=ប្រភេទ DCMI
+ Name[kn]=DCMI ಬಗೆಗಳು
+ Name[ko]=DCMI 형식
++Name[lv]=DCMI tipi
++Name[nb]=DCMI-typene
+ Name[nds]=De DCMI-Typen
+ Name[ne]=DCMI प्रकार
+ Name[nl]=De DMCI-typen
+@@ -24,8 +27,11 @@
+ Name[pt]=Os Tipos do DCMI
+ Name[pt_BR]=Tipos DCMI
+ Name[sl]=Vrste DCMI
++Name[sr]=ДЦМИ типови
++Name[sr at latin]=DCMI tipovi
+ Name[sv]=DCMI-typerna
+ Name[th]=ชนิดของ DCMI
++Name[uk]=Типи DCMI
+ Name[vi]=Kiểu DCMI
+ Name[wa]=Les sôres DCMI
+ Name[x-test]=xxThe DCMI Typesxx
+@@ -38,6 +44,7 @@
+ Comment[de]=Der Namensraum der Dublin Core Types stellt URIs für die Einträge des DCMI-Typ-Vokabulars bereit.
+ Comment[el]=Ο χώρος ονομάτων τύπων Dublin Core προσφέρει URI των καταχωρήσεων του λεξικού τύπων DCMI.
+ Comment[es]=El espacio de nombres Dublin Core proporciona URI para las entradas del vocabulario de tipos DCMI.
++Comment[et]=Dublin Core Typesi nimeruum pakub URI-d DCMI Type sõnastiku kirjetele.
+ Comment[fa]=فضای نام انواع هسته Dublin، URIهایی را برای مدخلهای واژگان نوع DCMI فراهم می‌کند.
+ Comment[ga]=Soláthraíonn ainmspás na gcineálacha Dublin Core URIanna le haghaidh iontrálacha sa Stór Cineálacha DCMI.
+ Comment[he]=תחום השמות של הטיפוסים של Dublin Core מספק כתובות עבור רשומות אוצר הטיפוסים של DCMI.
+@@ -46,11 +53,14 @@
+ Comment[km]=ចន្លោះ​ឈ្មោះ​ប្រភេទ​ស្នូល Dublin ផ្ដល់ URIs សម្រាប់​ធាតុ​របស់​វាក្យស័ព្ទ​ប្រភេទ DCMI ។
+ Comment[kn]=ಡಬ್ಲಿನ್ ಕೋರ್ ಬಗೆಯ ನಾಮವ್ಯೋಮವು (ನೇಮ್ ಸ್ಪೇಸ್), DCMI ಬಗೆಯ ಪದಪಟ್ಟಿಯ ನಮೂದುಗಳಿಗೆ URI ಗಳನ್ನು ನೀಡುತ್ತದೆ.
+ Comment[ko]=더블린 코어 형식 네임스페이스는 DCMI 형식 어휘의 항목에 접근하기 위한 URI를 제공합니다.
++Comment[nb]=Navnerommet Dublin Core Types inneholder URI-er til oppføringene i DCMI type-ordlista.
+ Comment[nds]=De Naamruum vun de Dublin-Core-Typen, de URIs praatstellt för de Indrääg vun den Typ-Woortsett vun DCMI.
+ Comment[ne]=डब्लिन मुख्य प्रकार नेमस्पेसले DCIM प्रकारका शब्दकोशको प्रविष्टिका लागि URIs उपलब्ध गराउँछ ।
+ Comment[nl]=De Dublin Core Types namespace levert URI-adressen voor de items van de DCMI-type-vocabulaire.
+ Comment[pt]=O espaço de nomes dos Tipos do Dublin Core oferece URIs para os itens do Vocabulário de Tipos do DCMI.
+ Comment[pt_BR]=O espaço de nomes Dublin Core Types fornece URIs para os itens do Vocabulário de Tipos DCMI
++Comment[sr]=Именски простор типова Даблинског језгра наводи УРИ-је ставки из Речника ДЦМИ типова.
++Comment[sr at latin]=Imenski prostor tipova Dablinskog jezgra navodi URI-je stavki iz Rečnika DCMI tipova.
+ Comment[sv]=Dublin-kärntypernas namnrymd tillhandahåller adresser för posterna i DCMI- typordförrådet.
+ Comment[th]=รูปแบบชื่อชนิดหลักของ Dublin ที่ให้ URI สำหรับรายการของคำศัพท์แบบ DCMI
+ Comment[vi]=Miền tên Kiểu Lõi Dublin thì cung cấp URI cho mỗi mục Từ vựng Kiểu DCMI.
+--- a/nepomuk/ontologies/nrl.desktop
++++ b/nepomuk/ontologies/nrl.desktop
+@@ -7,6 +7,7 @@
+ Name[csb]=Reprezentowóny jãzëk Napomuk
+ Name[el]=Γλώσσα αναπαράστασης Nepomuk
+ Name[es]=Lenguaje de representación Nepomuk
++Name[et]=Nepomuki esituskeel
+ Name[fa]=زبان بازنمایی Nepomuk
+ Name[ga]=Teanga Léirithe Nepomuk
+ Name[he]=שפת ייצוג של Nepomuk
+@@ -20,8 +21,11 @@
+ Name[nl]=Nepomuk Representatietaal
+ Name[pt]=NRL (Nepomuk Representation Language)
+ Name[pt_BR]=Linguagem de Representação Nepomuk
++Name[sr]=Непомуков репрезентациони језик
++Name[sr at latin]=Nepomukov reprezentacioni jezik
+ Name[sv]=Nepomuks beskrivningsspråk
+ Name[th]=ภาษาตัวแทน Nepomuk
++Name[uk]=Мова репрезентації Nepomuk
+ Name[vi]=Ngôn ngữ đại diện Nepomuk
+ Name[wa]=Lingaedje di reprezintåcion nepomuk
+ Name[x-test]=xxNepomuk Representation Languagexx
+@@ -35,16 +39,20 @@
+ Comment[el]=Η NRL είναι μια γλώσσα αναπαράστασης η οποία ξεπερνά συγκεκριμένους περιορισμούς της RDF/S. Έχει σχεδιαστεί πάνω στην RDF. Συγκεκριμένα περιλαμβάνει υποστήριξη για γραφήματα ονομάτων για την επεξεργασία δεδομένων. Αν και πρόκειται για μια πολύ δημοφιλής έννοια, τα γραφήματα ονομάτων δεν υποστηρίζονταν από οποιαδήποτε γλώσσα αναπαράστασης μέχρι τώρα. Βασισμένα στην οπτική ιδέα χειρισμού των οντοτήτων. Αυτή η οπτική ιδέα αποδείχτηκε εξαιρετικής αξία, καθώς προσφέρει ένα μηχανισμό επιβολής διαφορετικής σημειολογία διατηρώντας την ίδια συντακτική δομή.
+ Comment[en_GB]=NRL is a Representational Language that addresses certain limitations on the part of RDF/S. It is itself designed on top of RDF. In particular it includes support for Named Graphs for modularisation of data. Although being a widely-popular notion, named graphs have not been supported by any Representational Language so far. It is also based on a view concept for the tailoring of ontologies. This view concept turned out to be of additional value, as it also provides a mechanism to impose different semantics on the same syntactical structure.
+ Comment[es]=NRL es un lenguaje de representación que supera algunas limitaciones de RDF/S. Está diseñado sobre RDF. En concreto, implementa gráficos con nombre («named graphs») para modularización de datos. Aunque son una noción muy popular, hasta ahora ningún lenguaje de representación ha implementado los gráficos con nombre. También está basado sobre un concepto de vista para la adaptación de ontologías. Este concepto de vista resultó de ser valor añadido, pues también proporciona un mecanismo para imponer diferentes semánticas sobre la misma estructura sintáctica.
++Comment[et]=NRL (Nepomuk Representation Language) on esituskeel, mille siht on ületada teatud RDF/S-i piirangud. See paikneb RDF-ist kõrgemal. Eelkõige toetab see andmete modulariseerimisel nimega graafe. Ehkki nimega graafid on üsna laialt levinud, ei ole seni ükski esituskeel neid toetanud. Samuti kasutab NRL ontoloogiate käsitlemisel vaatekontseptsiooni. Sellel on omaette väärtus, sest see pakub ka mehhanismi, kuidas rakendada ühe ja sama süntaksistruktuuri korral erinevat semantikat.
+ Comment[ga]=Is teanga léiriúcháin é NRL a thugann aghaidh ar lochtanna áirithe i RDF/S. Tá sé tógtha ar bharr RDF.  Go sonrach, tá tacaíocht do Ghraif Ainmnithe ar fáil ann, le haghaidh modúlaithe sonraí.  Cé go bhfuil siad i mbéal an phobail, ní raibh tacaíocht do Ghraif Ainmnithe ar fáil in aon Teanga Léiriúcháin go dtí seo. Tá NRL bunaithe freisin ar "choincheap amhairc" le haghaidh oiriúnú d'ointeolaíochtaí.  Ba bhreisluach ar an gcoincheap amhairc seo, toisc go soláthraíonn sé meicníocht lenar féidir séimeantaic dhifriúil a chur i bhfeidhm ar aon struchtúr comhréireach amháin.
+ Comment[he]=שפת הייצוג של Nepomuk ‏(NRL) היא שפת ייצוג שנועדה לפתור מגבלות מסויימות של RDF/S. השפה כשלעצמה תוכננה כהרחבה ל־RDF. בפרט, היא כוללת תמיכה בגרפים בעלי שמות כדי לאפשר מודולריזציה של מידע. למרות שזהו מושג נפוץ, עד כה אף שפת ייצוג לא תמכה בגרפים בעלי שמות. כמו כן, השפה מבוססת גם על רעיון של תצוגה לשם התאמת אונטולוגיות. רעיון זה הסתבר כבעל ערך מוסף מכיוון שהוא מספק מנגנון להחיל סמנטיקות שונות על אותו מבנה תחבירי.
+ Comment[hu]=Az NRL egy ábrázoló nyelv, mely az RDF/S kiegészítésére készült. Maga a nyelv az RDF-re épül. Támogatja a nével ellátott grafikonokat az adatmodularizáció érdekében. Jóllehet elterjedt koncepciónak számít, a névvel ellátott grafikonokat eddig egyik ábrázoló nyelv sem támogatta. Támogat továbbá nézeteket is az ontológiák testreszabásához. Ez egy igen hasznos lehetőség, mert lehetővé teszi kölünféle szemnatikák alkalmazását ugyanarra a szintaktikai struktúrára.
+ Comment[kk]=NRL деген RDF/S дегеннің кейбір шектеу бөгеттерінен өту үшін арналған көрсетілімдер тілі. Ол RDF-тың негізінде құрылған. Демек, ол деректерді модуляризациялау үшін Атаулы диаграммасын қолдануға мүмкіндік береді. Қолдануы кең тараған болсада, атаулы диаграмма әзірше кез-келген көрсетілімдер тілімен қамтылмайды. Ол онтология көрініс концепциясын негіздейді. Бұл көрініс концепциясы қосымша табыс деп табылады, өйткені оның бір синтаксис құрылымында түрлі семантикаларды біріктіру тетігі бар.
+ Comment[km]=NRL គឺ​ជា​ភាសា​តំណាង​ដែល​ដាក់អាសយដ្ឋាន​​ការ​កំណត់​ពិតប្រាកដ​នៅលើ​ផ្នែក​នៃ RDF/S ។ វា​រចនា​ខ្លួន​វា​នៅលើ​កំពូល RDF ។ ជា​ពិសេស វា​រួម​បញ្ចូល​ការ​គាំទ្រ​សម្រាប់​ក្រាហ្វ​ដែល​បាន​ដាក់​ឈ្មោះ​សម្រាប់​ការ​រៀបចំ​ទិន្នន័យ​ជា​ម៉ូឌុល ។ ទោះ​បីជា ការ​យល់ដឹង​ទូលំទូលាយ​ក៏ដោយ ក៏​ក្រាហ្វ​ដែល​មាន​ឈ្មោះ​មិនត្រូវ​បាន​គាំទ្រ​ដោយ​ភាសា​តំណាង​ណាមួយ​ឡើយ ។ វា​ក៏​មាន​មូលដ្ឋាន​លើ​គំនិត​ទិដ្ឋភាព​សម្រាប់ការ​បន្ថែម​នៃ​ប្រាណ​វិទ្យា ។ គំនិត​ទិដ្ឋភាព​នេះ​នឹង​ត្រូវ​បង្កើត​ដើម្បី​ធ្វើ​ជា​តម្លៃ​បន្ថែម ដូចដែល​វា​ផ្ដល់​យន្តការ​សម្រាប់​ដាក់លើ​ភាសា​ផ្សេងគ្នា​លើ​រចនា​សម្ព័ន្ធវាក្យ​សម្ព័ន្ធ​ដូចគ្នា ។
++Comment[nb]=NRL er et representasjonsspråk som tar seg av noen svakheter i RDF/S. Det er bygget opp over RDF, spesielt har det med støtte for navngitte grafer for å kunne modularisere data. Selv om det er viden kjent har ikke navngitte grafer hatt støtte i noe representasjonsspråk hittil. Det er også basert på et visningsbegrep for å skreddersy ontologier. Dette visningsbegrepet viste seg å ha ekstra verdi, siden det også gir en mekanisme for å legge på forskjellig semantikk på den samme syntaktiske strukturen.
+ Comment[nds]=De Nepomuk-Vörstellspraak (engl. "Nepomuk Representation Language", "NRL") schall en Reeg Ingrenzen in RDF/S richten un buut dor op op. NRL ünnerstütt nöömt Diagrammen, Daten laat sik so moduulwies bewerken. Ok wenn se utbreedt bruukt warrt, hett betherto noch keen anner Vörstellspraak nöömt Diagrammen ünnerstütt. NRL buut ok op en besünner Wiesmetood för't Topassen vun Weeswarken, de as sünnerlich bruukbor rutkamen is. Mit disse Metood lett sik een syntaktsche Struktuur mit verscheden Bedüden opfüllen.
+ Comment[ne]=NRL एउटा RDF/S को भागमा निश्चित सीमा दर्शाउने प्रतिनिधि भाषा हो । यसलाई आफैँमा RDF को माथि डिजाइन गरिएको हुन्छ । खसमा यसले डेटाको मोडल गर्नका लागि नमाकरण गरिएका ग्राफको समर्थन समाविष्ट गर्दछ । धेरै लोकप्रिय विचार भएता पनि, नामकरण गरिएको ग्राफलाई धेरै प्रतिनिधि भाषाद्वारा समर्थन गरेको छैन । यो ओन्टोलोगिको टेलरिङका लागि दृश्य धारणामा पनि आधारित हुन्छ । यो दृश्य धारणा अतिरिक्त मान हुने गरी मेटिनेछ, त्यस्तै यसले उस्तै वाक्य रचना संरचनामा फरक शाब्दिक प्रभाव पार्ने संयन्त्र पनि उपलब्ध गर्दछ ।
+ Comment[nl]=NRL is een representationele taal gericht op het oplossen van bepaalde beperkingen in RDF/S. Het is geschreven als een uitbreiding van RDF. Het heeft ondersteuning voor 'Named Graphs' voor de modularisatie van data. Hoewel het een erg populair begrip is worden Named Graphs tot nog toe niet ondersteund in een representationele taal. Het is ook gebaseerd op een experimentele weergavemethode voor het aanpassen van ontologieën. Deze experimentele weergave bleek waarde toe te voegen, daar het een mechanisme bood om verschillende semantieken op de zelfde syntactische structuur te projecteren.
+ Comment[pt]=A NRL é uma Linguagem de Representação que lida com certas limitações por parte do RDF/S. Ela está desenhada em si sobre o RDF. Em particular, inclui o suporte para Grafos com Nomes, para a modularização dos dados. Ainda que seja uma noção bastante popular, os grafos com nomes não foram suportados por nenhuma linguagem de representação até agora. Também se baseia no conceito de vista para a concepção de ontologias. Este conceito de vista acabou por ser um valor acrescentado, dado que oferece também um mecanismo para impor semânticas diferentes sobre a mesma estrutura sintáctica.
+ Comment[pt_BR]=A NRL é uma Linguagem Representacional que aborda certas limitações por parte do RDF/S.  A própria NRL é desenhada em cima do RDF.  Ela conta com suporte para Named Graphs para a modularização de dados.  Embora este seja um conceito muito conhecido, até agora não havia nehuma Linguagem Representacional com suporte para named graphs.  A NRL também se baseia num conceito de visualização para o ajuste de ontologias.  Este conceito de visualização passou a ter um valor a mais, visto que proporciona também um mecanismo para import diferentes semânticas na mesma estrutura sintática.
++Comment[sr]=НРЛ је репрезентациони језик који решава извесна ограничења на страни РДФ шеме; сам је пројектован на основи РДФ-а. Посебно садржи подршку за именоване графове за модуларизацију података, које, иако широко популарне у идејном смислу, пре овога није подржавао ниједан репрезентациони језик. Такође је заснован на приказном концепту за прилагођавање онтологија, код кога је уочена и допунска вредност у томе што пружа механизам за наметање различите семантике над истом синтаксном структуром.
++Comment[sr at latin]=NRL je reprezentacioni jezik koji rešava izvesna ograničenja na strani RDF šeme; sam je projektovan na osnovi RDF-a. Posebno sadrži podršku za imenovane grafove za modularizaciju podataka, koje, iako široko popularne u idejnom smislu, pre ovoga nije podržavao nijedan reprezentacioni jezik. Takođe je zasnovan na prikaznom konceptu za prilagođavanje ontologija, kod koga je uočena i dopunska vrednost u tome što pruža mehanizam za nametanje različite semantike nad istom sintaksnom strukturom.
+ Comment[sv]=Nepomuks beskrivningsspråk (NRL) är ett representationsspråk som tar hand om vissa begränsningar som finns i RDF/S. Det är själv konstruerat med RDF som grund. I synnerhet innehåller det stöd för namngivna grafer för modularisering av data. Även om de är populära på många håll, har inte namngivna grafer tidigare haft stöd i något representationsspråk. Det är också baserat på ett vykoncept för anpassning av ontologier. Vykonceptet visade sig vara värdefullt på flera sätt, eftersom det också tillhandahåller en mekanism för att införa olika semantik med samma syntaktiska struktur.
+ Comment[th]=NRL คือภาษาตัวแทนที่จะบอกถึงข้อจำกัดในส่วนของ RDF/S โดยตัวมันนั้นถูกออกแบบมา ให้อยู่ในขั้นสูงกว่า RDF ว่ากันโดยละเอียดแล้วก็คือ มันจะรวมการสนับสนุนกราฟที่มีชื่อสำหรับ กระทำข้อมูลให้เป็นโมดูล แม้ว่าจะเป็นที่รู้จักกันอย่างกว้างขวาง แต่กราฟที่มีชื่อยังไม่ได้รับ การสนับสนุนจากภาษาตัวแทนในขณะนี้ นอกจากนี้มันยังตั้งอยู่บนพื้นฐานของมุมมองความคิด สำหรับการสร้างคำศัพท์กำกับด้วย โดยมุมมองความคิดนี้ก็กลายเป็นค่าเพิ่มเติม เพราะว่า มันก็ได้ให้กลไกในการกำหนดความหมายต่างๆ กันในแต่ละโครงสร้างทางไวยากรณ์ด้วย
+ Comment[vi]=Ngôn ngữ đại diện Nepomuk (Nepomuk Representation Language: NRL) là một ngôn ngữ đại diện có thỏa mãn một số giới hạn nào đó trong RDF/S. Chính nó được thiết kế bên trên RDF. Đặc biệt nó gồm khả năng hỗ trợ Đồ thị có Tên để mô-đun hoá các dữ liệu. Mặc dù Đồ thị có Tên là ý kiến phổ biến rộng rãi, nó chưa được hỗ trợ bởi Ngôn ngữ Đại diện nào. Nó cũng dựa vào một khái niệm xem để điều chỉnh bản thể học. Khái niệm xem này đã xảy ra hữu ích hơn, vỉ nó cũng cung cấp một cơ chế để điều khiển ngữ nghĩa học khác trên cùng một cấu trúc kiểu cú pháp.
+--- a/nepomuk/ontologies/rdfs.desktop
++++ b/nepomuk/ontologies/rdfs.desktop
+@@ -7,6 +7,7 @@
+ Name[cs]=RDF schéma
+ Name[el]=Σχήμα RDF
+ Name[es]=Esquema RDF
++Name[et]=RDF-skeem
+ Name[fa]=طرحواره RDF
+ Name[he]=סכמת־RDF
+ Name[hu]=RDF séma
+@@ -14,12 +15,17 @@
+ Name[km]=គ្រោងការណ៍ RDF
+ Name[kn]=RDF-ರೂಪರೇಖೆ (ಸ್ಕೀಮಾ)
+ Name[ko]=RDF 스키마
++Name[lv]=RDF shēma
++Name[nb]=RDF-skjema
+ Name[ne]=RDF-स्कीमा
+ Name[nl]=RDF-schema
+ Name[pa]=RDF-ਸਕੀਮਾਂ
+ Name[pt]=Esquema RDF
+ Name[sl]=Shema RDF
++Name[sr]=РДФ шема
++Name[sr at latin]=RDF šema
+ Name[sv]=RDF-schema
++Name[uk]=RDF-схема
+ Name[vi]=Giản đồ RDF
+ Name[wa]=Chema RDF
+ Name[x-test]=xxRDF-Schemaxx
+@@ -37,13 +43,18 @@
+ Comment[km]=ភាសា​ពិពណ៌នា​វាក្យ​ស័ព្ទ RDF ១.០ ៖ គ្រោងការណ៍ RDF
+ Comment[kn]=RDF ಪದಪಟ್ಟಿ (ವೊಕಾಬುಲರಿ) ವಿವರಣಾ ಭಾಷೆ ೧.೦: RDF-ರೂಪರೇಖೆ (ಸ್ಕೀಮಾ)
+ Comment[ko]=RDF 어휘 설명 언어 1.0: RDF 스키마
++Comment[lv]=RDF vārdnīcas apraksta valoda 1.0: RDF shēma
++Comment[nb]=RDF-språk for ordlistebeskrivelse 1.0 : RDF-skjema
+ Comment[nds]=Woortsett-Beschrievspraak RDF 1.0: RDF-Schema
+ Comment[ne]=RDF शब्दकोश वर्णन भाषा 1.0: RDF स्कीमा
+ Comment[nl]=RDF Vocabulaire Beschrijvingstaal 1.0: RDF-schema
+ Comment[pt]=RDF Vocabulary Description Language 1.0: Esquema de RDF
+ Comment[pt_BR]=Linguagem de Descrição de Vocabulário RDF 1.0: RDF Schema
++Comment[sr]=РДФ језик за опис речника 1.0: РДФ шема
++Comment[sr at latin]=RDF jezik za opis rečnika 1.0: RDF šema
+ Comment[sv]=RDF-ordförrådsbeskrivningsspråk 1.0 schema
+ Comment[th]=ภาษาสำหรับอธิบายคำศัพท์ RDF: รูปแบบ RDF
++Comment[uk]=Мова RDF опису слів 1.0: схема RDF
+ Comment[vi]=Ngôn ngữ Diễn tả Từ vựng RDF 1.0: giản đồ RDF
+ Comment[wa]=Chema do lingaedje di discrijhaedje di vocabulaire RDF 1.0
+ Comment[x-test]=xxRDF Vocabulary Description Language 1.0: RDF Schemaxx
+--- a/nepomuk/core/resourcemanager.cpp
++++ b/nepomuk/core/resourcemanager.cpp
+@@ -31,14 +31,22 @@
+ #include <krandom.h>
+ 
+ #include <Soprano/Client/DBusClient>
++#include <Soprano/Client/DBusModel>
+ #include <Soprano/Node>
+ #include <Soprano/Statement>
+-#include <Soprano/DummyModel>
+ #include <Soprano/Vocabulary/RDF>
+ #include <Soprano/StatementIterator>
+ 
++// just to be sure nobody hits me due to the API change in Soprano
++#include <soprano/dummymodel.h>
++namespace Soprano {
++   namespace Util {
++   class Dummy {};
++   }
++}
+ 
+ using namespace Soprano;
++using namespace Soprano::Util;
+ 
+ 
+ static const char* NEPOMUK_NAMESPACE = "http://nepomuk.kde.org/resources#";
+@@ -57,7 +65,7 @@
+     Soprano::Client::DBusClient client;
+     Soprano::Model* mainModel;
+ 
+-    Soprano::DummyModel* dummyModel;
++    DummyModel* dummyModel;
+ 
+ private:
+     ResourceManager* m_parent;
+@@ -218,7 +226,7 @@
+ 
+     if ( !d->mainModel ) {
+         if ( !d->dummyModel ) {
+-            d->dummyModel = new Soprano::DummyModel();
++            d->dummyModel = new DummyModel();
+         }
+         return d->dummyModel;
+     }
+--- a/nepomuk/core/ontology/nepomukontologyloader.cpp
++++ b/nepomuk/core/ontology/nepomukontologyloader.cpp
+@@ -23,6 +23,7 @@
+ #include <Soprano/Statement>
+ #include <Soprano/Model>
+ #include <Soprano/QueryResultIterator>
++#include <Soprano/Client/DBusModel>
+ #include <Soprano/Client/DBusClient>
+ 
+ #include <QtCore/QDebug>
+--- a/kimgio/qimageio_plugin.desktop
++++ b/kimgio/qimageio_plugin.desktop
+@@ -11,7 +11,9 @@
+ Comment[de]=QImageIOHandler-Modul
+ Comment[el]=Πρόσθετο QImageIOHandler
+ Comment[es]=Complemento QImageIOHandler
++Comment[et]=QImageIOHandleri plugin
+ Comment[fa]=وصله QImageIOHandler
++Comment[fi]=QImageIOHandler-lisäosa
+ Comment[ga]=Breiseán QImageIOHandler
+ Comment[he]=תוסף QImageIOHandler
+ Comment[hu]=QImageIOHandler modul
+@@ -21,6 +23,9 @@
+ Comment[km]=កម្មវិធី​ជំនួយ QImageIOHandler
+ Comment[kn]=QImageIOHandler ಮಿಳಿತಾನ್ವಯ (ಪ್ಲಗಿನ್)
+ Comment[ko]=QImageIOHandler 플러그인
++Comment[lt]=QImageIOHandler priedas
++Comment[lv]=QImageIOHandler spraudnis
++Comment[nb]=QImageIOHandler programtillegg
+ Comment[nds]=QImage-In-/Utgaavmoduul
+ Comment[ne]=QImageIOHandler प्लगइन
+ Comment[nl]=QImageIOHandler-plugin
+@@ -28,8 +33,11 @@
+ Comment[pt]='Plugin' do QImageIOHandler
+ Comment[pt_BR]=Plugin do QImageIOHandler
+ Comment[sl]=Vstavek QImageIOHandler
++Comment[sr]=Прикључак QImageIO руковаоца
++Comment[sr at latin]=Priključak QImageIO rukovaoca
+ Comment[sv]=Insticksprogram för QImage I/O-hantering
+ Comment[th]=ปลั๊กอินสำหรับจัดการ IO ของภาพ QImage
++Comment[uk]=Втулок QImageIOHandler
+ Comment[vi]=Bổ sung QImageIOHandler
+ Comment[wa]=Tchôke-divins QImageIOHandler
+ Comment[x-test]=xxQImageIOHandler pluginxx
+--- a/kimgio/dds.desktop
++++ b/kimgio/dds.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=DDS
++Name[sr]=ДДС
+ Name[te]=డిడిఎస్
+ Name[x-test]=xxDDSxx
+ Type=Service
+--- a/kimgio/hdr.desktop
++++ b/kimgio/hdr.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=HDR
++Name[sr]=ХДР
+ Name[te]=హెచ్ డి ఆర్
+ Name[x-test]=xxHDRxx
+ Type=Service
+--- a/kimgio/pbm.desktop
++++ b/kimgio/pbm.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=PBM
++Name[sr]=ПБМ
+ Name[te]=పిబిఎం
+ Name[x-test]=xxPBMxx
+ Type=Service
+--- a/kimgio/mng.desktop
++++ b/kimgio/mng.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=MNG
++Name[sr]=МНГ
+ Name[te]=ఎంఎన్ జి
+ Name[x-test]=xxMNGxx
+ Type=Service
+--- a/kimgio/png.desktop
++++ b/kimgio/png.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=PNG
++Name[sr]=ПНГ
+ Name[te]=పిఎన్ జి
+ Name[x-test]=xxPNGxx
+ Type=Service
+--- a/kimgio/jpeg.desktop
++++ b/kimgio/jpeg.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=JPEG
++Name[sr]=ЈПЕГ
+ Name[te]=జెపిఈజి
+ Name[x-test]=xxJPEGxx
+ Type=Service
+--- a/kimgio/xbm.desktop
++++ b/kimgio/xbm.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=XBM
++Name[sr]=ИксБМ
+ Name[te]=ఎక్స్ బిఎం
+ Name[x-test]=xxXBMxx
+ Type=Service
+--- a/kimgio/eps.desktop
++++ b/kimgio/eps.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=EPS
++Name[sr]=ЕПС
+ Name[te]=ఇపిఎస్
+ Name[x-test]=xxEPSxx
+ Type=Service
+--- a/kimgio/jp2.desktop
++++ b/kimgio/jp2.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=JP2
++Name[sr]=ЈП2
+ Name[te]=జెపి2
+ Name[x-test]=xxJP2xx
+ Type=Service
+--- a/kimgio/ppm.desktop
++++ b/kimgio/ppm.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=PPM
++Name[sr]=ППМ
+ Name[te]=పిపిఎం
+ Name[x-test]=xxPPMxx
+ Type=Service
+--- a/kimgio/exr.desktop
++++ b/kimgio/exr.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=EXR
++Name[sr]=ЕИксР
+ Name[te]=ఇఎక్స్ ఆర్
+ Name[x-test]=xxEXRxx
+ Type=Service
+--- a/kimgio/xpm.desktop
++++ b/kimgio/xpm.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=XPM
++Name[sr]=ИксПМ
+ Name[te]=ఎక్స్ పిఎం
+ Name[x-test]=xxXPMxx
+ Type=Service
+--- a/kimgio/gif.desktop
++++ b/kimgio/gif.desktop
+@@ -2,6 +2,7 @@
+ Encoding=UTF-8
+ Name=GIF
+ Name[ar]=SGI
++Name[sr]=ГИФ
+ Name[te]=జిఐఎఫ్
+ Name[x-test]=xxGIFxx
+ Type=Service
+--- a/kimgio/ico.desktop
++++ b/kimgio/ico.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=ICO
++Name[sr]=ИЦО
+ Name[te]=ఐసిఓ
+ Name[x-test]=xxICOxx
+ Type=Service
+--- a/kimgio/rgb.desktop
++++ b/kimgio/rgb.desktop
+@@ -2,6 +2,7 @@
+ Encoding=UTF-8
+ Name=RGB
+ Name[kn]=ಕೆ.ಹ.ನೀ/RGB
++Name[sr]=РГБ
+ Name[te]=ఆర్ జి బి
+ Name[x-test]=xxRGBxx
+ Type=Service
+--- a/kimgio/tga.desktop
++++ b/kimgio/tga.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=TGA
++Name[sr]=ТГА
+ Name[te]=టిజిఏ
+ Name[x-test]=xxTGAxx
+ Type=Service
+--- a/kimgio/bmp.desktop
++++ b/kimgio/bmp.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=BMP
++Name[sr]=БМП
+ Name[te]=బిఎంపి
+ Name[x-test]=xxBMPxx
+ Type=Service
+--- a/kimgio/xcf.desktop
++++ b/kimgio/xcf.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=XCF
++Name[sr]=ИксЦФ
+ Name[te]=ఎక్స్ సిఎఫ్
+ Name[x-test]=xxXCFxx
+ Type=Service
+--- a/kimgio/pgm.desktop
++++ b/kimgio/pgm.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=PGM
++Name[sr]=ПГМ
+ Name[te]=పిజిఎం
+ Name[x-test]=xxPGMxx
+ Type=Service
+--- a/kimgio/psd.desktop
++++ b/kimgio/psd.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=PSD
++Name[sr]=ПСД
+ Name[te]=పిఎస్ డి
+ Name[x-test]=xxPSDxx
+ Type=Service
+--- a/kimgio/tiff.desktop
++++ b/kimgio/tiff.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=TIFF
++Name[sr]=ТИФФ
+ Name[te]=టిఐ ఎఫ్ఎఫ్
+ Name[x-test]=xxTIFFxx
+ Type=Service
+--- a/kimgio/pcx.desktop
++++ b/kimgio/pcx.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=PCX
++Name[sr]=ПЦИкс
+ Name[te]=పిసిఎక్స్
+ Name[x-test]=xxPCXxx
+ Type=Service
+--- a/kimgio/xv.desktop
++++ b/kimgio/xv.desktop
+@@ -1,6 +1,7 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+ Name=XV
++Name[sr]=ИксВ
+ Name[te]=ఎక్స్ వి
+ Name[x-test]=xxXVxx
+ Type=Service
+--- a/kio/kfileplugin.desktop
++++ b/kio/kfileplugin.desktop
+@@ -33,7 +33,7 @@
+ Name[ko]=KFile 메타 데이터 플러그인
+ Name[lb]=KFile-Metadonnéeë-Plugin
+ Name[lt]=KFile Meta duomenų priedas
+-Name[lv]=KFailu meta datu iespraudnis
++Name[lv]=KFile meta datu spraudnis
+ Name[mk]=KFile приклучок за мета податоци
+ Name[ms]=Plug masuk Data Meta KFile
+ Name[nb]=KFile programtillegg for metadata
+@@ -48,8 +48,8 @@
+ Name[ru]=Модуль метаданных KFile
+ Name[se]=KFile lassemoduvla metadieđuid várás
+ Name[sl]=Vstavek za meta podatke pri KFile
+-Name[sr]=KFile прикључак за мета податке
+-Name[sr at latin]=KFile priključak za meta podatke
++Name[sr]=Прикључак за метаподатке (к-фајл)
++Name[sr at latin]=Priključak za metapodatke (KFile)
+ Name[sv]=Kfil-metadatainsticksprogram
+ Name[ta]=கேகோப்பு மெட்டா தகவல் சொருகுப்பொருள்
+ Name[te]=కెదస్త్రం మెటా దత్తాంసం ప్లగిన్
+--- a/kio/kio/slaveconfig.cpp
++++ b/kio/kio/slaveconfig.cpp
+@@ -82,7 +82,7 @@
+    {
+       QString filename = KProtocolInfo::config(_protocol);
+       scp = new SlaveConfigProtocol;
+-      scp->configFile = new KConfig(filename, KConfig::CascadeConfig);
++      scp->configFile = new KConfig(filename, KConfig::NoGlobals);
+       protocol.insert(_protocol, scp);
+    }
+    // Read global stuff...
+--- a/kio/kio/kdesktopfileactions.cpp
++++ b/kio/kio/kdesktopfileactions.cpp
+@@ -31,6 +31,8 @@
+ #include <klocale.h>
+ #include "kservice.h"
+ 
++enum BuiltinServiceType { ST_MOUNT = 0x0E1B05B0, ST_UNMOUNT = 0x0E1B05B1 }; // random numbers
++
+ static bool runFSDevice( const KUrl& _url, const KDesktopFile &cfg );
+ static bool runApplication( const KUrl& _url, const QString & _serviceFile );
+ static bool runLink( const KUrl& _url, const KDesktopFile &cfg );
+@@ -136,9 +138,9 @@
+     return false;
+ }
+ 
+-QList<KDesktopFileActions::Service> KDesktopFileActions::builtinServices( const KUrl& _url )
++QList<KServiceAction> KDesktopFileActions::builtinServices( const KUrl& _url )
+ {
+-    QList<Service> result;
++    QList<KServiceAction> result;
+ 
+     if ( !_url.isLocalFile() )
+         return result;
+@@ -150,30 +152,30 @@
+         return result;
+ 
+     if ( cfg.hasDeviceType() ) {
+-        QString dev = cfg.readDevice();
++        const QString dev = cfg.readDevice();
+         if ( dev.isEmpty() ) {
+             QString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.",  _url.path() );
+-            KMessageBoxWrapper::error( 0, tmp);
++            KMessageBoxWrapper::error(0, tmp);
+         } else {
+             KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByDevice( dev );
+             // not mounted ?
+             if ( !mp ) {
+-                Service mount;
+-                mount.m_strName = i18n("Mount");
+-                mount.m_type = ST_MOUNT;
+-                result.append( mount );
++                KServiceAction mount("mount", i18n("Mount"), QString(), QString(), false);
++                mount.setData(QVariant(ST_MOUNT));
++                result.append(mount);
+             } else {
+-                Service unmount;
++                QString text;
+ #ifdef HAVE_VOLMGT
+                 /*
+                  *  Solaris' volume management can only umount+eject
+                  */
+-                unmount.m_strName = i18n("Eject");
++                text = i18n("Eject");
+ #else
+-                unmount.m_strName = i18n("Unmount");
++                text = i18n("Unmount");
+ #endif
+-                unmount.m_type = ST_UNMOUNT;
+-                result.append( unmount );
++                KServiceAction unmount("unmount", text, QString(), QString(), false);
++                unmount.setData(QVariant(ST_UNMOUNT));
++                result.append(unmount);
+             }
+         }
+     }
+@@ -181,120 +183,74 @@
+     return result;
+ }
+ 
+-QList<KDesktopFileActions::Service> KDesktopFileActions::userDefinedServices( const QString& path, bool bLocalFiles )
++QList<KServiceAction> KDesktopFileActions::userDefinedServices( const QString& path, bool bLocalFiles )
+ {
+-  KDesktopFile cfg( path );
+-  return userDefinedServices( path, cfg, bLocalFiles );
++    KDesktopFile cfg( path );
++    return userDefinedServices( path, cfg, bLocalFiles );
+ }
+ 
+-QList<KDesktopFileActions::Service> KDesktopFileActions::userDefinedServices( const QString& path, const KDesktopFile& cfg, bool bLocalFiles, const KUrl::List & file_list )
++QList<KServiceAction> KDesktopFileActions::userDefinedServices( const QString& path, const KDesktopFile& cfg, bool bLocalFiles, const KUrl::List & file_list )
+ {
+-    QList<Service> result;
+-
+-    KConfigGroup cg = cfg.desktopGroup();
++    Q_UNUSED(path); // this was just for debugging; we use service.entryPath() now.
++    KService service(&cfg);
++    return userDefinedServices(service, bLocalFiles, file_list);
++}
+ 
+-    if ( !cg.hasKey( "Actions" ) && !cg.hasKey( "X-KDE-GetActionMenu") )
+-        return result;
++QList<KServiceAction> KDesktopFileActions::userDefinedServices( const KService& service, bool bLocalFiles, const KUrl::List & file_list )
++{
++    QList<KServiceAction> result;
+ 
+-    if ( cg.hasKey( "TryExec" ) && !cfg.tryExec() )
++    if (!service.isValid()) // e.g. TryExec failed
+         return result;
+ 
+     QStringList keys;
+-
+-    if( cg.hasKey( "X-KDE-GetActionMenu" )) {
+-        QStringList dbuscall = cg.readEntry( "X-KDE-GetActionMenu" ).split( QLatin1Char( ' ' ) );
+-
+-        if ( dbuscall.count() >= 4 ) {
+-
+-        const QString& app       = dbuscall.at( 0 );
+-        const QString& object    = dbuscall.at( 1 );
+-        const QString& interface = dbuscall.at( 2 );
+-        const QString& function  = dbuscall.at( 3 );
+-
+-        QDBusInterface remote( app, object, interface );
+-        QDBusReply<QStringList> reply = remote.call( QDBus::BlockWithGui,
+-                                                     function, file_list.toStringList() );
+-        keys = reply;               // ensures that the reply was a QStringList
++    const QString actionMenu = service.property("X-KDE-GetActionMenu", QVariant::String).toString();
++    if (!actionMenu.isEmpty()) {
++        const QStringList dbuscall = actionMenu.split(QChar(' '));
++        if (dbuscall.count() >= 4) {
++            const QString& app       = dbuscall.at( 0 );
++            const QString& object    = dbuscall.at( 1 );
++            const QString& interface = dbuscall.at( 2 );
++            const QString& function  = dbuscall.at( 3 );
++
++            QDBusInterface remote( app, object, interface );
++            QDBusReply<QStringList> reply = remote.call( QDBus::BlockWithGui,
++                                                         function, file_list.toStringList() );
++            keys = reply;               // ensures that the reply was a QStringList
++            if (keys.isEmpty())
++                return result;
+         } else {
+-            qWarning() << i18n("The desktop menu %1 has an invalid X-KDE-GetActionMenu entry.",path);
++            kWarning(7012) << "The desktop file" << service.entryPath()
++                           << "has an invalid X-KDE-GetActionMenu entry.";
+         }
+-
+     }
+ 
+-    keys += cfg.readActions();
+-
+-    if ( keys.count() == 0 )
+-        return result;
+-
+-    QStringList::ConstIterator it = keys.begin();
+-    QStringList::ConstIterator end = keys.end();
+-    for ( ; it != end; ++it )
+-    {
+-        //kDebug(7000) << "CURRENT KEY = " << (*it);
+-
+-        QString group = *it;
+-
+-        if (group == "_SEPARATOR_")
+-        {
+-            Service s;
+-            result.append(s);
+-            continue;
+-        }
+-
+-        bool bInvalidMenu = false;
++    // Now, either keys is empty (all actions) or it's set to the actions we want
+ 
+-        if ( cfg.hasActionGroup( group ) )
+-        {
+-            cg = cfg.actionGroup( group );
+-
+-            if ( !cg.hasKey( "Name" ) || !cg.hasKey( "Exec" ) )
+-                bInvalidMenu = true;
+-            else
+-            {
+-                QString exec = cg.readPathEntry( "Exec" );
+-                if ( bLocalFiles || exec.contains("%U") || exec.contains("%u") )
+-                {
+-                    Service s;
+-                    s.m_strName = cg.readEntry( "Name" );
+-                    s.m_strIcon = cg.readEntry( "Icon" );
+-                    s.m_strExec = exec;
+-                    s.m_type = ST_USER_DEFINED;
+-                    s.m_display = !cg.readEntry( "NoDisplay" , false );
+-                    result.append( s );
+-                }
++    foreach(const KServiceAction& action, service.actions()) {
++        if (keys.isEmpty() || keys.contains(action.name())) {
++            const QString exec = action.exec();
++            if (bLocalFiles || exec.contains("%U") || exec.contains("%u")) {
++                result.append( action );
+             }
+         }
+-        else
+-            bInvalidMenu = true;
+-
+-        if ( bInvalidMenu )
+-        {
+-            QString tmp = i18n("The desktop entry file\n%1\n has an invalid menu entry\n%2.",  path ,  *it );
+-            KMessageBoxWrapper::error( 0, tmp );
+-        }
+     }
+ 
+     return result;
+ }
+ 
+-void KDesktopFileActions::executeService( const KUrl::List& urls, const KDesktopFileActions::Service& _service )
++void KDesktopFileActions::executeService( const KUrl::List& urls, const KServiceAction& action )
+ {
+-    //kDebug(7000) << "EXECUTING Service " << _service.m_strName;
++    //kDebug(7000) << "EXECUTING Service " << action.name();
+ 
+-    if ( _service.m_type == ST_USER_DEFINED ) {
+-        kDebug() << "KDesktopFileActions::executeService " << _service.m_strName
+-                 << " first url's path=" << urls.first().path() << " exec=" << _service.m_strExec << endl;
+-        KRun::run( _service.m_strExec, urls, 0, _service.m_strName, _service.m_strIcon );
+-        // The action may update the desktop file. Example: eject unmounts (#5129).
+-        org::kde::KDirNotify::emitFilesChanged( urls.toStringList() );
+-        return;
+-    } else if ( _service.m_type == ST_MOUNT || _service.m_type == ST_UNMOUNT ) {
++    int actionData = action.data().toInt();
++    if ( actionData == ST_MOUNT || actionData == ST_UNMOUNT ) {
+         Q_ASSERT( urls.count() == 1 );
+-        QString path = urls.first().path();
++        const QString path = urls.first().path();
+         //kDebug(7000) << "MOUNT&UNMOUNT";
+ 
+         KDesktopFile cfg( path );
+-        QString dev = cfg.readDevice();
++        const QString dev = cfg.readDevice();
+         if ( dev.isEmpty() ) {
+             QString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.",  path );
+             KMessageBoxWrapper::error( 0, tmp );
+@@ -302,7 +258,7 @@
+         }
+         KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByDevice( dev );
+ 
+-        if ( _service.m_type == ST_MOUNT ) {
++        if ( actionData == ST_MOUNT ) {
+             // Already mounted? Strange, but who knows ...
+             if ( mp ) {
+                 kDebug(7000) << "ALREADY Mounted";
+@@ -318,7 +274,7 @@
+ #ifndef Q_WS_WIN
+             (void)new KAutoMount( ro, fstype.toLatin1(), dev, point, path, false );
+ #endif
+-        } else if ( _service.m_type == ST_UNMOUNT ) {
++        } else if ( actionData == ST_UNMOUNT ) {
+             // Not mounted? Strange, but who knows ...
+             if ( !mp )
+                 return;
+@@ -327,7 +283,12 @@
+             (void)new KAutoUnmount( mp->mountPoint(), path );
+ #endif
+         }
++    } else {
++        kDebug() << "KDesktopFileActions::executeService " << action.name()
++                 << " first url's path=" << urls.first().path() << " exec=" << action.exec() << endl;
++        KRun::run( action.exec(), urls, 0, action.text(), action.icon() );
++        // The action may update the desktop file. Example: eject unmounts (#5129).
++        org::kde::KDirNotify::emitFilesChanged( urls.toStringList() );
+     }
+-    else
+-        Q_ASSERT( 0 );
+ }
++
+--- a/kio/kio/slave.cpp
++++ b/kio/kio/slave.cpp
+@@ -42,7 +42,6 @@
+ #include <kstandarddirs.h>
+ #include <kapplication.h>
+ #include <ktemporaryfile.h>
+-#include <klibloader.h>
+ #include <ktoolinvocation.h>
+ #include <klauncher_iface.h>
+ 
+--- a/kio/kio/kdatatool.cpp
++++ b/kio/kio/kdatatool.cpp
+@@ -21,7 +21,6 @@
+ #include "kdatatool.h"
+ 
+ #include <kstandarddirs.h>
+-#include <klibloader.h>
+ #include <kdebug.h>
+ #include <kicon.h>
+ #include <kcomponentdata.h>
+--- a/kio/kio/safesite.cpp
++++ b/kio/kio/safesite.cpp
+@@ -24,8 +24,6 @@
+ #include <QTimer>
+ #include <assert.h>
+ 
+-using namespace SafeSite;
+-
+ namespace SafeSite {
+ class Service {
+ public:
+@@ -79,7 +77,7 @@
+ 
+ namespace {
+ 
+-static QList<Service*> *servicesList = 0;
++static QList<SafeSite::Service*> *servicesList = 0;
+ 
+ static void cleanupServicesList() {
+     qDeleteAll(*servicesList);
+@@ -87,10 +85,10 @@
+     servicesList = 0;
+ }
+ 
+-static QList<Service*> *services() {
++static QList<SafeSite::Service*> *services() {
+     if (!servicesList) {
+-        servicesList = new QList<Service*>;
+-        servicesList->append(new DummyService);
++        servicesList = new QList<SafeSite::Service*>;
++        servicesList->append(new SafeSite::DummyService);
+         qAddPostRoutine(cleanupServicesList);
+     }
+     return servicesList;
+--- a/kio/kio/knfsshare.cpp
++++ b/kio/kio/knfsshare.cpp
+@@ -61,7 +61,7 @@
+ {
+   KConfig knfsshare("knfsshare");
+   KConfigGroup config(&knfsshare, "General");
+-  exportsFile = config.readPathEntry("exportsFile");
++  exportsFile = config.readPathEntry("exportsFile", QString());
+ 
+   if ( QFile::exists(exportsFile) )
+     return true;
+--- a/kio/kio/delegateanimationhandler.cpp
++++ b/kio/kio/delegateanimationhandler.cpp
+@@ -22,7 +22,6 @@
+ #include <QListView>
+ #include <QAbstractItemView>
+ #include <QPersistentModelIndex>
+-#include <QTimeLine>
+ #include <QTime>
+ #include <QDebug>
+ 
+--- a/kio/kio/kdesktopfileactions.h
++++ b/kio/kio/kdesktopfileactions.h
+@@ -20,64 +20,65 @@
+ #ifndef KDESKTOPFILEACTIONS_H
+ #define KDESKTOPFILEACTIONS_H
+ 
++#include <kserviceaction.h>
+ #include <kio/kio_export.h>
+ #include <kurl.h>
+ class KDesktopFile;
++class KService;
+ 
+ /**
+  * KDesktopFileActions provides a number of methods related to actions in desktop files.
+  */
+ namespace KDesktopFileActions
+ {
+-    enum ServiceType { ST_MOUNT, ST_UNMOUNT, /* ST_PROPERTIES, */ ST_USER_DEFINED };
+-
+-    /**
+-     * Structure representing a service, in the list of services
+-     * returned by builtinServices and userDefinedServices
+-     */
+-    struct KIO_EXPORT Service
+-    {
+-        Service() { m_display = true; }
+-        bool isEmpty() const { return m_strName.isEmpty(); }
+-        QString m_strName;
+-        QString m_strIcon;
+-        QString m_strExec;
+-        ServiceType m_type;
+-        bool m_display;
+-    };
+-
+     /**
+      * Returns a list of services for the given .desktop file that are handled
+      * by kio itself. Namely mount/unmount for FSDevice files.
+      * @return the list of services
+      */
+-    KIO_EXPORT QList<Service> builtinServices( const KUrl& url );
++    KIO_EXPORT QList<KServiceAction> builtinServices( const KUrl& url );
+ 
+     /**
+      * Returns a list of services defined by the user as possible actions
+-     * on the given .desktop file. May include empty actions which represent where
+-     * visual separators should appear in user-visible representations of those actions,
++     * on the given .desktop file. May include separators (see KServiceAction::isSeparator)
++     * which should appear in user-visible representations of those actions,
+      * such as separators in a menu.
+      * @param path the path to the desktop file describing the services
+      * @param bLocalFiles true if those services are to be applied to local files only
+      * (if false, services that don't have %u or %U in the Exec line won't be taken into account).
+-     * @return the list of user deviced actions
++     * @return the list of user defined actions
+      */
+-    KIO_EXPORT QList<Service> userDefinedServices( const QString& path, bool bLocalFiles );
++    KIO_EXPORT QList<KServiceAction> userDefinedServices( const QString& path, bool bLocalFiles );
+ 
+     /**
+      * Overload of userDefinedServices but also allows you to pass a list of urls for this file.
+      * This allows for the menu to be changed depending on the exact files via
+      * the X-KDE-GetActionMenu extension.
+      */
+-    KIO_EXPORT QList<Service> userDefinedServices( const QString& path, const KDesktopFile& desktopFile, bool bLocalFiles, const KUrl::List & file_list = KUrl::List());
++    KIO_EXPORT QList<KServiceAction> userDefinedServices( const QString& path, const KDesktopFile& desktopFile, bool bLocalFiles, const KUrl::List & file_list = KUrl::List());
+ 
+     /**
++     * Returns a list of services defined by the user as possible actions
++     * on the given .desktop file represented by the KService instance.
++     * May include separators (see KServiceAction::isSeparator) which should
++     * appear in user-visible representations of those actions,
++     * such as separators in a menu.
++     * @param path the path to the desktop file describing the services
++     * @param bLocalFiles true if those services are to be applied to local files only
++     * (if false, services that don't have %u or %U in the Exec line won't be taken into account).
++     * @param file_list list of urls; this allows for the menu to be changed depending on the exact files via
++     * the X-KDE-GetActionMenu extension.
++     *
++     * @return the list of user defined actions
++     */
++    KIO_EXPORT QList<KServiceAction> userDefinedServices( const KService& service, bool bLocalFiles, const KUrl::List & file_list = KUrl::List() );
++
++   /**
+      * Execute @p service on the list of @p urls.
+      * @param urls the list of urls
+      * @param service the service to execute
+      */
+-    KIO_EXPORT void executeService( const KUrl::List& urls, const Service& service );
++    KIO_EXPORT void executeService( const KUrl::List& urls, const KServiceAction& service );
+ 
+     /**
+      * Invokes the default action for the desktop entry. If the desktop
+--- a/kio/kio/sessiondata.cpp
++++ b/kio/kio/sessiondata.cpp
+@@ -263,7 +263,7 @@
+ {
+     d->initDone = true;
+     // Get Cookie settings...
+-    d->useCookie = KConfig("kcookiejarrc", KConfig::CascadeConfig).
++    d->useCookie = KConfig("kcookiejarrc", KConfig::NoGlobals).
+                    group("Cookie Policy" ).
+                    readEntry("Cookies", true);
+ 
+--- a/kio/kio/krun.cpp
++++ b/kio/kio/krun.cpp
+@@ -218,7 +218,7 @@
+     if ( l.exec() )
+     {
+       KService::Ptr service = l.service();
+-      if ( !!service )
++      if ( service )
+         return KRun::run( *service, lst, window, tempFiles, suggestedFileName, asn );
+ 
+       kDebug(7010) << "No service set, running " << l.text();
+@@ -308,7 +308,8 @@
+ {
+    switch( option ) {
+    case 'u':
+-      ret << url.pathOrUrl();
++      ret << ((url.isLocalFile() && url.fragment().isNull() && url.encodedQuery().isNull()) ?
++                 url.toLocalFile()  : url.url());
+       break;
+    case 'd':
+       ret << url.directory();
+--- a/kio/kio/kurifilter.cpp
++++ b/kio/kio/kurifilter.cpp
+@@ -27,7 +27,6 @@
+ #include <kiconloader.h>
+ #include <kservicetypetrader.h>
+ #include <kmimetype.h>
+-#include <klibloader.h>
+ 
+ typedef QList<KUriFilterPlugin *> KUriFilterPluginList;
+ 
+--- a/kio/kio/kdirwatch.cpp
++++ b/kio/kio/kdirwatch.cpp
+@@ -217,7 +217,7 @@
+ 
+ void KDirWatchPrivate::inotifyEventReceived()
+ {
+-  kDebug(7001) << "KDirWatchPrivate::inotifyEventReceived";
++  //kDebug(7001);
+ #ifdef HAVE_SYS_INOTIFY_H
+   if ( !supports_inotify )
+     return;
+@@ -1168,7 +1168,7 @@
+ 
+   delayRemove = true;
+ 
+-  kDebug(7001) << "Fam event received";
++  //kDebug(7001) << "Fam event received";
+ 
+   while(use_fam && FAMPending(&fc)) {
+     if (FAMNextEvent(&fc, &fe) == -1) {
+@@ -1196,7 +1196,7 @@
+ 
+ void KDirWatchPrivate::checkFAMEvent(FAMEvent* fe)
+ {
+-  kDebug(7001) << "checkFAMEvent";
++  //kDebug(7001);
+ 
+   // Don't be too verbose ;-)
+   if ((fe->code == FAMExists) ||
+--- a/kio/kio/renamedialog.cpp
++++ b/kio/kio/renamedialog.cpp
+@@ -35,7 +35,6 @@
+ #include <kpushbutton.h>
+ #include <kio/global.h>
+ #include <kmimetypetrader.h>
+-#include <klibloader.h>
+ #include <kdialog.h>
+ #include <klocale.h>
+ #include <kglobal.h>
+@@ -378,7 +377,7 @@
+ 
+ void RenameDialog::cancelPressed()
+ {
+-  done( 0 );
++    done( R_CANCEL );
+ }
+ 
+ // Rename
+@@ -394,7 +393,7 @@
+     return;
+   }
+ 
+-  done( 1 );
++  done( R_RENAME );
+ }
+ 
+ QString RenameDialog::suggestName(const KUrl& baseURL, const QString& oldName)
+@@ -453,32 +452,32 @@
+ 
+ void RenameDialog::skipPressed()
+ {
+-  done( 2 );
++  done( R_SKIP );
+ }
+ 
+ void RenameDialog::autoSkipPressed()
+ {
+-  done( 3 );
++  done( R_AUTO_SKIP );
+ }
+ 
+ void RenameDialog::overwritePressed()
+ {
+-  done( 4 );
++  done( R_OVERWRITE );
+ }
+ 
+ void RenameDialog::overwriteAllPressed()
+ {
+-  done( 5 );
++  done( R_OVERWRITE_ALL );
+ }
+ 
+ void RenameDialog::resumePressed()
+ {
+-  done( 6 );
++  done( R_RESUME );
+ }
+ 
+ void RenameDialog::resumeAllPressed()
+ {
+-  done( 7 );
++  done( R_RESUME_ALL );
+ }
+ 
+ static QString mime( const KUrl& src )
+--- a/kio/kio/http_slave_defaults.h
++++ b/kio/kio/http_slave_defaults.h
+@@ -28,7 +28,7 @@
+ #define DEFAULT_CACHE_EXPIRE            3*60            // 3 MINS
+ #define DEFAULT_CLEAN_CACHE_INTERVAL    30*60           // 30 MINS
+ #define DEFAULT_CACHE_CONTROL           KIO::CC_Refresh // Verify with remote
+-#define CACHE_REVISION                  "8\n"           // Cache version
++#define CACHE_REVISION                  "9\n"           // Cache version
+ 
+ // DEFAULT USER AGENT KEY - ENABLES OS NAME
+ #define DEFAULT_USER_AGENT_KEYS         "o"             // Show OS
+--- a/kio/kio/skipdialog.cpp
++++ b/kio/kio/skipdialog.cpp
+@@ -45,13 +45,13 @@
+     setButtons( Cancel | User1 | User2 );
+ 
+     setButtonText( User1, i18n( "Skip" ) );
+-    connect( this, SIGNAL( user1Clicked() ), SLOT( b1Pressed() ) );
++    connect( this, SIGNAL( user1Clicked() ), SLOT(skipPressed()) );
+ 
+     setButtonText( User2, i18n( "AutoSkip" ) );
+-    connect( this, SIGNAL( user2Clicked() ), SLOT( b2Pressed() ) );
++    connect( this, SIGNAL( user2Clicked() ), SLOT(autoSkipPressed()) );
+   }
+ 
+-  connect( this, SIGNAL( cancelClicked() ), SLOT( b0Pressed() ) );
++  connect( this, SIGNAL( cancelClicked() ), SLOT(cancelPressed()) );
+ 
+   setMainWidget( new QLabel( _error_text, this ) );
+ 
+@@ -62,19 +62,19 @@
+ {
+ }
+ 
+-void SkipDialog::b0Pressed()
++void SkipDialog::cancelPressed()
+ {
+-  done(0);
++  done(S_CANCEL);
+ }
+ 
+-void SkipDialog::b1Pressed()
++void SkipDialog::skipPressed()
+ {
+-  done(0);
++  done(S_SKIP);
+ }
+ 
+-void SkipDialog::b2Pressed()
++void SkipDialog::autoSkipPressed()
+ {
+-  done(0);
++  done(S_AUTO_SKIP);
+ }
+ 
+ #include "skipdialog.moc"
+--- a/kio/kio/kfilewrite.desktop
++++ b/kio/kio/kfilewrite.desktop
+@@ -12,6 +12,7 @@
+ Comment[el]=Πρόσθετο KFileWrite
+ Comment[eo]=KFileWrite kromaĵo
+ Comment[es]=Complemento KFileWrite
++Comment[et]=KFileWrite'i plugin
+ Comment[fa]=وصلۀ KFileWrite
+ Comment[ga]=Breiseán KFileWrite
+ Comment[he]=תוסף KFileWrite
+@@ -22,6 +23,9 @@
+ Comment[km]=កម្មវិធី​ជំនួយ KFileWrite
+ Comment[kn]=ಕೆಫೈಲ್ರೈಟ್ ಮಿಳಿತಾನ್ವಯ (ಪ್ಲಗಿನ್)
+ Comment[ko]=KFileWrite 플러그인
++Comment[lt]=KFileWrite priedas
++Comment[lv]=KFileWrite spraudnis
++Comment[nb]=KFileWrite programtillegg
+ Comment[nds]=KFile-Schriefmoduul
+ Comment[ne]=केडीई फाइल राइट प्लगइन
+ Comment[nl]=KFileWrite-plugin
+@@ -29,9 +33,12 @@
+ Comment[pt]='Plugin' do KFileWrite
+ Comment[pt_BR]=Plugin do KFileWrite
+ Comment[sl]=Vstavek KFileWrite
++Comment[sr]=Прикључак за запис фајлова (к-фајл)
++Comment[sr at latin]=Priključak za zapis fajlova (KFile)
+ Comment[sv]=KFileWrite-insticksprogram
+ Comment[te]=కెఫైల్ వ్రైట్ ప్లగిన్
+ Comment[th]=ปลั๊กอินสำหรับเขียนของ KFile
++Comment[uk]=Втулок KFileWrite
+ Comment[vi]=Bổ sung KFileWrite
+ Comment[wa]=Tchôke-divins sicrijhaedje di fitchîs
+ Comment[x-test]=xxKFileWrite pluginxx
+--- a/kio/kio/global.h
++++ b/kio/kio/global.h
+@@ -29,7 +29,8 @@
+ #include <kiconloader.h>
+ #include <QtGui/QPixmap> // for pixmapForUrl
+ 
+-#include <sys/stat.h> // S_ISDIR
++#include <sys/stat.h>  // S_ISDIR
++#include <sys/types.h> // mode_t
+ 
+ #include <kjob.h>
+ 
+--- a/kio/kio/skipdialog.h
++++ b/kio/kio/skipdialog.h
+@@ -39,12 +39,10 @@
+   SkipDialog( QWidget *parent, bool _multi, const QString& _error_text );
+   ~SkipDialog();
+ 
+-protected:
+-
+-public Q_SLOTS:
+-  void b0Pressed();
+-  void b1Pressed();
+-  void b2Pressed();
++private Q_SLOTS:
++  void cancelPressed();
++  void skipPressed();
++  void autoSkipPressed();
+ 
+ Q_SIGNALS:
+   void result( SkipDialog *_this, int _button );
+--- a/kio/kio/kprotocolmanager.cpp
++++ b/kio/kio/kprotocolmanager.cpp
+@@ -32,7 +32,6 @@
+ #include <kconfiggroup.h>
+ #include <ksharedconfig.h>
+ #include <kstandarddirs.h>
+-#include <klibloader.h>
+ #include <kstringhandler.h>
+ #include <kurl.h>
+ #include <kio/slaveconfig.h>
+@@ -104,7 +103,7 @@
+     PRIVATE_DATA;
+   if (!d->config)
+   {
+-     d->config = KSharedConfig::openConfig("kioslaverc", KConfig::CascadeConfig);
++     d->config = KSharedConfig::openConfig("kioslaverc", KConfig::NoGlobals);
+   }
+   return d->config;
+ }
+@@ -113,7 +112,7 @@
+ {
+     PRIVATE_DATA;
+   if (!d->http_config) {
+-     d->http_config = KSharedConfig::openConfig("kio_httprc", KConfig::CascadeConfig);
++     d->http_config = KSharedConfig::openConfig("kio_httprc", KConfig::NoGlobals);
+   }
+   return KConfigGroup(d->http_config, QString());
+ }
+@@ -493,7 +492,7 @@
+ 
+   // Some languages may have web codes different from locale codes,
+   // read them from the config and insert in proper order.
+-  KConfig acclangConf("accept-languages.codes", KConfig::CascadeConfig);
++  KConfig acclangConf("accept-languages.codes", KConfig::NoGlobals);
+   KConfigGroup replacementCodes(&acclangConf, "ReplacementCodes");
+   QStringList languageListFinal;
+   foreach (const QString &lang, languageList)
+--- a/kio/kio/chmodjob.cpp
++++ b/kio/kio/chmodjob.cpp
+@@ -51,8 +51,8 @@
+     };
+ 
+     enum ChmodJobState {
+-        STATE_LISTING,
+-        STATE_CHMODING
++        CHMODJOB_STATE_LISTING,
++        CHMODJOB_STATE_CHMODING
+     };
+ 
+     class ChmodJobPrivate: public KIO::JobPrivate
+@@ -60,7 +60,7 @@
+     public:
+         ChmodJobPrivate(const KFileItemList& lstItems, int permissions, int mask,
+                         int newOwner, int newGroup, bool recursive)
+-            : state( STATE_LISTING )
++            : state( CHMODJOB_STATE_LISTING )
+             , m_permissions( permissions )
+             , m_mask( mask )
+             , m_newOwner( newOwner )
+@@ -149,7 +149,7 @@
+     }
+     kDebug(7007) << "ChmodJob::processList -> going to STATE_CHMODING";
+     // We have finished, move on
+-    state = STATE_CHMODING;
++    state = CHMODJOB_STATE_CHMODING;
+     chmodNextFile();
+ }
+ 
+@@ -252,13 +252,13 @@
+     //kDebug(7007) << " ChmodJob::slotResult( KJob * job ) d->m_lstItems:" << d->m_lstItems.count();
+     switch ( d->state )
+     {
+-        case STATE_LISTING:
++        case CHMODJOB_STATE_LISTING:
+             removeSubjob(job);
+             d->m_lstItems.removeFirst();
+             kDebug(7007) << "ChmodJob::slotResult -> processList";
+             d->_k_processList();
+             return;
+-        case STATE_CHMODING:
++        case CHMODJOB_STATE_CHMODING:
+             removeSubjob(job);
+             kDebug(7007) << "ChmodJob::slotResult -> chmodNextFile";
+             d->chmodNextFile();
+--- a/kio/kio/slaveinterface.cpp
++++ b/kio/kio/slaveinterface.cpp
+@@ -134,6 +134,7 @@
+   }
+ }
+ 
++#ifndef KDE_USE_FINAL // already defined in slavebase.cpp
+ /*
+  * Map pid_t to a signed integer type that makes sense for QByteArray;
+  * only the most common sizes 16 bit and 32 bit are special-cased.
+@@ -141,6 +142,7 @@
+ template<int T> struct PIDType { typedef pid_t PID_t; } ;
+ template<> struct PIDType<2> { typedef qint16 PID_t; } ;
+ template<> struct PIDType<4> { typedef qint32 PID_t; } ;
++#endif
+ 
+ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata )
+ {
+--- a/kio/kio/deletejob.cpp
++++ b/kio/kio/deletejob.cpp
+@@ -47,17 +47,17 @@
+ namespace KIO
+ {
+     enum DeleteJobState {
+-        STATE_STATING,
+-        STATE_LISTING,
+-        STATE_DELETING_FILES,
+-        STATE_DELETING_DIRS
++        DELETEJOB_STATE_STATING,
++        DELETEJOB_STATE_LISTING,
++        DELETEJOB_STATE_DELETING_FILES,
++        DELETEJOB_STATE_DELETING_DIRS
+     };
+ 
+     class DeleteJobPrivate: public KIO::JobPrivate
+     {
+     public:
+         DeleteJobPrivate(const KUrl::List& src)
+-            : state( STATE_STATING )
++            : state( DELETEJOB_STATE_STATING )
+             , m_totalSize( 0 )
+             , m_processedSize( 0 )
+             , m_fileProcessedSize( 0 )
+@@ -147,17 +147,17 @@
+    JobPrivate::emitDeleting( q, m_currentURL);
+ 
+    switch( state ) {
+-        case STATE_STATING:
+-        case STATE_LISTING:
++        case DELETEJOB_STATE_STATING:
++        case DELETEJOB_STATE_LISTING:
+             q->setTotalAmount(KJob::Bytes, m_totalSize);
+             q->setTotalAmount(KJob::Files, files.count());
+             q->setTotalAmount(KJob::Directories, dirs.count());
+             break;
+-        case STATE_DELETING_DIRS:
++        case DELETEJOB_STATE_DELETING_DIRS:
+             q->setProcessedAmount(KJob::Directories, m_processedDirs);
+             q->emitPercent( m_processedFiles + m_processedDirs, m_totalFilesDirs );
+             break;
+-        case STATE_DELETING_FILES:
++        case DELETEJOB_STATE_DELETING_FILES:
+             q->setProcessedAmount(KJob::Files, m_processedFiles);
+             q->emitPercent( m_processedFiles, m_totalFilesDirs );
+             break;
+@@ -218,7 +218,7 @@
+             return;
+         }
+         // Stat it
+-        state = STATE_STATING;
++        state = DELETEJOB_STATE_STATING;
+         KIO::SimpleJob * job = KIO::stat( m_currentURL, StatJob::SourceSide, 1, KIO::HideProgressInfo );
+         Scheduler::scheduleJob(job);
+         //kDebug(7007) << "KIO::stat (DeleteJob) " << m_currentURL;
+@@ -233,7 +233,7 @@
+         // used by e.g. kdirlister).
+         for ( QStringList::Iterator it = m_parentDirs.begin() ; it != m_parentDirs.end() ; ++it )
+             KDirWatch::self()->stopDirScan( *it );
+-        state = STATE_DELETING_FILES;
++        state = DELETEJOB_STATE_DELETING_FILES;
+         deleteNextFile();
+     }
+ }
+@@ -281,7 +281,7 @@
+             // loop only if direct deletion worked (job=0) and there is something else to delete
+         } while (!job && (!files.isEmpty() || !symlinks.isEmpty()));
+     }
+-    state = STATE_DELETING_DIRS;
++    state = DELETEJOB_STATE_DELETING_DIRS;
+     deleteNextDir();
+ }
+ 
+@@ -361,7 +361,7 @@
+     Q_D(DeleteJob);
+     switch ( d->state )
+     {
+-    case STATE_STATING:
++    case DELETEJOB_STATE_STATING:
+     {
+         // Was there an error while stating ?
+         if (job->error() )
+@@ -389,7 +389,7 @@
+             if ( !KProtocolManager::canDeleteRecursive( url ) ) {
+                 //kDebug(7007) << " Target is a directory ";
+                 // List it
+-                d->state = STATE_LISTING;
++                d->state = DELETEJOB_STATE_LISTING;
+                 ListJob *newjob = KIO::listRecursive( url, KIO::HideProgressInfo );
+                 newjob->setUnrestricted(true); // No KIOSK restrictions
+                 Scheduler::scheduleJob(newjob);
+@@ -419,7 +419,7 @@
+         }
+     }
+         break;
+-    case STATE_LISTING:
++    case DELETEJOB_STATE_LISTING:
+         if ( job->error() )
+         {
+             // Try deleting nonetheless, it may be empty (and non-listable)
+@@ -429,7 +429,7 @@
+         ++d->m_currentStat;
+         d->statNextSrc();
+         break;
+-    case STATE_DELETING_FILES:
++    case DELETEJOB_STATE_DELETING_FILES:
+         if ( job->error() )
+         {
+             Job::slotResult( job ); // will set the error and emit result(this)
+@@ -441,7 +441,7 @@
+ 
+         d->deleteNextFile();
+         break;
+-    case STATE_DELETING_DIRS:
++    case DELETEJOB_STATE_DELETING_DIRS:
+         if ( job->error() )
+         {
+             Job::slotResult( job ); // will set the error and emit result(this)
+--- a/kio/kio/scheduler.cpp
++++ b/kio/kio/scheduler.cpp
+@@ -43,10 +43,12 @@
+ 
+ using namespace KIO;
+ 
++#ifndef KDE_USE_FINAL // already defined in job.cpp
+ static inline Slave *jobSlave(SimpleJob *job)
+ {
+     return SimpleJobPrivate::get(job)->m_slave;
+ }
++#endif
+ 
+ static inline int jobCommand(SimpleJob *job)
+ {
+--- a/kio/bookmarks/kbookmarkmanager.cc
++++ b/kio/bookmarks/kbookmarkmanager.cc
+@@ -557,7 +557,7 @@
+ 
+ void KBookmarkSettings::readSettings()
+ {
+-   KConfig config("kbookmarkrc", KConfig::CascadeConfig);
++   KConfig config("kbookmarkrc", KConfig::NoGlobals);
+    KConfigGroup cg(&config, "Bookmarks");
+ 
+    // add bookmark dialog usage - no reparse
+--- a/kio/bookmarks/konqbookmarkmenu.cc
++++ b/kio/bookmarks/konqbookmarkmenu.cc
+@@ -48,7 +48,7 @@
+ 
+ void KonqBookmarkContextMenu::addActions()
+ {
+-  KConfigGroup config = KSharedConfig::openConfig("kbookmarkrc", KConfig::CascadeConfig)->group("Bookmarks");
++  KConfigGroup config = KSharedConfig::openConfig("kbookmarkrc", KConfig::NoGlobals)->group("Bookmarks");
+   bool filteredToolbar = config.readEntry( "FilteredToolbar", false );
+ 
+   if (bookmark().isGroup())
+@@ -66,7 +66,7 @@
+   }
+   else
+   {
+-    if(owner()) 
++    if(owner())
+     {
+       addAction( SmallIcon("window-new"), i18n( "Open in New Window" ), this, SLOT( openInNewWindow() ) );
+       addAction( SmallIcon("tab-new"), i18n( "Open in New Tab" ), this, SLOT( openInNewTab() ) );
+@@ -182,58 +182,59 @@
+ 
+ KonqBookmarkMenu::DynMenuInfo KonqBookmarkMenu::showDynamicBookmarks( const QString &id )
+ {
+-  KConfig bookmarkrc("kbookmarkrc", KConfig::CascadeConfig);
+-  KConfigGroup config(&bookmarkrc, "Bookmarks");
++    KConfig bookmarkrc("kbookmarkrc", KConfig::NoGlobals);
++    KConfigGroup config(&bookmarkrc, "Bookmarks");
+ 
+-  DynMenuInfo info;
+-  info.show = false;
++    DynMenuInfo info;
++    info.show = false;
+ 
+-  if (!config.hasKey("DynamicMenus")) {
+-      if (bookmarkrc.hasGroup("DynamicMenu-" + id)) {
+-          config.changeGroup("DynamicMenu-" + id);
+-          info.show = config.readEntry("Show", false);
+-          info.location = config.readPathEntry("Location");
+-          info.type = config.readEntry("Type");
+-          info.name = config.readEntry("Name");
+-      }
+-  }
+-  return info;
++    if (!config.hasKey("DynamicMenus")) {
++        if (bookmarkrc.hasGroup("DynamicMenu-" + id)) {
++            KConfigGroup dynGroup(&bookmarkrc, "DynamicMenu-" + id);
++            info.show = dynGroup.readEntry("Show", false);
++            info.location = dynGroup.readPathEntry("Location", QString());
++            info.type = dynGroup.readEntry("Type");
++            info.name = dynGroup.readEntry("Name");
++        }
++    }
++    return info;
+ }
++
+ QStringList KonqBookmarkMenu::dynamicBookmarksList()
+ {
+-  KConfigGroup config = KSharedConfig::openConfig("kbookmarkrc", KConfig::CascadeConfig)->group("Bookmarks");
++    KConfigGroup config = KSharedConfig::openConfig("kbookmarkrc", KConfig::NoGlobals)->group("Bookmarks");
+ 
+-  QStringList mlist;
+-  if (config.hasKey("DynamicMenus"))
+-    mlist = config.readEntry("DynamicMenus", QStringList());
++    QStringList mlist;
++    if (config.hasKey("DynamicMenus"))
++        mlist = config.readEntry("DynamicMenus", QStringList());
+ 
+-  return mlist;
++    return mlist;
+ }
+ 
+ void KonqBookmarkMenu::setDynamicBookmarks(const QString &id, const DynMenuInfo &newMenu)
+ {
+-  KConfigGroup config = KSharedConfig::openConfig("kbookmarkrc", KConfig::CascadeConfig)->group(QString("DynamicMenu-" + id));
+-
+-  // add group unconditionally
+-  config.writeEntry("Show", newMenu.show);
+-  config.writePathEntry("Location", newMenu.location);
+-  config.writeEntry("Type", newMenu.type);
+-  config.writeEntry("Name", newMenu.name);
++    KSharedConfig::Ptr kbookmarkrc = KSharedConfig::openConfig("kbookmarkrc", KConfig::NoGlobals);
++    KConfigGroup dynConfig = kbookmarkrc->group(QString("DynamicMenu-" + id));
+ 
+-  QStringList elist;
+-
+-  config.changeGroup("Bookmarks");
+-  if (config.hasKey("DynamicMenus")) {
+-    elist = config.readEntry("DynamicMenus", QStringList());
+-  }
++    // add group unconditionally
++    dynConfig.writeEntry("Show", newMenu.show);
++    dynConfig.writePathEntry("Location", newMenu.location);
++    dynConfig.writeEntry("Type", newMenu.type);
++    dynConfig.writeEntry("Name", newMenu.name);
++
++    QStringList elist;
++    KConfigGroup config = kbookmarkrc->group("Bookmarks");
++    if (config.hasKey("DynamicMenus")) {
++        elist = config.readEntry("DynamicMenus", QStringList());
++    }
+ 
+-  // make sure list includes type
+-  if (!elist.contains(id)) {
+-    elist << id;
+-    config.writeEntry("DynamicMenus", elist);
+-  }
++    // make sure list includes type
++    if (!elist.contains(id)) {
++        elist << id;
++        config.writeEntry("DynamicMenus", elist);
++    }
+ 
+-  config.sync();
++    config.sync();
+ }
+ 
+ KonqBookmarkOwner::~KonqBookmarkOwner()
+--- a/kio/kfile/kimagefilepreview.cpp
++++ b/kio/kfile/kimagefilepreview.cpp
+@@ -143,7 +143,7 @@
+     if ( item.isDir() )
+         imageLabel->clear();
+     else if (item.url() == currentURL) // should always be the case
+-        imageLabel->setPixmap(SmallIcon( "file-broken", KIconLoader::SizeLarge,
++        imageLabel->setPixmap(SmallIcon( "image-missing", KIconLoader::SizeLarge,
+                                          KIconLoader::DisabledState ));
+ }
+ 
+--- a/kio/kfile/tests/kfstest.cpp
++++ b/kio/kfile/tests/kfstest.cpp
+@@ -72,10 +72,9 @@
+         op->setView(KFile::Simple);
+         op->show();
+         a.exec();
+-    }
++    } else
+ #endif
+-
+-    else if (argv1 == QLatin1String("justone")) {
++    if (argv1 == QLatin1String("justone")) {
+         QString name = KFileDialog::getOpenFileName(startDir);
+         qDebug("filename=%s",name.toLatin1().constData());
+     }
+--- a/kio/kfile/kopenwithdialog.cpp
++++ b/kio/kfile/kopenwithdialog.cpp
+@@ -894,10 +894,10 @@
+ 
+     if (bRemember || saveNewApps)
+   {
+-    QStringList mimeList = cg.readEntry("MimeType", QStringList(), ';');
++    QStringList mimeList = cg.readXdgListEntry("MimeType");
+     if (!qMimeType.isEmpty() && !mimeList.contains(qMimeType))
+       mimeList.append(qMimeType);
+-    cg.writeEntry("MimeType", mimeList, ';');
++    cg.writeXdgListEntry("MimeType", mimeList);
+ 
+     if ( !qMimeType.isEmpty() )
+     {
+--- a/kio/kfile/kfilesharedialog.cpp
++++ b/kio/kfile/kfilesharedialog.cpp
+@@ -210,7 +210,7 @@
+     if (d->m_configProc) return;
+ 
+     d->m_configProc = new KfsProcess(this);
+-    (*d->m_configProc) << KStandardDirs::findExe("kdesu") << "kcmshell" << "fileshare";
++    (*d->m_configProc) << KStandardDirs::findExe("kdesu") << "kcmshell4" << "fileshare";
+     if (!d->m_configProc->start())
+     {
+        delete d->m_configProc;
+--- a/kio/kfile/kpropertiesdialogplugin.desktop
++++ b/kio/kfile/kpropertiesdialogplugin.desktop
+@@ -37,7 +37,7 @@
+ Comment[ko]=속성 대화 상자를 위한 플러그인
+ Comment[lb]=Plugin fir den Eegeschaften-Dialog
+ Comment[lt]=Priedas savybių dialogui
+-Comment[lv]=Īpašību dialoga iespraudnis
++Comment[lv]=Īpašību dialoga spraudnis
+ Comment[mk]=Приклучок за дијалогот за својства
+ Comment[ms]=Plugmasuk untuk Dialog Ciri-ciri
+ Comment[nb]=Programtillegg for dialogvinduet for egenskaper
+@@ -53,8 +53,8 @@
+ Comment[ru]=Модуль для диалога настроек
+ Comment[se]=Lassemoduvla iešvuođahtaláseža várás
+ Comment[sl]=Vstavek za pogovorno okno z lastnostmi
+-Comment[sr]=Прикључак за дијалог са својствима
+-Comment[sr at latin]=Priključak za dijalog sa svojstvima
++Comment[sr]=Прикључак за дијалог својстава
++Comment[sr at latin]=Priključak za dijalog svojstava
+ Comment[sv]=Insticksprogram för egenskapsdialogen
+ Comment[ta]=பண்புகள் உரையாடலுக்கான சொருகுப்பொருள்
+ Comment[te]=లక్షణాల సంభాషణ కొరకు ప్లగిన్
+--- a/kio/kfile/kfiledialog.cpp
++++ b/kio/kfile/kfiledialog.cpp
+@@ -369,9 +369,10 @@
+                                      QWidget *parent,
+                                      const QString& caption)
+ {
+-    bool specialDir = (!dir.isEmpty()) && (dir.protocol() == "kfiledialog");
++    bool defaultDir = dir.isEmpty();
++    bool specialDir = !defaultDir && dir.protocol() == "kfiledialog";
+     KFileDialog dlg( specialDir ? dir : KUrl(), filter, parent);
+-    if ( !specialDir ) {
++    if ( !specialDir && !defaultDir ) {
+         if (!dir.isLocalFile())
+             kWarning() << "KFileDialog::getSaveFileName called with non-local start dir " << dir;
+         dlg.setSelection( dir.path() ); // may also be a filename
+@@ -394,7 +395,8 @@
+                                      WId parent_id,
+                                      const QString& caption)
+ {
+-    bool specialDir = (!dir.isEmpty()) && (dir.protocol() == "kfiledialog");
++    bool defaultDir = dir.isEmpty();
++    bool specialDir = !defaultDir && dir.protocol() == "kfiledialog";
+     QWidget* parent = QWidget::find( parent_id );
+     KFileDialog dlg( specialDir ? dir : KUrl(), filter, parent);
+ #ifdef Q_WS_X11
+@@ -404,13 +406,13 @@
+     // TODO
+ #endif
+ 
+-    if ( !specialDir ) {
++    if ( !specialDir && !defaultDir ) {
+         if (!dir.isLocalFile())
+             kWarning() << "KFileDialog::getSaveFileNameWId called with non-local start dir " << dir;
+         dlg.setSelection( dir.path() ); // may also be a filename
+     }
+ 
+-    dlg.setOperationMode( KFileDialog::Saving);
++    dlg.setOperationMode( Saving );
+     dlg.setMode( KFile::File );
+     dlg.setWindowTitle(caption.isNull() ? i18n("Save As") : caption);
+ 
+@@ -426,7 +428,8 @@
+ KUrl KFileDialog::getSaveUrl(const KUrl& dir, const QString& filter,
+                              QWidget *parent, const QString& caption)
+ {
+-    bool specialDir = (!dir.isEmpty()) && (dir.protocol() == "kfiledialog");
++    bool defaultDir = dir.isEmpty();
++    bool specialDir = !defaultDir && dir.protocol() == "kfiledialog";
+     KFileDialog dlg(specialDir ? dir : KUrl(), filter, parent);
+     if ( !specialDir )
+         dlg.setSelection( dir.url() ); // may also be a filename
+--- a/kio/kfile/krecentdirs.cpp
++++ b/kio/kfile/krecentdirs.cpp
+@@ -49,7 +49,7 @@
+       key = key.mid(1);
+    }
+ 
+-   result=cg.readPathListEntry(key);
++   result=cg.readPathEntry(key, QStringList());
+    if (result.isEmpty())
+    {
+       result.append(KGlobalSettings::documentPath());
+--- a/kio/kfile/kpropertiesdialog.cpp
++++ b/kio/kfile/kpropertiesdialog.cpp
+@@ -1233,11 +1233,12 @@
+     KIO::filesize_t totalSize = d->dirSizeJob->totalSize();
+     KIO::filesize_t totalFiles = d->dirSizeJob->totalFiles();
+     KIO::filesize_t totalSubdirs = d->dirSizeJob->totalSubdirs();
+-    d->m_sizeLabel->setText( i18n("Calculating... %1 (%2)\n%3, %4",
+-			   KIO::convertSize(totalSize),
+-                          KGlobal::locale()->formatNumber(totalSize, 0),
+-         i18np("1 file","%1 files",totalFiles),
+-         i18np("1 sub-folder","%1 sub-folders",totalSubdirs)));
++    d->m_sizeLabel->setText(
++        i18n("Calculating... %1 (%2)\n%3, %4",
++             KIO::convertSize(totalSize),
++             totalSize,
++             i18np("1 file", "%1 files", totalFiles),
++             i18np("1 sub-folder", "%1 sub-folders", totalSubdirs)));
+ }
+ 
+ void KFilePropsPlugin::slotDirSizeFinished( KJob * job )
+@@ -1434,7 +1435,7 @@
+           KConfigGroup cg = config.desktopGroup();
+           QString nameStr = nameFromFileName(properties->kurl().fileName());
+           cg.writeEntry( "Name", nameStr );
+-          cg.writeEntry( "Name", nameStr, KConfigGroup::Persistent|KConfigGroup::NLS);
++          cg.writeEntry( "Name", nameStr, KConfigGroup::Persistent|KConfigGroup::Localized);
+       }
+   }
+ }
+@@ -2614,7 +2615,7 @@
+ 
+   KDesktopFile config( path );
+   const KConfigGroup dg = config.desktopGroup();
+-  d->URLStr = dg.readPathEntry( "URL" );
++  d->URLStr = dg.readPathEntry( "URL", QString() );
+ 
+   if ( !d->URLStr.isEmpty() )
+     d->URLEdit->setUrl( KUrl(d->URLStr) );
+@@ -2671,7 +2672,7 @@
+   {
+     QString nameStr = nameFromFileName(properties->kurl().fileName());
+     dg.writeEntry( "Name", nameStr );
+-    dg.writeEntry( "Name", nameStr, KConfig::Persistent|KConfig::NLS );
++    dg.writeEntry( "Name", nameStr, KConfigBase::Persistent|KConfigBase::Localized );
+ 
+   }
+ }
+@@ -2838,7 +2839,7 @@
+   dg.writeEntry( "Patterns",  d->patternEdit->text() );
+   dg.writeEntry( "Comment", d->commentEdit->text() );
+   dg.writeEntry( "Comment",
+-		     d->commentEdit->text(), KConfigGroup::Persistent|KConfigGroup::NLS ); // for compat
++		     d->commentEdit->text(), KConfigGroup::Persistent|KConfigGroup::Localized ); // for compat
+   dg.writeEntry( "MimeType", d->mimeEdit->text() );
+   if ( d->cbAutoEmbed->checkState() == Qt::PartiallyChecked )
+       dg.deleteEntry( "X-KDE-AutoEmbed" );
+@@ -3213,7 +3214,7 @@
+   QString nameStr = _config.readName();
+   QString genNameStr = _config.readGenericName();
+   QString commentStr = _config.readComment();
+-  QString commandStr = config.readPathEntry( "Exec" );
++  QString commandStr = config.readPathEntry( "Exec", QString() );
+   if (commandStr.startsWith(QLatin1String("ksystraycmd ")))
+   {
+     commandStr.remove(0, 12);
+@@ -3223,7 +3224,7 @@
+     d->m_systrayBool = false;
+ 
+   d->m_origCommandStr = commandStr;
+-  QString pathStr = config.readPathEntry( "Path" );
++  QString pathStr = config.readPathEntry( "Path", QString() );
+   d->m_terminalBool = config.readEntry( "Terminal", false );
+   d->m_terminalOptionStr = config.readEntry( "TerminalOptions" );
+   d->m_suidBool = config.readEntry( "X-KDE-SubstituteUID", false );
+@@ -3237,7 +3238,7 @@
+   if( d->m_dbusStartusType.isEmpty() && config.hasKey("X-DCOP-ServiceType"))
+          d->m_dbusStartusType = config.readEntry("X-DCOP-ServiceType").toLower();
+ 
+-  QStringList mimeTypes = config.readEntry( "MimeType", QStringList(), ';' );
++  QStringList mimeTypes = config.readXdgListEntry( "MimeType" );
+ 
+   if ( nameStr.isEmpty() || bKDesktopMode ) {
+     // We'll use the file name if no name is specified
+@@ -3369,9 +3370,9 @@
+   KConfigGroup config = _config.desktopGroup();
+   config.writeEntry( "Type", QString::fromLatin1("Application"));
+   config.writeEntry( "Comment", d->w->commentEdit->text() );
+-  config.writeEntry( "Comment", d->w->commentEdit->text(), KConfigGroup::Persistent|KConfigGroup::NLS ); // for compat
++  config.writeEntry( "Comment", d->w->commentEdit->text(), KConfigGroup::Persistent|KConfigGroup::Localized ); // for compat
+   config.writeEntry( "GenericName", d->w->genNameEdit->text() );
+-  config.writeEntry( "GenericName", d->w->genNameEdit->text(), KConfigGroup::Persistent|KConfigGroup::NLS ); // for compat
++  config.writeEntry( "GenericName", d->w->genNameEdit->text(), KConfigGroup::Persistent|KConfigGroup::Localized ); // for compat
+ 
+   if (d->m_systrayBool)
+     config.writePathEntry( "Exec", d->w->commandEdit->text().prepend("ksystraycmd ") );
+@@ -3391,12 +3392,12 @@
+   }
+ 
+   kDebug() << mimeTypes;
+-  config.writeEntry( "MimeType", mimeTypes, ';' );
++  config.writeXdgListEntry( "MimeType", mimeTypes );
+ 
+   if ( !d->w->nameEdit->isHidden() ) {
+       QString nameStr = d->w->nameEdit->text();
+       config.writeEntry( "Name", nameStr );
+-      config.writeEntry( "Name", nameStr, KConfigGroup::Persistent|KConfigGroup::NLS );
++      config.writeEntry( "Name", nameStr, KConfigGroup::Persistent|KConfigGroup::Localized );
+   }
+ 
+   config.writeEntry("Terminal", d->m_terminalBool);
+--- a/kio/kdatatool.desktop
++++ b/kio/kdatatool.desktop
+@@ -52,8 +52,8 @@
+ Comment[ru]=Утилита обработки информации KDE
+ Comment[se]=KDE dáhtareaidu
+ Comment[sl]=Podatkovno orodje za KDE
+-Comment[sr]=KDE-ов алат за податке
+-Comment[sr at latin]=KDE-ov alat za podatke
++Comment[sr]=КДЕ-ова алатка за податке
++Comment[sr at latin]=KDE-ova alatka za podatke
+ Comment[sv]=KDE-dataverktyg
+ Comment[ta]=கேடிஇ தகவல் கருவி
+ Comment[te]=కెడిఈ దత్తాంశం పనిముట్టు
+--- a/kio/misc/kssld/kssld.cpp
++++ b/kio/misc/kssld/kssld.cpp
+@@ -699,7 +699,7 @@
+ 	if (!out.open(QIODevice::WriteOnly))
+ 		return false;
+ 
+-        KConfig cfg("ksslcalist", KConfig::CascadeConfig);
++        KConfig cfg("ksslcalist", KConfig::NoGlobals);
+ 
+         const QStringList x = cfg.groupList();
+ 
+@@ -735,7 +735,7 @@
+ 
+ 	if (!x) return false;
+ 
+-        KConfig cfgFile("ksslcalist", KConfig::CascadeConfig);
++        KConfig cfgFile("ksslcalist", KConfig::NoGlobals);
+ 
+         KConfigGroup cfg(&cfgFile, x->getSubject());
+ 	cfg.writeEntry("x509", certificate);
+@@ -825,7 +825,7 @@
+ 
+ QStringList KSSLD::caList() {
+ QStringList x;
+-KConfig cfg("ksslcalist", KConfig::CascadeConfig);
++KConfig cfg("ksslcalist", KConfig::NoGlobals);
+ 
+ 	x = cfg.groupList();
+ 	x.removeAll("<default>");
+@@ -835,7 +835,7 @@
+ 
+ 
+ bool KSSLD::caUseForSSL(QString subject) {
+-    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::CascadeConfig)->group(subject);
++    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::NoGlobals)->group(subject);
+ 
+     return cg.readEntry("site", false);
+ }
+@@ -843,7 +843,7 @@
+ 
+ 
+ bool KSSLD::caUseForEmail(QString subject) {
+-    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::CascadeConfig)->group(subject);
++    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::NoGlobals)->group(subject);
+ 
+     return cg.readEntry("email", false);
+ }
+@@ -851,14 +851,14 @@
+ 
+ 
+ bool KSSLD::caUseForCode(QString subject) {
+-    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::CascadeConfig)->group(subject);
++    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::NoGlobals)->group(subject);
+ 
+     return cg.readEntry("code", false);
+ }
+ 
+ 
+ bool KSSLD::caRemove(QString subject) {
+-    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::CascadeConfig)->group(subject);
++    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::NoGlobals)->group(subject);
+ 
+     if (!cg.exists())
+         return false;
+@@ -871,14 +871,14 @@
+ 
+ 
+ QString KSSLD::caGetCert(QString subject) {
+-    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::CascadeConfig)->group(subject);
++    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::NoGlobals)->group(subject);
+ 
+     return cg.readEntry("x509", QString());
+ }
+ 
+ 
+ bool KSSLD::caSetUse(QString subject, bool ssl, bool email, bool code) {
+-    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::CascadeConfig)->group(subject);
++    KConfigGroup cg = KSharedConfig::openConfig("ksslcalist", KConfig::NoGlobals)->group(subject);
+ 
+     if (!cg.exists())
+         return false;
+--- a/kio/misc/kssld/kssld.desktop
++++ b/kio/misc/kssld/kssld.desktop
+@@ -39,7 +39,7 @@
+ Name[ko]=KSSL 데몬 모듈
+ Name[lb]=KSSL-Dämonmodul
+ Name[lt]=KSSL tarnybos modulis
+-Name[lv]=KSSL Dēmona Modulis
++Name[lv]=KSSL dēmona modulis
+ Name[ms]=Modul Daemon KSSL
+ Name[nb]=KSSL nisse-modul
+ Name[nds]=KSSL-Dämoon
+@@ -54,8 +54,8 @@
+ Name[ru]=Служба KSSL
+ Name[se]=KSSL-bálvámoduvla
+ Name[sl]=Strežniški modul KSSL
+-Name[sr]=KSSL демон модул
+-Name[sr at latin]=KSSL demon modul
++Name[sr]=Модул КССЛ демона
++Name[sr at latin]=Modul KSSL demona
+ Name[sv]=KSSL-demonmodul
+ Name[ta]=KSSL டெமான் பகுதி
+ Name[te]=కెఎస్ ఎస్ ఎల్ సూత్రధారి మాడ్యూల్
+@@ -87,7 +87,7 @@
+ Comment[et]=KDED KSSL deemoni moodul
+ Comment[eu]=KSSL daemon modulua KDEDrako
+ Comment[fa]=پیمانۀ شبح KSSL برای  KDED
+-Comment[fi]=KSSL-palvelinmoduuli KDED:lle
++Comment[fi]=KDED:n KSSL-palvelinmoduuli
+ Comment[fr]=Module démon KSSL pour KDED
+ Comment[fy]=KSSL daemon module foar KDED
+ Comment[ga]=Modúl deamhain KSSL le haghaidh KDED
+@@ -104,7 +104,7 @@
+ Comment[ko]=KDED용 KSSL 데몬 모듈
+ Comment[lb]=KSSL-Dämonmodul fir KDED
+ Comment[lt]=KSSL tarnybos modulis, skirtas KDED
+-Comment[lv]=KSSL Dēmona Modulis priekš KDED
++Comment[lv]=KSSL dēmona modulis priekš KDED
+ Comment[mk]=KSSL даемон модул за KDED
+ Comment[ms]=Modul Daemon KSSL untuk KDED
+ Comment[nb]=KSSL nissemodul for KDED
+@@ -120,8 +120,8 @@
+ Comment[ru]=Управление сертификатами SSL
+ Comment[se]=KDED:a KSSL-bálvámoduvla
+ Comment[sl]=Strežniški modul KSSL za KDED
+-Comment[sr]=KSSL демон модул за KDED
+-Comment[sr at latin]=KSSL demon modul za KDED
++Comment[sr]=Модул КССЛ демона за КДЕД
++Comment[sr at latin]=Modul KSSL demona za KDED
+ Comment[sv]=KSSL-demonmodul för KDED
+ Comment[ta]=KDEDக்கான KSSL டெமான் பகுதி
+ Comment[te]=కెడిఈడి కొరకు కెఎస్ ఎస్ ఎల్ సూత్రధారి మాడ్యూల్
+--- a/kio/misc/mms.protocol
++++ b/kio/misc/mms.protocol
+@@ -19,7 +19,7 @@
+ Description[de]=Microsoft Media Server Protokoll
+ Description[el]=Πρωτόκολλο Microsoft Media Server
+ Description[es]=Protocolo Microsoft Media Server
+-Description[et]=Microsoft Media Server protokoll
++Description[et]=Microsoft Media Serveri protokoll
+ Description[eu]=Microsoft Media Server protokoloa
+ Description[fa]=قرارداد کارساز رسانۀ میکروسافت
+ Description[fi]=Microsoft Media -palvelinprotokolla
+@@ -53,8 +53,8 @@
+ Description[ru]=Протокол Microsoft Media Server
+ Description[se]=Microsoft Media Server-protokolla
+ Description[sl]=Protokol Microsoft Media Server
+-Description[sr]=Microsoft Media Server протокол
+-Description[sr at latin]=Microsoft Media Server protokol
++Description[sr]=Протокол Мајкрософтовог медија-сервера
++Description[sr at latin]=Protokol Microsoftovog medija-servera
+ Description[sv]=Microsoft mediaserver-protokoll
+ Description[ta]=மைக்ரோசாப்ட் ஊடக சேவக நெறிமுறை
+ Description[te]=మైక్రొసాఫ్ట్ మీడియా సెర్వర్ ప్రొటొకాల్
+--- a/kio/misc/kwalletd/kwalletd.desktop
++++ b/kio/misc/kwalletd/kwalletd.desktop
+@@ -23,7 +23,7 @@
+ Name[et]=KWalleti deemoni moodul
+ Name[eu]=KWallet daemon modulua
+ Name[fa]=پیمانه شبح KWallet
+-Name[fi]=KWallet-palvelinmoduuli
++Name[fi]=KWallet-palvelumoduuli
+ Name[fr]=Module démon KWallet
+ Name[ga]=Modúl Deamhain KWallet
+ Name[gl]=Módulo do Demo KWallet
+@@ -39,7 +39,7 @@
+ Name[ko]=KWallet 데몬 모듈
+ Name[lb]=KWallet-Dämonmodul
+ Name[lt]=KDE slaptažodinių tarnybos modulis
+-Name[lv]=KWallet Dēmona Modulis
++Name[lv]=KWallet dēmona modulis
+ Name[ms]=Modul Daemon KWallet
+ Name[nb]=KWallet nisseprogramtillegg
+ Name[nds]=KWallet-Dämoon
+@@ -54,8 +54,8 @@
+ Name[ru]=Служба бумажника
+ Name[se]=KWallet-bálvámoduvla
+ Name[sl]=Modul KWallet demon
+-Name[sr]=KWallet демон модул
+-Name[sr at latin]=KWallet demon modul
++Name[sr]=Модул К-новчаниковог демона
++Name[sr at latin]=Modul K-novčanikovog demona
+ Name[sv]=Kwallet-demonmodul
+ Name[ta]=KWallet டெமான் பகுதி
+ Name[te]=కెవాలెట్ సూత్రధారి మాడ్యూల్
+@@ -86,7 +86,7 @@
+ Comment[et]=KDED KWalleti deemoni moodul
+ Comment[eu]=KWallet daemon modulua KDEDrako
+ Comment[fa]=پیمانۀ شبح KWallet برای KDED
+-Comment[fi]=KWallet palvelinmoduuli KDED:lle
++Comment[fi]=KDED:n KWallet-palvelumoduuli
+ Comment[fr]=Module démon KWallet pour KDED
+ Comment[fy]=KWallet daemon module foar KDED
+ Comment[ga]=Modúl deamhain KWallet le haghaidh KDED
+@@ -103,7 +103,7 @@
+ Comment[ko]=KDED용 KWallet 데몬 모듈
+ Comment[lb]=KWallet-Dämonmodul fir KDED
+ Comment[lt]=KDE slaptažodinių tarnybos modulis skirtas KDED
+-Comment[lv]=KWallet Dēmona Modulis priekš KDED
++Comment[lv]=KWallet dēmona modulis priekš KDED
+ Comment[mk]=KWallet даемон модул за KDED
+ Comment[ms]=Modul Daemon KWallet untuk KDED
+ Comment[nb]=KWallet nissemodul for KDED
+@@ -119,8 +119,8 @@
+ Comment[ru]=Управление бумажником KDE
+ Comment[se]=KDED:a KWallet-bálvámoduvla
+ Comment[sl]=Modul KWallet demon za KDED
+-Comment[sr]=KWallet демон модул за KDED
+-Comment[sr at latin]=KWallet demon modul za KDED
++Comment[sr]=Модул К-новчаниковог демона за КДЕД
++Comment[sr at latin]=Modul K-novčanikovog demona za KDED
+ Comment[sv]=Kwallet-demonmodul för KDED
+ Comment[ta]=KDEDக்கான KWallet Daemon  தொகுதி
+ Comment[te]=కెడిఈడి కొరకు కెవాలెట్ సూత్రధారి మాడ్యూల్
+--- a/kio/misc/kwalletd/kwalletd.cpp
++++ b/kio/misc/kwalletd/kwalletd.cpp
+@@ -505,7 +505,7 @@
+ 
+ 	if (!implicitAllow(wallet, thisApp)) {
+ 		KConfigGroup cfg = KSharedConfig::openConfig("kwalletrc")->group("Auto Allow");
+-		if (!cfg.entryIsImmutable(wallet)) {
++		if (!cfg.isEntryImmutable(wallet)) {
+ 		    KBetterThanKDialog *dialog = new KBetterThanKDialog;
+ 		    if (appid.isEmpty()) {
+ 			dialog->setLabel(i18n("<qt>KDE has requested access to the open wallet '<b>%1</b>'.</qt>", Qt::escape(wallet)));
+@@ -523,7 +523,7 @@
+ 			KConfigGroup cfg = KSharedConfig::openConfig("kwalletrc")->group("Auto Allow");
+ 			QStringList apps = cfg.readEntry(wallet, QStringList());
+ 			if (!apps.contains(thisApp)) {
+-				if (cfg.entryIsImmutable(wallet)) {
++				if (cfg.isEntryImmutable(wallet)) {
+ 					return false;
+ 				}
+ 				apps += thisApp;
+--- a/kio/misc/kpac/proxyscout.notifyrc
++++ b/kio/misc/kpac/proxyscout.notifyrc
+@@ -5,20 +5,30 @@
+ Comment[br]=Kefluniadur emgefreekh ar proksi
+ Comment[ca]=Configuració automàtica de l'intermediari
+ Comment[cs]=Automatické nastavení proxy
++Comment[de]=Sucht nach einem Proxy-Server und richtet ihn ein
+ Comment[el]=Αυτόματη ρύθμιση διαμεσολαβητή
++Comment[et]=Automaatne puhverserveri seadistamine
++Comment[fi]=Automaattiset välityspalvelinasetukset
+ Comment[ga]=Uathchumraíocht an tSeachfhreastalaí
+ Comment[hu]=Automatikus proxybeállítás
+ Comment[it]=Configurazione automatica proxy
+ Comment[ja]=自動プロキシ設定
++Comment[kk]=Проксиді автоматты түрде баптау
+ Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​ប្រូកស៊ី​ដោយ​ស្វ័យប្រវត្តិ
+ Comment[lt]=Automatinis proxy derinimas
++Comment[lv]=Automātiska starpniekserveru konfigurēšana
++Comment[nb]=Automatisk mellomtjeneroppsett
+ Comment[nds]=Proxy automaatsch instellen
+ Comment[nl]=Automatische proxyconfiguratie
+ Comment[pa]=ਆਟੋਮੈਟਿਕ ਪਰਾਕਸੀ ਸੰਰਚਨਾ
+ Comment[pt]=Configuração Automática do 'Proxy'
+ Comment[pt_BR]=Configuração Automática do Proxy
+ Comment[ru]=Автонастройка прокси-сервера
++Comment[sr]=Аутоматско подешавање проксија
++Comment[sr at latin]=Automatsko podešavanje proksija
+ Comment[sv]=Automatisk proxyinställning
++Comment[th]=การปรับแต่งพร็อกซีอัตโนมัติ
++Comment[uk]=Автоматичне налаштування проксі сервера
+ Comment[x-test]=xxAutomatic Proxy Configurationxx
+ Comment[zh_CN]=自动代理配置
+ Comment[zh_TW]=自動代理組態
+@@ -28,19 +38,30 @@
+ Name[be]=Няправільны сцэнар проксі
+ Name[ca]=Script de l'intermediari no vàlid
+ Name[cs]=Neplatný proxy skript
++Name[de]=Ungültiges Proxy-Skript
+ Name[el]=Μη έγκυρο σενάριο διαμεσολαβητή
++Name[et]=Vigane puhverserveri skript
++Name[fi]=Virheellinen välityspalvelinkomentosarja
+ Name[ga]=Script Neamhbhailí Seachfhreastalaí
+ Name[hu]=Érvénytelen proxyszkript
+ Name[it]=Script proxy non valido
+ Name[ja]=無効なプロキシスクリプト
++Name[kk]=Жарамсыз прокси скрипті
+ Name[km]=ស្គ្រីប​ប្រូកស៊ី​មិនត្រឹមត្រូវ
++Name[lt]=Blogas proxy scenarijus
++Name[lv]=Nederīgs starpniekservera skripts
++Name[nb]=Ugyldig mellomtjenerskript
+ Name[nds]=Leeg Proxy-Skript
+ Name[nl]=Ongeldig proxyscript
+ Name[pa]=ਗਲਤ ਪਰਾਕਸੀ ਸਕ੍ਰਿਪਟ
+ Name[pt]=Programa de 'Proxy' Inválido
+ Name[pt_BR]=Script de Proxy Inválido
+ Name[ru]=Недопустимый сценарий настройки прокси-сервера
++Name[sr]=Неисправна скрипта проксија
++Name[sr at latin]=Neispravna skripta proksija
+ Name[sv]=Ogiltigt proxyskript
++Name[th]=สคริปต์พร็อกซีไม่ถูกต้อง
++Name[uk]=Не чинний скрипт проксі
+ Name[x-test]=xxInvalid Proxy Scriptxx
+ Name[zh_CN]=无效的代理脚本
+ Name[zh_TW]=不合法的代理文稿
+@@ -52,10 +73,11 @@
+ Comment[cs]=Stažený konfigurační skript pro proxy je neplatný
+ Comment[cy]=Mae'r sgript ffurfweddu'r dirprwy a chafodd ei lawrlwytho yn annilys
+ Comment[da]=Det hentede proxy-indstillingsscript er ugyldigt
++Comment[de]=Das heruntergeladene Konfigurationsskript für den Proxy ist ungültig.
+ Comment[el]=Το ληφθέν σενάριο ρύθμισης διαμεσολαβητή δεν είναι έγκυρο
+-Comment[et]=Allalaaditud proxy seadistuse skript on vigane
++Comment[et]=Allalaaditud puhverserveri seadistuse skript on vigane
+ Comment[eu]=Deskargatutako proxy-aren konfigurazioko script-a baliogabea da
+-Comment[fi]=Ladattu proxy-asetusskripti on virheellinen
++Comment[fi]=Ladattu välityspalvelin asetuskomentosarja on virheellinen
+ Comment[fr]=Le script téléchargé de configuration du proxy n'est pas valable
+ Comment[fy]=It ynladen proxy ynstellings skript is ûnjildich
+ Comment[ga]=Is neamhbhailí í script chumraíocht an tseachfhreastalaí a íosluchtaíodh
+@@ -65,11 +87,14 @@
+ Comment[is]=Sótt milliþjónsskrifta er ógild
+ Comment[it]=Lo script di configurazione proxy scaricato non è valido
+ Comment[ja]=ダウンロードされたプロキシ設定スクリプトは無効です
++Comment[kk]=Жүктеп алынған проксиді баптау скрипті жарамсыз
+ Comment[km]=ស្គ្រីប​កំណត់​រចនា​សម្ព័ន្ធ​ប្រូកស៊ី​ដែល​បាន​ទាញយក​គឺ​មិនត្រឹមត្រូវ
+ Comment[lb]=D'Proxy-Configuratiounsskript, dat erofgelude gouf, ass ongülteg
+ Comment[lt]=Atsisiųstas proxy derinimo scenarijus yra blogas
++Comment[lv]=Lejuplādētais starpniekservera skripts bija nederīgs
+ Comment[mk]=Симнатата скрипта за конфигурација на прокси е навалидна
+ Comment[ms]=Skrip penyelarasan proksi yang dimuat turun tidak sah
++Comment[nb]=Det mellomtjenerskriptet som ble lastet ned er ugyldig
+ Comment[nds]=Dat daallaadte Proxy-Instellskript is leeg
+ Comment[nl]=Het gedownloade script met de proxyconfiguratie is ongeldig
+ Comment[pl]=Pobrany skrypt konfiguracji pośrednika jest nieprawidłowy
+@@ -78,12 +103,15 @@
+ Comment[ro]=Scriptul de configurare "proxy" este eronat
+ Comment[ru]=Загруженный скрипт настройки прокси содержит ошибки
+ Comment[sl]=Naložen nastavitveni skript posrednika je neveljaven
+-Comment[sr at latin]=Preuzeta skripta za podešavanje proksija je neispravna
++Comment[sr]=Преузета скрипта за подешавање проксија није исправна
++Comment[sr at latin]=Preuzeta skripta za podešavanje proksija nije ispravna
+ Comment[sv]=Det nerladdade proxyinställningsskriptet är ogiltigt
+ Comment[ta]=இறக்கப்பட்ட பதிலாள் வடிவமைப்பு எழுத்தாக்கம் செல்லாது
+ Comment[te]=డౌన్ లోడ్ చేయబడిన్ ప్రాక్సీ రూపకరణపు స్క్రిప్ట్ చెల్లదు
+ Comment[tg]=Шакли дастнависи вакил кардашуда ношоям фаровир
++Comment[th]=สคริปต์ปรับแต่งพร็อกซีที่ดาวน์โหลดมาไม่ถูกต้อง
+ Comment[tr]=Vekil sunucu yapılandırma dosyası geçersiz
++Comment[uk]=Звантажено не чинний скрип проксі
+ Comment[uz]=Проксини мослаш учун ёзиб олинган скрипт ҳақиқий эмас
+ Comment[x-test]=xxThe downloaded proxy configuration script is invalidxx
+ Comment[zh_CN]=下载的代理服务器配置脚本无效
+@@ -96,17 +124,28 @@
+ Name[be]=Памылка сцягвання сцэнара
+ Name[ca]=Error de descàrrega de l'script
+ Name[cs]=Chyba ve stažení skriptu
++Name[de]=Fehler beim Herunterladen des Skripts
+ Name[el]=Σφάλμα λήψης σεναρίου
++Name[et]=Viga skripti allalaadimisel
++Name[fi]=Komentosarjan latausvirhe
+ Name[ga]=Earráid Íosluchtaithe Scripte
+ Name[hu]=Szkriptletöltési hiba
+ Name[it]=Errore scaricamento script
+ Name[ja]=スクリプトのダウンロードエラー
++Name[kk]=Скриптті жүктеу қатесі
+ Name[km]=កំហុស​ក្នុង​ការ​ទាញយក​ស្គ្រីប
++Name[lt]=Scenarijaus atsisiuntimo klaida
++Name[lv]=Skripta lejuplādes kļūda
++Name[nb]=Feil ved skriptnedlasting
+ Name[nds]=Skript-Daallaadfehler
+ Name[nl]=Fout bij scriptdownload
+ Name[pt]=Erro de Transferência do Programa
+ Name[pt_BR]=Erro no Download do Script
++Name[sr]=Грешка у преузимању скрипте
++Name[sr at latin]=Greška u preuzimanju skripte
+ Name[sv]=Nerladdningsfel för skript
++Name[th]=การดาวน์โหลดสคริปต์เกิดข้อผิดพลาด
++Name[uk]=Помилка звантаження проксі
+ Name[x-test]=xxScript Download Errorxx
+ Name[zh_CN]=脚本下载错误
+ Name[zh_TW]=文稿下載錯誤
+@@ -118,10 +157,11 @@
+ Comment[cs]=Nelze stáhnout konfigurační skript pro proxy
+ Comment[cy]=Y sgript ffurfweddu'r dirprwy
+ Comment[da]=Proxy-indstillingsscriptet kunne ikke hentes
++Comment[de]=Das Konfigurationskript für den Proxy kann nicht heruntergeladen werden.
+ Comment[el]=Αδύνατη η λήψη του σεναρίου ρύθμισης διαμεσολαβητή
+-Comment[et]=Proxy seadistuse skripti ei õnnestu alla laadida
++Comment[et]=Puhverserveri seadistuse skripti allalaadimine nurjus
+ Comment[eu]=Proxy-aren konfigurazioko script-a ezin izan da deskargatu
+-Comment[fi]=Proxyn asetusskriptiä ei voitu ladata
++Comment[fi]=Välityspalvelimen asetuskomentosarjan lataaminen ei onnistunut
+ Comment[fr]=Le script de configuration du proxy n'a pas pu être téléchargé
+ Comment[fy]=It ynladen fan de proxy ynstellings skript is net slagge
+ Comment[ga]=Níorbh fhéidir script chumraíochta an tseachfhreastalaí a íosluchtú
+@@ -131,11 +171,14 @@
+ Comment[is]=Gat ekki sótt stillingaskriftu milliþjóns
+ Comment[it]=Impossibile scaricare lo script di configurazione proxy
+ Comment[ja]=プロキシ設定スクリプトをダウンロードできませんでした
++Comment[kk]=Проксиді баптау скрипті жүктеп алынбайды
+ Comment[km]=មិន​អាច​ទាញយក​ស្គ្រីប​កំណត់រចនា​សម្ព័ន្ធ​ប្រូកស៊ី​បាន​ឡើយ
+ Comment[lb]=D'Proxy-Konfiguratiounsskript konnt net erofgeluede ginn
+ Comment[lt]=Proxy derinimo scenarijus negali būti atsisiųstas
++Comment[lv]=Nebija iespējams lejuplādēt starpniekservera konfigurācijas skriptu
+ Comment[mk]=Скриптата за конфигурација на прокси не можеше да се симне
+ Comment[ms]=Skrip penyelarasan proksi tidak boleh dimuat turun
++Comment[nb]=Skriptet for mellomtjeneroppsett kunne ikke lastes ned
+ Comment[nds]=Dat Proxy-Instellskript lett sik nich daalladen
+ Comment[nl]=Het script met de proxyconfiguratie kon niet worden gedownload
+ Comment[pl]=Nie można pobrać skryptu konfiguracji pośrednika
+@@ -144,12 +187,15 @@
+ Comment[ro]=Nu am putut transfera scriptul de configurare "proxy"
+ Comment[ru]=Не удаётся загрузить скрипт настройки прокси
+ Comment[sl]=Nastavitveni skript posrednika ni mogel biti naložen
++Comment[sr]=Скрипта за подешавање проксија не може бити преузета
+ Comment[sr at latin]=Skripta za podešavanje proksija ne može biti preuzeta
+ Comment[sv]=Proxyinställningsskriptet kunde inte laddas ner
+ Comment[ta]=பதிலாள் வடிவமைப்பு எழுத்தாக்கத்தை இறக்க முடியவில்லை
+ Comment[te]=ప్రాక్సీ రూపకరణపు స్క్రిప్ట్ ని డౌన్ లోడ్ చేయలేకపోయాం
+ Comment[tg]=Шакли дастнависи вакил кардашуда фаровир наметавонад
++Comment[th]=ไม่สามารถดาวน์โหลดสคริปต์ปรับแต่งพร็อกซีได้
+ Comment[tr]=Vekil sunucu yapılandırma dosyası indirilemedi
++Comment[uk]=Неможливо звантажити скрип налаштування проксі
+ Comment[uz]=Проксини мослаш учун скриптни ёзиб олиб бўлмади
+ Comment[x-test]=xxThe proxy configuration script could not be downloadedxx
+ Comment[zh_CN]=无法下载代理配置脚本
+@@ -162,17 +208,28 @@
+ Name[be]=Памылка выканання сцэнару
+ Name[ca]=Error d'avaluació de l'script
+ Name[cs]=Chyba v analýze skriptu
++Name[de]=Fehler bei der Auswertung des Skripts
+ Name[el]=Σφάλμα αποτίμησης σεναρίου
++Name[et]=Viga skripti hindamisel
++Name[fi]=Komentosarjansuoritusvirhe
+ Name[ga]=Earráid agus Script á Luacháil
+ Name[hu]=Szkriptkiértékelési hiba
+ Name[it]=Errore di valutazione script
+ Name[ja]=スクリプト評価エラー
++Name[kk]=Скриптті орындау қатесі
+ Name[km]=កំហុស​ក្នុង​ការ​វាយ​តម្លៃ​ស្គ្រីប
++Name[lt]=Scenarijaus analizės klaida
++Name[lv]=Skripta novērtēšanas kļūda
++Name[nb]=Feil ved evaluering av skript
+ Name[nds]=Skript-Utföhrfehler
+ Name[nl]=Fout bij evalueren van script
+ Name[pt]=Erro de Avaliação do Programa
+ Name[pt_BR]=Erro de Avaliação do Script
++Name[sr]=Грешка у извршавању скрипте
++Name[sr at latin]=Greška u izvršavanju skripte
+ Name[sv]=Utvärderingsfel för skript
++Name[th]=การเรียกใช้สคริปต์เกิดข้อผิดพลาด
++Name[uk]=Помилка оцінки скрипту
+ Name[x-test]=xxScript Evaluation Errorxx
+ Name[zh_CN]=脚本执行错误
+ Name[zh_TW]=文稿執行錯誤
+@@ -184,10 +241,11 @@
+ Comment[cs]=Nastala chyba při spouštění konfiguračního skriptu proxy
+ Comment[cy]=Digwyddodd gwall wrth weithredu'r sgript ffurfweddu'r dirprwy
+ Comment[da]=Der opstod en fejl ved kørslen af proxy-indstillingsscriptet
++Comment[de]=Beim Ausführen des Skripts zur Proxy-Konfiguration ist ein Fehler aufgetreten.
+ Comment[el]=Παρουσιάστηκε σφάλμα κατά την εκτέλεση του σεναρίου ρύθμισης του διαμεσολαβητή
+-Comment[et]=Ilmnes tõsine viga proxy seadistuse skripti käivitamisel
++Comment[et]=Ilmnes tõsine viga puhverserveri seadistuse skripti käivitamisel
+ Comment[eu]=Errorea gertatu da proxy-a konfiguratzeko script-ean
+-Comment[fi]=Proxy-skriptin suorittamisessa tapahtui virhe
++Comment[fi]=Välityspalvelimen asetuskomentosarjan suorittamisessa tapahtui virhe
+ Comment[fr]=Une erreur s'est produite lors de l'exécution du script de configuration du proxy
+ Comment[fy]=Der wie in flater by it útfoeren fan de proxy ynstellings skript
+ Comment[ga]=Tharla earráid agus script chumraíocht an tseachfhreastalaí á rith
+@@ -197,11 +255,14 @@
+ Comment[is]=Það kom upp villa við keyrslu stillingaskriftu milliþjóns
+ Comment[it]=Si è verificato un errore durante l'esecuzione dello script di configurazione proxy
+ Comment[ja]=プロキシ設定スクリプトの実行でエラーが発生しました
++Comment[kk]=Проксиді баптау скриптін орындау қатесі
+ Comment[km]=មាន​កំហុស​ក្នុង​ការ​ប្រតិបត្តិ​ស្គ្រីប​កំណត់​រចនា​សម្ព័ន្ធ​ប្រូកស៊ី
+ Comment[lb]=Et gouf e Feeler beim Ausféiere vum Proxy-Konfiguratiounsskript
+ Comment[lt]=Paleidžiant proxy derinimo scenarijų įvyko klaida
++Comment[lv]=Gadījās kļūda izpildot starpniekservera konfigurēšanas skriptu
+ Comment[mk]=Имаше грешка при извршувањето на скриптата за конфигурација на прокси
+ Comment[ms]=Terdapat ralat melaksanakan skrip penyelarasan proksi
++Comment[nb]=Det oppsto en feil ved kjøring av skriptet for mellomtjeneroppsett
+ Comment[nds]=Bi't Utföhren vun't Proxy-Instellskript geev dat en Fehler
+ Comment[nl]=Er deed zich een fout voor tijdens het uitvoeren van het script met de proxyconfiguratie
+ Comment[pl]=Wystąpił błąd w czasie wykonywania skryptu konfiguracji pośrednika
+@@ -210,12 +271,15 @@
+ Comment[ro]=A apărut o eroare la execuţia scriptului de configurare "proxy"
+ Comment[ru]=Ошибка при выполнении скрипта настройки прокси
+ Comment[sl]=Prišlo je do napake pri izvajanju nastavitvenega skripta posrednika
+-Comment[sr at latin]=Desila se greška prilikom izvršavanja skripte za podešavanje proksija
++Comment[sr]=Дошло је до грешке током извршавања скрипте за подешавање проксија
++Comment[sr at latin]=Došlo je do greške tokom izvršavanja skripte za podešavanje proksija
+ Comment[sv]=Fel uppstod vid körning av proxyinställningsskriptet
+ Comment[ta]=பதிலாள் வடிவமைப்பு எழுத்தாக்கத்தை செயல்படுத்தும்போது ஒரு பிழை நேர்ந்தது
+ Comment[te]=ప్రాక్సీ రూపకరణపు స్క్రిప్ట్ నిర్వహణలొ దోషం వున్నది
+ Comment[tg]=Хато фаразани дар шакли дастнависи вакил кардашуда
++Comment[th]=เกิดข้อผิดพลาดขึ้นในการเรียกประมวลผลสคริปต์ปรับแต่งพร็อกซี
+ Comment[tr]=Vekil sunucu yapılandırma dosyası çalıştırılamadı
++Comment[uk]=Помилка запуску скрипту налаштування проксі
+ Comment[uz]=Проксини мослаш учун скриптни ишга туширишда хато рўй берди
+ Comment[x-test]=xxThere was an error executing the proxy configuration scriptxx
+ Comment[zh_CN]=执行代理配置脚本时出错
+--- a/kio/misc/kpac/proxyscout.desktop
++++ b/kio/misc/kpac/proxyscout.desktop
+@@ -14,7 +14,7 @@
+ Name[eo]=Prokurilo
+ Name[es]=Explorador del proxy
+ Name[fa]=پیشکار Scout
+-Name[fi]=Proxy-tiedustelija
++Name[fi]=Välityspalvelintiedustelija
+ Name[fy]=Proxy ferkenner
+ Name[ga]=Scabhta Seachfhreastalaithe
+ Name[gl]=Proxy Explorador
+@@ -65,10 +65,10 @@
+ Comment[el]=Αυτόματη ρύθμιση διαμεσολαβητή
+ Comment[eo]=Aŭtomata Prokuragordo
+ Comment[es]=Configuración automática del Proxy
+-Comment[et]=Automaatne proxy konfigureerimine
++Comment[et]=Automaatne puhverserveri seadistamine
+ Comment[eu]=Proxy-aren konfigurazio automatikoa
+ Comment[fa]=پیکربندی خودکار پیشکار
+-Comment[fi]=Automaattiset proxy-asetukset
++Comment[fi]=Automaattiset välityspalvelinasetukset
+ Comment[fr]=Configuration automatique du proxy
+ Comment[fy]=Automatyske proxy ynstelling
+ Comment[ga]=Uathchumraíocht an tseachfhreastalaí
+@@ -85,6 +85,7 @@
+ Comment[ko]=자동 프록시 설정
+ Comment[lb]=Automatesch Proxy-Configuratioun
+ Comment[lt]=Automatinis proxy derinimas
++Comment[lv]=Automātiska starpniekserveru konfigurēšana
+ Comment[mk]=Автоматска конфигурација на прокси
+ Comment[ms]=Penyelarasan Proksi Automatik
+ Comment[nb]=Automatisk mellomtjeneroppsett
+--- a/kio/kcmoduleinit.desktop
++++ b/kio/kcmoduleinit.desktop
+@@ -11,6 +11,7 @@
+ Name[el]=Αρχικοποίηση ρυθμίσεων του KDE
+ Name[en_GB]=KDE Configuration Initialisation
+ Name[es]=Inicialización de la configuración de KDE
++Name[et]=KDE seadistamise initsialiseerimine
+ Name[fa]=مقداردهی اولیه پیکربندی KDE
+ Name[ga]=Túsú Cumraíochta KDE
+ Name[he]=איתחול ההגדרות של KDE
+@@ -21,7 +22,9 @@
+ Name[km]=ការ​ចាប់​ផ្តើម​ការ​កំណត់​រចនាសម្ព័ន្ធ​ KDE
+ Name[kn]=ಕೆಡಿಇ ಸಂರಚನಾ ಮೊದಲುಗೊಳಿಸುವಿಕೆ
+ Name[ko]=KDE 설정 초기화
++Name[lt]=KDE konfigūravimo inicijavimas
+ Name[lv]=KDE konfigurācijas inicializācija
++Name[nb]=Klargjøring av KDE-oppsett
+ Name[nds]=KDE-Instellentorechtmaken
+ Name[ne]=केडीई कन्फिगरेसन सुरुआत
+ Name[nl]=KDE-configuratie initialiseren
+@@ -29,8 +32,11 @@
+ Name[pt]=Inicialização da Configuração do KDE
+ Name[pt_BR]=Inicialização da Configuração do KDE
+ Name[sl]=Začetno nastavljanje KDE-ja
++Name[sr]=Успостављање подешавања КДЕ-а
++Name[sr at latin]=Uspostavljanje podešavanja KDE-a
+ Name[sv]=Initiering av KDE-inställningar
+ Name[th]=เริ่มงานการปรับแต่ง KDE
++Name[uk]=Започаткування конфігурації KDE
+ Name[vi]=Sở khởi cấu hình KDE
+ Name[wa]=Inicialijhaedje di l' apontiaedje di KDE
+ Name[x-test]=xxKDE Configuration Initializationxx
+--- a/kio/tests/krununittest.cpp
++++ b/kio/tests/krununittest.cpp
+@@ -94,7 +94,7 @@
+     KUrl::List l3; l3 << KUrl( "file:/local/file" ) << KUrl( "http://remotehost.org/bar" );
+ 
+     static const char
+-        *execs[] = { "Exec=date -u", "Exec=echo $$PWD" },
++        *execs[] = { "Exec=date -u", "Exec=echo $PWD" },
+         *terms[] = { "Terminal=false", "Terminal=true\nTerminalOptions=-T \"%f - %c\"" },
+           *sus[] = { "X-KDE-SubstituteUID=false", "X-KDE-SubstituteUID=true\nX-KDE-Username=sprallo" },
+         *rslts[] = {
+@@ -133,6 +133,7 @@
+     KUrl::List l1; l1 << KUrl( "file:/tmp" );
+     KUrl::List l2; l2 << KUrl( "http://localhost/foo" );
+     KUrl::List l3; l3 << KUrl( "file:/local/file" ) << KUrl( "http://remotehost.org/bar" );
++    KUrl::List l4; l4 << KUrl( "http://login:password@www.kde.org" );
+ 
+     // A real-world use case would be kate.
+     // But I picked kdeinit4 since it's installed by kdelibs
+@@ -167,6 +168,7 @@
+                                    << l1 << false << "/bin/sh -c 'kdeinit4 \\\"/tmp\\\"'";
+ 
+     QTest::newRow("kmailservice %u l1") << "kmailservice %u" << l1 << false << kmailservice + " /tmp";
++    QTest::newRow("kmailservice %u l4") << "kmailservice %u" << l4 << false << kmailservice + " http://login:password@www.kde.org";
+ }
+ 
+ void KRunUnitTest::testProcessDesktopExecNoFile()
+--- a/kio/tests/dummymeta.desktop
++++ b/kio/tests/dummymeta.desktop
+@@ -24,6 +24,7 @@
+ Name[ko]=가짜 메타
+ Name[lb]=Dummy-Meta
+ Name[lt]=Netikras Meta
++Name[lv]=Testa metadati
+ Name[ms]=Meta Olok-olok
+ Name[ne]=डमी मेटा
+ Name[pa]=ਫ਼ਰਜੀ ਮੈਟਾ
+--- a/kio/kscan.desktop
++++ b/kio/kscan.desktop
+@@ -10,6 +10,7 @@
+ Name[ne]=केडीई स्क्यान
+ Name[pl]=Skan
+ Name[ru]=Сканер
++Name[sr]=К-скен
+ Name[sv]=Kscan
+ Name[ta]=Kவருடல்
+ Name[te]=కేస్కేన్
+--- a/kio/kurifilterplugin.desktop
++++ b/kio/kurifilterplugin.desktop
+@@ -52,8 +52,8 @@
+ Name[ru]=Модуль расширенного просмотра
+ Name[se]=Njuovžilut fierbmádatlogadeami lassemoduvla
+ Name[sl]=Vstavek za izboljšano brskanje
+-Name[sr]=Прикључак за побољшано претраживање
+-Name[sr at latin]=Priključak za poboljšano pretraživanje
++Name[sr]=Прикључак за побољшано прегледање
++Name[sr at latin]=Priključak za poboljšano pregledanje
+ Name[sv]=Utökad webbläsning
+ Name[ta]=மேம்படுத்திய உலாவும் சொருகுப்பொருள்
+ Name[te]=అభివ్రుద్దిపరచిన బ్రౌజింగ్ ప్లగిన్
+--- a/kio/data.protocol
++++ b/kio/data.protocol
+@@ -37,6 +37,7 @@
+ Description[ko]=데이터 URI를 위한 KIO 슬레이브 (RFC 2397)
+ Description[lb]=E kioslave fir Donnéen-URIs (rfc2397)
+ Description[lt]=Antrinė KDE programa duomenų URI (rfc2397)
++Description[lv]=Kioslave priekš datu URI (rfc2397)
+ Description[mk]=kio-служител за податочни URI (rfc2397)
+ Description[ms]=Kioslave untuk URI data (rfc2397)
+ Description[nb]=kioslave for data URI-er (rfc2397)
+@@ -52,8 +53,8 @@
+ Description[ru]=Обработчик URI данных (rfc2397)
+ Description[se]=kiošláva dáhta-URI:aid várás (rfc2397)
+ Description[sl]=kioslave za podatkovne URI-je (rfc2397)
+-Description[sr]=kioslave за URI-ије података (rfc2397)
+-Description[sr at latin]=kioslave za URI-ije podataka (rfc2397)
++Description[sr]=У/И-захват за УРИ-је података (РФЦ 2397)
++Description[sr at latin]=U/I-zahvat za URI-je podataka (RFC 2397)
+ Description[sv]=En I/O-slav för datawebbadresser (RFC 2397)
+ Description[ta]=தரவு வலைமனைகளுக்கான ஒரு kioslave (rfc2397)
+ Description[te]=దత్తాంశం యుఆరైల కొరకు కెఐఓబానిస (rfc2397)
+--- a/kio/kcmodule.desktop
++++ b/kio/kcmodule.desktop
+@@ -5,6 +5,7 @@
+ Name=KDE Configuration Module
+ Name[ar]=وحدة تحكم كيدي
+ Name[be]=Модуль настаўлення KDE
++Name[br]=Mollad kreizenn ren KDE
+ Name[ca]=Mòdul de configuració del KDE
+ Name[cs]=Ovládací modul KDE
+ Name[csb]=Kòntrolny mòduł pùltu KDE
+@@ -12,6 +13,7 @@
+ Name[el]=Άρθρωμα ρύθμισης του KDE
+ Name[eo]=KDE Agordmodulo
+ Name[es]=Módulo de configuración de KDE
++Name[et]=KDE seadistamismoodul
+ Name[fa]=پیمانۀ پیکربندی KDE
+ Name[ga]=Modúl Cumraíochta KDE
+ Name[he]=מודול הגדרות של KDE
+@@ -22,7 +24,9 @@
+ Name[km]=ម៉ូឌុល​កំណត់​រចនាសម្ព័ន្ធ​របស់ KDE
+ Name[kn]=ಕೆಡಿಇ ಸಂರಚನಾ ಘಟಕ
+ Name[ko]=KDE 제어 모듈
++Name[lt]=KDE konfigūravimo modulis
+ Name[lv]=KDE konfigurācijas modulis
++Name[nb]=KDE kontrollsenter-modul
+ Name[nds]=KDE-Kuntrullmoduul
+ Name[ne]=केडीई कन्फिगरेसन मोड्युल
+ Name[nl]=KDE-configuratiemodule
+@@ -30,9 +34,12 @@
+ Name[pt]=Módulo de Configuração do KDE
+ Name[pt_BR]=Módulo de Configuração do KDE
+ Name[sl]=Modul za nastavljanje KDE
++Name[sr]=КДЕ модул за подешавање
++Name[sr at latin]=KDE modul za podešavanje
+ Name[sv]=KDE-inställningsmodul
+ Name[te]=కెడిఈ అమరిక మాడ్యూల్
+ Name[th]=โมดูลปรับแต่งของ KDE
++Name[uk]=Модуль налаштування KDE
+ Name[vi]=Mô-đun Cấu hình KDE
+ Name[wa]=Module d' apontiaedje di KDE
+ Name[x-test]=xxKDE Configuration Modulexx
+--- a/kio/application.desktop
++++ b/kio/application.desktop
+@@ -43,6 +43,7 @@
+ Name[ne]=अनुप्रयोग
+ Name[nl]=Toepassing
+ Name[nn]=Program
++Name[oc]=Aplicacion
+ Name[pa]=ਕਾਰਜ
+ Name[pl]=Program
+ Name[pt]=Aplicação
+--- a/kio/kpasswdserver.desktop
++++ b/kio/kpasswdserver.desktop
+@@ -51,7 +51,7 @@
+ Name[ru]=Служба паролей
+ Name[se]=KDED beassansátni-moduvla
+ Name[sl]=Geselni modul KDED
+-Name[sr]=KDED модул за лозинке
++Name[sr]=КДЕД модул за лозинке
+ Name[sr at latin]=KDED modul za lozinke
+ Name[sv]=KDED-lösenordsmodul
+ Name[ta]=KDED கடவுச்சொல் பகுதி
+--- a/kio/kssl/kopenssl.h
++++ b/kio/kssl/kopenssl.h
+@@ -27,7 +27,6 @@
+ 
+ #include <kio/kio_export.h>
+ 
+-#include <klibloader.h>
+ #include <ksslconfig.h>
+ 
+ #ifdef KSSL_HAVE_SSL
+--- a/kio/kssl/ksslcertificatehome.cpp
++++ b/kio/kssl/ksslcertificatehome.cpp
+@@ -171,7 +171,7 @@
+ 
+ QString KSSLCertificateHome::getDefaultCertificateName(KSSLAuthAction *aa)
+ {
+-   KConfig _cfg("cryptodefaults", KConfig::CascadeConfig);
++   KConfig _cfg("cryptodefaults", KConfig::NoGlobals);
+    KConfigGroup cfg(&_cfg, "Auth");
+    if (aa) {
+       QString am = cfg.readEntry("AuthMethod", "");
+--- a/kio/kssl/kopenssl.cpp
++++ b/kio/kssl/kopenssl.cpp
+@@ -28,6 +28,7 @@
+ #include <kdebug.h>
+ #include <kconfig.h>
+ #include <kconfiggroup.h>
++#include <klibrary.h>
+ #include <QtCore/QCoreApplication>
+ #include <QtCore/QFile>
+ #include <QtCore/QRegExp>
+@@ -284,23 +285,28 @@
+ KOpenSSLProxy::KOpenSSLProxy()
+     : d(new KOpenSSLProxyPrivate())
+ {
+-    KLibLoader *ll = KLibLoader::self();
+     QStringList libpaths, libnamesc, libnamess;
+ 
+    d->cryptoLib = 0L;
+    d->sslLib = 0L;
+ 
+-   KConfig cfg("cryptodefaults", KConfig::CascadeConfig );
++   KConfig cfg("cryptodefaults", KConfig::NoGlobals );
+    KConfigGroup cg(&cfg, "OpenSSL");
+-   QString upath = cg.readPathEntry("Path");
++   QString upath = cg.readPathEntry("Path", QString());
+    if (!upath.isEmpty())
+       libpaths << upath;
+ 
+ #ifdef __OpenBSD__
+    {
+    QString libname = findMostRecentLib("/usr/lib" KDELIBSUFF, "crypto");
+-   if (!libname.isNull())
+-         d->cryptoLib = ll->library(libname, QLibrary::ExportExternalSymbolsHint);
++   if (!libname.isNull()) {
++         d->cryptoLib = new KLibrary(libname);
++         d->cryptoLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
++         if (!d->cryptoLib->load()) {
++             delete d->cryptoLib;
++             d->cryptoLib = 0;
++         }
++   }
+    }
+ #elif defined(__CYGWIN__)
+    libpaths << "/usr/bin/"
+@@ -378,12 +384,20 @@
+          if (!alib.isEmpty() && !alib.endsWith('/'))
+             alib += '/';
+          alib += *shit;
+-	 // someone knows why this is needed?
+-	 QString tmpStr(alib.toLatin1().constData());
+-	 tmpStr.replace(QRegExp("\\(.*\\)"), "");
+-	 if (!access(tmpStr.toLatin1(), R_OK))
+-            d->cryptoLib = ll->library(alib, QLibrary::ExportExternalSymbolsHint);
+-         if (d->cryptoLib) break;
++	     // someone knows why this is needed?
++	     QString tmpStr(alib.toLatin1().constData());
++	     tmpStr.replace(QRegExp("\\(.*\\)"), "");
++         if (!access(tmpStr.toLatin1(), R_OK)) {
++            d->cryptoLib = new KLibrary(alib);
++            d->cryptoLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
++         }
++         if (d->cryptoLib->load()) {
++             break;
++         }
++         else {
++             delete d->cryptoLib;
++             d->cryptoLib = 0;
++         }
+       }
+       if (d->cryptoLib) break;
+    }
+@@ -517,8 +531,14 @@
+ #ifdef __OpenBSD__
+    {
+    QString libname = findMostRecentLib("/usr/lib", "ssl");
+-   if (!libname.isNull())
+-         d->sslLib = ll->library(libname, QLibrary::ExportExternalSymbolsHint);
++   if (!libname.isNull()) {
++         d->sslLib = new KLibrary(libname);
++         d->sslLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
++         if (!d->sslLib->load()) {
++             delete d->sslLib;
++             d->sslLib = 0;
++         }
++   }
+    }
+ #else
+    for (QStringList::Iterator it = libpaths.begin();
+@@ -531,11 +551,19 @@
+          if (!alib.isEmpty() && !alib.endsWith('/'))
+             alib += '/';
+          alib += *shit;
+-	 QString tmpStr(alib.toLatin1());
+-	 tmpStr.replace(QRegExp("\\(.*\\)"), "");
+-	 if (!access(tmpStr.toLatin1(), R_OK))
+-         	d->sslLib = ll->library(alib, QLibrary::ExportExternalSymbolsHint);
+-         if (d->sslLib) break;
++	     QString tmpStr(alib.toLatin1());
++	     tmpStr.replace(QRegExp("\\(.*\\)"), "");
++         if (!access(tmpStr.toLatin1(), R_OK)) {
++         	d->sslLib = new KLibrary(alib);
++            d->sslLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
++         }
++         if (d->sslLib->load()) {
++             break;
++         }
++         else {
++             delete d->sslLib;
++             d->sslLib = 0;
++         }
+       }
+       if (d->sslLib) break;
+    }
+--- a/kio/kssl/ksslinfodialog.cpp
++++ b/kio/kssl/ksslinfodialog.cpp
+@@ -95,14 +95,14 @@
+ 
+         if (KSSL::doesSSLWork()) {
+             if (d->m_secCon) {
+-                d->pixmap->setPixmap(BarIcon("encrypted"));
++                d->pixmap->setPixmap(BarIcon("security-high"));
+                 d->info->setText(i18n("Current connection is secured with SSL."));
+             } else {
+-                d->pixmap->setPixmap(BarIcon("decrypted"));
++                d->pixmap->setPixmap(BarIcon("security-low"));
+                 d->info->setText(i18n("Current connection is not secured with SSL."));
+             }
+         } else {
+-            d->pixmap->setPixmap(BarIcon("decrypted"));
++            d->pixmap->setPixmap(BarIcon("security-low"));
+             d->info->setText(i18n("SSL support is not available in this build of KDE."));
+         }
+         d->m_layout->addItem(new QSpacerItem(0, 50), 0, 0); // give minimum height to look better
+@@ -136,7 +136,7 @@
+ }
+ 
+ void KSSLInfoDialog::launchConfig() {
+-    QProcess::startDetached("kcmshell", QStringList() << "crypto");
++    QProcess::startDetached("kcmshell4", QStringList() << "crypto");
+ }
+ 
+ 
+@@ -144,7 +144,7 @@
+     d->inQuestion = isIt;
+     if (KSSL::doesSSLWork())
+         if (isIt) {
+-            d->pixmap->setPixmap(BarIcon("halfencrypted"));
++            d->pixmap->setPixmap(BarIcon("security-medium"));
+             if (d->m_secCon) {
+                 d->info->setText(i18n("The main part of this document is secured with SSL, but some parts are not."));
+             } else {
+@@ -152,10 +152,10 @@
+             }
+         } else {
+             if (d->m_secCon) {
+-                d->pixmap->setPixmap(BarIcon("encrypted"));
++                d->pixmap->setPixmap(BarIcon("security-high"));
+                 d->info->setText(i18n("Current connection is secured with SSL."));
+             } else {
+-                d->pixmap->setPixmap(BarIcon("decrypted"));
++                d->pixmap->setPixmap(BarIcon("security-low"));
+                 d->info->setText(i18n("Current connection is not secured with SSL."));
+             }
+         }
+--- a/kio/kssl/ksslsettings.cpp
++++ b/kio/kssl/ksslsettings.cpp
+@@ -98,7 +98,7 @@
+ KSSLSettings::KSSLSettings(bool readConfig)
+ 	:d(new KSSLSettingsPrivate)
+ {
+-        m_cfg = new KConfig("cryptodefaults", KConfig::CascadeConfig);
++        m_cfg = new KConfig("cryptodefaults", KConfig::NoGlobals);
+ 
+ 	if (!KGlobal::dirs()->addResourceType("kssl", "data", "kssl")) {
+ 		//kDebug(7029) << "Error adding (kssl, share/apps/kssl)";
+@@ -198,7 +198,7 @@
+ 	cfg.changeGroup("EGD");
+ 	d->m_bUseEGD = cfg.readEntry("UseEGD", false);
+ 	d->m_bUseEFile = cfg.readEntry("UseEFile", false);
+-	d->m_EGDPath = cfg.readPathEntry("EGDPath");
++	d->m_EGDPath = cfg.readPathEntry("EGDPath", QString());
+ 
+ 	cfg.changeGroup("Auth");
+ 	d->m_bSendX509 = ("send" == cfg.readEntry("AuthMethod", ""));
+--- a/kio/renamedialogplugin.desktop
++++ b/kio/renamedialogplugin.desktop
+@@ -36,7 +36,7 @@
+ Comment[ko]=이름 바꾸기 대화상자용 플러그인
+ Comment[lb]=Plugin fir den Ëmbenennen-Dialog
+ Comment[lt]=Priedas pervadinimo dialogui
+-Comment[lv]=Spraudnis Pārsaukšanas Dialogam
++Comment[lv]=Spraudnis pārsaukšanas dialogam
+ Comment[mk]=Приклучок за дијалогот за преименување
+ Comment[ms]=Plug masuk untuk namakan semula Dialog
+ Comment[nb]=Programtillegg for omnavningsdialogen
+@@ -52,8 +52,8 @@
+ Comment[ru]=Модуль для диалога переименования
+ Comment[se]=Lassemoduvla nammarievdadanláseža várás
+ Comment[sl]=Vstavek za pogovorno okno za preimenovanje
+-Comment[sr]=Прикључак за дијалог за преименовање
+-Comment[sr at latin]=Priključak za dijalog za preimenovanje
++Comment[sr]=Прикључак за дијалог преименовања
++Comment[sr at latin]=Priključak za dijalog preimenovanja
+ Comment[sv]=Insticksprogram för Byt namn-dialogrutan
+ Comment[ta]=மறுபெயரிடல் உரையாடலுக்கான சொருகுப்பொருள்
+ Comment[te]=పేరు మార్చు సంభాషణ కొరకు ప్లగిన్
+--- a/DEBUG
++++ b/DEBUG
+@@ -8,12 +8,12 @@
+ Configuring for debugging
+ =========================
+ 
+-You can use --enable-debug with the configure script, if you want to have
++You can use -DCMAKE_BUILD_TYPE=Debug with the configure script, if you want to have
+ debug code in your KDE libs. If you have the space and can stand code that's
+ somewhat slower, this is worth it. The extra information really
+ helps debugging and thus bugfixing.
+ 
+-On the other hand, --disable-debug removes all debug messages, leading
++On the other hand, -DCMAKE_BUILD_TYPE=None removes all debug messages, leading
+ to a faster and cleaner desktop.
+ 
+ 
+--- a/kpty/CMakeLists.txt
++++ b/kpty/CMakeLists.txt
+@@ -13,7 +13,7 @@
+ 
+ target_link_libraries(kpty ${KDE4_KDECORE_LIBS} ${UTIL_LIBRARY})
+ 
+-#set_target_properties(kdecore PROPERTIES VERSION ${KDE_NON_GENERIC_LIB_VERSION} SOVERSION ${KDE_NON_GENERIC_LIB_SOVERSION} )
++set_target_properties(kpty PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
+ install(TARGETS kpty
+              RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+              LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+--- a/kdewidgets/kde.widgets
++++ b/kdewidgets/kde.widgets
+@@ -111,6 +111,12 @@
+ IncludeFile=kshortcutwidget.h
+ Group=Buttons (KDE)
+ 
++[KLanguageButton]
++ToolTip=Language Button (KDE)
++WhatsThis=KDE's language button.
++IncludeFile=klanguagebutton.h
++Group=Buttons (KDE)
++
+ [KDialogButtonBox]
+ ToolTip=Button Box (KDE)
+ WhatsThis=KDE's button box.
+@@ -191,12 +197,6 @@
+ IncludeFile=knuminput.h
+ Group=Input (KDE)
+ 
+-[KDoubleSpinBox]
+-ToolTip=Enhanced Spinbox for Floating Point Values (KDE)
+-WhatsThis=A spinbox widget for floating point numbers.
+-IncludeFile=knuminput.h
+-Group=Input (KDE)
+-
+ [KTimeZoneWidget]
+ ToolTip=This widget can be used to display or allow user selection of timezones. (KDE)
+ IncludeFile=ktimezonewidget.h
+--- a/kdewidgets/makekdewidgets.cpp
++++ b/kdewidgets/makekdewidgets.cpp
+@@ -126,7 +126,7 @@
+ }
+ 
+ void buildFile( QTextStream &ts, const QString& group, const QString& fileName, const QString& pluginName ) {
+-    KConfig input( fileName, KConfig::CascadeConfig );
++    KConfig input( fileName, KConfig::NoGlobals );
+     KConfigGroup cg(&input, "Global" );
+     QHash<QString, QString> MainMap;
+     MainMap.insert( "PluginName", cg.readEntry( "PluginName", pluginName ) );
+@@ -135,7 +135,7 @@
+     MainMap.insert( "Destroy", cg.readEntry( "Destroy", "" ) );
+     ts << classHeader << endl;
+ 
+-    QStringList includes = cg.readEntry( "Includes", QStringList(), ',' );
++    QStringList includes = cg.readEntry( "Includes", QStringList() );
+     QStringList classes = input.groupList();
+     classes.removeAll( "Global" );
+ 
+--- a/KDE4PORTING.html
++++ b/KDE4PORTING.html
+@@ -84,6 +84,7 @@
+ <li><a href="#mimetypes">Mime types names</a></li>
+ <li><a href="#knewstuff">KNewStuff</a></li>
+ <li><a href="#dcop">DCOP</a></li>
++<li><a href="#printing">Printing</a></li>
+ </UL>
+ 
+ <h3><a name="gettingstarted">Getting started</a></h3>
+@@ -257,6 +258,7 @@
+ <li>caption() has moved to KComponentData </li>
+ <li>makeStdCaption(const QString&amp;, bool, bool) has moved to KDialog and changed signature to makeStdCaption(const QString&amp;, CaptionFlags) </li>
+ <li>addKipcEventMask() is unneeded now, and the signals like settingsChanged(), fontChanged() etc. with enums SettingsCategory have moved to KGlobalSettings::self() which is now a QObject</li>
++<li>updateRemoteUserTimestamp() now takes DBUS service id instead of dbus name (i.e. something like org.kde. needs to be prepended)</li>
+ </ul>
+ 
+ <h4>KAudioPlayer</h4>
+@@ -321,7 +323,7 @@
+ <li>The KConfig constructors were changed to receive flags instead of boolean values, i.e.
+   <ul>
+     <li><tt>KConfig("file", false /* read-write */, false /* no globals */);</tt> becomes
+-            <tt>KConfig("file", KConfig::CascadeConfig);</tt> (note the read-write flag is gone)</li>
++            <tt>KConfig("file", KConfig::NoGlobals);</tt> (note the read-write flag is gone)</li>
+      <li><tt>KConfig("file", true);</tt>becomes <tt>KConfig("file");</tt></li>
+   </ul>
+ </li>
+@@ -516,6 +518,11 @@
+ 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.</p>
+ 
++<h4>KMultipleDrag</h4>
++<p>KMultipleDrag is obsolete, use QMimeData directly to provide contents in different mime formats.</p>
++<p>To make porting more incremental, K3MultipleDrag is provided for code that needs to work with
++Q3DragObject until being fully ported.</p>
++
+ <h4>KNetwork::KIpAddress</h4>
+ <p>Removed. Use QHostAddress instead.</p>
+ 
+@@ -1194,6 +1201,8 @@
+   item-&gt;setIcon( KIcon( "image" ) );
+ </pre>
+ </li>
++<li>The virtual methods associated with each button (slotOk(), slotCancel(), etc.) have been merged into a single KDialog::slotButtonClicked(int button) virtual method. However, the most direct replacement for slotOk() and slotCancel() is to reimplement QDialog::accept() and QDialog::reject(), respectively. For all other buttons, consider connect()ing to the corresponding signals provided by KDialog (helpClicked(), etc.).
++</li>
+ </ul>
+ 
+ <h4>KDockWindow</h4>
+@@ -1324,6 +1333,16 @@
+ <li>setMaxValue(min) -&gt; setMaximum(min) / maxValue() -&gt; maximum()</li>
+ </ul>
+ 
++<h4>KDoubleSpinBox</h4>
++<ul>
++<li>It was removed and replaced by QDoubleSpinBox</li>
++</ul>
++
++<h4>KIntSpinBox</h4>
++<ul>
++<li>In the long version of the constructor, the arguments parent and base have switched places.</li>
++</ul>
++
+ <h4>KJanusWidget</h4>
+ <p>Deprecated. Use KPageWidget instead.</p>
+ 
+@@ -2959,5 +2978,40 @@
+ 
+ <h4 align="right"><a href="#TOC">Return to the Table of Contents</a></h4>
+ 
++
++<h3><a name="printing">Printing</a></h3>
++
++<p>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.</p>
++
++<h4>Porting involves the following</h4>
++<ul>
++<li>using QPrinter instead of KPrinter</li>
++<li>using KdePrint::createPrintDialog() (in kdeui) to get a (customised) QPrintDialog, rather than using KPrinter::setup()</li>
++<li>using KPrintPreview (in kutils) for print preview, rather than KPrinter::setPreviewOnly(true)</li>
++<li>removing the dependency on libkdeprint</li>
++</ul>
++
++<p>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().</p>
++
++<h4>For more details, see the following:</h4>
++<ul>
++<li><a href="http://doc.trolltech.com/4.3/printing.html">Printing with Qt</a></li>
++<li><a href="http://api.kde.org/4.0-api/kdelibs-apidocs/kutils/html/classKPrintPreview.html">KPrintPreview apidocs</a></li>
++<li><a href="http://api.kde.org/4.0-api/kdelibs-apidocs/kdeui/html/namespaceKdePrint.html">KdePrint::createPrintDialog apidocs</a></li>
++<li><a href="http://techbase.kde.org/Projects/KDEPrint/KDE4#Porting">KDEPrint Porting on TechBase</a></li>
++</ul>
++
++
++<h4 align="right"><a href="#TOC">Return to the Table of Contents</a></h4>
++
+ </body>
+ </html>
+--- a/kdeui/kernel/kglobalsettings.h
++++ b/kdeui/kernel/kglobalsettings.h
+@@ -435,10 +435,11 @@
+      *
+      * This is only useful for configuration modules such as krdb and should not be
+      * used in normal circumstances.
++     * @param config KConfig from which to load the colors (passed as-is to
++     * ::KColorScheme).
+      *
+      * @return the QPalette
+      */
+-    // TODO should the parameter be documented, or should it be hidden from doxygen?
+     static QPalette createApplicationPalette(const KSharedConfigPtr &config = KSharedConfigPtr());
+ 
+     /**
+--- a/kdeui/kernel/kstyle.cpp
++++ b/kdeui/kernel/kstyle.cpp
+@@ -756,7 +756,14 @@
+             return;
+         case PE_IndicatorHeaderArrow:
+         {
+-            drawKStylePrimitive(WT_Header, (flags&State_UpArrow)?Generic::ArrowUp:Generic::ArrowDown, option, r, pal, flags, painter, widget);
++            const QStyleOptionHeader *hOpt = qstyleoption_cast<const QStyleOptionHeader *>(option);
++            int primitive = 0;
++            if (flags&State_UpArrow || (hOpt && hOpt->sortIndicator==QStyleOptionHeader::SortUp))
++                primitive = Generic::ArrowUp;
++            else if (flags&State_DownArrow || (hOpt && hOpt->sortIndicator==QStyleOptionHeader::SortDown))
++                primitive = Generic::ArrowDown;
++            if (primitive != 0)
++                drawKStylePrimitive(WT_Header, primitive, option, r, pal, flags, painter, widget);
+             return;
+         }
+         case PE_FrameTabBarBase:
+@@ -1730,19 +1737,33 @@
+ 
+         case CE_ScrollBarAddPage:
+         {
+-            drawKStylePrimitive(WT_ScrollBar,
+-                                (flags & State_Horizontal) ? ScrollBar::GrooveAreaHorRight :
+-                                        ScrollBar::GrooveAreaVertBottom,
++            const QStyleOptionSlider* slOpt = ::qstyleoption_cast<const QStyleOptionSlider*>(option);
++            if (!slOpt) return;
++
++            if (flags & State_Horizontal)
++                drawKStylePrimitive(WT_ScrollBar,
++                                (slOpt->direction == Qt::LeftToRight) ? ScrollBar::GrooveAreaHorRight :
++                                        ScrollBar::GrooveAreaHorLeft,
+                                 option, r, pal, flags, p, widget);
++            else
++                drawKStylePrimitive(WT_ScrollBar, ScrollBar::GrooveAreaVertBottom,
++                                                     option, r, pal, flags, p, widget);
+             return;
+         }
+ 
+         case CE_ScrollBarSubPage:
+         {
+-            drawKStylePrimitive(WT_ScrollBar,
+-                                (flags & State_Horizontal) ? ScrollBar::GrooveAreaHorLeft :
+-                                        ScrollBar::GrooveAreaVertTop,
++            const QStyleOptionSlider* slOpt = ::qstyleoption_cast<const QStyleOptionSlider*>(option);
++            if (!slOpt) return;
++
++            if (flags & State_Horizontal)
++                drawKStylePrimitive(WT_ScrollBar,
++                                (slOpt->direction == Qt::LeftToRight) ? ScrollBar::GrooveAreaHorLeft :
++                                        ScrollBar::GrooveAreaHorRight,
+                                 option, r, pal, flags, p, widget);
++            else
++                drawKStylePrimitive(WT_ScrollBar, ScrollBar::GrooveAreaVertTop,
++                                                     option, r, pal, flags, p, widget);
+             return;
+         }
+ 
+@@ -3135,8 +3156,11 @@
+                         return handleRTL(option,
+                                          QRect(buttonsLeft, r.bottom()-bmb-heightDown+1, buttonsWidth, heightDown) );
+                     case SC_SpinBoxEditField:
+-                        return handleRTL(option,
+-                                         QRect(r.left()+fw, r.top()+fw, r.width()-fw-bw, r.height()-2*fw) );
++                    {
++                        QRect labelRect(r.left()+fw, r.top()+fw, r.width()-fw-bw, r.height()-2*fw);
++                        labelRect = insideMargin(labelRect, WT_SpinBox, SpinBox::ContentsMargin, option, widget);
++                        return handleRTL(option, labelRect );
++                    }
+                     case SC_SpinBoxFrame:
+                         return (sb->frame || !supportFrameless) ? r : QRect();
+                     default:
+@@ -3149,14 +3173,14 @@
+         {
+             if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
+ 
+-                int fw = widgetLayoutProp(WT_ComboBox, SpinBox::FrameWidth, option, widget);
+-                int bw = widgetLayoutProp(WT_ComboBox, SpinBox::ButtonWidth, option, widget);
+-                int bm = widgetLayoutProp(WT_ComboBox, SpinBox::ButtonMargin, option, widget);
+-                int bml = bm + widgetLayoutProp(WT_ComboBox, SpinBox::ButtonMargin + Left, option, widget);
+-                int bmr = bm + widgetLayoutProp(WT_ComboBox, SpinBox::ButtonMargin + Right, option, widget);
+-                int bmt = bm + widgetLayoutProp(WT_ComboBox, SpinBox::ButtonMargin + Top, option, widget);
+-                int bmb = bm + widgetLayoutProp(WT_ComboBox, SpinBox::ButtonMargin + Bot, option, widget);
+-                bool supportFrameless = widgetLayoutProp(WT_ComboBox, SpinBox::SupportFrameless, option, widget);
++                int fw = widgetLayoutProp(WT_ComboBox, ComboBox::FrameWidth, option, widget);
++                int bw = widgetLayoutProp(WT_ComboBox, ComboBox::ButtonWidth, option, widget);
++                int bm = widgetLayoutProp(WT_ComboBox, ComboBox::ButtonMargin, option, widget);
++                int bml = bm + widgetLayoutProp(WT_ComboBox, ComboBox::ButtonMargin + Left, option, widget);
++                int bmr = bm + widgetLayoutProp(WT_ComboBox, ComboBox::ButtonMargin + Right, option, widget);
++                int bmt = bm + widgetLayoutProp(WT_ComboBox, ComboBox::ButtonMargin + Top, option, widget);
++                int bmb = bm + widgetLayoutProp(WT_ComboBox, ComboBox::ButtonMargin + Bot, option, widget);
++                bool supportFrameless = widgetLayoutProp(WT_ComboBox, ComboBox::SupportFrameless, option, widget);
+ 
+                 // ComboBox without a frame, set the corresponding layout values to 0, reduce button width.
+                 if (supportFrameless && !cb->frame)
+@@ -3173,8 +3197,11 @@
+                         return handleRTL(option,
+                                          QRect(r.right()-bw+bml+1, r.top()+bmt, bw-bml-bmr, r.height()-bmt-bmb) );
+                     case SC_ComboBoxEditField:
+-                        return handleRTL(option,
+-                                         QRect(r.left()+fw, r.top()+fw, r.width()-fw-bw, r.height()-2*fw) );
++                    {
++                        QRect labelRect(r.left()+fw, r.top()+fw, r.width()-fw-bw, r.height()-2*fw);
++                        labelRect = insideMargin(labelRect, WT_ComboBox, ComboBox::ContentsMargin, option, widget);
++                        return handleRTL(option, labelRect );
++                    }
+                     case SC_ComboBoxListBoxPopup:
+                         // TODO: need to add layoutProps to control the popup rect?
+ //                         return cb->popupRect;
+@@ -3643,6 +3670,25 @@
+                 return expandDim(QSize(w, h), WT_Header, Header::ContentsMargin, option, widget);
+             }
+         }
++
++        case CT_ComboBox:
++        {
++            // TODO: Figure out what to do with the button margins
++            QSize size = contentsSize;
++
++            // Add the contents margin
++            size = expandDim(size, WT_ComboBox, ComboBox::ContentsMargin, option, widget);
++
++            // Add the button width
++            size.rwidth() += widgetLayoutProp(WT_ComboBox, ComboBox::ButtonWidth, option, widget);
++
++            // Add the frame width
++            size.rwidth()  += widgetLayoutProp(WT_ComboBox, ComboBox::FrameWidth, option, widget) * 2;
++            size.rheight() += widgetLayoutProp(WT_ComboBox, ComboBox::FrameWidth, option, widget) * 2;
++
++            return size;
++        }
++
+         default:
+             break;
+     }
+--- a/kdeui/kernel/kapplication.cpp
++++ b/kdeui/kernel/kapplication.cpp
+@@ -110,7 +110,6 @@
+ 
+ #include <QtGui/QActionEvent>
+ #include <kcomponentdata.h>
+-#include <klibloader.h>
+ 
+ KApplication* KApplication::KApp = 0L;
+ bool KApplication::loadedByKdeinit = false;
+@@ -1026,9 +1025,10 @@
+ void KApplication::updateRemoteUserTimestamp( const QString& service, int time )
+ {
+ #if defined Q_WS_X11
++    Q_ASSERT(service.contains('.'));
+     if( time == 0 )
+         time = QX11Info::appUserTime();
+-    QDBusInterface(service.contains('.')?service:"org.kde."+service, QLatin1String("/MainApplication"),
++    QDBusInterface(service, QLatin1String("/MainApplication"),
+             QString(QLatin1String("org.kde.KApplication")))
+         .call(QLatin1String("updateUserTimestamp"), time);
+ #endif
+--- a/kdeui/kernel/kstyle.h
++++ b/kdeui/kernel/kstyle.h
+@@ -1051,10 +1051,13 @@
+                                 * spacing of the buttons will be reduced by 1 if
+                                 * necessary to avoid rounding problems. Needs to be
+                                 * handled in your drawing code. */
+-            SupportFrameless   /**< (\b 0) Set to non-zero to indicate that you are able to
++            SupportFrameless,   /**< (\b 0) Set to non-zero to indicate that you are able to
+                                 * handle frame-less SpinBoxes. For a SpinBox with no
+                                 * frame, FrameWidth and Top/Bottom/Right ButtonMargin
+                                 * is ignored. */
++            ContentsMargin
++                                /**< (\b 5) space between the bevel and the spinbox contents
++                                    */
+         };
+ 
+         /**
+@@ -1104,9 +1107,12 @@
+             FocusMargin = ButtonMargin + MarginInc,
+                                 /**< (\b 1) Focus margin for ComboBoxes that aren't
+                                  * editable, measured from the EditField rect */
+-            SupportFrameless = FocusMargin + MarginInc
++            SupportFrameless = FocusMargin + MarginInc,
+                                 /**< (\b 0) @see LP_SpinBox_SupportFrameless same description
+                                  * applies here */
++            ContentsMargin
++                                /**< (\b 5) space between the bevel and the combobox contents
++                                    */
+         };
+ 
+         /**
+--- a/kdeui/kernel/kapplication.h
++++ b/kdeui/kernel/kapplication.h
+@@ -339,7 +339,7 @@
+   unsigned long userTimestamp() const;
+ 
+   /**
+-   * Updates the last user action timestamp in the application registered to DCOP with dcopId
++   * Updates the last user action timestamp in the application registered to DBUS with id service
+    * to the given time, or to this application's user time, if 0 is given.
+    * Use before causing user interaction in the remote application, e.g. invoking a dialog
+    * in the application using a DCOP call.
+--- a/kdeui/kernel/kstartupinfo.cpp
++++ b/kdeui/kernel/kstartupinfo.cpp
+@@ -640,7 +640,7 @@
+ 
+ void KStartupInfo::setNewStartupId( QWidget* window, const QByteArray& startup_id )
+     {
+-    long activate = true;
++    bool activate = true;
+     kapp->setStartupId( startup_id );
+ #ifdef Q_WS_X11
+     if( window != NULL )
+@@ -1018,9 +1018,9 @@
+     if (!gethostname( hostname, 255 ))
+ 	hostname[sizeof(hostname)-1] = '\0';
+ #ifdef Q_WS_X11
+-    long qt_x_user_time = QX11Info::appUserTime();
++    unsigned long qt_x_user_time = QX11Info::appUserTime();
+ #else
+-    long qt_x_user_time = 0;
++    unsigned long qt_x_user_time = 0;
+ #endif
+     QByteArray id = QString::fromLatin1( "%1;%2;%3;%4_TIME%5" ).arg( hostname ).arg( tm.tv_sec )
+         .arg( tm.tv_usec ).arg( getpid()).arg( qt_x_user_time ).toUtf8();
+@@ -1151,7 +1151,9 @@
+     if( pos >= 0 )
+         {
+         bool ok;
+-        long time = QString( d->id.mid( pos + 5 ) ).toLong( &ok );
++        unsigned long time = QString( d->id.mid( pos + 5 ) ).toULong( &ok );
++        if( !ok && d->id[ pos + 5 ] == '-' ) // try if it's as a negative signed number perhaps
++            time = QString( d->id.mid( pos + 5 ) ).toLong( &ok );
+         if( ok )
+             return time;
+         }
+@@ -1166,7 +1168,9 @@
+         if( pos2 >= 0 )
+             {
+             bool ok;
+-            long time = QString( d->id.mid( pos2 + 1, pos1 - pos2 - 1 ) ).toLong( &ok );
++            unsigned long time = QString( d->id.mid( pos2 + 1, pos1 - pos2 - 1 ) ).toULong( &ok );
++            if( !ok && d->id[ pos2 + 1 ] == '-' )
++                time = QString( d->id.mid( pos2 + 1, pos1 - pos2 - 1 ) ).toLong( &ok );
+             if( ok )
+                 return time;
+             }
+--- a/kdeui/kernel/kglobalsettings.cpp
++++ b/kdeui/kernel/kglobalsettings.cpp
+@@ -45,6 +45,10 @@
+ #include <QtDBus/QtDBus>
+ #include <QtGui/QStyleFactory>
+ 
++// next two needed so we can set their palettes
++#include <QtGui/QToolTip>
++#include <QtGui/QWhatsThis>
++
+ #ifdef Q_WS_WIN
+ #include <windows.h>
+ #include <kkernel_win.h>
+@@ -100,6 +104,9 @@
+         void kdisplaySetFont();
+         void applyGUIStyle();
+ 
++        // TODO (4.1?) - make not-private, if used in KStyle
++        static QPalette createTooltipPalette(const KSharedConfigPtr &config = KSharedConfigPtr());
++
+         /**
+          * @internal
+          *
+@@ -885,6 +892,47 @@
+ }
+ 
+ 
++QPalette KGlobalSettings::Private::createTooltipPalette(const KSharedConfigPtr &config)
++{
++    QPalette palette = QToolTip::palette();
++
++    QPalette::ColorGroup setStates[3] = { QPalette::Active, QPalette::Inactive,
++                                          QPalette::Disabled };
++    QPalette::ColorGroup useStates[3] = { QPalette::Active, QPalette::Active,
++                                          QPalette::Disabled };
++
++    for ( int i = 0; i < 3 ; i++ ) {
++        // tooltips are never active (arguably a bug?), but should be drawn as if they were
++        QPalette::ColorGroup state = setStates[i];
++        QPalette::ColorGroup stateUsed = useStates[i];
++        KColorScheme schemeButton(stateUsed, KColorScheme::Button, config);
++        KColorScheme schemeSelection(stateUsed, KColorScheme::Selection, config);
++        KColorScheme schemeTooltip(stateUsed, KColorScheme::Tooltip, config);
++
++        palette.setBrush( state, QPalette::WindowText, schemeTooltip.foreground() );
++        palette.setBrush( state, QPalette::Window, schemeTooltip.background() );
++        palette.setBrush( state, QPalette::Base, schemeTooltip.background() );
++        palette.setBrush( state, QPalette::Text, schemeTooltip.foreground() );
++        palette.setBrush( state, QPalette::Button, schemeButton.background() );
++        palette.setBrush( state, QPalette::ButtonText, schemeButton.foreground() );
++        palette.setBrush( state, QPalette::Highlight, schemeSelection.background() );
++        palette.setBrush( state, QPalette::HighlightedText, schemeSelection.foreground() );
++
++        palette.setColor( state, QPalette::Light, schemeTooltip.shade( KColorScheme::LightShade ) );
++        palette.setColor( state, QPalette::Midlight, schemeTooltip.shade( KColorScheme::MidlightShade ) );
++        palette.setColor( state, QPalette::Mid, schemeTooltip.shade( KColorScheme::MidShade ) );
++        palette.setColor( state, QPalette::Dark, schemeTooltip.shade( KColorScheme::DarkShade ) );
++        palette.setColor( state, QPalette::Shadow, schemeTooltip.shade( KColorScheme::ShadowShade ) );
++
++        palette.setBrush( state, QPalette::AlternateBase, schemeTooltip.background( KColorScheme::AlternateBackground) );
++        palette.setBrush( state, QPalette::Link, schemeTooltip.foreground( KColorScheme::LinkText ) );
++        palette.setBrush( state, QPalette::LinkVisited, schemeTooltip.foreground( KColorScheme::VisitedText ) );
++    }
++
++    return palette;
++}
++
++
+ void KGlobalSettings::Private::kdisplaySetPalette()
+ {
+     // Added by Sam/Harald (TT) for Mac OS X initially, but why?
+@@ -894,6 +942,9 @@
+ 
+     if (qApp && qApp->type() == QApplication::GuiClient) {
+         QApplication::setPalette( q->createApplicationPalette() );
++        QPalette ttp = createTooltipPalette();
++        QToolTip::setPalette( ttp );
++        // QWhatsThis::setPalette( ttp ); // TODO (when Qt supports it)
+         emit q->kdisplayPaletteChanged();
+         emit q->appearanceChanged();
+     }
+--- a/kdeui/paged/kpagewidget.h
++++ b/kdeui/paged/kpagewidget.h
+@@ -140,6 +140,12 @@
+      * when the @param page is checked, or false if the @param page is unchecked.
+      */
+     void pageToggled( KPageWidgetItem *page, bool checked );
++    
++    /**
++     * This signal is emitted when a page is removed.
++     * @param page The page which is removed
++     * */
++    void pageRemoved( KPageWidgetItem *page );
+ 
+     protected:
+         KPageWidget(KPageWidgetPrivate &dd, QWidget *parent);
+--- a/kdeui/paged/kpagedialog.h
++++ b/kdeui/paged/kpagedialog.h
+@@ -193,6 +193,13 @@
+      */
+     void currentPageChanged( KPageWidgetItem *current, KPageWidgetItem *before );
+ 
++    /**
++     * This signal is emitted whenever a page has been removed.
++     *
++     * @param page The page which has been removed
++     **/
++    void pageRemoved( KPageWidgetItem *page );
++
+   protected:
+     /**
+      * This constructor can be used by subclasses to provide a custom page widget.
+--- a/kdeui/paged/kpagewidget.cpp
++++ b/kdeui/paged/kpagewidget.cpp
+@@ -109,6 +109,7 @@
+ 
+ void KPageWidget::removePage( KPageWidgetItem *item )
+ {
++    emit pageRemoved(item); // emit signal before we remove it, because the item will be deleted in the model
+     d_func()->model()->removePage(item);
+ }
+ 
+--- a/kdeui/paged/kpagedialog_p.h
++++ b/kdeui/paged/kpagedialog_p.h
+@@ -40,6 +40,8 @@
+             Q_Q(KPageDialog);
+             q->connect(mPageWidget, SIGNAL(currentPageChanged(KPageWidgetItem *, KPageWidgetItem *)),
+                     q, SIGNAL(currentPageChanged(KPageWidgetItem *, KPageWidgetItem *)));
++            q->connect(mPageWidget, SIGNAL(pageRemoved(KPageWidgetItem *)), 
++                    q, SIGNAL(pageRemoved(KPageWidgetItem *)));
+ 
+             q->setMainWidget(mPageWidget);
+             mPageWidget->layout()->setMargin(0);
+--- a/kdeui/dialogs/kprogressdialog.cpp
++++ b/kdeui/dialogs/kprogressdialog.cpp
+@@ -46,12 +46,12 @@
+     void slotAutoActions(int percentage);
+ 
+     KProgressDialog *q;
+-    bool          cancelButtonShown;
+-    bool          mAutoClose;
+-    bool          mAutoReset;
+-    bool          mCancelled;
+-    bool          mAllowCancel;
+-    bool          mShown;
++    bool          cancelButtonShown : 1;
++    bool          mAutoClose : 1;
++    bool          mAutoReset : 1;
++    bool          mCancelled : 1;
++    bool          mAllowCancel : 1;
++    bool          mShown : 1;
+     QString       mCancelText;
+     QLabel*       mLabel;
+     QProgressBar* mProgressBar;
+--- a/kdeui/dialogs/kconfigdialog.cpp
++++ b/kdeui/dialogs/kconfigdialog.cpp
+@@ -86,6 +86,7 @@
+   connect(this, SIGNAL(cancelClicked()), this, SLOT(updateWidgets()));
+   connect(this, SIGNAL(defaultClicked()), this, SLOT(updateWidgetsDefault()));
+   connect(this, SIGNAL(defaultClicked()), this, SLOT(_k_updateButtons()));
++  connect(this, SIGNAL(pageRemoved(KPageWidgetItem*)), this, SLOT(onPageRemoved(KPageWidgetItem*)));
+ 
+   d->manager = new KConfigDialogManager(this, config);
+   d->setupManagerConnections(d->manager);
+@@ -166,6 +167,24 @@
+     q->connect(q, SIGNAL(defaultClicked()), manager, SLOT(updateWidgetsDefault()));
+ }
+ 
++void KConfigDialog::onPageRemoved( KPageWidgetItem *item )
++{	
++	QMap<QWidget *, KConfigDialogManager *>::iterator j = d->managerForPage.begin();
++	while (j != d->managerForPage.end())
++	{
++		// there is a manager for this page, so remove it
++		if (item->widget()->isAncestorOf(j.key())) 
++		{
++			KConfigDialogManager* manager = j.value();
++			d->managerForPage.erase(j);
++			delete manager;
++			d->_k_updateButtons();
++			break;
++		}
++		j++;
++	}
++}
++
+ KConfigDialog* KConfigDialog::exists(const QString& name)
+ {
+   QHash<QString,KConfigDialog *>::const_iterator it = KConfigDialogPrivate::openDialogs.find( name );
+--- /dev/null
++++ b/kdeui/dialogs/kdeprintdialog.cpp
+@@ -0,0 +1,65 @@
++/*
++ *  This file is part of the KDE libraries
++ *  Copyright (c) 2007 Alex Merry <huntedhacker at tiscali.co.uk>
++ *  Copyright (c) 2007 Thomas Zander <zander at kde.org>
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Library General Public
++ *  License as published by the Free Software Foundation; either
++ *  version 2 of the License, or (at your option) any later version.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Library General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Library General Public License
++ *  along with this library; see the file COPYING.LIB.  If not, write to
++ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ *  Boston, MA 02110-1301, USA.
++ **/
++
++#include "kdeprintdialog.h"
++
++#include <klocale.h>
++
++#include <QLayout>
++#include <fixx11h.h> // for enable-final
++#include <QPrintDialog>
++#include <QStyle>
++#include <QTabWidget>
++
++QPrintDialog *KdePrint::createPrintDialog(QPrinter *printer,
++                                               const QList<QWidget*> &customTabs,
++                                               QWidget *parent)
++{
++    QPrintDialog *dialog = createPrintDialog(printer, parent);
++    if (! customTabs.isEmpty()) {
++        QWidget *generalWidget = dialog->findChild<QWidget*>("generalWidget");
++        QWidget *buttons = dialog->findChild<QWidget*>("buttonBox");
++        if (generalWidget && buttons) {
++            QTabWidget *tabs = new QTabWidget(dialog);
++            tabs->addTab(generalWidget, i18n("General"));
++            QStyle *style = dialog->style();
++            generalWidget->layout()->setContentsMargins(style->pixelMetric(QStyle::PM_LayoutLeftMargin),
++                                       style->pixelMetric(QStyle::PM_LayoutTopMargin),
++                                       style->pixelMetric(QStyle::PM_LayoutRightMargin),
++                                       style->pixelMetric(QStyle::PM_LayoutBottomMargin));
++            dialog->layout()->addWidget(tabs);
++            dialog->layout()->addWidget(buttons);
++
++            foreach(QWidget* tab, customTabs)
++                tabs->addTab(tab, tab->windowTitle());
++        }
++    }
++
++    return dialog;
++}
++
++
++QPrintDialog *KdePrint::createPrintDialog(QPrinter *printer,
++                                               QWidget *parent)
++{
++    return new QPrintDialog(printer, parent);
++}
++
+--- a/kdeui/dialogs/kdialog.cpp
++++ b/kdeui/dialogs/kdialog.cpp
+@@ -528,7 +528,7 @@
+ static QRect screenRect( QWidget *widget, int screen )
+ {
+   QDesktopWidget *desktop = QApplication::desktop();
+-  KConfig gc( "kdeglobals", KConfig::CascadeConfig );
++  KConfig gc( "kdeglobals", KConfig::NoGlobals );
+   KConfigGroup cg(&gc, "Windows" );
+   if ( desktop->isVirtualDesktop() &&
+        cg.readEntry( "XineramaEnabled", true ) &&
+--- a/kdeui/dialogs/kshortcutsdialog_p.h
++++ b/kdeui/dialogs/kshortcutsdialog_p.h
+@@ -27,19 +27,23 @@
+ #include <QModelIndex>
+ #include <QMetaType>
+ 
+-class QAbstractItemView;
++class QTreeWidget;
++class QTreeWidgetItem;
+ class QRadioButton;
+ class KKeySequenceWidget;
+ 
++
+ class KShortcutsEditorDelegate : public KExtendableItemDelegate
+ {
+ 	Q_OBJECT
+ public:
+-	KShortcutsEditorDelegate(QAbstractItemView *parent, bool allowLetterShortcuts);
++	KShortcutsEditorDelegate(QTreeWidget *parent, bool allowLetterShortcuts);
+ 	//reimplemented to have some extra height
+ 	virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ Q_SIGNALS:
+ 	void shortcutChanged(QVariant, const QModelIndex &);
++public Q_SLOTS:
++	void hiddenBySearchLine(QTreeWidgetItem *, bool);
+ protected:
+ 	virtual bool eventFilter(QObject *, QEvent *);
+ private:
+--- a/kdeui/dialogs/kinputdialog_p.h
++++ b/kdeui/dialogs/kinputdialog_p.h
+@@ -24,7 +24,7 @@
+ class QValidator;
+ 
+ class KComboBox;
+-class KDoubleSpinBox;
++class QDoubleSpinBox;
+ class KIntSpinBox;
+ class KLineEdit;
+ class KListWidget;
+@@ -61,7 +61,7 @@
+ 
+     KLineEdit *lineEdit() const;
+     KIntSpinBox *intSpinBox() const;
+-    KDoubleSpinBox *doubleSpinBox() const;
++    QDoubleSpinBox *doubleSpinBox() const;
+     KComboBox *comboBox() const;
+     KListWidget *listBox() const;
+     KTextEdit *textEdit() const;
+@@ -74,7 +74,7 @@
+     QLabel *m_label;
+     KLineEdit *m_lineEdit;
+     KIntSpinBox *m_intSpinBox;
+-    KDoubleSpinBox *m_doubleSpinBox;
++    QDoubleSpinBox *m_doubleSpinBox;
+     KComboBox *m_comboBox;
+     KListWidget *m_listBox;
+     KTextEdit *m_textEdit;
+--- a/kdeui/dialogs/kedittoolbar.cpp
++++ b/kdeui/dialogs/kedittoolbar.cpp
+@@ -355,7 +355,6 @@
+   QString            m_globalFile;
+   QString            m_rcFile;
+   QDomDocument       m_localDoc;
+-  bool               m_isPart;
+ 
+   ToolBarList        m_barList;
+   ToolBarListView *m_inactiveList;
+@@ -368,8 +367,9 @@
+   QLabel * m_helpArea;
+   KPushButton* m_changeIcon;
+   KProcess* m_kdialogProcess;
+-  bool m_hasKDialog;
+-  bool m_loadedOnce;
++  bool m_isPart : 1;
++  bool m_hasKDialog : 1;
++  bool m_loadedOnce : 1;
+ };
+ 
+ }
+@@ -992,6 +992,9 @@
+   // store the names of our active actions
+   QMap<QString, bool> active_list;
+ 
++  // i18n filtering message for action names
++  KLocalizedString nameFilter = ki18nc("@item:intable Action name in toolbar editor", "%1");
++
+   // see if our current action is in this toolbar
+   QDomNode n = elem.firstChild();
+   for( ; !n.isNull(); n = n.nextSibling() )
+@@ -1035,7 +1038,7 @@
+       {
+         // we have a match!
+         ToolBarItem *act = new ToolBarItem(m_activeList, it.tagName(), action->objectName(), action->toolTip());
+-        act->setText(1, action->text().remove(QChar('&')));
++        act->setText(1, nameFilter.subs(action->text().remove(QChar('&'))).toString());
+         act->setIcon(0, !action->icon().isNull() ? action->icon() : KIcon());
+         act->setIcon(1, KIcon());
+ 
+@@ -1053,7 +1056,7 @@
+       continue;
+ 
+     ToolBarItem *act = new ToolBarItem(m_inactiveList, tagActionList, action->objectName(), action->toolTip());
+-    act->setText(1, action->text().remove(QChar('&')));
++    act->setText(1, nameFilter.subs(action->text().remove(QChar('&'))).toString());
+     act->setIcon(0, !action->icon().isNull() ? action->icon() : KIcon());
+     act->setIcon(1, KIcon());
+   }
+--- a/kdeui/dialogs/kbugreport.h
++++ b/kdeui/dialogs/kbugreport.h
+@@ -71,7 +71,7 @@
+   
+ private:
+   /**
+-   * "Configure email" has been clicked - this calls kcmshell System/email
++   * "Configure email" has been clicked - this calls kcmshell4 System/email
+    */
+   Q_PRIVATE_SLOT(d, void _k_slotConfigureEmail())
+   
+--- a/kdeui/dialogs/kconfigdialogmanager.cpp
++++ b/kdeui/dialogs/kconfigdialogmanager.cpp
+@@ -60,8 +60,8 @@
+ 
+   QHash<QString, QWidget *> knownWidget;
+   QHash<QString, QWidget *> buddyWidget;
+-  bool insideGroupBox;
+-  bool trackChanges;
++  bool insideGroupBox : 1;
++  bool trackChanges : 1;
+ };
+ 
+ KConfigDialogManager::KConfigDialogManager(QWidget *parent, KConfigSkeleton *conf)
+--- a/kdeui/dialogs/kdialog_p.h
++++ b/kdeui/dialogs/kdialog_p.h
+@@ -53,8 +53,8 @@
+         KPushButton *button( KDialog::ButtonCode code ) const;
+ 
+ 
+-        bool mDetailsVisible;
+-        bool mSettingDetails;
++        bool mDetailsVisible : 1;
++        bool mSettingDetails : 1;
+         QWidget *mDetailsWidget;
+         QSize mIncSize;
+         QSize mMinSize;
+--- a/kdeui/dialogs/kconfigdialog.h
++++ b/kdeui/dialogs/kconfigdialog.h
+@@ -208,6 +208,12 @@
+    */
+   virtual void showEvent(QShowEvent *e);
+ 
++private Q_SLOTS:
++  /**
++   * Slot which cleans up the KConfigDialogManager of the page.
++   * */
++  void onPageRemoved(KPageWidgetItem* item);
++
+ private:
+   class KConfigDialogPrivate;
+   friend class KConfigDialogPrivate;
+--- /dev/null
++++ b/kdeui/dialogs/kdeprintdialog.h
+@@ -0,0 +1,71 @@
++/*
++ *  This file is part of the KDE libraries
++ *  Copyright (c) 2007 Alex Merry <huntedhacker at tiscali.co.uk>
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Library General Public
++ *  License as published by the Free Software Foundation; either
++ *  version 2 of the License, or (at your option) any later version.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Library General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Library General Public License
++ *  along with this library; see the file COPYING.LIB.  If not, write to
++ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ *  Boston, MA 02110-1301, USA.
++ **/
++
++#ifndef KDEPRINTDIALOG_H
++#define KDEPRINTDIALOG_H
++
++#include <kdeui_export.h>
++
++#include <QtCore/QList>
++
++class QPrintDialog;
++class QPrinter;
++class QWidget;
++
++/**
++ * Namespace for the KDE printing system
++ */
++namespace KdePrint
++{
++    /**
++     * Creates a printer dialog for a QPrinter with the given custom widgets.
++     *
++     * Note that the custom widgets will @b not be shown on Qt versions prior to
++     * 4.3.2.
++     *
++     * The caller takes ownership of the dialog and is responsible
++     * for deleting it.
++     *
++     * @param printer the QPrinter to apply settings to
++     * @param parent the parent for the dialog
++     * @param customTabs a list of custom widgets to show as tabs, the name printed on the tab will
++     *      be taken from the widgets windowTitle().
++     * @see QWidget::setWindowTitle()
++     */
++    KDEUI_EXPORT QPrintDialog *createPrintDialog(QPrinter *printer,
++                                                      const QList<QWidget*> &customTabs,
++                                                      QWidget *parent = 0);
++
++    /**
++     * Creates a printer dialog for a QPrinter
++     *
++     * The caller takes ownership of the dialog and is responsible
++     * for deleting it.
++     *
++     * @param printer the QPrinter to apply settings to
++     * @param parent the parent for the dialog
++     */
++    KDEUI_EXPORT QPrintDialog *createPrintDialog(QPrinter *printer,
++                                                      QWidget *parent = 0);
++}
++
++
++#endif // KDEPRINTDIALOG_H
++
+--- a/kdeui/dialogs/kswitchlanguagedialog_p.cpp
++++ b/kdeui/dialogs/kswitchlanguagedialog_p.cpp
+@@ -21,8 +21,10 @@
+ 
+ #include "kswitchlanguagedialog_p.moc"
+ 
++#include <QtGui/QApplication>
+ #include <QtGui/QLayout>
+ #include <QtGui/QLabel>
++#include <QtCore/QEvent>
+ #include <QtCore/QMap>
+ 
+ #include <klanguagebutton.h>
+@@ -202,23 +204,17 @@
+ 
+ void KSwitchLanguageDialog::slotOk()
+ {
+-    QString languageString;
+-    bool first = true;
++    QStringList languages;
+ 
+     for ( int i = 0, count = d->languageButtons.count(); i < count; ++i )
+     {
+         KLanguageButton *languageButton = d->languageButtons[i];
+-
+-        if (!first)
+-        {
+-            languageString += ':';
+-        }
+-        languageString += languageButton->current();
+-        first = false;
++	languages << languageButton->current();
+     }
+ 
+-    if (d->applicationLanguageList().join(":") != languageString)
++    if (d->applicationLanguageList() != languages)
+     {
++        QString languageString = languages.join(":");
+         //list is different from defaults or saved languages list
+         KConfigGroup group(KGlobal::config(), "Locale");
+ 
+@@ -231,6 +227,10 @@
+             i18n("Application language changed"), //caption
+             "ApplicationLanguageChangedWarning" //dontShowAgainName
+             );
++
++	KGlobal::locale()->setLanguage(d->applicationLanguageList());
++        QEvent ev(QEvent::LanguageChange);
++        QApplication::sendEvent(qApp, &ev);
+     }
+ 
+     accept();
+@@ -269,7 +269,7 @@
+         KConfigGroup group(config, "Locale");
+         if (group.hasKey("Language"))
+         {
+-            languagesList = group.readEntry("Language", QStringList(), ':');
++            languagesList = group.readEntry("Language", QString()).split(':');
+         }
+     }
+     return languagesList.isEmpty() ? KGlobal::locale()->languageList() : languagesList;
+--- a/kdeui/dialogs/kbugreport.cpp
++++ b/kdeui/dialogs/kbugreport.cpp
+@@ -360,10 +360,10 @@
+   if (m_process) return;
+   m_process = new QProcess;
+   QObject::connect( m_process, SIGNAL(finished( int, QProcess::ExitStatus )), q, SLOT(_k_slotSetFrom()) );
+-  m_process->start( QString::fromLatin1("kcmshell"), QStringList() << QString::fromLatin1("kcm_useraccount") );
++  m_process->start( QString::fromLatin1("kcmshell4"), QStringList() << QString::fromLatin1("kcm_useraccount") );
+   if ( !m_process->waitForStarted() )
+   {
+-    kDebug() << "Couldn't start kcmshell..";
++    kDebug() << "Couldn't start kcmshell4..";
+     delete m_process;
+     m_process = 0;
+     return;
+--- a/kdeui/dialogs/kaboutapplicationdialog.cpp
++++ b/kdeui/dialogs/kaboutapplicationdialog.cpp
+@@ -152,14 +152,14 @@
+ 
+         QList<KAboutPerson> lst = aboutData->authors();
+         for (int i = 0; i < lst.size(); ++i) {
+-            authorPageText += QString("%1<p style=\"margin: 0px; margin-bottom: 10px; margin-left: 15px;\">").arg(lst.at(i).name());
++            authorPageText += QString("<p style=\"margin: 0px;\">%1</p>").arg(lst.at(i).name());
+             if (!lst.at(i).emailAddress().isEmpty())
+-                authorPageText += QString("<a href=\"mailto:%1\">%1</a><br />").arg(lst.at(i).emailAddress());
++                authorPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\"><a href=\"mailto:%1\">%1</a></p>").arg(lst.at(i).emailAddress());
+             if (!lst.at(i).webAddress().isEmpty())
+-                authorPageText += QString("<a href=\"%3\">%3</a><br />").arg(lst.at(i).webAddress());
++                authorPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\"><a href=\"%3\">%3</a></p>").arg(lst.at(i).webAddress());
+             if (!lst.at(i).task().isEmpty())
+-                authorPageText += QString("%4").arg(lst.at(i).task());
+-            authorPageText += "</p>";
++                authorPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\">%4</p>").arg(lst.at(i).task());
++            authorPageText += "<br />";
+         }
+ 
+         KTextBrowser *authorTextBrowser = new KTextBrowser;
+@@ -174,14 +174,14 @@
+ 
+         QList<KAboutPerson> lst = aboutData->credits();
+         for (int i = 0; i < lst.size(); ++i) {
+-            creditsPageText += QString("%1<p style=\"margin: 0px; margin-bottom: 10px; margin-left: 15px;\">").arg(lst.at(i).name());
++            creditsPageText += QString("<p style=\"margin: 0px;\">%1</p>").arg(lst.at(i).name());
+             if (!lst.at(i).emailAddress().isEmpty())
+-                creditsPageText += QString("<a href=\"mailto:%1\">%1</a><br />").arg(lst.at(i).emailAddress());
++                creditsPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\"><a href=\"mailto:%1\">%1</a></p>").arg(lst.at(i).emailAddress());
+             if (!lst.at(i).webAddress().isEmpty())
+-                creditsPageText += QString("<a href=\"%3\">%3</a><br />").arg(lst.at(i).webAddress());
++                creditsPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\"><a href=\"%3\">%3</a></p>").arg(lst.at(i).webAddress());
+             if (!lst.at(i).task().isEmpty())
+-                creditsPageText += QString("%4").arg(lst.at(i).task());
+-            creditsPageText += "</p>";
++                creditsPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\">%4</p>").arg(lst.at(i).task());
++            creditsPageText += "<br />";
+         }
+ 
+         KTextBrowser *creditsTextBrowser = new KTextBrowser;
+@@ -197,10 +197,10 @@
+ 
+         QList<KAboutPerson>::ConstIterator it;
+         for(it = translatorList.begin(); it != translatorList.end(); ++it) {
+-            translatorPageText += QString("%1<p style=\"margin: 0px; margin-bottom: 10px; margin-left: 15px;\">").arg((*it).name());
++            translatorPageText += QString("<p style=\"margin: 0px;\">%1</p>").arg((*it).name());
+             if (!(*it).emailAddress().isEmpty())
+-                translatorPageText += QString("<a href=\"mailto:%1\">%1</a>").arg((*it).emailAddress());
+-            translatorPageText += "</p>";
++                translatorPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\"><a href=\"mailto:%1\">%1</a></p>").arg((*it).emailAddress());
++            translatorPageText += "<br />";
+         }
+ 
+         translatorPageText += KAboutData::aboutTranslationTeam();
+--- a/kdeui/dialogs/kshortcutsdialog.cpp
++++ b/kdeui/dialogs/kshortcutsdialog.cpp
+@@ -83,10 +83,15 @@
+ };
+ 
+ 
+-enum myRoles {
++enum MyRoles {
+ 	ShortcutRole = Qt::UserRole,
+-	DefaultShortcutRole,
+-	ItemPointerRole = Qt::UserRole + 2342
++	DefaultShortcutRole
++};
++
++
++enum ItemTypes {
++	NonActionItem = 0,
++	ActionItem = 1
+ };
+ 
+ 
+@@ -134,13 +139,11 @@
+ 
+ 	void initGUI( KShortcutsEditor::ActionTypes actionTypes, KShortcutsEditor::LetterShortcuts allowLetterShortcuts );
+ 	void appendToView( uint nList, const QString &title = QString() );
+-
+-	static void readGlobalKeys( QMap< QString, KShortcut >& map );
+-
+-	KShortcutsEditorItem *itemFromIndex(const QModelIndex &index);
+-
++	//used in appendToView
+ 	QTreeWidgetItem *findOrMakeItem(QTreeWidgetItem *parent, const QString &name);
+ 
++	static KShortcutsEditorItem *itemFromIndex(QTreeWidget *const w, const QModelIndex &index);
++
+ 	//helper functions for conflict resolution
+ 	bool stealShortcut(KShortcutsEditorItem *item, unsigned int column, const QKeySequence &seq);
+ 	void wontStealStandardShortcut(KStandardShortcut::StandardShortcut sa, const QKeySequence &seq);
+@@ -168,7 +171,16 @@
+ };
+ 
+ 
+-KShortcutsEditorDelegate::KShortcutsEditorDelegate(QAbstractItemView *parent, bool allowLetterShortcuts)
++//a gross hack to make a protected method public
++class QTreeWidgetHack : public QTreeWidget
++{
++public:
++	QTreeWidgetItem *itemFromIndex(const QModelIndex &index) const
++		{ return QTreeWidget::itemFromIndex(index); }
++};
++
++
++KShortcutsEditorDelegate::KShortcutsEditorDelegate(QTreeWidget *parent, bool allowLetterShortcuts)
+  : KExtendableItemDelegate(parent),
+    m_allowLetterShortcuts(allowLetterShortcuts),
+    m_editor(0)
+@@ -208,11 +220,12 @@
+ 	const QAbstractItemModel *model = index.model();
+ 	if (!model)
+ 		return;
+-	KShortcutsEditorItem *item = model->data(index, ItemPointerRole)
+-	                                    .value<KShortcutsEditorItem *>();
++	//As per our constructor our parent *is* a QTreeWidget
++	QTreeWidget *view = static_cast<QTreeWidget *>(parent());
+ 
++	KShortcutsEditorItem *item = KShortcutsEditorPrivate::itemFromIndex(view, index);
+ 	if (!item) {
+-		//a non-leaf item
++		//that probably was a non-leaf (type() !=ActionItem) item
+ 		return;
+ 	}
+ 
+@@ -220,8 +233,6 @@
+ 	if (column == Name) {
+ 		index = model->index(index.row(), LocalPrimary, index.parent());
+ 		column = LocalPrimary;
+-		//As per KExtendableItemDelegate's constructor our parent *is* an abstract itemview
+-		QAbstractItemView *view = static_cast<QAbstractItemView *>(parent());
+ 		view->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
+ 	}
+ 
+@@ -229,9 +240,9 @@
+ 		//we only want maximum ONE extender open at any time.
+ 		if (m_editingIndex.isValid()) {
+ 			QModelIndex idx = model->index(m_editingIndex.row(), Name, m_editingIndex.parent());
+-			KShortcutsEditorItem *oldItem = model->data(idx, ItemPointerRole)
+-			                                       .value<KShortcutsEditorItem *>();
+-			Q_ASSERT(oldItem);
++			KShortcutsEditorItem *oldItem = KShortcutsEditorPrivate::itemFromIndex(view, idx);
++			Q_ASSERT(oldItem); //here we really expect nothing but a real KShortcutsEditorItem
++
+ 			oldItem->m_isNameBold = false;
+ 			contractItem(m_editingIndex);
+ 		}
+@@ -262,14 +273,30 @@
+ 		extendItem(m_editor, index);
+ 
+ 	} else {
++		//the item is extended, and clicking on it again closes it
+ 		item->m_isNameBold = false;
+ 		contractItem(index);
++		view->selectionModel()->select(index, QItemSelectionModel::Clear);
+ 		m_editingIndex = QModelIndex();
+ 		m_editor = 0;
+ 	}
+ }
+ 
+ 
++//slot
++void KShortcutsEditorDelegate::hiddenBySearchLine(QTreeWidgetItem *item, bool hidden)
++{
++	if (!hidden || !item) {
++		return;
++	}
++	QTreeWidget *view = static_cast<QTreeWidget *>(parent());
++	QTreeWidgetItem *editingItem = KShortcutsEditorPrivate::itemFromIndex(view, m_editingIndex);
++	if (editingItem == item) {
++		itemActivated(m_editingIndex); //this will *close* the item's editor because it's already open
++	}
++}
++
++
+ //Prevent clicks in the empty part of the editor widget from closing the editor
+ //because they would propagate to the itemview and be interpreted as a click in
+ //an item's rect. That in turn would lead to an itemActivated() call, closing
+@@ -527,13 +554,21 @@
+ 	//TODO listen to changes to global shortcuts
+ 	QObject::connect(delegate, SIGNAL(shortcutChanged(QVariant, const QModelIndex &)),
+ 	                 q, SLOT(capturedShortcut(QVariant, const QModelIndex &)));
++	//hide the editor widget chen its item becomes hidden
++	QObject::connect(ui.searchFilter->searchLine(), SIGNAL(hiddenChanged(QTreeWidgetItem *, bool)),
++	                 delegate, SLOT(hiddenBySearchLine(QTreeWidgetItem *, bool)));
+ }
+ 
+ 
+-//QTreeWidget::itemFromIndex is protected because... uhm... well, it just is.
+-KShortcutsEditorItem *KShortcutsEditorPrivate::itemFromIndex(const QModelIndex &index)
++//static
++KShortcutsEditorItem *KShortcutsEditorPrivate::itemFromIndex(QTreeWidget *const w,
++                                                             const QModelIndex &index)
+ {
+-	return ui.list->model()->data(index, ItemPointerRole).value<KShortcutsEditorItem *>();
++	QTreeWidgetItem *item = static_cast<QTreeWidgetHack *>(w)->itemFromIndex(index);
++	if (item && item->type() == ActionItem) {
++		return static_cast<KShortcutsEditorItem *>(item);
++	}
++	return 0;
+ }
+ 
+ 
+@@ -544,7 +579,7 @@
+ 		if (child->text(0) == name)
+ 			return child;
+ 	}
+-	QTreeWidgetItem *ret = new QTreeWidgetItem(parent);
++	QTreeWidgetItem *ret = new QTreeWidgetItem(parent, NonActionItem);
+ 	ret->setText(0, name);
+ 	ui.list->expandItem(ret);
+ 	ret->setFlags(ret->flags() & ~Qt::ItemIsSelectable);
+@@ -559,7 +594,8 @@
+ 	if (!index.isValid())
+ 		return;
+ 	int column = index.column();
+-	KShortcutsEditorItem *item = itemFromIndex(index);
++	KShortcutsEditorItem *item = itemFromIndex(ui.list, index);
++	Q_ASSERT(item);
+ 
+ 	if (column >= LocalPrimary && column <= GlobalAlternate)
+ 		changeKeyShortcut(item, column, newShortcut.value<QKeySequence>());
+@@ -790,7 +826,7 @@
+ 
+ //---------------------------------------------------
+ KShortcutsEditorItem::KShortcutsEditorItem(QTreeWidgetItem *parent, KAction *action)
+-	: QTreeWidgetItem(parent)
++	: QTreeWidgetItem(parent, ActionItem)
+ 	, m_action(action)
+ 	, m_isNameBold(false)
+ 	, m_oldLocalShortcut(0)
+@@ -816,7 +852,7 @@
+ 	case Qt::DisplayRole:
+ 		switch(column) {
+ 		case Name:
+-			return m_action->text().remove('&');
++			return i18nc("@item:intable Action name in shortcuts configuration", "%1", m_action->text().remove('&'));
+ 		case LocalPrimary:
+ 		case LocalAlternate:
+ 		case GlobalPrimary:
+@@ -839,7 +875,7 @@
+ 	case Qt::WhatsThisRole:
+ 		return m_action->whatsThis();
+ 	case Qt::ToolTipRole:
+-		return m_action->toolTip();
++		return i18nc("@info:tooltip Action tooltip in shortcuts configuration", "%1", m_action->toolTip());
+ 	case Qt::FontRole:
+ 		if (column == Name && m_isNameBold) {
+ 			QFont modifiedFont = treeWidget()->font();
+@@ -853,9 +889,6 @@
+ 		else
+ 			return true;
+ //the following are custom roles, defined in this source file only
+-	case ItemPointerRole:
+-		return QVariant::fromValue(const_cast<KShortcutsEditorItem *>(this));
+-
+ 	case ShortcutRole:
+ 		switch(column) {
+ 		case LocalPrimary:
+--- a/kdeui/dialogs/kinputdialog.cpp
++++ b/kdeui/dialogs/kinputdialog.cpp
+@@ -159,7 +159,12 @@
+     m_label = new QLabel(label, frame);
+     layout->addWidget(m_label);
+ 
+-    m_doubleSpinBox = new KDoubleSpinBox(minValue, maxValue, step, value, frame, decimals);
++    m_doubleSpinBox = new QDoubleSpinBox(frame);
++    m_doubleSpinBox->setRange(minValue, maxValue);
++    m_doubleSpinBox->setSingleStep(step);
++    m_doubleSpinBox->setValue(value);
++    m_doubleSpinBox->setDecimals(decimals);
++
+     layout->addWidget(m_doubleSpinBox);
+ 
+     layout->addStretch();
+@@ -303,7 +308,7 @@
+     return m_intSpinBox;
+ }
+ 
+-KDoubleSpinBox *KInputDialogHelper::doubleSpinBox() const
++QDoubleSpinBox *KInputDialogHelper::doubleSpinBox() const
+ {
+     return m_doubleSpinBox;
+ }
+@@ -446,7 +451,7 @@
+     if (_ok) {
+         if (editable)
+             result = dlg.comboBox()->currentText();
+-        else
++        else if( dlg.listBox()->currentItem())
+             result = dlg.listBox()->currentItem()->text();
+     }
+ 
+--- a/kdeui/jobs/kabstractwidgetjobtracker.cpp
++++ b/kdeui/jobs/kabstractwidgetjobtracker.cpp
+@@ -37,8 +37,8 @@
+     KAbstractWidgetJobTracker *const q;
+ 
+     struct MoreOptions {
+-        bool stopOnClose;
+-        bool autoDelete;
++        bool stopOnClose : 1;
++        bool autoDelete : 1;
+     };
+ 
+     QMap<KJob*, MoreOptions> moreOptions;
+--- a/kdeui/shortcuts/kdedglobalaccel_adaptor.h
++++ b/kdeui/shortcuts/kdedglobalaccel_adaptor.h
+@@ -52,6 +52,12 @@
+     inline KdedGlobalAccel *p()
+         { return static_cast<KdedGlobalAccel *>(parent()); }
+ public Q_SLOTS:
++    //get all registered keys (mainly for debugging)
++    inline QList<int> allKeys()
++        { return p()->allKeys(); }
++    //get all registered keys as strings (mainly for debugging)
++    inline QStringList allKeysAsString()
++        { return p()->allKeysAsString(); }
+     //get the action that has key registered for it
+     inline QStringList action(int key)
+         { return p()->actionId(key); }
+--- a/kdeui/shortcuts/kdedglobalaccel.desktop
++++ b/kdeui/shortcuts/kdedglobalaccel.desktop
+@@ -15,6 +15,7 @@
+ Name[de]=KDED Server für globale Aktionen
+ Name[el]=Εξυπηρετητής καθολικών συντομεύσεων KDED
+ Name[es]=Servidor de accesos rápidos globales KDED
++Name[et]=KDED globaalsete kiirklahvide server
+ Name[fa]=کارساز میان‌برهای سراسری KDED
+ Name[ga]=Freastalaí Aicearraí Comhchoiteanna KDED
+ Name[he]=שרת הקיצורים הגלובלי של KDED
+@@ -25,6 +26,9 @@
+ Name[km]=KDED ម៉ាស៊ីន​បម្រើ​ផ្លូវ​កាត់​សកល
+ Name[kn]=ಕೆಡಿಇಡಿ ಸಾರ್ವತ್ರಿಕ ಶೀಘ್ರಮಾರ್ಗಗಳ (ಶಾರ್ಟ್ ಕಟ್) ಪರಿಚಾರಕ (ಸರ್ವರ್)
+ Name[ko]=KDED 전역 단축키 서버
++Name[lt]=KDED globalinių trumpių serveris
++Name[lv]=KDED globālo īsceļu serveris
++Name[nb]=KDED tjener for globale snarveier
+ Name[nds]=KDED-Server för globaal Tastkombinatschonen
+ Name[ne]=KDED विश्वब्यापी सर्टकट सर्भर
+ Name[nl]=KDED globale-sneltoetsen-server
+@@ -32,8 +36,11 @@
+ Name[pt]=Servidor de Atalhos Globais do KDED
+ Name[pt_BR]=Servidor de Atalhos Globais do KDED
+ Name[sl]=Globalni strežnik za bližnjice KDED
++Name[sr]=Глобални сервер за пречице (КДЕД)
++Name[sr at latin]=Globalni server za prečice (KDED)
+ Name[sv]=KDED-server för globala genvägar
+ Name[th]=เซิรฟเวอร์คีย์ลัดระบบ KDED
++Name[uk]=Сервер глобальних скорочень KDED
+ Name[wa]=Sierveu di rascourtis globås po KDED
+ Name[x-test]=xxKDED Global Shortcuts Serverxx
+ Name[zh_CN]=KDED 全局快捷键服务器
+--- a/kdeui/shortcuts/kstandardshortcut.cpp
++++ b/kdeui/shortcuts/kstandardshortcut.cpp
+@@ -17,7 +17,6 @@
+     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
+ */
+-#define KSTDACCEL_CPP 1
+ 
+ #include "kstandardshortcut.h"
+ 
+@@ -87,8 +86,9 @@
+ 	{ Replace,             I18N_NOOP2("@action","Replace"), 0,  CTRL(R), 0, KShortcut(), false },
+ 
+ //Group Navigation
+-	{ Home,                I18N_NOOP2("@action Opposite to End","Home"), 0, CTRL(Home), Qt::Key_HomePage, KShortcut(), false },
+-	{ End,                 I18N_NOOP2("@action","End"), 0,      CTRL(End), 0, KShortcut(), false },
++	{ Home,                I18N_NOOP2("@action Go to main page","Home"), 0, ALT(Home), Qt::Key_HomePage, KShortcut(), false },
++	{ Begin,               I18N_NOOP2("@action Beginning of document","Begin"), 0, CTRL(Home), 0, KShortcut(), false },
++	{ End,                 I18N_NOOP2("@action End of document","End"), 0,      CTRL(End), 0, KShortcut(), false },
+ 	{ Prior,               I18N_NOOP2("@action","Prior"), 0,    Qt::Key_PageUp, 0,KShortcut(), false },
+ 	{ Next,                I18N_NOOP2("@action Opposite to Prior","Next"), 0, Qt::Key_PageDown, 0, KShortcut(), false },
+ 
+@@ -277,6 +277,7 @@
+ const KShortcut& findPrev()              { return shortcut( FindPrev ); }
+ const KShortcut& replace()               { return shortcut( Replace ); }
+ const KShortcut& home()                  { return shortcut( Home ); }
++const KShortcut& begin()                 { return shortcut( Begin ); }
+ const KShortcut& end()                   { return shortcut( End ); }
+ const KShortcut& beginningOfLine()       { return shortcut( BeginningOfLine ); }
+ const KShortcut& endOfLine()             { return shortcut( EndOfLine ); }
+@@ -308,5 +309,3 @@
+ const KShortcut& showMenubar()           { return shortcut( ShowMenubar ); }
+ 
+ }
+-
+-#undef KSTDACCEL_CPP
+--- a/kdeui/shortcuts/kstandardshortcut.h
++++ b/kdeui/shortcuts/kstandardshortcut.h
+@@ -36,11 +36,12 @@
+ { // STUFF WILL BREAK IF YOU DON'T READ THIS!!!
+   /*
+    *Always add new std-accels to the end of this enum, never in the middle!
+-   *Don't forget to add the corresponding entries in g_infoStandardShortcut[] in kstdaccel.cpp, too.
++   *Don't forget to add the corresponding entries in g_infoStandardShortcut[] in kstandardshortcut.cpp, too.
+    *Values of elements here and positions of the corresponding entries in
+    *the big array g_infoStandardShortcut[] ABSOLUTELY MUST BE THE SAME.
+    * !!!    !!!!   !!!!!    !!!!
+    *    !!!!    !!!     !!!!    !!!!
++   * Remember to also update kdoctools/genshortcutents.cpp.
+    */
+ 
+   /**
+@@ -60,7 +61,7 @@
+     SelectAll, Deselect, DeleteWordBack, DeleteWordForward,
+     Find, FindNext, FindPrev, Replace,
+     // Navigation
+-    Home, End, Prior, Next,
++    Home, Begin, End, Prior, Next,
+     Up, Back, Forward, Reload,
+     // Text Navigation
+     BeginningOfLine, EndOfLine, GotoLine,
+@@ -75,7 +76,11 @@
+     // Text completion
+     TextCompletion, PrevCompletion, NextCompletion, SubstringCompletion,
+ 
+-    RotateUp, RotateDown
++    RotateUp, RotateDown,
++
++    // Insert new items here!
++
++    StandardShortcutCount // number of standard shortcuts
+   };
+ 
+   /**
+@@ -273,12 +278,18 @@
+   KDEUI_EXPORT const KShortcut &insert();
+ 
+   /**
+-   * Goto beginning of the document. Default: Ctrl-Home
++   * Goto home page. Default: Alt-Home
+    * @return the shortcut of the standard accelerator
+    */
+   KDEUI_EXPORT const KShortcut &home();
+ 
+   /**
++   * Goto beginning of the document. Default: Ctrl-Home
++   * @return the shortcut of the standard accelerator
++   */
++  KDEUI_EXPORT const KShortcut &begin();
++
++  /**
+    * Goto end of the document. Default: Ctrl-End
+    * @return the shortcut of the standard accelerator
+    */
+--- a/kdeui/shortcuts/kdedglobalaccel.cpp
++++ b/kdeui/shortcuts/kdedglobalaccel.cpp
+@@ -21,6 +21,7 @@
+ 
+ 
+ #include "kdedglobalaccel.h"
++#include <kdebug.h>
+ #include "kdedglobalaccel_adaptor.h"
+ 
+ // For KGlobalAccelImpl
+@@ -31,7 +32,7 @@
+ #elif defined(Q_WS_WIN)
+ #include "kglobalaccel_win.h"
+ #else
+-#include "kglobalaccel_emb.h"
++#include "kglobalaccel_qws.h"
+ #endif
+ 
+ #include <QtCore/QHash>
+@@ -81,7 +82,7 @@
+     QList<actionData *> componentActions(const QString &mainComponentName);
+ 
+     //helpers
+-    static bool isEmpty(QList<int>);
++    static bool isEmpty(const QList<int>&);
+     static QList<int> nonemptyOnly(const QList<int> &);
+ 
+     KGlobalAccelImpl *impl;
+@@ -151,7 +152,7 @@
+ 
+ //return if a list of keys is *logically* empty
+ //static
+-bool KdedGlobalAccelPrivate::isEmpty(QList<int> keys)
++bool KdedGlobalAccelPrivate::isEmpty(const QList<int>& keys)
+ {
+     const int count = keys.count();
+     for (int i = 0; i < count; i++)
+@@ -200,6 +201,20 @@
+     delete d;
+ }
+ 
++QList<int> KdedGlobalAccel::allKeys()
++{
++    QList<int> ret = d->keyToAction.keys();
++    kDebug() << ret;
++    return ret;
++}
++
++QStringList KdedGlobalAccel::allKeysAsString()
++{
++    QStringList ret;
++    foreach(int keyQt, d->keyToAction.keys())
++        ret << QKeySequence(keyQt).toString();
++    return ret;
++}
+ 
+ QStringList KdedGlobalAccel::actionId(int key)
+ {
+@@ -236,8 +251,10 @@
+         if (!ad->isPresent && setPresent) {
+             ad->isPresent = true;
+             foreach (int key, ad->keys)
+-                if (key != 0)
++                if (key != 0) {
++                    Q_ASSERT(d->keyToAction.value(key) == ad);
+                     d->impl->grabKey(key, true);
++                }
+         }
+         ad->isDefaultEmpty = isDefaultEmpty;
+         return ad->keys;
+@@ -307,8 +324,10 @@
+     }
+ 
+     if (ad->isPresent)
+-        foreach (int key, added)
++        foreach (int key, added) {
++            Q_ASSERT(d->keyToAction.value(key) == ad);
+             d->impl->grabKey(key, true);
++        }
+ 
+     scheduleWriteSettings();
+ 
+@@ -468,7 +487,7 @@
+     QStringList data = ad->actionId;
+ #ifdef Q_WS_X11
+     // pass X11 timestamp
+-    data.append( QString::number( QX11Info::appTime()));
++    data.append(QString::number(QX11Info::appTime()));
+ #endif
+     emit invokeAction(data);
+     return true;
+--- a/kdeui/shortcuts/kdedglobalaccel.h
++++ b/kdeui/shortcuts/kdedglobalaccel.h
+@@ -43,6 +43,9 @@
+     KdedGlobalAccel();
+     ~KdedGlobalAccel();
+ 
++    QList<int> allKeys();
++    QStringList allKeysAsString();
++
+     QStringList actionId(int key);
+     //to be called by main components not owning the action
+     QList<int> shortcut(const QStringList &actionId);
+--- a/kdeui/actions/krecentfilesaction.cpp
++++ b/kdeui/actions/krecentfilesaction.cpp
+@@ -133,11 +133,11 @@
+         break;
+       }
+     }
+-    // remove last item if already maxitems in list
++    // remove oldest item if already maxitems in list
+     if( d->m_maxItems && selectableActionGroup()->actions().count() == d->m_maxItems )
+     {
+-        // remove last item
+-        delete removeAction(selectableActionGroup()->actions().last());
++        // remove oldest added item
++        delete removeAction(selectableActionGroup()->actions().first());
+     }
+ 
+     if (d->m_noEntriesAction) removeAction(d->m_noEntriesAction)->deleteLater();
+@@ -222,7 +222,7 @@
+     for( int i = 1 ; i <= d->m_maxItems ; i++ )
+     {
+         key = QString( "File%1" ).arg( i );
+-        value = cg.readPathEntry( key );
++        value = cg.readPathEntry( key, QString() );
+ 	if (value.isEmpty()) continue;
+         url = KUrl( value );
+ 
+--- a/kdeui/actions/kstandardaction.h
++++ b/kdeui/actions/kstandardaction.h
+@@ -135,7 +135,7 @@
+     Zoom, Redisplay,
+ 
+     // Go Menu
+-    Up, Back, Forward, Home, Prior, Next, Goto, GotoPage, GotoLine,
++    Up, Back, Forward, Home /*Home page*/, Prior, Next, Goto, GotoPage, GotoLine,
+     FirstPage, LastPage,
+ 
+     // Bookmarks Menu
+@@ -153,7 +153,7 @@
+     Help, HelpContents, WhatsThis, ReportBug, AboutApp, AboutKDE,
+     TipofDay,
+ 
+-    // Another settings menu item
++    // Other standard actions
+     ConfigureNotifications,
+     FullScreen,
+     Clear,
+--- a/kdeui/actions/kfontaction.cpp
++++ b/kdeui/actions/kfontaction.cpp
+@@ -9,6 +9,7 @@
+               (C) 2002 Joseph Wenninger <jowenn at kde.org>
+               (C) 2003 Andras Mantia <amantia at kde.org>
+               (C) 2005-2006 Hamish Rodda <rodda at kde.org>
++              (C) 2007 Clarence Dang <dang at kde.org>
+ 
+     This library is free software; you can redistribute it and/or
+     modify it under the terms of the GNU Library General Public
+@@ -40,17 +41,27 @@
+ {
+     public:
+         KFontActionPrivate(KFontAction *parent)
+-            : q(parent)
++            : q(parent),
++              settingFont(0)
+         {
+         }
+ 
+         void _k_slotFontChanged(const QFont &font)
+         {
++            kDebug(129) << "QFontComboBox - slotFontChanged("
++                        << font.family() << ") settingFont=" << settingFont;
++            if (settingFont)
++                return;
++
++            q->setFont(font.family());
+             q->triggered(font.family());
++
++            kDebug(129) << "\tslotFontChanged done";
+         }
+ 
+ 
+         KFontAction *q;
++        int settingFont;
+ };
+ 
+ KFontAction::KFontAction(uint fontListCriteria, QObject *parent)
+@@ -101,6 +112,8 @@
+ 
+ QWidget* KFontAction::createWidget(QWidget* _parent)
+ {
++    kDebug(129) << "KFontAction::createWidget()";
++
+     QToolBar *parent = qobject_cast<QToolBar *>(_parent);
+     if (!parent)
+         return KSelectAction::createWidget(_parent);
+@@ -108,7 +121,16 @@
+ #ifdef __GNUC__
+ #warning FIXME: items need to be converted
+ #endif
++    // This is the visual element on the screen.  This method overrides
++    // the KSelectAction one, preventing KSelectAction from creating its
++    // regular KComboBox.
+     QFontComboBox *cb = new QFontComboBox( parent );
++
++    kDebug(129) << "\tset=" << font();
++    // Do this before connecting the signal so that nothing will fire.
++    cb->setCurrentFont( QFont( font().toLower() ) );
++    kDebug(129) << "\tspit back=" << cb->currentFont().family();
++
+     connect( cb, SIGNAL( currentFontChanged( const QFont & ) ), SLOT(_k_slotFontChanged( const QFont&  ) ) );
+     cb->setMinimumWidth( cb->sizeHint().width() );
+     return cb;
+@@ -119,6 +141,26 @@
+  */
+ void KFontAction::setFont( const QString &family )
+ {
++    kDebug(129) << "KFontAction::setFont(" << family << ")";
++
++    // Supress triggered(QString) signal and prevent recursive call to ourself.
++    d->settingFont++;
++
++    foreach(QWidget *w, createdWidgets())
++    {
++        QFontComboBox *cb = qobject_cast<QFontComboBox *>(w);
++        kDebug(129) << "\tw=" << w << "cb=" << cb;
++
++        if(!cb) continue;
++
++        cb->setCurrentFont(QFont(family.toLower()));
++        kDebug(129) << "\t\tw spit back=" << cb->currentFont().family();
++    }
++
++    d->settingFont--;
++
++    kDebug(129) << "\tcalling setCurrentAction()";
++
+     QString lowerName = family.toLower();
+     if (setCurrentAction(lowerName, Qt::CaseInsensitive))
+        return;
+@@ -136,6 +178,8 @@
+     if (setCurrentAction(lowerName, Qt::CaseInsensitive))
+       return;
+ 
++    // TODO: Inconsistent state if QFontComboBox::setCurrentFont() succeeded
++    //       but setCurrentAction() did not and vice-versa.
+     kDebug(129) << "Font not found " << family.toLower();
+ }
+ 
+--- a/kdeui/actions/kactioncollection.cpp
++++ b/kdeui/actions/kactioncollection.cpp
+@@ -75,10 +75,11 @@
+ 
+   QList<QWidget*> associatedWidgets;
+ 
+-  bool configIsGlobal;
+   QString configGroup;
++  bool configIsGlobal : 1;
+ 
+-  bool connectTriggered, connectHighlighted;
++  bool connectTriggered : 1;
++  bool connectHighlighted : 1;
+ 
+   KActionCollection *q;
+ };
+--- a/kdeui/actions/kstandardaction.cpp
++++ b/kdeui/actions/kstandardaction.cpp
+@@ -81,7 +81,7 @@
+         break;
+ 
+       case Home:
+-        sLabel = i18nc( "beginning (of line)", "&Home" );
++        sLabel = i18nc( "home page", "&Home" );
+         break;
+       case Help:
+         sLabel = i18nc( "show help", "&Help" );
+@@ -108,10 +108,10 @@
+ 
+     if ( QApplication::isRightToLeft() ) {
+       if ( id == Prior )
+-        iconName = "find-next";
++        iconName = "edit-find-next";
+ 
+       if ( id == Next )
+-        iconName = "find-previous";
++        iconName = "edit-find-previous";
+     }
+ 
+     QIcon icon = iconName.isEmpty() ? KIcon() : KIcon(iconName);
+--- a/kdeui/actions/kselectaction_p.h
++++ b/kdeui/actions/kselectaction_p.h
+@@ -64,7 +64,8 @@
+ 
+   void init(KSelectAction*);
+ 
+-  bool m_edit, m_menuAccelsEnabled;
++  bool m_edit : 1;
++  bool m_menuAccelsEnabled : 1;
+   int m_comboWidth;
+   int m_maxComboViewCount;
+ 
+--- a/kdeui/actions/kstandardaction_p.h
++++ b/kdeui/actions/kstandardaction_p.h
+@@ -62,8 +62,8 @@
+   { SelectAll,     KStandardShortcut::SelectAll, "edit_select_all", I18N_NOOP("Select &All"), 0, 0 },
+   { Deselect,      KStandardShortcut::Deselect, "edit_deselect", I18N_NOOP("Dese&lect"), 0, 0 },
+   { Find,          KStandardShortcut::Find, "edit_find", I18N_NOOP("&Find..."), 0, "edit-find" },
+-  { FindNext,      KStandardShortcut::FindNext, "edit_find_next", I18N_NOOP("Find &Next"), 0, "find-next" },
+-  { FindPrev,      KStandardShortcut::FindPrev, "edit_find_prev", I18N_NOOP("Find Pre&vious"), 0, "find-previous" },
++  { FindNext,      KStandardShortcut::FindNext, "edit_find_next", I18N_NOOP("Find &Next"), 0, "edit-find-next" },
++  { FindPrev,      KStandardShortcut::FindPrev, "edit_find_prev", I18N_NOOP("Find Pre&vious"), 0, "edit-find-previous" },
+   { Replace,       KStandardShortcut::Replace, "edit_replace", I18N_NOOP("&Replace..."), 0, 0 },
+ 
+   { ActualSize,    KStandardShortcut::AccelNone, "view_actual_size", I18N_NOOP("&Actual Size"), 0, "zoom-original" },
+@@ -80,12 +80,12 @@
+   { Back,          KStandardShortcut::Back, "go_back", 0, 0, "go-previous" },
+   { Forward,       KStandardShortcut::Forward, "go_forward", 0, 0, "go-next" },
+   { Home,          KStandardShortcut::Home, "go_home", 0, 0, "go-home" },
+-  { Prior,         KStandardShortcut::Prior, "go_previous", I18N_NOOP("&Previous Page"), 0, "find-previous" },
+-  { Next,          KStandardShortcut::Next, "go_next", I18N_NOOP("&Next Page"), 0, "find-next" },
++  { Prior,         KStandardShortcut::Prior, "go_previous", I18N_NOOP("&Previous Page"), 0, "edit-find-previous" },
++  { Next,          KStandardShortcut::Next, "go_next", I18N_NOOP("&Next Page"), 0, "edit-find-next" },
+   { Goto,          KStandardShortcut::AccelNone, "go_goto", I18N_NOOP("&Go To..."), 0, 0 },
+   { GotoPage,      KStandardShortcut::AccelNone, "go_goto_page", I18N_NOOP("&Go to Page..."), 0, "go-jump" },
+   { GotoLine,      KStandardShortcut::GotoLine, "go_goto_line", I18N_NOOP("&Go to Line..."), 0, 0 },
+-  { FirstPage,     KStandardShortcut::Home, "go_first", I18N_NOOP("&First Page"), 0, "go-first" },
++  { FirstPage,     KStandardShortcut::Begin, "go_first", I18N_NOOP("&First Page"), 0, "go-first" },
+   { LastPage,      KStandardShortcut::End, "go_last", I18N_NOOP("&Last Page"), 0, "go-last" },
+ 
+   { AddBookmark,   KStandardShortcut::AddBookmark, "bookmark_add", I18N_NOOP("&Add Bookmark"), 0, "bookmark-new" },
+@@ -101,7 +101,7 @@
+   { KeyBindings,   KStandardShortcut::AccelNone, "options_configure_keybinding", I18N_NOOP("Configure S&hortcuts..."), 0,"configure-shortcuts" },
+   { Preferences,   KStandardShortcut::AccelNone, "options_configure", I18N_NOOP("&Configure %1..."), 0, "configure" },
+   { ConfigureToolbars, KStandardShortcut::AccelNone, "options_configure_toolbars", I18N_NOOP("Configure Tool&bars..."), 0,"configure-toolbars" },
+-  { ConfigureNotifications, KStandardShortcut::AccelNone, "options_configure_notifications", I18N_NOOP("Configure &Notifications..."), 0, "knotify" },
++  { ConfigureNotifications, KStandardShortcut::AccelNone, "options_configure_notifications", I18N_NOOP("Configure &Notifications..."), 0, "preferences-desktop-notification" },
+ 
+   // the idea here is that Contents is used in menus, and Help in dialogs, so both share the same
+   // shortcut
+--- a/kdeui/plotting/kplotaxis.cpp
++++ b/kdeui/plotting/kplotaxis.cpp
+@@ -38,8 +38,8 @@
+ 
+         KPlotAxis *q;
+ 
+-        bool m_visible; // Property "visible" defines if Axis is drawn or not.
+-        bool m_showTickLabels;
++        bool m_visible : 1; // Property "visible" defines if Axis is drawn or not.
++        bool m_showTickLabels : 1;
+         char m_labelFmt; // Number format for number labels, see QString::arg()
+         QString m_label; // The label of the axis.
+         int m_labelFieldWidth; // Field width for number labels, see QString::arg()
+--- a/kdeui/plotting/kplotwidget.cpp
++++ b/kdeui/plotting/kplotwidget.cpp
+@@ -84,7 +84,9 @@
+     //Colors
+     QColor cBackground, cForeground, cGrid;
+     //draw options
+-    bool showGrid, showObjectToolTip, useAntialias;
++    bool showGrid : 1;
++    bool showObjectToolTip : 1;
++    bool useAntialias : 1;
+     //padding
+     int leftPadding, rightPadding, topPadding, bottomPadding;
+     // hashmap with the axes we have
+--- a/kdeui/colors/kcolordialog.cpp
++++ b/kdeui/colors/kcolordialog.cpp
+@@ -97,6 +97,7 @@
+     { "Recent_Colors", I18N_NOOP2( "palette name", "* Recent Colors *" ) },
+     { "Custom_Colors", I18N_NOOP2( "palette name", "* Custom Colors *" ) },
+     { "40.colors",     I18N_NOOP2( "palette name", "Forty Colors" ) },
++    { "Oxygen.colors", I18N_NOOP2( "palette name", "Oxygen Colors" ) },
+     { "Rainbow.colors",I18N_NOOP2( "palette name", "Rainbow Colors" ) },
+     { "Royal.colors",  I18N_NOOP2( "palette name", "Royal Colors" ) },
+     { "Web.colors",    I18N_NOOP2( "palette name", "Web Colors" ) },
+@@ -1154,7 +1155,7 @@
+   button->setIcon( KIcon("color-picker"));
+   int commonHeight = addButton->sizeHint().height();
+   button->setMinimumHeight( commonHeight );
+-  kDebug() << commonHeight;
++  //kDebug() << commonHeight;
+   button->setIconSize(QSize(commonHeight, commonHeight));
+   l_hbox->addWidget(button, 0, Qt::AlignHCenter );
+   connect( button, SIGNAL( clicked()), SLOT( slotColorPicker()));
+--- a/kdeui/colors/kcolorcombo.cpp
++++ b/kdeui/colors/kcolorcombo.cpp
+@@ -155,7 +155,7 @@
+ K_GLOBAL_STATIC_WITH_ARGS(QVector<QColor>, standardPalette, (STANDARD_PAL_SIZE))
+ static void createStandardPalette()
+ {
+-    if ( standardPalette )
++    if ( standardPalette->isEmpty() )
+         return;
+ 
+     int i = 0;
+--- a/kdeui/colors/kcolorbutton.cpp
++++ b/kdeui/colors/kcolorbutton.cpp
+@@ -44,9 +44,9 @@
+ 
+     KColorButton *q;
+     QColor m_defaultColor;
+-    bool m_bdefaultColor;
++    bool m_bdefaultColor : 1;
+ 
+-    bool dragFlag;
++    bool dragFlag : 1;
+     QColor col;
+     QPoint mPos;
+ 
+--- /dev/null
++++ b/kdeui/colors/Oxygen.colors
+@@ -0,0 +1,129 @@
++GIMP Palette
++Name: Oxygen 
++#
++56  37    9	wood brown6 
++87  64   30	wood brown5
++117 81   26	wood brown4
++143 107	 50	wood brown3
++179 146  93	wood brown2
++222 188 133	wood brown1
++156  15  15	brick red6
++191   3   3	brick red5
++226   8   0	brick red4
++232  87  82	brick red3
++240 134 130	brick red2
++249 204 202	brick red1
++156  15  86	raspberry pink6
++191   3  97	raspberry pink5
++226   0 113	raspberry pink4
++232  82 144	raspberry pink3
++240 130 176	raspberry pink2
++249 202 222	raspberry pink1
++106   0  86	burgundy purple6
++133   2 108	burgundy purple5
++160  39 134	burgundy purple4
++177  79 154	burgundy purple3
++193 115 176     burgundy purple2
++232 183 215     burgundy purple1
++ 29   10 85     grape violet6
++ 52  23 110     grape violet5
++ 70  40 134     grape violet4
++100  74 155     grape violet3
++142 121 165     grape violet2
++195 180 218     grape violet1
++  0  49 110     skyblue6
++  0  67 138     skyblue5
++  0  87 174     skyblue4
++ 44 114 199     skyblue3
++ 97 147 207     skyblue2
++164 192 228     skyblue1
++  0  72  77     sea blue6
++  0  96 102     sea blue5
++  0 120 128     sea blue4
++  0 167 179     sea blue3
++  0 196 204     sea blue2
++168 221 224     sea blue1
++  0   88 63     emerald green6
++  0 115  77     emerald green5
++  0 153 102     emerald green4
++  0 179 119     emerald green3
++  0 204 136     emerald green2
++153 220 198     emerald green1
++ 0  110  41     forest green6
++ 0  137  44     forest green5
++ 55 164  44     forest green4
++119 183  83     forest green3
++177 210 143     forest green2
++216 232 194     forest green1
++227 173   0     sun yellow6
++243 195   0     sun yellow5
++255 221   0     sun yellow4
++255 235  85     sun yellow3
++255 242 153     sun yellow2
++255 246 200     sun yellow1
++172  67  17     hot orange6
++207  73  19     hot orange5
++235 115  49     hot orange4
++242 155 104     hot orange3
++242 187 136     hot orange2
++255 217 176     hot orange1
++ 46  52  54     aluminum gray6
++ 85  87  83     aluminum gray5
++136 138 133     aluminum gray4
++186 189 182     aluminum gray3
++211 215 207     aluminum gray2
++238 238 236     aluminum gray1
++ 77  38   0	brown orange6
++128  63   0	brown orange5
++191  94   0	brown orange4
++255 126   0	brown orange3
++255 191 128	brown orange2
++255 223 191	brown orange1
++ 89   0   0	red6
++140   0   0	red5
++191   0   0	red4
++255   0   0	red3
++255 128 128	red2
++255 191 191	red1
++115   0  85	pink6
++163   0 123	pink5
++204   0 154	pink4
++255   0 191	pink3
++255 128 223	pink2
++255 191 240	pink1
++ 44   0  89	purple6
++ 64   0 128	purple5
++ 90   0 179	purple4
++128   0	255	purple3
++192 128 255	purple2
++223 191 255	purple1
++  0   0 128	blue6
++  0   0 191	blue5
++  0   0 255	blue4
++  0 102 255	blue3
++128 179 255	blue2
++191 217 255	blue1
++  0  77   0	green6
++  0 140   0	green5
++  0 191   0	green4
++  0 255   0	green3
++128 255 128	green2
++191 255 191	green1
++ 99 128   0	lime6
++139 179   0	lime5
++191 245   0	lime4
++229 255   0	lime3
++240 255 128	lime2
++248 255 191	lime1
++255 170   0	yellow6
++255 191   0	yellow5
++255 213   0	yellow4
++255 255   0	yellow3
++255 255 153	yellow2
++255 255 191	yellow1
++ 50  50  50	gray6
++ 85  85  85	gray5
++136 136 136	gray4
++187 187 187	gray3
++221 221 221	gray2
++238 238 238	gray1
+--- a/kdeui/tests/kxmlguitest.cpp
++++ b/kdeui/tests/kxmlguitest.cpp
+@@ -47,7 +47,7 @@
+     a = new KAction( KIcon( "view-left-right" ), "Split", shell );
+     shell->actionCollection()->addAction( "splitviewh", a );
+ 
+-    shell->setXMLFile( "./kxmlguitest_shell.rc" );
++    shell->setXMLFile( KDESRCDIR "/kxmlguitest_shell.rc" );
+ 
+     factory->addClient( shell );
+ 
+@@ -60,7 +60,7 @@
+     a->setShortcut( KShortcut(Qt::ALT + Qt::Key_1), KAction::DefaultShortcut );
+     a->connect( a, SIGNAL(triggered(bool)), part, SLOT( slotSec() ) );
+ 
+-    part->setXMLFile( "./kxmlguitest_part.rc" );
++    part->setXMLFile( KDESRCDIR "/kxmlguitest_part.rc" );
+ 
+     factory->addClient( part );
+     for ( int i = 0; i < 10; ++i )
+--- a/kdeui/tests/ktabwidgettest.cpp
++++ b/kdeui/tests/ktabwidgettest.cpp
+@@ -193,7 +193,7 @@
+     if ( !mRightWidget) {
+       mRightWidget = new QToolButton( mWidget );
+       QObject::connect( mRightWidget, SIGNAL( clicked() ), SLOT( removeCurrentTab() ) );
+-      mRightWidget->setIcon( SmallIcon( "tab-remove" ) );
++      mRightWidget->setIcon( SmallIcon( "tab-close" ) );
+       mRightWidget->setText("Close");
+       mRightWidget->setToolTip("Close");
+       mRightWidget->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+@@ -213,10 +213,10 @@
+   if (state) {
+     if (!mRightPopup) {
+       mRightPopup = new QMenu(this);
+-      mRightPopup->addAction(SmallIcon( "tab-remove" ), "Current Tab");
++      mRightPopup->addAction(SmallIcon( "tab-close" ), "Current Tab");
+       mRightPopup->addSeparator();
+-      mRightPopup->addAction(SmallIcon( "tab-remove" ), "Most Left Tab");
+-      mRightPopup->addAction(SmallIcon( "tab-remove" ), "Most Right Tab");
++      mRightPopup->addAction(SmallIcon( "tab-close" ), "Most Left Tab");
++      mRightPopup->addAction(SmallIcon( "tab-close" ), "Most Right Tab");
+       connect(mRightPopup, SIGNAL(triggered(QAction*)), SLOT(rightPopupActivated(QAction*)));
+     }
+     mRightWidget->setMenu(mRightPopup);
+@@ -308,7 +308,7 @@
+ 
+   mTabbarContextPopup = new QMenu(this);
+   mTabbarContextPopup->addAction(SmallIcon( "tab-new" ), mLeftWidget->isVisible() ? "Hide \"Add\" Button" : "Show \"Add\" Button");
+-  mTabbarContextPopup->addAction(SmallIcon( "tab-remove" ), mRightWidget->isVisible() ? "Hide \"Remove\" Button" : "Show \"Remove\" Button");
++  mTabbarContextPopup->addAction(SmallIcon( "tab-close" ), mRightWidget->isVisible() ? "Hide \"Remove\" Button" : "Show \"Remove\" Button");
+   mTabbarContextPopup->addSeparator();
+   mTabbarContextPopup->addAction(mWidget->tabPosition()==QTabWidget::North ? "Put Tabbar to Bottom" : "Put Tabbar to Top");
+   connect(mTabbarContextPopup, SIGNAL(triggered(QAction*)), SLOT(tabbarContextMenuActivated(QAction*)));
+--- a/kdeui/config/kconfigskeleton.cpp
++++ b/kdeui/config/kconfigskeleton.cpp
+@@ -141,7 +141,7 @@
+ 
+ void KConfigSkeletonItem::readImmutability( const KConfigGroup &group )
+ {
+-  d->mIsImmutable = group.entryIsImmutable( mKey );
++  d->mIsImmutable = group.isEntryImmutable( mKey );
+ }
+ 
+ 
+@@ -937,7 +937,7 @@
+   if ( !cg.hasKey( mKey ) )
+     mReference = mDefault;
+   else
+-    mReference = cg.readPathListEntry( mKey );
++    mReference = cg.readPathEntry( mKey, QStringList() );
+   mLoadedValue = mReference;
+ 
+   readImmutability( cg );
+--- a/kdeui/xmlgui/ui_standards.rc
++++ b/kdeui/xmlgui/ui_standards.rc
+@@ -80,7 +80,7 @@
+     <Separator/>
+     <MergeLocal/>
+   </Menu>
+-  <Menu name="move"><text>&amp;Move</text>
++  <Menu name="move"><text context="@title:menu Game move">&amp;Move</text>
+     <Action name="move_repeat"/>
+     <Action name="move_undo"/>
+     <Action name="move_redo"/>
+--- a/kdeui/xmlgui/kxmlguifactory.cpp
++++ b/kdeui/xmlgui/kxmlguifactory.cpp
+@@ -536,14 +536,20 @@
+ 
+     QVariant::Type propertyType = action->property( attrName.toLatin1() ).type();
+ 
+-    if ( propertyType == QVariant::Int )
++    if ( propertyType == QVariant::Int ) {
+         propertyValue = QVariant( attribute.value().toInt() );
+-    else if ( propertyType == QVariant::UInt )
++    } else if ( propertyType == QVariant::UInt ) {
+         propertyValue = QVariant( attribute.value().toUInt() );
+-    else if ( propertyType == QVariant::UserType && action->property( attrName.toLatin1() ).userType() == qMetaTypeId<KShortcut>() )
++    } else if ( propertyType == QVariant::UserType && action->property( attrName.toLatin1() ).userType() == qMetaTypeId<KShortcut>() ) {
++        // Setting the shortcut by property also sets the default shortcut (which is incorrect), so we have to do it directly
++        if (KAction* ka = qobject_cast<KAction*>(action)) {
++            ka->setShortcut(KShortcut(attribute.value()), KAction::ActiveShortcut);
++            return;
++        }
+         propertyValue =  KShortcut( attribute.value() )  ;
+-    else
++    } else {
+         propertyValue = QVariant( attribute.value() );
++    }
+     action->setProperty( attrName.toLatin1(), propertyValue );
+ }
+ 
+--- a/kdeui/xmlgui/kxmlguiwindow.cpp
++++ b/kdeui/xmlgui/kxmlguiwindow.cpp
+@@ -312,6 +312,12 @@
+         KStatusBar *sb = statusBar(); // Creates statusbar if it doesn't exist already.
+         connect(d->showStatusBarAction, SIGNAL(toggled(bool)), sb, SLOT(setVisible(bool)));
+         d->showStatusBarAction->setChecked(sb->isHidden());
++    } else {
++        // If the language has changed, we'll need to grab the new text and whatsThis
++	KAction *tmpStatusBar = KStandardAction::showStatusbar(NULL, NULL, NULL);
++        d->showStatusBarAction->setText(tmpStatusBar->text());
++        d->showStatusBarAction->setWhatsThis(tmpStatusBar->whatsThis());
++	delete tmpStatusBar;
+     }
+ }
+ 
+--- a/kdeui/xmlgui/kxmlguifactory_p.cpp
++++ b/kdeui/xmlgui/kxmlguifactory_p.cpp
+@@ -55,12 +55,12 @@
+ ContainerNode::ContainerNode( QWidget *_container, const QString &_tagName,
+                               const QString &_name, ContainerNode *_parent,
+                               KXMLGUIClient *_client, KXMLGUIBuilder *_builder,
+-                              int id, const QString &_mergingName,
++                              QAction* _containerAction, const QString &_mergingName,
+                               const QString &_groupName, const QStringList &customTags,
+                               const QStringList &containerTags )
+     : parent( _parent ), client( _client ), builder( _builder ),
+       builderCustomTags( customTags ), builderContainerTags( containerTags ),
+-      container( _container ), containerId( id ), tagName( _tagName ), name( _name ),
++      container( _container ), containerAction( _containerAction ), tagName( _tagName ), name( _name ),
+       groupName( _groupName ), index( 0 ), mergingName( _mergingName )
+ {
+     if ( parent )
+@@ -342,7 +342,7 @@
+ 
+         assert( builder );
+ 
+-        builder->removeContainer( container, parentContainer, element, containerId );
++        builder->removeContainer( container, parentContainer, element, containerAction );
+ 
+         client = 0L;
+ 
+@@ -762,11 +762,11 @@
+ 
+         int idx = calcMergingIndex( e, it, group );
+ 
+-        int id;
++        QAction* containerAction;
+ 
+         KXMLGUIBuilder *builder;
+ 
+-        QWidget *container = createContainer( parentNode->container, idx, e, id, &builder );
++        QWidget *container = createContainer( parentNode->container, idx, e, containerAction, &builder );
+ 
+         // no container? (probably some <text> tag or so ;-)
+         if ( !container )
+@@ -791,7 +791,7 @@
+         }
+ 
+         containerNode = new ContainerNode( container, tag, name, parentNode,
+-                                           m_state.guiClient, builder, id,
++                                           m_state.guiClient, builder, containerAction,
+                                            mergingName, group, cusTags, conTags );
+     }
+ 
+@@ -804,14 +804,14 @@
+ }
+ 
+ QWidget *BuildHelper::createContainer( QWidget *parent, int index,
+-                                       const QDomElement &element, int &id,
++                                       const QDomElement &element, QAction*& containerAction,
+                                        KXMLGUIBuilder **builder )
+ {
+     QWidget *res = 0L;
+ 
+     if ( m_state.clientBuilder )
+     {
+-        res = m_state.clientBuilder->createContainer( parent, index, element, id );
++        res = m_state.clientBuilder->createContainer( parent, index, element, containerAction );
+ 
+         if ( res )
+         {
+@@ -825,7 +825,7 @@
+ 
+     m_state.builder->setBuilderClient( m_state.guiClient );
+ 
+-    res = m_state.builder->createContainer( parent, index, element, id );
++    res = m_state.builder->createContainer( parent, index, element, containerAction );
+ 
+     m_state.builder->setBuilderComponentData(oldInstance);
+     m_state.builder->setBuilderClient( oldClient );
+--- a/kdeui/xmlgui/kxmlguibuilder.cpp
++++ b/kdeui/xmlgui/kxmlguibuilder.cpp
+@@ -18,9 +18,6 @@
+    Boston, MA 02110-1301, USA.
+ */
+ 
+-#define QT3_SUPPORT
+-#define QT3_SUPPORT_WARNINGS
+-
+ #include "kxmlguibuilder.h"
+ 
+ #include "kapplication.h"
+@@ -125,33 +122,27 @@
+   return res;
+ }
+ 
+-QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDomElement &element, int &id )
++QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDomElement &element, QAction*& containerAction )
+ {
+-  id = -1;
+-  if ( element.tagName().toLower() == d->tagMainWindow )
+-  {
+-    KMainWindow *mainwindow = 0;
+-    if ( qobject_cast<KMainWindow*>( d->m_widget ) )
+-      mainwindow = static_cast<KMainWindow *>(d->m_widget);
+-
+-    return mainwindow;
+-  }
+-
+-  if ( element.tagName().toLower() == d->tagMenuBar )
+-  {
+-    KMenuBar *bar;
+-
+-    if ( qobject_cast<KMainWindow*>( d->m_widget ) )
+-      bar = static_cast<KMainWindow *>(d->m_widget)->menuBar();
+-    else
+-      bar = new KMenuBar( d->m_widget );
+-
+-    bar->show();
+-    return bar;
+-  }
++    containerAction = 0;
++    const QString tagName = element.tagName().toLower();
++    if ( tagName == d->tagMainWindow ) {
++        KMainWindow *mainwindow = qobject_cast<KMainWindow*>( d->m_widget ); // could be 0
++        return mainwindow;
++    }
++
++    if ( tagName == d->tagMenuBar ) {
++        KMainWindow *mainWin = qobject_cast<KMainWindow*>( d->m_widget );
++        KMenuBar *bar = 0;
++        if (mainWin)
++            bar = mainWin->menuBar();
++        if (!bar)
++            bar = new KMenuBar( d->m_widget );
++        bar->show();
++        return bar;
++    }
+ 
+-  if ( element.tagName().toLower() == d->tagMenu )
+-  {
++  if ( tagName == d->tagMenu ) {
+     // Look up to see if we are inside a mainwindow. If yes, then
+     // use it as parent widget (to get kaction to plug itself into the
+     // mainwindow). Don't use a popupmenu as parent widget, otherwise
+@@ -176,8 +167,8 @@
+     QDomElement textElem = element.namedItem( d->attrText1 ).toElement();
+     if ( textElem.isNull() ) // try with capital T
+       textElem = element.namedItem( d->attrText2 ).toElement();
+-    QByteArray text = textElem.text().toUtf8();
+-    QByteArray context = textElem.attribute(d->attrContext).toUtf8();
++    const QByteArray text = textElem.text().toUtf8();
++    const QByteArray context = textElem.attribute(d->attrContext).toUtf8();
+ 
+     if ( text.isEmpty() ) // still no luck
+       i18nText = i18n( "No text" );
+@@ -186,33 +177,28 @@
+     else
+       i18nText = i18nc( context, text );
+ 
+-    QString icon (element.attribute( d->attrIcon ));
++    const QString icon = element.attribute( d->attrIcon );
+     KIcon pix;
+-
+     if (!icon.isEmpty()) {
+         pix = KIcon( icon );
+     }
+ 
+-    if ( parent && qobject_cast<KMenuBar*>( parent ) )
+-    {
+-      if ( !icon.isEmpty() )
+-        id = static_cast<KMenuBar *>(parent)->insertItem( pix, i18nText, popup, -1, index );
+-      else
+-        id = static_cast<KMenuBar *>(parent)->insertItem( i18nText, popup, -1, index );
+-    }
+-    else if ( parent && qobject_cast<QMenu*>( parent ) )
+-    {
+-      if ( !icon.isEmpty() )
+-        id = static_cast<QMenu *>(parent)->insertItem( pix, i18nText, popup, -1, index );
+-      else
+-        id = static_cast<QMenu *>(parent)->insertItem( i18nText, popup, -1, index );
++    if ( parent ) {
++        QAction* act = popup->menuAction();
++        if ( !icon.isEmpty() )
++            act->setIcon(pix);
++        act->setText(i18nText);
++        if (index == -1 || index >= parent->actions().count())
++            parent->addAction(act);
++        else
++            parent->insertAction(parent->actions().value(index), act);
++        containerAction = act;
+     }
+ 
+     return popup;
+   }
+ 
+-  if ( element.tagName().toLower() == d->tagToolBar )
+-  {
++  if ( tagName == d->tagToolBar ) {
+     bool honor = (element.attribute( d->attrName ) == "mainToolBar");
+ 
+     QByteArray name = element.attribute( d->attrName ).toUtf8();
+@@ -235,33 +221,27 @@
+     return bar;
+   }
+ 
+-  if ( element.tagName().toLower() == d->tagStatusBar )
+-  {
+-      if ( qobject_cast<KMainWindow*>( d->m_widget ) )
+-    {
+-      KMainWindow *mainWin = static_cast<KMainWindow *>(d->m_widget);
+-      mainWin->statusBar()->show();
+-      return mainWin->statusBar();
+-    }
+-    KStatusBar *bar = new KStatusBar( d->m_widget );
+-    return bar;
++  if ( tagName == d->tagStatusBar ) {
++      KMainWindow *mainWin = qobject_cast<KMainWindow *>(d->m_widget);
++      if ( mainWin ) {
++          mainWin->statusBar()->show();
++          return mainWin->statusBar();
++      }
++      KStatusBar *bar = new KStatusBar( d->m_widget );
++      return bar;
+   }
+ 
+   return 0L;
+ }
+ 
+-void KXMLGUIBuilder::removeContainer( QWidget *container, QWidget *parent, QDomElement &element, int id )
++void KXMLGUIBuilder::removeContainer( QWidget *container, QWidget *parent, QDomElement &element, QAction* containerAction )
+ {
+   // Warning parent can be 0L
+ 
+   if ( qobject_cast<QMenu*>( container ) )
+   {
+-    if ( parent )
+-    {
+-        if ( qobject_cast<KMenuBar*>( parent ) )
+-            static_cast<KMenuBar *>(parent)->removeItem( id );
+-        else if ( qobject_cast<QMenu*>( parent ) )
+-            static_cast<QMenu *>(parent)->removeItem( id );
++    if ( parent ) {
++        parent->removeAction( containerAction );
+     }
+ 
+     delete container;
+--- a/kdeui/xmlgui/kxmlguifactory_p.h
++++ b/kdeui/xmlgui/kxmlguifactory_p.h
+@@ -108,7 +108,7 @@
+ {
+     ContainerNode( QWidget *_container, const QString &_tagName, const QString &_name,
+                    ContainerNode *_parent = 0L, KXMLGUIClient *_client = 0L,
+-                   KXMLGUIBuilder *_builder = 0L, int id = -1,
++                   KXMLGUIBuilder *_builder = 0L, QAction* containerAction = 0,
+                    const QString &_mergingName = QString(),
+                    const QString &groupName = QString(),
+                    const QStringList &customTags = QStringList(),
+@@ -121,7 +121,7 @@
+     QStringList builderCustomTags;
+     QStringList builderContainerTags;
+     QWidget *container;
+-    int containerId;
++    QAction* containerAction;
+ 
+     QString tagName;
+     QString name;
+@@ -201,7 +201,7 @@
+ 
+ 
+     QWidget *createContainer( QWidget *parent, int index, const QDomElement &element,
+-                              int &id, KXMLGUIBuilder **builder );
++                              QAction*& containerAction, KXMLGUIBuilder **builder );
+ 
+     int calcMergingIndex( const QDomElement &element, MergingIndexList::Iterator &it, QString &group );
+ 
+--- a/kdeui/xmlgui/kxmlguibuilder.h
++++ b/kdeui/xmlgui/kxmlguibuilder.h
+@@ -32,10 +32,11 @@
+ class QWidget;
+ 
+ /**
+- * Abstract interface for a "GUI builder", used by the GUIFactory
+- * This interface is implemented by KMainWindow for the case where
+- * the toplevel widget is a KMainWindow. Other implementations may appear
+- * in the future (dialogs for instance)
++ * Implements the creation of the GUI (menubar, menus and toolbars)
++ * as requested by the GUI factory.
++ *
++ * The virtual methods are mostly for historical reasons, there isn't really
++ * a need to derive from KXMLGUIBuilder anymore.
+  */
+ class KDEUI_EXPORT KXMLGUIBuilder
+ {
+@@ -67,10 +68,10 @@
+    * @param element The element from the DOM tree describing the
+    *                container (use it to access container specified
+    *                attributes or child elements)
+-   * @param id The id to be used for this container
++   * @param action The action created for this container; used for e.g. passing to removeContainer.
+    */
+   virtual QWidget *createContainer( QWidget *parent, int index,
+-          const QDomElement &element, int &id );
++          const QDomElement &element, QAction* &containerAction );
+ 
+   /**
+    * Removes the given (and previously via createContainer )
+@@ -78,7 +79,7 @@
+    *
+    */
+   virtual void removeContainer( QWidget *container, QWidget *parent,
+-				QDomElement &element, int id );
++				QDomElement &element, QAction* containerAction );
+ 
+   virtual QStringList customTags() const;
+ 
+--- a/kdeui/sonnet/highlighter.cpp
++++ b/kdeui/sonnet/highlighter.cpp
+@@ -88,7 +88,7 @@
+     d->loader->settings()->restore(&conf);
+     d->filter->setSettings(d->loader->settings());
+     d->dict   = new Sonnet::Speller();
+-    if(d->dict->isValid()) {
++    if(!d->dict->isValid()) {
+ 	d->spellCheckerFound = false;
+     } else {
+         d->dictCache.insert(d->dict->language(),
+--- a/kdeui/widgets/knuminput.h
++++ b/kdeui/widgets/knuminput.h
+@@ -1,6 +1,6 @@
+ /* This file is part of the KDE libraries
+  *  Copyright (c) 1997 Patrick Dowler <dowler at morgul.fsh.uvic.ca>
+- *  Copyright (c) 2000 Dirk A. Mueller <mueller at kde.org>
++ *  Copyright (c) 2000 Dirk Mueller <mueller at kde.org>
+  *  Copyright (c) 2002 Marc Mutz <mutz at kde.org>
+  *
+  *  This library is free software; you can redistribute it and/or
+@@ -419,7 +419,7 @@
+     Q_PROPERTY( QString suffix READ suffix WRITE setSuffix )
+     Q_PROPERTY( QString prefix READ prefix WRITE setPrefix )
+     Q_PROPERTY( QString specialValueText READ specialValueText WRITE setSpecialValueText )
+-    Q_PROPERTY( int precision READ precision WRITE setPrecision )
++    Q_PROPERTY( int decimals READ decimals WRITE setDecimals )
+     Q_PROPERTY( double referencePoint READ referencePoint WRITE setReferencePoint )
+     Q_PROPERTY( double relativeValue READ relativeValue  WRITE setRelativeValue )
+ 
+@@ -492,10 +492,10 @@
+     QString prefix() const;
+ 
+     /**
+-     * @return the precision.
+-     * @see setPrecision()
++     * @return number of decimals.
++     * @see setDecimals()
+      */
+-    int precision() const;
++    int decimals() const;
+ 
+     /**
+      * @return the string displayed for a special value.
+@@ -530,7 +530,9 @@
+     /**
+      * Specifies the number of digits to use.
+      */
+-    void setPrecision(int precision);
++    void setDecimals(int decimals);
++
++    KDE_DEPRECATED void setPrecision(int precision) { setDecimals(precision); }
+ 
+     /**
+      * @return the reference point for relativeValue calculation
+@@ -709,178 +711,4 @@
+     Q_DISABLE_COPY(KIntSpinBox)
+ };
+ 
+-
+-/* --------------------------------------------------------------------------- */
+-
+-/**
+-   @short A spin box for fractional numbers.
+-
+-   This class provides a spin box for fractional numbers.
+-
+-   \image html kdoublespinbox.png "KDE Fractional Number Spinbox"
+-
+-   See below for code examples on how to use this class.
+-
+-   \b Parameters \n
+-
+-   To make successful use of KDoubleSpinBox, you need to understand the
+-   relationship between precision and available range.
+-
+-   @li precision: The number of digits after the decimal point.
+-   @li maximum/minimum: upper and lower bounds of the valid range
+-   @li lineStep: the size of the step that is made when the user hits
+-                 the up or down buttons
+-
+-   Since we work with fixed-point numbers internally, the maximum
+-   precision is a function of the valid range and vice versa. More
+-   precisely, the following relationships hold:
+-   \code
+-   max( abs(minimum()), abs(maximum() ) <= INT_MAX/10^precision
+-   maxPrecision = floor( log10( INT_MAX/max(abs(minimum()),abs(maximum())) ) )
+-   \endcode
+-
+-   Since the value, bounds and lineStep are rounded to the current
+-   precision, you may find that the order of setting these
+-   parameters matters. As an example, the following are @em not equivalent (try
+-   it!):
+-
+-   \code
+-   // sets precision,
+-   // then min/max value (rounded to precision and clipped to obtainable range if needed)
+-   // then value and lineStep
+-   KDoubleSpinBox * spin = new KDoubleSpinBox( 0, 9.999, 0.001, 4.321, 3, this );
+-
+-   // sets minimum to 0; maximum to 10.00(!); value to 4.32(!) and only then
+-   // increases the precision - too late, since e.g. value has already been rounded...
+-   KDoubleSpinBox * spin = new KDoubleSpinBox( this );
+-   spin->setMinimum( 0 );
+-   spin->setMaximum( 9.999 );
+-   spin->setValue( 4.321 );
+-   spin->setPrecision( 3 );
+-   \endcode
+-
+-   @author Marc Mutz <mutz at kde.org>
+-**/
+-
+-class KDEUI_EXPORT KDoubleSpinBox : public QSpinBox {
+-  Q_OBJECT
+-  Q_PROPERTY( bool acceptLocalizedNumbers READ acceptLocalizedNumbers WRITE setAcceptLocalizedNumbers )
+-  Q_OVERRIDE( double maximum READ maximum WRITE setMaximum )
+-  Q_OVERRIDE( double minimum READ minimum WRITE setMinimum )
+-  Q_OVERRIDE( double singleStep READ singleStep WRITE setSingleStep )
+-  Q_OVERRIDE( double value READ value WRITE setValue )
+-  Q_PROPERTY( int precision READ precision WRITE setPrecision )
+-
+-public:
+-  /** Constructs a KDoubleSpinBox with parent @p parent and
+-      default values for range and value (whatever QRangeControl
+-      uses) and precision (2). */
+-  explicit KDoubleSpinBox( QWidget * parent = 0 );
+-
+-  /** Constructs a KDoubleSpinBox with parent @p parent, range
+-      [ @p lower, @p upper ], lineStep @p step, precision @p
+-      precision and initial value @p value. */
+-  KDoubleSpinBox( double lower, double upper, double step, double value,
+-		  QWidget *parent,int precision=2);
+-
+-  virtual ~KDoubleSpinBox();
+-
+-  /** @return whether the spinbox uses localized numbers */
+-  bool acceptLocalizedNumbers() const;
+-
+-  /** Sets whether to use and accept localized numbers as returned by
+-      KLocale::formatNumber() */
+-  virtual void setAcceptLocalizedNumbers( bool accept );
+-
+-  /** Sets a new range for the spin box values. Note that @p lower, @p
+-      upper and @p step are rounded to @p precision decimal points
+-      first. */
+-  void setRange( double lower, double upper, double step=0.01, int precision=2 );
+-
+-  /** @return the current number of digits displayed to the right of the
+-      decimal point. */
+-  int precision() const;
+-
+-  /** Equivalent to setPrecision( @p precision, @p false ); Needed
+-      since Qt's moc doesn't ignore trailing parameters with default
+-      args when searching for a property setter method. */
+-  void setPrecision( int precision );
+-
+-  /** Sets the precision (number of digits to the right of the decimal point). Note
+-      that there is a tradeoff between the precision used and the available range of
+-      values. See the class documentation above for more information on this.
+-
+-      @param precision the new precision to use
+-
+-      @param force if true, disables checking of bounds violations that can
+-             arise if you increase the precision so much that the
+-             minimum and maximum values can't be represented
+-             anymore. Disabling is useful if you were going to disable range
+-             control in any case.
+-  **/
+-  virtual void setPrecision( int precision, bool force );
+-
+-  /** @return the current value */
+-  double value() const;
+-
+-  /** @return the current lower bound */
+-  double minimum() const;
+-
+-  /** Sets the lower bound of the range to @p value, subject to the
+-      contraints that @p value is first rounded to the current
+-      precision and then clipped to the maximum range interval that can
+-      be handled at that precision.
+-      @see maximum, minimum, setMaximum, setRange
+-  */
+-  void setMinimum( double value );
+-
+-  /** @return the current upper bound */
+-  double maximum() const;
+-
+-  /** Sets the upper bound of the range to @p value, subject to the
+-      contraints that @p value is first rounded to the current
+-      precision and then clipped to the maximum range interval
+-      that can be handled at that precision.
+-      @see minimum, maximum, setMinimum, setRange
+-  */
+-  void setMaximum( double value );
+-
+-  /** @return the current step size */
+-  double singleStep() const;
+-
+-  /** Sets the step size for clicking the up/down buttons to @p step,
+-      subject to the constraints that @p step is first rounded to the
+-      current precision and then clipped to the meaningful interval
+-      [ 1, @p maximum() - @p minimum() ]. */
+-  void setSingleStep( double step );
+-
+-  /** Overridden to ignore any setValidator() calls. */
+-  void setValidator( const QValidator * );
+-
+-Q_SIGNALS:
+-  /** Emitted whenever QSpinBox::valueChanged( int ) is emitted. */
+-  void valueChanged( double value );
+-
+-public Q_SLOTS:
+-  /** Sets the current value to @p value, subject to the constraints
+-      that @p value is first rounded to the current precision and then
+-      clipped to the interval [ @p minimum() , @p maximum() ]. */
+-  virtual void setValue( double value );
+-
+-protected:
+-  virtual QString textFromValue(int) const;
+-  virtual int valueFromText(const QString &text) const;
+-
+-protected Q_SLOTS:
+-  void slotValueChanged( int value );
+-
+-private:
+-  typedef QSpinBox base;
+-  void updateValidator();
+-  int maxPrecision() const;
+-
+-  class Private;
+-  Private * const d;
+-};
+-
+ #endif // K_NUMINPUT_H
+--- a/kdeui/widgets/kcmodule.cpp
++++ b/kdeui/widgets/kcmodule.cpp
+@@ -51,16 +51,16 @@
+     KComponentData _componentData;
+     const KAboutData *_about;
+     QString _rootOnlyMessage;
+-    bool _useRootOnlyMessage;
+-    bool _firstshow;
+     QList<KConfigDialogManager*> managers;
+     QString _quickHelp;
++    bool _useRootOnlyMessage : 1;
++    bool _firstshow : 1;
+ 
+     // this member is used to record the state on non-automatically
+     // managed widgets, allowing for mixed KConfigXT-drive and manual
+     // widgets to coexist peacefully and do the correct thing with
+     // the changed(bool) signal
+-    bool _unmanagedWidgetChangeState;
++    bool _unmanagedWidgetChangeState : 1;
+ };
+ 
+ KCModule::KCModule( QWidget *parent, const char *name, const QStringList& )
+--- a/kdeui/widgets/ktextedit.cpp
++++ b/kdeui/widgets/ktextedit.cpp
+@@ -59,7 +59,7 @@
+     void spellCheckerCorrected( const QString &, int,const QString &);
+     void spellCheckerAutoCorrect(const QString&,const QString&);
+     void spellCheckerCanceled();
+-    
++
+     void spellCheckerFinished();
+     void toggleAutoSpellCheck();
+     void slotAllowTab();
+@@ -69,9 +69,9 @@
+     QAction *autoSpellCheckAction;
+     QAction *allowTab;
+     QAction *spellCheckAction;
+-    bool customPalette;
++    bool customPalette : 1;
+ 
+-    bool checkSpellingEnabled;
++    bool checkSpellingEnabled : 1;
+     QString originalBuffer;
+     QString spellChechingConfigFileName;
+     Sonnet::Highlighter *highlighter;
+@@ -226,7 +226,7 @@
+     } while ( moved && verticalScrollBar()->value() > targetY );
+     event->accept();
+     return;
+-  } else if ( KStandardShortcut::home().contains( key ) ) {
++  } else if ( KStandardShortcut::begin().contains( key ) ) {
+     QTextCursor cursor = textCursor();
+     cursor.movePosition( QTextCursor::Start );
+     setTextCursor( cursor );
+--- a/kdeui/widgets/kurllabel.cpp
++++ b/kdeui/widgets/kurllabel.cpp
+@@ -74,12 +74,12 @@
+     QColor linkColor;
+     QColor highlightedLinkColor;
+     QCursor* cursor;
+-    bool textUnderlined;
+-    bool realUnderlined;
+-    bool useTips;
+-    bool useCursor;
+-    bool glowEnabled;
+-    bool floatEnabled;
++    bool textUnderlined : 1;
++    bool realUnderlined : 1;
++    bool useTips : 1;
++    bool useCursor : 1;
++    bool glowEnabled : 1;
++    bool floatEnabled : 1;
+     QPixmap alternatePixmap;
+     QPixmap realPixmap;
+     QTimer* timer;
+--- a/kdeui/widgets/kstringvalidator.cpp
++++ b/kdeui/widgets/kstringvalidator.cpp
+@@ -25,8 +25,8 @@
+ {
+   public:
+     QStringList mStringList;
+-    bool mRejecting;
+-    bool mFixupEnabled;
++    bool mRejecting : 1;
++    bool mFixupEnabled : 1;
+ };
+ 
+ //
+--- a/kdeui/widgets/kactionselector.cpp
++++ b/kdeui/widgets/kactionselector.cpp
+@@ -38,10 +38,11 @@
+   QListWidget *availableListWidget, *selectedListWidget;
+   QToolButton *btnAdd, *btnRemove, *btnUp, *btnDown;
+   QLabel *lAvailable, *lSelected;
+-  bool moveOnDoubleClick, keyboardEnabled;
++  bool moveOnDoubleClick : 1;
++  bool keyboardEnabled : 1;
++  bool showUpDownButtons : 1;
+   QString addIcon, removeIcon, upIcon, downIcon;
+   KActionSelector::InsertionPolicy availableInsertionPolicy, selectedInsertionPolicy;
+-  bool showUpDownButtons;
+ 
+   /**
+     Move item @p item to the other listbox
+--- a/kdeui/widgets/klanguagebutton.cpp
++++ b/kdeui/widgets/klanguagebutton.cpp
+@@ -18,7 +18,6 @@
+  *  Boston, MA 02110-1301, USA.
+  */
+ 
+-#define INCLUDE_MENUITEM_DEF
+ #include "klanguagebutton.moc"
+ 
+ #include <QtGui/QMenu>
+@@ -70,8 +69,8 @@
+   QMenu *popup;
+   QString current;
+   const KLocale *locale;
+-  bool staticText;
+-  bool showCodes;
++  bool staticText : 1;
++  bool showCodes : 1;
+ };
+ 
+ KLanguageButton::KLanguageButton( QWidget * parent )
+--- a/kdeui/widgets/klineedit.cpp
++++ b/kdeui/widgets/klineedit.cpp
+@@ -222,9 +222,9 @@
+     }
+ 
+     if (qApp->isLeftToRight()) {
+-        d->clearButton->setPixmap(SmallIcon("clear-left", 0, clearButtonState));
++        d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar-rtl", 0, clearButtonState));
+     } else {
+-        d->clearButton->setPixmap(SmallIcon("locationbar-erase", 0, clearButtonState));
++        d->clearButton->setPixmap(SmallIcon("edit-clear-locationbar", 0, clearButtonState));
+     }
+ }
+ 
+@@ -244,7 +244,7 @@
+ 
+         // we don't need to check for RTL here as Qt does that for us
+         // when it comes to style sheets
+-        kDebug() << "setting padding right to " << buttonWidth;
++        //kDebug() << "setting padding right to" << buttonWidth;
+         setStyleSheet( QString( "QLineEdit { padding-right: %1; }" )
+                        .arg( buttonWidth ) );
+     }
+--- a/kdeui/widgets/kcompletionbox.cpp
++++ b/kdeui/widgets/kcompletionbox.cpp
+@@ -39,10 +39,10 @@
+ public:
+     QWidget *m_parent; // necessary to set the focus back
+     QString cancelText;
+-    bool tabHandling;
+-    bool down_workaround;
+-    bool upwardBox;
+-    bool emitSelected;
++    bool tabHandling : 1;
++    bool down_workaround : 1;
++    bool upwardBox : 1;
++    bool emitSelected : 1;
+ };
+ 
+ KCompletionBox::KCompletionBox( QWidget *parent )
+--- a/kdeui/widgets/kkeysequencewidget.cpp
++++ b/kdeui/widgets/kkeysequencewidget.cpp
+@@ -177,9 +177,9 @@
+ 	layout->addWidget(clearButton);
+ 
+ 	if (qApp->isLeftToRight())
+-		clearButton->setIcon(KIcon("clear-left"));
++		clearButton->setIcon(KIcon("edit-clear-locationbar-rtl"));
+ 	else
+-		clearButton->setIcon(KIcon("locationbar-erase"));
++		clearButton->setIcon(KIcon("edit-clear-locationbar"));
+ }
+ 
+ 
+--- a/kdeui/widgets/kdatetable.cpp
++++ b/kdeui/widgets/kdatetable.cpp
+@@ -7,12 +7,12 @@
+     modify it under the terms of the GNU Library General Public
+     License as published by the Free Software Foundation; either
+     version 2 of the License, or (at your option) any later version.
+- 
++
+     This library is distributed in the hope that it will be useful,
+     but WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     Library General Public License for more details.
+- 
++
+     You should have received a copy of the GNU Library General Public License
+     along with this library; see the file COPYING.LIB.  If not, write to
+     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+@@ -106,8 +106,8 @@
+      */
+     int numDayColumns;
+ 
+-    bool popupMenuEnabled;
+-    bool useCustomColors;
++    bool popupMenuEnabled : 1;
++    bool useCustomColors : 1;
+ 
+     struct DatePaintingMode
+     {
+@@ -242,7 +242,7 @@
+     connect( prior, SIGNAL( triggered( bool ) ), SLOT( previousMonth() ) );
+ 
+     QAction* beginMonth = localCollection->addAction( QLatin1String( "beginMonth" ) );
+-    beginMonth->setShortcuts( KStandardShortcut::home() );
++    beginMonth->setShortcuts( KStandardShortcut::begin() );
+     connect( beginMonth, SIGNAL( triggered( bool ) ), SLOT( beginningOfMonth() ) );
+ 
+     QAction* endMonth = localCollection->addAction( QLatin1String( "endMonth" ) );
+@@ -489,7 +489,7 @@
+ void KDateTable::KDateTablePrivate::endOfWeek()
+ {
+     // setDate does validity checking for us
+-    q->setDate( q->calendar()->addDays( mDate, 
++    q->setDate( q->calendar()->addDays( mDate,
+                 q->calendar()->daysInWeek( mDate ) - q->calendar()->dayOfWeek( mDate ) ) );
+ }
+ 
+@@ -638,7 +638,7 @@
+     // set weekday number of first day of this month, but this may not be a valid date so fake
+     // it if needed e.g. in QDate Mon 1 Jan -4713 is not valid when it should be, so fake as day 1
+     QDate firstDayOfMonth;
+-    if ( calendar()->setYMD( firstDayOfMonth, 
++    if ( calendar()->setYMD( firstDayOfMonth,
+                              calendar()->year( d->mDate ), calendar()->month( d->mDate ), 1 ) ) {
+         d->weekDayFirstOfMonth = calendar()->dayOfWeek( firstDayOfMonth );
+     } else {
+--- a/kdeui/widgets/kmenubar.cpp
++++ b/kdeui/widgets/kmenubar.cpp
+@@ -20,10 +20,6 @@
+     */
+ 
+ 
+-#ifndef INCLUDE_MENUITEM_DEF
+-#define INCLUDE_MENUITEM_DEF
+-#endif
+-
+ #include "kmenubar.h"
+ 
+ #include <config.h>
+@@ -93,11 +89,11 @@
+     int frameStyle; // only valid in toplevel mode
+     int lineWidth;  // dtto
+     int margin;     // dtto
+-    bool fallback_mode; // dtto
++    bool fallback_mode : 1; // dtto
+ 
+-    bool forcedTopLevel;
+-    bool topLevel;
+-    bool wasTopLevel; // when TLW is fullscreen, remember state
++    bool forcedTopLevel : 1;
++    bool topLevel : 1;
++    bool wasTopLevel : 1; // when TLW is fullscreen, remember state
+ 
+ #ifdef Q_WS_X11
+     KSelectionWatcher* selection;
+--- a/kdeui/widgets/keditlistbox.h
++++ b/kdeui/widgets/keditlistbox.h
+@@ -92,6 +92,8 @@
+ 
+       Q_DECLARE_FLAGS( Buttons, Button )
+ 
++// ### KDE5: remove name arguments and simplify (merge?!) constructors
++
+       /**
+        * Create an editable listbox.
+        *
+--- a/kdeui/widgets/ktoolbar.h
++++ b/kdeui/widgets/ktoolbar.h
+@@ -192,8 +192,6 @@
+   protected:
+     virtual void contextMenuEvent( QContextMenuEvent* );
+     virtual void actionEvent( QActionEvent* );
+-    void applyAppearanceSettings( KConfigGroup &cg, bool forceGlobal = false );
+-    QString settingsGroup() const;
+ 
+     // Draggable toolbar configuration
+     virtual void dragEnterEvent( QDragEnterEvent* );
+@@ -205,6 +203,8 @@
+     virtual void mouseReleaseEvent( QMouseEvent* );
+ 
+   private:
++    void applyAppearanceSettings( const KConfigGroup &cg, bool forceGlobal = false );
++
+     class Private;
+     Private* const d;
+ 
+--- a/kdeui/widgets/kmainwindow.cpp
++++ b/kdeui/widgets/kmainwindow.cpp
+@@ -592,14 +592,11 @@
+     int n = 1; // Toolbar counter. toolbars are counted from 1,
+     foreach (KToolBar* toolbar, toolBars()) {
+         QString group;
+-        if (!configGroup.isEmpty())
+-        {
+-           // Give a number to the toolbar, but prefer a name if there is one,
+-           // because there's no real guarantee on the ordering of toolbars
+-           group = (toolbar->objectName().isEmpty() ? QString::number(n) : QString(" ")+toolbar->objectName());
+-           group.prepend(" Toolbar");
+-           group.prepend(configGroup);
+-        }
++        // Give a number to the toolbar, but prefer a name if there is one,
++        // because there's no real guarantee on the ordering of toolbars
++        group = (toolbar->objectName().isEmpty() ? QString::number(n) : QString(" ")+toolbar->objectName());
++        group.prepend(" Toolbar");
++        group.prepend(configGroup);
+         KConfigGroup groupGrp(cg.config(), group);
+         toolbar->saveSettings(groupGrp);
+         n++;
+--- a/kdeui/widgets/knuminput.cpp
++++ b/kdeui/widgets/knuminput.cpp
+@@ -3,9 +3,7 @@
+  * Initial implementation:
+  *     Copyright (c) 1997 Patrick Dowler <dowler at morgul.fsh.uvic.ca>
+  * Rewritten and maintained by:
+- *     Copyright (c) 2000 Dirk A. Mueller <mueller at kde.org>
+- * KDoubleSpinBox:
+- *     Copyright (c) 2002 Marc Mutz <mutz at kde.org>
++ *     Copyright (c) 2000 Dirk Mueller <mueller at kde.org>
+  *
+  *  This library is free software; you can redistribute it and/or
+  *  modify it under the terms of the GNU Library General Public
+@@ -531,10 +529,10 @@
+         w += priv->m_colw2 + 8;
+ 
+         if(priv->m_slider)
+-            priv->m_slider->setGeometry(w, h, e->size().width() - w, d->m_sizeSpin.height());
++            priv->m_slider->setGeometry(w, h, e->size().width() - w, d->m_sizeSpin.height() + KDialog::spacingHint());
+     }
+     else if(priv->m_slider) {
+-        priv->m_slider->setGeometry(w, h, e->size().width() - (w + priv->m_colw2 + KDialog::spacingHint()), d->m_sizeSpin.height());
++        priv->m_slider->setGeometry(w, h, e->size().width() - (w + priv->m_colw2 + KDialog::spacingHint()), d->m_sizeSpin.height() + KDialog::spacingHint());
+         d->m_spin->setGeometry(w + priv->m_slider->size().width() + KDialog::spacingHint(), h, priv->m_colw2, d->m_sizeSpin.height());
+     }
+     else {
+@@ -604,7 +602,7 @@
+ 	: spin( 0 ),
+ 	  referencePoint( r ),
+ 	  blockRelative ( 0 ) {}
+-    KDoubleSpinBox * spin;
++    QDoubleSpinBox * spin;
+     double referencePoint;
+     short blockRelative;
+     QSize m_sizeEdit;
+@@ -650,7 +648,12 @@
+ void KDoubleNumInput::init(double value, double lower, double upper,
+ 			   double step, int precision )
+ {
+-    d->spin = new KDoubleSpinBox(lower, upper, step, value, this,precision);
++    d->spin = new QDoubleSpinBox(this);
++    d->spin->setRange(lower, upper);
++    d->spin->setSingleStep(step);
++    d->spin->setValue(value);
++    d->spin->setDecimals(precision);
++
+     d->spin->setObjectName("KDoubleNumInput::d->spin" );
+     setFocusProxy(d->spin);
+     connect( d->spin, SIGNAL(valueChanged(double)),
+@@ -741,12 +744,12 @@
+         w += priv->m_colw2 + KDialog::spacingHint();
+ 
+         if(priv->m_slider)
+-            priv->m_slider->setGeometry(w, h, e->size().width() - w, d->m_sizeEdit.height());
++            priv->m_slider->setGeometry(w, h, e->size().width() - w, d->m_sizeEdit.height() + KDialog::spacingHint());
+     }
+     else if(priv->m_slider) {
+         priv->m_slider->setGeometry(w, h, e->size().width() -
+                                     (priv->m_colw1 + priv->m_colw2 + KDialog::spacingHint()),
+-                              d->m_sizeEdit.height());
++                              d->m_sizeEdit.height() + KDialog::spacingHint());
+         d->spin->setGeometry(w + priv->m_slider->width() + KDialog::spacingHint(), h,
+                              priv->m_colw2, d->m_sizeEdit.height());
+     }
+@@ -795,15 +798,16 @@
+   
+     if( priv->m_slider ) {
+ 	// don't update the slider to avoid an endless recursion
+-	QSpinBox * spin = d->spin;
++	QDoubleSpinBox * spin = d->spin;
+ 	disconnect(spin, SIGNAL(valueChanged(int)),
+ 		priv->m_slider, SLOT(setValue(int)) );
+     }
+-    d->spin->setRange( lower, upper, step, d->spin->precision() );
++    d->spin->setRange( lower, upper);
++    d->spin->setSingleStep(step);
+ 
+     if(slider) {
+ 	// upcast to base type to get the minimum/maximum in int form:
+-	QSpinBox * spin = d->spin;
++	QDoubleSpinBox * spin = d->spin;
+         int slmax = spin->maximum();
+ 	int slmin = spin->minimum();
+         int slvalue = spin->value();
+@@ -902,16 +906,16 @@
+     layout(true);
+ }
+ 
+-void KDoubleNumInput::setPrecision(int precision)
++void KDoubleNumInput::setDecimals(int decimals)
+ {
+-    d->spin->setPrecision( precision );
++    d->spin->setDecimals(decimals);
+ 
+     layout(true);
+ }
+ 
+-int KDoubleNumInput::precision() const
++int KDoubleNumInput::decimals() const
+ {
+-    return d->spin->precision();
++    return d->spin->decimals();
+ }
+ 
+ void KDoubleNumInput::setSpecialValueText(const QString& text)
+@@ -933,289 +937,4 @@
+ 
+ }
+ 
+-// ----------------------------------------------------------------------------
+-
+-
+-class KDoubleSpinBoxValidator : public KDoubleValidator
+-{
+-public:
+-    KDoubleSpinBoxValidator( KDoubleSpinBox *sb,double bottom, double top, int decimals)
+-        : KDoubleValidator( bottom, top, decimals, sb), spinBox( sb ) { }
+-
+-    virtual State validate( QString& str, int& pos ) const;
+-
+-private:
+-    KDoubleSpinBox *spinBox;
+-};
+-
+-QValidator::State KDoubleSpinBoxValidator::validate( QString& str, int& pos ) const
+-{
+-    QString pref = spinBox->prefix();
+-    QString suff = spinBox->suffix();
+-    QString suffStriped = suff.trimmed();
+-    int overhead = pref.length() + suff.length();
+-    State state = Invalid;
+-
+-    if ( overhead == 0 ) {
+-        state = KDoubleValidator::validate( str, pos );
+-    } else {
+-        bool stripedVersion = false;
+-        if ( str.length() >= overhead && str.startsWith(pref)
+-             && (str.endsWith(suff)
+-                 || (stripedVersion = str.endsWith(suffStriped))) ) {
+-            if ( stripedVersion )
+-                overhead = pref.length() + suffStriped.length();
+-            QString core = str.mid( pref.length(), str.length() - overhead );
+-            int corePos = pos - pref.length();
+-            state = KDoubleValidator::validate( core, corePos );
+-            pos = corePos + pref.length();
+-            str.replace( pref.length(), str.length() - overhead, core );
+-        } else {
+-            state = KDoubleValidator::validate( str, pos );
+-            if ( state == Invalid ) {
+-                // trimmed(), cf. QSpinBox::interpretText()
+-                QString special = spinBox->specialValueText().trimmed();
+-                QString candidate = str.trimmed();
+-
+-                if ( special.startsWith(candidate) ) {
+-                    if ( candidate.length() == special.length() ) {
+-                        state = Acceptable;
+-                    } else {
+-                        state = Intermediate;
+-                    }
+-                }
+-            }
+-        }
+-    }
+-    return state;
+-}
+-
+-// We use a kind of fixed-point arithmetic to represent the range of
+-// doubles [mLower,mUpper] in steps of 10^(-mPrecision). Thus, the
+-// following relations hold:
+-//
+-// 1. factor = 10^mPrecision
+-// 2. basicStep = 1/factor = 10^(-mPrecision);
+-// 3. lowerInt = lower * factor;
+-// 4. upperInt = upper * factor;
+-// 5. lower = lowerInt * basicStep;
+-// 6. upper = upperInt * basicStep;
+-class KDoubleSpinBox::Private {
+-public:
+-  Private( int precision=1 )
+-    : mPrecision( precision ),
+-      mValidator( 0 )
+-  {
+-  }
+-
+-  int factor() const {
+-    int f = 1;
+-    for ( int i = 0 ; i < mPrecision ; ++i ) f *= 10;
+-    return f;
+-  }
+-
+-  double basicStep() const {
+-    return 1.0/double(factor());
+-  }
+-
+-  int mapToInt( double value, bool * ok ) const {
+-    assert( ok );
+-    const double f = factor();
+-    if ( value > double(INT_MAX) / f ) {
+-      kWarning() << "KDoubleSpinBox: can't represent value " << value
+-		  << "in terms of fixed-point numbers with precision "
+-		  << mPrecision << endl;
+-      *ok = false;
+-      return INT_MAX;
+-    } else if ( value < double(INT_MIN) / f ) {
+-      kWarning() << "KDoubleSpinBox: can't represent value " << value
+-		  << "in terms of fixed-point numbers with precision "
+-		  << mPrecision << endl;
+-      *ok = false;
+-      return INT_MIN;
+-    } else {
+-      *ok = true;
+-      return int( value * f + ( value < 0 ? -0.5 : 0.5 ) );
+-    }
+-  }
+-
+-  double mapToDouble( int value ) const {
+-    return double(value) * basicStep();
+-  }
+-
+-  int mPrecision;
+-  KDoubleSpinBoxValidator * mValidator;
+-};
+-
+-KDoubleSpinBox::KDoubleSpinBox( QWidget * parent)
+-  : QSpinBox( parent), d(new Private())
+-{
+-  lineEdit()->setAlignment( Qt::AlignRight );
+-  updateValidator();
+-  connect( this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)) );
+-}
+-
+-KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step,
+-				double value, QWidget *parent, int precision)
+-  : QSpinBox( parent), d(new Private())
+-{
+-  lineEdit()->setAlignment( Qt::AlignRight );
+-  setRange( lower, upper, step, precision );
+-  setValue( value );
+-  connect( this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)) );
+-}
+-
+-KDoubleSpinBox::~KDoubleSpinBox() {
+-  delete d;
+-}
+-
+-bool KDoubleSpinBox::acceptLocalizedNumbers() const {
+-  if ( !d->mValidator ) return true; // we'll set one that does;
+-                                     // can't do it now, since we're const
+-  return d->mValidator->acceptLocalizedNumbers();
+-}
+-
+-void KDoubleSpinBox::setAcceptLocalizedNumbers( bool accept ) {
+-  if ( !d->mValidator ) updateValidator();
+-  d->mValidator->setAcceptLocalizedNumbers( accept );
+-}
+-
+-void KDoubleSpinBox::setRange( double lower, double upper, double step,
+-			       int precision ) {
+-  lower = qMin(upper, lower);
+-  upper = qMax(upper, lower);
+-  setPrecision( precision, true ); // disable bounds checking, since
+-  setMinimum( lower );            // it's done in set{Minimum,Maximum}
+-  setMaximum( upper );            // anyway and we want lower, upper
+-  setSingleStep( step );             // and step to have the right precision
+-}
+-
+-int KDoubleSpinBox::precision() const {
+-  return d->mPrecision;
+-}
+-
+-void KDoubleSpinBox::setPrecision( int precision ) {
+-    setPrecision( precision, false );
+-}
+-
+-void KDoubleSpinBox::setPrecision( int precision, bool force ) {
+-  if ( precision < 1 ) return;
+-  if ( !force ) {
+-    int maxPrec = maxPrecision();
+-    if ( precision > maxPrec )
+-      precision = maxPrec;
+-  }
+-  d->mPrecision = precision;
+-  updateValidator();
+-}
+-
+-int KDoubleSpinBox::maxPrecision() const {
+-    // INT_MAX must be > maxAbsValue * 10^precision
+-    // ==> 10^precision < INT_MAX / maxAbsValue
+-    // ==> precision < log10 ( INT_MAX / maxAbsValue )
+-    // ==> maxPrecision = floor( log10 ( INT_MAX / maxAbsValue ) );
+-    double maxAbsValue = qMax( fabs(minimum()), fabs(maximum()) );
+-    if ( maxAbsValue == 0 ) return 6; // return arbitrary value to avoid dbz...
+-
+-    return int( floor( log10( double(INT_MAX) / maxAbsValue ) ) );
+-}
+-
+-double KDoubleSpinBox::value() const {
+-  return d->mapToDouble( base::value() );
+-}
+-
+-void KDoubleSpinBox::setValue( double value ) {
+-    if ( value == this->value() ) return;
+-    if ( value < minimum() )
+-	base::setValue( base::minimum() );
+-    else if ( value > maximum() )
+-	base::setValue( base::maximum() );
+-    else {
+-	bool ok = false;
+-	base::setValue( d->mapToInt( value, &ok ) );
+-	assert( ok );
+-    }
+-}
+-
+-double KDoubleSpinBox::minimum() const {
+-  return d->mapToDouble( base::minimum() );
+-}
+-
+-void KDoubleSpinBox::setMinimum( double value ) {
+-  bool ok = false;
+-  int min = d->mapToInt( value, &ok );
+-  if ( !ok ) return;
+-  base::setMinimum( min );
+-  updateValidator();
+-}
+-
+-
+-double KDoubleSpinBox::maximum() const {
+-  return d->mapToDouble( base::maximum() );
+-}
+-
+-void KDoubleSpinBox::setMaximum( double value ) {
+-  bool ok = false;
+-  int max = d->mapToInt( value, &ok );
+-  if ( !ok ) return;
+-  base::setMaximum( max );
+-  updateValidator();
+-}
+-
+-double KDoubleSpinBox::singleStep() const {
+-  return d->mapToDouble( base::singleStep() );
+-}
+-
+-void KDoubleSpinBox::setSingleStep( double step ) {
+-  bool ok = false;
+-  if ( step > maximum() - minimum() )
+-    base::setSingleStep( 1 );
+-  else
+-    base::setSingleStep( qMax( d->mapToInt( step, &ok ), 1 ) );
+-}
+-
+-QString KDoubleSpinBox::textFromValue( int value ) const{
+-  if ( acceptLocalizedNumbers() )
+-    return KGlobal::locale()
+-      ->formatNumber( d->mapToDouble( value ), d->mPrecision );
+-  else
+-    return QString().setNum( d->mapToDouble( value ), 'f', d->mPrecision );
+-}
+-
+-int KDoubleSpinBox::valueFromText( const QString &text ) const{
+-  double value;
+-  bool ok;
+-  if ( acceptLocalizedNumbers() )
+-    value = KGlobal::locale()->readNumber( text, &ok );
+-  else
+-    value = cleanText().toDouble( &ok );
+-  if ( !ok ) return 0;
+-  if ( value > maximum() )
+-    value = maximum();
+-  else if ( value < minimum() )
+-    value = minimum();
+-  return d->mapToInt( value, &ok );
+-}
+-
+-void KDoubleSpinBox::setValidator( const QValidator * ) {
+-  // silently discard the new validator. We don't want another one ;-)
+-}
+-
+-void KDoubleSpinBox::slotValueChanged( int value ) {
+-  emit valueChanged( d->mapToDouble( value ) );
+-}
+-
+-void KDoubleSpinBox::updateValidator() {
+-  if ( !d->mValidator ) {
+-    d->mValidator =  new KDoubleSpinBoxValidator(this, minimum(), maximum(), precision());
+-    d->mValidator->setObjectName("d->mValidator" );
+-#ifdef __GNUC__
+-#warning KDE4 we NEED to fix the validation of values here
+-#endif
+-//    base::setValidator( d->mValidator );
+-  } else
+-    d->mValidator->setRange( minimum(), maximum(), precision() );
+-}
+-
+-
+ #include "knuminput.moc"
+--- a/kdeui/widgets/kruler.cpp
++++ b/kdeui/widgets/kruler.cpp
+@@ -75,9 +75,6 @@
+ class KRuler::KRulerPrivate
+ {
+ public:
+-  bool showpointer;
+-  bool showEndL;
+-  bool lengthFix;
+   int  endOffset_length;  /* marks the offset at the end of the ruler
+                            * i.e. right side at horizontal and down side
+                            * at vertical rulers.
+@@ -96,11 +93,15 @@
+   int mmDist;
+   int bmDist;
+   int offset;
+-  bool showtm; /* show tiny, little, medium, big, endmarks */
+-  bool showlm;
+-  bool showmm;
+-  bool showbm;
+-  bool showem;
++  bool showtm : 1; /* show tiny, little, medium, big, endmarks */
++  bool showlm : 1;
++  bool showmm : 1;
++  bool showbm : 1;
++  bool showem : 1;
++
++  bool showpointer : 1;
++  bool showEndL : 1;
++  bool lengthFix : 1;
+ 
+   double ppm; /* pixel per mark */
+ 
+--- a/kdeui/widgets/ktitlewidget.h
++++ b/kdeui/widgets/ktitlewidget.h
+@@ -89,7 +89,7 @@
+     };
+ 
+     /**
+-     * Constructs a progress bar with the given @param parent.
++     * Constructs a title widget with the given @param parent.
+      */
+     explicit KTitleWidget(QWidget *parent = 0);
+ 
+--- a/kdeui/widgets/ktabbar.cpp
++++ b/kdeui/widgets/ktabbar.cpp
+@@ -59,8 +59,8 @@
+ 
+     //bool mHoverCloseButtonEnabled;
+     //bool mHoverCloseButtonDelayed;
+-    bool mTabReorderingEnabled;
+-    bool mTabCloseActivatePrevious;
++    bool mTabReorderingEnabled : 1;
++    bool mTabCloseActivatePrevious : 1;
+ 
+ };
+ 
+--- a/kdeui/widgets/ksqueezedtextlabel.h
++++ b/kdeui/widgets/ksqueezedtextlabel.h
+@@ -76,6 +76,20 @@
+   void setTextElideMode( Qt::TextElideMode mode );
+ 
+ public Q_SLOTS:
++  /**
++   * Sets the text. Note that this is not technically a reimplementation of QLabel::setText(),
++   * which is not virtual (in Qt 4.3). Therefore, you may need to cast the object to
++   * KSqueezedTextLabel in some situations:
++   * \Example
++   * \code
++   * KSqueezedTextLabel* squeezed = new KSqueezedTextLabel("text", parent);
++   * QLabel* label = squeezed;
++   * label->setText("new text");	// this will not work
++   * squeezed->setText("new text");	// works as expected
++   * static_cast<KSqueezedTextLabel*>(label)->setText("new text");	// works as expected
++   * \endcode
++   * @param mode The new text.
++   */
+   void setText( const QString &text );
+ 
+ protected:
+--- a/kdeui/widgets/ktoolbar.cpp
++++ b/kdeui/widgets/ktoolbar.cpp
+@@ -154,8 +154,8 @@
+     // Default Values.
+     int IconSizeDefault;
+     Qt::ToolButtonStyle ToolButtonStyleDefault;
+-    bool HiddenDefault;
+-    bool NewLineDefault;
++    bool HiddenDefault : 1;
++    bool NewLineDefault : 1;
+     int OffsetDefault;
+     QString PositionDefault;
+ 
+@@ -664,27 +664,9 @@
+   return d->enableContext;
+ }
+ 
+-QString KToolBar::settingsGroup() const
++void KToolBar::saveSettings( KConfigGroup &cg )
+ {
+-  QString configGroup;
+-  if ( objectName().isEmpty() || d->isMainToolBar() )
+-    configGroup = "Toolbar style";
+-  else
+-    configGroup = QString( objectName() ) + " Toolbar style";
+-
+-  if ( mainWindow() ) {
+-    configGroup.prepend(" ");
+-    configGroup.prepend( mainWindow()->objectName() );
+-  }
+-
+-  return configGroup;
+-}
+-
+-void KToolBar::saveSettings( KConfigGroup &_cg )
+-{
+-  KConfigGroup cg = _cg;
+-    if ( cg.name().isEmpty() )
+-        cg.changeGroup(settingsGroup());
++    Q_ASSERT(!cg.name().isEmpty());
+ 
+   QString position;
+   Qt::ToolButtonStyle ToolButtonStyle;
+@@ -722,18 +704,14 @@
+     // The whole set of indexes has to be saved.
+     //kDebug(220) << name() << "                writing index " << index;
+ 
+-    // don't save if there's only one toolbar
+-
+-    // Don't use kmw->toolBarIterator() because you might
+-    // mess up someone else's iterator.  Make the list on your own
+-
+-    /* FIXME KMainWindow port - no replacement
+-    QList<KToolBar*> toolbarList = mainWindow()->findChildren<KToolBar*>();
++    KMainWindow* kmw = mainWindow();
++    QList<KToolBar*> toolbarList = kmw->findChildren<KToolBar*>();
+ 
++    // don't save if there's only one toolbar
+     if ( !kmw || toolbarList.count() > 1 )
+         cg.writeEntry("Index", index);
+     else
+-        cg.revertToDefault("Index");*/
++        cg.revertToDefault("Index");
+ 
+     /* FIXME KMainWindow port - no replacement
+     if(!cg.hasDefault("Offset") && offset() == d->OffsetDefault )
+@@ -932,11 +910,9 @@
+   current.setAttribute( "toolButtonStyleDefault", d->toolButtonStyleToString( d->ToolButtonStyleDefault ) );
+ }
+ 
+-void KToolBar::applySettings( const KConfigGroup &_cg, bool force )
++void KToolBar::applySettings( const KConfigGroup &cg, bool force )
+ {
+-    KConfigGroup cg = _cg;
+-    if ( cg.name().isEmpty() )
+-        cg.changeGroup(settingsGroup());
++    Q_ASSERT( !cg.name().isEmpty() );
+ 
+   /*
+     Let's explain this a bit more in details.
+@@ -983,11 +959,9 @@
+   }
+ }
+ 
+-void KToolBar::applyAppearanceSettings( KConfigGroup &_cg, bool forceGlobal )
++void KToolBar::applyAppearanceSettings( const KConfigGroup &cg, bool forceGlobal )
+ {
+-    KConfigGroup cg = _cg;
+-    if ( cg.name().isEmpty() )
+-        cg.changeGroup(settingsGroup());
++    Q_ASSERT(! cg.name().isEmpty() );
+ 
+   // If we have application-specific settings in the XML file,
+   // and nothing in the application's config file, then
+@@ -1287,18 +1261,28 @@
+     QAction* act = tb->actions().first();
+     if ( event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease ) {
+       QMouseEvent* me = static_cast<QMouseEvent*>( event );
+-      if ( me->button() == Qt::MidButton /*&& 
++      if ( me->button() == Qt::MidButton /*&&
+            act->receivers(SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)))*/ ) {
+-        if ( me->type() == QEvent::MouseButtonPress )  
+-          tb->setDown(true); 
++        if ( me->type() == QEvent::MouseButtonPress )
++          tb->setDown(true);
+         else {
+           tb->setDown(false);
+           QMetaObject::invokeMethod(act, "triggered", Qt::DirectConnection,
+-               Q_ARG(Qt::MouseButtons, me->button()), 
++               Q_ARG(Qt::MouseButtons, me->button()),
+                Q_ARG(Qt::KeyboardModifiers, QApplication::keyboardModifiers() ));
+         }
+       }
+     }
++
++    // CJK languages use more verbose accelerator marker: they add a Latin
++    // letter in parenthesis, and put accelerator on that. Hence, the default
++    // removal of ampersand only may not be enough there, instead the whole
++    // parenthesis construct should be removed. Provide these filtering i18n
++    // messages so that translators can use Transcript for custom removal.
++    if ( event->type() == QEvent::Paint || event->type() == QEvent::EnabledChange ) {
++      tb->setText(i18nc("@action:intoolbar Text label of toolbar button", "%1", tb->text()));
++      tb->setToolTip(i18nc("@info:tooltip Tooltip of toolbar button", "%1", tb->toolTip()));
++    }
+   }
+ 
+   found:
+--- a/kdeui/widgets/kdatepicker.cpp
++++ b/kdeui/widgets/kdatepicker.cpp
+@@ -269,7 +269,7 @@
+ 
+     d->selectWeek = new KComboBox( this );  // read only week selection
+     d->todayButton = new QToolButton( this );
+-    d->todayButton->setIcon( KIcon( "calendar-today" ) );
++    d->todayButton->setIcon( KIcon( "go-jump-today" ) );
+ 
+     d->yearForward->setToolTip( i18n( "Next year" ) );
+     d->yearBackward->setToolTip( i18n( "Previous year" ) );
+--- a/kdeui/widgets/klineedit_p.h
++++ b/kdeui/widgets/klineedit_p.h
+@@ -67,7 +67,8 @@
+             m_timeline->setDuration(250);
+         }
+ 
+-        m_timeline->start();
++        if (m_timeline->state() != QTimeLine::Running)
++            m_timeline->start();
+     }
+ 
+     void setPixmap(const QPixmap& p)
+--- a/kdeui/icons/kpixmapcache.h
++++ b/kdeui/icons/kpixmapcache.h
+@@ -32,10 +32,46 @@
+ 
+ 
+ /**
+- * General-purpose pixmap cache for KDE.
++ * @brief General-purpose pixmap cache for KDE.
+  *
+- * It can be used e.g. by applications wanting to cache pixmaps rendered from
+- *  SVGs.
++ * The pixmap cache can be used to store pixmaps which can later be loaded
++ *  from the cache very quickly.
++ *
++ * It's most common use is storing SVG images which might be expensive to
++ *  render every time they are used. With the cache you can render each SVG
++ *  only once and later use the stored version unless the SVG file or requested
++ *  pixmap size changes.
++ *
++ * KPixmapCache's API is similar to that of the QPixmapCache so if you're
++ *  already using the latter then all you need to do is creating a KPixmapCache
++ *  object (unlike QPixmapCache, KPixmapCache doesn't have many static methods)
++ *  and calling @ref insert() and @ref find() method on that object:
++ *  @code
++ *  // Create KPixmapCache object
++ *  KPixmapCache* cache = new KPixmapCache("myapp-pixmaps");
++ *  // Load a pixmap
++ *  QPixmap pix;
++ *  if (!cache->find("pixmap-1", pix)) {
++ *      // Pixmap isn't in the cache, create it and insert to cache
++ *      pix = createPixmapFromData();
++ *      cache->insert("pixmap-1", pix);
++ *  }
++ *  // Use pix
++ *  @endcode
++ *
++ * The above example illustrates that you can also cache pixmaps created from
++ *  some data. In case such data is updated, you might need to discard cache
++ *  contents using @ref discard() method:
++ * @code
++ * // Discard the cache if it's too old
++ * if (cache->timestamp() < mydataTimestamp()) {
++ *     cache->discard();
++ * }
++ * // Now the cache contains up-to-date data
++ * @endcode
++ * As demonstrated, you can use cache's @ref timestamp() method to see when
++ *  the cache was created. If necessary, you can also change the timestamp
++ *  using @ref setTimestamp() method.
+  */
+ class KDEUI_EXPORT KPixmapCache
+ {
+@@ -48,12 +84,14 @@
+     virtual ~KPixmapCache();
+ 
+     /**
+-     * Tries to load the specified pixmap from cache.
++     * Tries to load pixmap with the specified key from cache.
+      * @return true when pixmap was found and loaded from cache, false otherwise
+      **/
+     virtual bool find(const QString& key, QPixmap& pix);
+     /**
+      * Insert specified pixmap into the cache.
++     * If the cache already contains pixmap with the specified key then it is
++     *  overwritten.
+      **/
+     virtual void insert(const QString& key, const QPixmap& pix);
+ 
+@@ -79,12 +117,13 @@
+     /**
+      * Sets the timestamp of app-specific cache. It's saved in the cache file
+      *  and can later be retrieved using @p timestamp() method.
++     * By default the timestamp is set to the cache creation time.
+      **/
+     void setTimestamp(unsigned int time);
+     /**
+      * Sets whether QPixmapCache (memory caching) should be used in addition
+      * to disk cache.
+-     * QPixmapCache is used by default
++     * QPixmapCache is used by default.
+      **/
+     void setUseQPixmapCache(bool use);
+     /**
+@@ -114,6 +153,9 @@
+     void setCacheLimit(int kbytes);
+     /**
+      * Describes which entries will be removed first during cache cleanup.
++     * @li RemoveOldest oldest entries are removed first.
++     * @li RemoveSeldomUsed least used entries are removed first.
++     * @li RemoveLeastRecentlyUsed least recently used entries are removed first.
+      **/
+     enum RemoveStrategy { RemoveOldest, RemoveSeldomUsed, RemoveLeastRecentlyUsed };
+     /**
+@@ -128,7 +170,7 @@
+ 
+     /**
+      * @return true when the cache is enabled.
+-     * Cache will be disabled when e.g.it's data file cannot be created or
++     * Cache will be disabled when e.g. it's data file cannot be created or
+      *  read.
+      **/
+     bool isEnabled() const;
+--- a/kdeui/icons/kicontheme.cpp
++++ b/kdeui/icons/kicontheme.cpp
+@@ -48,6 +48,10 @@
+ 
+ #include <kconfiggroup.h>
+ 
++// The following define exists because the Qt SVG renderer needs
++// to be improved. This will be removed soon. (ereslibre)
++#undef KDE_QT_SVG_RENDERER_FIXED
++
+ class KIconTheme::KIconThemePrivate
+ {
+ public:
+@@ -194,10 +198,10 @@
+     }
+ 
+     d->hidden = cfg.readEntry("Hidden", false);
+-    d->example = cfg.readPathEntry("Example");
+-    d->screenshot = cfg.readPathEntry("ScreenShot");
++    d->example = cfg.readPathEntry("Example", QString());
++    d->screenshot = cfg.readPathEntry("ScreenShot", QString());
+ 
+-    QStringList dirs = cfg.readPathListEntry("Directories");
++    QStringList dirs = cfg.readPathEntry("Directories", QStringList());
+     for (it=dirs.begin(); it!=dirs.end(); ++it)
+     {
+         KConfigGroup cg(d->sharedConfig, *it);
+@@ -442,7 +446,7 @@
+                 ((size < dir->minSize()) || (size > dir->maxSize())))
+               continue;
+             if ((dir->type() == KIconLoader::Threshold) &&
+-		(abs(dir->size()-size) > dir->threshold()))
++                (abs(dir->size()-size) > dir->threshold()))
+                 continue;
+         } else
+         {
+@@ -471,8 +475,7 @@
+              it's a downscale, and we only had upscales befores.
+              This is to avoid scaling up unless we have to,
+              since that looks very ugly */
+-          if ((abs(dw) >= abs(delta)) ||
+-              (delta > 0 && dw < 0))
++          if ((abs(dw) >= abs(delta)) || (delta > 0 && dw < 0))
+             continue;
+         }
+ 
+@@ -480,18 +483,25 @@
+         if (path.isEmpty())
+             continue;
+         icon.path = path;
++// The following code has been commented out because the Qt SVG renderer needs
++// to be improved. If you are going to change/remove some code from this part,
++// please contact me before (ereslibre at kde.org), or kde-core-devel at kde.org. (ereslibre)
++#ifdef KDE_QT_SVG_RENDERER_FIXED
++        icon.size = size;
++#else
+         icon.size = dir->size();
++#endif
+         icon.type = dir->type();
+-	icon.threshold = dir->threshold();
++        icon.threshold = dir->threshold();
+         icon.context = dir->context();
+ 
+         // if we got in MatchExact that far, we find no better
+         if (match == KIconLoader::MatchExact)
+             return icon;
+-	else
++        else
+         {
+-	    delta = dw;
+-	    if (delta==0) return icon; // We won't find a better match anyway
++            delta = dw;
++            if (delta==0) return icon; // We won't find a better match anyway
+         }
+     }
+     return icon;
+--- a/kdeui/icons/kiconengine.cpp
++++ b/kdeui/icons/kiconengine.cpp
+@@ -74,11 +74,10 @@
+ QSize KIconEngine::actualSize( const QSize & size, QIcon::Mode mode, QIcon::State state )
+ {
+     Q_UNUSED(state)
+-
+     const int kstate = qIconModeToKIconState(mode);
+-    // We ignore overlays here
+-
+-    QPixmap pix = iconLoader()->loadIcon(d->iconName, KIconLoader::Desktop, qMin(size.width(), size.height()), kstate);
++    QPixmap pix = iconLoader()->loadIcon(d->iconName, KIconLoader::Desktop,
++                                         qMin(size.width(), size.height()),
++                                         kstate, d->overlays);
+     return pix.size();
+ }
+ 
+--- a/kdeui/icons/kiconloader.cpp
++++ b/kdeui/icons/kiconloader.cpp
+@@ -56,6 +56,9 @@
+ #include <assert.h>
+ #include <kconfiggroup.h>
+ 
++// The following define exists because the Qt SVG renderer needs
++// to be improved. This will be removed soon. (ereslibre)
++#undef KDE_QT_SVG_RENDERER_FIXED
+ 
+ //#define NO_LAZYLOAD_ICONTHEME
+ 
+@@ -227,11 +230,18 @@
+ 
+     int count = 0;
+     foreach (const QString& overlay, overlays) {
++        // Ensure empty strings fill up a emblem spot
++        // Needed when you have several emblems to ensure they're always painted
++        // at the same place, even if one is not here
++        if (overlay.isEmpty()) {
++            ++count;
++            continue;
++        }
++
+         //TODO: should we pass in the kstate? it results in a slower
+         //      path, and perhaps emblems should remain in the default state
+         //      anyways?
+-        QPixmap pixmap = iconLoader->loadIcon("emblem-" + overlay,
+-                                              group, overlaySize, state, QStringList(), 0, true);
++        QPixmap pixmap = iconLoader->loadIcon(overlay, group, overlaySize, state, QStringList(), 0, true);
+ 
+         if (pixmap.isNull()) {
+             continue;
+@@ -242,16 +252,20 @@
+         case 0:
+             // bottom left corner
+             startPoint = QPoint(2, iconSize - overlaySize - 2);
++            break;
+         case 1:
+             // bottom right corner
+             startPoint = QPoint(iconSize - overlaySize - 2,
+                                 iconSize - overlaySize - 2);
++            break;
+         case 2:
+             // top right corner
+             startPoint = QPoint(2, iconSize - overlaySize - 2);
++            break;
+         case 3:
+             // top left corner
+             startPoint = QPoint(2, 2);
++            break;
+         }
+ 
+         painter.drawPixmap(startPoint, pixmap);
+@@ -331,6 +345,7 @@
+ void KIconLoader::reconfigure( const QString& _appname, KStandardDirs *_dirs )
+ {
+     delete d;
++    d = new KIconLoaderPrivate(this);
+     d->init( _appname, _dirs );
+ }
+ 
+@@ -615,9 +630,39 @@
+     const_cast<KIconLoaderPrivate*>(this)->initIconThemes();
+ 
+     K3Icon icon;
+-    const char * const ext[4] = { ".png", ".svgz", ".svg", ".xpm" };
+ 
+-    /* To follow the XDG icon theme and icon naming specifications,
++// The following code has been commented out because the Qt SVG renderer needs
++// to be improved. If you are going to change/remove some code from this part,
++// please contact me before (ereslibre at kde.org), or kde-core-devel at kde.org. (ereslibre)
++#ifdef KDE_QT_SVG_RENDERER_FIXED
++    const char * ext1[4] = { ".png", ".svgz", ".svg", ".xpm" };
++    const char * ext2[4] = { ".svgz", ".svg", ".png", ".xpm" };
++    const char ** ext;
++
++    if (size == KIconLoader::SizeSmall ||
++        size == KIconLoader::SizeSmallMedium ||
++        size == KIconLoader::SizeMedium ||
++        size == KIconLoader::SizeLarge ||
++        size == KIconLoader::SizeHuge ||
++        size == KIconLoader::SizeEnormous)
++    {
++        ext = ext1; // size is standard, give preference to PNG over SVG when searching
++    }
++    else
++    {
++        ext = ext2; // size is non-standard, give preference to SVG over PNG when searching
++    }
++
++    /* If size parameter is a standard one, that means:
++
++           - KIconLoader::SizeSmall
++           - KIconLoader::SizeSmallMedium
++           - KIconLoader::SizeMedium
++           - KIconLoader::SizeLarge
++           - KIconLoader::SizeHuge
++           - KIconLoader::SizeEnormous
++
++       To follow the XDG icon theme and icon naming specifications,
+        the order in which we look for an icon is:
+ 
+        png, svgz, svg, xpm exact match
+@@ -638,7 +683,35 @@
+        (...)
+ 
+        and so on.
++
++       If size parameter is a non-standard one, then we give more preference to
++       SVG format since drawing SVG's gives better quality and despite being
++       slower than resizing a PNG image, the cases where non-standard sizes are
++       asked are very rare. For non-standard sizes what we have is:
++
++       svgz, svg, png, xpm exact match
++       svgz, svg, png, xpm best match
++       less specific fallback in this theme: svgz, svg, png, xpm exact match
++                                             svgz, svg, png, xpm best match
++       even less specific fallback in this theme: [same order]
++       (...)
++
++       next theme in inheritance tree: svgz, svg, png, xpm exact match
++                                       svgz, svg, png, xpm best match
++       less specific fallbacks in this next theme
++       (...)
++
++       next theme in inheritance tree: svgz, svg, png, xpm exact match
++                                       svgz, svg, png, xpm best match
++       less specific fallbacks in this next theme
++       (...)
++
++       and so on.
+        */
++#else
++    const char * const ext[4] = { ".png", ".svgz", ".svg", ".xpm" };
++#endif
++
+     foreach(KIconThemeNode *themeNode, links)
+     {
+         QStringList nameParts = name.split("-");
+@@ -646,6 +719,10 @@
+ 
+         while (!nameParts.isEmpty())
+         {
++// The following code has been commented out because the Qt SVG renderer needs
++// to be improved. If you are going to change/remove some code from this part,
++// please contact me before (ereslibre at kde.org), or kde-core-devel at kde.org. (ereslibre)
++#ifdef KDE_QT_SVG_RENDERER_FIXED
+             for (int i = 0 ; i < 4 ; i++)
+             {
+                 icon = themeNode->theme->iconPath(currentName + ext[i], size, KIconLoader::MatchExact);
+@@ -659,6 +736,18 @@
+                 if (icon.isValid())
+                     return icon;
+             }
++#else
++            for (int i = 0 ; i < 4 ; i++)
++            {
++                icon = themeNode->theme->iconPath(currentName + ext[i], size, KIconLoader::MatchExact);
++                if (icon.isValid())
++                    return icon;
++
++                icon = themeNode->theme->iconPath(currentName + ext[i], size, KIconLoader::MatchBest);
++                if (icon.isValid())
++                    return icon;
++            }
++#endif
+ 
+             nameParts.removeLast();
+             currentName = nameParts.join("-");
+@@ -784,6 +873,8 @@
+         key = "$kicou_";
+         key += QString::number(size); key += '_';
+         key += name;
++        key.append(overlays.join("_")); // krazy:exclude=doublequote_chars
++
+         if (d->mIconCache->find(key, pix, path_store)) {
+             //kDebug(264) << "KIL: " << "found the icon from KIC";
+             return pix;
+@@ -815,6 +906,7 @@
+             img=img.scaled(size,size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ 
+         pix = QPixmap::fromImage(img);
++        d->drawOverlays(this, KIconLoader::Desktop, state, pix, overlays);
+         d->mIconCache->insert(key, pix, path);
+         return pix;
+     }
+@@ -981,10 +1073,15 @@
+     }
+ 
+     // Scale the icon and apply effects if necessary
++#ifndef KDE_QT_SVG_RENDERER_FIXED
++    // The following code needs to be removed after the SVG rendering has been
++    // fixed (please take a look at the comment above). Please do not remove the
++    // #if condition as it marks what needs to be removed (ereslibre)
+     if (iconType == KIconLoader::Scalable && size != img->width())
+     {
+         *img = img->scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+     }
++#endif
+     if (iconType == KIconLoader::Threshold && size != img->width())
+     {
+         if ( abs(size-img->width())>iconThreshold )
+--- a/kdeui/itemviews/kcategorizedsortfilterproxymodel_p.h
++++ b/kdeui/itemviews/kcategorizedsortfilterproxymodel_p.h
+@@ -212,10 +212,10 @@
+     Qt::SortOrder sortOrder;
+     Qt::CaseSensitivity sortCaseSensitivity;
+     int sortRole;
+-    bool sortLocaleAware;
++    bool sortLocaleAware : 1;
+ 
+-    bool dynamicSortFilter;
+-    bool categorizedModel;
++    bool dynamicSortFilter : 1;
++    bool categorizedModel : 1;
+ 
+     int filterColumn;
+     QRegExp filterRegExp;
+--- a/kdeui/itemviews/kextendableitemdelegate.cpp
++++ b/kdeui/itemviews/kextendableitemdelegate.cpp
+@@ -39,9 +39,9 @@
+ 	QHash<QWidget *, QPersistentModelIndex> extenderIndices;
+ 	QPixmap extendIcon;
+ 	QPixmap contractIcon;
++	int stateTick;
+ 	//mostly for quick startup - don't look for extenders while the view
+ 	//is being populated.
+-	int stateTick;
+ 	bool hasExtenders;
+ };
+ 
+--- a/kdeui/itemviews/ktreewidgetsearchline.h
++++ b/kdeui/itemviews/ktreewidgetsearchline.h
+@@ -107,6 +107,13 @@
+      */
+     QList<QTreeWidget *> treeWidgets() const;
+ 
++Q_SIGNALS:
++    /**
++     * This signal is emitted whenever an item gets hidden or unhidden due
++     * to it not matching or matching the search string.
++     */
++    void hiddenChanged(QTreeWidgetItem *, bool);
++
+   public Q_SLOTS:
+     /**
+      * Adds a QTreeWidget to the list of listviews filtered by this search line.
+@@ -146,6 +153,10 @@
+      * If this is set to true (the default) then the parents of matching items
+      * will be shown.
+      *
++     * \warning setKeepParentsVisible(true) does not have the expected effect
++     * on items being added to or removed from the view while a search is active.
++     * When a new search starts afterwards the behavior will be normal.
++     *
+      * @see keepParentsVisible
+      */
+     void setKeepParentsVisible( bool value );
+--- a/kdeui/itemviews/klistwidget.cpp
++++ b/kdeui/itemviews/klistwidget.cpp
+@@ -42,8 +42,8 @@
+         void _k_slotAutoSelect();
+ 
+         KListWidget *q;
+-        bool m_bUseSingle;
+-        bool m_bChangeCursorOverItem;
++        bool m_bUseSingle : 1;
++        bool m_bChangeCursorOverItem : 1;
+ 
+         QListWidgetItem* m_pCurrentItem;
+         QTimer* m_pAutoSelect;
+--- a/kdeui/itemviews/kcategorizedsortfilterproxymodel.cpp
++++ b/kdeui/itemviews/kcategorizedsortfilterproxymodel.cpp
+@@ -130,11 +130,11 @@
+ 
+ void KCategorizedSortFilterProxyModel::sort(int column, Qt::SortOrder order)
+ {
++    emit layoutAboutToBeChanged();
++
+     d->sortColumn = column;
+     d->sortOrder = order;
+ 
+-    emit layoutAboutToBeChanged();
+-
+     QModelIndexList sourceIndexes = d->storePersistentIndexes();
+ 
+     QMap<QModelIndex, Private::InternalInformation*>::const_iterator it = d->sourceIndexMap.constBegin();
+@@ -750,7 +750,13 @@
+ 
+ void KCategorizedSortFilterProxyModel::setCategorizedModel(bool categorizedModel)
+ {
++    if (categorizedModel == d->categorizedModel)
++    {
++        return;
++    }
++
+     d->categorizedModel = categorizedModel;
++    sort(d->sortColumn, d->sortOrder); // items need to be sorted again
+ }
+ 
+ void KCategorizedSortFilterProxyModel::setFilterWildcard(const QString &pattern)
+--- a/kdeui/itemviews/ktreewidgetsearchline.cpp
++++ b/kdeui/itemviews/ktreewidgetsearchline.cpp
+@@ -39,20 +39,18 @@
+ class KTreeWidgetSearchLine::Private
+ {
+   public:
+-    Private( KTreeWidgetSearchLine *_parent )
+-      : parent( _parent ),
++    Private( KTreeWidgetSearchLine *_q )
++      : q( _q ),
+         caseSensitive( Qt::CaseInsensitive ),
+-        activeSearch( false ),
+         keepParentsVisible( true ),
+         canChooseColumns( true ),
+         queuedSearches( 0 )
+     {
+     }
+ 
+-    KTreeWidgetSearchLine *parent;
++    KTreeWidgetSearchLine *q;
+     QList<QTreeWidget *> treeWidgets;
+     Qt::CaseSensitivity caseSensitive;
+-    bool activeSearch;
+     bool keepParentsVisible;
+     bool canChooseColumns;
+     QString search;
+@@ -87,7 +85,7 @@
+ 
+ void KTreeWidgetSearchLine::Private::_k_rowsInserted( const QModelIndex & parentIndex, int start, int end ) const
+ {
+-  QAbstractItemModel* model = qobject_cast<QAbstractItemModel*>( parent->sender() );
++  QAbstractItemModel* model = qobject_cast<QAbstractItemModel*>( q->sender() );
+   if ( !model )
+     return;
+ 
+@@ -101,17 +99,22 @@
+   if ( !widget )
+     return;
+ 
+-  QTreeWidgetWorkaround* widgetWorkaround = static_cast<QTreeWidgetWorkaround *>( widget );
+-  for ( int i = start; i <= end; ++i ) {
+-    if ( QTreeWidgetItem* item = widgetWorkaround->itemFromIndex( model->index( i, 0, parentIndex ) ) )
+-      item->treeWidget()->setItemHidden( item, !parent->itemMatches( item, parent->text() ) );
++  QTreeWidgetWorkaround* widgetW = static_cast<QTreeWidgetWorkaround *>(widget);
++  for (int i = start; i <= end; ++i) {
++      if (QTreeWidgetItem *item = widgetW->itemFromIndex(model->index(i, 0, parentIndex))) {
++          bool newHidden = !q->itemMatches(item, q->text());
++          if (item->isHidden() != newHidden) {
++              item->setHidden(newHidden);
++              emit q->hiddenChanged(item, newHidden);
++          }
++      }
+   }
+ }
+ 
+ void KTreeWidgetSearchLine::Private::_k_treeWidgetDeleted( QObject *object )
+ {
+   treeWidgets.removeAll( static_cast<QTreeWidget *>( object ) );
+-  parent->setEnabled( treeWidgets.isEmpty() );
++  q->setEnabled( treeWidgets.isEmpty() );
+ }
+ 
+ void KTreeWidgetSearchLine::Private::_k_slotColumnActivated( QAction *action )
+@@ -150,7 +153,7 @@
+     }
+   }
+ 
+-  parent->updateSearch();
++  q->updateSearch();
+ }
+ 
+ void KTreeWidgetSearchLine::Private::_k_slotAllVisibleColumns()
+@@ -160,7 +163,7 @@
+   else
+     searchColumns.clear();
+ 
+-  parent->updateSearch();
++  q->updateSearch();
+ }
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+@@ -170,17 +173,19 @@
+ 
+ void KTreeWidgetSearchLine::Private::checkColumns()
+ {
+-  canChooseColumns = parent->canChooseColumnsCheck();
++  canChooseColumns = q->canChooseColumnsCheck();
+ }
+ 
+-void KTreeWidgetSearchLine::Private::checkItemParentsNotVisible( QTreeWidget *treeWidget )
++void KTreeWidgetSearchLine::Private::checkItemParentsNotVisible(QTreeWidget *treeWidget)
+ {
+-  QTreeWidgetItemIterator it( treeWidget );
+-
+-  for ( ; *it; ++it ) {
+-    QTreeWidgetItem *item = *it;
+-    item->treeWidget()->setItemHidden( item, !parent->itemMatches( item, search ) );
+-  }
++    for (QTreeWidgetItemIterator it(treeWidget); *it; ++it) {
++        QTreeWidgetItem *item = *it;
++        bool newHidden = !q->itemMatches(item, search);
++        if (item->isHidden() != newHidden) {
++            item->setHidden(newHidden);
++            emit q->hiddenChanged(item, newHidden);
++        }
++    }
+ }
+ 
+ #include <kvbox.h>
+@@ -192,23 +197,23 @@
+  *  \return \c true if an item which should be visible is found, \c false if all items found should be hidden. If this function
+  *             returns true and \p highestHiddenParent was not 0, highestHiddenParent will have been shown.
+  */
+-bool KTreeWidgetSearchLine::Private::checkItemParentsVisible( QTreeWidgetItem* item )
++bool KTreeWidgetSearchLine::Private::checkItemParentsVisible(QTreeWidgetItem *item)
+ {
+-  QTreeWidget* treeWidget = item->treeWidget();
+-
+-  bool childMatch = false;
+-  for ( int i = 0; i < item->childCount(); ++i )
+-    childMatch |= checkItemParentsVisible( item->child( i ) );
++    QTreeWidget *treeWidget = item->treeWidget();
+ 
+-  // Should this item be shown? It should if any children should be, or if it matches.
+-  if ( childMatch || parent->itemMatches( item, search ) ) {
+-    treeWidget->setItemHidden( item, false );
+-    return true;
+-  }
++    bool childMatch = false;
++    for (int i = 0; i < item->childCount(); ++i) {
++        childMatch |= checkItemParentsVisible(item->child(i));
++    }
+ 
+-  treeWidget->setItemHidden( item, true );
++    // Should this item be shown? It should if any children should be, or if it matches.
++    bool newHidden = !childMatch && !q->itemMatches(item, search);
++    if (item->isHidden() != newHidden) {
++        item->setHidden(newHidden);
++        emit q->hiddenChanged(item, newHidden);
++    }
+ 
+-  return false;
++    return !newHidden;
+ }
+ 
+ 
+@@ -216,8 +221,8 @@
+ // public methods
+ ////////////////////////////////////////////////////////////////////////////////
+ 
+-KTreeWidgetSearchLine::KTreeWidgetSearchLine( QWidget *parent, QTreeWidget *treeWidget )
+-  : KLineEdit( parent ), d( new Private( this ) )
++KTreeWidgetSearchLine::KTreeWidgetSearchLine( QWidget *q, QTreeWidget *treeWidget )
++  : KLineEdit( q ), d( new Private( this ) )
+ {
+   connect( this, SIGNAL( textChanged( const QString& ) ),
+            this, SLOT( _k_queueSearch( const QString& ) ) );
+@@ -230,9 +235,9 @@
+   }
+ }
+ 
+-KTreeWidgetSearchLine::KTreeWidgetSearchLine( QWidget *parent,
++KTreeWidgetSearchLine::KTreeWidgetSearchLine( QWidget *q,
+                                               const QList<QTreeWidget *> &treeWidgets )
+-  : KLineEdit( parent ), d( new Private( this ) )
++  : KLineEdit( q ), d( new Private( this ) )
+ {
+   connect( this, SIGNAL( textChanged( const QString& ) ),
+            this, SLOT( _k_queueSearch( const QString& ) ) );
+@@ -529,7 +534,7 @@
+   queuedSearches++;
+   search = _search;
+ 
+-  QTimer::singleShot( 200, parent, SLOT( _k_activateSearch() ) );
++  QTimer::singleShot( 200, q, SLOT( _k_activateSearch() ) );
+ }
+ 
+ void KTreeWidgetSearchLine::Private::_k_activateSearch()
+@@ -537,7 +542,7 @@
+   --queuedSearches;
+ 
+   if ( queuedSearches == 0 )
+-    parent->updateSearch( search );
++    q->updateSearch( search );
+ }
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+--- a/kdeui/findreplace/kfind_p.h
++++ b/kdeui/findreplace/kfind_p.h
+@@ -96,8 +96,8 @@
+     KFind *q;
+     QPointer<QWidget>  findDialog;
+     int                   currentId;
+-    bool                  customIds;
+-    bool                  patternChanged;
++    bool                  customIds : 1;
++    bool                  patternChanged : 1;
+     QString               matchedPattern;
+     QHash<QString,Match>  incrementalPath;
+     Match *               emptyMatch;
+@@ -112,8 +112,8 @@
+     QString text; // the text set by setData
+     int index;
+     int matchedLength;
+-    bool dialogClosed;
+-    bool lastResult;
++    bool dialogClosed : 1;
++    bool lastResult : 1;
+ };
+ 
+ #endif // KFIND_P_H
+--- a/kdeui/findreplace/kfinddialog_p.h
++++ b/kdeui/findreplace/kfinddialog_p.h
+@@ -41,8 +41,8 @@
+         : q(q),
+         regexpDialog(0),
+         regexpDialogQueryDone(false),
+-        enabled(KFind::WholeWordsOnly | KFind::FromCursor |  KFind::SelectedText | KFind::CaseSensitive | KFind::FindBackwards | KFind::RegularExpression),
+         initialShowDone(false),
++        enabled(KFind::WholeWordsOnly | KFind::FromCursor |  KFind::SelectedText | KFind::CaseSensitive | KFind::FindBackwards | KFind::RegularExpression),
+         findExtension(0)
+         {}
+ 
+@@ -57,9 +57,9 @@
+ 
+     KFindDialog *q;
+     QDialog *regexpDialog;
+-    bool regexpDialogQueryDone;
++    bool regexpDialogQueryDone : 1;
++    bool initialShowDone : 1;
+     long enabled; // uses Options to define which search options are enabled
+-    bool initialShowDone;
+     QStringList findStrings;
+     QString pattern;
+     QWidget *findExtension;
+--- a/kdeui/CMakeLists.txt
++++ b/kdeui/CMakeLists.txt
+@@ -32,10 +32,7 @@
+ add_subdirectory( sonnet/tests )
+ 
+ ########### next target ###############
+-# Workaround to make kdeui compiles with enable-final: don't move kxmlguibuilder.cpp to an other place
+-# until we remove qt3 support into this file
+ set(kdeui_LIB_SRCS
+- xmlgui/kxmlguibuilder.cpp
+  actions/kactioncollection.cpp
+  actions/kaction.cpp
+  actions/kactionmenu.cpp
+@@ -69,6 +66,7 @@
+  dialogs/kconfigdialog.cpp
+  dialogs/kconfigdialogmanager.cpp
+  dialogs/kbugreport.cpp
++ dialogs/kdeprintdialog.cpp
+  dialogs/kdialog.cpp
+  dialogs/kedittoolbar.cpp
+  dialogs/kinputdialog.cpp
+@@ -206,6 +204,7 @@
+  widgets/kurllabel.cpp
+  widgets/kvbox.cpp
+  widgets/kxyselector.cpp
++ xmlgui/kxmlguibuilder.cpp
+  xmlgui/kxmlguiwindow.cpp
+  xmlgui/kmainwindowiface.cpp
+  xmlgui/kmenumenuhandler_p.cpp
+@@ -327,6 +326,7 @@
+  dialogs/kbugreport.h
+  dialogs/kconfigdialog.h
+  dialogs/kconfigdialogmanager.h
++ dialogs/kdeprintdialog.h
+  dialogs/kdialog.h
+  dialogs/kedittoolbar.h
+  dialogs/kinputdialog.h
+@@ -475,7 +475,7 @@
+   install(PROGRAMS kernel/start-session-bus.sh DESTINATION ${BIN_INSTALL_DIR} )
+ endif (Q_WS_MAC)
+ 
+-install( FILES colors/40.colors colors/Web.colors colors/Royal.colors colors/Rainbow.colors DESTINATION ${CONFIG_INSTALL_DIR}/colors)
++install( FILES colors/40.colors colors/Oxygen.colors colors/Web.colors colors/Royal.colors colors/Rainbow.colors DESTINATION ${CONFIG_INSTALL_DIR}/colors)
+ 
+ set( kded_globalaccel_SRCS shortcuts/kdedglobalaccel.cpp )
+ if ( Q_WS_X11 )
+--- a/kdeui/util/kstandardguiitem.cpp
++++ b/kdeui/util/kstandardguiitem.cpp
+@@ -164,7 +164,7 @@
+ 
+ KGuiItem clear()
+ {
+-  return KGuiItem( i18n( "C&lear" ), "locationbar-erase",
++  return KGuiItem( i18n( "C&lear" ), "edit-clear-locationbar",
+                    i18n( "Clear input" ),
+                    i18n( "Clear the input in the edit field" ) );
+ }
+--- a/kdeui/util/ksystemtrayicon.cpp
++++ b/kdeui/util/ksystemtrayicon.cpp
+@@ -64,8 +64,8 @@
+     KActionCollection* actionCollection;
+     KMenu* menu;
+     QWidget* window;
+-    bool onAllDesktops; // valid only when the parent widget was hidden
+-    bool hasQuit;
++    bool onAllDesktops : 1; // valid only when the parent widget was hidden
++    bool hasQuit : 1;
+ };
+ 
+ KSystemTrayIcon::KSystemTrayIcon( QWidget* parent )
+--- a/kdeui/util/kcrash.cpp
++++ b/kdeui/util/kcrash.cpp
+@@ -26,6 +26,7 @@
+  */
+ 
+ #include "kcrash.h"
++#include <kstandarddirs.h>
+ 
+ #include <config.h>
+ 
+@@ -61,6 +62,7 @@
+ static KCrash::HandlerType s_crashHandler = 0;
+ static char *s_appName = 0;
+ static char *s_appPath = 0;
++static char *s_drkonqiPath = 0;
+ static KCrash::CrashFlags s_flags = 0;
+ 
+ namespace KCrash
+@@ -84,6 +86,9 @@
+    */
+   if (s_emergencySaveFunction && !s_crashHandler)
+     s_crashHandler = defaultCrashHandler;
++
++  if (!s_drkonqiPath)
++        s_drkonqiPath = qstrdup(KStandardDirs::findExe("drkonqi").toLatin1().constData());
+ }
+ 
+ KCrash::HandlerType
+@@ -208,7 +213,7 @@
+           int i = 0;
+ 
+           // argument 0 has to be drkonqi
+-          argv[i++] = "drkonqi";
++          argv[i++] = s_drkonqiPath;
+ 
+ #if defined Q_WS_X11
+           // start up on the correct display
+@@ -378,7 +383,7 @@
+       _exit(253);
+     if (s_flags & KeepFDs)
+       closeAllFDs();
+-    execvp("drkonqi", const_cast< char** >( argv ));
++    execvp(s_drkonqiPath, const_cast< char** >( argv ));
+     fprintf( stderr, "KCrash failed to exec(), errno = %d\n", errno );
+     _exit(253);
+   default:
+@@ -563,6 +568,7 @@
+ 
+   server.sun_family = AF_UNIX;
+   strcpy(server.sun_path, sock_file);
++  printf("sock_file=%s\n", sock_file);
+   socklen = sizeof(server);
+   if(connect(s, (struct sockaddr *)&server, socklen) == -1)
+   {
+--- a/kdeui/util/kkeyserver_x11.cpp
++++ b/kdeui/util/kkeyserver_x11.cpp
+@@ -453,7 +453,7 @@
+ 	int symQt = keyQt & ~Qt::KeyboardModifierMask;
+ 
+ 	if( symQt < 0x1000 ) {
+-		*keySym = QChar(symQt).toLower().unicode();
++		*keySym = QChar(symQt).toUpper().unicode();
+ 		return true;
+ 	}
+ 
+@@ -477,7 +477,7 @@
+ 	*keyQt = Qt::Key_unknown;
+ 	if( keySym < 0x1000 ) {
+ 		if( keySym >= 'a' && keySym <= 'z' )
+-			*keyQt = QChar(keySym).toLower().unicode();
++			*keyQt = QChar(keySym).toUpper().unicode();
+ 		else
+ 			*keyQt = keySym;
+ 	}
+--- a/kdeui/util/kcompletion.cpp
++++ b/kdeui/util/kcompletion.cpp
+@@ -54,8 +54,8 @@
+     QString                myCurrentMatch;
+     KCompTreeNode *        myTreeRoot;
+     //QStringList            myRotations;
+-    bool                   myBeep;
+-    bool                   myIgnoreCase;
++    bool                   myBeep : 1;
++    bool                   myIgnoreCase : 1;
+     bool                   myHasMultipleMatches;
+     int                    myRotationIndex;
+ };
+--- a/security/crypto/crypto.cpp
++++ b/security/crypto/crypto.cpp
+@@ -271,7 +271,7 @@
+   grid->setMargin( KDialog::marginHint() );
+   grid->setSpacing( KDialog::spacingHint() );
+   // no need to parse kdeglobals.
+-  config = new KConfig("cryptodefaults", KConfig::CascadeConfig);
++  config = new KConfig("cryptodefaults", KConfig::NoGlobals);
+   policies = new KConfig("ksslpolicies", KConfig::SimpleConfig);
+   pcerts = new KConfig("ksslcertificates", KConfig::SimpleConfig);
+   authcfg = new KConfig("ksslauthmap", KConfig::SimpleConfig);
+@@ -877,12 +877,12 @@
+     mUseEFile->setChecked(true);
+     slotUseEFile();
+   }
+-  mEGDPath->setPath(cg.readPathEntry("EGDPath"));
++  mEGDPath->setPath(cg.readPathEntry("EGDPath", QString()));
+ 
+ 
+ #ifdef KSSL_HAVE_SSL
+   cg.changeGroup("OpenSSL");
+-  oPath->setUrl(cg.readPathEntry("Path"));
++  oPath->setUrl(cg.readPathEntry("Path", QString()));
+ #endif
+ 
+   KConfigGroup sslV3(config, "SSLv3");
+@@ -962,7 +962,7 @@
+   }
+ 
+   groups = _signers->list();
+-  KConfig sigcfg( "ksslcalist", KConfig::CascadeConfig );
++  KConfig sigcfg( "ksslcalist", KConfig::NoGlobals );
+   caList->clear();
+   for (QStringList::Iterator i = groups.begin();
+                              i != groups.end();
+@@ -1976,7 +1976,7 @@
+ 
+ 
+   QStringList groups = _signers->list();
+-  KConfig sigcfg( "ksslcalist", KConfig::CascadeConfig );
++  KConfig sigcfg( "ksslcalist", KConfig::NoGlobals );
+ 
+   for (QStringList::Iterator i = groups.begin();
+                              i != groups.end();
+--- a/security/crypto/crypto.desktop
++++ b/security/crypto/crypto.desktop
+@@ -3,7 +3,7 @@
+ Icon=preferences-desktop-cryptography
+ Type=Service
+ ServiceTypes=KCModule
+-Exec=kcmshell crypto
++Exec=kcmshell4 crypto
+ X-DocPath=kcontrol/crypto/index.html
+ 
+ X-KDE-Library=kcm_crypto
+@@ -16,6 +16,7 @@
+ Name[de]=Krypto
+ Name[el]=Κρυπτογράφηση
+ Name[es]=Criptografía
++Name[et]=Krüpto
+ Name[fa]=رمز
+ Name[he]=הצפנה
+ Name[hu]=Titkosítás
+@@ -24,11 +25,15 @@
+ Name[kn]=ಕ್ರಿಪ್ಟೋ
+ Name[ko]=암호화
+ Name[lt]=Šifravimas
++Name[lv]=Kriptogrāfija
++Name[nb]=Kryptering
+ Name[ne]=गुप्त
+ Name[pa]=ਕਰਿਪਟੂ
+ Name[pt]=Cifra
+ Name[ru]=Шифрование
+ Name[sl]=Šifriranje
++Name[sr]=Шифровање
++Name[sr at latin]=Šifrovanje
+ Name[sv]=Krypto
+ Name[th]=การเข้ารหัส
+ Name[vi]=Mật mã
+@@ -43,6 +48,7 @@
+ Comment[el]=Ρύθμιση SSL, διαχείριση πιστοποιητικών, και άλλες ρυθμίσεις κρυπτογραφίας
+ Comment[en_GB]=Configure SSL, manage certificates and other cryptography settings
+ Comment[es]=Configurar SSL, gestionar certificados y otras preferencias de criptografía
++Comment[et]=SSL-i seadistamine, sertifikaatide haldamine ja muud krüptoseadistused
+ Comment[fa]=پیکربندی SSL، مدیریت گواهی‌نامه‌ها، و تنظیمات رمزنگاری دیگر
+ Comment[ga]=Cumraigh SSL, bainistigh teastais, agus socruithe criptiúcháin eile
+ Comment[he]=שינוי הגדרות SSL, ניהול תעודות והגדרות הצפנה אחרות
+@@ -50,15 +56,20 @@
+ Comment[it]=Configura SSL, gestisce i certificati ed altre impostazioni di crittografia
+ Comment[ja]=SSL の設定、証明書の管理、その他の暗号作成形式の設定
+ Comment[kk]=SSL баптаулары, күаліктерді басқару және басқа криптография параметрлері
++Comment[km]=កំណត់​រចនា​សម្ព័ន្ធ SSL គ្រប់គ្រង​វិញ្ញាបនបត្រ និង​ការ​កំណត់​កូដសាស្ដ្រ
+ Comment[kn]=SSL ಅನ್ನು ಸಂರಚಿಸು, ಪ್ರಮಾಣಪತ್ರಗಳನ್ನು ನಿಭಾಯಿಸು, ಮತ್ತು ಇತರ ಗೂಢಲಿಪಿಶಾಸ್ತ್ರ (ಕ್ರಿಪ್ಟೋಗ್ರಫಿ) ಸಂಯೋಜನೆಗಳು
+ Comment[ko]=SSL과 같은 암호화를 설정하고, 인증서를 관리합니다
+ Comment[lt]=Derina SSL, tvarko sertifikatus ir kitus šifravimo parametrus
++Comment[lv]=Konfigurē SSL, pārvalda sertifikātus un citus kriptogrāfijas iestatījumus
++Comment[nb]=Oppsett av SSL, behandling av sertifikater og andre innstillinger for kryptering
+ Comment[nds]=SSL inrichten, Zertifikaten plegen un anner Verslötel-Instellen
+ Comment[ne]=SSL कन्फिगरेसन, प्रमाणपत्र प्रबन्ध, र अन्य गुप्तिकरण सेटिङ
+ Comment[nl]=Stel SSL in, beheer certificaten en configureer andere cryptografische instellingen
+ Comment[pt]=Configurar o SSL, gerir os certificados e outras opções de criptografia
+ Comment[pt_BR]=Configura SSL, gerencia certificados e outras configurações de criptografia
+ Comment[sl]=Nastavljanje SSL, upravljanje s potrdili in ostale nastavitve šifriranja
++Comment[sr]=Подешавање ССЛ-а, управљање сертификатима, и друге криптографске поставке
++Comment[sr at latin]=Podešavanje SSL-a, upravljanje sertifikatima, i druge kriptografske postavke
+ Comment[sv]=Anpassa SSL, hantera certifikat och andra kryptografiska inställningar
+ Comment[th]=ปรับแต่ง SSL, จัดการใบรับรอง, และการตั้งค่าเกี่ยวกับการเข้ารหัสอื่นๆ
+ Comment[vi]=Cấu hình SSL, quản lý chứng nhận và các thiết lập mật mã khác
+@@ -73,6 +84,7 @@
+ Keywords[de]=Crypto, Krypto, Kryptographie, Verschlüsselung, SSL, https, Zertifikate, Chiffren, TLS, sicher, Sicherheit
+ Keywords[el]=Κρυπτογράφηση,Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,πιστοποιητικά,ciphers,TLS,secure,security,ασφαλές,ασφάλεια
+ Keywords[es]=Criptografía,cifrado,SSL,https,certificados,código,códigos,TLS,seguro,seguridad
++Keywords[et]=Krüpto,Krüptograafia,krüptimine,SSL,https,sertificaadid,šifrid,TLS,turvalisus
+ Keywords[fa]=رمز، Krypto، رمزنگاری، رمزبندی، SSL، https، گواهی‌نامه‌ها، رمزها، TLS، امن، امنیت
+ Keywords[ga]=Crypto,Krypto,cripteagrafaíocht,criptiú,SSL,https,teastais,sifir,TLS,daingean,slándáil
+ Keywords[he]=הצפנה,SSL,https,תעודות,צפנים,TLS,אבטחה
+@@ -81,11 +93,15 @@
+ Keywords[ja]=暗号化,Krypto,暗号作成形式,暗号化,SSL,http,証明書,暗号,TLS,セキュア,セキュリティ
+ Keywords[ko]=암호화,보안,SSL,https,인증서,TLS
+ Keywords[lt]=Crypto,Krypto,Cryptography,kriptografija,encryption,šifravimas,SSL,https,certificates,sertifikatai,ciphers,šifrai,TLS,secure,saugus,security,saugumas,apsauga
++Keywords[lv]=Kriptogrāfija,šifrēšana,SSL,https,sertifikāti,čiperi,TLS,drošs,drošība
++Keywords[nb]=Crypto,Krypto,Kryptografi,kryptering,SSL,https,sertifikater,chifre,TLS,sikker,sikkerhet
+ Keywords[nds]=Crypto,Krypto,Kryptografie,Verslöteln,SSL,https,Zertifikaten,Verslötelmetoden,TLS,seker,Sekerheit
+ Keywords[nl]=Crypto,Krypto,Cryptografie,encryptie,SSL,https,certificaten,ciphers,TLS,secure,security,veiligheid,beveiliging,versleuteling,
+ Keywords[pt]=Cifra,Criptografia,encriptação,SSL,HTTPS,certificados,cifras,TLS,seguro,segurança
+ Keywords[pt_BR]=Crypto,Krypto,Criptografia,encriptação,SSL,https,certificados,cifras,TLS,seguro,segurança
+ Keywords[sl]=Šifriranje,šifre,šifra,SSL,HTTPS,potrdila,TLS,varnost
++Keywords[sr]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,крипто,криптографија,шифровање,ССЛ,ХТТПС,сертификати,шифрари,ТЛС,безбедност
++Keywords[sr at latin]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,kripto,kriptografija,šifrovanje,SSL,HTTPS,sertifikati,šifrari,TLS,bezbednost
+ Keywords[sv]=Krypto,Kryptografi,kryptering,SSL,https,certifikat,chiffer,TLS,säker,säkerhet
+ Keywords[th]=เข้า-ถอดรหัส,Krypto,เรื่องเกี่ยวกับการเข้า-ถอดรหัส,การเข้ารหัส,SSL,https,ใบรับรอง,ciphers,TLS,ปลอดภัย,ความปลอดภัย
+ Keywords[vi]=Crypto,mật mã,mã hoá,Krypto,Cryptography,encryption,SSL,https,certificates,chứng nhận,ciphers,TLS,secure,bảo mật,security
+--- a/security/kcert/kcertpart.cc
++++ b/security/kcert/kcertpart.cc
+@@ -751,7 +751,7 @@
+ 		if (!_silentImport)
+ 			KMessageBox::information(_frame, i18n("Certificate has been successfully imported into KDE.\nYou can manage your certificate settings from the KDE Control Center."), i18n("Certificate Import"));
+ 	} else if (_ca) {
+-		KConfig cfg("ksslcalist", KConfig::CascadeConfig);
++		KConfig cfg("ksslcalist", KConfig::NoGlobals);
+ 		if (cfg.hasGroup(_ca->getSubject())) {
+ 			QString msg = _curName + '\n' + i18n("A certificate with that name already exists. Are you sure that you wish to replace it?");
+ 			int rc= KMessageBox::warningContinueCancel(_frame, msg, i18n("Certificate Import"),KGuiItem(i18n("Replace")));
+@@ -784,7 +784,7 @@
+ 
+ 
+ void KCertPart::slotLaunch() {
+-	QProcess::startDetached("kcmshell", QStringList() << "crypto");
++	QProcess::startDetached("kcmshell4", QStringList() << "crypto");
+ }
+ 
+ 
+--- a/security/kcert/kcertpart.desktop
++++ b/security/kcert/kcertpart.desktop
+@@ -29,11 +29,12 @@
+ Comment[it]=Gestione integrabile dei certificati personali
+ Comment[ja]=埋め込み可能な個人証明書マネージャ
+ Comment[kk]=Ендірілетін дербес куәлік менеджері
+-Comment[km]=កម្មវិធី​គ្រប់គ្រង​វិញ្ញាបនបត្រ​ឯកជន​ដែល​អាច​បង្កប់
++Comment[km]=កម្មវិធី​គ្រប់គ្រង​វិញ្ញាបនបត្រ​ឯកជន​ដែល​អាច​បង្កប់​បាន
+ Comment[kn]=ಹುದುಗಿಸಬಹುದಾದ (ಎಂಬೆಡಬಲ್) ವೈಯಕ್ತಿಕ ಪ್ರಮಾಣಪತ್ರ ವ್ಯವಸ್ಥಾಪಕ
+ Comment[ko]=첨부할 수 있는 개인 인증서 관리자
+ Comment[lb]=Abettbare perséinlechen Zertifikatsmanager
+ Comment[lt]=Įdedama asmeninių sertifikatų tvarkyklė
++Comment[lv]=Iegulstams personīgo sertifikātu pārvaldnieks
+ Comment[mk]=Вгнездлив менаџер на лични сертификати
+ Comment[ms]=Pengurus Sijil Peribadi Boleh Serta
+ Comment[nb]=Innebyggbar personlig sertifikathåndterer
+@@ -49,8 +50,8 @@
+ Comment[ru]=Встраиваемый персональный менеджер сертификатов
+ Comment[se]=Vuojuhanláhkái persuvnnalaš duođaštusaid gieđahalli
+ Comment[sl]=Vgradljivi osebni upravljalnik certifikatov
+-Comment[sr]=Уградиви менаџер личних сертификата
+-Comment[sr at latin]=Ugradivi menadžer ličnih sertifikata
++Comment[sr]=Угњездиви менаџер личних сертификата
++Comment[sr at latin]=Ugnjezdivi menadžer ličnih sertifikata
+ Comment[sv]=Inbäddningsbar personlig certifikatshanterare
+ Comment[ta]=உட்பொதிந்த சொந்தச் சான்றிதழ் மேலாளர்
+ Comment[te]=పొదగబడె వక్తిగత ప్రమాణ పత్రాల అభికర్త
+@@ -74,6 +75,8 @@
+ Name[cy]=KRhanTyst
+ Name[eo]=Atestilo-parto
+ Name[kn]=ಕೆಸರ್ಟ್ ಪಾರ್ಟ್
++Name[sr]=Сертификатски део
++Name[sr at latin]=Sertifikatski deo
+ Name[sv]=Kcertpart
+ Name[ta]=கேசான்றிதழ்பகுதி
+ Name[te]=కెసెర్ట్ పార్ట్
+--- a/kutils/kprintpreview.h
++++ b/kutils/kprintpreview.h
+@@ -26,14 +26,38 @@
+ 
+ class KPrintPreviewPrivate;
+ 
++/**
++ * KPrintPreview provides a print preview dialog.
++ *
++ * Use it like this:
++ *
++ * @code
++ * QPrinter printer;
++ * KPrintPreview preview(&printer);
++ * doPrint(printer); // draws to the QPrinter
++ * preview.exec();
++ * @endcode
++ */
+ class KUTILS_EXPORT KPrintPreview : public KDialog
+ {
+     Q_OBJECT
+ 
+ public:
++    /**
++     * Create a KPrintPreview object.
++     *
++     * This will change the settings on the QPrinter, so you
++     * should not re-use the QPrinter object for printing
++     * normally.
++     *
++     * @param printer pointer to a QPrinter to configure for
++     *                print preview
++     * @param parent  pointer to the parent widget for the dialog
++     */
+     explicit KPrintPreview(QPrinter *printer, QWidget *parent = 0);
+     virtual ~KPrintPreview();
+ 
++protected:
+     void showEvent(QShowEvent *event);
+ 
+ private:
+--- a/kutils/ksettings/dispatcher.cpp
++++ b/kutils/ksettings/dispatcher.cpp
+@@ -104,10 +104,11 @@
+ 
+ void DispatcherPrivate::unregisterComponent(QObject *obj)
+ {
+-    kDebug(701) ;
+     QString name = m_componentName[obj];
+     m_componentName.remove(obj); //obj will be destroyed when we return, so we better remove this entry
+     --(m_componentInfo[name].count);
++    kDebug(701) << "componentName=" << name << "refcount=" << m_componentInfo[name].count;
++    Q_ASSERT(m_componentInfo[name].count >= 0);
+     if (m_componentInfo[name].count == 0) {
+         m_componentInfo.remove(name);
+     }
+--- a/kutils/ksettings/dispatcher_p.h
++++ b/kutils/ksettings/dispatcher_p.h
+@@ -39,6 +39,8 @@
+     typedef QPair<QObject*, const char*> Slot;
+     QList<Slot> slotList;
+     int count;
++
++    ComponentInfo() : count(0) {}
+ };
+ 
+ class DispatcherPrivate : public QObject
+--- a/kdecore/kernel/kautostart.cpp
++++ b/kdecore/kernel/kautostart.cpp
+@@ -129,7 +129,7 @@
+ 
+ QString KAutostart::commandToCheck() const
+ {
+-    return d->df->desktopGroup().readPathEntry( "TryExec" );
++    return d->df->desktopGroup().readPathEntry( "TryExec", QString() );
+ }
+ 
+ void KAutostart::setCommandToCheck(const QString& exec)
+@@ -179,12 +179,12 @@
+ 
+ QStringList KAutostart::allowedEnvironments() const
+ {
+-    return d->df->desktopGroup().readEntry( "OnlyShowIn", QStringList(), ';' );
++    return d->df->desktopGroup().readXdgListEntry( "OnlyShowIn" );
+ }
+ 
+ void KAutostart::setAllowedEnvironments(const QStringList& environments)
+ {
+-    d->df->desktopGroup().writeEntry( "OnlyShowIn", environments, ';' );
++    d->df->desktopGroup().writeXdgListEntry( "OnlyShowIn", environments );
+ }
+ 
+ void KAutostart::addToAllowedEnvironments(const QString& environment)
+@@ -216,12 +216,12 @@
+ 
+ QStringList KAutostart::excludedEnvironments() const
+ {
+-    return d->df->desktopGroup().readEntry("NotShowIn", QStringList(), ';');
++    return d->df->desktopGroup().readXdgListEntry("NotShowIn");
+ }
+ 
+ void KAutostart::setExcludedEnvironments(const QStringList& environments)
+ {
+-    d->df->desktopGroup().writeEntry("NotShowIn", environments, ';');
++    d->df->desktopGroup().writeXdgListEntry("NotShowIn", environments);
+ }
+ 
+ void KAutostart::addToExcludedEnvironments(const QString& environment)
+--- a/kdecore/kernel/kcmdlineargs.cpp
++++ b/kdecore/kernel/kcmdlineargs.cpp
+@@ -167,8 +167,8 @@
+ 
+     int argc; // The original argc
+     char **argv; // The original argv
+-    bool parsed; // Whether we have parsed the arguments since calling init
+-    bool ignoreUnknown; // Ignore unknown options and arguments
++    bool parsed : 1; // Whether we have parsed the arguments since calling init
++    bool ignoreUnknown : 1; // Ignore unknown options and arguments
+     QString mCwd; // Current working directory. Important for KUnqiueApp!
+     KCmdLineArgs::StdCmdLineArgs mStdargs;
+ 
+@@ -681,6 +681,8 @@
+                int p = nextOption.indexOf(' ');
+                if (p > 0)
+                   nextOption = nextOption.left(p);
++               if (nextOption.startsWith('!'))
++                  nextOption = nextOption.mid(1);
+                if (nextOption.startsWith("no"))
+                {
+                   nextOption = nextOption.mid(2);
+--- a/kdecore/kernel/ktoolinvocation_x11.cpp
++++ b/kdecore/kernel/ktoolinvocation_x11.cpp
+@@ -240,7 +240,7 @@
+     QString group = defaultsGrp.readEntry("Profile","Default");
+ 
+     KConfigGroup profileGrp(&config, QString("PROFILE_%1").arg(group) );
+-    QString command = profileGrp.readPathEntry("EmailClient");
++    QString command = profileGrp.readPathEntry("EmailClient", QString());
+ 
+     QString to, cc, bcc;
+     if (command.isEmpty() || command == QLatin1String("kmail")
+--- a/kdecore/kernel/kstandarddirs.cpp
++++ b/kdecore/kernel/kstandarddirs.cpp
+@@ -67,9 +67,9 @@
+           checkRestrictions(true)
+     { }
+ 
+-    bool restrictionsActive;
+-    bool dataRestrictionActive;
+-    bool checkRestrictions;
++    bool restrictionsActive : 1;
++    bool dataRestrictionActive : 1;
++    bool checkRestrictions : 1;
+     QMap<QByteArray, bool> restrictions;
+     QStringList xdgdata_prefixes;
+     QStringList xdgconf_prefixes;
+--- a/kdecore/services/kservice_p.h
++++ b/kdecore/services/kservice_p.h
+@@ -41,6 +41,7 @@
+     }
+ 
+     void init(const KDesktopFile *config, KService* q);
++    void parseActions(const KDesktopFile *config, KService* q);
+     void load( QDataStream& );
+     virtual void save( QDataStream& );
+ 
+@@ -77,8 +78,9 @@
+     QMap<QString,QVariant> m_mapProps;
+     QStringList m_lstKeywords;
+     QString m_strGenName;
+-    bool m_bAllowAsDefault;
+-    bool m_bTerminal;
+-    bool m_bValid;
++    QList<KServiceAction> m_actions;
++    bool m_bAllowAsDefault : 1;
++    bool m_bTerminal : 1;
++    bool m_bValid : 1;
+ };
+ #endif
+--- a/kdecore/services/kservicegroup_p.h
++++ b/kdecore/services/kservicegroup_p.h
+@@ -64,11 +64,11 @@
+     void parseAttribute( const QString &item ,  bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool & showInlineAlias ,int &inlineValue );
+ 
+ 
+-    bool m_bNoDisplay;
+-    bool m_bShowEmptyMenu;
+-    bool m_bShowInlineHeader;
+-    bool m_bInlineAlias;
+-    bool m_bAllowInline;
++    bool m_bNoDisplay : 1;
++    bool m_bShowEmptyMenu : 1;
++    bool m_bShowInlineHeader : 1;
++    bool m_bInlineAlias : 1;
++    bool m_bAllowInline : 1;
+     int m_inlineValue;
+     QStringList suppressGenericNames;
+     QString directoryEntryPath;
+--- a/kdecore/services/kplugininfo.desktop
++++ b/kdecore/services/kplugininfo.desktop
+@@ -52,8 +52,8 @@
+ Name[ru]=Сведения о модуле KDE
+ Name[se]=Dieđut KDE-moduvlla birra
+ Name[sl]=Informacija o vstavkih v KDE
+-Name[sr]=Информација о KDE dodatku
+-Name[sr at latin]=Informacija o KDE dodatku
++Name[sr]=Подаци о КДЕ прикључку
++Name[sr at latin]=Podaci o KDE priključku
+ Name[sv]=KDE-insticksinformation
+ Name[ta]=KDE சொருகுப்பொருள் தகவல்
+ Name[te]=కెడిఈ ప్లగిన్ సమాచారం
+--- /dev/null
++++ b/kdecore/services/kserviceaction.h
+@@ -0,0 +1,120 @@
++/* This file is part of the KDE project
++   Copyright 2007 David Faure <faure at kde.org>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License as published by the Free Software Foundation; either
++   version 2 of the License, or (at your option) any later version.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++
++#ifndef KSERVICEACTION_H
++#define KSERVICEACTION_H
++
++#include <kdecore_export.h>
++#include <QtCore/QSharedDataPointer>
++class QVariant;
++class KServiceActionPrivate;
++
++/**
++ * Represents an action in a .desktop file
++ * Actions are defined with the config key Actions in the [Desktop Entry]
++ * group, followed by one group per action, as per the desktop entry standard.
++ * @see KService::actions
++ */
++class KDECORE_EXPORT KServiceAction
++{
++public:
++    /**
++     * Creates a KServiceAction.
++     * Normally you don't have to do this, KService creates the actions
++     * when parsing the .desktop file.
++     */
++    KServiceAction(const QString& name, const QString& text,
++                   const QString& icon, const QString& exec,
++                   bool noDisplay = false);
++    /**
++     * @internal
++     * Needed for operator>>
++     */
++    KServiceAction();
++    /**
++     * Destroys a KServiceAction.
++     */
++    ~KServiceAction();
++
++    /**
++     * Copy constructor
++     */
++    KServiceAction(const KServiceAction& other);
++    /**
++     * Assignment operator
++     */
++    KServiceAction& operator=(const KServiceAction& other);
++
++    /**
++     * Sets the action's internal data to the given @p userData.
++     */
++    void setData( const QVariant& userData );
++    /**
++     * @return the action's internal data.
++     */
++    QVariant data() const;
++
++    /**
++     * @return the action's internal name
++     * For instance Actions=Setup;... and the group [Desktop Action Setup]
++     * define an action with the name "Setup".
++     */
++    QString name() const;
++
++    /**
++     * @return the action's text, as defined by the Name key in the desktop action group
++     */
++    QString text() const;
++
++    /**
++     * @return the action's icon, as defined by the Icon key in the desktop action group
++     */
++    QString icon() const;
++
++    /**
++     * @return the action's exec command, as defined by the Exec key in the desktop action group
++     */
++    QString exec() const;
++
++    /**
++     * Returns whether the action should be suppressed in menus.
++     * This is useful for having actions with a known name that the code
++     * looks for explicitely, like Setup and Root for kscreensaver actions,
++     * and which should not appear in popup menus.
++     * @return true to suppress this service
++     */
++    bool noDisplay() const;
++
++    /**
++     * Returns whether the action is a separator.
++     * This is true when the Actions key contains "_SEPARATOR_".
++     */
++    bool isSeparator() const;
++
++private:
++    QSharedDataPointer<KServiceActionPrivate> d;
++    friend KDECORE_EXPORT QDataStream& operator>>( QDataStream& str, KServiceAction& act );
++    friend KDECORE_EXPORT QDataStream& operator<<( QDataStream& str, const KServiceAction& act );
++};
++
++KDECORE_EXPORT QDataStream& operator>>( QDataStream& str, KServiceAction& act );
++KDECORE_EXPORT QDataStream& operator<<( QDataStream& str, const KServiceAction& act );
++
++#endif /* KSERVICEACTION_H */
++
+--- a/kdecore/services/kservice.h
++++ b/kdecore/services/kservice.h
+@@ -21,6 +21,7 @@
+ #ifndef KSERVICE_H
+ #define KSERVICE_H
+ 
++#include "kserviceaction.h"
+ #include <QtCore/QStringList>
+ #include <QtCore/QVariant>
+ #include <klibloader.h>
+@@ -305,6 +306,11 @@
+     bool allowAsDefault() const;
+ 
+     /**
++     * Returns the actions defined in this desktop file
++     */
++    QList<KServiceAction> actions() const;
++
++    /**
+      * Checks whether this service can handle several files as
+      * startup arguments.
+      * @return true if multiple files may be passed to this service at
+--- a/kdecore/services/kservicetypeprofile.cpp
++++ b/kdecore/services/kservicetypeprofile.cpp
+@@ -91,7 +91,7 @@
+         // See writeServiceTypeProfile for a description of the file format.
+         // ### Since this new format names groups after servicetypes maybe we can even
+         // avoid doing any init upfront, and just look up the group when asked...
+-        KConfig configFile( "servicetype_profilerc", KConfig::CascadeConfig );
++        KConfig configFile( "servicetype_profilerc", KConfig::NoGlobals );
+         const QStringList tmpList = configFile.groupList();
+         for (QStringList::const_iterator aIt = tmpList.begin();
+              aIt != tmpList.end(); ++aIt) {
+@@ -115,7 +115,7 @@
+         }
+     }
+ 
+-    KConfig profilerc( "profilerc", KConfig::CascadeConfig );
++    KConfig profilerc( "profilerc", KConfig::NoGlobals );
+ 
+     const QStringList tmpList = profilerc.groupList();
+     for (QStringList::const_iterator aIt = tmpList.begin();
+--- /dev/null
++++ b/kdecore/services/kserviceaction.cpp
+@@ -0,0 +1,127 @@
++/* This file is part of the KDE project
++   Copyright 2007 David Faure <faure at kde.org>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License as published by the Free Software Foundation; either
++   version 2 of the License, or (at your option) any later version.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++#include "kserviceaction.h"
++#include <QVariant>
++
++class KServiceActionPrivate : public QSharedData
++{
++public:
++    KServiceActionPrivate(const QString& name, const QString& text,
++                          const QString& icon, const QString& exec,
++                          bool noDisplay)
++        : m_name(name), m_text(text), m_icon(icon), m_exec(exec), m_noDisplay(noDisplay) {}
++    QString m_name;
++    QString m_text;
++    QString m_icon;
++    QString m_exec;
++    QVariant m_data;
++    bool m_noDisplay;
++    // warning keep QDataStream operators in sync if adding data here
++};
++
++KServiceAction::KServiceAction()
++    : d(new KServiceActionPrivate(QString(), QString(), QString(), QString(), false))
++{
++}
++
++KServiceAction::KServiceAction(const QString& name, const QString& text,
++                               const QString& icon, const QString& exec,
++                               bool noDisplay)
++    : d(new KServiceActionPrivate(name, text, icon, exec, noDisplay))
++{
++}
++
++KServiceAction::~KServiceAction()
++{
++}
++
++KServiceAction::KServiceAction(const KServiceAction& other)
++    : d(other.d)
++{
++}
++
++KServiceAction& KServiceAction::operator=(const KServiceAction& other)
++{
++    d = other.d;
++    return *this;
++}
++
++QVariant KServiceAction::data() const
++{
++     return d->m_data;
++}
++
++void KServiceAction::setData( const QVariant& data )
++{
++     d->m_data = data;
++}
++
++QString KServiceAction::name() const
++{
++    return d->m_name;
++}
++
++QString KServiceAction::text() const
++{
++    return d->m_text;
++}
++
++QString KServiceAction::icon() const
++{
++    return d->m_icon;
++}
++
++QString KServiceAction::exec() const
++{
++    return d->m_exec;
++}
++
++bool KServiceAction::noDisplay() const
++{
++    return d->m_noDisplay;
++}
++
++bool KServiceAction::isSeparator() const
++{
++    return d->m_name == QLatin1String("_SEPARATOR_");
++}
++
++QDataStream& operator>>( QDataStream& str, KServiceAction& act )
++{
++    KServiceActionPrivate* d = act.d;
++    str >> d->m_name;
++    str >> d->m_text;
++    str >> d->m_icon;
++    str >> d->m_exec;
++    str >> d->m_data;
++    str >> d->m_noDisplay;
++    return str;
++}
++
++QDataStream& operator<<( QDataStream& str, const KServiceAction& act )
++{
++    const KServiceActionPrivate* d = act.d;
++    str << d->m_name;
++    str << d->m_text;
++    str << d->m_icon;
++    str << d->m_exec;
++    str << d->m_data;
++    str << d->m_noDisplay;
++    return str;
++}
+--- a/kdecore/services/kmimetypetrader.h
++++ b/kdecore/services/kmimetypetrader.h
+@@ -161,7 +161,7 @@
+     {
+         const KService::List offers = self()->query(mimeType, serviceType, constraint);
+         Q_FOREACH (const KService::Ptr &ptr, offers) {
+-            T *component = ptr->createInstance<T>(parent, args, error);
++            T *component = ptr->template createInstance<T>(parent, args, error);
+             if (component) {
+                 if (error)
+                     error->clear();
+--- a/kdecore/services/kservice.cpp
++++ b/kdecore/services/kservice.cpp
+@@ -48,7 +48,7 @@
+     bool absPath = !QDir::isRelativePath(entryPath);
+ 
+     // TODO: it makes sense to have a KConstConfigGroup I guess
+-    KConfigGroup desktopGroup = const_cast<KDesktopFile*>(config)->desktopGroup();
++    const KConfigGroup desktopGroup = const_cast<KDesktopFile*>(config)->desktopGroup();
+     QMap<QString, QString> entryMap = desktopGroup.entryMap();
+ 
+     entryMap.remove("Encoding"); // reserved as part of Desktop Entry Standard
+@@ -65,11 +65,6 @@
+     entryMap.remove("Name");
+     if ( m_strName.isEmpty() )
+     {
+-        if (desktopGroup.readEntry( "Exec" ).isEmpty())
+-        {
+-            m_bValid = false;
+-            return;
+-        }
+         // Try to make up a name.
+         m_strName = entryPath;
+         int i = m_strName.lastIndexOf('/');
+@@ -98,6 +93,20 @@
+         return;
+     }
+ 
++    m_strExec = desktopGroup.readPathEntry( "Exec", QString() );
++    entryMap.remove("Exec");
++
++    if ( m_strType == "Application" ) {
++        // It's an application? Should have an Exec line then, otherwise we can't run it
++        if (m_strExec.isEmpty()) {
++            kWarning(7012) << "The desktop entry file " << entryPath
++                           << " has Type=" << m_strType
++                           << " but no Exec line" << endl;
++            m_bValid = false;
++            return;
++        }
++    }
++
+     // In case Try Exec is set, check if the application is available
+     if (!config->tryExec()) {
+         q->setDeleted( true );
+@@ -139,29 +148,27 @@
+     if (pos != -1)
+         _name = _name.left(pos);
+ 
+-    m_strExec = desktopGroup.readPathEntry( "Exec" );
+-    entryMap.remove("Exec");
+-
+     m_strIcon = desktopGroup.readEntry( "Icon" );
+     entryMap.remove("Icon");
+     m_bTerminal = desktopGroup.readEntry( "Terminal", false); // should be a property IMHO
+     entryMap.remove("Terminal");
+     m_strTerminalOptions = desktopGroup.readEntry( "TerminalOptions" ); // should be a property IMHO
+     entryMap.remove("TerminalOptions");
+-    m_strPath = desktopGroup.readPathEntry( "Path" );
++    m_strPath = desktopGroup.readPathEntry( "Path", QString() );
+     entryMap.remove("Path");
+     m_strComment = config->readComment();
+     entryMap.remove("Comment");
+     m_strGenName = config->readGenericName();
+     entryMap.remove("GenericName");
+     QString _untranslatedGenericName = desktopGroup.readEntryUntranslated( "GenericName" );
+-    entryMap.insert("UntranslatedGenericName", _untranslatedGenericName);
++    if (!_untranslatedGenericName.isEmpty())
++        entryMap.insert("UntranslatedGenericName", _untranslatedGenericName);
+ 
+     m_lstKeywords = desktopGroup.readEntry("Keywords", QStringList());
+     entryMap.remove("Keywords");
+     m_lstKeywords += desktopGroup.readEntry("X-KDE-Keywords", QStringList());
+     entryMap.remove("X-KDE-Keywords");
+-    categories = desktopGroup.readEntry("Categories", QStringList(), ';');
++    categories = desktopGroup.readXdgListEntry("Categories");
+     entryMap.remove("Categories");
+     m_strLibrary = desktopGroup.readEntry( "X-KDE-Library" );
+     entryMap.remove("X-KDE-Library");
+@@ -170,13 +177,17 @@
+     entryMap.remove("ServiceTypes");
+     m_lstServiceTypes += desktopGroup.readEntry( "X-KDE-ServiceTypes", QStringList() );
+     entryMap.remove("X-KDE-ServiceTypes");
+-    m_lstServiceTypes += desktopGroup.readEntry( "MimeType", QStringList(), ';' ); // freedesktop.org standard
++    m_lstServiceTypes += desktopGroup.readXdgListEntry( "MimeType" );
+     entryMap.remove("MimeType");
+ 
+     if ( m_strType == "Application" && !m_lstServiceTypes.contains("Application") )
+         // Applications implement the service type "Application" ;-)
+         m_lstServiceTypes += "Application";
+ 
++    if (entryMap.contains("Actions")) {
++        parseActions(config, q);
++    }
++
+     QString dbusStartupType = desktopGroup.readEntry("X-DBUS-StartupType").toLower();
+     //Compatibility
+     if( dbusStartupType.isEmpty() && desktopGroup.hasKey("X-DCOP-ServiceType"))
+@@ -207,18 +218,52 @@
+     // break BC, so we have to store it in m_mapProps.
+ //  qDebug("Path = %s", entryPath.toLatin1().constData());
+     QMap<QString,QString>::ConstIterator it = entryMap.begin();
+-    for( ; it != entryMap.end();++it)
+-    {
+-//     qDebug("   Key = %s Data = %s", it.key().toLatin1().data(), it->toLatin1().data());
+-        m_mapProps.insert( it.key(), QVariant( *it));
++    for( ; it != entryMap.end();++it) {
++        const QString key = it.key();
++        // do not store other translations like Name[fr]; kbuildsycoca will rerun if we change languages anyway
++        if (!key.contains('[')) {
++            //kDebug(7012) << "  Key =" << key << " Data =" << *it;
++            m_mapProps.insert(key, QVariant(*it));
++        }
++    }
++}
++
++void KServicePrivate::parseActions(const KDesktopFile *config, KService* q)
++{
++    const QStringList keys = config->readActions();
++    if (keys.isEmpty())
++        return;
++
++    QStringList::ConstIterator it = keys.begin();
++    const QStringList::ConstIterator end = keys.end();
++    for ( ; it != end; ++it ) {
++        const QString group = *it;
++        if (group == "_SEPARATOR_") {
++            m_actions.append(KServiceAction(group, QString(), QString(), QString(), false));
++            continue;
++        }
++
++        if (config->hasActionGroup(group)) {
++            const KConfigGroup cg = config->actionGroup(group);
++            if ( !cg.hasKey( "Name" ) || !cg.hasKey( "Exec" ) ) {
++                kWarning(7012) << "The action" << group << "in the desktop file" << q->entryPath()
++                               << "has no Name or no Exec key";
++            } else {
++                m_actions.append(KServiceAction(group,
++                                                cg.readEntry("Name"),
++                                                cg.readEntry("Icon"),
++                                                cg.readEntry("Exec"),
++                                                cg.readEntry("NoDisplay", false)));
++            }
++        } else {
++            kWarning(7012) << "The desktop file" << q->entryPath()
++                           << "references the action" << group << "but doesn't define it";
++        }
+     }
+ }
+ 
+ void KServicePrivate::load(QDataStream& s)
+ {
+-    // dummies are here because of fields that were removed, to keep bin compat.
+-    // Feel free to re-use, but fields for Applications only (not generic services)
+-    // should rather be added to application.desktop
+     qint8 def, term;
+     qint8 dst, initpref;
+ 
+@@ -234,10 +279,10 @@
+       >> m_strDesktopEntryName
+       >> initpref
+       >> m_lstKeywords >> m_strGenName
+-      >> categories >> menuId;
++      >> categories >> menuId >> m_actions;
+ 
+-    m_bAllowAsDefault = def;
+-    m_bTerminal = term;
++    m_bAllowAsDefault = (bool)def;
++    m_bTerminal = (bool)term;
+     m_DBUSStartusType = (KService::DBusStartupType) dst;
+     m_initialPreference = initpref;
+ 
+@@ -263,7 +308,7 @@
+       << m_strDesktopEntryName
+       << initpref
+       << m_lstKeywords << m_strGenName
+-      << categories << menuId;
++      << categories << menuId << m_actions;
+ }
+ 
+ ////
+@@ -444,6 +489,7 @@
+     default:
+         // All others
+         // For instance properties defined as StringList, like MimeTypes.
++        // XXX This API is accessible only through a friend declaration.
+         return KConfigGroup::convertToQVariant(_name.toUtf8().constData(), it->toString().toUtf8(), t);
+     }
+ }
+@@ -827,3 +873,9 @@
+     Q_D(KService);
+     return d->m_lstServiceTypes;
+ }
++
++QList<KServiceAction> KService::actions() const
++{
++    Q_D(const KService);
++    return d->m_actions;
++}
+--- a/kdecore/services/kservicegroup.cpp
++++ b/kdecore/services/kservicegroup.cpp
+@@ -65,12 +65,12 @@
+   QStringList tmpList;
+   if (config.hasKey("OnlyShowIn"))
+   {
+-     if (!config.readEntry("OnlyShowIn", QStringList(), ';').contains("KDE"))
++     if (!config.readXdgListEntry("OnlyShowIn").contains("KDE"))
+         m_bNoDisplay = true;
+   }
+   if (config.hasKey("NotShowIn"))
+   {
+-     if (config.readEntry("NotShowIn", QStringList(), ';').contains("KDE"))
++     if (config.readXdgListEntry("NotShowIn").contains("KDE"))
+         m_bNoDisplay = true;
+   }
+ 
+--- a/kdecore/localization/ktranscript.cpp
++++ b/kdecore/localization/ktranscript.cpp
+@@ -244,24 +244,20 @@
+ // Normalize string key for hash lookups,
+ QString normKeystr (const QString &raw)
+ {
+-    // NOTE: Regexes are not used here for performance reasons.
++    // NOTE: Regexes should not be used here for performance reasons.
+     // This function may potentially be called thousands of times
+     // on application startup.
+ 
+     QString key = raw;
+ 
+     // Strip all whitespace.
+-    // Convert all non-alphanumeric sequences to single underscore.
+     int len = key.length();
+     QString nkey;
+     for (int i = 0; i < len; ++i) {
+         QChar c = key[i];
+-        if (c.isLetter() || c.isDigit()) {
++        if (!c.isSpace()) {
+             nkey.append(c);
+         }
+-        else if (!c.isSpace() && !nkey.endsWith('_')) {
+-            nkey.append('_');
+-        }
+     }
+     key = nkey;
+ 
+--- a/kdecore/localization/kuitformats.cpp
++++ b/kdecore/localization/kuitformats.cpp
+@@ -44,7 +44,9 @@
+     return fistr;
+ }
+ 
+-QString KuitFormats::toNumberUS (const QString &numstr)
++static QString toNumberGeneric (const QString &numstr,
++                                const QChar &thosep, const QChar &decsep,
++                                int thosepGE = 0)
+ {
+     int len = numstr.length();
+     int p1 = 0;
+@@ -58,38 +60,41 @@
+     while (p2 < len && numstr[p2].isDigit()) {
+         ++p2;
+     }
++    QString intpart = numstr.mid(p1, p2 - p1);
++    int intval = intpart.toInt();
+ 
+     QString pre = numstr.left(p1);
+-    QString mid = insertIntegerSeparators(numstr.mid(p1, p2 - p1), ',', 3);
++    QString mid = intpart;
++    if (intval >= thosepGE) {
++        mid = insertIntegerSeparators(intpart, thosep, 3);
++    }
++
+     QString post = numstr.mid(p2);
++    if (post.startsWith('.')) {
++        post[0] = decsep;
++    }
+ 
+     return pre + mid + post;
+ }
+ 
+-QString KuitFormats::toNumberEuro (const QString &numstr)
++QString KuitFormats::toNumberUS (const QString &numstr)
+ {
+-    int len = numstr.length();
+-    int p1 = 0;
+-    while (p1 < len && !numstr[p1].isDigit()) {
+-        ++p1;
+-    }
+-    if (p1 == len) {
+-        return numstr;
+-    }
+-    int p2 = p1 + 1;
+-    while (p2 < len && numstr[p2].isDigit()) {
+-        ++p2;
+-    }
++    return toNumberGeneric(numstr, ',', '.');
++}
+ 
+-    QString pre = numstr.left(p1);
+-    QString mid = insertIntegerSeparators(numstr.mid(p1, p2 - p1), '.', 3);
++QString KuitFormats::toNumberEuro (const QString &numstr)
++{
++    return toNumberGeneric(numstr, '.', ',');
++}
+ 
+-    QString post = numstr.mid(p2);
+-    if (post.startsWith('.')) {
+-        post[0] = ',';
+-    }
++QString KuitFormats::toNumberEuro2 (const QString &numstr)
++{
++    return toNumberGeneric(numstr, ' ', ',');
++}
+ 
+-    return pre + mid + post;
++QString KuitFormats::toNumberEuro2ct (const QString &numstr)
++{
++    return toNumberGeneric(numstr, ' ', ',', 10000);
+ }
+ 
+ QString KuitFormats::toKeyCombo (const QString &shstr, const QString &delim,
+--- a/kdecore/localization/klocale.cpp
++++ b/kdecore/localization/klocale.cpp
+@@ -175,8 +175,8 @@
+   int fracDigits;
+   KLocale::SignPosition positiveMonetarySignPosition;
+   KLocale::SignPosition negativeMonetarySignPosition;
+-  bool positivePrefixCurrencySymbol;
+-  bool negativePrefixCurrencySymbol;
++  bool positivePrefixCurrencySymbol : 1;
++  bool negativePrefixCurrencySymbol : 1;
+ 
+   // Date and time
+   QString timeFormat;
+@@ -301,7 +301,7 @@
+     list += QFile::decodeName(getenv("KDE_LANG")).split(':');
+ 
+   // Collect languages set by KDE config.
+-  list += cg.readEntry("Language", QStringList(), ':');
++  list += cg.readEntry("Language", QString()).split(':');
+ 
+   // Collect languages read from environment variables by gettext(3).
+   if (useEnv) {
+@@ -475,7 +475,7 @@
+   // 2) duplicate entries like in de:fr:de, where we have to keep the first occurrence of a language in order
+   //    to preserve the order of precenence of the user
+   // 3) languages into which the application is not translated. For those languages we should not even load kdelibs.mo or kio.po.
+-  //    these langugage have to be dropped. Otherwise we get strange side effects, e.g. with Hebrew:
++  //    these languages have to be dropped. Otherwise we get strange side effects, e.g. with Hebrew:
+   //    the right/left switch for languages that write from
+   //    right to left (like Hebrew or Arabic) is set in kdelibs.mo. If you only have kdelibs.mo
+   //    but nothing from appname.mo, you get a mostly English app with layout from right to left.
+@@ -2201,7 +2201,7 @@
+ QStringList KLocale::allLanguagesList() const
+ {
+   if (!d->languages)
+-    d->languages = new KConfig("all_languages", KConfig::CascadeConfig, "locale");
++    d->languages = new KConfig("all_languages", KConfig::NoGlobals, "locale");
+ 
+   return d->languages->groupList();
+ }
+@@ -2209,7 +2209,7 @@
+ QString KLocale::languageCodeToName(const QString &language) const
+ {
+   if (!d->languages)
+-    d->languages = new KConfig("all_languages", KConfig::CascadeConfig, "locale");
++    d->languages = new KConfig("all_languages", KConfig::NoGlobals, "locale");
+ 
+   KConfigGroup cg(d->languages, language);
+   return cg.readEntry("Name");
+--- a/kdecore/localization/klocale.h
++++ b/kdecore/localization/klocale.h
+@@ -1085,7 +1085,6 @@
+    */
+   void copyCatalogsTo(KLocale *locale);
+ 
+-protected:
+   /**
+    * Changes the current country. The current country will be left
+    * unchanged if failed. It will force a reload of the country specific
+--- a/kdecore/localization/kuitsemantics.cpp
++++ b/kdecore/localization/kuitsemantics.cpp
+@@ -94,7 +94,7 @@
+ 
+     namespace Numfmt { // number formats
+         typedef enum {
+-            Posix, US, Euro
++            Posix, US, Euro, Euro2, Euro2ct
+         } Var;
+     }
+ 
+@@ -313,6 +313,7 @@
+     SETUP_NUMFMT(Posix, "posix");
+     SETUP_NUMFMT(US, "us");
+     SETUP_NUMFMT(Euro, "euro");
++    SETUP_NUMFMT(Euro2ct, "euro2ct");
+ 
+     // Known XML entities, direct/inverse mapping.
+     xmlEntities["lt"] = '<';
+@@ -639,11 +640,11 @@
+ 
+     // -------> Icode
+     SET_PATTERN(Tag::Icode, Att::None, Fmt::Plain,
+-                XXXX_NOOP2("@icode/plain",
++                I18N_NOOP2("@icode/plain",
+     // i18n: KUIT pattern, see the comment to the first of these entries above.
+                            "“%1”"));
+     SET_PATTERN(Tag::Icode, Att::None, Fmt::Rich,
+-                XXXX_NOOP2("@icode/rich",
++                I18N_NOOP2("@icode/rich",
+     // i18n: KUIT pattern, see the comment to the first of these entries above.
+                            "<tt>%1</tt>"));
+ 
+@@ -651,7 +652,7 @@
+     SET_PATTERN(Tag::Bcode, Att::None, Fmt::Plain,
+                 XXXX_NOOP2("@bcode/plain",
+     // i18n: KUIT pattern, see the comment to the first of these entries above.
+-                           "%1"));
++                           "\n%1\n"));
+     SET_PATTERN(Tag::Bcode, Att::None, Fmt::Rich,
+                 XXXX_NOOP2("@bcode/rich",
+     // i18n: KUIT pattern, see the comment to the first of these entries above.
+@@ -754,7 +755,14 @@
+ 
+     m_numfmtInt = Kuit::Numfmt::Posix;
+     // i18n: Decide how integer-valued amounts will be formatted in your
+-    // language. For possible formats, see translation documentation.
++    // language. Currently available number formats are:
++    //   posix   - decimal point
++    //   us      - thousands separation by comma, decimal point
++    //   euro    - thousands separation by point, decimal comma
++    //   euro2   - thousands separation by space, decimal comma
++    //   euro2ct - as euro2, except thousand not separated when <10000
++    // If none of the existing formats is appropriate for your language,
++    // write to kde-i18n-doc at kde.org to arrange for a new format.
+     QString fmtnameInt = cat.translate("number-format:integer", "us").toLower();
+     if (s->knownNumfmts.contains(fmtnameInt)) {
+         m_numfmtInt = s->knownNumfmts[fmtnameInt];
+@@ -767,7 +775,7 @@
+ 
+     m_numfmtReal = Kuit::Numfmt::Posix;
+     // i18n: Decide how real-valued amounts will be formatted in your
+-    // language. For possible formats, see translation documentation.
++    // language. See the comment to previous entry.
+     QString fmtnameReal = cat.translate("number-format:real", "us").toLower();
+     if (s->knownNumfmts.contains(fmtnameReal)) {
+         m_numfmtReal = s->knownNumfmts[fmtnameReal];
+@@ -1317,40 +1325,30 @@
+                                              Kuit::FmtVar fmt) const
+ {
+     // numctx < 1 means that the number is not in numeric-id context.
+-    if (tag == Kuit::Tag::NumIntg && numctx < 1) {
+-        if (m_numfmtInt == Kuit::Numfmt::US) {
+-            return KuitFormats::toNumberUS(text);
+-        }
+-        else if (m_numfmtInt == Kuit::Numfmt::Euro) {
+-            return KuitFormats::toNumberEuro(text);
+-        }
+-        else {
+-            return text;
+-        }
+-    }
+-
+-    // numctx < 1 means that the number is not in numeric-id context.
+-    if (tag == Kuit::Tag::NumReal && numctx < 1) {
+-        if (m_numfmtReal == Kuit::Numfmt::US) {
++    if (   (tag == Kuit::Tag::NumIntg || tag == Kuit::Tag::NumReal) \
++        && numctx < 1)
++    {
++        int numfmt = (tag == Kuit::Tag::NumIntg ? m_numfmtInt : m_numfmtReal);
++        switch (numfmt) {
++        case Kuit::Numfmt::US:
+             return KuitFormats::toNumberUS(text);
+-        }
+-        else if (m_numfmtReal == Kuit::Numfmt::Euro) {
++        case Kuit::Numfmt::Euro:
+             return KuitFormats::toNumberEuro(text);
+-        }
+-        else {
++        case Kuit::Numfmt::Euro2:
++            return KuitFormats::toNumberEuro2(text);
++        case Kuit::Numfmt::Euro2ct:
++            return KuitFormats::toNumberEuro2ct(text);
++        default:
+             return text;
+         }
+     }
+-
+-    if (tag == Kuit::Tag::Filename) {
++    else if (tag == Kuit::Tag::Filename) {
+         return QDir::toNativeSeparators(text);
+     }
+-
+-    if (tag == Kuit::Tag::Shortcut) {
++    else if (tag == Kuit::Tag::Shortcut) {
+         return KuitFormats::toKeyCombo(text, m_comboKeyDelim[fmt], m_keyNames);
+     }
+-
+-    if (tag == Kuit::Tag::Interface) {
++    else if (tag == Kuit::Tag::Interface) {
+         return KuitFormats::toInterfacePath(text, m_guiPathDelim[fmt]);
+     }
+ 
+--- a/kdecore/localization/kencodingdetector.cpp
++++ b/kdecore/localization/kencodingdetector.cpp
+@@ -82,10 +82,10 @@
+     KEncodingDetector::EncodingChoiceSource m_source;
+     KEncodingDetector::AutoDetectScript m_autoDetectLanguage;
+ 
+-    bool m_visualRTL;
+-    bool m_seenBody;
+-    bool m_writtingHappened;
+-    bool m_analyzeCalled; //for decode()
++    bool m_visualRTL : 1;
++    bool m_seenBody : 1;
++    bool m_writtingHappened : 1;
++    bool m_analyzeCalled : 1; //for decode()
+     int m_multiByte;
+ 
+     QByteArray m_bufferForDefferedEncDetection;
+--- a/kdecore/localization/kuitformats_p.h
++++ b/kdecore/localization/kuitformats_p.h
+@@ -39,6 +39,20 @@
+     QString toNumberEuro (const QString &numstr);
+ 
+     /**
++     * Reformat raw number string to Euro2 standard.
++     * @param numstr raw number string
++     * @returns number string in proper format
++     */
++    QString toNumberEuro2 (const QString &numstr);
++
++    /**
++     * Reformat raw number string to Euro2ct standard.
++     * @param numstr raw number string
++     * @returns number string in proper format
++     */
++    QString toNumberEuro2ct (const QString &numstr);
++
++    /**
+      * Reformat keyboard shortcut. The first of encountered of '+' or '-'
+      * is taken for key delimiter, and the supplied delimiter is used instead.
+      * A dictionary of replacement key names can also be provided, which can
+--- a/kdecore/network/k3socks.cpp
++++ b/kdecore/network/k3socks.cpp
+@@ -309,7 +309,7 @@
+           */
+ 
+    if (_meth == 4) {         // try to load^H^H^H^Hguess at a custom library
+-      d->_socksLib = ll->library(config->readPathEntry("SOCKS_lib"));
++      d->_socksLib = ll->library(config->readPathEntry("SOCKS_lib", QString()));
+       if (d->_socksLib && d->_socksLib->resolveFunction("Rconnect")) {  // Dante compatible?
+          d->_st = new KDanteSocksTable;
+          d->_useSocks = true;
+--- a/kdecore/tests/kservicetest.cpp
++++ b/kdecore/tests/kservicetest.cpp
+@@ -68,6 +68,8 @@
+     QCOMPARE(kdeprintd->property("ServiceTypes").toStringList().join(","), QString("KDEDModule"));
+     QCOMPARE(kdeprintd->property("X-KDE-Kded-autoload").toBool(), false);
+     QCOMPARE(kdeprintd->property("X-KDE-Kded-load-on-demand").toBool(), true);
++    QVERIFY(!kdeprintd->property("Name").toString().isEmpty());
++    QVERIFY(!kdeprintd->property("Name[fr]", QVariant::String).isValid());
+ 
+     KService::Ptr kjavaappletviewer = KService::serviceByDesktopPath("kjavaappletviewer.desktop");
+     QVERIFY(kjavaappletviewer);
+@@ -306,3 +308,39 @@
+         QSKIP( "testServiceTypeTraderForReadOnlyPart not run", SkipAll );
+     QCOMPARE( offers[0]->entryPath(), m_firstOffer );
+ }
++
++void KServiceTest::testActionsAndDataStream()
++{
++    const QString servicePath = KStandardDirs::locate( "services", "ScreenSavers/krandom.desktop" );
++    if (servicePath.isEmpty() )
++        QSKIP("kdebase not installed, krandom.desktop not found", SkipAll);
++    KService service( servicePath );
++    QVERIFY(!service.property("Name[fr]", QVariant::String).isValid());
++    const QList<KServiceAction> actions = service.actions();
++    QCOMPARE(actions.count(), 3);
++    const KServiceAction setupAction = actions[0];
++    QCOMPARE(setupAction.name(), QString("Setup"));
++    QCOMPARE(setupAction.exec(), QString("krandom.kss -setup"));
++    QVERIFY(!setupAction.icon().isEmpty());
++    QCOMPARE(setupAction.noDisplay(), false);
++    QVERIFY(!setupAction.isSeparator());
++    const KServiceAction rootAction = actions[2];
++    QCOMPARE(rootAction.name(), QString("Root"));
++
++    QByteArray data;
++    QDataStream stream(&data, QIODevice::WriteOnly);
++    service.save(stream);
++    QVERIFY(!data.isEmpty());
++    // The binary size of that KService in ksycoca was 3700 when storing all Name[...] translations!
++    // Now down to 755. This is on x86, so make the assert for 1500 in case x86_64 needs more.
++    QVERIFY(data.size() < 1500);
++    QDataStream loadingStream(data);
++    // loading must first get type, see KSycocaEntryPrivate::save
++    // (the path that save writes out, is read by the KSycocaEntryPrivate ctor)
++    qint32 type;
++    loadingStream >> type;
++    KService loadedService(loadingStream, 0);
++    QCOMPARE(loadedService.name(), service.name());
++    QCOMPARE(loadedService.exec(), service.exec());
++    QCOMPARE(loadedService.actions().count(), 3);
++}
+--- a/kdecore/tests/kmimetypetest.cpp
++++ b/kdecore/tests/kmimetypetest.cpp
+@@ -320,34 +320,39 @@
+     QCOMPARE( mime->name(), QString::fromLatin1("application/x-php") );
+ }
+ 
+-void KMimeTypeTest::testFindByContent()
++void KMimeTypeTest::testFindByContent_data()
+ {
+-    KMimeType::Ptr mime;
+-
+-    QByteArray textData = "Hello world";
+-    mime = KMimeType::findByContent(textData);
+-    QVERIFY( mime );
+-    QCOMPARE( mime->name(), QString::fromLatin1("text/plain") );
+-
++    QTest::addColumn<QByteArray>("data");
++    QTest::addColumn<QString>("expectedMimeType");
++    QTest::newRow("simple text") << QByteArray("Hello world") << "text/plain";
++    QTest::newRow("html: <html>") << QByteArray("<html>foo</html>") << "text/html";
++#if 0 // currently buggy, xml and html have conflicting magic rules, discussed on xdg list.
++    QTest::newRow("html: comment+<html>") << QByteArray("<!--foo--><html>foo</html>") << "text/html";
++#endif
+ #if 0 // https://bugs.freedesktop.org/show_bug.cgi?id=11259
+-    QByteArray htmlData = "<script>foo</script>";
+-    mime = KMimeType::findByContent(htmlData);
+-    QVERIFY( mime );
+-    QCOMPARE( mime->name(), QString::fromLatin1("text/html") );
++    QTest::newRow("html: <script>") << QByteArray("<script>foo</script>") << "text/html";
+ #endif
+-
+-    QByteArray pdfData = "%PDF-";
+-    mime = KMimeType::findByContent(pdfData);
+-    QVERIFY( mime );
+-    QCOMPARE( mime->name(), QString::fromLatin1("application/pdf") );
++    QTest::newRow("pdf") << QByteArray("%PDF-") << "application/pdf";
+ 
+     QByteArray mswordData = "\320\317\021\340\241\261\032\341";
+     QVERIFY(KMimeType::isBufferBinaryData(mswordData));
+-    mime = KMimeType::findByContent(mswordData);
+-    QVERIFY( mime );
+     // We have no magic specific to msword data, so finding x-ole-storage is correct.
+-    QCOMPARE( mime->name(), QString::fromLatin1("application/x-ole-storage") );
++    QTest::newRow("msword") << mswordData << "application/x-ole-storage";
++}
+ 
++void KMimeTypeTest::testFindByContent()
++{
++    QFETCH(QByteArray, data);
++    QFETCH(QString, expectedMimeType);
++
++    KMimeType::Ptr mime = KMimeType::findByContent(data);
++    QVERIFY( mime );
++    QCOMPARE( mime->name(), expectedMimeType );
++}
++
++void KMimeTypeTest::testFindByFileContent()
++{
++    KMimeType::Ptr mime;
+     // Calling findByContent on a directory
+     mime = KMimeType::findByFileContent("/");
+     QVERIFY( mime );
+--- a/kdecore/tests/kdatetimetest.cpp
++++ b/kdecore/tests/kdatetimetest.cpp
+@@ -1335,6 +1335,12 @@
+ 
+ void KDateTimeTest::toZone()
+ {
++    QEventLoop loop;
++    QTimer timer;
++    timer.setSingleShot(true);
++    QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
++    QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
++
+     // This test relies on kded running, and on kdebase/runtime being installed
+     if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kded")) {
+         QSKIP("kded not running", SkipSingle);
+@@ -1359,6 +1365,8 @@
+     config.sync();
+     QDBusMessage message = QDBusMessage::createSignal("/Daemon", "org.kde.KTimeZoned", "configChanged");
+     QDBusConnection::sessionBus().send(message);
++    timer.start(1000);
++    loop.exec();
+ 
+     // Zone -> Zone
+     KDateTime londonWinter(QDate(2005,1,1), QTime(0,0,0), london);
+@@ -1436,6 +1444,8 @@
+     group.writeEntry("LocalZone", QString::fromLatin1("America/Los_Angeles"));
+     config.sync();
+     QDBusConnection::sessionBus().send(message);
++    timer.start(1000);
++    loop.exec();
+ }
+ 
+ void KDateTimeTest::toTimeSpec()
+--- a/kdecore/tests/kurltest.cpp
++++ b/kdecore/tests/kurltest.cpp
+@@ -634,7 +634,7 @@
+   KUrl urlWithPass("ftp://user:password@ftp.kde.org/path");
+   QCOMPARE( urlWithPass.pass(), QString::fromLatin1( "password" ) );
+   QCOMPARE( urlWithPass.prettyUrl(), QString::fromLatin1( "ftp://user@ftp.kde.org/path" ) );
+-  
++
+   KUrl xmppUri("xmpp:ogoffart at kde.org");
+   QCOMPARE( xmppUri.prettyUrl(), QString::fromLatin1( "xmpp:ogoffart at kde.org" ) );
+ }
+@@ -961,6 +961,11 @@
+   KUrl sadEagleCombined( sadEagleBase, "/personal/diary/rpc.php?C=jsrs1&F=getDiaryDay&P0=[2006-3-8]&U=1141858921458" );
+   QCOMPARE( sadEagleCombined.url(), sadEagleExpectedResult.url() );
+ 
++  KUrl dxOffEagle( KUrl("http://something/other.html"), "newpage.html?[{\"foo: bar\"}]" );
++  QEXPECT_FAIL("","Issue N183630", Continue);
++  QVERIFY(dxOffEagle.isValid());
++  QEXPECT_FAIL("","Issue N183630", Continue);
++  QCOMPARE(dxOffEagle.url(), QString("http://something/newpage.html?%5B%7B%22foo:%20bar%22%7D%5D") );
+ }
+ 
+ void KUrlTest::testSubURL()
+@@ -1056,6 +1061,11 @@
+   QCOMPARE( emptyUserTest2.user(), QString::fromLatin1( "foo" ) );
+   emptyUserTest2.setUser( QString() );
+   QCOMPARE( emptyUserTest1==emptyUserTest2, true );
++
++  KUrl uga("ftp://ftp.kde.org");
++  uga.setUser("foo at bar");
++  QCOMPARE(uga.user(), QString::fromLatin1("foo at bar"));
++  QCOMPARE(uga.url(), QString::fromLatin1("ftp://foo%40bar@ftp.kde.org"));
+ }
+ 
+ void KUrlTest::testComparisons()
+@@ -1274,13 +1284,30 @@
+ 
+   broken = "ptal://mlc:usb:PC_970";
+   QVERIFY( !broken.isValid() );
+-  QSKIP( "QUrl doesn't provide the initial string if it's an invalid url; asked for 4.2...", SkipSingle );
++  QEXPECT_FAIL( "", "QUrl doesn't provide the initial string if it's an invalid url...", Continue );
+   QCOMPARE( broken.url(), QString("ptal://mlc:usb:PC_970") ); // FAILS - but we need it...
+ 
+   QUrl brokenUrl( "ptal://mlc:usb:PC_970" );
+   QVERIFY( !brokenUrl.isValid() );
++  QEXPECT_FAIL( "", "QUrl doesn't provide the initial string if it's an invalid url...", Continue );
+   QCOMPARE( brokenUrl.toString(), QString("ptal://mlc:usb:PC_970") );
++  QEXPECT_FAIL( "", "QUrl doesn't provide the initial string if it's an invalid url...", Continue );
+   QCOMPARE( brokenUrl.toEncoded(), QByteArray("ptal://mlc:usb:PC_970") );
++
++  QUrl dxOffEagle( "http://something/newpage.html?[{\"foo: bar\"}]", QUrl::TolerantMode);
++  QVERIFY(dxOffEagle.isValid());
++  QCOMPARE(QString(dxOffEagle.toEncoded()), QString("http://something/newpage.html?%5B%7B%22foo:%20bar%22%7D%5D"));
++  QUrl dxOffEagle2;
++  dxOffEagle2.setUrl( "http://something/newpage.html?[{\"foo: bar\"}]", QUrl::TolerantMode);
++  QVERIFY(dxOffEagle2.isValid());
++  QCOMPARE(dxOffEagle.toEncoded(), dxOffEagle2.toEncoded());
++
++  QUrl dxOffEagle3;
++  dxOffEagle3.setEncodedUrl( "http://something/newpage.html?[{\"foo: bar\"}]", QUrl::TolerantMode);
++  QEXPECT_FAIL("","Issue N183630", Continue);
++  QVERIFY(dxOffEagle3.isValid());
++  QEXPECT_FAIL("","Issue N183630", Continue);
++  QCOMPARE(dxOffEagle.toEncoded(), dxOffEagle3.toEncoded());
+ }
+ 
+ void KUrlTest::testMailto()
+--- a/kdecore/tests/kconfigtest.cpp
++++ b/kdecore/tests/kconfigtest.cpp
+@@ -27,6 +27,8 @@
+ #include <kconfiggroup.h>
+ #include <kstandarddirs.h>
+ 
++#include <QtNetwork/QHostInfo>
++
+ KCONFIGGROUP_DECLARE_ENUM_QOBJECT(KConfigTest,Testing)
+ KCONFIGGROUP_DECLARE_FLAGS_QOBJECT(KConfigTest,Flags)
+ 
+@@ -41,6 +43,7 @@
+ #define STRINGENTRY5 " "
+ #define STRINGENTRY6 ""
+ #define UTF8BITENTRY "Hello äöü"
++#define TRANSLATEDSTRINGENTRY1 "bonjour"
+ #define BYTEARRAYENTRY QByteArray( "\x00\xff\x7f\x3c abc\x00\x00", 10 )
+ #define ESCAPEKEY " []\0017[]==]"
+ #define ESCAPEENTRY "[]\170[]]=3=]\\] "
+@@ -51,6 +54,8 @@
+ #define DATETIMEENTRY QDateTime( QDate( 2002, 06, 23 ), QTime( 12, 55, 40 ) )
+ #define STRINGLISTENTRY (QStringList( "Hello," ) << " World")
+ #define STRINGLISTEMPTYENTRY (QStringList())
++#define STRINGLISTJUSTEMPTYELEMENT (QStringList(QString()) )
++#define STRINGLISTEMPTYTRAINLINGELEMENT (QStringList( "Hi" ) << QString())
+ #define STRINGLISTESCAPEODDENTRY (QStringList( "Hello\\\\\\" ) << "World")
+ #define STRINGLISTESCAPEEVENENTRY (QStringList( "Hello\\\\\\\\" ) << "World")
+ #define STRINGLISTESCAPECOMMAENTRY (QStringList( "Hel\\\\\\,\\\\,\\,\\\\\\\\,lo" ) << "World")
+@@ -85,6 +90,7 @@
+   cg.writeEntry( ESCAPEKEY, ESCAPEENTRY );
+   cg.writeEntry( "emptyEntry", "");
+   cg.writeEntry( "stringEntry1", STRINGENTRY1 );
++  cg.writeEntry( "stringEntry1[fr]", TRANSLATEDSTRINGENTRY1 );
+   cg.writeEntry( "stringEntry2", STRINGENTRY2 );
+   cg.writeEntry( "stringEntry3", STRINGENTRY3 );
+   cg.writeEntry( "stringEntry4", STRINGENTRY4 );
+@@ -110,6 +116,8 @@
+   cg.writeEntry( "listOfByteArraysEntry1", BYTEARRAYLISTENTRY1 );
+   cg.writeEntry( "stringListEntry", STRINGLISTENTRY );
+   cg.writeEntry( "stringListEmptyEntry", STRINGLISTEMPTYENTRY );
++  cg.writeEntry( "stringListJustEmptyElement", STRINGLISTJUSTEMPTYELEMENT );
++  cg.writeEntry( "stringListEmptyTrailingElement", STRINGLISTEMPTYTRAINLINGELEMENT );
+   cg.writeEntry( "stringListEscapeOddEntry", STRINGLISTESCAPEODDENTRY );
+   cg.writeEntry( "stringListEscapeEvenEntry", STRINGLISTESCAPEEVENENTRY );
+   cg.writeEntry( "stringListEscapeCommaEntry", STRINGLISTESCAPECOMMAENTRY );
+@@ -219,7 +227,7 @@
+   KConfigGroup sc3( &sc2, "AAA");
+ 
+   QVERIFY( sc3.hasKey( "stringEntry1" ) );
+-  QVERIFY( !sc3.entryIsImmutable("stringEntry1") );
++  QVERIFY( !sc3.isEntryImmutable("stringEntry1") );
+   QCOMPARE( sc3.readEntry( "stringEntry1" ), QString( STRINGENTRY1 ) );
+ 
+   QVERIFY( !sc3.hasKey( "stringEntry2" ) );
+@@ -258,7 +266,14 @@
+   QCOMPARE( sc3.readEntry( QString("stringListEntry"), QStringList()),
+             STRINGLISTENTRY );
+ 
+-  QVERIFY( sc3.hasKey( QString("stringListEmptyEntry") ) );
++  QCOMPARE( sc3.readEntry( QString("stringListEmptyEntry"), QStringList("wrong") ),
++            STRINGLISTEMPTYENTRY );
++
++  QCOMPARE( sc3.readEntry( QString("stringListJustEmptyElement"), QStringList() ),
++            STRINGLISTJUSTEMPTYELEMENT );
++
++  QCOMPARE( sc3.readEntry( QString("stringListEmptyTrailingElement"), QStringList() ),
++            STRINGLISTEMPTYTRAINLINGELEMENT );
+ 
+   QCOMPARE( sc3.readEntry( QString("stringListEscapeOddEntry"), QStringList()),
+             STRINGLISTESCAPEODDENTRY );
+@@ -283,9 +298,51 @@
+ {
+   KConfig sc2( "kconfigtest" );
+   KConfigGroup sc3(&sc2, "Path Type");
+-  QString p = sc3.readPathEntry("homepath");
++  QString p = sc3.readPathEntry("homepath", QString());
+   QCOMPARE( sc3.readPathEntry( "homepath", QString() ), HOMEPATH );
+   QCOMPARE( sc3.readPathEntry( "homepathescape", QString() ), HOMEPATHESCAPE );
++  
++  {
++      QFile file(KStandardDirs::locateLocal("config", "pathtest"));
++      file.open(QIODevice::WriteOnly|QIODevice::Text);
++      QTextStream out(&file);
++      out.setCodec("UTF-8");
++      out << "[Test Group]" << endl
++              << "homePath=$HOME/foo" << endl
++              << "homePath2=file://$HOME/foo" << endl
++              << "hostname[$e]=$(hostname)" << endl;
++  }
++  KConfig cf2("pathtest");
++  KConfigGroup group = cf2.group("Test Group");
++  QVERIFY(group.hasKey("homePath"));
++  QCOMPARE(group.readPathEntry("homePath", QString()), HOMEPATH);
++  QVERIFY(group.hasKey("homePath2"));
++  QCOMPARE(group.readPathEntry("homePath2", QString()), QString("file://") + HOMEPATH );
++#ifndef Q_OS_WIN32
++  // I don't know if this will work on windows
++  QVERIFY(group.hasKey("hostname"));
++  QCOMPARE(group.readEntry("hostname", QString()), QHostInfo::localHostName());
++#endif
++}
++
++void KConfigTest::testPersistenceOfExpandFlagForPath()
++{
++  // This test checks that a path entry starting with $HOME is still flagged
++  // with the expand flag after the config was altered without rewriting the
++  // path entry.
++
++  // 1st step: Open the config, add a new dummy entry and then sync the config
++  // back to the storage.
++  {
++  KConfig sc2( "kconfigtest" );
++  KConfigGroup sc3(&sc2, "Path Type");
++  sc3.writeEntry( "dummy", "dummy" );
++  sc2.sync();
++  }
++
++  // 2nd step: Call testPath() again. Rewriting the config must not break
++  // the testPath() test.
++  testPath();
+ }
+ 
+ void KConfigTest::testComplex()
+@@ -324,6 +381,31 @@
+   QVERIFY( sc3.readEntry( "flags-bit0-bit1", Flags() ) == bitfield );
+ }
+ 
++void KConfigTest::testEntryMap()
++{
++    KConfig sc("kconfigtest");
++    KConfigGroup cg(&sc, "Hello");
++    QMap<QString, QString> entryMap = cg.entryMap();
++    qDebug() << entryMap.keys();
++    QCOMPARE(entryMap.value("stringEntry1"), QString(STRINGENTRY1));
++    // #### Why is this translated entry here? This just bloats the entryMap.
++    QCOMPARE(entryMap.value("stringEntry1[fr]"), QString(TRANSLATEDSTRINGENTRY1));
++    QCOMPARE(entryMap.value("stringEntry2"), QString(STRINGENTRY2));
++    QCOMPARE(entryMap.value("stringEntry3"), QString(STRINGENTRY3));
++    QCOMPARE(entryMap.value("stringEntry4"), QString(STRINGENTRY4));
++    QVERIFY(!entryMap.contains("stringEntry5"));
++    QVERIFY(!entryMap.contains("stringEntry6"));
++    QCOMPARE(entryMap.value("Test"), QString::fromUtf8(UTF8BITENTRY));
++    QCOMPARE(entryMap.value("bytearrayEntry"), QString::fromUtf8(BYTEARRAYENTRY));
++    QCOMPARE(entryMap.value("emptyEntry"), QString());
++    QVERIFY(entryMap.contains("emptyEntry"));
++    QCOMPARE(entryMap.value("boolEntry1"), QString(BOOLENTRY1?"true":"false"));
++    QCOMPARE(entryMap.value("boolEntry2"), QString(BOOLENTRY2?"true":"false"));
++    QCOMPARE(entryMap.value("keywith=equalsign"), QString(STRINGENTRY1));
++    QCOMPARE(entryMap.value("byteArrayEntry1"), QString(STRINGENTRY1));
++    QCOMPARE(entryMap.value("doubleEntry1"), QString::number(DOUBLEENTRY, 'g', 15));
++}
++
+ void KConfigTest::testInvalid()
+ {
+   KConfig sc( "kconfigtest" );
+@@ -397,7 +479,7 @@
+     KConfigGroup sc3(&sc, "Hello");
+     QCOMPARE(sc3.name(), QString("Hello"));
+     KConfigGroup newGroup(sc3);
+-    newGroup.changeGroup("FooBar");
++    newGroup.changeGroup("FooBar"); // deprecated!
+     QCOMPARE(newGroup.name(), QString("FooBar"));
+     QCOMPARE(sc3.name(), QString("Hello")); // unchanged
+ }
+--- a/kdecore/tests/kmimetypetest.h
++++ b/kdecore/tests/kmimetypetest.h
+@@ -35,6 +35,8 @@
+     void testFindByPathWithContent();
+     void testFindByNameAndContent();
+     void testFindByContent();
++    void testFindByContent_data();
++    void testFindByFileContent();
+     void testAllMimeTypes();
+     void testAlias();
+     void testMimeTypeParent();
+--- a/kdecore/tests/kconfigtest.h
++++ b/kdecore/tests/kconfigtest.h
+@@ -38,8 +38,10 @@
+     void testSimple();
+     void testLists();
+     void testPath();
++    void testPersistenceOfExpandFlagForPath();
+     void testComplex();
+     void testEnums();
++    void testEntryMap();
+     void testInvalid();
+     void testDelete();
+     void testDefaultGroup();
+--- a/kdecore/tests/kservicetest.h
++++ b/kdecore/tests/kservicetest.h
+@@ -37,6 +37,7 @@
+     void testDefaultOffers();
+     void testDeleteServiceTypeProfile();
+     void testDBUSStartupType();
++    void testActionsAndDataStream();
+ 
+ private:
+     QString m_firstOffer;
+--- a/kdecore/tests/kshelltest.cpp
++++ b/kdecore/tests/kshelltest.cpp
+@@ -33,6 +33,7 @@
+ 
+   private Q_SLOTS:
+     void tildeExpand();
++    void quoteArg();
+     void joinArgs();
+     void splitJoin();
+     void abortOnMeta();
+@@ -46,31 +47,38 @@
+     QCOMPARE(KShell::tildeExpand("~/dir"), QDir::homePath()+"/dir");
+     QCOMPARE(KShell::tildeExpand("~" + me), QDir::homePath());
+     QCOMPARE(KShell::tildeExpand("~" + me + "/dir"), QDir::homePath()+"/dir");
++#ifdef Q_OS_WIN
++    QCOMPARE(KShell::tildeExpand("^~" + me), "~" + me);
++#else
+     QCOMPARE(KShell::tildeExpand("\\~" + me), "~" + me);
++#endif
++}
++
++void
++KShellTest::quoteArg()
++{
++#ifdef Q_OS_WIN
++    QCOMPARE(KShell::quoteArg("a space"), QString("\"a space\""));
++    QCOMPARE(KShell::quoteArg("fds\\\""), QString("fds\\\\\\^\""));
++    QCOMPARE(KShell::quoteArg("\\\\foo"), QString("\\\\foo"));
++    QCOMPARE(KShell::quoteArg("\"asdf\""), QString("\\^\"asdf\\^\""));
++    QCOMPARE(KShell::quoteArg("with\\"), QString("\"with\\\\\""));
++    QCOMPARE(KShell::quoteArg("\\\\"), QString("\"\\\\\\\\\""));
++    QCOMPARE(KShell::quoteArg("\"a space\\\""), QString("\\^\"\"a space\"\\\\\\^\""));
++    QCOMPARE(KShell::quoteArg("as df\\"), QString("\"as df\\\\\""));
++    QCOMPARE(KShell::quoteArg("foo bar\"\\\"bla"), QString("\"foo bar\"\\^\"\\\\\\^\"\"bla\""));
++
++#else
++    QCOMPARE(KShell::quoteArg("a space"), QString("'a space'"));
++#endif
+ }
+ 
+ void
+ KShellTest::joinArgs()
+ {
+     QStringList list;
+-
+     list << "this" << "is" << "a" << "test";
+     QCOMPARE(KShell::joinArgs(list), QString("this is a test"));
+-    list.clear();
+-
+-#ifdef Q_OS_WIN
+-    list << "this" << "is" << "with" << "a space";
+-    QCOMPARE(KShell::joinArgs(list), QString("this is with \"a space\""));
+-    list.clear();
+-
+-    list << "fds\\\"" << "\"asdf\"" << "with\\" << "\\\\" << "\"a space\\\"" << "as df\\";
+-    QCOMPARE(KShell::joinArgs(list), QString("fds\\\\\\\" \\\"asdf\\\" with\\ \\\\ \"\\\"a space\\\\\\\"\" \"as df\"\\"));
+-    list.clear();
+-#else
+-    list << "this" << "is" << "with" << "a space";
+-    QCOMPARE(KShell::joinArgs(list), QString("this is with 'a space'"));
+-    list.clear();
+-#endif
+ }
+ 
+ static QString sj(const QString& str, KShell::Options flags, KShell::Errors* ret)
+@@ -89,7 +97,7 @@
+     QVERIFY(err == KShell::NoError);
+ 
+     QCOMPARE(sj(" ha\\ lo ", KShell::NoOptions, &err),
+-             QString("ha\\ lo"));
++             QString("\"ha\\\\\" lo"));
+     QVERIFY(err == KShell::NoError);
+ 
+     QCOMPARE(sj("say \" error", KShell::NoOptions, &err),
+--- a/kdecore/doc/DESIGN.kconfig
++++ b/kdecore/doc/DESIGN.kconfig
+@@ -45,7 +45,7 @@
+ <Changed during KDE 3.0 / 3.2>
+ Extra functions:
+ 
+-bool entryIsImmutable(key); // Can entry be modified?
++bool isEntryImmutable(key); // Can entry be modified?
+ bool hasDefault(key); // Is there a system wide default set for the entry?
+ void revertToDefault(key); // Restore to default
+ void deleteEntry(key); // Remove entry
+--- a/kdecore/sonnet/sonnetspeller.desktop
++++ b/kdecore/sonnet/sonnetspeller.desktop
+@@ -12,6 +12,7 @@
+ Comment[el]=Πελάτης ορθογραφικού ελέγχου Sonnet
+ Comment[eo]=Sonnet Literumil-Kliento
+ Comment[es]=Cliente de revisión ortográfica Sonnet
++Comment[et]=Sonneti õigekirja kontrollimise klient
+ Comment[fa]=کارخواه هجی Sonnet
+ Comment[ga]=Cliant Litrithe Sonnet
+ Comment[he]=תוכנית בדיקת איות Sonnet
+@@ -22,6 +23,9 @@
+ Comment[km]=កម្មវិធី​អក្ខរាវិរុទ្ធ Sonnet
+ Comment[kn]=ಸಾನೆಟ್ ಕಾಗುಣಿತ ಸೇವನಾರ್ಥಿ
+ Comment[ko]=Sonnet 스펠링 클라이언트
++Comment[lt]=Sonnet Spell klientas
++Comment[lv]=Sonnet pareizrakstības pārbaudes klients
++Comment[nb]=Sonnet staveklient
+ Comment[nds]=Schriefwiesprööv-Client Sonnet
+ Comment[ne]=सोनेट स्पेल क्लाइन्ट
+ Comment[nl]=Sonnet Spellingcontrole
+@@ -30,8 +34,11 @@
+ Comment[pt_BR]=Cliente do Verificador Ortográfico Sonnet
+ Comment[ru]=Клиент Sonnet
+ Comment[sl]=Odjemnik za črkovanje Sonnet
++Comment[sr]=Сонет, правописни клијент
++Comment[sr at latin]=Sonnet, pravopisni klijent
+ Comment[sv]=Sonnet stavningsklient
+ Comment[th]=ไคลเอนท์ Sonnet Spell
++Comment[uk]=Клієнт перевірки орфографії Sonnet
+ Comment[wa]=Cliyint coridjrece sonnet
+ Comment[x-test]=xxSonnet Spell Clientxx
+ Comment[zh_CN]=Sonnet Spell 客户
+--- a/kdecore/CMakeLists.txt
++++ b/kdecore/CMakeLists.txt
+@@ -146,6 +146,7 @@
+    services/kmimetypetrader.cpp
+    services/kmimetype.cpp
+    services/kservice.cpp
++   services/kserviceaction.cpp
+    services/kservicefactory.cpp
+    services/kservicegroup.cpp
+    services/kservicegroupfactory.cpp
+@@ -291,6 +292,7 @@
+    kdecore_export.h
+    compression/kfilterbase.h
+    compression/kfilterdev.h
++   config/conversion_check.h
+    config/kconfig.h
+    config/kconfigbase.h
+    config/kconfiggroup.h
+@@ -340,6 +342,7 @@
+    services/kmimetype.h
+    services/kmimetypetrader.h
+    services/kservice.h
++   services/kserviceaction.h
+    services/kservicegroup.h
+    #services/kservicefactory.h: do not install, internal API
+    services/kservicetype.h
+@@ -359,7 +362,6 @@
+    text/kascii.h
+    text/kcodecs.h
+    text/kstringhandler.h
+-   util/conversion_check.h
+    util/kallocator.h
+    util/kde_file.h
+    util/kdedmodule.h
+--- a/kdecore/date/ksystemtimezone.cpp
++++ b/kdecore/date/ksystemtimezone.cpp
+@@ -235,23 +235,8 @@
+ 
+         // A KSystemTimeZones instance is required only to catch D-Bus signals.
+         m_parent = new KSystemTimeZones;
+-        // Ensure that the KDED time zones module has initialized
++        // Ensure that the KDED time zones module has initialized. The call loads the module on demand.
+         QDBusInterface *ktimezoned = new QDBusInterface("org.kde.kded", "/modules/ktimezoned", KTIMEZONED_DBUS_IFACE);
+-        if (!ktimezoned->isValid())
+-        {
+-kDebug(161)<<"instance(): load KDED module";
+-            // Need to load the KDED time zones module
+-            delete ktimezoned;
+-            ktimezoned = 0;
+-            QDBusInterface kded("org.kde.kded", "/kded", "org.kde.kded");
+-            QDBusReply<bool> reply = kded.call("loadModule", "ktimezoned");
+-            if (!reply.isValid())
+-                kError(161) << "KSystemTimeZones: could not load ktimezoned kded module: " << reply.error().message() << endl;
+-            else if (!reply)
+-                kError(161) << "KSystemTimeZones: could not load ktimezoned kded module" << endl;
+-            ktimezoned = new QDBusInterface("org.kde.kded", "/modules/ktimezoned", KTIMEZONED_DBUS_IFACE);
+-kDebug(161)<<"instance(): ... loaded";
+-        }
+         QDBusReply<void> reply = ktimezoned->call("initialize", false);
+         if (!reply.isValid())
+             kError(161) << "KSystemTimeZones: ktimezoned initialize() D-Bus call failed: " << reply.error().message() << endl;
+--- a/kdecore/sycoca/ksycoca.h
++++ b/kdecore/sycoca/ksycoca.h
+@@ -35,7 +35,7 @@
+  * If the existing file is outdated, it will not get read
+  * but instead we'll ask kded to regenerate a new one...
+  */
+-#define KSYCOCA_VERSION 109
++#define KSYCOCA_VERSION 111
+ 
+ /**
+  * Sycoca file name, used internally (by kbuildsycoca)
+--- a/kdecore/sycoca/kprotocolinfo.cpp
++++ b/kdecore/sycoca/kprotocolinfo.cpp
+@@ -41,7 +41,7 @@
+   KConfigGroup config(&sconfig, "Protocol" );
+ 
+   m_name = config.readEntry( "protocol" );
+-  m_exec = config.readPathEntry( "exec" );
++  m_exec = config.readPathEntry( "exec", QString() );
+   m_isSourceProtocol = config.readEntry( "source", true );
+   m_isHelperProtocol = config.readEntry( "helper", false );
+   m_supportsReading = config.readEntry( "reading", false );
+@@ -85,9 +85,9 @@
+   else
+     m_outputType = KProtocolInfo::T_NONE;
+ 
+-  d->docPath = config.readPathEntry( "X-DocPath" );
++  d->docPath = config.readPathEntry( "X-DocPath", QString() );
+   if (d->docPath.isEmpty())
+-    d->docPath = config.readPathEntry( "DocPath" );
++    d->docPath = config.readPathEntry( "DocPath", QString() );
+   d->protClass = config.readEntry( "Class" ).toLower();
+   if (d->protClass[0] != ':')
+      d->protClass.prepend(QLatin1Char(':'));
+--- a/kdecore/sycoca/kprotocolinfo_p.h
++++ b/kdecore/sycoca/kprotocolinfo_p.h
+@@ -49,11 +49,11 @@
+   QString docPath;
+   QString protClass;
+   KProtocolInfo::ExtraFieldList extraFields;
+-  bool showPreviews;
+-  bool canRenameFromFile;
+-  bool canRenameToFile;
+-  bool canDeleteRecursive;
+-  bool fileNameUsedForCopying; // true if using UDS_NAME, false if using KUrl::fileName() [default]
++  bool showPreviews : 1;
++  bool canRenameFromFile : 1;
++  bool canRenameToFile : 1;
++  bool canDeleteRecursive : 1;
++  bool fileNameUsedForCopying : 1; // true if using UDS_NAME, false if using KUrl::fileName() [default]
+   //KUrl::URIMode uriMode;
+   QStringList capabilities;
+   QString proxyProtocol;
+--- a/kdecore/kdebugrc
++++ b/kdecore/kdebugrc
+@@ -19,7 +19,7 @@
+ # For file output you can give a filename by *Filename=<file>
+ # otherwise kdebug.dbg in the current directory is used.
+ #
+-# ekzample:
++# example:
+ #
+ # For the debug area 100 you want output of debug messages
+ # to a file /var/log/dbg.log and error messages as message boxes.
+--- a/kdecore/jobs/kjobuidelegate.cpp
++++ b/kdecore/jobs/kjobuidelegate.cpp
+@@ -33,8 +33,8 @@
+     KJobUiDelegate * const q;
+ 
+     KJob *job;
+-    bool autoErrorHandling;
+-    bool autoWarningHandling;
++    bool autoErrorHandling : 1;
++    bool autoWarningHandling : 1;
+ 
+     void connectJob(KJob *job);
+     void _k_result(KJob *job);
+--- a/kdecore/config/kconfiggroup.h
++++ b/kdecore/config/kconfiggroup.h
+@@ -24,10 +24,13 @@
+ #ifndef KCONFIGGROUP_H
+ #define KCONFIGGROUP_H
+ 
++#include "kconfigbase.h"
++
+ #include <kdecore_export.h>
+-#include <kconfigbase.h>
++
+ #include <QtCore/QExplicitlySharedDataPointer>
+ #include <QtCore/QVariant>
++#include <QtCore/QStringList>
+ 
+ class KConfig;
+ class KConfigGroupPrivate;
+@@ -88,61 +91,56 @@
+     bool isValid() const;
+ 
+     /**
+-     * Delete all entries in the entire group
+-     * @param pFlags flags passed to KConfig::deleteGroup
++     * The full name of this group, including and parent groups.
++     * The hierarchy separator is the slash.
++     * The root group is named "<default>".
+      */
+-    void deleteGroup(WriteConfigFlags pFlags=Normal);
++    QString name() const;
+ 
+     /**
+-     * Returns a map (tree) of entries for all entries in this group.
+-     *
+-     * Only the actual entry string is returned, none of the
+-     * other internal data should be included.
+-     *
+-     * @return A map of entries in this group, indexed by key.
++     * Check whether the containing KConfig object acutally contains a
++     * group with this name.
+      */
+-    QMap<QString, QString> entryMap() const;
++    bool exists() const;
++
++    /// @reimp
++    void sync();
++
++    /// @reimp
++    void markAsClean();
++
++    /// @reimp
++    AccessMode accessMode() const;
+ 
+     /**
+-     * Syncs the configuration object that this group belongs to.
++     * Return the config object that this group belongs to.
+      */
+-    void sync();
++    KConfig* config();
++    const KConfig* config() const;
+ 
+     /**
+      * Changes the group of the object. This is a convenience function and should
+      * not be overused. Prefer another object for another group to avoid mixture of
+      * groups. A subgroup can only change to another subgroup of the parent.
+      */
+-    void changeGroup( const QString &group );
+-    void changeGroup( const QByteArray &group);
+-    void changeGroup( const char *group);
++    KDE_DEPRECATED void changeGroup( const QString &group );
++    KDE_DEPRECATED void changeGroup( const QByteArray &group);
++    KDE_DEPRECATED void changeGroup( const char *group);
+ 
+-    QString name() const;
+-    bool exists() const;
++    /// @reimp
++    QStringList groupList() const;
+ 
+     /**
+-     * Return the config object that this group belongs to.
++     * Returns a list of keys this group contains.
+      */
+-    KConfig* config();
+-    const KConfig* config() const;
++    QStringList keyList() const;
+ 
+     /**
+-     * Return the data in @p value converted to a QVariant.
+-     * 
+-     * @param pKey The name of the entry being converted, this is only used for error
+-     * reporting.
+-     * @param value The UTF-8 data to be converted.
+-     * @param aDefault The default value if @p pKey is not found.
+-     * @return @p value converted to QVariant, or @p aDefault if @p value is invalid or cannot be converted.
++     * Delete all entries in the entire group
++     * @param pFlags flags passed to KConfig::deleteGroup
+      */
+-    static QVariant convertToQVariant(const char* pKey, const QByteArray& value, const QVariant& aDefault);
+-
+-    QString readEntry(const char *key, const char * aDefault = 0) const
+-    { return readEntry(QByteArray(key), aDefault); }
+-    QString readEntry(const QByteArray &key, const char * aDefault = 0) const;
+-    QString readEntry(const QString &key, const char * aDefault = 0) const
+-    { return readEntry(key.toUtf8(), aDefault); }
+-
++    void deleteGroup(WriteConfigFlags pFlags=Normal);
++    using KConfigBase::deleteGroup;
+ 
+     /**
+      * Reads the value of an entry specified by @p pKey in the current group.
+@@ -164,29 +162,29 @@
+      * @return The value for this key, or @p aDefault.
+      */
+     template <typename T>
+-    inline T readEntry(const QByteArray &key, const T &defaultValue) const
+-    { return readListCheck(key, defaultValue); }
+-
++        T readEntry(const QByteArray &key, const T &defaultValue) const
++            { return readListCheck(key, defaultValue); }
+     template <typename T>
+-        T readEntry( const QString& pKey, const T& aDefault) const
+-    { return readEntry(pKey.toUtf8(), aDefault); }
++        T readEntry(const QString& pKey, const T& aDefault) const
++            { return readEntry(pKey.toUtf8(), aDefault); }
+     template <typename T>
+-        T readEntry( const char *key, const T& aDefault) const
+-    { return readEntry(QByteArray(key), aDefault); }
++        T readEntry(const char *key, const T& aDefault) const
++            { return readEntry(QByteArray(key), aDefault); }
++
++    QString readEntry(const QByteArray &key, const char * aDefault = 0) const;
++    QString readEntry(const QString &key, const char * aDefault = 0) const;
++    QString readEntry(const char *key, const char * aDefault = 0) const;
+ 
+     /**
+-     * Reads a list of strings from the config object.
++     * Reads a list of strings from the config object, following XDG
++     * desktop entry spec separator semantics.
+      * @param pKey The key to search for.
+      * @param aDefault The default value to use if the key does not exist.
+-     * @param sep The list separator.
+      * @return The list. Contains @p aDefault if @p pKey does not exist.
+      */
+-    QStringList readEntry(const char* pKey, const QStringList& aDefault,
+-                          char sep=',') const;
+-    QStringList readEntry(const QByteArray& pKey, const QStringList& aDefault,
+-                          char sep=',') const;
+-    QStringList readEntry(const QString& pKey, const QStringList& aDefault,
+-                          char sep=',') const;
++    QStringList readXdgListEntry(const QByteArray& pKey, const QStringList& aDefault = QStringList()) const;
++    QStringList readXdgListEntry(const QString& pKey, const QStringList& aDefault = QStringList()) const;
++    QStringList readXdgListEntry(const char* pKey, const QStringList& aDefault = QStringList()) const;
+ 
+     /**
+      * Reads a path.
+@@ -199,9 +197,9 @@
+      * @param aDefault A default value returned if the key was not found.
+      * @return The value for this key. Can be QString() if aDefault is null.
+      */
+-    QString readPathEntry( const QString& pKey, const QString & aDefault = QString() ) const;
+-    QString readPathEntry( const QByteArray &key, const QString & aDefault = QString() ) const;
+-    QString readPathEntry( const char *key, const QString & aDefault = QString() ) const;
++    QString readPathEntry( const QByteArray &key, const QString & aDefault ) const;
++    QString readPathEntry( const QString& pKey, const QString & aDefault ) const;
++    QString readPathEntry( const char *key, const QString & aDefault ) const;
+ 
+     /**
+      * Reads a list of string paths.
+@@ -211,12 +209,12 @@
+      * for this value, so that e.g. $HOME gets expanded.
+      *
+      * @param pKey The key to search for.
+-     * @param sep  The list separator (default is ",").
++     * @param aDefault A default value returned if the key was not found.
+      * @return The list. Empty if the entry does not exist.
+      */
+-    QStringList readPathListEntry( const QString& pKey, char sep = ',' ) const;
+-    QStringList readPathListEntry( const QByteArray &key, char sep = ',' ) const;
+-    QStringList readPathListEntry( const char *key, char sep = ',' ) const;
++    QStringList readPathEntry( const QByteArray &key, const QStringList& aDefault ) const;
++    QStringList readPathEntry( const QString& pKey, const QStringList& aDefault ) const;
++    QStringList readPathEntry( const char *key, const QStringList& aDefault ) const;
+ 
+     /**
+      * Reads the value of an entry specified by @p pKey in the current group.
+@@ -226,46 +224,50 @@
+      * @param aDefault A default value returned if the key was not found.
+      * @return The value for this key.
+      */
+-    QString readEntryUntranslated( const QString& pKey,
+-                                   const QString& aDefault = QString() ) const;
+     QString readEntryUntranslated( const QByteArray &key,
+                                    const QString& aDefault = QString() ) const;
++    QString readEntryUntranslated( const QString& pKey,
++                                   const QString& aDefault = QString() ) const;
+     QString readEntryUntranslated( const char *key,
+                                    const QString& aDefault = QString() ) const;
+ 
+     /**
+-     * @copydoc writeEntry( const char*, const QString&, WriteConfigFlags )
++     * Writes a value to the config object.
++     *
++     * @param pKey The key to write
++     * @param value The value to write
++     * @param pFlags       The flags to use when writing this entry.
+      */
+     template <typename T>
+-    void writeEntry(const QByteArray &key, const T& value, WriteConfigFlags pFlags = Normal )
+-        { writeListCheck(key, value, pFlags); }
++        void writeEntry(const QByteArray &key, const T& value, WriteConfigFlags pFlags = Normal )
++            { writeListCheck(key, value, pFlags); }
+     template <typename T>
+-    void writeEntry( const QString& pKey, const T& value, WriteConfigFlags pFlags = Normal )
+-        { writeEntry( pKey.toUtf8(), value, pFlags ); }
++        void writeEntry( const QString& pKey, const T& value, WriteConfigFlags pFlags = Normal )
++            { writeEntry( pKey.toUtf8(), value, pFlags ); }
+     template <typename T>
+-    void writeEntry( const char *key, const T& value, WriteConfigFlags pFlags = Normal )
+-        { writeEntry( QByteArray(key), value, pFlags ); }
++        void writeEntry( const char *key, const T& value, WriteConfigFlags pFlags = Normal )
++            { writeEntry( QByteArray(key), value, pFlags ); }
+ 
++    void writeEntry(const QByteArray &key, const char *value, WriteConfigFlags pFlags = Normal);
++    void writeEntry(const QString &key, const char *value, WriteConfigFlags pFlags = Normal);
++    void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags = Normal);
+ 
+     /**
+-     * writeEntry() overridden to accept a list of strings.
++     * Writes a list of strings to the config object, following XDG
++     * desktop entry spec separator semantics.
+      *
+      * @param pKey The key to write
+      * @param value The list to write
+-     * @param sep  The list separator (default is ",").
+      * @param pFlags       The flags to use when writing this entry.
+      *
+      * @see  writeEntry()
+      */
+-    void writeEntry( const QString& pKey, const QStringList &value,
+-                     char sep = ',',
+-                     WriteConfigFlags pFlags = Normal );
+-    void writeEntry( const char *pKey, const QStringList &value,
+-                     char sep = ',',
+-                     WriteConfigFlags pFlags = Normal );
+-    void writeEntry( const QByteArray &key, const QStringList &value,
+-                     char sep = ',',
+-                     WriteConfigFlags pFlags = Normal );
++    void writeXdgListEntry( const QByteArray &key, const QStringList &value,
++                            WriteConfigFlags pFlags = Normal );
++    void writeXdgListEntry( const QString& pKey, const QStringList &value,
++                            WriteConfigFlags pFlags = Normal );
++    void writeXdgListEntry( const char *pKey, const QStringList &value,
++                            WriteConfigFlags pFlags = Normal );
+ 
+     /**
+      * Writes a file path.
+@@ -278,34 +280,32 @@
+      * @param path The path to write.
+      * @param pFlags       The flags to use when writing this entry.
+      */
++    void writePathEntry( const QByteArray &key, const QString & path,
++                         WriteConfigFlags pFlags = Normal );
+     void writePathEntry( const QString& pKey, const QString & path,
+                          WriteConfigFlags pFlags = Normal );
+     void writePathEntry( const char *pKey, const QString & path,
+                          WriteConfigFlags pFlags = Normal );
+-    void writePathEntry( const QByteArray &key, const QString & path,
+-                         WriteConfigFlags pFlags = Normal );
+ 
+     /**
+      * writePathEntry() overridden to accept a list of paths (strings).
+      *
+      * It is checked whether the paths are located under $HOME. If so each of
+      * the paths are written out with the user's home-directory replaced with
+-     * $HOME. The paths should be read back with readPathListEntry()
++     * $HOME. The paths should be read back with readPathEntry()
+      *
+      * @param pKey The key to write
+      * @param value The list to write
+-     * @param sep  The list separator (default is ",").
+      * @param pFlags       The flags to use when writing this entry.
+      *
+-     * @see  writePathEntry()
+-     * @see  readPathListEntry()
++     * @see  readPathEntry()
+      */
++    void writePathEntry( const QByteArray &key, const QStringList &value,
++                         WriteConfigFlags pFlags = Normal );
+     void writePathEntry( const QString& pKey, const QStringList &value,
+-                         char sep = ',', WriteConfigFlags pFlags = Normal );
++                         WriteConfigFlags pFlags = Normal );
+     void writePathEntry( const char *pKey, const QStringList &value,
+-                         char sep = ',', WriteConfigFlags pFlags = Normal );
+-    void writePathEntry( const QByteArray &key, const QStringList &value,
+-                         char sep = ',', WriteConfigFlags pFlags = Normal );
++                         WriteConfigFlags pFlags = Normal );
+ 
+     /**
+      * Deletes the entry specified by @p pKey in the current group.
+@@ -313,9 +313,9 @@
+      * @param pKey The key to delete.
+      * @param pFlags       The flags to use when deleting this entry.
+      */
+-    void deleteEntry( const QString& pKey, WriteConfigFlags pFlags = Normal );
+-    void deleteEntry( const char *pKey, WriteConfigFlags pFlags = Normal );
+     void deleteEntry(const QByteArray &key, WriteConfigFlags flags = Normal);
++    void deleteEntry(const QString& pKey, WriteConfigFlags pFlags = Normal);
++    void deleteEntry(const char *pKey, WriteConfigFlags pFlags = Normal);
+ 
+     /**
+      * Checks whether the key has an entry in the currently active group.
+@@ -330,7 +330,6 @@
+     bool hasKey(const QString &key) const;
+     bool hasKey(const char *key) const;
+ 
+-
+     /**
+      * Checks whether it is possible to change the given group.
+      * @return whether changes may be made to this group.
+@@ -343,16 +342,9 @@
+      * @return whether the entry @p key may be changed in the current group
+      * in this configuration file.
+      */
+-    bool entryIsImmutable(const QString &key) const;
+-    bool entryIsImmutable(const QByteArray &key) const;
+-    bool entryIsImmutable(const char *key) const;
+-
+-    /**
+-     * When set, all readEntry and readXXXEntry calls return the system
+-     * wide (default) values instead of the user's preference.
+-     * This is off by default.
+-     */
+-    void setReadDefaults(bool b);
++    bool isEntryImmutable(const QByteArray &key) const;
++    bool isEntryImmutable(const QString &key) const;
++    bool isEntryImmutable(const char *key) const;
+ 
+     /**
+      * Reverts the entry with key @p key in the current group in the
+@@ -364,9 +356,9 @@
+      *
+      * @param key The key of the entry to revert.
+      */
++    void revertToDefault(const QByteArray &key);
+     void revertToDefault(const QString &key);
+     void revertToDefault(const char* key);
+-    void revertToDefault(const QByteArray &key);
+ 
+     /**
+      * Returns whether a default is specified for an entry in either the
+@@ -393,24 +385,26 @@
+      * and will follow changes the computed default makes over time.
+      * @param key The key of the entry to check.
+      */
++    bool hasDefault(const QByteArray &key) const;
+     bool hasDefault(const QString &key) const;
+     bool hasDefault(const char* key) const;
+-    bool hasDefault(const QByteArray &key) const;
+ 
+-    QStringList groupList() const;
+-    QStringList keyList() const;
+-    void clean();
+-    ConfigState getConfigState() const;
++    /**
++     * Returns a map (tree) of entries for all entries in this group.
++     *
++     * Only the actual entry string is returned, none of the
++     * other internal data should be included.
++     *
++     * @return A map of entries in this group, indexed by key.
++     */
++    KDE_DEPRECATED QMap<QString, QString> entryMap() const;
+ 
+-    inline void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags = Normal);
+-    inline void writeEntry(const QByteArray &key, const char *value, WriteConfigFlags pFlags = Normal);
+-    inline void writeEntry(const QString &key, const char *value, WriteConfigFlags pFlags = Normal);
+ protected:
+     bool hasGroupImpl(const QByteArray &group) const;
+     KConfigGroup groupImpl(const QByteArray &b);
+     const KConfigGroup groupImpl(const QByteArray &b) const;
+     void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags);
+-    bool groupIsImmutableImpl(const QByteArray& aGroup) const;
++    bool isGroupImmutableImpl(const QByteArray& aGroup) const;
+ 
+ private:
+     QExplicitlySharedDataPointer<KConfigGroupPrivate> d;
+@@ -428,6 +422,18 @@
+     inline void writeListCheck(const QByteArray &key, const QList<T> &value, WriteConfigFlags pFlags);
+ 
+     friend class KConfigGroupPrivate;
++
++    /**
++     * Return the data in @p value converted to a QVariant.
++     * 
++     * @param pKey The name of the entry being converted, this is only used for error
++     * reporting.
++     * @param value The UTF-8 data to be converted.
++     * @param aDefault The default value if @p pKey is not found.
++     * @return @p value converted to QVariant, or @p aDefault if @p value is invalid or cannot be converted.
++     */
++    static QVariant convertToQVariant(const char* pKey, const QByteArray& value, const QVariant& aDefault);
++    friend class KServicePrivate; // XXX yeah, ugly^5
+ };
+ 
+ #define KCONFIGGROUP_ENUMERATOR_ERROR(ENUM) \
+@@ -476,14 +482,17 @@
+ writeEntry(key, QByteArray(M_enum.valueToKeys(value)), flags);              \
+ }
+ 
+-#include <conversion_check.h>
++#include "conversion_check.h"
+ 
+ template<>
+ KDECORE_EXPORT QVariantList KConfigGroup::readEntry<QVariantList>(const QByteArray &key, const QVariantList &defaultValue) const;
+ template<>
+ KDECORE_EXPORT QVariant KConfigGroup::readEntry<QVariant>(const QByteArray &key, const QVariant &defaultValue) const;
+ template<>
++KDECORE_EXPORT QStringList KConfigGroup::readEntry<QStringList>(const QByteArray &key, const QStringList &defaultValue) const;
++template<>
+ KDECORE_EXPORT QString KConfigGroup::readEntry<QString>(const QByteArray &key, const QString &defaultValue) const;
++
+ template<class T>
+ T KConfigGroup::readListCheck(const QByteArray &key, const T &defaultValue) const
+ {
+@@ -511,7 +520,7 @@
+   QList<T> list;
+   if (!vList.isEmpty()) {
+     Q_FOREACH (const QVariant &aValue, vList) {
+-      Q_ASSERT(aValue.canConvert<T>());
++      Q_ASSERT(qVariantCanConvert<T>(aValue));
+       list.append( qvariant_cast<T>(aValue) );
+     }
+   }
+@@ -528,15 +537,10 @@
+ template<>
+ KDECORE_EXPORT void KConfigGroup::writeEntry<QByteArray>(const QByteArray &key, const QByteArray &value, KConfigBase::WriteConfigFlags pFlags);
+ template<>
++KDECORE_EXPORT void KConfigGroup::writeEntry<QStringList>(const QByteArray &key, const QStringList &value, KConfigBase::WriteConfigFlags pFlags);
++template<>
+ KDECORE_EXPORT void KConfigGroup::writeEntry<QVariantList>(const QByteArray &key, const QVariantList &value, KConfigBase::WriteConfigFlags pFlags);
+ 
+-inline void KConfigGroup::writeEntry(const char *key, const char *value, WriteConfigFlags pFlags)
+-{ writeEntry<const char *>(QByteArray(key), value, pFlags); }
+-inline void KConfigGroup::writeEntry(const QByteArray &key, const char *value, WriteConfigFlags pFlags)
+-{ writeEntry<const char *>(key, value, pFlags); }
+-inline void KConfigGroup::writeEntry(const QString &key, const char *value, WriteConfigFlags pFlags)
+-{ writeEntry<const char *>(key.toUtf8(), value, pFlags); }
+-
+ template <typename T>
+ void KConfigGroup::writeListCheck( const QByteArray &key, const QList<T>& list,
+                               WriteConfigFlags pFlags )
+@@ -548,7 +552,7 @@
+   Q_FOREACH(const T &value, list)
+     vList.append(value);
+ 
+-  writeEntry( key, QVariant(vList), pFlags );
++  writeEntry( key, vList, pFlags );
+ }
+ 
+ template <typename T>
+--- a/kdecore/config/kconfig_p.h
++++ b/kdecore/config/kconfig_p.h
+@@ -50,14 +50,12 @@
+ 
+     // functions for KConfigGroup
+     bool canWriteEntry(const QByteArray& group, const QByteArray& key, bool isDefault=false) const;
+-    QString lookupData(const QByteArray& group, const QByteArray& key, int flags, bool* expand) const;
+-    QByteArray lookupData(const QByteArray& group, const QByteArray& key, int flags) const;
++    QString lookupData(const QByteArray& group, const QByteArray& key, KEntryMap::SearchFlags flags,
++                       bool* expand) const;
++    QByteArray lookupData(const QByteArray& group, const QByteArray& key, KEntryMap::SearchFlags flags) const;
+ 
+-    enum ExtendedWriteFlag { NoFlag = 0x0, Expand = 0x1, Delete =0x2 };
+-    Q_DECLARE_FLAGS(ExtendedWriteFlags, ExtendedWriteFlag)
+-
+-    void putData(const QByteArray& group, const QByteArray& key,
+-        const QByteArray& value, KConfigBase::WriteConfigFlags flags, ExtendedWriteFlags = NoFlag);
++    void putData(const QByteArray& group, const QByteArray& key, const QByteArray& value,
++                 KConfigBase::WriteConfigFlags flags, bool expand=false);
+     QStringList groupList(const QByteArray& group) const;
+ 
+ protected:
+@@ -65,7 +63,7 @@
+ 
+     KConfigPrivate(const KComponentData &componentData_, KConfig::OpenFlags flags,
+            const char* resource);
+-    
++
+     ~KConfigPrivate()
+     {
+     }
+@@ -89,12 +87,11 @@
+ 
+     QString locale;
+     QString fileName;
+-    QString currentGroup;
+     KComponentData componentData;
+-    KConfigBase::ConfigState configState;
++    KConfigBase::AccessMode configState;
+ 
+     bool wantGlobals() const { return openFlags&KConfig::IncludeGlobals; }
+-    bool wantDefaults() const { return openFlags&KConfig::CascadeConfig; }
++    bool wantDefaults() const { return openFlags&KConfig::NoGlobals; }
+     bool wantMerge() const { return !(openFlags&KConfig::DontMergeOnSync); }
+     bool isSimple() const { return openFlags == KConfig::SimpleConfig; }
+     bool isReadOnly() const { return configState == KConfig::ReadOnly; }
+@@ -108,6 +105,4 @@
+     void setDirty(bool b);
+ };
+ 
+-Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigPrivate::ExtendedWriteFlags)
+-
+-#endif // KCONFIG_H
++#endif // KCONFIG_P_H
+--- a/kdecore/config/kconfigini_p.h
++++ b/kdecore/config/kconfigini_p.h
+@@ -44,6 +44,7 @@
+                      WriteOptions options, const KComponentData &data);
+ 
+     bool isWritable() const;
++    KConfigBase::AccessMode accessMode() const;
+     void createEnclosing();
+     void setFilePath(const QString& path);
+     bool lock(const KComponentData& componentData);
+--- a/kdecore/config/DESIGN.kconfig
++++ b/kdecore/config/DESIGN.kconfig
+@@ -45,7 +45,7 @@
+ <Changed during KDE 3.0 / 3.2>
+ Extra functions:
+ 
+-bool entryIsImmutable(key); // Can entry be modified?
++bool isEntryImmutable(key); // Can entry be modified?
+ bool hasDefault(key); // Is there a system wide default set for the entry?
+ void revertToDefault(key); // Restore to default
+ void deleteEntry(key); // Remove entry
+--- a/kdecore/config/kconfigbase.cpp
++++ b/kdecore/config/kconfigbase.cpp
+@@ -86,20 +86,20 @@
+     deleteGroupImpl(group, flags);
+ }
+ 
+-bool KConfigBase::groupIsImmutable(const QByteArray& aGroup) const
++bool KConfigBase::isGroupImmutable(const QByteArray& aGroup) const
+ {
+-    return groupIsImmutableImpl(aGroup);
++    return isGroupImmutableImpl(aGroup);
+ }
+ 
+-bool KConfigBase::groupIsImmutable(const QString& aGroup) const
++bool KConfigBase::isGroupImmutable(const QString& aGroup) const
+ {
+-    return groupIsImmutableImpl(aGroup.toUtf8());
++    return isGroupImmutableImpl(aGroup.toUtf8());
+ }
+ 
+ 
+-bool KConfigBase::groupIsImmutable(const char *aGroup) const
++bool KConfigBase::isGroupImmutable(const char *aGroup) const
+ {
+-    return groupIsImmutableImpl(aGroup);
++    return isGroupImmutableImpl(aGroup);
+ }
+ 
+ KConfigBase::~KConfigBase()
+--- a/kdecore/config/kconfigini.cpp
++++ b/kdecore/config/kconfigini.cpp
+@@ -412,8 +412,21 @@
+     }
+ }
+ 
++KConfigBase::AccessMode KConfigIniBackend::accessMode() const
++{
++    if (filePath().isEmpty())
++        return KConfigBase::NoAccess;
++
++    if (KStandardDirs::checkAccess(filePath(), W_OK))
++        return KConfigBase::ReadWrite;
++
++    return KConfigBase::ReadOnly;
++}
++
+ bool KConfigIniBackend::lock(const KComponentData& componentData)
+ {
++    Q_ASSERT(!filePath().isEmpty());
++
+     lockFile = new KLockFile(filePath() + QLatin1String(".lock"), componentData);
+ 
+     if (lockFile->lock() == KLockFile::LockStale) // attempt to break the lock
+--- a/kdecore/config/kconfigbase.h
++++ b/kdecore/config/kconfigbase.h
+@@ -30,6 +30,7 @@
+ 
+ class QStringList;
+ class KConfigGroup;
++class KConfigBasePrivate;
+ 
+ class KDECORE_EXPORT KConfigBase
+ {
+@@ -49,7 +50,6 @@
+          * application specific config file.
+          */
+         Localized = 0x04,
+-        NLS = Localized,
+         /**<
+          * Add the locale tag to the key when writing it.
+          */
+@@ -62,13 +62,19 @@
+     };
+     Q_DECLARE_FLAGS(WriteConfigFlags, WriteConfigFlag)
+ 
+-
+     /**
+      * Destructs the KConfigBase object.
+      */
+     virtual ~KConfigBase();
+ 
+     /**
++     * Returns a list of groups that are known about.
++     *
++     * @return The list of groups.
++     **/
++    virtual QStringList groupList() const = 0;
++
++    /**
+      * Returns true if the specified group is known about.
+      *
+      * @param group The group to search for.
+@@ -78,72 +84,78 @@
+     bool hasGroup(const char *group) const;
+     bool hasGroup(const QByteArray &group) const;
+ 
+-  /**
+-   * Returns a list of groups that are known about.
+-   *
+-   * @return The list of groups.
+-   **/
+-    virtual QStringList groupList() const = 0;
+-
+-    KConfigGroup group( const QByteArray &b);
+-    KConfigGroup group( const QString &str);
+-    KConfigGroup group( const char *str);
+-
+-    const KConfigGroup group( const QByteArray &b ) const;
+-    const KConfigGroup group( const QString &s ) const;
+-    const KConfigGroup group( const char *s ) const;
+-
+-
+-  /**
+-   * Mark the config object as "clean," i.e. don't write dirty entries
+-   * at destruction time. If @p bDeep is false, only the global dirty
+-   * flag of the KConfig object gets cleared. If you then call
+-   * writeEntry() again, the global dirty flag is set again and all
+-   * dirty entries will be written at a subsequent sync() call.
+-   *
+-   */
+-    virtual void clean() = 0;
+-
+-    KDE_DEPRECATED void rollback() { clean(); }
+-
+-  /**
+-   * Checks whether this configuration object can be modified.
+-   * @return whether changes may be made to this configuration object.
+-   */
+-    virtual bool isImmutable() const = 0;
+-
+     /**
+-     * Possible return values for getConfigState().
++     * Returns an object for the named subgroup.
+      *
+-     * @see  getConfigState()
+-     */
+-    enum ConfigState { NoAccess, ReadOnly, ReadWrite };
++     * @param group the group to open. Pass a null string on to the KConfig
++     *   object to obtain a handle on the root group.
++     * @return The list of groups.
++     **/
++    KConfigGroup group(const QByteArray &group);
++    KConfigGroup group(const QString &group);
++    KConfigGroup group(const char *group);
+ 
+-  /**
+-   * Returns the state of the app-config object.
+-   *
+-   * Possible return values
+-   * are NoAccess (the application-specific config file could not be
+-   * opened neither read-write nor read-only), ReadOnly (the
+-   * application-specific config file is opened read-only, but not
+-   * read-write) and ReadWrite (the application-specific config
+-   * file is opened read-write).
+-   *
+-   * @see  ConfigState()
+-   * @return the state of the app-config object
+-   */
+-    virtual ConfigState getConfigState() const = 0;
++    /**
++     * @overload
++     **/
++    const KConfigGroup group(const QByteArray &group) const;
++    const KConfigGroup group(const QString &group) const;
++    const KConfigGroup group(const char *group) const;
+ 
++    /**
++     * Delete @p aGroup. This marks @p aGroup as @em deleted in the config object. This effectively
++     * removes any cascaded values from config files earlier in the stack.
++     */
+     void deleteGroup(const QByteArray &group, WriteConfigFlags flags = Normal);
+     void deleteGroup(const QString &group, WriteConfigFlags flags = Normal);
+     void deleteGroup(const char *group, WriteConfigFlags flags = Normal);
+ 
+-    bool groupIsImmutable(const QByteArray& aGroup) const;
+-    bool groupIsImmutable(const QString& aGroup) const;
+-    bool groupIsImmutable(const char *aGroup) const;
+-
++    /**
++     * Syncs the configuration object that this group belongs to.
++     */
+     virtual void sync() = 0;
+ 
++    /**
++     * Reset the dirty flags of all entries in the entry map, so the
++     * values will not be written to disk on a later call to sync().
++     */
++    virtual void markAsClean() = 0;
++
++    /**
++     * Possible return values for accessMode().
++     */
++    enum AccessMode { NoAccess, ReadOnly, ReadWrite };
++
++    /**
++     * Returns the access mode of the app-config object.
++     *
++     * Possible return values
++     * are NoAccess (the application-specific config file could not be
++     * opened neither read-write nor read-only), ReadOnly (the
++     * application-specific config file is opened read-only, but not
++     * read-write) and ReadWrite (the application-specific config
++     * file is opened read-write).
++     *
++     * @return the access mode of the app-config object
++     */
++    virtual AccessMode accessMode() const = 0;
++
++    /**
++     * Checks whether this configuration object can be modified.
++     * @return whether changes may be made to this configuration object.
++     */
++    virtual bool isImmutable() const = 0;
++
++    /**
++     * Can changes be made to the entries in @p aGroup?
++     * 
++     * @param aGroup The group to check for immutability.
++     * @return @c false if the entries in @p aGroup can be modified.
++     */
++    bool isGroupImmutable(const QByteArray& aGroup) const;
++    bool isGroupImmutable(const QString& aGroup) const;
++    bool isGroupImmutable(const char *aGroup) const;
++
+ protected:
+     KConfigBase();
+ 
+@@ -151,7 +163,7 @@
+     virtual KConfigGroup groupImpl( const QByteArray &b) = 0;
+     virtual const KConfigGroup groupImpl(const QByteArray &b) const = 0;
+     virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags = Normal) = 0;
+-    virtual bool groupIsImmutableImpl(const QByteArray& aGroup) const = 0;
++    virtual bool isGroupImmutableImpl(const QByteArray& aGroup) const = 0;
+ 
+     /** Virtual hook, used to add new "virtual" functions while maintaining
+      * binary compatibility. Unused in this class.
+--- a/kdecore/config/kconfig.cpp
++++ b/kdecore/config/kconfig.cpp
+@@ -56,7 +56,7 @@
+     : openFlags(flags), resourceType(resource), mBackend(0),
+       bDynamicBackend(true),  bDirty(false), bReadDefaults(false),
+       bFileImmutable(false), bForceGlobal(false), componentData(componentData_),
+-      configState(KConfigBase::ReadWrite)
++      configState(KConfigBase::NoAccess)
+ {
+     sGlobalFileName = componentData.dirs()->saveLocation("config") +
+                           QString::fromLatin1("kdeglobals");
+@@ -180,9 +180,7 @@
+ {
+     Q_D(const KConfig);
+     QStringList keys;
+-    const QByteArray theGroup(aGroup.isEmpty() ?
+-            (aGroup.isNull()? d->currentGroup.toUtf8(): "<default>"):
+-            aGroup.toUtf8());
++    const QByteArray theGroup(aGroup.isEmpty() ? "<default>" : aGroup.toUtf8());
+ 
+     const KEntryMapConstIterator theEnd = d->entryMap.constEnd();
+     KEntryMapConstIterator it = d->entryMap.findEntry(theGroup);
+@@ -205,9 +203,7 @@
+ {
+     Q_D(const KConfig);
+     QMap<QString, QString> theMap;
+-    const QByteArray theGroup(aGroup.isEmpty()?
+-            (aGroup.isNull()? d->currentGroup.toUtf8(): "<default>"):
+-            aGroup.toUtf8());
++    const QByteArray theGroup(aGroup.isEmpty() ? "<default>" : aGroup.toUtf8());
+ 
+     const KEntryMapConstIterator theEnd = d->entryMap.constEnd();
+     KEntryMapConstIterator it = d->entryMap.findEntry(theGroup, 0, 0);
+@@ -245,15 +241,15 @@
+         }
+ 
+         // lock the local file
+-        if (!d->lockLocal()) {
+-            kWarning() << "couldn't lock local file";
++        if (d->configState == ReadWrite && !d->lockLocal()) {
++            qWarning() << "couldn't lock local file";
+             return;
+         }
+ 
+         KEntryMap toMerge;
+         if (d->wantGlobals()) {
+             KSharedPtr<KConfigBackend> tmp = KConfigBackend::create(componentData(), d->sGlobalFileName);
+-            if (!tmp->lock(componentData())) {
++            if (d->configState == ReadWrite && !tmp->lock(componentData())) {
+                 qWarning() << "couldn't lock global file";
+                 return;
+             }
+@@ -273,7 +269,7 @@
+     }
+ }
+ 
+-void KConfig::clean()
++void KConfig::markAsClean()
+ {
+     Q_D(KConfig);
+     d->bDirty = false;
+@@ -354,6 +350,8 @@
+         mBackend = KConfigBackend::create(componentData, file);
+     else
+         mBackend->setFilePath(file);
++
++    configState = mBackend->accessMode();
+ }
+ 
+ void KConfig::reparseConfiguration()
+@@ -368,31 +366,10 @@
+     d->bFileImmutable = false;
+ 
+     // Parse all desired files from the least to the most specific.
+-
+-    // lock the local file
+-    if (!d->lockLocal()) {
+-        //what do we do now?
+-    }
+-
+-    if (d->wantGlobals()) {
+-        KSharedPtr<KConfigBackend> global = KConfigBackend::create(componentData(), d->sGlobalFileName);
+-        // lock the global file
+-        if (!global->lock(componentData())) {
+-            //what do we do now?
+-        }
+-
++    if (d->wantGlobals())
+         d->parseGlobalFiles();
+ 
+-        // unlock the global file
+-        if (global->isLocked())
+-            global->unlock();
+-    }
+-
+     d->parseConfigFiles();
+-
+-    // unlock local file
+-    if (d->mBackend && d->mBackend->isLocked())
+-        d->mBackend->unlock();
+ }
+ 
+ void KConfigPrivate::parseGlobalFiles()
+@@ -478,7 +455,7 @@
+     }
+ }
+ 
+-KConfig::ConfigState KConfig::getConfigState() const
++KConfig::AccessMode KConfig::accessMode() const
+ {
+     Q_D(const KConfig);
+     return d->configState;
+@@ -540,7 +517,7 @@
+     return d->bFileImmutable;
+ }
+ 
+-bool KConfig::groupIsImmutableImpl(const QByteArray& aGroup) const
++bool KConfig::isGroupImmutableImpl(const QByteArray& aGroup) const
+ {
+     Q_D(const KConfig);
+     return isImmutable()|d->entryMap.getEntryOption(aGroup, 0, 0, KEntryMap::EntryImmutable);
+@@ -558,18 +535,6 @@
+     return d->bForceGlobal;
+ }
+ 
+-void KConfig::setGroup(const QString& group)
+-{
+-    Q_D(KConfig);
+-    d->currentGroup = group;
+-}
+-
+-QString KConfig::group() const
+-{
+-    Q_D(const KConfig);
+-    return d->currentGroup;
+-}
+-
+ KConfigGroup KConfig::groupImpl(const QByteArray &arr)
+ {
+     return KConfigGroup(this, arr);
+@@ -588,7 +553,7 @@
+         options |= KEntryMap::EntryDirty;
+     if (flags&KConfig::Global)
+         options |= KEntryMap::EntryGlobal;
+-    if (flags&KConfig::NLS)
++    if (flags&KConfig::Localized)
+         options |= KEntryMap::EntryLocalized;
+     return options;
+ }
+@@ -652,7 +617,7 @@
+ }
+ 
+ void KConfigPrivate::putData( const QByteArray& group, const QByteArray& key,
+-                      const QByteArray& value, KConfigBase::WriteConfigFlags flags, ExtendedWriteFlags extendedFlags)
++                      const QByteArray& value, KConfigBase::WriteConfigFlags flags, bool expand)
+ {
+     // the KConfig object is dirty now
+     // set this before any IO takes place so that if any derivative
+@@ -665,30 +630,32 @@
+     KEntryMap::EntryOptions options;
+     if (flags& KConfigBase::Global || bForceGlobal)
+         options |= KEntryMap::EntryGlobal;
+-    if (flags& KConfigBase::NLS)
++    if (flags& KConfigBase::Localized)
+         options |= KEntryMap::EntryLocalized;
+     if (flags& KConfigBase::Persistent)
+         options |= KEntryMap::EntryDirty;
+-    if (extendedFlags & Expand)
+-        options |=KEntryMap::EntryExpansion;
++    if (expand)
++        options |= KEntryMap::EntryExpansion;
+ 
+-    if (extendedFlags & Delete) // deleting entry
++    if (value.isNull()) // deleting entry
+         options |= KEntryMap::EntryDeleted;
+ 
+     entryMap.setEntry(group, key, value, options);
+ }
+ 
+-QByteArray KConfigPrivate::lookupData(const QByteArray& group, const QByteArray& key, int flags) const
++QByteArray KConfigPrivate::lookupData(const QByteArray& group, const QByteArray& key,
++                                      KEntryMap::SearchFlags flags) const
+ {
+-    KEntryMapConstIterator it = entryMap.findEntry(group, key, KEntryMap::SearchFlags(flags));
++    KEntryMapConstIterator it = entryMap.findEntry(group, key, flags);
+     if (it == entryMap.constEnd())
+         return QByteArray();
+     return it->mValue;
+ }
+ 
+-QString KConfigPrivate::lookupData(const QByteArray& group, const QByteArray& key, int flags, bool *expand) const
++QString KConfigPrivate::lookupData(const QByteArray& group, const QByteArray& key,
++                                   KEntryMap::SearchFlags flags, bool *expand) const
+ {
+-    return entryMap.getEntry(group, key, QString(), KEntryMap::SearchFlags(flags), expand);
++    return entryMap.getEntry(group, key, QString(), flags, expand);
+ }
+ 
+ void KConfig::virtual_hook(int /*id*/, void* /*data*/)
+--- a/kdecore/config/kdesktopfile.cpp
++++ b/kdecore/config/kdesktopfile.cpp
+@@ -40,7 +40,7 @@
+ };
+ 
+ KDesktopFilePrivate::KDesktopFilePrivate(const char * resourceType, const QString &fileName)
+-    : KConfigPrivate(KGlobal::mainComponent(), KConfig::CascadeConfig, resourceType)
++    : KConfigPrivate(KGlobal::mainComponent(), KConfig::NoGlobals, resourceType)
+ {
+     mBackend = new KConfigIniBackend();
+     bDynamicBackend = false;
+@@ -192,7 +192,7 @@
+ QString KDesktopFile::readPath() const
+ {
+   Q_D(const KDesktopFile);
+-  return d->desktopGroup.readPathEntry("Path");
++  return d->desktopGroup.readPathEntry("Path", QString());
+ }
+ 
+ QString KDesktopFile::readDevice() const
+@@ -207,7 +207,7 @@
+     if (hasDeviceType()) {
+         return d->desktopGroup.readEntry("MountPoint", QString());
+     } else {
+-	QString url = d->desktopGroup.readPathEntry("URL");
++	QString url = d->desktopGroup.readPathEntry("URL", QString());
+         if ( !url.isEmpty() && !QDir::isRelativePath(url) )
+         {
+             // Handle absolute paths as such (i.e. we need to escape them)
+@@ -220,7 +220,7 @@
+ QStringList KDesktopFile::readActions() const
+ {
+     Q_D(const KDesktopFile);
+-    return d->desktopGroup.readEntry("Actions", QStringList(), ';');
++    return d->desktopGroup.readXdgListEntry("Actions");
+ }
+ 
+ KConfigGroup KDesktopFile::actionGroup(const QString &group)
+@@ -262,7 +262,7 @@
+ {
+   Q_D(const KDesktopFile);
+   // Test for TryExec and "X-KDE-AuthorizeAction"
+-  QString te = d->desktopGroup.readPathEntry("TryExec");
++  QString te = d->desktopGroup.readPathEntry("TryExec", QString());
+ 
+   if (!te.isEmpty()) {
+     if (!QDir::isRelativePath(te)) {
+@@ -342,8 +342,8 @@
+ {
+   Q_D(const KDesktopFile);
+   if(d->desktopGroup.hasKey( "DocPath" ))
+-    return d->desktopGroup.readPathEntry( "DocPath" );
+-  return d->desktopGroup.readPathEntry( "X-DocPath" );
++    return d->desktopGroup.readPathEntry( "DocPath", QString() );
++  return d->desktopGroup.readPathEntry( "X-DocPath", QString() );
+ }
+ 
+ KDesktopFile* KDesktopFile::copyTo(const QString &file) const
+--- a/kdecore/config/kconfig.h
++++ b/kdecore/config/kconfig.h
+@@ -24,7 +24,9 @@
+ #ifndef KCONFIG_H
+ #define KCONFIG_H
+ 
+-#include <kconfigbase.h>
++#include "kconfigbase.h"
++
++#include <kdecore_export.h>
+ 
+ #include <QtCore/QString>
+ #include <QtCore/QVariant>
+@@ -40,17 +42,19 @@
+ {
+ public:
+     enum OpenFlag {
+-        SimpleConfig     =0x00, ///< no cascading, no globals
+-        IncludeGlobals =0x01, ///< read globals
+-        CascadeConfig=0x02, ///< cascade
+-        DontMergeOnSync=0x04, ///< merge when sync() called
+-        FullConfig=IncludeGlobals|CascadeConfig ///< cascade, read globals
++        IncludeGlobals  = 0x01, ///< Blend kdeglobals into the config object.
++        CascadeConfig   = 0x02, ///< Cascade to system-wide config files.
++        DontMergeOnSync = 0x04, ///< Overwrite concurrent changes.
++
++        /// The following are convenience definitions for the basic mode.
++        /// Do @em not combine them with anything but DontMergeOnSync.
++        SimpleConfig    = 0x00, ///< Just a single config file.
++        NoCascade       = IncludeGlobals, ///< Include user's globals, but omit system settings.
++        NoGlobals       = CascadeConfig, ///< Cascade to system settings, but omit user's globals.
++        FullConfig      = IncludeGlobals|CascadeConfig ///< Fully-fledged config.
+     };
+     Q_DECLARE_FLAGS(OpenFlags, OpenFlag)
+ 
+-    static const OpenFlag OnlyLocal=SimpleConfig;
+-    static const OpenFlag NoGlobals=CascadeConfig;
+-
+     explicit KConfig(const QString& file = QString(), OpenFlags mode = FullConfig,
+                      const char* resourceType = "config");
+ 
+@@ -59,32 +63,25 @@
+ 
+     virtual ~KConfig();
+ 
+-    virtual void sync();
+-
+     const KComponentData &componentData() const; // krazy:exclude=constref
+ 
+     /**
+-     * Checks whether the config file contains the update @p id
+-     * as contained in @p updateFile. If not, it runs kconf_update
+-     * to update the config file.
+-     *
+-     * If you install config update files with critical fixes
+-     * you may wish to use this method to verify that a critical
+-     * update has indeed been performed to catch the case where
+-     * a user restores an old config file from backup that has
+-     * not been updated yet.
+-     * @param id the update to check
+-     * @param updateFile the file containing the update
++     * Returns the filename passed to the constructor.
+      */
+-    void checkUpdate(const QString &id, const QString &updateFile);
++    QString name() const;
+ 
+-    /**
+-     * Cleans all entries in the entry map, so the
+-     * values will not be written to disk on a later call to
+-     * sync().
+-     *
+-     */
+-    void clean();
++    /// @reimp
++    void sync();
++
++    /// @reimp
++    void markAsClean();
++
++    /// @{ configuration object state
++    /// @reimp
++    AccessMode accessMode() const;
++
++    bool isConfigWritable(bool warnUser);
++    /// @}
+ 
+     /**
+      * Copies all entries from this config object to a new config
+@@ -99,22 +96,25 @@
+     KConfig* copyTo(const QString &file, KConfig *config=0) const;
+ 
+     /**
+-     * Clears all internal data structures and then reread
+-     * configuration information from persistent storage.
++     * Checks whether the config file contains the update @p id
++     * as contained in @p updateFile. If not, it runs kconf_update
++     * to update the config file.
++     *
++     * If you install config update files with critical fixes
++     * you may wish to use this method to verify that a critical
++     * update has indeed been performed to catch the case where
++     * a user restores an old config file from backup that has
++     * not been updated yet.
++     * @param id the update to check
++     * @param updateFile the file containing the update
+      */
+-    void reparseConfiguration();
++    void checkUpdate(const QString &id, const QString &updateFile);
+ 
+-    /// @{ configuration object state
+     /**
+-     * Returns the state of the config object.
+-     *
+-     * @see  ConfigState
+-     * @return the state of the config object
++     * Clears all internal data structures and then reread
++     * configuration information from persistent storage.
+      */
+-    virtual ConfigState getConfigState() const;
+-
+-    bool isConfigWritable(bool warnUser);
+-    /// @}
++    void reparseConfiguration();
+ 
+     /// @{ extra config files
+     /**
+@@ -124,14 +124,12 @@
+      * local config files to set.
+      */
+     void addConfigSources(const QStringList &sources);
+-    KDE_DEPRECATED void setExtraConfigFiles(const QStringList &files) { addConfigSources(files); }
+ 
+     /// @}
+     /// @{ locales
+     /**
+      * Returns the current locale.
+      */
+-
+     QString locale() const;
+     /**
+      * Sets the locale to @p aLocale.
+@@ -144,11 +142,17 @@
+     /// @}
+ 
+     /// @{ defaults
++    /**
++     * When set, all readEntry and readXXXEntry calls return the system
++     * wide (default) values instead of the user's preference.
++     * This is off by default.
++     */
+     void setReadDefaults(bool b);
+     bool readDefaults() const;
+     /// @}
+ 
+     /// @{ immutability
++    /// @reimp
+     bool isImmutable() const;
+     /// @}
+ 
+@@ -168,61 +172,10 @@
+     KDE_DEPRECATED bool forceGlobal() const;
+     /// @}
+ 
+-    /// @{ groups
+-    /**
+-     * Specifies the group in which keys will be read and written.
+-     *
+-     *  Subsequent
+-     * calls to readEntry() and writeEntry() will be applied only in the
+-     * activated group.
+-     *
+-     * Switch back to the default group by passing a null string.
+-     * @param group The name of the new group.
+-     */
+-    KDE_DEPRECATED void setGroup( const QString& group );
+-    /**
+-     * Returns the name of the group in which we are
+-     *  searching for keys and from which we are retrieving entries.
+-     *
+-     * @return The current group.
+-     */
+-    KDE_DEPRECATED QString group() const;
+-    using KConfigBase::group;
++    /// @reimp
++    QStringList groupList() const;
+ 
+     /**
+-     * Returns a list of groups that are known.
+-     * @return a list of of groups
+-     */
+-    virtual QStringList groupList() const;
+-
+-    /**
+-     * Does this config object contain @p aGroup?
+-     * @return @c true if aGroup exists.
+-     */
+-    /**
+-     * Delete @p aGroup. This marks @p aGroup as @em deleted in the config object. This effectively
+-     * removes any cascaded values from config files earlier in the stack.
+-     */
+-
+-    /**
+-     * Can changes be made to the entries in @p aGroup?
+-     * 
+-     * @param aGroup The group to check for immutability.
+-     * @return @c false if the entries in @p aGroup can be modified.
+-     */
+-
+-    /// @}
+-
+-    /// @{ entries
+-
+-    KDE_DEPRECATED QString readEntryUntranslated(const char* aKey, const QString& aDefault=QString()) const;
+-    /// @}
+-
+-    /**
+-     * Returns the filename passed to the constructor.
+-     */
+-    QString name() const;
+-    /**
+      * Returns a map (tree) of entries in a particular group.  Only the actual entry as a string
+      * is returned, none of the other internal data is included.
+      *
+@@ -234,14 +187,14 @@
+      *         The returned map may be empty if the group is empty, or not found.
+      * @see   QMap
+      */
+-    QMap<QString, QString> entryMap(const QString &aGroup=QString()) const;
++    KDE_DEPRECATED QMap<QString, QString> entryMap(const QString &aGroup=QString()) const;
+ 
+ protected:
+     virtual bool hasGroupImpl(const QByteArray &group) const;
+     virtual KConfigGroup groupImpl( const QByteArray &b);
+     virtual const KConfigGroup groupImpl(const QByteArray &b) const;
+     virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags = Normal);
+-    virtual bool groupIsImmutableImpl(const QByteArray& aGroup) const;
++    virtual bool isGroupImmutableImpl(const QByteArray& aGroup) const;
+ 
+     friend class KConfigGroup;
+     friend class KConfigGroupPrivate;
+--- /dev/null
++++ b/kdecore/config/conversion_check.h
+@@ -0,0 +1,119 @@
++/*
++   This file is part of the KDE libraries
++   Copyright (c) 2006 Thomas Braxton <brax108 at cox.net>
++
++   This library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public
++   License as published by the Free Software Foundation; either
++   version 2 of the License, or (at your option) any later version.
++
++   This library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public License
++   along with this library; see the file COPYING.LIB.  If not, write to
++   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++   Boston, MA 02110-1301, USA.
++*/
++
++
++#ifndef CONVERSION_CHECK_H
++#define CONVERSION_CHECK_H
++
++#include <QtCore/QString>
++#include <QtGui/QColor>
++#include <QtGui/QFont>
++#include <QtCore/QDate>
++#include <QtCore/QPoint>
++#include <QtCore/QSize>
++#include <QtCore/QRect>
++#include <kurl.h>
++#include <QtCore/QVariant>
++
++namespace ConversionCheck {
++
++// used to distinguish between supported/unsupported types
++struct supported { };
++struct unsupported { };
++
++// traits type class to define support for constraints
++template <typename T>
++struct QVconvertible
++{
++  typedef unsupported toQString;
++  typedef unsupported toQVariant;
++};
++
++// constraint classes
++template <typename T>
++struct type_toQString
++{
++  void constraint() { supported x = y; }
++  typename QVconvertible<T>::toQString y;
++};
++
++template <typename T>
++struct type_toQVariant
++{
++  void constraint() { supported x = y; }
++  typename QVconvertible<T>::toQVariant y;
++};
++
++
++// check if T is convertible to QString thru QVariant
++// if not supported can't be used in QList<T> functions
++template <typename T>
++inline void to_QString()
++{
++  void (type_toQString<T>::*x)() = &type_toQString<T>::constraint;
++  Q_UNUSED(x);
++}
++
++// check if T is convertible to QVariant & supported in readEntry/writeEntry
++template <typename T>
++inline void to_QVariant()
++{
++  void (type_toQVariant<T>::*x)() = &type_toQVariant<T>::constraint;
++  Q_UNUSED(x);
++}
++
++// define for all types handled in readEntry/writeEntry
++// string_support - is supported by QVariant(type).toString(),
++//                  can be used in QList<T> functions
++// variant_support - has a QVariant constructor
++#define QVConversions(type, string_support, variant_support) \
++template <> struct QVconvertible<type> {\
++ typedef string_support toQString;\
++ typedef variant_support toQVariant;\
++}
++
++// The only types needed here are the types handled in readEntry/writeEntry
++// the default QVconvertible will take care of the rest.
++QVConversions(bool, supported, supported);
++QVConversions(int, supported, supported);
++QVConversions(unsigned int, supported, supported);
++QVConversions(long long, supported, supported);
++QVConversions(unsigned long long, supported, supported);
++QVConversions(double, supported, supported);
++QVConversions(QString, supported, supported);
++QVConversions(QColor, unsupported, supported);
++QVConversions(QFont, supported, supported);
++QVConversions(QDateTime, unsupported, supported);
++QVConversions(QDate, unsupported, supported);
++QVConversions(QSize, unsupported, supported);
++QVConversions(QRect, unsupported, supported);
++QVConversions(QPoint, unsupported, supported);
++QVConversions(QSizeF, unsupported, supported);
++QVConversions(QRectF, unsupported, supported);
++QVConversions(QPointF, unsupported, supported);
++QVConversions(QByteArray, supported, supported);
++QVConversions(QStringList, unsupported, supported);
++QVConversions(QVariantList, unsupported, supported);
++QVConversions(KUrl, supported, supported);
++QVConversions(KUrl::List, unsupported, supported);
++}
++
++#endif
++
+--- a/kdecore/config/kconfigbackend.cpp
++++ b/kdecore/config/kconfigbackend.cpp
+@@ -49,14 +49,14 @@
+     QDateTime lastModified;
+     QString localFileName;
+ 
+-    static QString whatSystem(const QString& fileName)
++    static QString whatSystem(const QString& /*fileName*/)
+     {
+         return QLatin1String("INI");
+     }
+ };
+ 
+ 
+-void KConfigBackend::registerMappings(KEntryMap& entryMap)
++void KConfigBackend::registerMappings(const KEntryMap& /*entryMap*/)
+ {
+ }
+ 
+--- a/kdecore/config/kconfiggroup.cpp
++++ b/kdecore/config/kconfiggroup.cpp
+@@ -99,7 +99,7 @@
+         if (mName.isEmpty())
+             bImmutable = mOwner->isImmutable();
+         else
+-            bImmutable = mOwner->groupIsImmutable(fullName());
++            bImmutable = mOwner->isGroupImmutable(fullName());
+     }
+ 
+     static QString expandString(const QString& value);
+@@ -115,217 +115,260 @@
+         }
+     }
+ 
+-    static QByteArray convertList(const QList<QByteArray> &list, char sep);
++    static QByteArray serializeList(const QList<QByteArray> &list);
++    static QStringList deserializeList(const QString &data);
+ };
+ 
+-KConfigGroup::KConfigGroup() : d(0)
+-{
+-}
+-
+-bool KConfigGroup::isValid() const
++QByteArray KConfigGroupPrivate::serializeList(const QList<QByteArray> &list)
+ {
+-    return 0 != d.constData();
+-}
++    QByteArray value = "";
+ 
+-KConfigGroupGui _kde_internal_KConfigGroupGui;
+-static inline bool readEntryGui(const QByteArray& data, const QByteArray &key, const QVariant &input,
+-                                QVariant &output)
+-{
+-  if (_kde_internal_KConfigGroupGui.readEntryGui)
+-    return _kde_internal_KConfigGroupGui.readEntryGui(data, key, input, output);
+-  return false;
+-}
++    if (!list.isEmpty()) {
++        QList<QByteArray>::ConstIterator it = list.constBegin();
++        const QList<QByteArray>::ConstIterator end = list.constEnd();
+ 
+-static inline bool writeEntryGui(KConfigGroup *cg, const QByteArray &key, const QVariant &input,
+-                                 KConfigGroup::WriteConfigFlags flags)
+-{
+-  if (_kde_internal_KConfigGroupGui.writeEntryGui)
+-    return _kde_internal_KConfigGroupGui.writeEntryGui(cg, key, input, flags);
+-  return false;
+-}
++        value = QByteArray(*it).replace('\\', "\\\\").replace(',', "\\,");
+ 
+-KConfigGroup::KConfigGroup(KConfigBase *master, const QString &_group)
+-    : d(KConfigGroupPrivate::create(master, _group.toUtf8(), false))
+-{
+-}
++        while (++it != end) {
++            // In the loop, so it is not done when there is only one element.
++            // Doing it repeatedly is a pretty cheap operation.
++            value.reserve(4096);
+ 
+-KConfigGroup::KConfigGroup(KConfigBase *master, const QByteArray &_group)
+- : d(KConfigGroupPrivate::create(master, _group, false))
+-{
+-}
++            value += ',';
++            value += QByteArray(*it).replace('\\', "\\\\").replace(',', "\\,");
++        }
+ 
+-KConfigGroup::KConfigGroup(KConfigBase *master, const char *_group)
+- : d(KConfigGroupPrivate::create(master, _group, false))
+-{
+-}
++        // To be able to distinguish an empty list from a list with one empty element.
++        if (value.isEmpty())
++            value = "\\0";
++    }
+ 
+-KConfigGroup::KConfigGroup(const KConfigBase *master, const QString &_group)
+-    : d(KConfigGroupPrivate::create(const_cast<KConfigBase*>(master), _group.toUtf8(), true))
+-{
++    return value;
+ }
+ 
+-KConfigGroup::KConfigGroup(const KConfigBase *master, const QByteArray &_group)
+-    : d(KConfigGroupPrivate::create(const_cast<KConfigBase*>(master), _group, true))
++QStringList KConfigGroupPrivate::deserializeList(const QString &data)
+ {
++    if (data.isEmpty())
++        return QStringList();
++    if (data == "\\0")
++        return QStringList(QString());
++    QStringList value;
++    QString val;
++    val.reserve(data.size());
++    bool quoted = false;
++    for (int p = 0; p < data.length(); p++) {
++        if (quoted) {
++            val += data[p];
++            quoted = false;
++        } else if (data[p] == '\\') {
++            quoted = true;
++        } else if (data[p] == ',') {
++            val.squeeze(); // release any unused memory
++            value.append(val);
++            val.clear();
++            val.reserve(data.size() - p);
++        } else {
++            val += data[p];
++        }
++    }
++    value.append(val);
++    return value;
+ }
+ 
+-KConfigGroup::KConfigGroup(const KConfigBase *master, const char * _group)
+-    : d(KConfigGroupPrivate::create(const_cast<KConfigBase*>(master), _group, true))
++static QList<int> asIntList(const QByteArray& string)
+ {
++    QList<int> list;
++    Q_FOREACH(const QByteArray& s, string.split(','))
++        list << s.toInt();
++    return list;
+ }
+ 
+-KConfigGroup::KConfigGroup(const KSharedConfigPtr &master, const QString &_group)
+-    : d(new KConfigGroupPrivate(master, _group.toUtf8()))
++static QList<qreal> asRealList(const QByteArray& string)
+ {
++    QList<qreal> list;
++    Q_FOREACH(const QByteArray& s, string.split(','))
++        list << s.toDouble();
++    return list;
+ }
+ 
+-KConfigGroup::KConfigGroup(const KSharedConfigPtr &master, const QByteArray &_group)
+-    : d(new KConfigGroupPrivate(master, _group))
++QVariant KConfigGroup::convertToQVariant(const char *pKey, const QByteArray& value, const QVariant& aDefault)
+ {
+-}
++    const QString errString = QString::fromLatin1("\"%1\" - conversion of \"%3\" to %2 failed")
++            .arg(pKey).arg(QVariant::typeToName(aDefault.type())).arg(value.constData());
++    const QString formatError = QString::fromLatin1(" (wrong format: expected %1 items, got %2)");
++    QVariant tmp = aDefault;
+ 
+-KConfigGroup::KConfigGroup(const KSharedConfigPtr &master, const char * _group)
+-    : d(new KConfigGroupPrivate(master, _group))
+-{
+-}
++    // if a type handler is added here you must add a QVConversions definition
++    // to conversion_check.h, or ConversionCheck::to_QVariant will not allow
++    // readEntry<T> to convert to QVariant.
++    switch( aDefault.type() ) {
++        case QVariant::Invalid:
++            return QVariant();
++        case QVariant::String:
++            // this should return the raw string not the dollar expanded string.
++            // imho if processed string is wanted should call
++            // readEntry(key, QString) not readEntry(key, QVariant)
++            return QString::fromUtf8(value);
++        case QVariant::List:
++        case QVariant::StringList:
++            return KConfigGroupPrivate::deserializeList(QString::fromUtf8(value));
++        case QVariant::ByteArray:
++            return value;
++        case QVariant::Bool: {
++            const QByteArray lower(value.toLower());
++            if (lower == "false" || lower == "no" || lower == "off" || lower == "0")
++                return false;
++            return true;
++        }
++        case QVariant::Double:
++        case QVariant::Int:
++        case QVariant::UInt:
++        case QVariant::LongLong:
++        case QVariant::ULongLong:
++            tmp = value;
++            if ( !tmp.convert(aDefault.type()) )
++                tmp = aDefault;
++            return tmp;
++        case QVariant::Point: {
++            const QList<int> list = asIntList(value);
+ 
+-KConfigGroup &KConfigGroup::operator=(const KConfigGroup &rhs)
+-{
+-    d = rhs.d;
+-    return *this;
+-}
++            if ( list.count() != 2 ) {
++                kError() << errString
++                         << formatError.arg(2).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            return QPoint(list.at( 0 ), list.at( 1 ));
++        }
++        case QVariant::PointF: {
++            const QList<qreal> list = asRealList(value);
+ 
+-KConfigGroup::KConfigGroup(const KConfigGroup &rhs)
+-    : KConfigBase(), d(rhs.d)
+-{
+-}
++            if ( list.count() != 2 ) {
++                kError() << errString
++                         << formatError.arg(2).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            return QPointF(list.at( 0 ), list.at( 1 ));
++        }
++        case QVariant::Rect: {
++            const QList<int> list = asIntList(value);
+ 
+-KConfigGroup::~KConfigGroup()
+-{
+-    d = 0;
+-}
++            if ( list.count() != 4 ) {
++                kError() << errString
++                         << formatError.arg(4).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            const QRect rect(list.at( 0 ), list.at( 1 ), list.at( 2 ), list.at( 3 ));
++            if ( !rect.isValid() ) {
++                kError() << errString << endl;
++                return aDefault;
++            }
++            return rect;
++        }
++        case QVariant::RectF: {
++            const QList<qreal> list = asRealList(value);
+ 
+-KConfigGroup KConfigGroup::groupImpl(const QByteArray& aGroup)
+-{
+-    Q_ASSERT(isValid() && !d->mName.isEmpty());
+-    KConfigGroup newGroup;
++            if ( list.count() != 4 ) {
++                kError() << errString
++                         << formatError.arg(4).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            const QRectF rect(list.at( 0 ), list.at( 1 ), list.at( 2 ), list.at( 3 ));
++            if ( !rect.isValid() ) {
++                kError() << errString << endl;
++                return aDefault;
++            }
++            return rect;
++        }
++        case QVariant::Size: {
++            const QList<int> list = asIntList(value);
+ 
+-    KConfigGroupPrivate sub = *d;
+-    sub.mParent = d;
+-    sub.mName = aGroup;
+-    bool subImmutable = config()->groupIsImmutable(sub.fullName());
+-    newGroup.d = new KConfigGroupPrivate(&sub, subImmutable, d->bConst);
++            if ( list.count() != 2 ) {
++                kError() << errString
++                         << formatError.arg(2).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            const QSize size(list.at( 0 ), list.at( 1 ));
++            if ( !size.isValid() ) {
++                kError() << errString << endl;
++                return aDefault;
++            }
++            return size;
++        }
++        case QVariant::SizeF: {
++            const QList<qreal> list = asRealList(value);
+ 
+-    return newGroup;
+-}
++            if ( list.count() != 2 ) {
++                kError() << errString
++                         << formatError.arg(2).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            const QSizeF size(list.at( 0 ), list.at( 1 ));
++            if ( !size.isValid() ) {
++                kError() << errString << endl;
++                return aDefault;
++            }
++            return size;
++        }
++        case QVariant::DateTime: {
++            const QList<int> list = asIntList(value);
++            if ( list.count() != 6 ) {
++                kError() << errString
++                         << formatError.arg(6).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            const QDate date( list.at( 0 ), list.at( 1 ), list.at( 2 ) );
++            const QTime time( list.at( 3 ), list.at( 4 ), list.at( 5 ) );
++            const QDateTime dt( date, time );
++            if ( !dt.isValid() ) {
++                kError() << errString << endl;
++                return aDefault;
++            }
++            return dt;
++        }
++        case QVariant::Date: {
++            QList<int> list = asIntList(value);
++            if ( list.count() == 6 )
++                list = list.mid(0, 3); // don't break config files that stored QDate as QDateTime
++            if ( list.count() != 3 ) {
++                kError() << errString
++                         << formatError.arg(3).arg(list.count())
++                         << endl;
++                return aDefault;
++            }
++            const QDate date( list.at( 0 ), list.at( 1 ), list.at( 2 ) );
++            if ( !date.isValid() ) {
++                kError() << errString << endl;
++                return aDefault;
++            }
++            return date;
++        }
++        case QVariant::Color:
++        case QVariant::Font:
++            kFatal() << "KConfigGroup::readEntry was passed GUI type '"
++                    << aDefault.typeName()
++                    << "' but kdeui isn't linked! If it is linked to your program, "
++                    "this is a platform bug. Please inform the KDE developers" << endl;
++            break;
++        case QVariant::Url:
++            return QUrl(QString::fromUtf8(value));
+ 
+-const KConfigGroup KConfigGroup::groupImpl(const QByteArray& aGroup) const
+-{
+-    Q_ASSERT(isValid() && !d->mName.isEmpty());
+-    KConfigGroup newGroup;
+-
+-    KConfigGroupPrivate sub = *d;
+-    sub.mParent = d;
+-    sub.mName = aGroup;
+-    bool subImmutable = config()->groupIsImmutable(sub.fullName().constData());
+-    newGroup.d = new KConfigGroupPrivate(&sub, subImmutable, true);
+-
+-    return newGroup;
+-}
+-
+-void KConfigGroup::deleteGroup(WriteConfigFlags flags)
+-{
+-    Q_ASSERT(!d->bConst);
+-
+-    config()->deleteGroup(d->fullName().constData(), flags);
+-}
+-
+-void KConfigGroup::changeGroup( const QString &group )
+-{
+-    changeGroup(group.toUtf8());
+-}
+-
+-void KConfigGroup::changeGroup( const char *group )
+-{
+-    changeGroup(QByteArray(group));
+-}
+-
+-void KConfigGroup::changeGroup( const QByteArray &group)
+-{
+-    // detach (QExplicitlySharedDataPointer takes care of deleting the old d if necessary)
+-    // ### temporary solution until QExplicitlySharedDataPointer has detach()
+-    d = new KConfigGroupPrivate(d, group);
+-}
+-
+-QString KConfigGroup::name() const
+-{
+-    return QString::fromUtf8(d->fullName());
+-}
+-
+-bool KConfigGroup::exists() const
+-{
+-    return config()->hasGroup( d->fullName() );
+-}
+-
+-void KConfigGroup::sync()
+-{
+-    if (!d->bConst)
+-        config()->sync();
+-}
+-
+-QMap<QString, QString> KConfigGroup::entryMap() const
+-{
+-  return config()->entryMap(d->fullName());
+-}
+-
+-KConfig* KConfigGroup::config()
+-{
+-  return d->mOwner;
+-}
+-
+-const KConfig* KConfigGroup::config() const
+-{
+-    return d->mOwner;
+-}
+-
+-bool KConfigGroup::entryIsImmutable(const QByteArray& key) const
+-{
+-    return (isImmutable() ||
+-        !config()->d_func()->canWriteEntry(d->fullName(), key, config()->readDefaults()));
+-}
+-
+-bool KConfigGroup::entryIsImmutable(const char* key) const
+-{
+-    return entryIsImmutable(QByteArray(key));
+-}
+-
+-bool KConfigGroup::entryIsImmutable(const QString& key) const
+-{
+-    return entryIsImmutable(key.toUtf8());
+-}
+-
+-QString KConfigGroup::readEntryUntranslated( const QByteArray& key, const QString& aDefault ) const
+-{
+-    QString result = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::EntryOptions(), 0);
+-    if (result.isNull())
+-        return aDefault;
+-    return result;
+-}
+-
+-QString KConfigGroup::readEntryUntranslated( const QString& key, const QString& aDefault ) const
+-{
+-   return readEntryUntranslated(key.toUtf8(), aDefault);
+-}
+-
+-
+-QString KConfigGroup::readEntryUntranslated( const char *key, const QString& aDefault ) const
+-{
+-    return readEntryUntranslated(QByteArray(key), aDefault);
+-}
++        default:
++            if( aDefault.canConvert<KUrl>() ) {
++                const KUrl url(QString::fromUtf8(value));
++                return qVariantFromValue<KUrl>( url );
++            }
++            break;
++    }
+ 
+-QString KConfigGroup::readEntry( const QByteArray &key, const char* aDefault) const
+-{
+-    return readEntry(key, QString::fromUtf8(aDefault));
++    kFatal() << "unhandled type " << aDefault.typeName() << endl;
++    return QVariant();
+ }
+ 
+ QString KConfigGroupPrivate::expandString(const QString& value)
+@@ -334,7 +377,6 @@
+ 
+     // check for environment variables and make necessary translations
+     int nDollarPos = aValue.indexOf( '$' );
+-
+     while( nDollarPos != -1 && nDollarPos+1 < aValue.length()) {
+         // there is at least one $
+         if( aValue[nDollarPos+1] == '(' ) {
+@@ -360,6 +402,7 @@
+             }
+             setenv( "PATH", oldpath, 1/*overwrite*/ );
+             aValue.replace( nDollarPos, nEndPos-nDollarPos, result );
++            nDollarPos += result.length();
+         } else if( aValue[nDollarPos+1] != '$' ) {
+             int nEndPos = nDollarPos+1;
+             // the next character is not $
+@@ -392,8 +435,8 @@
+                     // locale specified encoding or UTF8 encoding
+                         env = KStringHandler::from8Bit( pEnv );
+                 }
+-                if (!env.isEmpty())
+-                    aValue.replace(nDollarPos, nEndPos-nDollarPos, env);
++                aValue.replace(nDollarPos, nEndPos-nDollarPos, env);
++                nDollarPos += env.length();
+             } else
+                 aValue.remove( nDollarPos, nEndPos-nDollarPos );
+         } else {
+@@ -407,224 +450,322 @@
+     return aValue;
+ }
+ 
+-template <>
+-QString KConfigGroup::readEntry<QString>( const QByteArray& key, const QString& aDefault ) const
++#ifdef Q_WS_WIN
++# include <QtCore/QDir>
++#endif
++
++static bool cleanHomeDirPath( QString &path, const QString &homeDir )
+ {
+-    const char *pKey = key.constData();
+-    if ( !hasKey(pKey) )
+-        return aDefault;
++#ifdef Q_WS_WIN //safer
++   if (!QDir::convertSeparators(path).startsWith(QDir::convertSeparators(homeDir)))
++        return false;
++#else
++   if (!path.startsWith(homeDir))
++        return false;
++#endif
+ 
+-    bool expand = false;
++   int len = homeDir.length();
++   // replace by "$HOME" if possible
++   if (len && (path.length() == len || path[len] == '/')) {
++        path.replace(0, len, QString::fromLatin1("$HOME"));
++        return true;
++   } else
++        return false;
++}
+ 
+-    // read value from the entry map
+-    QString aValue = config()->d_func()->lookupData(d->fullName().constData(), pKey, KEntryMap::SearchLocalized,
+-                                           &expand);
+-    if (aValue.isNull())
+-        aValue = aDefault;
++static QString translatePath( QString path ) // krazy:exclude=passbyvalue
++{
++   if (path.isEmpty())
++       return path;
+ 
+-    return aValue;
++   // only "our" $HOME should be interpreted
++   path.replace('$', "$$");
++
++   bool startsWithFile = path.startsWith(QLatin1String("file:"), Qt::CaseInsensitive);
++
++   // return original path, if it refers to another type of URL (e.g. http:/), or
++   // if the path is already relative to another directory
++   if ((!startsWithFile && QFileInfo(path).isRelative()) ||
++       (startsWithFile && QFileInfo(path.mid(5)).isRelative()))
++	return path;
++
++   if (startsWithFile)
++        path.remove(0,5); // strip leading "file:/" off the string
++
++   // keep only one single '/' at the beginning - needed for cleanHomeDirPath()
++   while (path[0] == '/' && path[1] == '/')
++	path.remove(0,1);
++
++   // we can not use KGlobal::dirs()->relativeLocation("home", path) here,
++   // since it would not recognize paths without a trailing '/'.
++   // All of the 3 following functions to return the user's home directory
++   // can return different paths. We have to test all them.
++   const QString homeDir0 = QFile::decodeName(getenv("HOME"));
++   const QString homeDir1 = QDir::homePath();
++   const QString homeDir2 = QDir(homeDir1).canonicalPath();
++   if (cleanHomeDirPath(path, homeDir0) ||
++       cleanHomeDirPath(path, homeDir1) ||
++       cleanHomeDirPath(path, homeDir2) ) {
++     // kDebug() << "Path was replaced\n";
++   }
++
++   if (startsWithFile)
++      path.prepend( "file://" );
++
++   return path;
+ }
+ 
+-static QList<int> asIntList(const QByteArray& string)
++
++KConfigGroup::KConfigGroup() : d(0)
+ {
+-    QList<int> list;
+-    Q_FOREACH(const QByteArray& s, string.split(','))
+-        list << s.toInt();
+-    return list;
+ }
+ 
+-static QList<qreal> asRealList(const QByteArray& string)
++bool KConfigGroup::isValid() const
+ {
+-    QList<qreal> list;
+-    Q_FOREACH(const QByteArray& s, string.split(','))
+-        list << s.toDouble();
+-    return list;
++    return 0 != d.constData();
+ }
+ 
+-QVariant KConfigGroup::convertToQVariant(const char *pKey, const QByteArray& value, const QVariant& aDefault)
++KConfigGroupGui _kde_internal_KConfigGroupGui;
++static inline bool readEntryGui(const QByteArray& data, const QByteArray &key, const QVariant &input,
++                                QVariant &output)
+ {
+-    const QString errString = QString::fromLatin1("\"%1\" - conversion from \"%3\" to %2 failed")
+-            .arg(pKey).arg(QVariant::typeToName(aDefault.type())).arg(value.constData());
+-    const QString formatError = QString::fromLatin1(" (wrong format: expected '%1' items, read '%2')");
+-    QVariant tmp = aDefault;
+-
+-    // if a type handler is added here you must add a QVConversions definition
+-    // to conversion_check.h, or ConversionCheck::to_QVariant will not allow
+-    // readEntry<T> to convert to QVariant.
+-    switch( aDefault.type() ) {
+-        case QVariant::Invalid:
+-            return QVariant();
+-        case QVariant::String:
+-            // this should return the raw string not the dollar expanded string.
+-            // imho if processed string is wanted should call
+-            // readEntry(key, QString) not readEntry(key, QVariant)
+-            return QString::fromUtf8(value);
+-        case QVariant::List:
+-        case QVariant::StringList:
+-            return value.isEmpty() ? QStringList() : QString::fromUtf8(value).split(QLatin1Char(','));
+-        case QVariant::ByteArray:
+-            return value;
+-        case QVariant::Bool: {
+-            const QByteArray lower(value.toLower());
+-            if (lower == "false" || lower == "no" || lower == "off" || lower == "0")
+-                return false;
+-            return true;
+-        }
+-        case QVariant::Double:
+-        case QVariant::Int:
+-        case QVariant::UInt:
+-        case QVariant::LongLong:
+-        case QVariant::ULongLong:
+-            tmp = value;
+-            if ( !tmp.convert(aDefault.type()) )
+-                tmp = aDefault;
+-            return tmp;
+-        case QVariant::Point: {
+-            const QList<int> list = asIntList(value);
++  if (_kde_internal_KConfigGroupGui.readEntryGui)
++    return _kde_internal_KConfigGroupGui.readEntryGui(data, key, input, output);
++  return false;
++}
+ 
+-            if ( list.count() != 2 ) {
+-                kError() << errString
+-                         << formatError.arg(2).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            return QPoint(list.at( 0 ), list.at( 1 ));
+-        }
+-        case QVariant::PointF: {
+-            const QList<qreal> list = asRealList(value);
++static inline bool writeEntryGui(KConfigGroup *cg, const QByteArray &key, const QVariant &input,
++                                 KConfigGroup::WriteConfigFlags flags)
++{
++  if (_kde_internal_KConfigGroupGui.writeEntryGui)
++    return _kde_internal_KConfigGroupGui.writeEntryGui(cg, key, input, flags);
++  return false;
++}
+ 
+-            if ( list.count() != 2 ) {
+-                kError() << errString
+-                         << formatError.arg(2).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            return QPointF(list.at( 0 ), list.at( 1 ));
+-        }
+-        case QVariant::Rect: {
+-            const QList<int> list = asIntList(value);
++KConfigGroup::KConfigGroup(KConfigBase *master, const QString &_group)
++    : d(KConfigGroupPrivate::create(master, _group.toUtf8(), false))
++{
++}
+ 
+-            if ( list.count() != 4 ) {
+-                kError() << errString
+-                         << formatError.arg(4).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            const QRect rect(list.at( 0 ), list.at( 1 ), list.at( 2 ), list.at( 3 ));
+-            if ( !rect.isValid() ) {
+-                kError() << errString << endl;
+-                return aDefault;
+-            }
+-            return rect;
+-        }
+-        case QVariant::RectF: {
+-            const QList<qreal> list = asRealList(value);
++KConfigGroup::KConfigGroup(KConfigBase *master, const QByteArray &_group)
++ : d(KConfigGroupPrivate::create(master, _group, false))
++{
++}
+ 
+-            if ( list.count() != 4 ) {
+-                kError() << errString
+-                         << formatError.arg(4).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            const QRectF rect(list.at( 0 ), list.at( 1 ), list.at( 2 ), list.at( 3 ));
+-            if ( !rect.isValid() ) {
+-                kError() << errString << endl;
+-                return aDefault;
+-            }
+-            return rect;
+-        }
+-        case QVariant::Size: {
+-            const QList<int> list = asIntList(value);
++KConfigGroup::KConfigGroup(KConfigBase *master, const char *_group)
++ : d(KConfigGroupPrivate::create(master, _group, false))
++{
++}
+ 
+-            if ( list.count() != 2 ) {
+-                kError() << errString
+-                         << formatError.arg(2).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            const QSize size(list.at( 0 ), list.at( 1 ));
+-            if ( !size.isValid() ) {
+-                kError() << errString << endl;
+-                return aDefault;
+-            }
+-            return size;
+-        }
+-        case QVariant::SizeF: {
+-            const QList<qreal> list = asRealList(value);
++KConfigGroup::KConfigGroup(const KConfigBase *master, const QString &_group)
++    : d(KConfigGroupPrivate::create(const_cast<KConfigBase*>(master), _group.toUtf8(), true))
++{
++}
+ 
+-            if ( list.count() != 2 ) {
+-                kError() << errString
+-                         << formatError.arg(2).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            const QSizeF size(list.at( 0 ), list.at( 1 ));
+-            if ( !size.isValid() ) {
+-                kError() << errString << endl;
+-                return aDefault;
+-            }
+-            return size;
+-        }
+-        case QVariant::DateTime: {
+-            const QList<int> list = asIntList(value);
+-            if ( list.count() != 6 ) {
+-                kError() << errString
+-                         << formatError.arg(6).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            const QDate date( list.at( 0 ), list.at( 1 ), list.at( 2 ) );
+-            const QTime time( list.at( 3 ), list.at( 4 ), list.at( 5 ) );
+-            const QDateTime dt( date, time );
+-            if ( !dt.isValid() ) {
+-                kError() << errString << endl;
+-                return aDefault;
+-            }
+-            return dt;
+-        }
+-        case QVariant::Date: {
+-            QList<int> list = asIntList(value);
+-            if ( list.count() == 6 )
+-                list = list.mid(0, 3); // don't break config files that stored QDate as QDateTime
+-            if ( list.count() != 3 ) {
+-                kError() << errString
+-                         << formatError.arg(3).arg(list.count())
+-                         << endl;
+-                return aDefault;
+-            }
+-            const QDate date( list.at( 0 ), list.at( 1 ), list.at( 2 ) );
+-            if ( !date.isValid() ) {
+-                kError() << errString << endl;
+-                return aDefault;
+-            }
+-            return date;
+-        }
+-        case QVariant::Color:
+-        case QVariant::Font:
+-            kFatal() << "KConfigGroup::readEntry was passed GUI type '"
+-                    << aDefault.typeName()
+-                    << "' but kdeui isn't linked! If it is linked to your program, "
+-                    "this is a platform bug. Please inform the KDE developers" << endl;
+-            break;
+-        case QVariant::Url:
+-            return QUrl(QString::fromUtf8(value));
++KConfigGroup::KConfigGroup(const KConfigBase *master, const QByteArray &_group)
++    : d(KConfigGroupPrivate::create(const_cast<KConfigBase*>(master), _group, true))
++{
++}
++
++KConfigGroup::KConfigGroup(const KConfigBase *master, const char * _group)
++    : d(KConfigGroupPrivate::create(const_cast<KConfigBase*>(master), _group, true))
++{
++}
++
++KConfigGroup::KConfigGroup(const KSharedConfigPtr &master, const QString &_group)
++    : d(new KConfigGroupPrivate(master, _group.toUtf8()))
++{
++}
++
++KConfigGroup::KConfigGroup(const KSharedConfigPtr &master, const QByteArray &_group)
++    : d(new KConfigGroupPrivate(master, _group))
++{
++}
++
++KConfigGroup::KConfigGroup(const KSharedConfigPtr &master, const char * _group)
++    : d(new KConfigGroupPrivate(master, _group))
++{
++}
++
++KConfigGroup &KConfigGroup::operator=(const KConfigGroup &rhs)
++{
++    d = rhs.d;
++    return *this;
++}
++
++KConfigGroup::KConfigGroup(const KConfigGroup &rhs)
++    : KConfigBase(), d(rhs.d)
++{
++}
++
++KConfigGroup::~KConfigGroup()
++{
++    d = 0;
++}
++
++KConfigGroup KConfigGroup::groupImpl(const QByteArray& aGroup)
++{
++    Q_ASSERT(isValid() && !d->mName.isEmpty());
++    KConfigGroup newGroup;
++
++    KConfigGroupPrivate sub = *d;
++    sub.mParent = d;
++    sub.mName = aGroup;
++    bool subImmutable = config()->isGroupImmutable(sub.fullName());
++    newGroup.d = new KConfigGroupPrivate(&sub, subImmutable, d->bConst);
++
++    return newGroup;
++}
++
++const KConfigGroup KConfigGroup::groupImpl(const QByteArray& aGroup) const
++{
++    Q_ASSERT(isValid() && !d->mName.isEmpty());
++    KConfigGroup newGroup;
++
++    KConfigGroupPrivate sub = *d;
++    sub.mParent = d;
++    sub.mName = aGroup;
++    bool subImmutable = config()->isGroupImmutable(sub.fullName());
++    newGroup.d = new KConfigGroupPrivate(&sub, subImmutable, true);
++
++    return newGroup;
++}
++
++void KConfigGroup::deleteGroup(WriteConfigFlags flags)
++{
++    Q_ASSERT(!d->bConst);
++
++    config()->deleteGroup(d->fullName(), flags);
++}
++
++void KConfigGroup::changeGroup( const QString &group )
++{
++    changeGroup(group.toUtf8());
++}
++
++void KConfigGroup::changeGroup( const char *group )
++{
++    changeGroup(QByteArray(group));
++}
++
++void KConfigGroup::changeGroup( const QByteArray &group)
++{
++    // detach (QExplicitlySharedDataPointer takes care of deleting the old d if necessary)
++    // ### temporary solution until QExplicitlySharedDataPointer has detach()
++    d = new KConfigGroupPrivate(d, group);
++}
++
++QString KConfigGroup::name() const
++{
++    return QString::fromUtf8(d->fullName());
++}
++
++bool KConfigGroup::exists() const
++{
++    return config()->hasGroup( d->fullName() );
++}
++
++void KConfigGroup::sync()
++{
++    if (!d->bConst)
++        config()->sync();
++}
++
++QMap<QString, QString> KConfigGroup::entryMap() const
++{
++  return config()->entryMap(d->fullName());
++}
++
++KConfig* KConfigGroup::config()
++{
++  return d->mOwner;
++}
++
++const KConfig* KConfigGroup::config() const
++{
++    return d->mOwner;
++}
++
++bool KConfigGroup::isEntryImmutable(const QByteArray& key) const
++{
++    return (isImmutable() ||
++        !config()->d_func()->canWriteEntry(d->fullName(), key, config()->readDefaults()));
++}
++
++bool KConfigGroup::isEntryImmutable(const char* key) const
++{
++    return isEntryImmutable(QByteArray(key));
++}
++
++bool KConfigGroup::isEntryImmutable(const QString& key) const
++{
++    return isEntryImmutable(key.toUtf8());
++}
++
++QString KConfigGroup::readEntryUntranslated(const QString& pKey, const QString& aDefault) const
++{
++    return readEntryUntranslated(pKey.toUtf8(), aDefault);
++}
++
++QString KConfigGroup::readEntryUntranslated(const char *key, const QString& aDefault) const
++{
++    return readEntryUntranslated(QByteArray(key), aDefault);
++}
++
++QString KConfigGroup::readEntryUntranslated( const QByteArray& key, const QString& aDefault ) const
++{
++    QString result = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchFlags(), 0);
++    if (result.isNull())
++        return aDefault;
++    return result;
++}
++
++QString KConfigGroup::readEntry(const char *key, const char* aDefault) const
++{
++    return readEntry(QByteArray(key), aDefault);
++}
++
++QString KConfigGroup::readEntry(const QString &key, const char* aDefault) const
++{
++    return readEntry(key.toUtf8(), aDefault);
++}
++
++QString KConfigGroup::readEntry(const QByteArray &key, const char* aDefault) const
++{
++    return readEntry(key, QString::fromUtf8(aDefault));
++}
++
++template <>
++QString KConfigGroup::readEntry<QString>( const QByteArray& key, const QString& aDefault ) const
++{
++    bool expand = false;
+ 
+-        default:
+-            if( aDefault.canConvert<KUrl>() ) {
+-                const KUrl url(QString::fromUtf8(value));
+-                return qVariantFromValue<KUrl>( url );
+-            }
+-            break;
+-    }
++    // read value from the entry map
++    QString aValue = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchLocalized,
++                                           &expand);
++    if (aValue.isNull())
++        aValue = aDefault;
+ 
+-    kFatal() << "unhandled type " << aDefault.typeName() << endl;
+-    return QVariant();
++    if (expand)
++        return KConfigGroupPrivate::expandString(aValue);
++
++    return aValue;
++}
++
++template<>
++QStringList KConfigGroup::readEntry<QStringList>(const QByteArray &key, const QStringList& aDefault) const
++{
++    const QString data = readEntry(key, QString());
++    if (data.isNull())
++        return aDefault;
++
++    return KConfigGroupPrivate::deserializeList(data);
+ }
+ 
+ template<>
+ QVariant KConfigGroup::readEntry<QVariant>( const QByteArray &key, const QVariant &aDefault ) const
+ {
+-    const QByteArray data = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::EntryOptions());
++    const QByteArray data = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchFlags());
+     if (data.isNull())
+         return aDefault;
+ 
+@@ -638,107 +779,73 @@
+ template<>
+ QVariantList KConfigGroup::readEntry<QVariantList>( const QByteArray &key, const QVariantList& aDefault) const
+ {
+-    const QByteArray data = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::EntryOptions());
+-
++    const QString data = readEntry(key, QString());
+     if (data.isNull())
+         return aDefault;
+-    if (data.isEmpty())
+-        return QVariantList();
+ 
+-    if (!data.contains("\\,")) { // easy no escaped commas
+-        QVariantList list;
+-        foreach (const QByteArray& v, data.split(','))
+-            list << QString::fromUtf8(v.constData(), v.length());
+-        return list;
+-    }
+-
+-    // now look out for escaped commas
+-    QList<QByteArray> list;
+-    for (int i=0; i < data.size(); /* nothing */) {
+-        int end = data.indexOf(',', i);
+-    again:
+-        if (end < 0) { // no more commas found, end of entry
+-            list << data.mid(i);
+-            i = data.size();
+-        } else if (end == 0) { // empty first element
+-            list << QByteArray();
+-            i++;
+-        } else if (data.at(end-1) == '\\') { // escaped comma
+-            end = data.indexOf(',', end+1);
+-            goto again;
+-        } else {
+-            list << data.mid(i, end-i);
+-            i = end+1;
+-        }
+-    }
++    QStringList list = KConfigGroupPrivate::deserializeList(data);
+ 
+     QVariantList value;
+-    foreach(const QByteArray& v, list)
+-        value << QString::fromUtf8(QByteArray(v).replace("\\,", ","));
++    foreach(QString v, list)
++        value << v;
+ 
+     return value;
+ }
+ 
+-QStringList KConfigGroup::readEntry(const QByteArray &key, const QStringList& aDefault, char sep) const
++QStringList KConfigGroup::readXdgListEntry(const QString& pKey, const QStringList& aDefault) const
++{
++    return readXdgListEntry(pKey.toUtf8(), aDefault);
++}
++
++QStringList KConfigGroup::readXdgListEntry(const char *key, const QStringList& aDefault) const
++{
++    return readXdgListEntry(QByteArray(key), aDefault);
++}
++
++QStringList KConfigGroup::readXdgListEntry(const QByteArray &key, const QStringList& aDefault) const
+ {
+     const QString data = readEntry(key, QString());
+     if (data.isNull())
+         return aDefault;
+-    if (data.isEmpty())
+-        return QStringList();
+-
+-    const QString separator = QChar(sep);
+-    const QString escaped = QString(separator).prepend(QLatin1Char('\\'));
+ 
+     QStringList value;
+-    if (!data.contains(escaped)) {
+-        value = data.split(separator); // easy no escaped separators
+-    } else {
+-        // now look out for escaped separators
+-        for(int i=0; i < data.size(); /* nothing */) {
+-            int end = data.indexOf(separator, i);
+-        again:
+-            if (end < 0) { // no more separators found, end of entry
+-                value << data.mid(i).replace(escaped, separator);
+-                i = data.size();
+-            } else if (end == 0) { // empty first element
+-                value << QString();
+-                i++;
+-            } else if (data.at(end-1) == QLatin1Char('\\')) { // escaped separator
+-                end = data.indexOf(separator, end+1);
+-                goto again;
+-            } else {
+-                value << data.mid(i, end-i).replace(escaped, separator);
+-                i = end+1;
+-            }
++    QString val;
++    val.reserve(data.size());
++    // XXX List serialization being a separate layer from low-level parsing is
++    // probably a bug. No affected entries are defined, though.
++    bool quoted = false;
++    for (int p = 0; p < data.length(); p++) {
++        if (quoted) {
++            val += data[p];
++            quoted = false;
++        } else if (data[p] == '\\') {
++            quoted = true;
++        } else if (data[p] == ';') {
++            value.append(val);
++            val.clear();
++            val.reserve(data.size() - p);
++        } else {
++            val += data[p];
+         }
+     }
+-    if (sep == ';' && !value.isEmpty() && value.last().isEmpty())
+-        value.removeLast(); // Support for Actions="foo;" as per the desktop entry standard
++    if (!val.isEmpty()) {
++        kWarning() << "List entry" << key << "is not compliant with XDG standard (missing trailing semicolon).";
++        value.append(val);
++    }
+     return value;
+ }
+ 
+-QStringList KConfigGroup::readEntry(const QString& pKey, const QStringList& aDefault, char sep) const
+-{
+-    return readEntry(pKey.toUtf8().constData(), aDefault, sep);
+-}
+-
+-QStringList KConfigGroup::readEntry(const char *key, const QStringList& aDefault, char sep) const
+-{
+-    return readEntry(QByteArray(key), aDefault, sep);
+-}
+-
+-QString KConfigGroup::readPathEntry( const QString& pKey, const QString& pDefault ) const
++QString KConfigGroup::readPathEntry(const QString& pKey, const QString & aDefault) const
+ {
+-    return readPathEntry(pKey.toUtf8(), pDefault);
++    return readPathEntry(pKey.toUtf8(), aDefault);
+ }
+ 
+-QString KConfigGroup::readPathEntry( const char *pKey, const QString& aDefault ) const
++QString KConfigGroup::readPathEntry(const char *key, const QString & aDefault) const
+ {
+-    return readPathEntry(QByteArray(pKey), aDefault);
++    return readPathEntry(QByteArray(key), aDefault);
+ }
+ 
+-QString KConfigGroup::readPathEntry( const QByteArray &key, const QString& aDefault ) const
++QString KConfigGroup::readPathEntry(const QByteArray &key, const QString& aDefault) const
+ {
+     bool expand = false;
+ 
+@@ -747,68 +854,26 @@
+     if (aValue.isNull())
+         aValue = aDefault;
+ 
+-    // only do dollar expansion if it's an expandable string
+-    if (expand)
+-        return KConfigGroupPrivate::expandString(aValue);
+-    return aValue;
++    return KConfigGroupPrivate::expandString(aValue);
+ }
+ 
+-QStringList KConfigGroup::readPathListEntry( const QString& pKey, char sep ) const
++QStringList KConfigGroup::readPathEntry(const QString& pKey, const QStringList& aDefault) const
+ {
+-    return readPathListEntry(pKey.toUtf8(), sep);
++    return readPathEntry(pKey.toUtf8(), aDefault);
+ }
+ 
+-QStringList KConfigGroup::readPathListEntry( const char *pKey, char sep ) const
++QStringList KConfigGroup::readPathEntry(const char *key, const QStringList& aDefault) const
+ {
+-    return readPathListEntry(QByteArray(pKey), sep);
++    return readPathEntry(QByteArray(key), aDefault);
+ }
+ 
+-QStringList KConfigGroup::readPathListEntry( const QByteArray &key, char sep ) const
++QStringList KConfigGroup::readPathEntry( const QByteArray &key, const QStringList& aDefault ) const
+ {
+-    bool expand = false;
+-    const QString data = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchLocalized,
+-                                             &expand);
+-    if (data.isEmpty())
+-        return QStringList();
+-
+-    const QString separator = QChar(sep);
+-    const QString escaped = QString(separator).prepend(QLatin1Char('\\'));
+-    QStringList value;
++    const QString data = readPathEntry(key, QString());
++    if (data.isNull())
++        return aDefault;
+ 
+-    if (!data.contains(escaped)) { // easy no escaped separators
+-        foreach(const QString& s, data.split(separator)) {
+-            if (expand)
+-                value << KConfigGroupPrivate::expandString(s);
+-            else
+-                value << s;
+-        }
+-    } else { // now look out for escaped separators
+-        QStringList value;
+-        for(int i=0; i < data.size(); /* nothing */) {
+-            int end = data.indexOf(separator, i);
+-    again:
+-            if (end < 0) { // no more separators found, end of entry
+-                if (expand)
+-                    value << KConfigGroupPrivate::expandString(data.mid(i).replace(escaped, separator));
+-                else
+-                    value << data.mid(i).replace(escaped, separator);
+-                i = data.size();
+-            } else if (end == 0) { // empty first element
+-                value << QString();
+-                i++;
+-            } else if (data.at(end-1) == QLatin1Char('\\')) { // escaped separator
+-                end = data.indexOf(separator, end+1);
+-                goto again;
+-            } else {
+-                if (expand)
+-                    value << KConfigGroupPrivate::expandString(data.mid(i, end-i).replace(escaped, separator));
+-                else
+-                    value << data.mid(i, end-i).replace(escaped, separator);
+-                i = end+1;
+-            }
+-        }
+-    }
+-    return value;
++    return KConfigGroupPrivate::deserializeList(data);
+ }
+ 
+ template<>
+@@ -820,27 +885,25 @@
+ 
+ }
+ 
+-template<>
+-void KConfigGroup::writeEntry<const char *>(const QByteArray &key, const char* const &value, WriteConfigFlags flags)
++void KConfigGroup::writeEntry(const QByteArray &key, const char *value, WriteConfigFlags pFlags)
+ {
+-    writeEntry(key, QByteArray(value), flags);
++    writeEntry<const char *>(key, value, pFlags);
+ }
+ 
+-template<>
+-void KConfigGroup::writeEntry<QVariantList>( const QByteArray &key, const QVariantList& list, WriteConfigFlags flags )
++void KConfigGroup::writeEntry(const QString &key, const char *value, WriteConfigFlags pFlags)
+ {
+-    Q_ASSERT(!d->bConst);
+-
+-    QList<QByteArray> data;
++    writeEntry<const char *>(key.toUtf8(), value, pFlags);
++}
+ 
+-    foreach(const QVariant& v, list) {
+-        if (v.type() == QVariant::ByteArray)
+-            data << v.toByteArray();
+-        else
+-            data << v.toString().toUtf8();
+-    }
++void KConfigGroup::writeEntry(const char *key, const char *value, WriteConfigFlags pFlags)
++{
++    writeEntry<const char *>(QByteArray(key), value, pFlags);
++}
+ 
+-    writeEntry(key, KConfigGroupPrivate::convertList(data, ','), flags);
++template<>
++void KConfigGroup::writeEntry<const char *>(const QByteArray &key, const char* const &value, WriteConfigFlags flags)
++{
++    writeEntry(key, QByteArray(value), flags);
+ }
+ 
+ template<>
+@@ -849,22 +912,37 @@
+ {
+     Q_ASSERT(!d->bConst);
+ 
+-    config()->d_func()->putData(d->fullName(), key, value, flags);
++    config()->d_func()->putData(d->fullName(), key, value.isNull()? QByteArray(""): value, flags);
+ }
+ 
+-void KConfigGroup::deleteEntry(const QByteArray& key, WriteConfigFlags flags)
++template<>
++void KConfigGroup::writeEntry<QStringList>(const QByteArray &key, const QStringList &list, WriteConfigFlags flags)
+ {
+-   config()->d_func()->putData(d->fullName(), key, QByteArray(), flags, KConfigPrivate::Delete);
+-}
++    Q_ASSERT(!d->bConst);
+ 
+-void KConfigGroup::deleteEntry( const QString& key, WriteConfigFlags flags)
+-{
+-    deleteEntry(key.toUtf8(), flags);
++    QList<QByteArray> balist;
++
++    foreach(const QString &entry, list)
++        balist.append(entry.toUtf8());
++
++    writeEntry(key, KConfigGroupPrivate::serializeList(balist), flags);
+ }
+ 
+-void KConfigGroup::deleteEntry( const char *key, WriteConfigFlags flags)
++template<>
++void KConfigGroup::writeEntry<QVariantList>( const QByteArray &key, const QVariantList& list, WriteConfigFlags flags )
+ {
+-    deleteEntry(QByteArray(key), flags);
++    Q_ASSERT(!d->bConst);
++
++    QList<QByteArray> data;
++
++    foreach(const QVariant& v, list) {
++        if (v.type() == QVariant::ByteArray)
++            data << v.toByteArray();
++        else
++            data << v.toString().toUtf8();
++    }
++
++    writeEntry(key, KConfigGroupPrivate::serializeList(data), flags);
+ }
+ 
+ template<>
+@@ -983,52 +1061,88 @@
+     writeEntry(key, data, flags);
+ }
+ 
+-void KConfigGroup::writeEntry(const QString& pKey, const QStringList &value, char sep, WriteConfigFlags flags)
++void KConfigGroup::writeXdgListEntry(const QString& pKey, const QStringList &value, WriteConfigFlags pFlags)
+ {
+-    writeEntry( pKey.toUtf8(), value, sep, flags );
++    writeXdgListEntry(pKey.toUtf8(), value, pFlags);
+ }
+ 
+-void KConfigGroup::writeEntry(const char *pKey, const QStringList &value, char sep, WriteConfigFlags flags)
++void KConfigGroup::writeXdgListEntry(const char *pKey, const QStringList &value, WriteConfigFlags pFlags)
+ {
+-    writeEntry(QByteArray(pKey), value, sep, flags );
++    writeXdgListEntry(QByteArray(pKey), value, pFlags);
+ }
+ 
+-void KConfigGroup::writeEntry(const QByteArray &key, const QStringList &list, char sep, WriteConfigFlags flags)
++void KConfigGroup::writeXdgListEntry(const QByteArray &key, const QStringList &list, WriteConfigFlags flags)
+ {
+     Q_ASSERT(!d->bConst);
+ 
+-    QList<QByteArray> balist;
++    QString value;
++    value.reserve(4096);
+ 
+-    foreach(const QString &entry, list)
+-        balist.append(entry.toUtf8());
++    // XXX List serialization being a separate layer from low-level escaping is
++    // probably a bug. No affected entries are defined, though.
++    QStringList::ConstIterator it = list.constBegin();
++    const QStringList::ConstIterator end = list.constEnd();
++    for (; it != end; ++it) {
++        QString val(*it);
++        val.replace('\\', "\\\\").replace(';', "\\;");
++        value += val;
++        value += ';';
++    }
++
++    writeEntry(key, value, flags);
++}
+ 
+-    writeEntry(key, KConfigGroupPrivate::convertList(balist, sep), flags);
++void KConfigGroup::writePathEntry(const QString& pKey, const QString & path, WriteConfigFlags pFlags)
++{
++    writePathEntry(pKey.toUtf8(), path, pFlags);
+ }
+ 
+-QByteArray KConfigGroupPrivate::convertList(const QList<QByteArray> &list, char sep)
++void KConfigGroup::writePathEntry(const char *pKey, const QString & path, WriteConfigFlags pFlags)
+ {
+-    const QByteArray escaped = QByteArray(1, '\\') + sep;
++    writePathEntry(QByteArray(pKey), path, pFlags);
++}
+ 
+-    QByteArray value;
++void KConfigGroup::writePathEntry(const QByteArray &key, const QString &path, WriteConfigFlags flags)
++{
++    Q_ASSERT(!d->bConst);
+ 
+-    if (!list.isEmpty()) {
+-        QList<QByteArray>::ConstIterator it = list.constBegin();
+-        const QList<QByteArray>::ConstIterator end = list.constEnd();
++    config()->d_func()->putData(d->fullName(), key, translatePath(path).toUtf8(), flags, true);
++}
+ 
+-        value = *it;
+-        value.reserve(4084);
++void KConfigGroup::writePathEntry(const QString& pKey, const QStringList &value, WriteConfigFlags pFlags)
++{
++    writePathEntry(pKey.toUtf8(), value, pFlags);
++}
+ 
+-        value.replace(sep, escaped);
++void KConfigGroup::writePathEntry(const char *pKey, const QStringList &value, WriteConfigFlags pFlags)
++{
++    writePathEntry(QByteArray(pKey), value, pFlags);
++}
+ 
+-        while (++it != end) {
+-            value += sep;
+-            value += QByteArray(*it).replace(sep, escaped);
+-        }
++void KConfigGroup::writePathEntry(const QByteArray &key, const QStringList &value, WriteConfigFlags flags)
++{
++    Q_ASSERT(!d->bConst);
+ 
+-        value.squeeze(); // release any unused memory
+-    }
++    QList<QByteArray> list;
++    foreach(const QString& path, value)
++        list << translatePath(path).toUtf8();
+ 
+-    return value;
++    config()->d_func()->putData(d->fullName(), key, KConfigGroupPrivate::serializeList(list), flags, true);
++}
++
++void KConfigGroup::deleteEntry(const QByteArray& key, WriteConfigFlags flags)
++{
++   config()->d_func()->putData(d->fullName(), key, QByteArray(), flags);
++}
++
++void KConfigGroup::deleteEntry( const QString& key, WriteConfigFlags flags)
++{
++    deleteEntry(key.toUtf8(), flags);
++}
++
++void KConfigGroup::deleteEntry( const char *key, WriteConfigFlags flags)
++{
++    deleteEntry(QByteArray(key), flags);
+ }
+ 
+ void KConfigGroup::revertToDefault(const QByteArray& key)
+@@ -1039,8 +1153,7 @@
+     const QByteArray theDefault = config()->d_func()->lookupData(d->fullName(), key,
+                       KEntryMap::SearchDefaults|KEntryMap::SearchLocalized);
+ 
+-    config()->d_func()->putData(d->fullName(), key, theDefault, KConfig::Normal,
+-                                theDefault.isNull() ? KConfigPrivate::Delete : KConfigPrivate::NoFlag);
++    config()->d_func()->putData(d->fullName(), key, theDefault, KConfig::Normal);
+ }
+ 
+ void KConfigGroup::revertToDefault(const char *key)
+@@ -1056,7 +1169,6 @@
+ bool KConfigGroup::hasDefault(const QByteArray& key) const
+ {
+     KEntryMap::SearchFlags flags = KEntryMap::SearchDefaults|KEntryMap::SearchLocalized;
+-    flags |= KEntryMap::SearchLocalized;
+ 
+     return !config()->d_func()->lookupData(d->fullName(), key, flags).isNull();
+ }
+@@ -1095,109 +1207,6 @@
+     return d->bImmutable;
+ }
+ 
+-
+-
+-#include <QtCore/QDir>
+-
+-static bool cleanHomeDirPath( QString &path, const QString &homeDir )
+-{
+-#ifdef Q_WS_WIN //safer
+-   if (!QDir::convertSeparators(path).startsWith(QDir::convertSeparators(homeDir)))
+-        return false;
+-#else
+-   if (!path.startsWith(homeDir))
+-        return false;
+-#endif
+-
+-   int len = homeDir.length();
+-   // replace by "$HOME" if possible
+-   if (len && (path.length() == len || path[len] == '/')) {
+-        path.replace(0, len, QString::fromLatin1("$HOME"));
+-        return true;
+-   } else
+-        return false;
+-}
+-
+-QString translatePath( QString path ) // krazy:exclude=passbyvalue
+-{
+-   if (path.isEmpty())
+-       return path;
+-
+-   // only "our" $HOME should be interpreted
+-   path.replace('$', "$$");
+-
+-   bool startsWithFile = path.startsWith(QLatin1String("file:"), Qt::CaseInsensitive);
+-
+-   // return original path, if it refers to another type of URL (e.g. http:/), or
+-   // if the path is already relative to another directory
+-   if ((!startsWithFile && QFileInfo(path).isRelative()) ||
+-       (startsWithFile && QFileInfo(path.mid(5)).isRelative()))
+-	return path;
+-
+-   if (startsWithFile)
+-        path.remove(0,5); // strip leading "file:/" off the string
+-
+-   // keep only one single '/' at the beginning - needed for cleanHomeDirPath()
+-   while (path[0] == '/' && path[1] == '/')
+-	path.remove(0,1);
+-
+-   // we can not use KGlobal::dirs()->relativeLocation("home", path) here,
+-   // since it would not recognize paths without a trailing '/'.
+-   // All of the 3 following functions to return the user's home directory
+-   // can return different paths. We have to test all them.
+-   const QString homeDir0 = QFile::decodeName(getenv("HOME"));
+-   const QString homeDir1 = QDir::homePath();
+-   const QString homeDir2 = QDir(homeDir1).canonicalPath();
+-   if (cleanHomeDirPath(path, homeDir0) ||
+-       cleanHomeDirPath(path, homeDir1) ||
+-       cleanHomeDirPath(path, homeDir2) ) {
+-     // kDebug() << "Path was replaced\n";
+-   }
+-
+-   if (startsWithFile)
+-      path.prepend( "file://" );
+-
+-   return path;
+-}
+-
+-void KConfigGroup::writePathEntry(const QString &key, const QString & path, WriteConfigFlags flags)
+-{
+-   writePathEntry(key.toUtf8(), path, flags);
+-}
+-
+-void KConfigGroup::writePathEntry(const char *key, const QString & path, WriteConfigFlags flags)
+-{
+-   writePathEntry(QByteArray(key), path, flags);
+-}
+-
+-void KConfigGroup::writePathEntry(const QByteArray &key, const QString &path, WriteConfigFlags flags)
+-{
+-    Q_ASSERT(!d->bConst);
+-
+-    config()->d_func()->putData(d->fullName(), key, translatePath(path).toUtf8(), flags, KConfigPrivate::Expand);
+-}
+-
+-void KConfigGroup::writePathEntry(const QString &key, const QStringList &value, char sep, WriteConfigFlags flags)
+-{
+-  writePathEntry(key.toUtf8(), value, sep, flags);
+-}
+-
+-void KConfigGroup::writePathEntry(const char *key, const QStringList &value, char sep, WriteConfigFlags flags)
+-{
+-  writePathEntry(QByteArray(key), value, sep, flags);
+-}
+-
+-void KConfigGroup::writePathEntry(const QByteArray &key, const QStringList &value, char sep, WriteConfigFlags flags)
+-{
+-    Q_ASSERT(!d->bConst);
+-
+-    QList<QByteArray> list;
+-    foreach(const QString& path, value)
+-        list << translatePath(path).toUtf8();
+-
+-    config()->d_func()->putData(d->fullName(), key, KConfigGroupPrivate::convertList(list, sep), flags, KConfigPrivate::Expand);
+-}
+-
+ QStringList KConfigGroup::groupList() const
+ {
+     return config()->d_func()->groupList(d->fullName());
+@@ -1208,14 +1217,14 @@
+     return entryMap().keys();
+ }
+ 
+-void KConfigGroup::clean()
++void KConfigGroup::markAsClean()
+ {
+-    config()->clean();
++    config()->markAsClean();
+ }
+ 
+-KConfigGroup::ConfigState KConfigGroup::getConfigState() const
++KConfigGroup::AccessMode KConfigGroup::accessMode() const
+ {
+-    return config()->getConfigState();
++    return config()->accessMode();
+ }
+ 
+ bool KConfigGroup::hasGroupImpl(const QByteArray & b) const
+@@ -1230,7 +1239,8 @@
+     config()->deleteGroup(d->fullName() + '/' + b, flags);
+ }
+ 
+-bool KConfigGroup::groupIsImmutableImpl(const QByteArray& b) const
++bool KConfigGroup::isGroupImmutableImpl(const QByteArray& b) const
+ {
+     return groupImpl(b).d->bImmutable;
+ }
++
+--- a/kdecore/config/kconfigbackend.h
++++ b/kdecore/config/kconfigbackend.h
+@@ -55,7 +55,7 @@
+     /** registers mappings from directory to configuration system
+      * @param entryMap the KEntryMap to build the mappings from
+      */
+-    static void registerMappings(KEntryMap& entryMap);
++    static void registerMappings(const KEntryMap& entryMap);
+ 
+     /** destroys the backend */
+     virtual ~KConfigBackend();
+@@ -110,6 +110,11 @@
+      */
+     virtual bool isWritable() const = 0;
+     /**
++     * get the read/write status of the configuration object.
++     * @note This function @b MUST be implemented by sub-classes.
++     */
++    virtual KConfigBase::AccessMode accessMode() const = 0;
++    /**
+      * create the enclosing object of @em this object.
+      * @note This function @b MUST be implemented by sub-classes.
+      */
+--- a/kdecore/all_languages.desktop
++++ b/kdecore/all_languages.desktop
+@@ -7,6 +7,7 @@
+ Name[csb]=Afarsczi
+ Name[cy]=Afareg
+ Name[eo]=Afara
++Name[et]=Afari
+ Name[fa]=افار
+ Name[ga]=Afárais
+ Name[he]=אפאר
+@@ -27,8 +28,8 @@
+ Name[ru]=Афарский
+ Name[se]=Afárgiella
+ Name[sl]=afarsko
+-Name[sr]=Афарски
+-Name[sr at latin]=Afarski
++Name[sr]=афарски
++Name[sr at latin]=afarski
+ Name[ta]=அஃபார்
+ Name[te]=ఎఫార్
+ Name[tg]=Афарӣ
+@@ -86,8 +87,8 @@
+ Name[ru]=Абхазский
+ Name[se]=Abhásiagiella
+ Name[sl]=abkazijansko
+-Name[sr]=Абхазијски
+-Name[sr at latin]=Abhazijski
++Name[sr]=абхазијски
++Name[sr at latin]=abhazijski
+ Name[sv]=Abkhasiska
+ Name[ta]=அப்காசியன்
+ Name[te]=అబ్ఖజియన్
+@@ -128,6 +129,7 @@
+ Name[km]=អាវែស្តង់
+ Name[kn]=ಅವೆಸ್ತನ್
+ Name[ko]=아베스탄어
++Name[lv]=Avestāņu
+ Name[mk]=Авестан
+ Name[nb]=Avestisk
+ Name[nds]=Avesta
+@@ -140,8 +142,8 @@
+ Name[ru]=Авестийский
+ Name[se]=Avestánagiella
+ Name[sl]=avestansko
+-Name[sr]=Авестански
+-Name[sr at latin]=Avestanski
++Name[sr]=авестански
++Name[sr at latin]=avestanski
+ Name[sv]=Avestiska
+ Name[ta]=அவெஸ்தன்
+ Name[te]=అవెస్థన్
+@@ -189,8 +191,8 @@
+ Name[ru]=Африкаанс
+ Name[se]=Afrikánsgiella
+ Name[sl]=afrikansko
+-Name[sr]=Африканерски
+-Name[sr at latin]=Afrikanerski
++Name[sr]=африканерски
++Name[sr at latin]=afrikanerski
+ Name[sv]=Sydafrikansk holländska
+ Name[ta]=ஆஃபரிகான்ஸ்
+ Name[te]=ఆఫ్రికాన్స్
+@@ -243,6 +245,7 @@
+ Name[ne]=अम्हारिक
+ Name[nl]=Amharisch
+ Name[nn]=Amharisk
++Name[oc]=Amaric
+ Name[pa]=ਅਮਹਾਰਿਕ
+ Name[pl]=Etiopski
+ Name[pt]=Amárico
+@@ -251,8 +254,8 @@
+ Name[ru]=Амхарский
+ Name[se]=Ambháriagiella
+ Name[sl]=amharik
+-Name[sr]=Амарски
+-Name[sr at latin]=Amarski
++Name[sr]=амарски
++Name[sr at latin]=amarski
+ Name[sv]=Amarinja
+ Name[ta]=அம்ஹாரிக்
+ Name[te]=అమ్హరిక్
+@@ -310,6 +313,7 @@
+ Name[ne]=अरबी
+ Name[nl]=Arabisch
+ Name[nn]=Arabisk
++Name[oc]=Arab
+ Name[pa]=ਅਰਬੀ
+ Name[pl]=Arabski
+ Name[pt]=Árabe
+@@ -318,8 +322,8 @@
+ Name[ru]=Арабский
+ Name[se]=Arábiagiella
+ Name[sl]=arabsko
+-Name[sr]=Арапски
+-Name[sr at latin]=Arapski
++Name[sr]=арапски
++Name[sr at latin]=arapski
+ Name[sv]=Arabiska
+ Name[ta]=அராபிக்
+ Name[te]=అరబిక్
+@@ -370,6 +374,7 @@
+ Name[ne]=आसामी
+ Name[nl]=Assamees
+ Name[nn]=Assami
++Name[oc]=Assamés
+ Name[pa]=ਆਸਾਮੀ
+ Name[pl]=Assamijski
+ Name[pt_BR]=Assamês
+@@ -377,8 +382,8 @@
+ Name[ru]=Ассамский
+ Name[se]=Assamesegiella
+ Name[sl]=asamese
+-Name[sr]=Асамски
+-Name[sr at latin]=Asamski
++Name[sr]=асамејски
++Name[sr at latin]=asamejski
+ Name[sv]=Assamesiska
+ Name[ta]=அஸ்ஸாமிய
+ Name[te]=అస్సామీ
+@@ -414,17 +419,18 @@
+ Name[kn]=ಅಯಮಾರಾ
+ Name[ko]=아이마라어
+ Name[lb]=Aimara
+-Name[lv]=Ajmaru
++Name[lv]=Aimaru
+ Name[mk]=Ајмара
+ Name[ne]=एमरा
++Name[oc]=Aymarà
+ Name[pa]=ਅਯਮਾਰਾ
+ Name[pt_BR]=Aimará
+ Name[ro]=Aymară
+ Name[ru]=Аймарский
+ Name[se]=Aimáragiella
+ Name[sl]=ajmarsko
+-Name[sr]=Ајмарски
+-Name[sr at latin]=Ajmarski
++Name[sr]=ајмарски
++Name[sr at latin]=ajmarski
+ Name[ta]=அய்மாரா
+ Name[te]=అయ్మరా
+ Name[tg]=Аймарагӣ
+@@ -454,7 +460,7 @@
+ Name[et]=Aserbaidžaani
+ Name[eu]=Azerbaijanera
+ Name[fa]=آذربایجانی
+-Name[fi]=Azerbaidžani
++Name[fi]=Azeri
+ Name[fr]=Azerbaïdjanais
+ Name[fy]=Azerbeidzjaansk
+ Name[ga]=Asarbaiseáinis
+@@ -479,6 +485,7 @@
+ Name[ne]=अजरबैजानी
+ Name[nl]=Azerbeidjaans
+ Name[nn]=Aserbajdsjansk
++Name[oc]=Aseri
+ Name[pa]=ਅਜ਼ਰਬਾਈਜਾਨੀ
+ Name[pl]=Azerbejdżański
+ Name[pt]=Azerbaijano
+@@ -487,8 +494,8 @@
+ Name[ru]=Азербайджанский
+ Name[se]=Azerbaižánagiella
+ Name[sl]=azerbajdžansko
+-Name[sr]=Азербејџански
+-Name[sr at latin]=Azerbejdžanski
++Name[sr]=азербејџански
++Name[sr at latin]=azerbejdžanski
+ Name[sv]=Azerbajdzjanska
+ Name[ta]=அசர்பைசானி
+ Name[te]=అజెర్ బైజాని
+@@ -536,6 +543,7 @@
+ Name[nds]=Baschkiirsch
+ Name[ne]=बास्खिर
+ Name[nn]=Basjkirsk
++Name[oc]=Bachkir
+ Name[pa]=ਬਸਕੀਰ
+ Name[pl]=Baszkirski
+ Name[pt_BR]=Basquir
+@@ -543,8 +551,8 @@
+ Name[ru]=Башкирский
+ Name[se]=Baškiriagiella
+ Name[sl]=baškirsko
+-Name[sr]=Башкирски
+-Name[sr at latin]=Baškirski
++Name[sr]=башкирски
++Name[sr at latin]=baškirski
+ Name[ta]=பாக்ஷீர்
+ Name[te]=బాష్కిర్
+ Name[tg]=Бошқирдӣ
+@@ -599,6 +607,7 @@
+ Name[ne]=बेलारूसी
+ Name[nl]=Wit-Rusland
+ Name[nn]=Kviterussisk
++Name[oc]=Bielorus
+ Name[pa]=ਬੇਲਾਰੂਸ
+ Name[pl]=Białoruski
+ Name[pt]=Bielorrusso
+@@ -607,8 +616,8 @@
+ Name[ru]=Белорусский
+ Name[se]=Vilgesruoššagiella
+ Name[sl]=belorusko
+-Name[sr]=Белоруски
+-Name[sr at latin]=Beloruski
++Name[sr]=белоруски
++Name[sr at latin]=beloruski
+ Name[sv]=Vitryska
+ Name[ta]=பெலாரூசியன்
+ Name[te]=బెలరషియన్
+@@ -667,6 +676,7 @@
+ Name[ne]=बुल्गेरियाली
+ Name[nl]=Bulgaars
+ Name[nn]=Bulgarsk
++Name[oc]=Bulgar
+ Name[pa]=ਬੁਲਗਾਰੀਆ
+ Name[pl]=Bułgarski
+ Name[pt]=Búlgaro
+@@ -675,8 +685,8 @@
+ Name[ru]=Болгарский
+ Name[se]=Bulgáriagiella
+ Name[sl]=bolgarsko
+-Name[sr]=Бугарски
+-Name[sr at latin]=Bugarski
++Name[sr]=бугарски
++Name[sr at latin]=bugarski
+ Name[sv]=Bulgariska
+ Name[ta]=பல்கேரியன்
+ Name[te]=బల్గెరియన్
+@@ -715,8 +725,8 @@
+ Name[ru]=Бихарский
+ Name[se]=Biháragiella
+ Name[sl]=bihari
+-Name[sr]=Бихарски
+-Name[sr at latin]=Biharski
++Name[sr]=бихарски
++Name[sr at latin]=biharski
+ Name[ta]=பீகாரி
+ Name[te]=బిహారి
+ Name[tg]=Бихарӣ
+@@ -747,12 +757,13 @@
+ Name[ko]=비슬라마어
+ Name[mk]=Бислама
+ Name[ne]=बिस्लामा
++Name[oc]=Bislamà
+ Name[pa]=ਬਿਸਲਾਮਾ
+ Name[ru]=Бислама
+ Name[se]=Bislamagiella
+ Name[sl]=bislama
+-Name[sr]=Бисламски
+-Name[sr at latin]=Bislamski
++Name[sr]=бисламски
++Name[sr at latin]=bislamski
+ Name[ta]=பிஸ்லாமா
+ Name[te]=బిస్లమా
+ Name[tg]=Бислама
+@@ -796,13 +807,14 @@
+ Name[mk]=Бенгалски
+ Name[nds]=Bengaalsch
+ Name[ne]=बङ्गाली
++Name[oc]=Bengalí
+ Name[pa]=ਬੰਗਾਲੀ
+ Name[pl]=Bengalski
+ Name[ru]=Бенгали
+ Name[se]=Bengalagiella
+ Name[sl]=bengalsko
+-Name[sr]=Бенгалски
+-Name[sr at latin]=Bengalski
++Name[sr]=бенгалски
++Name[sr at latin]=bengalski
+ Name[ta]=பெங்காலி
+ Name[te]=బెంగాలి
+ Name[tg]=Бенголӣ
+@@ -866,8 +878,8 @@
+ Name[ru]=Тибетский
+ Name[se]=Tibehtagiella
+ Name[sl]=tibetansko
+-Name[sr]=Тибетански
+-Name[sr at latin]=Tibetanski
++Name[sr]=тибетански
++Name[sr at latin]=tibetanski
+ Name[sv]=Tibetanska
+ Name[ta]=திபெத்தியன்
+ Name[te]=టిబెటియన్
+@@ -929,8 +941,8 @@
+ Name[ru]=Бретонский
+ Name[se]=Bretonagiella
+ Name[sl]=bretonsko
+-Name[sr]=Бретонски
+-Name[sr at latin]=Bretonski
++Name[sr]=бретонски
++Name[sr at latin]=bretonski
+ Name[sv]=Bretonska
+ Name[ta]=பிரெடான்
+ Name[te]=బ్రెటన్
+@@ -989,6 +1001,7 @@
+ Name[ne]=बोस्नियाली
+ Name[nl]=Bosnisch
+ Name[nn]=Bosnisk
++Name[oc]=Bosniac
+ Name[pa]=ਬੋਸਨੀਆ
+ Name[pl]=Bośniacki
+ Name[pt]=Bósnio
+@@ -997,8 +1010,8 @@
+ Name[ru]=Боснийский
+ Name[se]=Bosniagiella
+ Name[sl]=bosansko
+-Name[sr]=Бошњачки
+-Name[sr at latin]=Bošnjački
++Name[sr]=бошњачки
++Name[sr at latin]=bošnjački
+ Name[sv]=Bosniska
+ Name[ta]=பொஸ்னியன்
+ Name[te]=బొస్నియన్
+@@ -1063,8 +1076,8 @@
+ Name[ru]=Каталонский
+ Name[se]=Katalánagiella
+ Name[sl]=katalonsko
+-Name[sr]=Каталонски
+-Name[sr at latin]=Katalonski
++Name[sr]=каталонски
++Name[sr at latin]=katalonski
+ Name[sv]=Katalanska
+ Name[ta]=கடலான்
+ Name[te]=కెటలన్
+@@ -1124,8 +1137,8 @@
+ Name[ru]=Чеченский
+ Name[se]=Čečeniagiella
+ Name[sl]=čečensko
+-Name[sr]=Чеченски
+-Name[sr at latin]=Čečenski
++Name[sr]=чеченски
++Name[sr at latin]=čečenski
+ Name[sv]=Tjetjenska
+ Name[ta]=செச்சென்
+ Name[te]=చెచన్
+@@ -1148,6 +1161,7 @@
+ Name[cy]=Chamorreg
+ Name[eo]=Ĉamora
+ Name[fa]=کاماروئی
++Name[fi]=Tšamorro
+ Name[ga]=Seamóróis
+ Name[he]=צ'מורו
+ Name[hr]=Čamorski
+@@ -1159,13 +1173,14 @@
+ Name[ko]=차모로어
+ Name[mk]=Чаморо
+ Name[ne]=क्यामोरो
++Name[oc]=Chamorrá
+ Name[pa]=ਚਾਮੂਰੂ
+ Name[ro]=Camoro
+ Name[ru]=Чаморро
+ Name[se]=Chamorrogiella
+ Name[sl]=chamorro
+-Name[sr]=Чаморски
+-Name[sr at latin]=Čamorski
++Name[sr]=чаморски
++Name[sr at latin]=čamorski
+ Name[ta]=சமாரோ
+ Name[te]=చమొర్రొ
+ Name[tg]=Чаморроӣ
+@@ -1219,6 +1234,7 @@
+ Name[ne]=कोर्सिकन
+ Name[nl]=Corsicaans
+ Name[nn]=Korsikansk
++Name[oc]=Còrse
+ Name[pa]=ਕੁਰਸੀਕੇਨ
+ Name[pl]=Korsykański
+ Name[pt]=Corso
+@@ -1227,8 +1243,8 @@
+ Name[ru]=Корсиканский
+ Name[se]=Korsikagiella
+ Name[sl]=korzijško
+-Name[sr]=Корзикански
+-Name[sr at latin]=Korzikanski
++Name[sr]=корзикански
++Name[sr at latin]=korzikanski
+ Name[sv]=Korsikanska
+ Name[ta]=கோர்சிகன்
+ Name[te]=కొర్సికన్
+@@ -1285,6 +1301,7 @@
+ Name[ne]=चेक
+ Name[nl]=Tsjechisch
+ Name[nn]=Tsjekkisk
++Name[oc]=Chèc
+ Name[pa]=ਚੈੱਕ
+ Name[pl]=Czeski
+ Name[pt]=Checo
+@@ -1293,8 +1310,8 @@
+ Name[ru]=Чешский
+ Name[se]=Čehkagiella
+ Name[sl]=češko
+-Name[sr]=Чешки
+-Name[sr at latin]=Češki
++Name[sr]=чешки
++Name[sr at latin]=češki
+ Name[sv]=Tjeckiska
+ Name[ta]=செக்
+ Name[te]=చెక్
+@@ -1358,8 +1375,8 @@
+ Name[ru]=Церковно-славянский
+ Name[se]=Slávagiella
+ Name[sl]=cerkvena slovanščina
+-Name[sr]=Црквени православни
+-Name[sr at latin]=Crkveni pravoslavni
++Name[sr]=црквенословенски
++Name[sr at latin]=crkvenoslovenski
+ Name[sv]=Kyrkoslaviska
+ Name[ta]=சர்ச் ஸ்லாவிக்
+ Name[te]=చర్చి స్లావిక్
+@@ -1411,8 +1428,8 @@
+ Name[ru]=Чувашский
+ Name[se]=Chuvashgiella
+ Name[sl]=chuvash
+-Name[sr]=Чувашки
+-Name[sr at latin]=Čuvaški
++Name[sr]=чувашки
++Name[sr at latin]=čuvaški
+ Name[sv]=Tjuvasjiska
+ Name[ta]=சுவாஷ்
+ Name[te]=చువాష్
+@@ -1445,7 +1462,7 @@
+ Name[et]=Uelsi
+ Name[eu]=Galesa
+ Name[fa]=ولزی
+-Name[fi]=Wales
++Name[fi]=Kymri
+ Name[fr]=Gallois
+ Name[fy]=Welsk
+ Name[ga]=Breatnais
+@@ -1469,6 +1486,7 @@
+ Name[nds]=Waliessch
+ Name[ne]=वेल्स
+ Name[nn]=Walisisk
++Name[oc]=Galés
+ Name[pa]=ਵਾਲਿਸ਼
+ Name[pl]=Walijski
+ Name[pt]=Galês
+@@ -1477,8 +1495,8 @@
+ Name[ru]=Уэльский
+ Name[se]=Walesagiella
+ Name[sl]=valižansko
+-Name[sr]=Велшански
+-Name[sr at latin]=Velšanski
++Name[sr]=велшки
++Name[sr at latin]=velški
+ Name[sv]=Walesiska
+ Name[ta]=வெல்ஷ்
+ Name[te]=వెల్ష్
+@@ -1535,6 +1553,7 @@
+ Name[ne]=डेनिश
+ Name[nl]=Deens
+ Name[nn]=Dansk
++Name[oc]=Danés
+ Name[pa]=ਡੈਨਿਸ਼
+ Name[pl]=Duński
+ Name[pt]=Dinamarquês
+@@ -1543,8 +1562,8 @@
+ Name[ru]=Датский
+ Name[se]=Dánskkagiella
+ Name[sl]=dansko
+-Name[sr]=Дански
+-Name[sr at latin]=Danski
++Name[sr]=дански
++Name[sr at latin]=danski
+ Name[sv]=Danska
+ Name[ta]=டேனிஷ்
+ Name[te]=డెనిష్
+@@ -1603,6 +1622,7 @@
+ Name[ne]=जर्मन
+ Name[nl]=Duits
+ Name[nn]=Tysk
++Name[oc]=Aleman
+ Name[pa]=ਜਰਮਨ
+ Name[pl]=Niemiecki
+ Name[pt]=Alemão
+@@ -1611,8 +1631,8 @@
+ Name[ru]=Немецкий
+ Name[se]=Duiskkagiella
+ Name[sl]=nemško
+-Name[sr]=Немачки
+-Name[sr at latin]=Nemački
++Name[sr]=немачки
++Name[sr at latin]=nemački
+ Name[sv]=Tyska
+ Name[ta]=ஜெர்மன்
+ Name[te]=జెర్మన్
+@@ -1648,8 +1668,8 @@
+ Name[ru]=Дзонгка (Бутан)
+ Name[se]=Dzongkhagiella
+ Name[sl]=dzonkha
+-Name[sr]=Џонка
+-Name[sr at latin]=Džonka
++Name[sr]=џонка
++Name[sr at latin]=džonka
+ Name[ta]=ட்சொங்க்ஹா
+ Name[te]=జొంగ్ఖ
+ Name[tg]=Дзонгка (Бутан)
+@@ -1705,6 +1725,7 @@
+ Name[ne]=ग्रीक
+ Name[nl]=Grieks
+ Name[nn]=Gresk
++Name[oc]=Grèc
+ Name[pa]=ਗਰੀਕ
+ Name[pl]=Grecki
+ Name[pt]=Grego
+@@ -1713,8 +1734,8 @@
+ Name[ru]=Греческий
+ Name[se]=Greikkagiella
+ Name[sl]=grško
+-Name[sr]=Грчки
+-Name[sr at latin]=Grčki
++Name[sr]=грчки
++Name[sr at latin]=grčki
+ Name[sv]=Grekiska
+ Name[ta]=கிரேக்கம்
+ Name[te]=గ్రీక్
+@@ -1774,6 +1795,7 @@
+ Name[ne]=अङ्ग्रेजी
+ Name[nl]=Engels
+ Name[nn]=Engelsk
++Name[oc]=Anglés
+ Name[pa]=ਅੰਗਰੇਜ਼ੀ
+ Name[pl]=Angielski
+ Name[pt]=Inglês
+@@ -1782,8 +1804,8 @@
+ Name[ru]=Английский
+ Name[se]=Eŋgelasgiella
+ Name[sl]=angleško
+-Name[sr]=Енглески
+-Name[sr at latin]=Engleski
++Name[sr]=енглески
++Name[sr at latin]=engleski
+ Name[sv]=Engelska
+ Name[ta]=ஆங்கிலம்
+ Name[te]=ఆంగ్లం
+@@ -1818,7 +1840,7 @@
+ Name[et]=Briti inglise
+ Name[eu]=Ingelesa (britainiarra)
+ Name[fa]=انگلیسی بریتانیایی
+-Name[fi]=Brittienglanti
++Name[fi]=Brittannianenglanti
+ Name[fr]=Anglais britannique
+ Name[fy]=Britsk Ingelsk
+ Name[ga]=Béarla na Sasanach
+@@ -1850,8 +1872,8 @@
+ Name[ru]=Английский (Великобритания)
+ Name[se]=Eŋgelasgiella (Stuorra Brittania)
+ Name[sl]=britansko angleško
+-Name[sr]=Британски енглески
+-Name[sr at latin]=Britanski engleski
++Name[sr]=британски енглески
++Name[sr at latin]=britanski engleski
+ Name[sv]=Brittisk engelska
+ Name[ta]=பிரிட்டிஷ் ஆங்கிலம்
+ Name[te]=బ్రిటిష్ ఆంగ్లం
+@@ -1916,8 +1938,8 @@
+ Name[ru]=Английский (США)
+ Name[se]=Eŋgelasgiella (Amerihkáhlaš)
+ Name[sl]=ameriško angleško
+-Name[sr]=Амерички енглески
+-Name[sr at latin]=Američki engleski
++Name[sr]=амерички енглески
++Name[sr at latin]=američki engleski
+ Name[sv]=Amerikansk engelska
+ Name[ta]=அமெரிக்கன் ஆங்கிலம்
+ Name[te]=అమెరికన్ ఆంగ్లం
+@@ -1953,7 +1975,8 @@
+ Name[pa]=ਇਸਪੀਰਨਟੋ
+ Name[ru]=Эсперанто
+ Name[sl]=esperanto
+-Name[sr]=Есперанто
++Name[sr]=есперанто
++Name[sr at latin]=esperanto
+ Name[ta]=எஸ்பரான்டோ
+ Name[te]=ఎస్పరాన్టొ
+ Name[tg]=Эсперантоӣ
+@@ -2009,6 +2032,7 @@
+ Name[ne]=स्पेनिश
+ Name[nl]=Spaans
+ Name[nn]=Spansk
++Name[oc]=Castelhan
+ Name[pa]=ਸਪੇਨੀ
+ Name[pl]=Hiszpański
+ Name[pt]=Espanhol
+@@ -2017,8 +2041,8 @@
+ Name[ru]=Испанский
+ Name[se]=Spánskkagiella
+ Name[sl]=špansko
+-Name[sr]=Шпански
+-Name[sr at latin]=Španski
++Name[sr]=шпански
++Name[sr at latin]=španski
+ Name[sv]=Spanska
+ Name[ta]=ஸ்பானிய
+ Name[te]=స్పెనిష్
+@@ -2053,7 +2077,7 @@
+ Name[et]=Eesti
+ Name[eu]=Estoniera
+ Name[fa]=استونیایی
+-Name[fi]=Eesti
++Name[fi]=Viro
+ Name[fr]=Estonien
+ Name[fy]=Estsk
+ Name[ga]=Eastóinis
+@@ -2086,8 +2110,8 @@
+ Name[ru]=Эстонский
+ Name[se]=Esttegiella
+ Name[sl]=estonsko
+-Name[sr]=Естонски
+-Name[sr at latin]=Estonski
++Name[sr]=естонски
++Name[sr at latin]=estonski
+ Name[sv]=Estniska
+ Name[ta]=எஸ்டோனியன்
+ Name[te]=ఎస్టొనియన్
+@@ -2143,6 +2167,7 @@
+ Name[ne]=बास्क
+ Name[nl]=Baskisch
+ Name[nn]=Baskisk
++Name[oc]=Basc
+ Name[pa]=ਬਸਕਿਉ
+ Name[pl]=Baskijski
+ Name[pt]=Basco
+@@ -2151,8 +2176,8 @@
+ Name[ru]=Баскский
+ Name[se]=Baskalašgiella
+ Name[sl]=baskovsko
+-Name[sr]=Баскијски
+-Name[sr at latin]=Baskijski
++Name[sr]=баскијски
++Name[sr at latin]=baskijski
+ Name[sv]=Baskiska
+ Name[ta]=பாஸ்க்
+ Name[te]=బాస్క్
+@@ -2186,7 +2211,7 @@
+ Name[et]=Farsi (pärsia)
+ Name[eu]=Farsiera (Persiera)
+ Name[fa]=فارسی
+-Name[fi]=Farsi (Persia)
++Name[fi]=Farsi (persia)
+ Name[fr]=Persan
+ Name[fy]=Farsysk (Persysk)
+ Name[ga]=Fairsis (Peirsis)
+@@ -2219,8 +2244,8 @@
+ Name[ru]=Фарси
+ Name[se]=Farsigiella (Persialaš)
+ Name[sl]=Farsi (perzijsko)
+-Name[sr]=Фарси (Персијски)
+-Name[sr at latin]=Farsi (Persijski)
++Name[sr]=фарси (персијски)
++Name[sr at latin]=farsi (persijski)
+ Name[sv]=Persiska
+ Name[ta]=பார்சி (பெர்சியன்)
+ Name[te]=ఫార్సి (పెర్షియన్)
+@@ -2278,6 +2303,7 @@
+ Name[ne]=फिनिश
+ Name[nl]=Fins
+ Name[nn]=Finsk
++Name[oc]=Finés
+ Name[pa]=ਫੈਨਿਸ਼
+ Name[pl]=Fiński
+ Name[pt]=Finlandês
+@@ -2286,8 +2312,8 @@
+ Name[ru]=Финский
+ Name[se]=Suomagiella
+ Name[sl]=finsko
+-Name[sr]=Фински
+-Name[sr at latin]=Finski
++Name[sr]=фински
++Name[sr at latin]=finski
+ Name[sv]=Finska
+ Name[ta]=ஃபின்னிஷ்
+ Name[te]=ఫిన్నిష్
+@@ -2350,8 +2376,8 @@
+ Name[ru]=Фиджи
+ Name[se]=Fižigiella
+ Name[sl]=fidžijsko
+-Name[sr]=Фиџијски
+-Name[sr at latin]=Fidžijski
++Name[sr]=фиџијски
++Name[sr at latin]=fidžijski
+ Name[sv]=Fijianska
+ Name[ta]=ஃபிஜியன்
+ Name[te]=ఫిజియన్
+@@ -2404,6 +2430,7 @@
+ Name[nds]=Färöösch
+ Name[ne]=फारोसी
+ Name[nn]=Færøysk
++Name[oc]=Feroés
+ Name[pa]=ਫਾਰੋਇਸੀ
+ Name[pl]=z Wysp Owczych
+ Name[pt]=Faroês
+@@ -2412,8 +2439,8 @@
+ Name[ru]=Фарерский
+ Name[se]=Fearagiella
+ Name[sl]=fersko
+-Name[sr]=Фарски
+-Name[sr at latin]=Farski
++Name[sr]=фарски
++Name[sr at latin]=farski
+ Name[sv]=Färöiska
+ Name[ta]=ஃபாரோவீஸ்
+ Name[te]=ఫారొఈస్
+@@ -2471,6 +2498,7 @@
+ Name[ne]=फ्रेन्च
+ Name[nl]=Frans
+ Name[nn]=Fransk
++Name[oc]=Francés
+ Name[pa]=ਫਰੈਂਚ
+ Name[pl]=Francuski
+ Name[pt]=Francês
+@@ -2479,8 +2507,8 @@
+ Name[ru]=Французский
+ Name[se]=Fránskkagiella
+ Name[sl]=francosko
+-Name[sr]=Француски
+-Name[sr at latin]=Francuski
++Name[sr]=француски
++Name[sr at latin]=francuski
+ Name[sv]=Franska
+ Name[ta]=பிரென்ச்
+ Name[te]=ఫ్రెంచ్
+@@ -2546,8 +2574,8 @@
+ Name[ru]=Фризийский
+ Name[se]=Frisagiella
+ Name[sl]=frizijsko
+-Name[sr]=Фризијски
+-Name[sr at latin]=Frizijski
++Name[sr]=фризијски
++Name[sr at latin]=frizijski
+ Name[sv]=Frisiska
+ Name[ta]=ஃபரீசியன்
+ Name[te]=ఫ్రిసియన్
+@@ -2578,7 +2606,7 @@
+ Name[et]=Iiri gaeli
+ Name[eu]=Irlandar gaelikoa
+ Name[fa]=اسکاتلندی ایرلندی
+-Name[fi]=Irlannin gael
++Name[fi]=Iiri
+ Name[fr]=Gaélique irlandais
+ Name[fy]=Iersk Gaelic
+ Name[ga]=Gaeilge
+@@ -2607,8 +2635,8 @@
+ Name[ru]=Галльский (Ирландия)
+ Name[se]=Irlánddalaš gaelagiella
+ Name[sl]=irsko galsko
+-Name[sr]=Ирски галски
+-Name[sr at latin]=Irski galski
++Name[sr]=ирски галски
++Name[sr at latin]=irski galski
+ Name[sv]=Irländsk galiciska
+ Name[ta]=ஐரிஷ் காலிக்
+ Name[te]=ఐరిష్ గెలిక్
+@@ -2638,7 +2666,7 @@
+ Name[et]=Gaeli
+ Name[eu]=Gaelikoa
+ Name[fa]=اسکاتلندی
+-Name[fi]=Gael
++Name[fi]=Gaeli
+ Name[fr]=Gaélique
+ Name[ga]=Gàidhlig
+ Name[gl]=Gaélico
+@@ -2666,8 +2694,8 @@
+ Name[ru]=Галльский
+ Name[se]=Gaelagiella
+ Name[sl]=galsko
+-Name[sr]=Галски
+-Name[sr at latin]=Galski
++Name[sr]=галски
++Name[sr at latin]=galski
+ Name[sv]=Galiciska
+ Name[ta]=கேலிக்
+ Name[te]=గెలిక్
+@@ -2718,7 +2746,7 @@
+ Name[lt]=Galiciečių
+ Name[lv]=Galiciāņu
+ Name[mk]=Галски
+-Name[nb]=Gaelisk
++Name[nb]=Galicisk
+ Name[nds]=Galizsch
+ Name[ne]=ग्यालिसियन
+ Name[nl]=Galicisch
+@@ -2731,8 +2759,8 @@
+ Name[ru]=Галицийский
+ Name[se]=Galisiagiella
+ Name[sl]=galicijsko
+-Name[sr]=Галицијски
+-Name[sr at latin]=Galicijski
++Name[sr]=галицијски
++Name[sr at latin]=galicijski
+ Name[sv]=Galiciska
+ Name[ta]=காலிசியன்
+ Name[te]=గలిచియన్
+@@ -2769,13 +2797,14 @@
+ Name[ko]=과라니어
+ Name[mk]=Гуарани
+ Name[ne]=गुवारानी
++Name[oc]=Guarari
+ Name[pa]=ਗੁਜਰਾਨੀ
+ Name[ro]=Guarană
+ Name[ru]=Гуарани
+ Name[se]=Guaránagiella
+ Name[sl]=guarani
+-Name[sr]=Гварански
+-Name[sr at latin]=Gvaranski
++Name[sr]=гварани
++Name[sr at latin]=gvarani
+ Name[sv]=Gujarati
+ Name[ta]=குவரானி
+ Name[te]=గువారాని
+@@ -2819,8 +2848,8 @@
+ Name[ru]=Гуджарати
+ Name[se]=Gujaratigiella
+ Name[sl]=gujarati
+-Name[sr]=Гујаратски
+-Name[sr at latin]=Gujaratski
++Name[sr]=гујарати
++Name[sr at latin]=gujarati
+ Name[ta]=குஜராத்தி
+ Name[te]=గుజరాతీ
+ Name[tg]=Гӯҷаратӣ
+@@ -2862,8 +2891,8 @@
+ Name[ru]=Манкс
+ Name[se]=Mánksagiella
+ Name[sl]=manx
+-Name[sr]=Манкски
+-Name[sr at latin]=Mankski
++Name[sr]=манкс
++Name[sr at latin]=manks
+ Name[ta]=மான்க்ஸ்
+ Name[te]=మేన్క్స్
+ Name[tg]=Манксӣ
+@@ -2903,7 +2932,8 @@
+ Name[ru]=Хауса
+ Name[se]=Hausagiella
+ Name[sl]=hausa
+-Name[sr]=Хауса
++Name[sr]=хауса
++Name[sr at latin]=hausa
+ Name[ta]=ஹவுசா
+ Name[te]=హౌసా
+ Name[tg]=Хаусагӣ
+@@ -2959,6 +2989,7 @@
+ Name[ne]=हिब्रु
+ Name[nl]=Hebreeuws
+ Name[nn]=Hebraisk
++Name[oc]=Ebrèu
+ Name[pa]=ਹੈਬਰਿਊ
+ Name[pl]=Hebrajski
+ Name[pt]=Hebreu
+@@ -2967,8 +2998,8 @@
+ Name[ru]=Иврит
+ Name[se]=Hebreagiella
+ Name[sl]=hebrejsko
+-Name[sr]=Хебрејски
+-Name[sr at latin]=Hebrejski
++Name[sr]=хебрејски
++Name[sr at latin]=hebrejski
+ Name[sv]=Hebreiska
+ Name[ta]=எபிரேயம்
+ Name[te]=హీబ్రూ
+@@ -3005,14 +3036,15 @@
+ Name[lv]=Hindu
+ Name[mk]=Хинди
+ Name[ne]=हिन्दी
++Name[oc]=Indi
+ Name[pa]=ਹਿੰਦੀ
+ Name[pt]=Hindu
+ Name[ro]=Hindusă
+ Name[ru]=Хинди
+ Name[se]=Hindigiella
+ Name[sl]=hindujsko
+-Name[sr]=Хинду
+-Name[sr at latin]=Hindu
++Name[sr]=хинду
++Name[sr at latin]=hindu
+ Name[ta]=ஹிந்தி
+ Name[te]=హింది
+ Name[tg]=Ҳиндӣ
+@@ -3046,12 +3078,13 @@
+ Name[mk]=Хири Моту
+ Name[ne]=हिरी मोतु
+ Name[nn]=Hiri motu
++Name[oc]=Iri Motu
+ Name[pa]=ਹੀਰੀ ਮੋਟੂ
+ Name[ru]=Хири Моту
+ Name[se]=Hiri Motu-giella
+ Name[sl]=hiri motu
+-Name[sr]=Хиримотски
+-Name[sr at latin]=Hirimotski
++Name[sr]=хири-моту
++Name[sr at latin]=hiri-motu
+ Name[sv]=Hirimotu
+ Name[ta]=ஹிரி மொட்டு
+ Name[te]=హిరి మోటు
+@@ -3108,6 +3141,7 @@
+ Name[ne]=क्रोयसियाली
+ Name[nl]=Kroatisch
+ Name[nn]=Kroatisk
++Name[oc]=Croat
+ Name[pa]=ਕਰੋਟੀਅਨ
+ Name[pl]=Chorwacki
+ Name[pt]=Croata
+@@ -3116,8 +3150,8 @@
+ Name[ru]=Хорватский
+ Name[se]=Kroatiagiella
+ Name[sl]=hrvaško
+-Name[sr]=Хрватски
+-Name[sr at latin]=Hrvatski
++Name[sr]=хрватски
++Name[sr at latin]=hrvatski
+ Name[sv]=Kroatiska
+ Name[ta]=குரொவேசியன்
+ Name[te]=క్రొయెషియన్
+@@ -3163,6 +3197,7 @@
+ Name[kn]=ಮೇಲಿನ ಸೋರ್ಬಿಯನ್
+ Name[ko]=고지대 소르비아어
+ Name[lb]=Uewersorbesch
++Name[lv]=Augšvendu
+ Name[mk]=Јужно лужички
+ Name[nb]=Øvresorbisk
+ Name[nds]=Böversorbsch
+@@ -3177,8 +3212,8 @@
+ Name[ru]=Верхнелужицкий
+ Name[se]=Bajil Sorbiagiella
+ Name[sl]=zgornjesorbijsko
+-Name[sr]=Горње лужичко српски
+-Name[sr at latin]=Gornje lužičko srpski
++Name[sr]=горњолужичкосрпски
++Name[sr at latin]=gornjolužičkosrpski
+ Name[sv]=Högsorbiska
+ Name[ta]=அப்பர் செர்பியன்
+ Name[te]=అప్పర్ సొర్బియన్
+@@ -3236,6 +3271,7 @@
+ Name[ne]=हङ्गेरियन
+ Name[nl]=Hongaars
+ Name[nn]=Ungarsk
++Name[oc]=Ongrés
+ Name[pa]=ਹੰਗਰੀਆਈ
+ Name[pl]=Węgierski
+ Name[pt]=Húngaro
+@@ -3244,8 +3280,8 @@
+ Name[ru]=Венгерский
+ Name[se]=Ungárgiella
+ Name[sl]=madžarsko
+-Name[sr]=Мађарски
+-Name[sr at latin]=Mađarski
++Name[sr]=мађарски
++Name[sr at latin]=mađarski
+ Name[sv]=Ungerska
+ Name[ta]=ஹங்கேரியன்
+ Name[te]=హంగెరియన్
+@@ -3312,8 +3348,8 @@
+ Name[ru]=Армянский
+ Name[se]=Armeniagiella
+ Name[sl]=armensko
+-Name[sr]=Јерменски
+-Name[sr at latin]=Jermenski
++Name[sr]=јерменски
++Name[sr at latin]=jermenski
+ Name[sv]=Armenska
+ Name[ta]=ஆர்மீனியன்
+ Name[te]=అర్మెనియన్
+@@ -3346,14 +3382,15 @@
+ Name[ko]=헤레로어
+ Name[mk]=Хереро
+ Name[ne]=हेरेरो
++Name[oc]=Ebrèu
+ Name[pa]=ਹੀਰੀਰੋ
+ Name[pt_BR]=Hereró
+ Name[ro]=Hereră
+ Name[ru]=Эреро
+ Name[se]=Hererogiella
+ Name[sl]=herero
+-Name[sr]=Херерски
+-Name[sr at latin]=Hererski
++Name[sr]=хереро
++Name[sr at latin]=herero
+ Name[ta]=ஹெர்ரோ
+ Name[te]=హెరెరో
+ Name[tg]=Херэро
+@@ -3382,12 +3419,13 @@
+ Name[lv]=Interlingva
+ Name[mk]=Интерлингва
+ Name[ne]=इन्टरलिङ्गुवा
++Name[oc]=Interlinguà
+ Name[pa]=ਇੰਟਰਲੀਗੂਆ
+ Name[pt_BR]=Interlíngua
+ Name[ru]=Интерлингва
+ Name[sl]=interlingua
+-Name[sr]=Интерлингвански
+-Name[sr at latin]=Interlingvanski
++Name[sr]=интерлингва
++Name[sr at latin]=interlingva
+ Name[ta]=இன்டெர்லிங்குவா
+ Name[te]=ఇంటర్ లింగువా
+ Name[tg]=Забони миёнрав
+@@ -3452,8 +3490,8 @@
+ Name[ru]=Индонезийский
+ Name[se]=Indonesiagiella
+ Name[sl]=indonezijsko
+-Name[sr]=Индонезијски
+-Name[sr at latin]=Indonezijski
++Name[sr]=индонезијски
++Name[sr at latin]=indonezijski
+ Name[sv]=Indonesiska
+ Name[ta]=இந்தோனீசியன்
+ Name[te]=ఇన్డొనెషియన్
+@@ -3492,8 +3530,8 @@
+ Name[ne]=इन्टरलिङ्गुवा
+ Name[pa]=ਇੰਟਰਈਨੂਗੂਈ
+ Name[sl]=interlingue
+-Name[sr]=Интерлингвијски
+-Name[sr at latin]=Interlingvijski
++Name[sr]=интерлингве
++Name[sr at latin]=interlingve
+ Name[sv]=Interlingua
+ Name[ta]=இன்டெர்லிங்கு
+ Name[te]=ఇంటర్ లింగె
+@@ -3531,8 +3569,8 @@
+ Name[ru]=Инупиак
+ Name[se]=Inupiaqgiella
+ Name[sl]=inupiaq
+-Name[sr]=Инупиакски
+-Name[sr at latin]=Inupiakski
++Name[sr]=инупијак
++Name[sr at latin]=inupijak
+ Name[ta]=இனுபியாக்
+ Name[te]=ఇనుపియాక్
+ Name[tg]=Инупиакӣ
+@@ -3563,8 +3601,8 @@
+ Name[ru]=Идо
+ Name[se]=Idogiella
+ Name[sl]=ido
+-Name[sr]=Идоски
+-Name[sr at latin]=Idoski
++Name[sr]=идо
++Name[sr at latin]=ido
+ Name[ta]=ஈடோ
+ Name[te]=ఇడొ
+ Name[tg]=Идо
+@@ -3619,6 +3657,7 @@
+ Name[ne]=आइसल्यान्डिक
+ Name[nl]=IJslands
+ Name[nn]=Islandsk
++Name[oc]=Islandés
+ Name[pa]=ਆਇਸਲੈਂਡ
+ Name[pl]=Islandzki
+ Name[pt]=Islandês
+@@ -3627,8 +3666,8 @@
+ Name[ru]=Исландский
+ Name[se]=Islánddagiella
+ Name[sl]=islandsko
+-Name[sr]=Исландски
+-Name[sr at latin]=Islandski
++Name[sr]=исландски
++Name[sr at latin]=islandski
+ Name[sv]=Isländska
+ Name[ta]=ஐஸ்லாந்திக்
+ Name[te]=ఐస్ లేండిక్
+@@ -3695,8 +3734,8 @@
+ Name[ru]=Итальянский
+ Name[se]=Itáliagiella
+ Name[sl]=italijansko
+-Name[sr]=Италијански
+-Name[sr at latin]=Italijanski
++Name[sr]=италијански
++Name[sr at latin]=italijanski
+ Name[sv]=Italienska
+ Name[ta]=இத்தாலியன்
+ Name[te]=ఇటాలియన్
+@@ -3732,8 +3771,8 @@
+ Name[ru]=Инуктитут
+ Name[se]=Inuhkagiella
+ Name[sl]=inuktitut
+-Name[sr]=Инуктитутски
+-Name[sr at latin]=Inuktitutski
++Name[sr]=инуктитут
++Name[sr at latin]=inuktitut
+ Name[ta]=இனுக்டிடுட்
+ Name[te]=ఇనుక్తిటుట్
+ Name[tg]=Инуктитут
+@@ -3789,6 +3828,7 @@
+ Name[ne]=जापानी
+ Name[nl]=Japans
+ Name[nn]=Japansk
++Name[oc]=Japonés
+ Name[pa]=ਜਾਪਾਨੀ
+ Name[pl]=Japoński
+ Name[pt]=Japonês
+@@ -3797,8 +3837,8 @@
+ Name[ru]=Японский
+ Name[se]=Jáhpangiella
+ Name[sl]=japonsko
+-Name[sr]=Јапански
+-Name[sr at latin]=Japanski
++Name[sr]=јапански
++Name[sr at latin]=japanski
+ Name[sv]=Japanska
+ Name[ta]=ஜப்பானியம்
+ Name[te]=జపనీస్
+@@ -3856,6 +3896,7 @@
+ Name[ne]=जाभानिज
+ Name[nl]=Javanees
+ Name[nn]=Javanesisk
++Name[oc]=Javanés
+ Name[pa]=ਜਾਵਾਨੀਆਈ
+ Name[pl]=Jawański
+ Name[pt]=Javanês
+@@ -3864,8 +3905,8 @@
+ Name[ru]=Яванский
+ Name[se]=Jávagiella
+ Name[sl]=javansko
+-Name[sr]=Јавански
+-Name[sr at latin]=Javanski
++Name[sr]=јавански
++Name[sr at latin]=javanski
+ Name[sv]=Javanska
+ Name[ta]=ஜாவானீஸ்
+ Name[te]=జావానీస్
+@@ -3931,8 +3972,8 @@
+ Name[ru]=Грузинский
+ Name[se]=Grusiagiella
+ Name[sl]=gruzijsko
+-Name[sr]=Грузијски
+-Name[sr at latin]=Gruzijski
++Name[sr]=грузијски
++Name[sr at latin]=gruzijski
+ Name[sv]=Georgiska
+ Name[ta]=ஜார்ஜியன்
+ Name[te]=జార్జియన్
+@@ -3970,8 +4011,8 @@
+ Name[ru]=Кикую
+ Name[se]=Kikujugiella
+ Name[sl]=kikuyu
+-Name[sr]=Кикујски
+-Name[sr at latin]=Kikujski
++Name[sr]=кикују
++Name[sr at latin]=kikuju
+ Name[ta]=கியுகு
+ Name[te]=కికుయు
+ Name[tg]=Кикуягӣ
+@@ -4025,8 +4066,8 @@
+ Name[ru]=Казахский
+ Name[se]=Kazakhagiella
+ Name[sl]=kazaško
+-Name[sr]=Казачки
+-Name[sr at latin]=Kazački
++Name[sr]=казачки
++Name[sr at latin]=kazački
+ Name[sv]=Kazakiska
+ Name[ta]=கசாக்
+ Name[te]=కజాఖ్
+@@ -4046,7 +4087,7 @@
+ Name[be]=Калаалісут
+ Name[bn_IN]=কালালিসুট
+ Name[fa]=کالالیسوت
+-Name[fi]=Grönlanti
++Name[fi]=Kalaallisut (grönlanti)
+ Name[ga]=Graonlainnis
+ Name[gl]=Groenlandés
+ Name[he]=קלאליסוט
+@@ -4064,8 +4105,8 @@
+ Name[ru]=Калаалисут
+ Name[se]=Kalállisutgiella
+ Name[sl]=kalaallisut
+-Name[sr]=Калалисутски
+-Name[sr at latin]=Kalalisutski
++Name[sr]=калалисут
++Name[sr at latin]=kalalisut
+ Name[sv]=Grönländska
+ Name[ta]=கலாலிசுட்
+ Name[te]=కలాల్లిసుత్
+@@ -4109,8 +4150,8 @@
+ Name[ru]=Кхмерский
+ Name[se]=Khmeragiella
+ Name[sl]=kmersko
+-Name[sr]=Кмерски
+-Name[sr at latin]=Kmerski
++Name[sr]=кмерски
++Name[sr at latin]=kmerski
+ Name[sv]=Kambodjanska
+ Name[ta]=கெமர்
+ Name[te]=ఖ్మెర్
+@@ -4141,14 +4182,15 @@
+ Name[ko]=칸나다어
+ Name[mk]=Канада
+ Name[ne]=कन्नडा
++Name[oc]=Kannadà
+ Name[pa]=ਕਾਨਡਾ
+ Name[pt_BR]=Canará
+ Name[ro]=Kanada
+ Name[ru]=Каннада
+ Name[se]=Kannadagiella
+ Name[sl]=kannada
+-Name[sr]=Канадски
+-Name[sr at latin]=Kanadski
++Name[sr]=канадски
++Name[sr at latin]=kanadski
+ Name[sv]=Kanaresiska
+ Name[ta]=கன்னடம்
+ Name[te]=కన్నడ
+@@ -4205,6 +4247,7 @@
+ Name[ne]=कोरियाली
+ Name[nl]=Koreaans
+ Name[nn]=Koreansk
++Name[oc]=Corean
+ Name[pa]=ਕੋਰੀਆਈ
+ Name[pl]=Koreański
+ Name[pt]=Coreano
+@@ -4213,8 +4256,8 @@
+ Name[ru]=Корейский
+ Name[se]=Koreagiella
+ Name[sl]=korejsko
+-Name[sr]=Корејски
+-Name[sr at latin]=Korejski
++Name[sr]=корејски
++Name[sr at latin]=korejski
+ Name[sv]=Koreanska
+ Name[ta]=கொரியன்
+ Name[te]=కొరియన్
+@@ -4269,8 +4312,8 @@
+ Name[ru]=Кашмирский
+ Name[se]=Kašmirgiella
+ Name[sl]=kašmirsko
+-Name[sr]=Кашмирски
+-Name[sr at latin]=Kašmirski
++Name[sr]=кашмирски
++Name[sr at latin]=kašmirski
+ Name[ta]=காஷ்மீரி
+ Name[te]=కష్మీరీ
+ Name[tg]=Кашмирӣ
+@@ -4325,6 +4368,7 @@
+ Name[ne]=कुर्दिश
+ Name[nl]=Koerdisch
+ Name[nn]=Kurdisk
++Name[oc]=Curd
+ Name[pa]=ਕੁਰਦ
+ Name[pl]=Kurdyjski
+ Name[pt]=Curdo
+@@ -4333,8 +4377,8 @@
+ Name[ru]=Курдский
+ Name[se]=Kurdigiella
+ Name[sl]=kurdsko
+-Name[sr]=Курдски
+-Name[sr at latin]=Kurdski
++Name[sr]=курдски
++Name[sr at latin]=kurdski
+ Name[sv]=Kurdiska
+ Name[ta]=குர்திஷ்
+ Name[te]=కుర్దిష్
+@@ -4373,8 +4417,8 @@
+ Name[ru]=Коми
+ Name[se]=Komigiella
+ Name[sl]=komi
+-Name[sr]=Комски
+-Name[sr at latin]=Komski
++Name[sr]=коми
++Name[sr at latin]=komi
+ Name[ta]=கோமி
+ Name[te]=కోమి
+ Name[tg]=Коми
+@@ -4423,6 +4467,7 @@
+ Name[nds]=Kornisch
+ Name[ne]=कर्निस
+ Name[nn]=Kornisk
++Name[oc]=Cornic
+ Name[pa]=ਕੋਰਨਿਸ਼
+ Name[pl]=Kornwalijski
+ Name[pt]=Cornualho
+@@ -4431,8 +4476,8 @@
+ Name[ru]=Корнуольский
+ Name[se]=Kornagiella
+ Name[sl]=cornish
+-Name[sr]=Корнски
+-Name[sr at latin]=Kornski
++Name[sr]=корниш
++Name[sr at latin]=korniš
+ Name[sv]=Korniska
+ Name[ta]=கோர்னிஷ்
+ Name[te]=కొర్నిష్
+@@ -4493,8 +4538,8 @@
+ Name[ru]=Киргизский
+ Name[se]=Kirgisiagiella
+ Name[sl]=kirgizijsko
+-Name[sr]=Киргиски
+-Name[sr at latin]=Kirgiski
++Name[sr]=киргиз
++Name[sr at latin]=kirgiz
+ Name[sv]=Kirghiziska
+ Name[ta]=கிர்கிஸ்
+ Name[te]=కిర్ఘిజ్
+@@ -4540,6 +4585,7 @@
+ Name[ko]=라틴어
+ Name[lb]=Latäin
+ Name[lt]=Lotynų
++Name[lv]=Latīņu
+ Name[mk]=Латински
+ Name[nds]=Latiensch
+ Name[ne]=ल्याटिन
+@@ -4552,8 +4598,8 @@
+ Name[ru]=Латинский
+ Name[se]=Láhtengiella
+ Name[sl]=latinsko
+-Name[sr]=Латински
+-Name[sr at latin]=Latinski
++Name[sr]=латински
++Name[sr at latin]=latinski
+ Name[ta]=இலத்தீன்
+ Name[te]=లాటిన్
+ Name[tg]=Лотинӣ
+@@ -4607,6 +4653,7 @@
+ Name[ne]=लग्जेम्बर्गिस
+ Name[nl]=Letzenburgs
+ Name[nn]=Luxembourgsk
++Name[oc]=Luxemborgés
+ Name[pa]=ਲਕਸ਼ਬਰਗਸ਼
+ Name[pl]=Luksemburski
+ Name[pt]=Luxemburguês
+@@ -4615,8 +4662,8 @@
+ Name[ru]=Люксембургский
+ Name[se]=Luksenburggagiella
+ Name[sl]=luksemburško
+-Name[sr]=Луксембуршки
+-Name[sr at latin]=Luksemburški
++Name[sr]=луксембуршки
++Name[sr at latin]=luksemburški
+ Name[sv]=Luxemburgiska
+ Name[ta]=லக்சம்போர்கிஷ்
+ Name[te]=లక్సెంబర్గిష్
+@@ -4645,7 +4692,7 @@
+ Name[es]=Limburgano
+ Name[et]=Limburgi
+ Name[fa]=لیمبرگان
+-Name[fi]=Limburgi
++Name[fi]=Limburg
+ Name[fr]=Limbourgeois
+ Name[fy]=Limburgsk
+ Name[ga]=Liombuirgis
+@@ -4674,8 +4721,8 @@
+ Name[ru]=Лимбуржский
+ Name[se]=Limburggagiella
+ Name[sl]=limburgan
+-Name[sr]=Лимбуршки
+-Name[sr at latin]=Limburški
++Name[sr]=лимбуршки
++Name[sr at latin]=limburški
+ Name[sv]=Limburgiska
+ Name[ta]=லக்சம்பேர்க்
+ Name[te]=లింబర్గన్
+@@ -4704,13 +4751,14 @@
+ Name[kn]=ಲಿಂಗಾಲ
+ Name[mk]=Лингала
+ Name[ne]=लिङ्गाला
++Name[oc]=Lingalà
+ Name[pa]=ਲੀਨਗਾਲਾ
+ Name[ro]=Lingală
+ Name[ru]=Лингала
+ Name[se]=Lingalagiella
+ Name[sl]=lingala
+-Name[sr]=Лингалски
+-Name[sr at latin]=Lingalski
++Name[sr]=лингала
++Name[sr at latin]=lingala
+ Name[ta]=லிங்காலா
+ Name[te]=లింగాలా
+ Name[tg]=Лингалӣ
+@@ -4746,13 +4794,15 @@
+ Name[mk]=Лао
+ Name[nds]=Laootsch
+ Name[ne]=लाओ
++Name[oc]=Laossian
+ Name[pa]=ਲਿਓ
+ Name[pl]=Laotański
+ Name[pt_BR]=Laociano
+ Name[ru]=Лао
+ Name[se]=Laogiella
+ Name[sl]=laoško
+-Name[sr]=Лао
++Name[sr]=лаоћански
++Name[sr at latin]=laoćanski
+ Name[sv]=Laotiska
+ Name[ta]=லாவோ
+ Name[te]=లావో
+@@ -4810,6 +4860,7 @@
+ Name[ne]=लिथुनियाली
+ Name[nl]=Litouws
+ Name[nn]=Litauisk
++Name[oc]=Lituanian
+ Name[pa]=ਲੀਥੂਨੀਆਨ
+ Name[pl]=Litewski
+ Name[pt]=Lituano
+@@ -4818,8 +4869,8 @@
+ Name[ru]=Литовский
+ Name[se]=Lietuvagiella
+ Name[sl]=litvansko
+-Name[sr]=Литвански
+-Name[sr at latin]=Litvanski
++Name[sr]=литвански
++Name[sr at latin]=litvanski
+ Name[sv]=Litauiska
+ Name[ta]=லிதுவேனியன்
+ Name[te]=లితువెనియన్
+@@ -4877,6 +4928,7 @@
+ Name[ne]=लाट्भियन
+ Name[nl]=Lets
+ Name[nn]=Latvisk
++Name[oc]=Leton
+ Name[pa]=ਲਾਟਵੀਨ
+ Name[pl]=Łotewski
+ Name[pt]=Letão
+@@ -4885,8 +4937,8 @@
+ Name[ru]=Латышский
+ Name[se]=Látviagiella
+ Name[sl]=latvijsko
+-Name[sr]=Латвијски
+-Name[sr at latin]=Latvijski
++Name[sr]=латвијски
++Name[sr at latin]=latvijski
+ Name[sv]=Lettiska
+ Name[ta]=இலட்வியன்
+ Name[te]=లాటివ్యన్
+@@ -4917,7 +4969,7 @@
+ Name[et]=Malagassi
+ Name[eu]=Madagaskarera
+ Name[fa]=مالاگازی
+-Name[fi]=Malagasi
++Name[fi]=Malagassi
+ Name[fr]=Malgache
+ Name[fy]=Malagasysk
+ Name[ga]=Malagásais
+@@ -4946,8 +4998,8 @@
+ Name[ru]=Мальгашский
+ Name[se]=Malagasigiella
+ Name[sl]=malagaško
+-Name[sr]=Малагаски
+-Name[sr at latin]=Malagaski
++Name[sr]=малагаси
++Name[sr at latin]=malagasi
+ Name[sv]=Malagassiska
+ Name[ta]=மலகாசி
+ Name[te]=మలగాసి
+@@ -5010,8 +5062,8 @@
+ Name[ru]=Маршалльский
+ Name[se]=Marshallagiella
+ Name[sl]=maršalsko
+-Name[sr]=Маршалески
+-Name[sr at latin]=Maršaleski
++Name[sr]=маршалески
++Name[sr at latin]=maršaleski
+ Name[sv]=Marshall
+ Name[ta]=மார்ஷலீஸ்
+ Name[te]=మార్షలీస్
+@@ -5051,14 +5103,15 @@
+ Name[lv]=Maoru
+ Name[mk]=Маорски
+ Name[ne]=माओरी
++Name[oc]=Maòri
+ Name[pa]=ਮਾਓਰੀ
+ Name[pl]=Maoryjski
+ Name[ro]=Maură
+ Name[ru]=Маори
+ Name[se]=Maoragiella
+ Name[sl]=maorsko
+-Name[sr]=Маорски
+-Name[sr at latin]=Maorski
++Name[sr]=маорски
++Name[sr at latin]=maorski
+ Name[sv]=Maoriska
+ Name[ta]=மாவோரி
+ Name[te]=మావొరి
+@@ -5124,8 +5177,8 @@
+ Name[ru]=Македонский
+ Name[se]=Makedoniagiella
+ Name[sl]=makedonsko
+-Name[sr]=Македонски
+-Name[sr at latin]=Makedonski
++Name[sr]=македонски
++Name[sr at latin]=makedonski
+ Name[sv]=Makedonska
+ Name[ta]=மாசிடோனியன்
+ Name[te]=మసిడొనియన్
+@@ -5174,8 +5227,8 @@
+ Name[ru]=Малайялам
+ Name[se]=Malajalamagiella
+ Name[sl]=malayalam
+-Name[sr]=Малајамски
+-Name[sr at latin]=Malajamski
++Name[sr]=малајалам
++Name[sr at latin]=malajalam
+ Name[ta]=மலையாளம்
+ Name[te]=మలయాళం
+ Name[tg]=Малаямӣ
+@@ -5239,8 +5292,8 @@
+ Name[ru]=Монгольский
+ Name[se]=Mongoliagiella
+ Name[sl]=mongolsko
+-Name[sr]=Монголски
+-Name[sr at latin]=Mongolski
++Name[sr]=монголски
++Name[sr at latin]=mongolski
+ Name[sv]=Mongoliska
+ Name[ta]=மொங்கோலியன்
+ Name[te]=మంగోలియన్
+@@ -5298,6 +5351,7 @@
+ Name[ne]=मोल्डाभियन
+ Name[nl]=Moldavisch
+ Name[nn]=Moldovsk
++Name[oc]=Croacia
+ Name[pa]=ਮੋਲਡਾਵੀਆਈ
+ Name[pl]=Mołdawski
+ Name[pt]=Moldavo
+@@ -5306,8 +5360,8 @@
+ Name[ru]=Молдавский
+ Name[se]=Moldáviagiella
+ Name[sl]=moldavsko
+-Name[sr]=Молдавски
+-Name[sr at latin]=Moldavski
++Name[sr]=молдавски
++Name[sr at latin]=moldavski
+ Name[sv]=Moldaviska
+ Name[ta]=மோல்டோவியன்
+ Name[te]=మొల్దావియన్
+@@ -5346,14 +5400,15 @@
+ Name[lv]=Maratu
+ Name[mk]=Марати
+ Name[ne]=मराठी
++Name[oc]=Marati
+ Name[pa]=ਮਰਾਠੀ
+ Name[pl]=Marathi (Hinduski)
+ Name[pt_BR]=Marata
+ Name[ru]=Марати
+ Name[se]=Marathagiella
+ Name[sl]=marathi
+-Name[sr]=Маратски
+-Name[sr at latin]=Maratski
++Name[sr]=марати
++Name[sr at latin]=marati
+ Name[ta]=மராத்தி
+ Name[te]=మరాఠి
+ Name[tg]=Маравӣ
+@@ -5403,6 +5458,7 @@
+ Name[nds]=Malaiisch
+ Name[ne]=मले
+ Name[nn]=Malayisk
++Name[oc]=Malés
+ Name[pa]=ਮਾਲਿਆ
+ Name[pl]=Malajski
+ Name[pt]=Malaio
+@@ -5411,8 +5467,8 @@
+ Name[ru]=Малайский
+ Name[se]=Malaigiella
+ Name[sl]=malajsko
+-Name[sr]=Малајски
+-Name[sr at latin]=Malajski
++Name[sr]=малајски
++Name[sr at latin]=malajski
+ Name[sv]=Malajiska
+ Name[ta]=மலாய்
+ Name[te]=మలయ
+@@ -5467,6 +5523,7 @@
+ Name[ne]=माल्तिस
+ Name[nl]=Maltees
+ Name[nn]=Maltesisk
++Name[oc]=Maltés
+ Name[pa]=ਮਾਲਟੀਸੀ
+ Name[pl]=Maltański
+ Name[pt]=Maltês
+@@ -5475,8 +5532,8 @@
+ Name[ru]=Мальтийский
+ Name[se]=Maltagiella
+ Name[sl]=maltežansko
+-Name[sr]=Малтешки
+-Name[sr at latin]=Malteški
++Name[sr]=малтешки
++Name[sr at latin]=malteški
+ Name[sv]=Maltesiska
+ Name[ta]=மால்டீசிய
+ Name[te]=మాల్టీస్
+@@ -5534,6 +5591,7 @@
+ Name[ne]=बर्मेली
+ Name[nl]=Burmees
+ Name[nn]=Burmesisk
++Name[oc]=Birman
+ Name[pa]=ਬੁਰਮੀਸੀ
+ Name[pl]=Birmański
+ Name[pt]=Birmanês
+@@ -5542,8 +5600,8 @@
+ Name[ru]=Бирманский
+ Name[se]=Burmagiella
+ Name[sl]=burmansko
+-Name[sr]=Бурмански
+-Name[sr at latin]=Burmanski
++Name[sr]=бурмански
++Name[sr at latin]=burmanski
+ Name[sv]=Burmesiska
+ Name[ta]=பர்மிய
+ Name[te]=బర్మీస్
+@@ -5587,8 +5645,8 @@
+ Name[ru]=Науру
+ Name[se]=Naurugiella
+ Name[sl]=nauru
+-Name[sr]=Наурски
+-Name[sr at latin]=Naurski
++Name[sr]=науру
++Name[sr at latin]=nauru
+ Name[ta]=நவுரு
+ Name[te]=నౌరు
+ Name[tg]=Науру
+@@ -5619,7 +5677,7 @@
+ Name[et]=Norra bokmål
+ Name[eu]=Norvegiera (Bokmål)
+ Name[fa]=نروژی بوکمال
+-Name[fi]=Norja (bokmål)
++Name[fi]=Norjan bokmål
+ Name[fr]=Norvégien Bokmaal
+ Name[fy]=Noarsk, Bokmål
+ Name[ga]=Ioruais (Bokmål)
+@@ -5651,8 +5709,8 @@
+ Name[ru]=Норвежский (литературный)
+ Name[se]=Girjedárogiella
+ Name[sl]=norveško (bokmaal)
+-Name[sr]=Норвешки (Бокмалски)
+-Name[sr at latin]=Norveški (Bokmalski)
++Name[sr]=норвешки (бокмал)
++Name[sr at latin]=norveški (bokmal)
+ Name[sv]=Norskt bokmål
+ Name[ta]=நார்வீஜியன் பொக்மால்
+ Name[te]=నార్వీజియన్ బోక్మాల్
+@@ -5684,7 +5742,7 @@
+ Name[et]=Põhja-ndebele
+ Name[eu]=Ndebelera (iparraldekoa)
+ Name[fa]=اندبل شمالی
+-Name[fi]=Ndebele, Pohjoinen
++Name[fi]=Pohjois-ndebele
+ Name[fr]=Ndébélé du Nord
+ Name[fy]=Ndebele, Noard
+ Name[ga]=Ndebele Thuaidh
+@@ -5715,8 +5773,8 @@
+ Name[ru]=Сев. Ндебеле
+ Name[se]=Ndebelegiella, davvi
+ Name[sl]=ndebele, severno
+-Name[sr]=Ндебеле, Северни
+-Name[sr at latin]=Ndebele, Severni
++Name[sr]=ндебеле, северни
++Name[sr at latin]=ndebele, severni
+ Name[sv]=Nordndebele
+ Name[ta]=டெபெலே, வட
+ Name[te]=నెబేలె, ఉత్తర
+@@ -5767,7 +5825,7 @@
+ Name[lt]=Žemutinių saksonų
+ Name[lv]=Lejas sakšu
+ Name[mk]=Долносаксонски
+-Name[nb]=Lavgermansk
++Name[nb]=Nedersaksisk
+ Name[nds]=Plattdüütsch
+ Name[ne]=लो साक्सोन
+ Name[nl]=Nedersaksisch
+@@ -5780,15 +5838,15 @@
+ Name[ru]=Нижнесаксонский
+ Name[se]=Vuolil Sáksonagiella
+ Name[sl]=spodnjesaško
+-Name[sr]=Доњи саксонски
+-Name[sr at latin]=Donji saksonski
++Name[sr]=доњосаксонски
++Name[sr at latin]=donjosaksonski
+ Name[sv]=Lågsaxiska
+ Name[ta]=லோ சாக்ஸான்
+ Name[te]=లో సాక్సన్
+ Name[tg]=Саксон
+ Name[th]=ภาษาเยอรมัน ระดับล่าง
+ Name[tr]=Aşağı Sakson
+-Name[uk]=Ніжньосаксонська
++Name[uk]=Нижньосаксонська
+ Name[uz]=Паст Саксонча
+ Name[vi]=Xác-xọnh thấp
+ Name[wa]=Bas sacson
+@@ -5837,8 +5895,8 @@
+ Name[ru]=Непальский
+ Name[se]=Nepálagiella
+ Name[sl]=nepalsko
+-Name[sr]=Непалски
+-Name[sr at latin]=Nepalski
++Name[sr]=непалски
++Name[sr at latin]=nepalski
+ Name[ta]=நேபாளி
+ Name[te]=నేపాలి
+ Name[tg]=Непалӣ
+@@ -5873,7 +5931,8 @@
+ Name[ru]=Ндонга
+ Name[se]=Ndongagiella
+ Name[sl]=ndonga
+-Name[sr]=Ндонга
++Name[sr]=ндонга
++Name[sr at latin]=ndonga
+ Name[ta]=டொங்கா
+ Name[te]=డొంగా
+ Name[tg]=Ндонга
+@@ -5929,6 +5988,7 @@
+ Name[ne]=डच
+ Name[nl]=Nederlands
+ Name[nn]=Nederlandsk
++Name[oc]=Olandés
+ Name[pa]=ਡੱਚ
+ Name[pl]=Holenderski
+ Name[pt]=Holandês
+@@ -5937,8 +5997,8 @@
+ Name[ru]=Голландский
+ Name[se]=Hollánddagiella
+ Name[sl]=nizozemsko
+-Name[sr]=Холандски
+-Name[sr at latin]=Holandski
++Name[sr]=холандски
++Name[sr at latin]=holandski
+ Name[sv]=Holländska
+ Name[ta]=டச்சு
+ Name[te]=డచ్
+@@ -5973,7 +6033,7 @@
+ Name[et]=Norra nynorsk
+ Name[eu]=Norvegiera (Nynorsk)
+ Name[fa]=نرس جدید نروژی
+-Name[fi]=Norja (nynorsk)
++Name[fi]=Norjan nynorsk
+ Name[fr]=Norvégien Nynorsk
+ Name[fy]=Noarsk, Nynorsk
+ Name[ga]=Ioruais (Nynorsk)
+@@ -5997,6 +6057,7 @@
+ Name[ne]=नर्वेली नाइनोर्सक
+ Name[nl]=Noors, Nynorsk
+ Name[nn]=Norsk nynorsk
++Name[oc]=Nòrvegian (Nynorsk)
+ Name[pa]=ਨੋਰਵਿਗੀਆਨ ਨਯਾਨੋਰਸਕ
+ Name[pl]=Norweski Nynorsk
+ Name[pt]=Norueguês Nynorsk
+@@ -6005,8 +6066,8 @@
+ Name[ru]=Норвежский (нинорский)
+ Name[se]=Ođđadárogiella
+ Name[sl]=norveško (nyorsk)
+-Name[sr]=Норвешки (Ниноршки)
+-Name[sr at latin]=Norveški (Ninorški)
++Name[sr]=норвешки (нинорск)
++Name[sr at latin]=norveški (ninorsk)
+ Name[sv]=Nynorska
+ Name[ta]=நார்வீஜியன் (நையோர்ஸ்க்)
+ Name[te]=నార్వీజియన్ న్యోర్స్క్
+@@ -6039,7 +6100,7 @@
+ Name[et]=Lõuna-ndebele
+ Name[eu]=Ndebelera (hegoaldekoa)
+ Name[fa]=اندبل جنوبی
+-Name[fi]=Ndebele, Etelä
++Name[fi]=Etelä-ndebele
+ Name[fr]=Ndébélé du Sud
+ Name[fy]=Ndebele, Súd
+ Name[ga]=Ndebele Theas
+@@ -6070,8 +6131,8 @@
+ Name[ru]=Юж. Ндебеле
+ Name[se]=Ndebelegiella, lulli
+ Name[sl]=ndebele, južno
+-Name[sr]=Ндебеле, Јужни
+-Name[sr at latin]=Ndebele, Južni
++Name[sr]=ндебеле, јужни
++Name[sr at latin]=ndebele, južni
+ Name[sv]=Sydndebele
+ Name[ta]=டெபெலே, தென்
+ Name[te]=నెబేలె, దక్షిణ
+@@ -6137,8 +6198,8 @@
+ Name[ru]=Северное Сото
+ Name[se]=Davvi-sothogiella
+ Name[sl]=severni sotho
+-Name[sr]=Северни сото
+-Name[sr at latin]=Severni soto
++Name[sr]=сото, северни
++Name[sr at latin]=soto, severni
+ Name[sv]=Nordsotho
+ Name[ta]=நார்தன் சோத்தோ
+ Name[te]=ఉత్తర సొతొ
+@@ -6159,7 +6220,6 @@
+ Name[eo]=Navaha
+ Name[et]=Navaho
+ Name[fa]=ناواجو
+-Name[fi]=Navaho
+ Name[fr]=Navaho
+ Name[ga]=Navachóis
+ Name[gl]=Navaxo
+@@ -6176,8 +6236,8 @@
+ Name[ru]=Навахо
+ Name[se]=Naváhogiella
+ Name[sl]=navajo
+-Name[sr]=Навахо
+-Name[sr at latin]=Navaho
++Name[sr]=навахо
++Name[sr at latin]=navaho
+ Name[sv]=Navaho
+ Name[ta]=நவாஜோ
+ Name[te]=నవాజొ
+@@ -6218,8 +6278,8 @@
+ Name[ru]=Чичева
+ Name[se]=Chichevagiella
+ Name[sl]=chichewa
+-Name[sr]=Чичевски
+-Name[sr at latin]=Čičevski
++Name[sr]=чичева
++Name[sr at latin]=čičeva
+ Name[sv]=Chewa
+ Name[ta]=சிச்செவா
+ Name[te]=చిచెవా
+@@ -6277,8 +6337,8 @@
+ Name[ru]=Французский (диалект Occitan)
+ Name[se]=Oksitánagiella
+ Name[sl]=očitansko
+-Name[sr]=Оцитански
+-Name[sr at latin]=Ocitanski
++Name[sr]=оцитански
++Name[sr at latin]=ocitanski
+ Name[sv]=Occitanska
+ Name[ta]=ஒக்சிட்டான்
+ Name[te]=ఒస్సిటాన్
+@@ -6314,8 +6374,8 @@
+ Name[ru]=Оромо
+ Name[se]=Oromogiella
+ Name[sl]=oromo
+-Name[sr]=Оромски
+-Name[sr at latin]=Oromski
++Name[sr]=оромо
++Name[sr at latin]=oromo
+ Name[ta]=ஒரோமோ
+ Name[te]=ఒరొమొ
+ Name[tg]=Оромо
+@@ -6348,14 +6408,15 @@
+ Name[lb]=Orija
+ Name[mk]=Орија
+ Name[ne]=ओरिया
++Name[oc]=Oriyà
+ Name[pa]=ਉੜੀਆ
+ Name[pt_BR]=Oriá
+ Name[ro]=Oriană
+ Name[ru]=Ория
+ Name[se]=Orijagiella
+ Name[sl]=oriya
+-Name[sr]=Оријски
+-Name[sr at latin]=Orijski
++Name[sr]=оријски
++Name[sr at latin]=orijski
+ Name[ta]=ஒரியா
+ Name[te]=ఒరియా
+ Name[tg]=Ориёӣ
+@@ -6414,8 +6475,8 @@
+ Name[ru]=Осетинский
+ Name[se]=Ossetiagiella
+ Name[sl]=osetijsko
+-Name[sr]=Осетски
+-Name[sr at latin]=Osetski
++Name[sr]=осетски
++Name[sr at latin]=osetski
+ Name[sv]=Ossetsiska
+ Name[ta]=ஒசெட்டியன்
+ Name[te]=ఒస్సెషియన్
+@@ -6434,11 +6495,13 @@
+ Name[ar]=بنجابية
+ Name[be]=Панджабі
+ Name[bn_IN]=পাঞ্জাবি
++Name[br]=Pendjabieg
+ Name[ca]=Panjabi
+ Name[cs]=Pandžábský
+ Name[de]=Pandschabi
+ Name[eo]=Panĝaba
+ Name[es]=Punjabi
++Name[et]=Pandžabi
+ Name[fa]=پنجابی/پنجابی
+ Name[ga]=Painseáibis
+ Name[he]=פנג'אבית
+@@ -6448,14 +6511,18 @@
+ Name[km]=ពូនយ៉ាប៊ី
+ Name[kn]=ಪಂಜಾಬಿ
+ Name[ko]=펀자브어
++Name[lv]=Pandžabu
+ Name[nds]=Pandschaabsch
+ Name[ne]=पन्जाबी/पन्जाबी
+ Name[nl]=Panjabi
+ Name[pa]=ਪੰਜਾਬੀ
+ Name[pt]=Panjabi/Punjabi
+ Name[sl]=pandžabsko
++Name[sr]=панџаби/панџаби
++Name[sr at latin]=pandžabi/pandžabi
+ Name[te]=పంజాబి
+ Name[th]=ภาษาปัญจาบี/ปัญจาบ
++Name[uk]=Панджабська
+ Name[vi]=Pan-gia-bi
+ Name[wa]=Pundjabi
+ Name[x-test]=xxPunjabi/Panjabixx
+@@ -6470,6 +6537,7 @@
+ Name[es]=Palí
+ Name[et]=Paali
+ Name[fa]=پالی
++Name[fi]=Paali
+ Name[ga]=Páilis
+ Name[he]=פאלי
+ Name[ja]=パーリ語
+@@ -6482,8 +6550,8 @@
+ Name[ru]=Пали
+ Name[se]=Páligiella
+ Name[sl]=pali
+-Name[sr]=Палијски
+-Name[sr at latin]=Palijski
++Name[sr]=пали
++Name[sr at latin]=pali
+ Name[ta]=பாலி
+ Name[te]=పాళి
+ Name[tg]=Пали
+@@ -6539,6 +6607,7 @@
+ Name[ne]=पोलीस
+ Name[nl]=Pools
+ Name[nn]=Polsk
++Name[oc]=Polonés
+ Name[pa]=ਪੋਲੈਂਡੀ
+ Name[pl]=Polski
+ Name[pt]=Polaco
+@@ -6547,8 +6616,8 @@
+ Name[ru]=Польский
+ Name[se]=Polskkagiella
+ Name[sl]=poljsko
+-Name[sr]=Пољски
+-Name[sr at latin]=Poljski
++Name[sr]=пољски
++Name[sr at latin]=poljski
+ Name[sv]=Polska
+ Name[ta]=போலிஷ்
+ Name[te]=పోలిష్
+@@ -6597,8 +6666,8 @@
+ Name[ru]=Пуштунский
+ Name[se]=Puštugiella
+ Name[sl]=pushto
+-Name[sr]=Пушто
+-Name[sr at latin]=Pušto
++Name[sr]=пушто
++Name[sr at latin]=pušto
+ Name[sv]=Pashto
+ Name[ta]=பாஷ்டுன்
+ Name[te]=పుష్తొ
+@@ -6656,6 +6725,7 @@
+ Name[ne]=पोर्चुगाली
+ Name[nl]=Portugees
+ Name[nn]=Portugisisk
++Name[oc]=Portugués
+ Name[pa]=ਪੁਰਤਗਾਲੀ
+ Name[pl]=Portugalski
+ Name[pt]=Português
+@@ -6664,8 +6734,8 @@
+ Name[ru]=Португальский
+ Name[se]=Portugálagiella
+ Name[sl]=portugalsko
+-Name[sr]=Португалски
+-Name[sr at latin]=Portugalski
++Name[sr]=португалски
++Name[sr at latin]=portugalski
+ Name[sv]=Portugisiska
+ Name[ta]=போர்த்துக்கீசிய
+ Name[te]=పోర్ట్యుగీస్
+@@ -6698,7 +6768,7 @@
+ Name[et]=Brasiilia portugali
+ Name[eu]=Portugesa (Brasilgoa)
+ Name[fa]=پرتغالی برزیلی
+-Name[fi]=Brasilian Portugali
++Name[fi]=Brasilianportugali
+ Name[fr]=Portugais Brésilien
+ Name[fy]=Braziliaansk Portugeesk
+ Name[ga]=Portaingéilis na Brasaíle
+@@ -6731,8 +6801,8 @@
+ Name[ru]=Португальский (Бразилия)
+ Name[se]=Brasilialaš portugálagiella
+ Name[sl]=brazilska portugalščina
+-Name[sr]=Бразилско португалски
+-Name[sr at latin]=Brazilsko portugalski
++Name[sr]=бразилски португалски
++Name[sr at latin]=brazilski portugalski
+ Name[sv]=Brasiliansk portugisiska
+ Name[ta]=பிரேஸிலிய போர்த்துக்கீசிய
+ Name[te]=బ్రాజిలియన్ పోర్ట్యుగీస్
+@@ -6776,8 +6846,8 @@
+ Name[ru]=Кечуа
+ Name[se]=Keččuagiella
+ Name[sl]=quechua
+-Name[sr]=Квечва
+-Name[sr at latin]=Kvečva
++Name[sr]=квечва
++Name[sr at latin]=kvečva
+ Name[ta]=குவெச்சா
+ Name[te]=క్వెచువా
+ Name[tg]=Квечуа
+@@ -6813,7 +6883,8 @@
+ Name[ru]=Рунди
+ Name[se]=Rundigiella
+ Name[sl]=rundi
+-Name[sr]=Рунди
++Name[sr]=рунди
++Name[sr at latin]=rundi
+ Name[ta]=ருண்டி
+ Name[te]=రుండి
+ Name[tg]=Рунди
+@@ -6878,8 +6949,8 @@
+ Name[ru]=Румынский
+ Name[se]=Romániagiella
+ Name[sl]=romunsko
+-Name[sr]=Румунски
+-Name[sr at latin]=Rumunski
++Name[sr]=румунски
++Name[sr at latin]=rumunski
+ Name[sv]=Rumänska
+ Name[ta]=உருமேனியன்
+ Name[te]=రొమేనియన్
+@@ -6925,6 +6996,7 @@
+ Name[kn]=ರೋಮನೀ
+ Name[ko]=로마니어
+ Name[lb]=Romani
++Name[lv]=Čigānu
+ Name[mk]=Ромски
+ Name[ms]=Romania
+ Name[nb]=Romani
+@@ -6940,8 +7012,8 @@
+ Name[ru]=Цыганский
+ Name[se]=Románigiella
+ Name[sl]=romsko
+-Name[sr]=Ромски
+-Name[sr at latin]=Romski
++Name[sr]=ромски
++Name[sr at latin]=romski
+ Name[sv]=Romanés
+ Name[te]=రొమని
+ Name[tg]=Романӣ
+@@ -6996,6 +7068,7 @@
+ Name[ne]=रसियाली
+ Name[nl]=Russisch
+ Name[nn]=Russisk
++Name[oc]=Rus
+ Name[pa]=ਰੂਸੀ
+ Name[pl]=Rosyjski
+ Name[pt]=Russo
+@@ -7004,8 +7077,8 @@
+ Name[ru]=Русский
+ Name[se]=Ruoššagiella
+ Name[sl]=rusko
+-Name[sr]=Руски
+-Name[sr at latin]=Ruski
++Name[sr]=руски
++Name[sr at latin]=ruski
+ Name[sv]=Ryska
+ Name[ta]=இரஷியன்
+ Name[te]=రషియన్
+@@ -7043,13 +7116,14 @@
+ Name[lb]=Ruanda-Sprooch
+ Name[mk]=Кинјарванда
+ Name[ne]=किन्यरवान्डा
++Name[oc]=Kinyarwandà
+ Name[pa]=ਕਿਨਯਾਰਵਾਡਾਂ
+ Name[ro]=Chiniaruandeză
+ Name[ru]=Киньяруанда
+ Name[se]=Kinyarwandagiella
+ Name[sl]=kinyarwanda
+-Name[sr]=Кинијарвандаски
+-Name[sr at latin]=Kinijarvandaski
++Name[sr]=кинијарванда
++Name[sr at latin]=kinijarvanda
+ Name[sv]=Rwanda
+ Name[ta]=கின்யார்வாண்டா
+ Name[te]=కిన్న్యార్వాండా
+@@ -7100,7 +7174,8 @@
+ Name[ru]=Санскрит
+ Name[se]=Sanskrihtagiella
+ Name[sl]=sanskrt
+-Name[sr]=Санскрит
++Name[sr]=санскрит
++Name[sr at latin]=sanskrit
+ Name[ta]=சமஸ்கிருதம்
+ Name[te]=సంస్క్రుతం
+ Name[tg]=Санскрит
+@@ -7154,6 +7229,7 @@
+ Name[ne]=सर्दिनियन
+ Name[nl]=Sardinisch
+ Name[nn]=Sardiniansk
++Name[oc]=Sard
+ Name[pa]=ਸਾਰਡੀਨੀਆਈ
+ Name[pl]=Sardyński
+ Name[pt]=Sardenho
+@@ -7162,8 +7238,8 @@
+ Name[ru]=Сардинийский
+ Name[se]=Sardiniagiella
+ Name[sl]=sardinsko
+-Name[sr]=Сардинијски
+-Name[sr at latin]=Sardinijski
++Name[sr]=сардинијски
++Name[sr at latin]=sardinijski
+ Name[sv]=Sardiska
+ Name[ta]=சார்டீனியன்
+ Name[te]=సార్డినియన్
+@@ -7203,8 +7279,8 @@
+ Name[ru]=Синдхи
+ Name[se]=Sindhigiella
+ Name[sl]=sindijsko
+-Name[sr]=Синдиски
+-Name[sr at latin]=Sindiski
++Name[sr]=синди
++Name[sr at latin]=sindi
+ Name[ta]=சிந்தி
+ Name[te]=సింధి
+ Name[tg]=Синдхӣ
+@@ -7232,7 +7308,7 @@
+ Name[de]=Nördliches Sami
+ Name[eo]=Norda Samea
+ Name[es]=Samí del norte
+-Name[et]=Põhja-saami
++Name[et]=Põhjasaami
+ Name[eu]=Samia (iparrekoa)
+ Name[fa]=سامی شمالی
+ Name[fi]=Pohjoissaame
+@@ -7252,7 +7328,7 @@
+ Name[ko]=북부 사미어
+ Name[lb]=Nördlecht Sami
+ Name[lt]=Šiaurės Sami
+-Name[lv]=Ziemeļu Sāmu
++Name[lv]=Ziemeļu sāmu
+ Name[mk]=Северен Сами
+ Name[ms]=Sami Utara
+ Name[nb]=Nordsamisk
+@@ -7268,8 +7344,8 @@
+ Name[ru]=Северное Саами
+ Name[se]=Davvisámegiella
+ Name[sl]=severno sami
+-Name[sr]=Северносамски
+-Name[sr at latin]=Severnosamski
++Name[sr]=северни сами
++Name[sr at latin]=severni sami
+ Name[sv]=Samiska
+ Name[ta]=நார்தன் சாமி
+ Name[te]=ఉత్తర సమి
+@@ -7307,7 +7383,8 @@
+ Name[ru]=Санго
+ Name[se]=Sangogiella
+ Name[sl]=sango
+-Name[sr]=Санго
++Name[sr]=санго
++Name[sr at latin]=sango
+ Name[ta]=சாங்கோ
+ Name[te]=సాంగొ
+ Name[tg]=Санго
+@@ -7359,6 +7436,7 @@
+ Name[ne]=सिङ्हाली
+ Name[nl]=Sinhalees
+ Name[nn]=Singalesisk
++Name[oc]=Vinyes
+ Name[pa]=ਸਿਹਾਲਾ
+ Name[pl]=Syngaleski
+ Name[pt_BR]=Cingalês
+@@ -7366,8 +7444,8 @@
+ Name[ru]=Сингальский
+ Name[se]=Singalesagiella
+ Name[sl]=sinhalese
+-Name[sr]=Синхалски
+-Name[sr at latin]=Sinhalski
++Name[sr]=синхалски
++Name[sr at latin]=sinhalski
+ Name[sv]=Singalesiska
+ Name[ta]=சிங்களம்
+ Name[te]=సింహలీస్
+@@ -7424,6 +7502,7 @@
+ Name[ne]=स्लोभाकी
+ Name[nl]=Slowaaks
+ Name[nn]=Slovakisk
++Name[oc]=Eslovac
+ Name[pa]=ਸਲੋਵਾਕ
+ Name[pl]=Słowacki
+ Name[pt]=Eslovaco
+@@ -7432,8 +7511,8 @@
+ Name[ru]=Словацкий
+ Name[se]=Slovákagiella
+ Name[sl]=slovaško
+-Name[sr]=Словачки
+-Name[sr at latin]=Slovački
++Name[sr]=словачки
++Name[sr at latin]=slovački
+ Name[sv]=Slovakiska
+ Name[ta]=சுலோவாக்
+ Name[te]=స్లొవాక్
+@@ -7493,6 +7572,7 @@
+ Name[ne]=स्लोभेनियन
+ Name[nl]=Sloweens
+ Name[nn]=Slovensk
++Name[oc]=Eslovèn
+ Name[pa]=ਸਲੋਵੀਨੀਆਈ
+ Name[pl]=Słoweński
+ Name[pt]=Esloveno
+@@ -7501,8 +7581,8 @@
+ Name[ru]=Словенский
+ Name[se]=Slovenagiella
+ Name[sl]=slovensko
+-Name[sr]=Словеначки
+-Name[sr at latin]=Slovenački
++Name[sr]=словеначки
++Name[sr at latin]=slovenački
+ Name[sv]=Slovenska
+ Name[ta]=சுலோவீனியன்
+ Name[te]=స్లొవేనియన్
+@@ -7564,8 +7644,8 @@
+ Name[ru]=Самоа
+ Name[se]=Samoagiella
+ Name[sl]=samojsko
+-Name[sr]=Самоански
+-Name[sr at latin]=Samoanski
++Name[sr]=самоански
++Name[sr at latin]=samoanski
+ Name[sv]=Samoanska
+ Name[ta]=சமோவன்
+ Name[te]=సమొవన్
+@@ -7586,7 +7666,7 @@
+ Name[bn_IN]=শোনা
+ Name[eo]=Ŝona
+ Name[fa]=شوها
+-Name[fi]=šona
++Name[fi]=Šona
+ Name[ga]=Seoinis
+ Name[he]=שונה
+ Name[hu]=Sona
+@@ -7598,14 +7678,15 @@
+ Name[mk]=Шона
+ Name[nds]=Schona
+ Name[ne]=शोना
++Name[oc]=XChat
+ Name[pa]=ਸ਼ੋਨਾ
+ Name[pt_BR]=Chona
+ Name[ro]=Şonă
+ Name[ru]=Схона
+ Name[se]=Šonagiella
+ Name[sl]=shona
+-Name[sr]=Шонски
+-Name[sr at latin]=Šonski
++Name[sr]=шона
++Name[sr at latin]=šona
+ Name[ta]=ஷோனா
+ Name[te]=షొనా
+ Name[tg]=Шонӣ
+@@ -7659,8 +7740,8 @@
+ Name[ru]=Сомалийский
+ Name[se]=Somálagiella
+ Name[sl]=somalsko
+-Name[sr]=Сомалијски
+-Name[sr at latin]=Somalijski
++Name[sr]=сомалијски
++Name[sr at latin]=somalijski
+ Name[ta]=சோமாலி
+ Name[te]=సొమాలి
+ Name[tg]=Сомалӣ
+@@ -7725,8 +7806,8 @@
+ Name[ru]=Албанский
+ Name[se]=Albániagiella
+ Name[sl]=albansko
+-Name[sr]=Албански
+-Name[sr at latin]=Albanski
++Name[sr]=албански
++Name[sr at latin]=albanski
+ Name[sv]=Albanska
+ Name[ta]=அல்பேனியன்
+ Name[te]=అల్బేనియన్
+@@ -7792,8 +7873,8 @@
+ Name[ru]=Сербский
+ Name[se]=Serbiagiella
+ Name[sl]=srbsko
+-Name[sr]=Српски
+-Name[sr at latin]=Srpski
++Name[sr]=српски
++Name[sr at latin]=srpski
+ Name[sv]=Serbiska
+ Name[ta]=செர்பியன்
+ Name[te]=సెర్బియన్
+@@ -7826,7 +7907,7 @@
+ Name[et]=Serbia (ladina)
+ Name[eu]=Serbiera (Latina)
+ Name[fa]=صربستانی
+-Name[fi]=Serbian latina
++Name[fi]=Serbia (latinanalainen)
+ Name[fr]=Serbe Latin
+ Name[fy]=Servysk Latijnsk
+ Name[ga]=Seirbis (aibítir Laidineach)
+@@ -7859,8 +7940,8 @@
+ Name[ru]=Сербский латинницей
+ Name[se]=Serbialaš latiidnagiella
+ Name[sl]=srbsko latinsko
+-Name[sr]=Српски латинични
+-Name[sr at latin]=Srpski latinični
++Name[sr]=српски (латиница)
++Name[sr at latin]=srpski (latinica)
+ Name[sv]=Latinsk serbiska
+ Name[te]=సెర్బియన్ లాటిన్
+ Name[tg]=Лотини Сербиявӣ
+@@ -7897,8 +7978,8 @@
+ Name[ru]=Свати
+ Name[se]=Svatigiella
+ Name[sl]=swati
+-Name[sr]=Свати
+-Name[sr at latin]=Svati
++Name[sr]=свати
++Name[sr at latin]=svati
+ Name[sv]=Swazi
+ Name[ta]=சுவாதி
+ Name[te]=స్వాతి
+@@ -7931,7 +8012,7 @@
+ Name[et]=Lõuna-sotho
+ Name[eu]=Sothoera (egoaldekoa)
+ Name[fa]=سوتوی جنوبی
+-Name[fi]=Sotho
++Name[fi]=Eteläsotho
+ Name[fr]=Sotho du Sud
+ Name[fy]=Sotho, Súd
+ Name[ga]=Sótó Theas
+@@ -7963,8 +8044,8 @@
+ Name[ru]=Юж. Сото
+ Name[se]=Sothogiella, lulli
+ Name[sl]=sotho, južni
+-Name[sr]=Сото, јужни
+-Name[sr at latin]=Soto, južni
++Name[sr]=сото, јужни
++Name[sr at latin]=soto, južni
+ Name[sv]=Sydsotho
+ Name[ta]=சோத்தோ, தென்
+ Name[te]=సోతొ, దక్షిణ
+@@ -8025,8 +8106,8 @@
+ Name[ru]=Суданский
+ Name[se]=Sundanesagiella
+ Name[sl]=sudansko
+-Name[sr]=Сундански
+-Name[sr at latin]=Sundanski
++Name[sr]=сундански
++Name[sr at latin]=sundanski
+ Name[sv]=Sundanesiska
+ Name[ta]=சூடானீஸ்
+ Name[te]=సన్దనీస్
+@@ -8083,6 +8164,7 @@
+ Name[ne]=स्विडेनी
+ Name[nl]=Zweeds
+ Name[nn]=Svensk
++Name[oc]=Suedés
+ Name[pa]=ਸਵੀਡਿਸ਼
+ Name[pl]=Szwedzki
+ Name[pt]=Sueco
+@@ -8091,8 +8173,8 @@
+ Name[ru]=Шведский
+ Name[se]=Ruoŧagiella
+ Name[sl]=švedsko
+-Name[sr]=Шведски
+-Name[sr at latin]=Švedski
++Name[sr]=шведски
++Name[sr at latin]=švedski
+ Name[sv]=Svenska
+ Name[ta]=சுவீடிஷ்
+ Name[te]=స్వీడిష్
+@@ -8140,8 +8222,8 @@
+ Name[ru]=Суахили
+ Name[se]=Svahilagiella
+ Name[sl]=svahili
+-Name[sr]=Свахили
+-Name[sr at latin]=Svahili
++Name[sr]=свахили
++Name[sr at latin]=svahili
+ Name[ta]=ஸ்வாஹிலி
+ Name[te]=స్వాహిలి
+ Name[tg]=Свахили
+@@ -8165,11 +8247,11 @@
+ Name[cs]=Tamilský
+ Name[csb]=Tamilsczi
+ Name[da]=Tamilsk
++Name[de]=Tamilisch
+ Name[eo]=Tamila
+ Name[et]=Tamili
+ Name[eu]=Tamilera
+ Name[fa]=تامیل
+-Name[fi]=Tamili
+ Name[fr]=Tamoul
+ Name[ga]=Tamailis
+ Name[he]=טמילית
+@@ -8193,8 +8275,8 @@
+ Name[ru]=Тамильский
+ Name[se]=Tamilgiella
+ Name[sl]=tamilsko
+-Name[sr]=Тамилски
+-Name[sr at latin]=Tamilski
++Name[sr]=тамилски
++Name[sr at latin]=tamilski
+ Name[ta]=தமிழ்
+ Name[te]=తమిళం
+ Name[tg]=Тамилӣ
+@@ -8232,8 +8314,8 @@
+ Name[ru]=Телугу
+ Name[se]=Telugugiella
+ Name[sl]=telugu
+-Name[sr]=Телугски
+-Name[sr at latin]=Telugski
++Name[sr]=телугу
++Name[sr at latin]=telugu
+ Name[ta]=தெலுங்கு
+ Name[te]=తెలుగు
+ Name[tg]=Телугуягӣ
+@@ -8294,8 +8376,8 @@
+ Name[ru]=Таджикский
+ Name[se]=Tažihkagiella
+ Name[sl]=tadžiško
+-Name[sr]=Таџикистански
+-Name[sr at latin]=Tadžikistanski
++Name[sr]=таџикистански
++Name[sr at latin]=tadžikistanski
+ Name[sv]=Tadzjikiska
+ Name[ta]=தஜிக்
+ Name[te]=తాజిక్
+@@ -8320,6 +8402,7 @@
+ Name[cs]=Thajský
+ Name[csb]=Tajsczi
+ Name[da]=Thailandsk
++Name[de]=Thailändische Schrift
+ Name[el]=Ταϊλανδικά
+ Name[eo]=Taja
+ Name[es]=Tailandés
+@@ -8345,6 +8428,7 @@
+ Name[ne]=थाई
+ Name[nl]=Thais
+ Name[nn]=Thailandsk
++Name[oc]=Tailandés
+ Name[pa]=ਥਾਈ
+ Name[pl]=Tajski
+ Name[pt]=Tailandês
+@@ -8353,8 +8437,8 @@
+ Name[ru]=Тайский
+ Name[se]=Thaigiella
+ Name[sl]=tajsko
+-Name[sr]=Тајландски
+-Name[sr at latin]=Tajlandski
++Name[sr]=тајландски
++Name[sr at latin]=tajlandski
+ Name[sv]=Thailändska
+ Name[ta]=தாய்
+ Name[te]=థాయి
+@@ -8399,8 +8483,8 @@
+ Name[ru]=Тигринья
+ Name[se]=Tigrinjágiella
+ Name[sl]=tigrinya
+-Name[sr]=Тигрински
+-Name[sr at latin]=Tigrinski
++Name[sr]=тигрињи
++Name[sr at latin]=tigrinji
+ Name[sv]=Tigrinja
+ Name[ta]=திகிரின்யா
+ Name[te]=టిగ్రిన్యా
+@@ -8461,8 +8545,8 @@
+ Name[ru]=Туркменский
+ Name[se]=Turkmenagiella
+ Name[sl]=turkmensko
+-Name[sr]=Туркменистански
+-Name[sr at latin]=Turkmenistanski
++Name[sr]=туркменистански
++Name[sr at latin]=turkmenistanski
+ Name[sv]=Turkmenska
+ Name[ta]=துருக்மென்
+ Name[te]=తుర్క్మెన్
+@@ -8486,7 +8570,6 @@
+ Name[et]=Tsvana
+ Name[eu]=Tswanera
+ Name[fa]=تی سوانا
+-Name[fi]=Tšwana
+ Name[fy]=Tswanaansk
+ Name[ga]=Suáinis
+ Name[he]=צוואנה
+@@ -8505,8 +8588,8 @@
+ Name[ru]=Тсвана
+ Name[se]=Tswanagiella
+ Name[sl]=tswana
+-Name[sr]=Цвана
+-Name[sr at latin]=Cvana
++Name[sr]=цвана
++Name[sr at latin]=cvana
+ Name[ta]=ஸ்வானா
+ Name[te]=స్వానా
+ Name[tg]=Сванавӣ
+@@ -8541,13 +8624,15 @@
+ Name[mk]=Тонга
+ Name[ne]=टोङ्गा
+ Name[nn]=Tongansk
++Name[oc]=Tònga
+ Name[pa]=ਤੋਂਗਾ
+ Name[pt_BR]=Tonganês
+ Name[ro]=Tongă
+ Name[ru]=Тонга
+ Name[se]=Tongagiella
+ Name[sl]=tongaško
+-Name[sr]=Тонга
++Name[sr]=тонга
++Name[sr at latin]=tonga
+ Name[ta]=டோங்கா
+ Name[te]=టొన్గా
+ Name[tg]=Тонгаӣ
+@@ -8603,6 +8688,7 @@
+ Name[ne]=टर्किश
+ Name[nl]=Turks
+ Name[nn]=Tyrkisk
++Name[oc]=Turc
+ Name[pa]=ਤੁਰਕਿਸ਼
+ Name[pl]=Turecki
+ Name[pt]=Turco
+@@ -8611,8 +8697,8 @@
+ Name[ru]=Турецкий
+ Name[se]=Turkiijagiella
+ Name[sl]=turško
+-Name[sr]=Турски
+-Name[sr at latin]=Turski
++Name[sr]=турски
++Name[sr at latin]=turski
+ Name[sv]=Turkiska
+ Name[ta]=துருக்கிய
+ Name[te]=టర్కిష్
+@@ -8645,13 +8731,14 @@
+ Name[lb]=Tsonga-Sprooch
+ Name[mk]=Цонга
+ Name[ne]=सोङ्गा
++Name[oc]=Tsongà
+ Name[pa]=ਤਸੋਂਗਾ
+ Name[ro]=Tsongă
+ Name[ru]=Тсонга
+ Name[se]=Tsongagiella
+ Name[sl]=tsonga
+-Name[sr]=Цонга
+-Name[sr at latin]=Conga
++Name[sr]=цонга
++Name[sr at latin]=conga
+ Name[ta]=டிசோங்கா
+ Name[te]=సొంగా
+ Name[tg]=Сонгавӣ
+@@ -8703,8 +8790,8 @@
+ Name[ru]=Татарский
+ Name[se]=Tatáragiella
+ Name[sl]=tatarsko
+-Name[sr]=Татарски
+-Name[sr at latin]=Tatarski
++Name[sr]=татарски
++Name[sr at latin]=tatarski
+ Name[sv]=Tatariska
+ Name[ta]=டாடார்
+ Name[te]=తతర్
+@@ -8738,8 +8825,8 @@
+ Name[ru]=Тви
+ Name[se]=Twigiella
+ Name[sl]=twi
+-Name[sr]=Твиски
+-Name[sr at latin]=Tviski
++Name[sr]=тви
++Name[sr at latin]=tvi
+ Name[ta]=த்வீ
+ Name[te]=ట్వి
+ Name[tg]=Твиягӣ
+@@ -8792,6 +8879,7 @@
+ Name[ne]=ताहितियन
+ Name[nl]=Tahitiaans
+ Name[nn]=Tahitisk
++Name[oc]=Taician
+ Name[pa]=ਤਾਹੀਟੀਅਨ
+ Name[pl]=Tahitański
+ Name[pt]=Tahitiano
+@@ -8800,8 +8888,8 @@
+ Name[ru]=Таити
+ Name[se]=Tahitigiella
+ Name[sl]=tahitijsko
+-Name[sr]=Тахићански
+-Name[sr at latin]=Tahićanski
++Name[sr]=тахићански
++Name[sr at latin]=tahićanski
+ Name[sv]=Tahitiska
+ Name[ta]=தஹிடியன்
+ Name[te]=టహితియన్
+@@ -8850,8 +8938,8 @@
+ Name[ru]=Уйгурский
+ Name[se]=Uiguragiella
+ Name[sl]=ujgursko
+-Name[sr]=Ујгурски
+-Name[sr at latin]=Ujgurski
++Name[sr]=ујгур
++Name[sr at latin]=ujgur
+ Name[sv]=Uiguriska
+ Name[ta]=உயிகூர்
+ Name[te]=ఉఇఘర్
+@@ -8910,6 +8998,7 @@
+ Name[ne]=युक्रेनी
+ Name[nl]=Oekraïns
+ Name[nn]=Ukrainsk
++Name[oc]=Ucraïnian
+ Name[pa]=ਯੂਕਰੇਨ
+ Name[pl]=Ukraiński
+ Name[pt]=Ucraniano
+@@ -8918,8 +9007,8 @@
+ Name[ru]=Украинский
+ Name[se]=Ukrainagiella
+ Name[sl]=ukrajinsko
+-Name[sr]=Украјински
+-Name[sr at latin]=Ukrajinski
++Name[sr]=украјински
++Name[sr at latin]=ukrajinski
+ Name[sv]=Ukrainska
+ Name[ta]=உக்ரேனியன்
+ Name[te]=ఉక్రేనియన్
+@@ -8958,7 +9047,8 @@
+ Name[ru]=Урду
+ Name[se]=Urdugiella
+ Name[sl]=urdu
+-Name[sr]=Урду
++Name[sr]=урду
++Name[sr at latin]=urdu
+ Name[ta]=உருது
+ Name[te]=ఉర్దు
+ Name[tg]=Урду
+@@ -9017,8 +9107,8 @@
+ Name[ru]=Узбекский
+ Name[se]=Uzbehkagiella
+ Name[sl]=uzbeško
+-Name[sr]=Узбечки
+-Name[sr at latin]=Uzbečki
++Name[sr]=узбечки
++Name[sr at latin]=uzbečki
+ Name[sv]=Uzbekiska
+ Name[ta]=உஸ்பெக்
+ Name[te]=ఉజ్బెక్
+@@ -9049,11 +9139,13 @@
+ Name[ko]=벤다어
+ Name[mk]=Венда
+ Name[ne]=भेन्डा
++Name[oc]=Vendà
+ Name[pa]=ਵਾਂਡਾ
+ Name[ru]=Венда
+ Name[se]=Vendagiella
+ Name[sl]=venda
+-Name[sr]=Венда
++Name[sr]=венда
++Name[sr at latin]=venda
+ Name[ta]=வெண்டா
+ Name[te]=వెండా
+ Name[tg]=Вендаӣ
+@@ -9107,6 +9199,7 @@
+ Name[ne]=भियतनामी
+ Name[nl]=Vietnamees
+ Name[nn]=Vietnamesisk
++Name[oc]=Vietnamés
+ Name[pa]=ਵੀਅਤਨਾਮੀ
+ Name[pl]=Wietnamski
+ Name[pt]=Vietnamita
+@@ -9115,8 +9208,8 @@
+ Name[ru]=Вьетнамский
+ Name[se]=Vietnamagiella
+ Name[sl]=vietnamsko
+-Name[sr]=Вијетнамски
+-Name[sr at latin]=Vijetnamski
++Name[sr]=вијетнамски
++Name[sr at latin]=vijetnamski
+ Name[sv]=Vietnamesiska
+ Name[ta]=வியட்னாமிய
+ Name[te]=వియత్నామీస్
+@@ -9157,8 +9250,8 @@
+ Name[ru]=Волапюк
+ Name[se]=Volapükgiella
+ Name[sl]=volapük
+-Name[sr]=Волапикски
+-Name[sr at latin]=Volapikski
++Name[sr]=волапик
++Name[sr at latin]=volapik
+ Name[ta]=வொல்பாக்
+ Name[te]=వొలపుక్
+ Name[tg]=Волапёкӣ
+@@ -9207,6 +9300,7 @@
+ Name[ne]=वालोन
+ Name[nl]=Waals
+ Name[nn]=Vallonsk
++Name[oc]=Valon
+ Name[pa]=ਵਾਲੂਨ
+ Name[pl]=Waloński
+ Name[pt]=Valão
+@@ -9215,8 +9309,8 @@
+ Name[ru]=Валлонский
+ Name[se]=Vallonagiella
+ Name[sl]=walloonsko
+-Name[sr]=Валонски
+-Name[sr at latin]=Valonski
++Name[sr]=валонски
++Name[sr at latin]=valonski
+ Name[sv]=Vallonska
+ Name[ta]=வாலூன்
+ Name[te]=వాలూన్
+@@ -9259,8 +9353,8 @@
+ Name[ru]=Уолоф
+ Name[se]=Volofagiella
+ Name[sl]=wolof
+-Name[sr]=Волофски
+-Name[sr at latin]=Volofski
++Name[sr]=волоф
++Name[sr at latin]=volof
+ Name[ta]=வொலொஃப்
+ Name[te]=వొలొఫ్
+ Name[tg]=Волофӣ
+@@ -9289,19 +9383,20 @@
+ Name[km]=ឃូសា
+ Name[kn]=ಗ್ಝೋಸಾ
+ Name[ko]=크호사어
++Name[lv]=Khosu
+ Name[mk]=Ксоса
+ Name[ne]=होसा
+ Name[pa]=ਝੋਸਾ
+ Name[ru]=Кшоса
+ Name[se]=Xhosagiella
+ Name[sl]=xhosa
+-Name[sr]=Зоса
+-Name[sr at latin]=Zosa
++Name[sr]=кхоса
++Name[sr at latin]=khosa
+ Name[ta]=சோசா
+ Name[te]=క్జొసా
+ Name[tg]=Хоса
+ Name[th]=ภาษาโคซา
+-Name[uk]=Ксоза
++Name[uk]=Хоза
+ Name[uz]=Хҳоса
+ Name[vi]=Xô-xa
+ Name[wa]=Xhossa
+@@ -9352,8 +9447,8 @@
+ Name[ru]=Идиш
+ Name[se]=Jiddišgiella
+ Name[sl]=yiddish
+-Name[sr]=Јидијски
+-Name[sr at latin]=Jidijski
++Name[sr]=јидиш
++Name[sr at latin]=jidiš
+ Name[ta]=யிட்டிஷ்
+ Name[te]=యిడ్డిష్
+ Name[tg]=Йидишӣ
+@@ -9397,8 +9492,8 @@
+ Name[ru]=Йоруба
+ Name[se]=Jorubagiella
+ Name[sl]=yoruba
+-Name[sr]=Јорубски
+-Name[sr at latin]=Jorubski
++Name[sr]=јоруба
++Name[sr at latin]=joruba
+ Name[ta]=யொரூபா
+ Name[te]=యొరుబా
+ Name[tg]=Ёруба
+@@ -9432,8 +9527,8 @@
+ Name[ru]=Чжуанг
+ Name[se]=Zhuangagiella
+ Name[sl]=zhuang
+-Name[sr]=Цуанг
+-Name[sr at latin]=Cuang
++Name[sr]=жуанг
++Name[sr at latin]=žuang
+ Name[ta]=சுவாங்
+ Name[te]=జువాంగ్
+ Name[tg]=Жуанг
+@@ -9489,6 +9584,7 @@
+ Name[ne]=चिनियाँ
+ Name[nl]=Chinees
+ Name[nn]=Kinesisk
++Name[oc]=Chinés
+ Name[pa]=ਚੀਨੀ
+ Name[pl]=Chiński
+ Name[pt]=Chinês
+@@ -9497,8 +9593,8 @@
+ Name[ru]=Китайский
+ Name[se]=Kiinnágiella
+ Name[sl]=kitajsko
+-Name[sr]=Кинески
+-Name[sr at latin]=Kineski
++Name[sr]=кинески
++Name[sr at latin]=kineski
+ Name[sv]=Kinesiska
+ Name[ta]=சீனம்
+ Name[te]=చైనీస్
+@@ -9557,6 +9653,7 @@
+ Name[ne]=सरलीकृत चिनियाँ
+ Name[nl]=Chinees (Vereenvoudigd)
+ Name[nn]=Kinesisk (forenkla)
++Name[oc]=Chinés simplificat
+ Name[pa]=ਚੀਨੀ ਸਧਾਰਨ
+ Name[pl]=Chiński uproszczony
+ Name[pt]=Chinês Simplificado
+@@ -9565,8 +9662,8 @@
+ Name[ru]=Китайский (КНР)
+ Name[se]=Álkiduvvon kiinnágiella
+ Name[sl]=poenostavljeno kitajsko
+-Name[sr]=Поједностављени кинески
+-Name[sr at latin]=Pojednostavljeni kineski
++Name[sr]=кинески, поједностављени
++Name[sr at latin]=kineski, pojednostavljeni
+ Name[sv]=Förenklad kinesiska
+ Name[ta]=சீனம் சுலபமாக்கப்பட்டது
+ Name[te]=సరళికరించిన చైనీస్
+@@ -9598,7 +9695,7 @@
+ Name[et]=Hiina (Hong Kong)
+ Name[eu]=Txinera (Hong Kong)
+ Name[fa]=چینی)هنگ کنگ(
+-Name[fi]=Kiina (Hong Kong)
++Name[fi]=Kiina (Hongkong)
+ Name[fr]=Chinois (Hong Kong)
+ Name[fy]=Sjineesk (Hong Kong)
+ Name[ga]=Sínis (Hong Cong)
+@@ -9631,8 +9728,8 @@
+ Name[ru]=Китайский (Гонконг)
+ Name[se]=Kiinnágiella (Hong Kong)
+ Name[sl]=kitajsko (Hong Kong)
+-Name[sr]=Кинески (Хонгконг)
+-Name[sr at latin]=Kineski (Hongkong)
++Name[sr]=кинески (хонконшки)
++Name[sr at latin]=kineski (honkonški)
+ Name[sv]=Kinesiska (Hong Kong)
+ Name[te]=చైనీస్ (హాంగ్ కాంగ్)
+ Name[tg]=Хитоӣ (Гон-Конг)
+@@ -9687,6 +9784,7 @@
+ Name[ne]=चिनियाँ परम्परागत
+ Name[nl]=Chinees (Traditioneel)
+ Name[nn]=Kinesisk (tradisjonell)
++Name[oc]=Chinés tradicional
+ Name[pa]=ਚੀਨੀ ਮੂਲ
+ Name[pl]=Chiński tradycyjny
+ Name[pt]=Chinês Tradicional
+@@ -9695,8 +9793,8 @@
+ Name[ru]=Китайский (Тайвань)
+ Name[se]=Árbevirolaš kiinnágiella
+ Name[sl]=tradicionalno kitajsko
+-Name[sr]=Традиционални кинески
+-Name[sr at latin]=Tradicionalni kineski
++Name[sr]=кинески, традиционални
++Name[sr at latin]=kineski, tradicionalni
+ Name[sv]=Traditionell kinesiska
+ Name[ta]=சீனம் பழமையானது
+ Name[te]=సాంప్రదాయక చైనీస్
+@@ -9736,12 +9834,14 @@
+ Name[lv]=Zulusu
+ Name[mk]=Зулу
+ Name[ne]=जुलु
++Name[oc]=Zolo
+ Name[pa]=ਜ਼ੂਲੂ
+ Name[pl]=Zuluski
+ Name[ru]=Зулусский
+ Name[se]=Zulugiella
+ Name[sl]=zulu
+-Name[sr]=Зулу
++Name[sr]=зулу
++Name[sr at latin]=zulu
+ Name[ta]=ஜுலு
+ Name[te]=జూలు
+ Name[tg]=Зулу
+--- a/kdecore/io/kdebug.cpp
++++ b/kdecore/io/kdebug.cpp
+@@ -355,7 +355,7 @@
+                 return cache.find(0);
+             }
+ 
+-            config = new KConfig(QLatin1String("kdebugrc"), KConfig::CascadeConfig);
++            config = new KConfig(QLatin1String("kdebugrc"), KConfig::NoGlobals);
+             loadAreaNames();
+         }
+ 
+--- a/kdecore/util/conversion_check.h
++++ /dev/null
+@@ -1,119 +0,0 @@
+-/*
+-   This file is part of the KDE libraries
+-   Copyright (c) 2006 Thomas Braxton <brax108 at cox.net>
+-
+-   This library is free software; you can redistribute it and/or
+-   modify it under the terms of the GNU Library General Public
+-   License as published by the Free Software Foundation; either
+-   version 2 of the License, or (at your option) any later version.
+-
+-   This library is distributed in the hope that it will be useful,
+-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-   Library General Public License for more details.
+-
+-   You should have received a copy of the GNU Library General Public License
+-   along with this library; see the file COPYING.LIB.  If not, write to
+-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+-   Boston, MA 02110-1301, USA.
+-*/
+-
+-
+-#ifndef CONVERSION_CHECK_H
+-#define CONVERSION_CHECK_H
+-
+-#include <QtCore/QString>
+-#include <QtGui/QColor>
+-#include <QtGui/QFont>
+-#include <QtCore/QDate>
+-#include <QtCore/QPoint>
+-#include <QtCore/QSize>
+-#include <QtCore/QRect>
+-#include <kurl.h>
+-#include <QtCore/QVariant>
+-
+-namespace ConversionCheck {
+-
+-// used to distinguish between supported/unsupported types
+-struct supported { };
+-struct unsupported { };
+-
+-// traits type class to define support for constraints
+-template <typename T>
+-struct QVconvertible
+-{
+-  typedef unsupported toQString;
+-  typedef unsupported toQVariant;
+-};
+-
+-// constraint classes
+-template <typename T>
+-struct type_toQString
+-{
+-  void constraint() { supported x = y; }
+-  typename QVconvertible<T>::toQString y;
+-};
+-
+-template <typename T>
+-struct type_toQVariant
+-{
+-  void constraint() { supported x = y; }
+-  typename QVconvertible<T>::toQVariant y;
+-};
+-
+-
+-// check if T is convertible to QString thru QVariant
+-// if not supported can't be used in QList<T> functions
+-template <typename T>
+-inline void to_QString()
+-{
+-  void (type_toQString<T>::*x)() = &type_toQString<T>::constraint;
+-  Q_UNUSED(x);
+-}
+-
+-// check if T is convertible to QVariant & supported in readEntry/writeEntry
+-template <typename T>
+-inline void to_QVariant()
+-{
+-  void (type_toQVariant<T>::*x)() = &type_toQVariant<T>::constraint;
+-  Q_UNUSED(x);
+-}
+-
+-// define for all types handled in readEntry/writeEntry
+-// string_support - is supported by QVariant(type).toString(),
+-//                  can be used in QList<T> functions
+-// variant_support - has a QVariant constructor
+-#define QVConversions(type, string_support, variant_support) \
+-template <> struct QVconvertible<type> {\
+- typedef string_support toQString;\
+- typedef variant_support toQVariant;\
+-}
+-
+-// The only types needed here are the types handled in readEntry/writeEntry
+-// the default QVconvertible will take care of the rest.
+-QVConversions(bool, supported, supported);
+-QVConversions(int, supported, supported);
+-QVConversions(unsigned int, supported, supported);
+-QVConversions(long long, supported, supported);
+-QVConversions(unsigned long long, supported, supported);
+-QVConversions(double, supported, supported);
+-QVConversions(QString, supported, supported);
+-QVConversions(QColor, unsupported, supported);
+-QVConversions(QFont, supported, supported);
+-QVConversions(QDateTime, unsupported, supported);
+-QVConversions(QDate, unsupported, supported);
+-QVConversions(QSize, unsupported, supported);
+-QVConversions(QRect, unsupported, supported);
+-QVConversions(QPoint, unsupported, supported);
+-QVConversions(QSizeF, unsupported, supported);
+-QVConversions(QRectF, unsupported, supported);
+-QVConversions(QPointF, unsupported, supported);
+-QVConversions(QByteArray, supported, supported);
+-QVConversions(QStringList, unsupported, supported);
+-QVConversions(QVariantList, unsupported, supported);
+-QVConversions(KUrl, supported, supported);
+-QVConversions(KUrl::List, unsupported, supported);
+-}
+-
+-#endif
+-
+--- a/kdecore/util/kshell_win.cpp
++++ b/kdecore/util/kshell_win.cpp
+@@ -121,32 +121,68 @@
+     //not reached
+ }
+ 
+-QString KShell::quoteArg(const QString &arg)
++static QString quoteArg(const QString &arg)
+ {
+-    if (arg.isEmpty())
+-        return QString::fromLatin1("\"\"");
+-
+-    QString ret(arg);
+-    ret.replace(QLatin1String("\\\""), QLatin1String("\\\\\""));
+-    ret.replace(QLatin1Char('\"'), QLatin1String("\\\""));
+-
+-    for (int x = arg.length() - 1; x >= 0; --x) {
+-        if (isSpecialChar(arg[x].unicode())) {
+-
+-            ret.prepend(QLatin1Char('\"'));
+-
+-            if (ret.endsWith(QLatin1Char('\\'))) {
+-                ret.truncate(ret.length() - 1);
+-                ret.append(QLatin1String("\"\\"));
++    // Escape quotes, preceding backslashes are doubled. Surround with quotes.
++    // Note that cmd does not understand quote escapes in quoted strings,
++    // so the quoting needs to be "suspended".
++    const QLatin1Char bs('\\'), dq('\"');
++    QString ret;
++    bool inquote = false;
++    int bslashes = 0;
++    for (int p = 0; p < arg.length(); p++) {
++        if (arg[p] == bs) {
++            bslashes++;
++        } else if (arg[p] == dq) {
++            if (inquote) {
++                ret.append(dq);
++                inquote = false;
+             }
+-            else {
+-                ret.append(QLatin1Char('\"'));
++            for (; bslashes; bslashes--)
++                ret.append(QLatin1String("\\\\"));
++            ret.append(QLatin1String("\\^\""));
++        } else {
++            if (!inquote) {
++                ret.append(dq);
++                inquote = true;
+             }
+-
+-            break;
++            for (; bslashes; bslashes--)
++                ret.append(bs);
++            ret.append(arg[p]);
++        }
++    }
++    if (bslashes) {
++        // Ensure that we don't have directly trailing backslashes,
++        // so concatenating with another string won't cause surprises.
++        if (!inquote) {
++            ret.append(dq);
++            inquote = true;
+         }
++        for (; bslashes; bslashes--)
++            ret.append(QLatin1String("\\\\"));
+     }
++    if (inquote)
++        ret.append(dq);
++    return ret;
++}
++
++QString KShell::quoteArg(const QString &arg)
++{
++    if (arg.isEmpty())
++        return QString::fromLatin1("\"\"");
+ 
++    // Ensure that we don't have directly trailing backslashes,
++    // so concatenating with another string won't cause surprises.
++    if (arg.endsWith(QLatin1Char('\\')))
++        return ::quoteArg(arg);
++
++    for (int x = arg.length() - 1; x >= 0; --x)
++        if (isSpecialChar(arg[x].unicode()))
++            return ::quoteArg(arg);
++
++    // Escape quotes. Preceding backslashes are doubled.
++    QString ret(arg);
++    ret.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\^\""));
+     return ret;
+ }
+ 
+--- a/kdecore/util/klibloader.cpp
++++ b/kdecore/util/klibloader.cpp
+@@ -57,43 +57,9 @@
+ {
+ }
+ 
+-static inline QString makeLibName( const QString &libname )
+-{
+-    int pos = libname.lastIndexOf('/');
+-    if (pos < 0)
+-      pos = 0;
+-    if (libname.indexOf('.', pos) < 0) {
+-        const char* const extList[] = { ".so", ".dylib", ".bundle", ".dll", ".sl" };
+-        for (uint i = 0; i < sizeof(extList) / sizeof(*extList); ++i) {
+-           if (QLibrary::isLibrary(libname + extList[i]))
+-               return libname + extList[i];
+-        }
+-    }
+-    return libname;
+-}
++extern QString makeLibName( const QString &libname );
+ 
+-static inline QString findLibraryInternal(const QString &name, const KComponentData &cData)
+-{
+-    QString libname = makeLibName( name );
+-
+-    // only look up the file if it is not an absolute filename
+-    // (mhk, 20000228)
+-    QString libfile;
+-    if (QDir::isRelativePath(libname)) {
+-      libfile = cData.dirs()->findResource("module", libname);
+-      if ( libfile.isEmpty() )
+-      {
+-        libfile = cData.dirs()->findResource("lib", libname);
+-#ifndef NDEBUG
+-        if ( !libfile.isEmpty() && libname.startsWith( "lib" ) ) // don't warn for kdeinit modules
+-          kDebug(150) << "library" << libname << "not found under 'module' but under 'lib'";
+-#endif
+-      }
+-    } else {
+-      libfile = libname;
+-    }
+-    return libfile;
+-}
++extern QString findLibraryInternal(const QString &name, const KComponentData &cData);
+ 
+ //static
+ QString KLibLoader::findLibrary(const QString &_name, const KComponentData &cData)
+@@ -135,6 +101,13 @@
+ 
+     KLibrary *lib = new KLibrary(_name);
+ 
++    // Klibrary search magic did work?
++    if (lib->fileName().isEmpty()) {
++        kLibLoaderPrivate->errorString = i18n("Library not found");
++        delete lib;
++        return 0;
++    }
++
+     lib->setLoadHints(hint);
+ 
+     lib->load();
+@@ -165,7 +138,13 @@
+     if ( !lib )
+         return 0;
+ 
+-    return lib->factory();
++    KPluginFactory* fac = lib->factory();
++    if ( !fac ) {
++        kLibLoaderPrivate->errorString = errorString( ErrNoFactory );
++        return 0;
++    }
++
++    return fac;
+ }
+ 
+ QString KLibLoader::errorString( int componentLoadingError )
+--- a/kdecore/util/klibrary.cpp
++++ b/kdecore/util/klibrary.cpp
+@@ -20,55 +20,16 @@
+ #include "klibrary.h"
+ 
+ #include <QtCore/QDir>
++#include <QtCore/QPointer>
+ 
+ #include <kcomponentdata.h>
+ #include <kstandarddirs.h>
+ #include <kpluginfactory.h>
+ #include <kdebug.h>
+ 
+-static inline QString makeLibName( const QString &libname )
+-{
+-#ifdef Q_OS_WIN
+-    if (!libname.endsWith(".dll"))
+-        return libname + ".dll";
+-    return libname;
+-#else
+-    int pos = libname.lastIndexOf('/');
+-    if (pos < 0)
+-      pos = 0;
+-    if (libname.indexOf('.', pos) < 0) {
+-        const char* const extList[] = { ".so", ".dylib", ".bundle", ".sl" };
+-        for (uint i = 0; i < sizeof(extList) / sizeof(*extList); ++i) {
+-           if (QLibrary::isLibrary(libname + extList[i]))
+-               return libname + extList[i];
+-        }
+-    }
+-    return libname;
+-#endif
+-}
+-
+-static inline QString findLibraryInternal(const QString &name, const KComponentData &cData)
+-{
+-    QString libname = makeLibName( name );
++extern QString makeLibName( const QString &libname );
+ 
+-    // only look up the file if it is not an absolute filename
+-    // (mhk, 20000228)
+-    QString libfile;
+-    if (QDir::isRelativePath(libname)) {
+-      libfile = cData.dirs()->findResource("module", libname);
+-      if ( libfile.isEmpty() )
+-      {
+-        libfile = cData.dirs()->findResource("lib", libname);
+-#ifndef NDEBUG
+-        if ( !libfile.isEmpty() && libname.startsWith( "lib" ) ) // don't warn for kdeinit modules
+-          kDebug(150) << "library" << libname << "not found under 'module' but under 'lib'";
+-#endif
+-      }
+-    } else {
+-      libfile = libname;
+-    }
+-    return libfile;
+-}
++extern QString findLibraryInternal(const QString &name, const KComponentData &cData);
+ 
+ //static
+ QString findLibrary(const QString &name, const KComponentData &cData)
+@@ -122,6 +83,9 @@
+ {
+ }
+ 
++typedef QHash<QString, QPointer<KPluginFactory> > FactoryHash;
++K_GLOBAL_STATIC(FactoryHash, s_createdKde3Factories)
++
+ static KPluginFactory* kde3Factory(KLibrary *lib, const QByteArray &factoryname)
+ {
+     QByteArray symname = "init_";
+@@ -131,6 +95,14 @@
+         symname += QFileInfo(lib->fileName()).fileName().split(".").first().toLatin1();
+     }
+ 
++    const QString hashKey = lib->fileName() + QLatin1Char(':') + QString::fromAscii(symname);
++    if (s_createdKde3Factories->contains(hashKey)) {
++        KPluginFactory *factory = s_createdKde3Factories->value(hashKey);
++        if (factory) {
++            return factory;
++        }
++    }
++
+     typedef KPluginFactory* (*t_func)();
+     t_func func = reinterpret_cast<t_func>(lib->resolveFunction( symname ));
+     if ( !func )
+@@ -147,6 +119,7 @@
+         kDebug(150) << "The library" << lib->fileName() << "does not offer a KDE compatible factory.";
+         return 0;
+     }
++    s_createdKde3Factories->insert(hashKey, factory);
+ 
+     return factory;
+ }
+--- a/kdecore/util/kshell.cpp
++++ b/kdecore/util/kshell.cpp
+@@ -46,6 +46,12 @@
+     return ret;
+ }
+ 
++#ifdef Q_OS_WIN
++# define ESCAPE '^'
++#else
++# define ESCAPE '\\'
++#endif
++
+ QString KShell::tildeExpand( const QString &fname )
+ {
+     if (fname.length() && fname[0] == QLatin1Char('~')) {
+@@ -56,7 +62,7 @@
+         if (!ret.isNull())
+             ret += fname.mid(pos);
+         return ret;
+-    } else if (fname.length() > 1 && fname[0] == QLatin1Char('\\') && fname[1] == QLatin1Char('~')) {
++    } else if (fname.length() > 1 && fname[0] == QLatin1Char(ESCAPE) && fname[1] == QLatin1Char('~')) {
+         return fname.mid(1);
+     }
+     return fname;
+--- a/kdecore/util/qtest_kde.h
++++ b/kdecore/util/qtest_kde.h
+@@ -78,6 +78,7 @@
+ { \
+     setenv("LC_ALL", "C", 1); \
+     setenv("KDEHOME", QFile::encodeName( QDir::homePath() + "/.kde-unit-test" ), 1); \
++    unsetenv("KDE_COLOR_DEBUG"); \
+     KAboutData aboutData( componentName, 0, ki18n("qttest"), "version" );  \
+     KDEMainFlags mainFlags = flags;                         \
+     KComponentData cData(&aboutData); \
+--- a/kdecore/util/kpluginloader.cpp
++++ b/kdecore/util/kpluginloader.cpp
+@@ -52,7 +52,7 @@
+     KLibrary *lib;
+ };
+ 
+-static inline QString makeLibName( const QString &libname )
++inline QString makeLibName( const QString &libname )
+ {
+ #ifdef Q_OS_WIN
+     if (!libname.endsWith(".dll"))
+@@ -73,7 +73,7 @@
+ #endif
+ }
+ 
+-static inline QString findLibraryInternal(const QString &name, const KComponentData &cData)
++inline QString findLibraryInternal(const QString &name, const KComponentData &cData)
+ {
+     QString libname = makeLibName(name);
+ 
+--- a/kdecore/util/kshell.h
++++ b/kdecore/util/kshell.h
+@@ -115,8 +115,9 @@
+ 
+     /**
+      * Performs tilde expansion on @p path. Interprets "~/path" and
+-     * "~user/path". If the path starts with "\~" (i.e., an escaped tilde),
+-     * the backslash is removed and the path is returned as is.
++     * "~user/path". If the path starts with an escaped tilde ("\~" on UNIX,
++     * "^~" on Windows), the escape char is removed and the path is returned
++     * as is.
+      *
+      * @param path the path to tilde-expand
+      * @return the expanded path
+--- a/knewstuff/knewstuff2/engine.cpp
++++ b/knewstuff/knewstuff2/engine.cpp
+@@ -46,6 +46,7 @@
+         setDxsPolicy(DxsEngine::DxsNever); // FIXME: until KIO/cDXS gets fixed!
+         m_entry = NULL;
+         m_modal = false;
++        m_parent = parent;
+     }
+ 
+     enum Command
+@@ -65,6 +66,7 @@
+     KNS::Entry *m_entry;
+     KNS::Provider::List m_providers;
+     bool m_modal;
++    QWidget * m_parent;
+ 
+   private Q_SLOTS:
+     void slotProviderLoaded(KNS::Provider *provider);
+@@ -128,7 +130,7 @@
+                 SIGNAL(signalEntriesFeedFinished(const KNS::Feed*)),
+                 SLOT(slotEntriesFeedFinished(const KNS::Feed*)));
+ 
+-        m_downloaddialog = new DownloadDialog(this, 0);
++        m_downloaddialog = new DownloadDialog(this,m_parent);
+         m_downloaddialog->show();
+ 
+         connect(m_downloaddialog, SIGNAL(finished()), SLOT(slotDownloadDialogClosed()));
+--- a/knewstuff/knewstuff2/core/coreengine.cpp
++++ b/knewstuff/knewstuff2/core/coreengine.cpp
+@@ -69,12 +69,12 @@
+ 	kDebug(550) << "Initializing KNS::CoreEngine from '" << configfile << "'";
+ 
+ 	KConfig conf(configfile);
+-	if(conf.getConfigState() == KConfig::NoAccess)
++	if(conf.accessMode() == KConfig::NoAccess)
+ 	{
+ 		kError(550) << "No knsrc file named '" << configfile << "' was found." << endl;
+ 		return false;
+ 	}
+-	// FIXME: getConfigState() doesn't return NoAccess for non-existing files
++	// FIXME: accessMode() doesn't return NoAccess for non-existing files
+ 	// - bug in kdecore?
+ 	// - this needs to be looked at again until KConfig backend changes for KDE 4
+ 	// the check below is a workaround
+--- a/knewstuff/knewstuff2/ui/kdxsbutton.cpp
++++ b/knewstuff/knewstuff2/ui/kdxsbutton.cpp
+@@ -102,7 +102,7 @@
+ 		i18n("Translate"));
+ 	action_collabsubscribe = pcollab->addAction(SmallIcon("news-subscribe"),
+ 		i18n("Subscribe"));
+-	action_collabremoval = pcollab->addAction(SmallIcon("edit-trash"),
++	action_collabremoval = pcollab->addAction(SmallIcon("user-trash"),
+ 		i18n("Report bad entry"));
+ 	pcollab->addMenu(m_contact);
+ 
+--- a/knewstuff/knewstuff2/ui/downloaddialog.cpp
++++ b/knewstuff/knewstuff2/ui/downloaddialog.cpp
+@@ -389,7 +389,7 @@
+     sortCombo->setEnabled( false );
+     sortCombo->addItem( SmallIcon( "text" ), i18n("Name") );
+     sortCombo->addItem( SmallIcon( "favorites" ), i18n("Rating") );
+-    sortCombo->addItem( SmallIcon( "calendar-today" ), i18n("Most recent") );
++    sortCombo->addItem( SmallIcon( "go-jump-today" ), i18n("Most recent") );
+     sortCombo->addItem( SmallIcon( "cdcopy" ), i18n("Most downloads") );
+     connect( sortCombo, SIGNAL( activated(int) ), SLOT( slotSortingSelected(int) ) );
+ 

Modified: branches/kde4/packages/kdelibs/debian/patches/series
===================================================================
--- branches/kde4/packages/kdelibs/debian/patches/series	2007-10-25 12:48:52 UTC (rev 7645)
+++ branches/kde4/packages/kdelibs/debian/patches/series	2007-10-25 13:27:56 UTC (rev 7646)
@@ -1,4 +1,4 @@
-01_kdelibs_branch_r726725.diff
+01_kdelibs_branch_r729265.diff
 10_kdehome_kde4.diff
 11_applications_menu_kde4.diff
 13_qt4_designer_plugins_path.diff




More information about the pkg-kde-commits mailing list