[ooo-build-commit] 2 commits - patches/dev300

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jun 12 08:36:03 PDT 2009


 patches/dev300/apply                          |    8 
 patches/dev300/kde4-fpicker.diff              |  721 --------
 patches/dev300/kde4-kde_headers.diff          |   70 
 patches/dev300/kde4-kdebe.diff                |  142 -
 patches/dev300/kde4-kdedata.cxx.diff          |   47 
 patches/dev300/kde4-salnativewidgets-kde.diff | 2187 --------------------------
 6 files changed, 4 insertions(+), 3171 deletions(-)

New commits:
commit 58d49dbad8d478d081ae4166f7c6dbe9e9bbd752
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 17:35:20 2009 +0200

    Remove the old KDE4 stuff.
    
    * patches/dev300/kde4-fpicker.diff: Bin.
    * patches/dev300/kde4-kde_headers.diff: Bin.
    * patches/dev300/kde4-kdebe.diff: Bin.
    * patches/dev300/kde4-kdedata.cxx.diff: Bin.
    * patches/dev300/kde4-salnativewidgets-kde.diff: Bin.

diff --git a/patches/dev300/kde4-fpicker.diff b/patches/dev300/kde4-fpicker.diff
deleted file mode 100644
index 00f22d1..0000000
--- a/patches/dev300/kde4-fpicker.diff
+++ /dev/null
@@ -1,721 +0,0 @@
---- configure.in.kde4fpicker~	2008-07-10 00:12:02.046715223 +0200
-+++ configure.in	2008-07-10 00:23:50.984694910 +0200
-@@ -5801,7 +5801,7 @@ your KDE installation by exporting KDEDI
-     fi
- 
-     dnl Set the variables
--    KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
-+    KDE_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
-     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lQtCore -lQtGui"
- fi
- AC_SUBST(KDE_CFLAGS)
---- fpicker/source/unx/kde/kdecommandthread.cxx.kde4fpicker~	2008-07-10 00:11:18.425692998 +0200
-+++ fpicker/source/unx/kde/kdecommandthread.cxx	2008-07-10 00:23:50.986696561 +0200
-@@ -55,6 +55,7 @@
-  *  All Rights Reserved.
-  *
-  *  Contributor(s): Jan Holesovsky <kendy at openoffice.org>
-+ *                  Bernhard Rosenkraenzer <bero at arklinux.ch>
-  *
-  *
-  ************************************************************************/
-@@ -65,6 +66,10 @@
- 
- #include <kapplication.h>
- 
-+#include <QWidget>
-+#include <QTextStream>
-+#include <QTextCodec>
-+
- #include <iostream>
- 
- //////////////////////////////////////////////////////////////////////////
-@@ -72,8 +77,8 @@
- //////////////////////////////////////////////////////////////////////////
- 
- CommandEvent::CommandEvent( const QString &qCommand, QStringList *pStringList )
--    : QCustomEvent( TypeId, pStringList ),
--      m_eCommand( Unknown )
-+    : QEvent( TypeId ),
-+      m_eCommand( Unknown ), data(pStringList)
- {
-     struct {
-         const char *pName;
-@@ -120,8 +125,8 @@ CommandThread::~CommandThread()
- 
- void CommandThread::run()
- {
--    QTextIStream qStream( stdin );
--    qStream.setEncoding( QTextStream::UnicodeUTF8 );
-+    QTextStream qStream( stdin, QIODevice::ReadOnly );
-+    qStream.setCodec( QTextCodec::codecForName("UTF-8") );
- 
-     QString qLine;
-     bool bQuit = false;
-@@ -158,7 +163,7 @@ void CommandThread::handleCommand( const
-     {
-         bQuit = true;
-         kapp->exit();
--        kapp->wakeUpGuiThread();
-+        kapp->processEvents();
-     }
-     else
-         kapp->postEvent( m_pObject, new CommandEvent( qCommand, pTokens ) );
-@@ -197,7 +202,7 @@ QStringList* CommandThread::tokenize( co
-         else if ( *pUnicode == ' ' && !bQuoted )
-         {
-             pList->push_back( qBuffer );
--            qBuffer.setLength( 0 );
-+            qBuffer.resize( 0 );
-         }
-         else
-             qBuffer.append( *pUnicode );
---- fpicker/source/unx/kde/kdecommandthread.hxx.kde4fpicker~	2008-07-10 00:11:18.426694382 +0200
-+++ fpicker/source/unx/kde/kdecommandthread.hxx	2008-07-10 00:23:50.986696561 +0200
-@@ -55,6 +55,7 @@
-  *  All Rights Reserved.
-  *
-  *  Contributor(s): Jan Holesovsky <kendy at openoffice.org>
-+ *                  Bernhard Rosenkraenzer <bero at arklinux.ch>
-  *
-  *
-  ************************************************************************/
-@@ -66,7 +67,7 @@
- #include <qmutex.h>
- #include <qthread.h>
- 
--class CommandEvent : public QCustomEvent
-+class CommandEvent : public QEvent
- {
- public:
-     enum CommandEventType {
-@@ -104,7 +105,9 @@ public:
-     CommandEvent( const QString &qCommand, QStringList *pStringList );
- 
-     CommandEventType            command() const { return m_eCommand; }
--    QStringList*                stringList() { return static_cast< QStringList* >( data() ); }
-+    QStringList*                stringList() { return data; }
-+protected:
-+    QStringList *data;
- };
- 
- class CommandThread : public QThread
---- fpicker/source/unx/kde/kdefilepicker.cxx.kde4fpicker~	2008-07-10 00:11:19.584944383 +0200
-+++ fpicker/source/unx/kde/kdefilepicker.cxx	2008-07-10 00:23:50.990695254 +0200
-@@ -64,14 +64,11 @@
- 
- #include <qcheckbox.h>
- #include <qcombobox.h>
--#include <qgrid.h>
--#include <qhbox.h>
- #include <qlabel.h>
- #include <qlayout.h>
--#include <qobjectlist.h>
- #include <qpushbutton.h>
- #include <qregexp.h>
--#include <qvbox.h>
-+#include <QTemporaryFile>
- 
- #ifdef QT_NO_EMIT
- #define emit
-@@ -84,7 +81,6 @@
- #include <kio/netaccess.h>
- #include <klocale.h>
- #include <kmessagebox.h>
--#include <ktempfile.h>
- 
- #include <algorithm>
- #include <iostream>
-@@ -94,25 +90,42 @@
- //////////////////////////////////////////////////////////////////////////
- 
- FileDialog::FileDialog( const QString &startDir, const QString &filter,
--        QWidget *parent, const char *name )
--    : KFileDialog( startDir, filter, parent, name, true, m_pCustomWidget = new QVBox() ),
--      m_pCombosAndButtons( new QHBox( m_pCustomWidget ) ),
--      m_pLabels( new QVBox( m_pCombosAndButtons ) ),
--      m_pComboBoxes( new QVBox( m_pCombosAndButtons ) ),
--      m_pPushButtons( new QVBox( m_pCombosAndButtons ) ),
--      m_pCheckBoxes( new QGrid( 2, m_pCustomWidget ) ),
-+        QWidget *parent )
-+    : KFileDialog( startDir, filter, parent, m_pCustomWidget = new QWidget() ), m_pCustomWidgetLayout( new QVBoxLayout(m_pCustomWidget) ),
-+      m_pCombosAndButtons( new QWidget( m_pCustomWidget ) ),
-+      m_pCombosAndButtonsLayout( new QHBoxLayout( m_pCombosAndButtons ) ),
-+      m_pLabels( new QWidget( m_pCombosAndButtons ) ),
-+      m_pLabelsLayout( new QVBoxLayout( m_pLabels ) ),
-+      m_pComboBoxes( new QWidget( m_pCombosAndButtons ) ),
-+      m_pComboBoxesLayout( new QVBoxLayout( m_pComboBoxes ) ),
-+      m_pPushButtons( new QWidget( m_pCombosAndButtons ) ),
-+      m_pPushButtonsLayout( new QVBoxLayout( m_pPushButtons ) ),
-+      m_pCheckBoxes( new QWidget( m_pCustomWidget ) ),
-+      m_pCheckBoxesLayout( new QGridLayout( m_pCheckBoxes ) ),
-+      m_pCheckBoxX(0), m_pCheckBoxY(0),
-       m_bIsSave( false ),
-       m_bIsExecuting( false ),
-       m_bCanNotifySelection( true )
- {
-+    m_pCustomWidgetLayout->addWidget(m_pCombosAndButtons);
-+    m_pCombosAndButtonsLayout->addWidget(m_pLabels);
-+    m_pCombosAndButtonsLayout->addWidget(m_pComboBoxes);
-+    m_pCombosAndButtonsLayout->addWidget(m_pPushButtons);
-+    m_pCustomWidgetLayout->addWidget(m_pCheckBoxes);
-+    m_pCustomWidget->setLayout(m_pCustomWidgetLayout);
-+    m_pCombosAndButtons->setLayout(m_pCombosAndButtonsLayout);
-+    m_pLabels->setLayout(m_pLabelsLayout);
-+    m_pComboBoxes->setLayout(m_pComboBoxesLayout);
-+    m_pPushButtons->setLayout(m_pPushButtonsLayout);
-+    m_pCheckBoxes->setLayout(m_pCheckBoxesLayout);
-     connect( this, SIGNAL( fileHighlighted( const QString & ) ),
-              this, SLOT( fileHighlightedCommand( const QString & ) ) );
- 
-     connect( this, SIGNAL( selectionChanged() ),
-              this, SLOT( selectionChangedCommand() ) );
- 
--    m_pCustomWidget->setSpacing( KDialog::spacingHint() );
--    m_pCombosAndButtons->setSpacing( KDialog::spacingHint() );
-+    m_pCustomWidgetLayout->setSpacing( KDialog::spacingHint() );
-+    m_pCombosAndButtonsLayout->setSpacing( KDialog::spacingHint() );
- 
-     updateCustomWidgetLayout();
- }
-@@ -137,11 +150,11 @@ void FileDialog::showEvent( QShowEvent *
- 
- void FileDialog::updateCustomWidgetLayout()
- {
--    QPoint qReferencePoint = filterWidget->mapTo( this, QPoint( 0, 0 ) );
-+    QPoint qReferencePoint = filterWidget()->mapTo( this, QPoint( 0, 0 ) );
-     QPoint qCustomPoint = m_pCustomWidget->mapTo( this, QPoint( 0, 0 ) );
- 
-     int nLeft = qReferencePoint.x() - qCustomPoint.x();
--    int nRight = m_pCustomWidget->width() - filterWidget->width() - nLeft;
-+    int nRight = m_pCustomWidget->width() - filterWidget()->width() - nLeft;
-     
-     nLeft -= KDialog::spacingHint();
-     nRight -= KDialog::spacingHint();
-@@ -152,7 +165,7 @@ void FileDialog::updateCustomWidgetLayou
-     m_pPushButtons->setFixedWidth( ( nRight > 0 )? nRight: 100 );
- }
- 
--void FileDialog::customEvent( QCustomEvent *pEvent )
-+void FileDialog::customEvent( QEvent *pEvent )
- {
-     if ( pEvent && pEvent->type() == CommandEvent::TypeId )
-     {
-@@ -225,19 +238,19 @@ void FileDialog::customEvent( QCustomEve
-                 break;
-             case CommandEvent::GetCurrentFilter:
-                 {
--                    QString qCurrentFilter = filterWidget->currentText();
-+                    QString qCurrentFilter = filterWidget()->currentText();
-                     sendCommand( "currentFilter " + escapeString( qCurrentFilter ) );
-                 }
-                 break;
-             case CommandEvent::SetCurrentFilter:
-                 if ( nListSize >= 1 )
-                 {
--                    static_cast< FileFilterComboHack* >( filterWidget )->setCurrentFilter( pStringList->front() );
-+                    static_cast< FileFilterComboHack* >( filterWidget() )->setCurrentFilter( pStringList->front() );
-                 }
-                 break;
-             case CommandEvent::GetDirectory:
-                 {
--                    QString qDirectory = baseURL().url();
-+                    QString qDirectory = baseUrl().url();
-                     if ( qDirectory.startsWith( "file:/" ) && qDirectory.mid( 6, 1 ) != "/" )
-                         qDirectory.replace( "file:/", "file:///" );
-                     sendCommand( "currentDirectory " + escapeString( qDirectory ) );
-@@ -246,7 +259,7 @@ void FileDialog::customEvent( QCustomEve
-             case CommandEvent::SetDirectory:
-                 if ( nListSize >= 1 )
-                 {
--                    setURL( pStringList->front() );
-+                    setUrl( pStringList->front() );
-                 }
-                 break;
-             case CommandEvent::GetFiles:
-@@ -256,19 +269,9 @@ void FileDialog::customEvent( QCustomEve
- 
-                     qString.append( "files" );
- 
--                    if ( result() == QDialog::Accepted )
--                    {
--                        KURL::List qList( selectedURLs() );
--                        for ( KURL::List::const_iterator it = qList.begin(); it != qList.end(); ++it )
--                            appendURL( qString, (*it) );
--                    }
--                    else
--                    {
--                        // we have to return the selected files anyway
--                        const KFileItemList *pItems = ops->selectedItems();
--                        for ( KFileItemListIterator it( *pItems ); it.current(); ++it )
--                            appendURL( qString, (*it)->url() );
--                    }
-+                    KUrl::List qList( selectedUrls() );
-+                    for ( KUrl::List::const_iterator it = qList.begin(); it != qList.end(); ++it )
-+                        appendURL( qString, (*it) );
- 
-                     sendCommand( qString );
-                     setCanNotifySelection( true );
-@@ -314,6 +317,6 @@ void FileDialog::customEvent( QCustomEve
-                 break;
-             case CommandEvent::Exec:
-                 {
--                    filterWidget->setEditable( false );
-+                    filterWidget()->setEditable( false );
-                     setIsExecuting( true );
-                     bool bCanExit = false;
-@@ -322,5 +325,5 @@ void FileDialog::customEvent( QCustomEve
-                         setCanNotifySelection( true );
-                         exec();
- 
--                        KURL qLocalSelectedURL = mostLocalURL( selectedURL() );
-+                        KUrl qLocalSelectedURL = mostLocalURL( selectedUrl() );
-                         QString qProtocol( qLocalSelectedURL.protocol() );
-@@ -338,7 +341,7 @@ void FileDialog::customEvent( QCustomEve
-                                                                  i18n( "A file named \"%1\" already exists. "
-                                                                      "Are you sure you want to overwrite it?" ).arg( qFileName ),
-                                                                  i18n( "Overwrite File?" ),
--                                                                 i18n( "Overwrite" ), KStdGuiItem::cancel() ) == KMessageBox::Yes );
-+                                                                 KGuiItem(i18n( "Overwrite" )), KStandardGuiItem::cancel() ) == KMessageBox::Yes );
-                             }
-                             else if ( !isSupportedProtocol( qProtocol ) )
-                             {
-@@ -382,7 +385,10 @@ void FileDialog::appendControl( const QS
- 
-     if ( rType == "checkbox" )
-     {
--        QCheckBox *pCheckBox = new QCheckBox( qLabel, m_pCheckBoxes, rId.utf8() );
-+        QCheckBox *pCheckBox = new QCheckBox( qLabel, m_pCheckBoxes );
-+	pCheckBox->setObjectName(rId);
-+	m_pCheckBoxesLayout->addWidget(pCheckBox, m_pCheckBoxY, m_pCheckBoxX);
-+	m_pCheckBoxX++; if(m_pCheckBoxX==2) { m_pCheckBoxY++; m_pCheckBoxX=0; }
- 
-         pCheckBox->setEnabled( true );
-         pCheckBox->setChecked( false );
-@@ -390,33 +396,35 @@ void FileDialog::appendControl( const QS
-     else if ( rType == "listbox" )
-     {
-         QLabel *pComboLabel = new QLabel( qLabel, m_pLabels );
--        QComboBox *pComboBox = new QComboBox( m_pComboBoxes, rId.utf8() );
-+	m_pLabelsLayout->addWidget(pComboLabel);
-+        QComboBox *pComboBox = new QComboBox( m_pComboBoxes );
-+	pComboBox->setObjectName(rId);
-+	m_pComboBoxesLayout->addWidget(pComboBox);
- 
-         pComboLabel->setBuddy( pComboBox );
-         pComboBox->setEnabled( true );
-     }
-     else if ( rType == "pushbutton" )
-     {
--        QPushButton *pPushButton = new QPushButton( qLabel, m_pPushButtons, rId.utf8() );
-+        QPushButton *pPushButton = new QPushButton( qLabel, m_pPushButtons );
-+	pPushButton->setObjectName(rId);
-+	m_pPushButtonsLayout->addWidget(pPushButton);
-         pPushButton->setEnabled( true );
-     }
- }
- 
- QWidget* FileDialog::findControl( const QString &rId ) const
- {
--    QObjectList *pList = m_pCustomWidget->queryList();
--    QCString qName( rId.utf8() );
--    QObjectList::const_iterator it = pList->begin();
-+    QList<QObject*> const &pList = qFindChildren<QObject*>(m_pCustomWidget);
-+    QList<QObject*>::const_iterator it = pList.begin();
-     
--    for ( ; it != pList->end() && qName != (*it)->name(); ++it )
-+    for ( ; it != pList.end() && rId != (*it)->objectName(); ++it )
-         ;
- 
-     QWidget *pWidget = NULL;
--    if ( it != pList->end() )
-+    if ( it != pList.end() )
-         pWidget = static_cast< QWidget* >( *it );
-     
--    delete pList;
--
-     return pWidget;
- }
- 
-@@ -425,7 +433,7 @@ void FileDialog::enableControl( const QS
-     QWidget *pWidget = findControl( rId );
- 
-     if ( pWidget )
--        pWidget->setEnabled( rValue.lower() == "true" );
-+        pWidget->setEnabled( rValue.toLower() == "true" );
- }
- 
- void FileDialog::getValue( const QString &rId, const QString &rAction )
-@@ -437,7 +445,7 @@ void FileDialog::getValue( const QString
- 
-     if ( pWidget )
-     {
--        QCString qClassName = pWidget->className();
-+        QString qClassName = pWidget->metaObject()->className();
-         if ( qClassName == "QCheckBox" )
-         {
-             QCheckBox *pCheckBox = static_cast< QCheckBox* >( pWidget );
-@@ -456,7 +464,7 @@ void FileDialog::getValue( const QString
-                 for ( int nIdx = 0; nIdx < pComboBox->count(); ++nIdx )
-                 {
-                     qString.append( ' ' );
--                    appendEscaped( qString, pComboBox->text( nIdx ) );
-+                    appendEscaped( qString, pComboBox->itemText( nIdx ) );
-                 }
-             }
-             else if ( rAction == "getSelectedItem" )
-@@ -467,7 +475,7 @@ void FileDialog::getValue( const QString
-             else if ( rAction == "getSelectedItemIndex" )
-             {
-                 qString.append( " int " );
--                qString.append( QString().setNum( pComboBox->currentItem() ) );
-+                qString.append( QString().setNum( pComboBox->currentIndex() ) );
-             }
-             // TODO getHelpURL
-         }
-@@ -483,12 +491,12 @@ void FileDialog::setValue( const QString
- 
-     if ( pWidget )
-     {
--        QCString qClassName = pWidget->className();
-+        QString qClassName = pWidget->metaObject()->className();
-         if ( qClassName == "QCheckBox" )
-         {
-             QCheckBox *pCheckBox = static_cast< QCheckBox* >( pWidget );
- 
--            bool bValue = ( !rValue.isEmpty() ) && ( rValue.front().lower() == "true" );
-+            bool bValue = ( !rValue.isEmpty() ) && ( rValue.front().toLower() == "true" );
-             pCheckBox->setChecked( bValue );
-         }
-         else if ( qClassName == "QComboBox" )
-@@ -497,11 +505,11 @@ void FileDialog::setValue( const QString
-             if ( rAction == "addItem" )
-             {
-                 if ( !rValue.isEmpty() )
--                    pComboBox->insertItem( rValue.front() );
-+                    pComboBox->addItem( rValue.front() );
-             }
-             else if ( rAction == "addItems" )
-             {
--                pComboBox->insertStringList( rValue );
-+                pComboBox->addItems( rValue );
-             }
-             else if ( rAction == "deleteItem" )
-             {
-@@ -515,7 +523,7 @@ void FileDialog::setValue( const QString
-             else if ( rAction == "setSelectedItem" )
-             {
-                 if ( !rValue.isEmpty() )
--                    pComboBox->setCurrentItem( rValue.front().toInt() );
-+                    pComboBox->setCurrentIndex( rValue.front().toInt() );
-             }
-             // FIXME setHelpURL is ignored
-         }
-@@ -566,24 +574,24 @@ QString FileDialog::addExtension( const 
-     QString qExtension;
- 
-     QWidget *pExtensionWidget = findControl( "100" ); // CHECKBOX_AUTOEXTENSION
--    QCheckBox *pExtensionCB = pExtensionWidget? static_cast< QCheckBox* >( pExtensionWidget->qt_cast( "QCheckBox" ) ): NULL;
-+    QCheckBox *pExtensionCB = pExtensionWidget? qobject_cast< QCheckBox* >( pExtensionWidget ): NULL;
-     if ( pExtensionCB && pExtensionCB->isChecked() )
-     {
-         // FIXME: qFilter can be a MIME; we ignore it now...
--        QStringList qFilterList = QStringList::split( " ", currentFilter() );
-+        QStringList qFilterList = currentFilter().split( " " );
-         for ( QStringList::const_iterator it = qFilterList.begin();
-               qExtension.isEmpty() && it != qFilterList.end();
-               ++it )
-         {
--            int nUnwanted = (*it).findRev( '*' );
-+            int nUnwanted = (*it).lastIndexOf( '*' );
-             if ( nUnwanted < 0 )
--                nUnwanted = (*it).findRev( '?' );
-+                nUnwanted = (*it).lastIndexOf( '?' );
-             else
--                nUnwanted = ::std::max( nUnwanted, (*it).find( '?', nUnwanted ) );
-+                nUnwanted = ::std::max( nUnwanted, (*it).indexOf( '?', nUnwanted ) );
- 
--            int nIdx = (*it).find( '.', ::std::max( nUnwanted, 0 ) );
-+            int nIdx = (*it).indexOf( '.', ::std::max( nUnwanted, 0 ) );
-             if ( nIdx >= 0 )
--                qExtension = (*it).mid( nIdx ).lower();
-+                qExtension = (*it).mid( nIdx ).toLower();
-         }
-     }
- 
-@@ -616,17 +624,17 @@ bool FileDialog::isSupportedProtocol( co
-     return false;
- }
- 
--KURL FileDialog::mostLocalURL( const KURL &rURL ) const
-+KUrl FileDialog::mostLocalURL( const KUrl &rURL ) const
- {
- #if KDE_IS_VERSION(3,5,0)
--    KURL qMostLocalURL( KIO::NetAccess::mostLocalURL( rURL, const_cast<FileDialog*>( this ) ) );
-+    KUrl qMostLocalURL( KIO::NetAccess::mostLocalUrl( rURL, const_cast<FileDialog*>( this ) ) );
-     if ( qMostLocalURL.isLocalFile() )
-         return qMostLocalURL;
-     else
-     {
-         // Terrible hack to get even non-existing media:// files right
-         qMostLocalURL.cd( ".." );
--        KURL qMostLocalPath( KIO::NetAccess::mostLocalURL( qMostLocalURL, const_cast<FileDialog*>( this ) ) );
-+        KUrl qMostLocalPath( KIO::NetAccess::mostLocalUrl( qMostLocalURL, const_cast<FileDialog*>( this ) ) );
-         if ( qMostLocalPath.isLocalFile() )
-         {
-             qMostLocalPath.addPath( rURL.fileName() );
-@@ -640,22 +648,22 @@ KURL FileDialog::mostLocalURL( const KUR
- 
- QString FileDialog::localCopy( const QString &rFileName ) const
- {
--    // 106 == MIB enum for UTF-8
--    KURL qLocalURL = mostLocalURL( KURL( rFileName, 106 ) );
-+    KUrl qLocalURL = mostLocalURL( KUrl( rFileName ) );
-     if ( qLocalURL.isLocalFile() )
-         return qLocalURL.url();
- 
--    int nExtensionPos = rFileName.findRev( '/' );
-+    int nExtensionPos = rFileName.lastIndexOf( '/' );
-     if ( nExtensionPos >= 0 )
--        nExtensionPos = rFileName.find( '.', nExtensionPos );
-+        nExtensionPos = rFileName.indexOf( '.', nExtensionPos );
-     else
--        nExtensionPos = rFileName.find( '.' );
-+        nExtensionPos = rFileName.indexOf( '.' );
- 
--    KTempFile qTempFile( QString::null, ( nExtensionPos < 0 )? QString(): rFileName.mid( nExtensionPos ) );
--    KURL qDestURL;
--    qDestURL.setPath( qTempFile.name() );
-+    QTemporaryFile qTempFile( QString("ooo-temp-XXXXXX.") + (( nExtensionPos < 0 )? QString(): rFileName.mid( nExtensionPos )) );
-+    qTempFile.setAutoRemove(false);
-+    KUrl qDestURL;
-+    qDestURL.setPath( qTempFile.fileName() );
- 
--    if ( !KIO::NetAccess::file_copy( rFileName, qDestURL, 0600, true, false, NULL ) )
-+    if ( !KIO::NetAccess::file_copy( rFileName, qDestURL ) )
-     {
-         KMessageBox::error( 0, KIO::NetAccess::lastErrorString() );
-         return QString::null;
-@@ -689,10 +697,10 @@ void FileDialog::sendCommand( const QStr
- #endif
- 
-     //m_aOutputStream << rCommand << endl;
--    ::std::cout << rCommand.utf8() << ::std::endl;
-+    ::std::cout << rCommand.toUtf8().data() << ::std::endl;
- }
- 
--void FileDialog::appendURL( QString &rBuffer, const KURL &rURL )
-+void FileDialog::appendURL( QString &rBuffer, const KUrl &rURL )
- {
-     // From Martin Kretzschmar:
-     // file:///path/to/test%E0.odt is not a valid URL from OOo's point of
-@@ -701,7 +709,7 @@ void FileDialog::appendURL( QString &rBu
-     // (which file:///path/test%E0.odt is not).
-     // Cf. the comment in sal/inc/osl/file.h.
-     // 106 == MIB enum for UTF-8
--    QString qUrlStr = addExtension( rURL.url( 0, 106 ) );
-+    QString qUrlStr = addExtension( rURL.url( KUrl::RemoveTrailingSlash ) );
- 
-     if ( !isExecuting() && !isSupportedProtocol( rURL.protocol() ) )
-         qUrlStr = localCopy( qUrlStr );
-@@ -747,19 +755,19 @@ QString FileDialog::escapeString( const 
- 
- void FileFilterComboHack::setCurrentFilter( const QString& filter )
- {
--    setCurrentText( filter );
-+    setEditText( filter );
-     filterChanged();
- 
-     // Workaround for 'Filter name (*.blah)' vs. 'Filter name'
--    if ( currentText() != text( currentItem() ) )
-+    if ( currentText() != itemText( currentIndex() ) )
-     {
-         int nItem = 0;
--        for ( ; nItem < count() && !text( nItem ).startsWith( filter ); ++nItem );
-+        for ( ; nItem < count() && !itemText( nItem ).startsWith( filter ); ++nItem );
- 
-         if ( nItem < count() )
--            setCurrentItem( nItem );
-+            setCurrentIndex( nItem );
-         else
--            setCurrentItem( 0 );
-+            setCurrentIndex( 0 );
- 
-         filterChanged();
-     }
---- fpicker/source/unx/kde/kdefilepicker.hxx.kde4fpicker~	2008-07-10 00:11:19.584944383 +0200
-+++ fpicker/source/unx/kde/kdefilepicker.hxx	2008-07-10 00:23:50.991695311 +0200
-@@ -65,9 +65,10 @@
- #include <kfiledialog.h>
- #include <kfilefiltercombo.h>
- 
--class QGrid;
--class QHBox;
--class QVBox;
-+#include <QWidget>
-+#include <QVBoxLayout>
-+#include <QHBoxLayout>
-+#include <QGridLayout>
- 
- class FileDialog : public KFileDialog
- {
-@@ -75,16 +76,24 @@ class FileDialog : public KFileDialog
- 
- protected:
-     typedef QPair< QString, QString > FilterEntry;
--    typedef QValueList< FilterEntry > FilterList;
-+    typedef QList< FilterEntry > FilterList;
-     
--    QVBox                      *m_pCustomWidget;
--    QHBox                      *m_pCombosAndButtons;
-+    QWidget                    *m_pCustomWidget;
-+    QVBoxLayout                *m_pCustomWidgetLayout;
-+    QWidget                    *m_pCombosAndButtons;
-+    QHBoxLayout                *m_pCombosAndButtonsLayout;
-     
--    QVBox                      *m_pLabels;
--    QVBox                      *m_pComboBoxes;
--    QVBox                      *m_pPushButtons;
--
--    QGrid                      *m_pCheckBoxes;
-+    QWidget                    *m_pLabels;
-+    QVBoxLayout                *m_pLabelsLayout;
-+    QWidget                    *m_pComboBoxes;
-+    QVBoxLayout                *m_pComboBoxesLayout;
-+    QWidget                    *m_pPushButtons;
-+    QVBoxLayout                *m_pPushButtonsLayout;
-+
-+    QWidget                    *m_pCheckBoxes;
-+    QGridLayout                *m_pCheckBoxesLayout;
-+    int                         m_pCheckBoxX;
-+    int                         m_pCheckBoxY;
- 
-     FilterList                  m_aFilters;
- 
-@@ -102,7 +111,7 @@ protected:
- 
- public:
-     FileDialog( const QString &startDir, const QString &filter,
--                QWidget *parent, const char *name );
-+                QWidget *parent = 0 );
-     virtual ~FileDialog();
- 
- protected:
-@@ -110,7 +119,7 @@ protected:
-     virtual void                showEvent( QShowEvent *pEvent );
-     void                        updateCustomWidgetLayout();
- 
--    virtual void                customEvent( QCustomEvent *pEvent );
-+    virtual void                customEvent( QEvent *pEvent );
- 
- protected:
-     void                        appendControl( const QString &rId, const QString &rType, const QString &rTitle );
-@@ -130,7 +139,7 @@ protected:
-     bool                        isExecuting( void ) const { return m_bIsExecuting; }
- 
-     bool                        isSupportedProtocol( const QString &rProtocol ) const;
--    KURL                        mostLocalURL( const KURL &rURL ) const;
-+    KUrl                        mostLocalURL( const KUrl &rURL ) const;
-     QString                     localCopy( const QString &rFileName ) const;
- 
-     void                        setCanNotifySelection( bool bCanNotifySelection ) { m_bCanNotifySelection = bCanNotifySelection; }
-@@ -142,7 +151,7 @@ protected slots:
- 
- protected:
-     void                        sendCommand( const QString &rCommand );
--    void                        appendURL( QString &rBuffer, const KURL &rURL );
-+    void                        appendURL( QString &rBuffer, const KUrl &rURL );
-     void                        appendEscaped( QString &rBuffer, const QString &rString );
-     QString                     escapeString( const QString &rString );
- };
---- fpicker/source/unx/kde/kdefpmain.cxx.kde4fpicker~	2008-07-10 00:11:19.682945316 +0200
-+++ fpicker/source/unx/kde/kdefpmain.cxx	2008-07-10 00:23:50.993695356 +0200
-@@ -74,41 +74,39 @@
- // Main
- //////////////////////////////////////////////////////////////////////////
- 
--static KCmdLineOptions sOptions[] =
--{
--    { "winid <argument>", I18N_NOOP("Window ID to which is the fpicker modal"), "0" },
--    KCmdLineLastOption
--};
--
- int main( int argc, char* argv[] )
- {
-+    KCmdLineOptions options;
-+    options.add("winid <argument>", ki18n("Window ID to which is the fpicker modal"));
-     // we fake the name of the application to have "OpenOffice.org" in the
-     // title
--    KAboutData qAboutData( "kdefilepicker", I18N_NOOP( "OpenOffice.org" ),
--            "0.1", I18N_NOOP( "kdefilepicker is an implementation of the KDE file dialog for OpenOffice.org." ),
-+    KAboutData qAboutData( "kdefilepicker", 0, ki18n( "OpenOffice.org" ),
-+            "0.1",
-+	    ki18n( "kdefilepicker is an implementation of the KDE file dialog for OpenOffice.org." ),
-             KAboutData::License_LGPL,
--            "(c) 2004, Jan Holesovsky" );
--    qAboutData.addAuthor( "Jan Holesovsky", I18N_NOOP("Original author and current maintainer"), "kendy at openoffice.org" );
-+            ki18n("(c) 2004, Jan Holesovsky") );
-+    qAboutData.addAuthor( ki18n("Jan Holesovsky"), ki18n("Original author and current maintainer"), "kendy at openoffice.org" );
-+    qAboutData.addAuthor( ki18n("Bernhard Rosenkraenzer"), ki18n("Port to KDE 4.x"), "bero at arklinux.ch", "http://linux.cd/" );
- 
-     // Let the user see that this does something...
-     ::std::cerr << "kdefilepicker, an implementation of KDE file dialog for OOo." << ::std::endl
-         << "Type 'exit' and press Enter to finish." << ::std::endl;
- 
--    KCmdLineArgs::addCmdLineOptions( sOptions );
-+    KCmdLineArgs::addCmdLineOptions( options );
-     KCmdLineArgs::init( argc, argv, &qAboutData );
- 
--    KLocale::setMainCatalogue( "kdialog" );
-+    KLocale::setMainCatalog( "kdialog" );
-     
-     KApplication kApplication;
- 
-     // Setup the modality
-     KCmdLineArgs *pArgs = KCmdLineArgs::parsedArgs();
--    long nWinId = atol( pArgs->getOption( "winid" ) );
-+    long nWinId = pArgs->getOption( "winid" ).toLong();
-     pArgs->clear();
- 
-     ModalityFilter qModalityFilter( nWinId );
- 
--    FileDialog aFileDialog( NULL, QString(), NULL, "kdefiledialog" );
-+    FileDialog aFileDialog( QString::null, QString::null, NULL );
-     
-     CommandThread qCommandThread( &aFileDialog );
-     qCommandThread.start();
---- fpicker/source/unx/kde/kdemodalityfilter.cxx.kde4fpicker~	2008-07-10 00:23:50.992695019 +0200
-+++ fpicker/source/unx/kde/kdemodalityfilter.cxx	2008-07-10 00:23:50.994695273 +0200
-@@ -62,6 +62,7 @@
- #include <kdemodalityfilter.hxx>
- 
- #include <kapplication.h>
--#include <kdialogbase.h>
-+#include <kdialog.h>
-+#include <QX11Info>
- 
- #include <netwm.h>
-@@ -88,10 +88,10 @@ bool ModalityFilter::eventFilter( QObjec
- {
-     if ( pObject->isWidgetType() && pEvent->type() == QEvent::Show )
-     {
--        KDialogBase* pDlg = ::qt_cast< KDialogBase* >( pObject );
-+        KDialog* pDlg = qobject_cast< KDialog* >( pObject );
-         if ( pDlg != NULL && m_nWinId != 0 )
-         {
--            XSetTransientForHint( qt_xdisplay(), pDlg->winId(), m_nWinId );
-+            XSetTransientForHint( QX11Info::display(), pDlg->winId(), m_nWinId );
-             m_nWinId = 0;
-         }
-     }
---- fpicker/source/unx/kde/kdemodalityfilter.hxx.kde4fpicker~	2008-07-10 00:11:18.435695037 +0200
-+++ fpicker/source/unx/kde/kdemodalityfilter.hxx	2008-07-10 00:23:50.992695019 +0200
-@@ -62,7 +62,7 @@
- #ifndef _KDEMODALITYFILTER_HXX_
- #define _KDEMODALITYFILTER_HXX_
- 
--#include <qobject.h>
-+#include <QWidget>
- 
- class ModalityFilter : public QObject
- {
diff --git a/patches/dev300/kde4-kde_headers.diff b/patches/dev300/kde4-kde_headers.diff
deleted file mode 100644
index f9d17cf..0000000
--- a/patches/dev300/kde4-kde_headers.diff
+++ /dev/null
@@ -1,70 +0,0 @@
---- vcl/unx/inc/kde_headers.h.old	2008-03-22 06:13:11.000000000 +0100
-+++ vcl/unx/inc/kde_headers.h	2008-03-25 21:29:51.000000000 +0100
-@@ -51,27 +51,30 @@
- 
- 
- /* ********* Qt headers */
--#include <qaccessible.h>
--#include <qcheckbox.h>
--#include <qcombobox.h>
--#include <qfont.h>
--#include <qframe.h>
--#include <qlineedit.h>
--#include <qlistview.h>
--#include <qmainwindow.h>
--#include <qmenudata.h>
--#include <qpaintdevice.h>
--#include <qpainter.h>
--#include <qpushbutton.h>
--#include <qradiobutton.h>
--#include <qrangecontrol.h>
--#include <qstring.h>
--#include <qtabbar.h>
--#include <qtabwidget.h>
--#include <qtoolbar.h>
--#include <qtoolbutton.h>
--#include <qwidget.h>
--#include <qprogressbar.h>
-+#include <QtCore/qstring.h>
-+
-+#include <QtGui/qaccessible.h>
-+#include <QtGui/qcheckbox.h>
-+#include <QtGui/qcombobox.h>
-+#include <QtGui/qfont.h>
-+#include <QtGui/qframe.h>
-+#include <QtGui/qlineedit.h>
-+#include <QtGui/qlistview.h>
-+#include <QtGui/qmainwindow.h>
-+#include <QtGui/qmenudata.h>
-+#include <QtGui/qpaintdevice.h>
-+#include <QtGui/qpainter.h>
-+#include <QtGui/qpushbutton.h>
-+#include <QtGui/qradiobutton.h>
-+#include <QtGui/qscrollbar.h>
-+#include <QtGui/qspinbox.h>
-+#include <QtGui/qtabbar.h>
-+#include <QtGui/qtabwidget.h>
-+#include <QtGui/qtoolbar.h>
-+#include <QtGui/qtoolbutton.h>
-+#include <QtGui/qwidget.h>
-+#include <QtGui/qprogressbar.h>
-+
- 
- /* ********* See hack on top of this file */
- #undef Region
-@@ -82,6 +85,7 @@
- #include <kapplication.h>
- #include <kcmdlineargs.h>
- #include <kconfig.h>
-+#include <kconfiggroup.h>
- #include <kdeversion.h>
- #include <kemailsettings.h>
- #include <kglobal.h>
-@@ -92,6 +96,7 @@
- #include <kprotocolmanager.h>
- #include <kstartupinfo.h>
- #include <kstyle.h>
-+#include <ktoolbar.h>
- 
- 
- /* ********* KDE address book connectivity headers */
diff --git a/patches/dev300/kde4-kdebe.diff b/patches/dev300/kde4-kdebe.diff
deleted file mode 100644
index 590e318..0000000
--- a/patches/dev300/kde4-kdebe.diff
+++ /dev/null
@@ -1,142 +0,0 @@
---- shell/source/backends/kdebe/kdecommonlayer.cxx.old	2008-03-26 02:12:01.000000000 +0100
-+++ shell/source/backends/kdebe/kdecommonlayer.cxx	2008-03-26 02:12:37.000000000 +0100
-@@ -104,7 +104,7 @@
-         aClientProgram = "kmail";
-     else
-         aClientProgram = aClientProgram.section(SPACE, 0, 0);
--    sClientProgram = (const sal_Unicode *) aClientProgram.ucs2();
-+    sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
- 
-     aPropInfoList[nProperties].Name = rtl::OUString(
-         RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
-@@ -121,7 +121,7 @@
- 
-     aFixedFont = KGlobalSettings::fixedFont();
-     aFontName = aFixedFont.family();
--    sFontName = (const sal_Unicode *) aFontName.ucs2();
-+    sFontName = (const sal_Unicode *) aFontName.utf16();
-     nFontHeight = aFixedFont.pointSize();
- 
-     aPropInfoList[nProperties].Name = rtl::OUString(
-@@ -162,9 +162,9 @@
-     ::rtl::OUString sTimeStamp,
-                     sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
- 
--    sTimeStamp = (const sal_Unicode *) aClientProgram.ucs2();
-+    sTimeStamp = (const sal_Unicode *) aClientProgram.utf16();
-     sTimeStamp += sep;
--    sTimeStamp += (const sal_Unicode *) aFixedFont.ucs2();
-+    sTimeStamp += (const sal_Unicode *) aFixedFont.utf16();
- 
-     return sTimeStamp;
- }
---- shell/source/backends/kdebe/kdeinetlayer.cxx.old	2008-03-26 02:13:08.000000000 +0100
-+++ shell/source/backends/kdebe/kdeinetlayer.cxx	2008-03-26 02:19:27.000000000 +0100
-@@ -108,9 +108,9 @@
- // The best we can do here is to ask the current value for a given address.
-             setProxy(aPropInfoList, nProperties, 1,
-                      KProtocolManager::noProxyFor(),
--                     KProtocolManager::proxyForURL( "http://www.openoffice.org" ),
--                     KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" ),
--					 KProtocolManager::proxyForURL( "https://www.openoffice.org" ));
-+                     KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ),
-+                     KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ),
-+					 KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ));
-             break;
-         default:                            // No proxy is used
-             setProxy(aPropInfoList, nProperties, 0);
-@@ -147,9 +147,9 @@
-         case KProtocolManager::EnvVarProxy:
-             aProxyType = '1';
-             aNoProxyFor = KProtocolManager::noProxyFor();
--            aHTTPProxy = KProtocolManager::proxyForURL( "http://www.openoffice.org" );
--			aHTTPSProxy = KProtocolManager::proxyForURL( "https://www.openoffice.org" );
--            aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
-+            aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") );
-+			aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") );
-+            aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
-             break;
-         default:
-             aProxyType = '0';
-@@ -158,15 +158,15 @@
-     ::rtl::OUString sTimeStamp,
-                     sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
- 
--    sTimeStamp = (const sal_Unicode *) aProxyType.ucs2();
-+    sTimeStamp = (const sal_Unicode *) aProxyType.utf16();
-     sTimeStamp += sep;
--    sTimeStamp += (const sal_Unicode *) aNoProxyFor.ucs2();
-+    sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16();
-     sTimeStamp += sep;
--    sTimeStamp += (const sal_Unicode *) aHTTPProxy.ucs2();
-+    sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16();
-     sTimeStamp += sep;
--	sTimeStamp += (const sal_Unicode *) aHTTPSProxy.ucs2();
-+	sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16();
-     sTimeStamp += sep;
--    sTimeStamp += (const sal_Unicode *) aFTPProxy.ucs2();
-+    sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16();
- 
-     return sTimeStamp;
- }
-@@ -192,7 +192,7 @@
-         ::rtl::OUString sNoProxyFor;
- 
-         aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
--        sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2();
-+        sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
- 
-         aPropInfoList[nProperties].Name = rtl::OUString( 
-         RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
-@@ -204,8 +204,8 @@
- 
-     if ( !aHTTPProxy.isEmpty() )
-     {
--        KURL aProxy(aHTTPProxy);
--        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
-+        KUrl aProxy(aHTTPProxy);
-+        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
-         sal_Int32 nPort = aProxy.port();
- 
-         aPropInfoList[nProperties].Name = rtl::OUString(
-@@ -225,8 +225,8 @@
- 
- 	if ( !aHTTPSProxy.isEmpty() )
-     {
--        KURL aProxy(aHTTPSProxy);
--        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
-+        KUrl aProxy(aHTTPSProxy);
-+        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
-         sal_Int32 nPort = aProxy.port();
- 
-         aPropInfoList[nProperties].Name = rtl::OUString(
-@@ -246,8 +246,8 @@
- 
-     if ( !aFTPProxy.isEmpty() )
-     {
--        KURL aProxy(aFTPProxy);
--        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
-+        KUrl aProxy(aFTPProxy);
-+        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
-         sal_Int32 nPort = aProxy.port();
- 
-         aPropInfoList[nProperties].Name = rtl::OUString(
---- shell/source/backends/kdebe/kdepathslayer.cxx.old	2008-03-26 02:19:55.000000000 +0100
-+++ shell/source/backends/kdebe/kdepathslayer.cxx	2008-03-26 02:27:24.000000000 +0100
-@@ -108,6 +108,6 @@
-     if ( aDocumentsDir.endsWith(QChar('/')) )
-         aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
--    sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2();
-+    sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
-     osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
- 
-     aPropInfoList[nProperties].Name = rtl::OUString(
-@@ -137,7 +137,7 @@
-     QString aDocumentsDir;
-     aDocumentsDir = KGlobalSettings::documentPath();
- 
--    sTimeStamp += (const sal_Unicode *) aDocumentsDir.ucs2();
-+    sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16();
- 
-     return sTimeStamp;
- }
diff --git a/patches/dev300/kde4-kdedata.cxx.diff b/patches/dev300/kde4-kdedata.cxx.diff
deleted file mode 100644
index 3360969..0000000
--- a/patches/dev300/kde4-kdedata.cxx.diff
+++ /dev/null
@@ -1,47 +0,0 @@
---- vcl/unx/kde/kdedata.cxx.old	2008-03-22 05:08:32.000000000 +0100
-+++ vcl/unx/kde/kdedata.cxx	2008-03-22 05:57:03.000000000 +0100
-@@ -140,18 +140,22 @@
- 	XrmInitialize();
- 
- 	KAboutData *kAboutData = new KAboutData( "OpenOffice.org",
--			I18N_NOOP( "OpenOffice.org" ),
--			"1.1.0",
--			I18N_NOOP( "OpenOffice.org with KDE Native Widget Support." ),
-+			"OpenOffice.org",
-+			ki18n( "OpenOffice.org" ),
-+			"3.0.0",
-+			ki18n( "OpenOffice.org with KDE Native Widget Support." ),
- 			KAboutData::License_LGPL,
--			"(c) 2003, 2004 Novell, Inc",
--			I18N_NOOP( "OpenOffice.org is an office suite.\n" ),
-+			ki18n( "Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Novell, Inc"),
-+			ki18n( "OpenOffice.org is an office suite.\n" ),
- 			"http://kde.openoffice.org/index.html",
--			"dev at kde.openoffice.org");
--	kAboutData->addAuthor( "Jan Holesovsky",
--			I18N_NOOP( "Original author and maintainer of the KDE NWF." ),
-+			"dev at kde.openoffice.org" );
-+	kAboutData->addAuthor( ki18n( "Jan Holesovsky" ),
-+			ki18n( "Original author and maintainer of the KDE NWF." ),
- 			"kendy at artax.karlin.mff.cuni.cz",
- 			"http://artax.karlin.mff.cuni.cz/~kendy" );
-+	kAboutData->addAuthor( ki18n("Eric Bischoff"),
-+			ki18n( "Accessibility fixes, porting to KDE 4." ),
-+			"bischoff at kde.org" );
- 
-     m_nFakeCmdLineArgs = 1;
- 	USHORT nIdx;
-@@ -191,11 +195,10 @@
- 
- 	KCmdLineArgs::init( m_nFakeCmdLineArgs, m_pAppCmdLineArgs, kAboutData );
- 
--	KApplication::disableAutoDcopRegistration();
- 	m_pApplication = new VCLKDEApplication();
--    kapp->disableSessionManagement();
-+	kapp->disableSessionManagement();
- 	
--	Display* pDisp = QPaintDevice::x11AppDisplay();
-+	Display* pDisp = QX11Info::display();
- 
- 	SalDisplay *pSalDisplay = new SalKDEDisplay( pDisp );
- 
diff --git a/patches/dev300/kde4-salnativewidgets-kde.diff b/patches/dev300/kde4-salnativewidgets-kde.diff
deleted file mode 100644
index 10f59bd..0000000
--- a/patches/dev300/kde4-salnativewidgets-kde.diff
+++ /dev/null
@@ -1,2187 +0,0 @@
---- vcl/unx/kde/salnativewidgets-kde.cxx.old	2008-03-23 22:48:32.000000000 +0100
-+++ vcl/unx/kde/salnativewidgets-kde.cxx	2008-03-25 22:16:15.000000000 +0100
-@@ -109,15 +109,6 @@
- 	*/
- 	QComboBox    *m_pComboBox;
- 
--	/** Cached editable combo box.
--
--	    Needed, because some styles do not like dynamic changes
--	    (QComboBox::setEditable()).
--
--	    @see m_pPushButton
--	*/
--	QComboBox    *m_pEditableComboBox;
--
- 	/** Cached line edit box.
- 
- 	    @see m_pPushButton
-@@ -128,27 +119,21 @@
- 
- 	    @see m_pPushButton
- 	*/
--	QSpinWidget  *m_pSpinWidget;
--
--	/** Cached spin box'es line edit.
-+	QSpinBox     *m_pSpinBox;
- 
--	    @see m_pPushButton
--	*/
--	QLineEdit    *m_pSpinEdit;
--
--	/** Cached tab.
-+	/** Identifiers of tabs.
- 
- 	    Left, middle, right tab and a tab which is alone.
- 
- 	    @see m_pPushButton
- 	*/
--	QTab         *m_pTabLeft, *m_pTabMiddle, *m_pTabRight, *m_pTabAlone;
-+	int          m_nTabLeft, m_nTabMiddle, m_nTabRight, m_nTabAlone;
- 
- 	/** Cached tab bar's parent widget.
- 
- 	    Needed, because the Qt windows style checks for the availability
- 	    of tab bar's parent. We cannot use m_pTabWidget, because
--	    TabWidget::setTabBar() and TabWidget::tabBar() methods are
-+	    QTabWidget::setTabBar() and QTabWidget::tabBar() methods are
- 	    protected.
- 
- 	    @see m_pPushButton, m_pTabWidget
-@@ -207,19 +192,23 @@
-     */
-     QMenuBar     *m_pMenuBar;
- 
--    /** Identifiers of menu bar items.
-+    /** Cached menu bar items.
-+
-+      @see m_pPushButton
-      */
--    int           m_nMenuBarEnabledItem, m_nMenuBarDisabledItem;
-+    QAction      *m_pMenuBarEnabledItem, *m_pMenuBarDisabledItem;
- 
-     /** Cached popup menu.
- 
-       @see m_pPushButton
-     */
--    QPopupMenu   *m_pPopupMenu;
-+    QMenu        *m_pPopupMenu;
-+
-+    /** Cached popup menu items.
- 
--    /** Identifiers of popup menu items.
-+      @see m_pPushButton
-      */
--    int           m_nPopupMenuEnabledItem, m_nPopupMenuDisabledItem;
-+    QAction      *m_pPopupMenuEnabledItem, *m_pPopupMenuDisabledItem;
-     
-     /** cached progress bar
-       */
-@@ -248,12 +237,12 @@
- 	/** Paints the specified widget to the X window.
- 
- 	    Use X calls to bitblt (bit block transfer) the widget qWidget to
--	    the window specified by drawable with the style defined by nStyle.
-+	    the window specified by drawable with the style defined by nState.
- 
- 	    @param qWidget
- 	    A pointer to the cached widget.
- 
--	    @param nState
-+	    @param nControlState
- 	    The state of the control (focused, on/off, ...)
- 
- 	    @param aValue
-@@ -269,7 +258,7 @@
- 	    The graphics context.
- 	*/
-         BOOL drawStyledWidget( QWidget *pWidget,
--                ControlState nState, const ImplControlValue& aValue,
-+                ControlState nControlState, const ImplControlValue& aValue,
-                 Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc,
-                 ControlPart nPart = PART_ENTIRE_CONTROL );
- 
-@@ -297,10 +286,7 @@
- 
- 	/** 'Get' method for combo box.
- 
--	    It returns m_pComboBox or m_pEditableComboBox according to
--	    bEditable.
--
--	    @see pushButton(), m_pEditableComboBox
-+	    @see pushButton()
- 	*/
- 	QComboBox    *comboBox( const Region& rControlRegion, BOOL bEditable );
- 
-@@ -314,7 +300,7 @@
- 
- 	    @see pushButton()
- 	*/
--	QSpinWidget  *spinWidget( const Region& rControlRegion );
-+	QSpinBox     *spinBox( const Region& rControlRegion );
- 
- 	/** 'Get' method for tab bar.
- 
-@@ -363,7 +349,7 @@
- 
-       @see pushButton()
-     */
--    QPopupMenu   *popupMenu( const Region& rControlRegion );
-+    QMenu        *popupMenu( const Region& rControlRegion );
-     
-     /** 'Get' method for progress bar
-     
-@@ -379,14 +365,14 @@
- 	    Conversion function between VCL ControlState together with
- 	    ImplControlValue and Qt state flags.
- 
--	    @param nState
-+	    @param nControlState
- 	    State of the widget (default, focused, ...) as defined in Native
- 	    Widget Framework.
- 
- 	    @param aValue
- 	    Value held by the widget (on, off, ...)
- 	*/
--	QStyle::SFlags vclStateValue2SFlags( ControlState nState, const ImplControlValue& aValue );
-+	QStyle::State vclStateValue2StateFlag( ControlState nControlState, const ImplControlValue& aValue );
- 
-     public:
- 	/** Convert VCL Region to QRect.
-@@ -405,14 +391,12 @@
-       m_pRadioButton( NULL ),
-       m_pCheckBox( NULL ),
-       m_pComboBox( NULL ),
--      m_pEditableComboBox( NULL ),
-       m_pLineEdit( NULL ),
--      m_pSpinWidget( NULL ),
--      m_pSpinEdit( NULL ),
--      m_pTabLeft( NULL ),
--      m_pTabMiddle( NULL ),
--      m_pTabRight( NULL ),
--      m_pTabAlone( NULL ),
-+      m_pSpinBox( NULL ),
-+      m_nTabLeft( -1 ),
-+      m_nTabMiddle( -1 ),
-+      m_nTabRight( -1 ),
-+      m_nTabAlone( -1 ),
-       m_pTabBarParent( NULL ),
-       m_pTabBar( NULL ),
-       m_pTabWidget( NULL ),
-@@ -423,7 +407,11 @@
-       m_pToolBarVert( NULL ),
-       m_pToolButton( NULL ),
-       m_pMenuBar( NULL ),
-+      m_pMenuBarEnabledItem( NULL ),
-+      m_pMenuBarDisabledItem( NULL ),
-       m_pPopupMenu( NULL ),
-+      m_pPopupMenuEnabledItem( NULL ),
-+      m_pPopupMenuDisabledItem( NULL ),
-       m_pProgressBar( NULL )
- {
- }
-@@ -434,16 +422,10 @@
-     delete m_pRadioButton, m_pRadioButton = NULL;
-     delete m_pCheckBox, m_pCheckBox = NULL;
-     delete m_pComboBox, m_pComboBox = NULL;
--    delete m_pEditableComboBox, m_pEditableComboBox = NULL;
-     delete m_pLineEdit, m_pLineEdit = NULL;
--    delete m_pSpinWidget, m_pSpinWidget = NULL;
--    m_pSpinEdit = NULL; // Deleted in m_pSpinWidget's destructor
--    delete m_pTabAlone, m_pTabAlone = NULL;
-+    delete m_pSpinBox, m_pSpinBox = NULL;
-     delete m_pTabBarParent, m_pTabBarParent = NULL;
-     m_pTabBar = NULL;    // Deleted in m_pTabBarParent's destructor
--    m_pTabLeft = NULL;
--    m_pTabMiddle = NULL;
--    m_pTabRight = NULL;
-     delete m_pTabWidget, m_pTabWidget = NULL;
-     delete m_pListView, m_pListView = NULL;
-     delete m_pScrollBar, m_pScrollBar = NULL;
-@@ -452,24 +434,28 @@
-     delete m_pMainWindow, m_pMainWindow = NULL;
-     delete m_pToolButton, m_pToolButton = NULL;
-     delete m_pMenuBar, m_pMenuBar = NULL;
-+    m_pMenuBarEnabledItem = NULL; // Already deleted by the menu bar ???
-+    m_pMenuBarDisabledItem = NULL; // Already deleted by the menu bar ???
-     delete m_pPopupMenu, m_pPopupMenu = NULL;
-+    m_pPopupMenuEnabledItem = NULL; // Already deleted by the popup menu ???
-+    m_pPopupMenuDisabledItem = NULL; // Already deleted by the popup menu ???
-     delete m_pProgressBar, m_pProgressBar = NULL;
- }
- 
- BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
--	ControlState nState, const ImplControlValue& aValue,
-+	ControlState nControlState, const ImplControlValue& aValue,
-         Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc,
-         ControlPart nPart )
- {
-     if ( !pWidget )
--	return FALSE;
-+		return FALSE;
- 
-     // Normalize the widget
-     QPoint   qWidgetPos( pWidget->pos() );
-     pWidget->move( 0, 0 );
- 
-     // Enable/disable the widget
--    pWidget->setEnabled( nState & CTRL_STATE_ENABLED );
-+    pWidget->setEnabled( nControlState & CTRL_STATE_ENABLED );
- 
-     // Create pixmap to paint to
-     QPixmap  qPixmap( pWidget->width(), pWidget->height() );
-@@ -480,340 +466,386 @@
-     qPixmap.fill( pWidget, QPoint(0, 0) );
-     
-     // Convert the flags
--    QStyle::SFlags nStyle = vclStateValue2SFlags( nState, aValue );
-+    QStyle::State nState = vclStateValue2StateFlag( nControlState, aValue );
-     
-     // Store the widget class
--    const char *pClassName = pWidget->className();
-+    const char *pClassName = pWidget->metaObject()->className();
-     
-     // Draw the widget to the pixmap
-     if ( strcmp( "QPushButton", pClassName ) == 0 )
-     {
--	// Workaround for the Platinum style.
--	// Platinum takes the state directly from the widget, not from SFlags.
--	QPushButton *pPushButton = static_cast<QPushButton *>( pWidget->qt_cast( "QPushButton" ) );
--	if ( pPushButton )
--	{
--	    pPushButton->setDown   ( nStyle & QStyle::Style_Down );
--	    pPushButton->setOn     ( nStyle & QStyle::Style_On );
--	    pPushButton->setEnabled( nStyle & QStyle::Style_Enabled );
--	}
--	
--	kapp->style().drawControl( QStyle::CE_PushButton,
--		&qPainter, pWidget, qRect,
--		pWidget->colorGroup(), nStyle );
-+		// Workaround for the Platinum style.
-+		// Platinum takes the state directly from the widget, not from StateFlag.
-+		QPushButton *pPushButton = qobject_cast<QPushButton *>( pWidget );
-+		if ( pPushButton )
-+		{
-+		    pPushButton->setDown   ( nState & QStyle::State_Sunken );
-+		    pPushButton->setChecked( nState & QStyle::State_On );
-+		    pPushButton->setEnabled( nState & QStyle::State_Enabled );
-+		}
-+
-+		QStyleOptionButton aStyleOption;	
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState;
-+		kapp->style()->drawControl( QStyle::CE_PushButton,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QRadioButton", pClassName ) == 0 )
-     {
--	// Bitblt from the screen, because the radio buttons are usually not
--	// rectangular, and there could be a bitmap under them
--	GC aTmpGC = XCreateGC( dpy, qPixmap.handle(), 0, NULL );
--    X11SalGraphics::CopyScreenArea( dpy,
-+		// Bitblt from the screen, because the radio buttons are usually not
-+		// rectangular, and there could be a bitmap under them
-+		GC aTmpGC = XCreateGC( dpy, qPixmap.handle(), 0, NULL );
-+        X11SalGraphics::CopyScreenArea( dpy,
-                               drawable, nScreen, nDepth,
--                              qPixmap.handle(), qPixmap.x11Screen(), qPixmap.x11Depth(),
-+                              qPixmap.handle(), qPixmap.x11Info().screen(), qPixmap.x11Info().depth(),
-                               aTmpGC,
-                               qWidgetPos.x(), qWidgetPos.y(), qRect.width(), qRect.height(),
-                               0, 0 );
--	XFreeGC( dpy, aTmpGC );
-+		XFreeGC( dpy, aTmpGC );
-+
-+		QStyleOptionButton aStyleOption;	
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState;
- 
--	kapp->style().drawControl( QStyle::CE_RadioButton,
--		&qPainter, pWidget, qRect,
--		pWidget->colorGroup(), nStyle );
-+		kapp->style()->drawControl( QStyle::CE_RadioButton,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QCheckBox", pClassName ) == 0 )
-     {
--	kapp->style().drawControl( QStyle::CE_CheckBox,
--		&qPainter, pWidget, qRect,
--		pWidget->colorGroup(), nStyle );
-+		QStyleOption aStyleOption;	
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState;
-+
-+		kapp->style()->drawControl( QStyle::CE_CheckBox,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QComboBox", pClassName ) == 0 )
-     {
--	kapp->style().drawComplexControl( QStyle::CC_ComboBox,
--		&qPainter, pWidget, qRect,
--		pWidget->colorGroup(), nStyle );
-+		QStyleOptionComboBox aStyleOption;	
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState;
-+
-+		kapp->style()->drawComplexControl( QStyle::CC_ComboBox,
-+			&aStyleOption, &qPainter, pWidget);
- 	
--	// Editable combo box uses the background of the associated edit box
--	QComboBox *pComboBox = static_cast<QComboBox *>( pWidget->qt_cast( "QComboBox" ) );
--	if ( pComboBox && pComboBox->editable() && pComboBox->lineEdit() )
--	{
--	    QColorGroup::ColorRole eColorRole = ( pComboBox->isEnabled() )?
--		QColorGroup::Base: QColorGroup::Background;
--	    qPainter.fillRect( 
--		    kapp->style().querySubControlMetrics( QStyle::CC_ComboBox, 
--			pComboBox, QStyle::SC_ComboBoxEditField ),
--		    pComboBox->lineEdit()->colorGroup().brush( eColorRole ) );
--	}
-+		// Editable combo box uses the background of the associated edit box
-+		QComboBox *pComboBox = qobject_cast<QComboBox *>( pWidget );
-+		if ( pComboBox && pComboBox->isEditable() && pComboBox->lineEdit() )
-+		{
-+	    	QPalette::ColorRole eColorRole = ( pComboBox->isEnabled() )?
-+			QPalette::Base: QPalette::Background;
-+	    	qPainter.fillRect( 
-+		    	kapp->style()->subControlRect( QStyle::CC_ComboBox, &aStyleOption, QStyle::SC_ComboBoxEditField ),
-+		    	pComboBox->lineEdit()->palette().brush( eColorRole ) );
-+		}
-     }
-     else if ( strcmp( "QLineEdit", pClassName ) == 0 )
-     {
--	kapp->style().drawPrimitive( QStyle::PE_PanelLineEdit,
--		&qPainter, qRect,
--		pWidget->colorGroup(), nStyle | QStyle::Style_Sunken );
-+		QStyleOption aStyleOption;
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = (QStyle::State) (nState | QStyle::State_Sunken);
-+
-+		kapp->style()->drawPrimitive( QStyle::PE_PanelLineEdit,
-+			&aStyleOption, &qPainter);
-+
-     }
--    else if ( strcmp( "QSpinWidget", pClassName ) == 0 )
-+    else if ( strcmp( "QSpinBox", pClassName ) == 0 )
-     {
--	SpinbuttonValue *pValue = static_cast<SpinbuttonValue *> ( aValue.getOptionalVal() );
-+		SpinbuttonValue *pValue = static_cast<SpinbuttonValue *> ( aValue.getOptionalVal() );
- 	
--	// Is any of the buttons pressed?
--	QStyle::SCFlags eActive = QStyle::SC_None;
--	if ( pValue )
--	{
--	    if ( pValue->mnUpperState & CTRL_STATE_PRESSED )
--		eActive = QStyle::SC_SpinWidgetUp;
--	    else if ( pValue->mnLowerState & CTRL_STATE_PRESSED )
--		eActive = QStyle::SC_SpinWidgetDown;
--
--	    // Update the enable/disable state of the widget
--	    if ( ( nState & CTRL_STATE_ENABLED ) ||
--		    ( pValue->mnUpperState & CTRL_STATE_ENABLED ) ||
--		    ( pValue->mnLowerState & CTRL_STATE_ENABLED ) )
--	    {
--		pWidget->setEnabled( true );
--		nStyle |= QStyle::Style_Enabled;
--	    }
--	    else
--		pWidget->setEnabled( false );
-+		// Is any of the buttons pressed?
-+		QStyle::SubControl eActive = QStyle::SC_None;
-+		if ( pValue )
-+		{
-+	    	if ( pValue->mnUpperState & CTRL_STATE_PRESSED )
-+				eActive = QStyle::SC_SpinBoxUp;
-+	    	else if ( pValue->mnLowerState & CTRL_STATE_PRESSED )
-+				eActive = QStyle::SC_SpinBoxDown;
-+
-+	    	// Update the enable/disable state of the widget
-+	    	if ( ( nControlState & CTRL_STATE_ENABLED ) ||
-+		    	( pValue->mnUpperState & CTRL_STATE_ENABLED ) ||
-+		    	( pValue->mnLowerState & CTRL_STATE_ENABLED ) )
-+	    	{
-+				pWidget->setEnabled( true );
-+				nState |= QStyle::State_Enabled;
-+	    	}
-+	    	else
-+				pWidget->setEnabled( false );
-+
-+	    	// Mouse-over effect
-+	    	if ( (pValue->mnUpperState & CTRL_STATE_ROLLOVER) ||
-+		    	(pValue->mnLowerState & CTRL_STATE_ROLLOVER) )
-+				nState |= QStyle::State_MouseOver;
-+		}
- 
--	    // Mouse-over effect
--	    if ( (pValue->mnUpperState & CTRL_STATE_ROLLOVER) ||
--		    (pValue->mnLowerState & CTRL_STATE_ROLLOVER) )
--		nStyle |= QStyle::Style_MouseOver;
--	}
--
--	// Spin widget uses the background of the associated edit box
--	QSpinWidget *pSpinWidget = static_cast<QSpinWidget *>( pWidget->qt_cast( "QSpinWidget" ) );
--	if ( pSpinWidget && pSpinWidget->editWidget() )
--	{
--	    QColorGroup::ColorRole eColorRole = ( pSpinWidget->isEnabled() )?
--		QColorGroup::Base: QColorGroup::Background;
--	    qPainter.fillRect( 
--		    kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget, 
--			pSpinWidget, QStyle::SC_SpinWidgetEditField ),
--		    pSpinWidget->editWidget()->colorGroup().brush( eColorRole ) );
--	}
--
--	// Adjust the frame (needed for Motif Plus style)
--	QRect qFrameRect = kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget,
--		pWidget, QStyle::SC_SpinWidgetFrame );
--	
--	kapp->style().drawComplexControl( QStyle::CC_SpinWidget,
--		&qPainter, pWidget, qFrameRect,
--		pWidget->colorGroup(), nStyle,
--		QStyle::SC_All, eActive );
-+		// Spin widget uses the background of the associated edit box
-+		QSpinBox *pSpinBox = qobject_cast<QSpinBox *>( pWidget );
-+        QStyleOptionSpinBox aStyleOption;
-+
-+		if ( pSpinBox )
-+		{
-+	    	QPalette::ColorRole eColorRole = ( pSpinBox->isEnabled() )?
-+			QPalette::Base: QPalette::Background;
-+	    	qPainter.fillRect( 
-+		    	kapp->style()->subControlRect( QStyle::CC_SpinBox, &aStyleOption, QStyle::SC_SpinBoxEditField ),
-+		    	pSpinBox->palette().brush( eColorRole ) );
-+		}
-+
-+		// Adjust the frame (needed for Motif Plus style)
-+		aStyleOption.rect = kapp->style()->subControlRect( QStyle::CC_SpinBox, &aStyleOption, QStyle::SC_SpinBoxFrame );
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState;
-+		aStyleOption.subControls = QStyle::SC_All;
-+		aStyleOption.activeSubControls = eActive;
-+
-+		kapp->style()->drawComplexControl( QStyle::CC_SpinBox,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QTabBar", pClassName ) == 0 )
-     {
--	TabitemValue *pValue = static_cast<TabitemValue *> ( aValue.getOptionalVal() );
--	
--	QTab *pTab = NULL;
--	if ( pValue )
--	{
--	    if ( ( pValue->isFirst() || pValue->isLeftAligned() ) && ( pValue->isLast() || pValue->isRightAligned() ) )
--		pTab = m_pTabAlone;
--	    else if ( pValue->isFirst() || pValue->isLeftAligned() )
--		pTab = m_pTabLeft;
--	    else if ( pValue->isLast() || pValue->isRightAligned() )
--		pTab = m_pTabRight;
--	    else
--		pTab = m_pTabMiddle;
--	}
--	if ( !pTab )
--	    return FALSE;
-+		TabitemValue *pValue = static_cast<TabitemValue *> ( aValue.getOptionalVal() );
- 	
--	pTab->setRect( qRect );
-+		int nTab = -1;
-+		if ( pValue )
-+		{
-+	    	if ( ( pValue->isFirst() || pValue->isLeftAligned() ) && ( pValue->isLast() || pValue->isRightAligned() ) )
-+				nTab = m_nTabAlone;
-+	    	else if ( pValue->isFirst() || pValue->isLeftAligned() )
-+				nTab = m_nTabLeft;
-+	    	else if ( pValue->isLast() || pValue->isRightAligned() )
-+				nTab = m_nTabRight;
-+	    	else
-+				nTab = m_nTabMiddle;
-+		}
-+		if ( nTab == -1 )
-+	    	return FALSE;
- 	
--	kapp->style().drawControl( QStyle::CE_TabBarTab,
--		&qPainter, pWidget, qRect,
--		pWidget->colorGroup(), nStyle,
--		QStyleOption( pTab ) );
-+		QStyleOptionTabBarBase aStyleOption;
-+		aStyleOption.rect = qRect;
-+		aStyleOption.state = nState;
-+		aStyleOption.palette = pWidget->palette();
-+
-+		kapp->style()->drawControl( QStyle::CE_TabBarTab,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QTabWidget", pClassName ) == 0 )
-     {
--	kapp->style().drawPrimitive( QStyle::PE_PanelTabWidget,
--		&qPainter, qRect,
--		pWidget->colorGroup(), nStyle );
-+		QStyleOptionTab aStyleOption;
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState;
-+
-+		kapp->style()->drawPrimitive( QStyle::PE_FrameTabWidget,
-+			&aStyleOption, &qPainter);
-     }
-     else if ( strcmp( "QListView", pClassName ) == 0 )
-     {
--	kapp->style().drawPrimitive( QStyle::PE_Panel,
--		&qPainter, qRect,
--		pWidget->colorGroup(), nStyle | QStyle::Style_Sunken );
-+		QStyleOption aStyleOption;
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState | QStyle::State_Sunken;
-+
-+		kapp->style()->drawPrimitive( QStyle::PE_Frame,
-+			&aStyleOption, &qPainter);
-     }
-     else if ( strcmp( "QScrollBar", pClassName ) == 0 )
-     {
--	ScrollbarValue *pValue = static_cast<ScrollbarValue *> ( aValue.getOptionalVal() );
--
--	QStyle::SCFlags eActive = QStyle::SC_None;
--	if ( pValue )
--	{
--	    // Workaround for Style_MouseOver-aware themes.
--	    // Quite ugly, but I do not know about a better solution.
--	    const char *pStyleName = kapp->style().className();
--	    if ( strcmp( "QMotifPlusStyle", pStyleName ) == 0 )
--	    {
--		nStyle |= QStyle::Style_MouseOver;
--		if ( pValue->mnThumbState & CTRL_STATE_ROLLOVER )
--		    eActive = QStyle::SC_ScrollBarSlider;
--	    }
--	    else if ( strcmp( "QSGIStyle", pStyleName ) == 0 )
--	    {
--		nStyle |= QStyle::Style_MouseOver;
--		if ( pValue->mnButton1State & CTRL_STATE_ROLLOVER )
--		    eActive = QStyle::SC_ScrollBarSubLine;
--		else if ( pValue->mnButton2State & CTRL_STATE_ROLLOVER )
--		    eActive = QStyle::SC_ScrollBarAddLine;
--		else if ( pValue->mnThumbState & CTRL_STATE_ROLLOVER )
--		    eActive = QStyle::SC_ScrollBarSlider;
--	    }
-+		ScrollbarValue *pValue = static_cast<ScrollbarValue *> ( aValue.getOptionalVal() );
- 
--	    if ( pValue->mnButton1State & CTRL_STATE_PRESSED )
--		eActive = QStyle::SC_ScrollBarSubLine;
--	    else if ( pValue->mnButton2State & CTRL_STATE_PRESSED )
--		eActive = QStyle::SC_ScrollBarAddLine;
--	    else if ( pValue->mnThumbState & CTRL_STATE_PRESSED )
--		eActive = QStyle::SC_ScrollBarSlider;
--	    else if ( pValue->mnPage1State & CTRL_STATE_PRESSED )
--		eActive = QStyle::SC_ScrollBarSubPage;
--	    else if ( pValue->mnPage2State & CTRL_STATE_PRESSED )
--		eActive = QStyle::SC_ScrollBarAddPage;
--
--	    // Update the enable/disable state of the widget
--	    if ( ( nState & CTRL_STATE_ENABLED ) ||
--		    ( pValue->mnButton1State & CTRL_STATE_ENABLED ) ||
--		    ( pValue->mnButton2State & CTRL_STATE_ENABLED ) ||
--		    ( pValue->mnThumbState & CTRL_STATE_ENABLED ) ||
--		    ( pValue->mnPage1State & CTRL_STATE_ENABLED ) ||
--		    ( pValue->mnPage2State & CTRL_STATE_ENABLED ) )
--	    {
--		pWidget->setEnabled( true );
--		nStyle |= QStyle::Style_Enabled;
--	    }
--	    else
--		pWidget->setEnabled( false );
--	}
-+		QStyle::SubControl eActive = QStyle::SC_None;
-+		if ( pValue )
-+		{
-+	    	// Workaround for State_MouseOver-aware themes.
-+	    	// Quite ugly, but I do not know about a better solution.
-+	    	const char *pStyleName = kapp->style()->metaObject()->className();
-+	    	if ( strcmp( "QMotifPlusStyle", pStyleName ) == 0 )
-+	    	{
-+				nState |= QStyle::State_MouseOver;
-+				if ( pValue->mnThumbState & CTRL_STATE_ROLLOVER )
-+				    eActive = QStyle::SC_ScrollBarSlider;
-+	    	}
-+	    	else if ( strcmp( "QSGIStyle", pStyleName ) == 0 )
-+	    	{
-+				nState |= QStyle::State_MouseOver;
-+				if ( pValue->mnButton1State & CTRL_STATE_ROLLOVER )
-+		    		eActive = QStyle::SC_ScrollBarSubLine;
-+				else if ( pValue->mnButton2State & CTRL_STATE_ROLLOVER )
-+		    		eActive = QStyle::SC_ScrollBarAddLine;
-+				else if ( pValue->mnThumbState & CTRL_STATE_ROLLOVER )
-+		    		eActive = QStyle::SC_ScrollBarSlider;
-+	    	}
-+
-+	    	if ( pValue->mnButton1State & CTRL_STATE_PRESSED )
-+				eActive = QStyle::SC_ScrollBarSubLine;
-+	    	else if ( pValue->mnButton2State & CTRL_STATE_PRESSED )
-+				eActive = QStyle::SC_ScrollBarAddLine;
-+	    	else if ( pValue->mnThumbState & CTRL_STATE_PRESSED )
-+				eActive = QStyle::SC_ScrollBarSlider;
-+	    	else if ( pValue->mnPage1State & CTRL_STATE_PRESSED )
-+				eActive = QStyle::SC_ScrollBarSubPage;
-+	    	else if ( pValue->mnPage2State & CTRL_STATE_PRESSED )
-+				eActive = QStyle::SC_ScrollBarAddPage;
-+
-+	    	// Update the enable/disable state of the widget
-+	    	if ( ( nControlState & CTRL_STATE_ENABLED ) ||
-+		    	( pValue->mnButton1State & CTRL_STATE_ENABLED ) ||
-+		    	( pValue->mnButton2State & CTRL_STATE_ENABLED ) ||
-+		    	( pValue->mnThumbState & CTRL_STATE_ENABLED ) ||
-+		    	( pValue->mnPage1State & CTRL_STATE_ENABLED ) ||
-+		    	( pValue->mnPage2State & CTRL_STATE_ENABLED ) )
-+	    	{
-+				pWidget->setEnabled( true );
-+				nState |= QStyle::State_Enabled;
-+	    	}
-+	    	else
-+				pWidget->setEnabled( false );
-+		}
- 	
--	// Is it a horizontal scroll bar?
--	QScrollBar *pScrollBar = static_cast<QScrollBar *> ( pWidget->qt_cast( "QScrollBar" ) );
--	QStyle::StyleFlags eHoriz = QStyle::Style_Default;
--	if ( pScrollBar && pScrollBar->orientation() == Qt::Horizontal )
--	    eHoriz = QStyle::Style_Horizontal;
--
--	kapp->style().drawComplexControl( QStyle::CC_ScrollBar,
--		&qPainter, pWidget, qRect,
--		pWidget->colorGroup(), nStyle | eHoriz,
--		QStyle::SC_All, eActive );
-+		// Is it a horizontal scroll bar?
-+		QScrollBar *pScrollBar = qobject_cast<QScrollBar *>( pWidget );
-+		QStyle::State eHoriz = QStyle::State_None;
-+		if ( pScrollBar && pScrollBar->orientation() == Qt::Horizontal )
-+	    	eHoriz = QStyle::State_Horizontal;
-+
-+		QStyleOptionComplex aStyleOption;	
-+		aStyleOption.rect = qRect;
-+		aStyleOption.palette = pWidget->palette();
-+		aStyleOption.state = nState | eHoriz;
-+		aStyleOption.subControls = QStyle::SC_All;
-+		aStyleOption.activeSubControls = eActive;
-+
-+		kapp->style()->drawComplexControl( QStyle::CC_ScrollBar,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QToolBar", pClassName ) == 0 )
-     {
--        QToolBar *pToolBar = static_cast< QToolBar * >( pWidget->qt_cast( "QToolBar" ) );
-+        QToolBar *pToolBar = qobject_cast< QToolBar * >( pWidget );
-         bool bIsHorizontal = false;
-         if ( pToolBar && pToolBar->orientation() == Qt::Horizontal )
-         {
--            nStyle |= QStyle::Style_Horizontal;
-+            nState |= QStyle::State_Horizontal;
-             bIsHorizontal = true;
-         }
- 
--        kapp->style().drawControl( QStyle::CE_DockWindowEmptyArea,
--                &qPainter, pWidget, qRect,
--                pWidget->colorGroup(), nStyle );
-+		QStyleOptionToolBar aStyleOption;
-+		aStyleOption.rect = qRect;
-+		aStyleOption.state = nState;
-+		aStyleOption.palette = pWidget->palette();
-+
-+        kapp->style()->drawControl( QStyle::CE_HeaderEmptyArea,
-+			&aStyleOption, &qPainter, pWidget);
-+
-+        kapp->style()->drawPrimitive( QStyle::PE_FrameDockWidget,
-+			&aStyleOption, &qPainter);
- 
--        kapp->style().drawPrimitive( QStyle::PE_PanelDockWindow,
--                &qPainter, qRect, pWidget->colorGroup(), nStyle );
--        
-         if ( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
-         {
-             ToolbarValue *pValue = static_cast< ToolbarValue * >( aValue.getOptionalVal() );
-             
-             QRect qThumbRect = region2QRect( pValue->maGripRect );
--            qThumbRect.moveBy( -qWidgetPos.x(), -qWidgetPos.y() );
-+            qThumbRect.translate( -qWidgetPos.x(), -qWidgetPos.y() );
-             if ( bIsHorizontal )
--                qThumbRect.addCoords( 0, 2, 0, -3 );    // make the thumb a bit nicer
-+                qThumbRect.adjust( 0, 2, 0, -3 );    // make the thumb a bit nicer
-             else
--                qThumbRect.addCoords( 2, 0, -3, 0 );    // make the thumb a bit nicer
-+                qThumbRect.adjust( 2, 0, -3, 0 );    // make the thumb a bit nicer
- 
--            if ( kapp->style().inherits( "HighColorStyle" ) ||
--                 kapp->style().inherits( "HighContrastStyle" ) ||
--                 kapp->style().inherits( "KeramikStyle" ) ||
--                 kapp->style().inherits( "KThemeStyle" ) ||
--                 kapp->style().inherits( "ThinKeramikStyle" ) )
--            {
--                // Workaround for the workaround in KStyle::drawPrimitive()
--                KStyle *pStyle = static_cast< KStyle * >( &kapp->style() );
--                pStyle->drawKStylePrimitive( KStyle::KPE_ToolBarHandle,
--                        &qPainter, pToolBar, qThumbRect,
--                        pWidget->colorGroup(), nStyle );
--            }
--            else
--                kapp->style().drawPrimitive( QStyle::PE_DockWindowHandle,
--                        &qPainter, qThumbRect, pWidget->colorGroup(), nStyle );
-+	    	aStyleOption.rect = qThumbRect;
-+            kapp->style()->drawPrimitive( QStyle::PE_IndicatorToolBarHandle,
-+				&aStyleOption, &qPainter);
-         }
-     }
-     else if ( strcmp( "QToolButton", pClassName ) == 0 )
-     {
--        if( (nStyle & QStyle::Style_MouseOver) )
--            nStyle &= ~QStyle::Style_Off;
--        kapp->style().drawComplexControl( QStyle::CC_ToolButton,
--                &qPainter, pWidget, qRect,
--                pWidget->colorGroup(), nStyle,
--                QStyle::SC_ToolButton );
-+        if ( nState & QStyle::State_MouseOver )
-+            nState &= ~QStyle::State_Off;
-+
-+		QStyleOptionToolButton aStyleOption;
-+		aStyleOption.rect = qRect;
-+		aStyleOption.state = nState;
-+		aStyleOption.palette = pWidget->palette();
-+        aStyleOption.subControls = QStyle::SC_ToolButton;
-+
-+        kapp->style()->drawComplexControl( QStyle::CC_ToolButton,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QMenuBar", pClassName ) == 0 )
-     {
-         if ( nPart == PART_ENTIRE_CONTROL )
-         {
--            kapp->style().drawControl( QStyle::CE_MenuBarEmptyArea,
--                    &qPainter, pWidget, qRect,
--                    pWidget->colorGroup(), nStyle );
-+	    	QStyleOption aStyleOption;
-+	    	aStyleOption.rect = qRect;
-+	    	aStyleOption.state = nState;
-+	    	aStyleOption.palette = pWidget->palette();
-+
-+            kapp->style()->drawControl( QStyle::CE_MenuBarEmptyArea,
-+				&aStyleOption, &qPainter, pWidget);
-         }
-         else if ( nPart == PART_MENU_ITEM )
-         {
--            int nMenuItem = ( nStyle & QStyle::Style_Enabled )? m_nMenuBarEnabledItem: m_nMenuBarDisabledItem;
--            QMenuItem *pMenuItem = static_cast<QMenuBar*>( pWidget )->findItem( nMenuItem );
-+//          QAction *pMenuItem = ( nState & QStyle::State_Enabled )? m_pMenuBarEnabledItem: m_pMenuBarDisabledItem;
- 
--            if ( nStyle & QStyle::Style_Selected )
--                nStyle |= QStyle::Style_Active | QStyle::Style_Down | QStyle::Style_HasFocus;
-+            if ( nState & QStyle::State_Selected )
-+                nState |= QStyle::State_Active | QStyle::State_Sunken | QStyle::State_HasFocus;
- 
--            kapp->style().drawControl( QStyle::CE_MenuBarItem,
--                    &qPainter, pWidget, qRect,
--                    pWidget->colorGroup(), nStyle,
--                    QStyleOption( pMenuItem ) );
-+            QStyleOptionMenuItem aStyleOption;
-+//          aStyleOption.initFrom( pMenuItem ); does not work, actions are not widgets
-+            aStyleOption.rect = qRect;
-+            aStyleOption.state = nState;
-+	    	aStyleOption.palette = pWidget->palette();
-+
-+            kapp->style()->drawControl( QStyle::CE_MenuBarItem,
-+				&aStyleOption, &qPainter, pWidget);
-         }
-     }
--    else if ( strcmp( "QPopupMenu", pClassName ) == 0 )
-+    else if ( strcmp( "QMenu", pClassName ) == 0 )
-     {
--        int nMenuItem = ( nStyle & QStyle::Style_Enabled )? m_nPopupMenuEnabledItem: m_nPopupMenuDisabledItem;
--        QMenuItem *pMenuItem = static_cast<QPopupMenu*>( pWidget )->findItem( nMenuItem );
-+//      QAction *pMenuItem = ( nState & QStyle::State_Enabled )? m_pPopupMenuEnabledItem: m_pPopupMenuDisabledItem;
-+
-+        if ( nState & QStyle::State_Selected )
-+            nState |= QStyle::State_Active;
- 
--        if ( nStyle & QStyle::Style_Selected )
--            nStyle |= QStyle::Style_Active;
-+        QStyleOption aStyleOption;
-+//	aStyleOption.initFrom( pMenuItem ); does not work, actions are not widgets
-+        aStyleOption.rect = qRect;
-+        aStyleOption.state = nState;
-+        aStyleOption.palette = pWidget->palette();
- 
--        kapp->style().drawControl( QStyle::CE_PopupMenuItem,
--                &qPainter, pWidget, qRect,
--                pWidget->colorGroup(), nStyle,
--                QStyleOption( pMenuItem, 0, 0 ) );
-+        kapp->style()->drawControl( QStyle::CE_MenuItem,
-+			&aStyleOption, &qPainter, pWidget);
-     }
-     else if ( strcmp( "QProgressBar", pClassName ) == 0 )
-     {
-         long nProgressWidth = aValue.getNumericVal();
--        QProgressBar* pProgress = static_cast<QProgressBar*>(pWidget);
--        pProgress->setProgress( nProgressWidth, qRect.width() );
--
--        kapp->style().drawControl( QStyle::CE_ProgressBarGroove,
--            &qPainter, pWidget, qRect,
--            pWidget->colorGroup(), nStyle );
--        kapp->style().drawControl( QStyle::CE_ProgressBarContents,
--            &qPainter, pWidget, qRect,
--            pWidget->colorGroup(), nStyle );
-+        QProgressBar* pProgress = static_cast<QProgressBar*>( pWidget );
-+        pProgress->setRange( 0, qRect.width() );
-+		pProgress->setValue( nProgressWidth );
-+
-+        QStyleOptionProgressBar aStyleOption;
-+        aStyleOption.rect = qRect;
-+        aStyleOption.state = nState;
-+        aStyleOption.palette = pWidget->palette();
-+
-+        kapp->style()->drawControl( QStyle::CE_ProgressBarGroove,
-+		&aStyleOption, &qPainter, pWidget);
-+        kapp->style()->drawControl( QStyle::CE_ProgressBarContents,
-+		&aStyleOption, &qPainter, pWidget);
-     }
-     else
--	return FALSE;
-+		return FALSE;
- 
-     // Bitblt it to the screen
-     X11SalGraphics::CopyScreenArea( dpy,
--	                          qPixmap.handle(), qPixmap.x11Screen(), qPixmap.x11Depth(),
--                              drawable, nScreen, nDepth,
--                              gc,
--                              0, 0, qRect.width(), qRect.height(),
--                              qWidgetPos.x(), qWidgetPos.y() );
-+        qPixmap.handle(), qPixmap.x11Info().screen(), qPixmap.x11Info().depth(),
-+        drawable, nScreen, nDepth,
-+        gc,
-+        0, 0, qRect.width(), qRect.height(),
-+        qWidgetPos.x(), qWidgetPos.y() );
- 
-     // Restore widget's position
-     pWidget->move( qWidgetPos );
-@@ -825,7 +857,7 @@
- 	BOOL bDefault )
- {
-     if ( !m_pPushButton )
--	m_pPushButton = new QPushButton( NULL, "push_button" );
-+	m_pPushButton = new QPushButton( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
- 
-@@ -835,20 +867,23 @@
-     // FIXME Fix Keramik style to be consistant with Qt built-in styles. Aargh!
-     if ( bDefault )
-     {
--	QSize qContentsSize( 50, 50 );
--	m_pPushButton->setDefault( false );
--	QSize qNormalSize = kapp->style().sizeFromContents( QStyle::CT_PushButton,
--		m_pPushButton, qContentsSize );
--	m_pPushButton->setDefault( true );
--	QSize qDefSize = kapp->style().sizeFromContents( QStyle::CT_PushButton,
--		m_pPushButton, qContentsSize );
-+		QSize qContentsSize( 50, 50 );
-+		QStyleOptionButton aStyleOption;
-+
-+		m_pPushButton->setDefault( false );
-+		QSize qNormalSize = kapp->style()->sizeFromContents( QStyle::CT_PushButton,
-+			&aStyleOption, qContentsSize, m_pPushButton );
-+		m_pPushButton->setDefault( true );
-+		QSize qDefSize = kapp->style()->sizeFromContents( QStyle::CT_PushButton,
-+			&aStyleOption, qContentsSize, m_pPushButton );
- 	
--	int nIndicatorSize = kapp->style().pixelMetric(
--		QStyle::PM_ButtonDefaultIndicator, m_pPushButton );
--	if ( qNormalSize.width() == qDefSize.width() )
--	    qRect.addCoords( nIndicatorSize, 0, -nIndicatorSize, 0 );
--	if ( qNormalSize.height() == qDefSize.height() )
--	    qRect.addCoords( 0, nIndicatorSize, 0, -nIndicatorSize );
-+		int nIndicatorSize = kapp->style()->pixelMetric( QStyle::PM_ButtonDefaultIndicator,
-+			&aStyleOption, m_pPushButton );
-+
-+		if ( qNormalSize.width() == qDefSize.width() )
-+	    	qRect.adjust( nIndicatorSize, 0, -nIndicatorSize, 0 );
-+		if ( qNormalSize.height() == qDefSize.height() )
-+	    	qRect.adjust( 0, nIndicatorSize, 0, -nIndicatorSize );
-     }
-     
-     m_pPushButton->move( qRect.topLeft() );
-@@ -861,24 +896,25 @@
- QRadioButton *WidgetPainter::radioButton( const Region& rControlRegion )
- {
-     if ( !m_pRadioButton )
--	m_pRadioButton = new QRadioButton( NULL, "radio_button" );
-+		m_pRadioButton = new QRadioButton( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
-+    QStyleOptionButton aStyleOption;
- 
-     // Workaround for broken themes which do not honor the given size.
-     // Quite ugly, but I do not know about a better solution.
--    const char *pStyleName = kapp->style().className();
-+    const char *pStyleName = kapp->style()->metaObject()->className();
-     if ( strcmp( "KThemeStyle", pStyleName ) == 0 )
-     {
--	QRect qOldRect( qRect );
-+		QRect qOldRect( qRect );
- 	
--	qRect.setWidth( kapp->style().pixelMetric(
--		QStyle::PM_ExclusiveIndicatorWidth, m_pRadioButton ) );
--	qRect.setHeight( kapp->style().pixelMetric(
--		QStyle::PM_ExclusiveIndicatorHeight, m_pRadioButton ) );
--	
--	qRect.moveBy( ( qOldRect.width() - qRect.width() ) / 2,
--		( qOldRect.height() - qRect.height() ) / 2 );
-+		qRect.setWidth( kapp->style()->pixelMetric( QStyle::PM_ExclusiveIndicatorWidth,
-+			&aStyleOption, m_pRadioButton ) );
-+		qRect.setHeight( kapp->style()->pixelMetric( QStyle::PM_ExclusiveIndicatorHeight,
-+			&aStyleOption, m_pRadioButton ) );
-+
-+		qRect.translate( ( qOldRect.width() - qRect.width() ) / 2,
-+			( qOldRect.height() - qRect.height() ) / 2 );
-     }
- 
-     m_pRadioButton->move( qRect.topLeft() );
-@@ -890,24 +926,25 @@
- QCheckBox *WidgetPainter::checkBox( const Region& rControlRegion )
- {
-     if ( !m_pCheckBox )
--	m_pCheckBox = new QCheckBox( NULL, "check_box" );
-+		m_pCheckBox = new QCheckBox( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
-+    QStyleOption aStyleOption;
- 
-     // Workaround for broken themes which do not honor the given size.
-     // Quite ugly, but I do not know about a better solution.
--    const char *pStyleName = kapp->style().className();
-+    const char *pStyleName = kapp->style()->metaObject()->className();
-     if ( strcmp( "KThemeStyle", pStyleName ) == 0 )
-     {
--	QRect qOldRect( qRect );
-+		QRect qOldRect( qRect );
- 	
--	qRect.setWidth( kapp->style().pixelMetric(
--		QStyle::PM_IndicatorWidth, m_pCheckBox ) );
--	qRect.setHeight( kapp->style().pixelMetric(
--		QStyle::PM_IndicatorHeight, m_pCheckBox ) );
-+		qRect.setWidth( kapp->style()->pixelMetric( QStyle::PM_IndicatorWidth,
-+			&aStyleOption, m_pCheckBox ) );
-+		qRect.setHeight( kapp->style()->pixelMetric( QStyle::PM_IndicatorHeight,
-+			&aStyleOption, m_pCheckBox ) );
- 	
--	qRect.moveBy( ( qOldRect.width() - qRect.width() ) / 2,
--		( qOldRect.height() - qRect.height() ) / 2 );
-+		qRect.translate( ( qOldRect.width() - qRect.width() ) / 2,
-+			( qOldRect.height() - qRect.height() ) / 2 );
-     }
- 
-     m_pCheckBox->move( qRect.topLeft() );
-@@ -919,32 +956,23 @@
- QComboBox *WidgetPainter::comboBox( const Region& rControlRegion,
- 	BOOL bEditable )
- {
--    QComboBox *pComboBox = NULL;
--    if ( bEditable )
--    {
--	if ( !m_pEditableComboBox )
--	    m_pEditableComboBox = new QComboBox( true, NULL, "combo_box_edit" );
--	pComboBox = m_pEditableComboBox;
--    }
--    else
--    {
--	if ( !m_pComboBox )
--	    m_pComboBox = new QComboBox( false, NULL, "combo_box" );
--	pComboBox = m_pComboBox;
--    }
-+    if ( !m_pComboBox )
-+	    m_pComboBox = new QComboBox( NULL );
-+
-+    m_pComboBox->setEditable( bEditable );
- 
-     QRect qRect = region2QRect( rControlRegion );
-     
--    pComboBox->move( qRect.topLeft() );
--    pComboBox->resize( qRect.size() );
-+    m_pComboBox->move( qRect.topLeft() );
-+    m_pComboBox->resize( qRect.size() );
- 
--    return pComboBox;
-+    return m_pComboBox;
- }
- 
- QLineEdit *WidgetPainter::lineEdit( const Region& rControlRegion )
- {
-     if ( !m_pLineEdit )
--	m_pLineEdit = new QLineEdit( NULL, "line_edit" );
-+		m_pLineEdit = new QLineEdit( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
-     
-@@ -954,42 +982,31 @@
-     return m_pLineEdit;
- }
- 
--QSpinWidget *WidgetPainter::spinWidget( const Region& rControlRegion )
-+QSpinBox *WidgetPainter::spinBox( const Region& rControlRegion )
- {
--    if ( !m_pSpinWidget )
--    {
--	m_pSpinWidget = new QSpinWidget( NULL, "spin_widget" );
--	
--	m_pSpinEdit = new QLineEdit( NULL, "line_edit_spin" );
--	m_pSpinWidget->setEditWidget( m_pSpinEdit );
--    }
-+    if ( !m_pSpinBox )
-+		m_pSpinBox = new QSpinBox( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
-     
--    m_pSpinWidget->move( qRect.topLeft() );
--    m_pSpinWidget->resize( qRect.size() );
--    m_pSpinWidget->arrange();
-+    m_pSpinBox->move( qRect.topLeft() );
-+    m_pSpinBox->resize( qRect.size() );
- 
--    return m_pSpinWidget;
-+    return m_pSpinBox;
- }
- 
- QTabBar *WidgetPainter::tabBar( const Region& rControlRegion )
- {
-     if ( !m_pTabBar )
-     {
--	if ( !m_pTabBarParent )
--	    m_pTabBarParent = new QWidget( NULL, "tab_bar_parent" );
-+		if ( !m_pTabBarParent )
-+	    	m_pTabBarParent = new QWidget( NULL );
- 
--	m_pTabBar = new QTabBar( m_pTabBarParent, "tab_bar" );
-+		m_pTabBar = new QTabBar( m_pTabBarParent );
- 	
--	m_pTabLeft = new QTab();
--	m_pTabMiddle = new QTab();
--	m_pTabRight = new QTab();
--	m_pTabAlone = new QTab();
--
--	m_pTabBar->addTab( m_pTabLeft );
--	m_pTabBar->addTab( m_pTabMiddle );
--	m_pTabBar->addTab( m_pTabRight );
-+		m_nTabLeft = m_pTabBar->addTab( "" );
-+		m_nTabMiddle = m_pTabBar->addTab( "" );
-+		m_nTabRight = m_pTabBar->addTab( "" );
-     }
- 
-     QRect qRect = region2QRect( rControlRegion );
-@@ -997,7 +1014,7 @@
-     m_pTabBar->move( qRect.topLeft() );
-     m_pTabBar->resize( qRect.size() );
-     
--    m_pTabBar->setShape( QTabBar::RoundedAbove );
-+    m_pTabBar->setShape( QTabBar::RoundedNorth );
- 
-     return m_pTabBar;
- }
-@@ -1005,10 +1022,10 @@
- QTabWidget *WidgetPainter::tabWidget( const Region& rControlRegion )
- {
-     if ( !m_pTabWidget )
--	m_pTabWidget = new QTabWidget( NULL, "tab_widget" );
-+		m_pTabWidget = new QTabWidget( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
--    --qRect.rTop();
-+    qRect.setTop( qRect.top() - 1 );
-     
-     m_pTabWidget->move( qRect.topLeft() );
-     m_pTabWidget->resize( qRect.size() );
-@@ -1019,7 +1036,7 @@
- QListView *WidgetPainter::listView( const Region& rControlRegion )
- {
-     if ( !m_pListView )
--	m_pListView = new QListView( NULL, "list_view" );
-+		m_pListView = new QListView( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
-     
-@@ -1034,9 +1051,9 @@
- {
-     if ( !m_pScrollBar )
-     {
--	m_pScrollBar = new QScrollBar( NULL, "scroll_bar" );
--	m_pScrollBar->setTracking( false );
--	m_pScrollBar->setLineStep( 1 );
-+		m_pScrollBar = new QScrollBar( NULL );
-+		m_pScrollBar->setTracking( false );
-+		m_pScrollBar->setSingleStep( 1 );
-     }
- 
-     QRect qRect = region2QRect( rControlRegion );
-@@ -1048,10 +1065,10 @@
-     ScrollbarValue *pValue = static_cast<ScrollbarValue *> ( aValue.getOptionalVal() );
-     if ( pValue )
-     {
--	m_pScrollBar->setMinValue( pValue->mnMin );
--	m_pScrollBar->setMaxValue( pValue->mnMax - pValue->mnVisibleSize );
--	m_pScrollBar->setValue( pValue->mnCur );
--	m_pScrollBar->setPageStep( pValue->mnVisibleSize );
-+		m_pScrollBar->setMinimum( pValue->mnMin );
-+		m_pScrollBar->setMaximum( pValue->mnMax - pValue->mnVisibleSize );
-+		m_pScrollBar->setValue( pValue->mnCur );
-+		m_pScrollBar->setPageStep( pValue->mnVisibleSize );
-     }
- 
-     return m_pScrollBar;
-@@ -1060,15 +1077,15 @@
- QToolBar *WidgetPainter::toolBar( const Region& rControlRegion, BOOL bHorizontal )
- {
-     if ( !m_pMainWindow )
--        m_pMainWindow = new QMainWindow( NULL, "main_window" );
-+        m_pMainWindow = new QMainWindow( NULL, Qt::Window );
- 
-     QToolBar *pToolBar;
-     if ( bHorizontal )
-     {
-         if ( !m_pToolBarHoriz )
-         {
--            m_pToolBarHoriz = new QToolBar( m_pMainWindow, "tool_bar_horiz" );
--            m_pMainWindow->moveDockWindow( m_pToolBarHoriz, Qt::DockTop );
-+            m_pToolBarHoriz = new QToolBar( m_pMainWindow );
-+            m_pToolBarHoriz->setAllowedAreas( Qt::TopToolBarArea );
-         }
-         pToolBar = m_pToolBarHoriz;
-     }
-@@ -1076,8 +1093,8 @@
-     {
-         if ( !m_pToolBarVert )
-         {
--            m_pToolBarVert = new QToolBar( m_pMainWindow, "tool_bar_horiz" );
--            m_pMainWindow->moveDockWindow( m_pToolBarVert, Qt::DockLeft );
-+            m_pToolBarVert = new QToolBar( m_pMainWindow );
-+            m_pToolBarHoriz->setAllowedAreas( Qt::LeftToolBarArea );
-         }
-         pToolBar = m_pToolBarVert;
-     }
-@@ -1093,7 +1110,7 @@
- QToolButton *WidgetPainter::toolButton( const Region& rControlRegion)
- {
-     if ( !m_pToolButton )
--	m_pToolButton = new QToolButton( NULL, "tool_button" );
-+		m_pToolButton = new QToolButton( NULL );
- 
-     QRect qRect = region2QRect( rControlRegion );
- 
-@@ -1107,13 +1124,15 @@
- {
-     if ( !m_pMenuBar )
-     {
--        m_pMenuBar = new QMenuBar( NULL, "menu_bar" );
-+        m_pMenuBar = new QMenuBar( NULL );
- 
--        m_nMenuBarEnabledItem = m_pMenuBar->insertItem( "" );
--        m_nMenuBarDisabledItem = m_pMenuBar->insertItem( "" );
-+	if ( !m_pMenuBarEnabledItem )
-+        	m_pMenuBarEnabledItem = m_pMenuBar->addAction( "" );
-+	if ( !m_pMenuBarDisabledItem )
-+        	m_pMenuBarDisabledItem = m_pMenuBar->addAction( "" );
- 
--        m_pMenuBar->setItemEnabled( m_nMenuBarEnabledItem, true );
--        m_pMenuBar->setItemEnabled( m_nMenuBarDisabledItem, false );
-+        m_pMenuBarEnabledItem->setEnabled( true );
-+        m_pMenuBarDisabledItem->setEnabled( false );
-     }
- 
-     QRect qRect = region2QRect( rControlRegion );
-@@ -1124,17 +1143,19 @@
-     return m_pMenuBar;
- }
- 
--QPopupMenu *WidgetPainter::popupMenu( const Region& rControlRegion)
-+QMenu *WidgetPainter::popupMenu( const Region& rControlRegion)
- {
-     if ( !m_pPopupMenu )
-     {
--        m_pPopupMenu = new QPopupMenu( NULL, "popup_menu" );
-+        m_pPopupMenu = new QMenu( NULL );
- 
--        m_nPopupMenuEnabledItem = m_pPopupMenu->insertItem( "" );
--        m_nPopupMenuDisabledItem = m_pPopupMenu->insertItem( "" );
-+        if ( !m_pPopupMenuEnabledItem )
-+        	m_pPopupMenuEnabledItem = m_pPopupMenu->addAction( "" );
-+        if ( !m_pPopupMenuDisabledItem )
-+        	m_pPopupMenuDisabledItem = m_pPopupMenu->addAction( "" );
- 
--        m_pPopupMenu->setItemEnabled( m_nPopupMenuEnabledItem, true );
--        m_pPopupMenu->setItemEnabled( m_nPopupMenuDisabledItem, false );
-+        m_pPopupMenuEnabledItem->setEnabled( true );
-+        m_pPopupMenuDisabledItem->setEnabled( false );
-     }
- 
-     QRect qRect = region2QRect( rControlRegion );
-@@ -1148,7 +1169,7 @@
- QProgressBar *WidgetPainter::progressBar( const Region& rControlRegion )
- {
-     if ( !m_pProgressBar )
--	m_pProgressBar = new QProgressBar( NULL, "progress_bar" );
-+		m_pProgressBar = new QProgressBar( NULL );
- 	
-     QRect qRect = region2QRect( rControlRegion );
-     
-@@ -1158,27 +1179,27 @@
-     return m_pProgressBar;
- }
- 
--QStyle::SFlags WidgetPainter::vclStateValue2SFlags( ControlState nState,
-+QStyle::State WidgetPainter::vclStateValue2StateFlag( ControlState nControlState,
- 	const ImplControlValue& aValue )
- {
--    QStyle::SFlags nStyle =
--	( (nState & CTRL_STATE_DEFAULT)?  QStyle::Style_ButtonDefault: QStyle::Style_Default ) |
--	( (nState & CTRL_STATE_ENABLED)?  QStyle::Style_Enabled:       QStyle::Style_Default ) |
--	( (nState & CTRL_STATE_FOCUSED)?  QStyle::Style_HasFocus:      QStyle::Style_Default ) |
--	( (nState & CTRL_STATE_PRESSED)?  QStyle::Style_Down:          QStyle::Style_Raised )  |
--	( (nState & CTRL_STATE_SELECTED)? QStyle::Style_Selected :     QStyle::Style_Default ) |
--	( (nState & CTRL_STATE_ROLLOVER)? QStyle::Style_MouseOver:     QStyle::Style_Default );
--	//TODO ( (nState & CTRL_STATE_HIDDEN)?   QStyle::Style_: QStyle::Style_Default ) |
-+    QStyle::State nState =
-+		( (nControlState & CTRL_STATE_DEFAULT)?  QStyle::State_None:      QStyle::State_None ) |
-+		( (nControlState & CTRL_STATE_ENABLED)?  QStyle::State_Enabled:   QStyle::State_None ) |
-+		( (nControlState & CTRL_STATE_FOCUSED)?  QStyle::State_HasFocus:  QStyle::State_None ) |
-+		( (nControlState & CTRL_STATE_PRESSED)?  QStyle::State_Sunken:    QStyle::State_None ) |
-+		( (nControlState & CTRL_STATE_SELECTED)? QStyle::State_Selected : QStyle::State_None ) |
-+		( (nControlState & CTRL_STATE_ROLLOVER)? QStyle::State_MouseOver: QStyle::State_None );
-+		//TODO ( (nControlState & CTRL_STATE_HIDDEN)?   QStyle::State_:   QStyle::State_None ) |
- 
-     switch ( aValue.getTristateVal() )
-     {
--	case BUTTONVALUE_ON:    nStyle |= QStyle::Style_On;       break;
--	case BUTTONVALUE_OFF:   nStyle |= QStyle::Style_Off;      break;
--	case BUTTONVALUE_MIXED: nStyle |= QStyle::Style_NoChange; break;
-+	case BUTTONVALUE_ON:    nState |= QStyle::State_On;       break;
-+	case BUTTONVALUE_OFF:   nState |= QStyle::State_Off;      break;
-+	case BUTTONVALUE_MIXED: nState |= QStyle::State_NoChange; break;
-     default: break;
-     }
- 
--    return nStyle;
-+    return nState;
- }
- 
- QRect WidgetPainter::region2QRect( const Region& rControlRegion )
-@@ -1205,15 +1226,15 @@
- 									   const Region& rControlRegion, const Point& aPos,
- 									   SalControlHandle& rControlHandle, BOOL& rIsInside );
- 	virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart,
--									const Region& rControlRegion, ControlState nState,
-+									const Region& rControlRegion, ControlState nControlState,
- 									const ImplControlValue& aValue, SalControlHandle& rControlHandle,
- 									const OUString& aCaption );
- 	virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart,
--										const Region& rControlRegion, ControlState nState,
-+										const Region& rControlRegion, ControlState nControlState,
- 										const ImplControlValue& aValue, SalControlHandle& rControlHandle,
- 										const OUString& aCaption );
- 	virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart,
--										 const Region& rControlRegion, ControlState nState,
-+										 const Region& rControlRegion, ControlState nControlState,
- 										 const ImplControlValue& aValue, SalControlHandle& rControlHandle,
- 										 const OUString& aCaption,
- 										 Region &rNativeBoundingRegion, Region &rNativeContentRegion );
-@@ -1272,97 +1293,104 @@
- {
-     if ( nType == CTRL_SCROLLBAR )
-     {
--    // make position relative to rControlRegion
--    Point aPos = rPos - rControlRegion.GetBoundRect().TopLeft();
--	rIsInside = FALSE;
-+    	// make position relative to rControlRegion
-+    	Point aPos = rPos - rControlRegion.GetBoundRect().TopLeft();
-+		rIsInside = FALSE;
- 
--	BOOL bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
-+		BOOL bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
- 	
--	QScrollBar *pScrollBar = pWidgetPainter->scrollBar( rControlRegion,
--		bHorizontal, ImplControlValue() );
--	QRect qRectSubLine = kapp->style().querySubControlMetrics(
--		QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubLine );
--	QRect qRectAddLine = kapp->style().querySubControlMetrics(
--		QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarAddLine );
--
--	// There are 2 buttons on the right/bottom side of the scrollbar
--	BOOL bTwoSubButtons = FALSE;
--
--	// It is a Platinum style scroll bar
--	BOOL bPlatinumStyle = FALSE;
--
--	// Workaround for Platinum and 3 button style scroll bars.
--	// It makes the right/down button bigger.
--	if ( bHorizontal )
--	{
--	    qRectAddLine.setLeft( kapp->style().querySubControlMetrics(
--			QStyle::CC_ScrollBar, pScrollBar,
--			QStyle::SC_ScrollBarAddPage ).right() + 1 );
--	    if ( qRectAddLine.width() > qRectSubLine.width() )
--		bTwoSubButtons = TRUE;
--	    if ( qRectSubLine.left() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).left() )
--		bPlatinumStyle = TRUE;
--	}
--	else
--	{
--	    qRectAddLine.setTop( kapp->style().querySubControlMetrics(
--			QStyle::CC_ScrollBar, pScrollBar,
--			QStyle::SC_ScrollBarAddPage ).bottom() + 1 );
--	    if ( qRectAddLine.height() > qRectSubLine.height() )
--		bTwoSubButtons = TRUE;
--	    if ( qRectSubLine.top() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).top() )
--		bPlatinumStyle = TRUE;
--	}
--
--	switch ( nPart )
--	{
--	    case PART_BUTTON_LEFT:
--		if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
--		    rIsInside = TRUE;
--		else if ( bTwoSubButtons )
-+		QScrollBar *pScrollBar = pWidgetPainter->scrollBar( rControlRegion,
-+			bHorizontal, ImplControlValue() );
-+		QStyleOptionComplex aStyleOption;
-+			aStyleOption.initFrom( pScrollBar );
-+
-+		QRect qRectSubLine = kapp->style()->subControlRect(
-+			QStyle::CC_ScrollBar, &aStyleOption, QStyle::SC_ScrollBarSubLine );
-+		QRect qRectAddLine = kapp->style()->subControlRect(
-+			QStyle::CC_ScrollBar, &aStyleOption, QStyle::SC_ScrollBarAddLine );
-+
-+		// There are 2 buttons on the right/bottom side of the scrollbar
-+		BOOL bTwoSubButtons = FALSE;
-+
-+		// It is a Platinum style scroll bar
-+		BOOL bPlatinumStyle = FALSE;
-+
-+		// Workaround for Platinum and 3 button style scroll bars.
-+		// It makes the right/down button bigger.
-+		if ( bHorizontal )
- 		{
--		    qRectAddLine.setWidth( qRectAddLine.width() / 2 );
--		    rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
-+	    	qRectAddLine.setLeft( kapp->style()->subControlRect(
-+				QStyle::CC_ScrollBar, &aStyleOption,
-+				QStyle::SC_ScrollBarAddPage ).right() + 1 );
-+	    	if ( qRectAddLine.width() > qRectSubLine.width() )
-+				bTwoSubButtons = TRUE;
-+	    	if ( qRectSubLine.left() > kapp->style()->subControlRect(
-+                QStyle::CC_ScrollBar, &aStyleOption,
-+                QStyle::SC_ScrollBarSubPage ).left() )
-+				bPlatinumStyle = TRUE;
- 		}
--		break;
--		
--	    case PART_BUTTON_UP:
--		if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
--		    rIsInside = TRUE;
--		else if ( bTwoSubButtons )
-+		else
- 		{
--		    qRectAddLine.setHeight( qRectAddLine.height() / 2 );
--		    rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
-+	    	qRectAddLine.setTop( kapp->style()->subControlRect(
-+				QStyle::CC_ScrollBar, &aStyleOption,
-+				QStyle::SC_ScrollBarAddPage ).bottom() + 1 );
-+	    	if ( qRectAddLine.height() > qRectSubLine.height() )
-+				bTwoSubButtons = TRUE;
-+	    	if ( qRectSubLine.top() > kapp->style()->subControlRect(
-+                QStyle::CC_ScrollBar, &aStyleOption,
-+                QStyle::SC_ScrollBarSubPage ).top() )
-+			bPlatinumStyle = TRUE;
- 		}
--		break;
-+
-+		switch ( nPart )
-+		{
-+	    case PART_BUTTON_LEFT:
-+			if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
-+			    rIsInside = TRUE;
-+			else if ( bTwoSubButtons )
-+			{
-+			    qRectAddLine.setWidth( qRectAddLine.width() / 2 );
-+		    	rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
-+			}
-+			break;
-+		
-+	    case PART_BUTTON_UP:
-+			if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
-+		    	rIsInside = TRUE;
-+			else if ( bTwoSubButtons )
-+			{
-+			    qRectAddLine.setHeight( qRectAddLine.height() / 2 );
-+			    rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
-+			}
-+			break;
- 		
- 	    case PART_BUTTON_RIGHT:
--		if ( bTwoSubButtons )
--		    qRectAddLine.setLeft( qRectAddLine.left() + qRectAddLine.width() / 2 );
-+			if ( bTwoSubButtons )
-+		    	qRectAddLine.setLeft( qRectAddLine.left() + qRectAddLine.width() / 2 );
- 
--		rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
--		break;
-+			rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
-+			break;
- 		
- 	    case PART_BUTTON_DOWN:
--		if ( bTwoSubButtons )
--		    qRectAddLine.setTop( qRectAddLine.top() + qRectAddLine.height() / 2 );
-+			if ( bTwoSubButtons )
-+		    	qRectAddLine.setTop( qRectAddLine.top() + qRectAddLine.height() / 2 );
- 
--		rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
--		break;
-+			rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
-+			break;
-         
-         // cases PART_TRACK_HORZ_AREA and PART_TRACK_VERT_AREA
-         default:
--        return FALSE;
--	}
-+        	return FALSE;
-+		}
- 
--	return TRUE;
-+		return TRUE;
-     }
- 
-     return FALSE;
- }
- 
- 
--/** Draw the requested control described by nPart/nState.
-+/** Draw the requested control described by nPart/nControlState.
-  
-     @param rControlRegion
-     The bounding region of the complete control in VCL frame coordinates.
-@@ -1377,7 +1405,7 @@
-     A caption or title string (like button text etc.)
- */
- BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
--										const Region& rControlRegion, ControlState nState,
-+										const Region& rControlRegion, ControlState nControlState,
- 										const ImplControlValue& aValue, SalControlHandle&,
- 										const OUString& )
- {
-@@ -1389,115 +1417,115 @@
- 	
-     if ( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->pushButton( rControlRegion, (nState & CTRL_STATE_DEFAULT) ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->pushButton( rControlRegion, (nControlState & CTRL_STATE_DEFAULT) ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_RADIOBUTTON) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->radioButton( rControlRegion ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->radioButton( rControlRegion ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_CHECKBOX) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->checkBox( rControlRegion ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->checkBox( rControlRegion ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_COMBOBOX) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->comboBox( rControlRegion, TRUE ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->comboBox( rControlRegion, TRUE ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_EDITBOX) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->lineEdit( rControlRegion ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->lineEdit( rControlRegion ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_LISTBOX) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->comboBox( rControlRegion, FALSE ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->comboBox( rControlRegion, FALSE ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_LISTBOX) && (nPart == PART_WINDOW) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->listView( rControlRegion ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->listView( rControlRegion ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_SPINBOX) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->spinWidget( rControlRegion ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->spinBox( rControlRegion ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType==CTRL_TAB_ITEM) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->tabBar( rControlRegion ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->tabBar( rControlRegion ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType==CTRL_TAB_PANE) && (nPart == PART_ENTIRE_CONTROL) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->tabWidget( rControlRegion ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->tabWidget( rControlRegion ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_SCROLLBAR) && (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT) )
-     {
--	bReturn = pWidgetPainter->drawStyledWidget(
--		pWidgetPainter->scrollBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ, aValue ),
--		nState, aValue,
--		dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+		bReturn = pWidgetPainter->drawStyledWidget(
-+			pWidgetPainter->scrollBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ, aValue ),
-+			nControlState, aValue,
-+			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_TOOLBAR) && (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT || nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) )
-     {
-         bReturn = pWidgetPainter->drawStyledWidget(
--                pWidgetPainter->toolBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_THUMB_VERT ),
--                nState, aValue,
--                dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc, nPart );
-+            pWidgetPainter->toolBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_THUMB_VERT ),
-+            nControlState, aValue,
-+            dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc, nPart );
-     }
-     else if ( (nType == CTRL_TOOLBAR) && (nPart == PART_BUTTON) )
-     {
-         bReturn = pWidgetPainter->drawStyledWidget(
--                pWidgetPainter->toolButton( rControlRegion ),
--                nState, aValue,
--                dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc, nPart );
-+            pWidgetPainter->toolButton( rControlRegion ),
-+            nControlState, aValue,
-+            dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc, nPart );
-     }
-     else if ( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) )
-     {
-         bReturn = pWidgetPainter->drawStyledWidget(
--                pWidgetPainter->menuBar( rControlRegion ),
--                nState, aValue,
--                dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc, nPart );
-+            pWidgetPainter->menuBar( rControlRegion ),
-+            nControlState, aValue,
-+            dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc, nPart );
-     }
-     else if ( (nType == CTRL_MENU_POPUP) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) )
-     {
-         bReturn = pWidgetPainter->drawStyledWidget(
--                pWidgetPainter->popupMenu( rControlRegion ),
--                nState, aValue,
--                dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+            pWidgetPainter->popupMenu( rControlRegion ),
-+            nControlState, aValue,
-+            dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
-     else if ( (nType == CTRL_PROGRESS) && (nPart == PART_ENTIRE_CONTROL) )
-     {
-         bReturn = pWidgetPainter->drawStyledWidget(
--                pWidgetPainter->progressBar( rControlRegion ),
--                nState, aValue,
--                dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-+            pWidgetPainter->progressBar( rControlRegion ),
-+            nControlState, aValue,
-+            dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
-     }
- 
-     return bReturn;
-@@ -1506,7 +1534,7 @@
- 
- /** Draw text on the widget.
-  
--    OPTIONAL. Draws the requested text for the control described by nPart/nState.
-+    OPTIONAL. Draws the requested text for the control described by nPart/nControlState.
-     Used if text is not drawn by DrawNativeControl().
-  
-     @param rControlRegion
-@@ -1550,7 +1578,7 @@
-     A caption or title string (like button text etc.)
- */
- BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
--											 const Region& rControlRegion, ControlState nState,
-+											 const Region& rControlRegion, ControlState nControlState,
- 											 const ImplControlValue&, SalControlHandle&,
- 											 const OUString&,
- 											 Region &rNativeBoundingRegion, Region &rNativeContentRegion )
-@@ -1558,77 +1586,86 @@
-     BOOL bReturn = FALSE;
-     QRect qBoundingRect = WidgetPainter::region2QRect( rControlRegion );
-     QRect qRect;
--    
-+    QStyleOptionComplex aStyleOption;
-+
-     QWidget *pWidget = NULL;
-     switch ( nType )
-     {
- 	// Metrics of the push button
- 	case CTRL_PUSHBUTTON:
--	    pWidget = pWidgetPainter->pushButton( rControlRegion, ( nState & CTRL_STATE_DEFAULT ) );
-+	    pWidget = pWidgetPainter->pushButton( rControlRegion, ( nControlState & CTRL_STATE_DEFAULT ) );
- 
- 	    switch ( nPart )
- 	    {
- 		case PART_ENTIRE_CONTROL:
- 		    qRect = qBoundingRect;
- 
--		    if ( nState & CTRL_STATE_DEFAULT )
-+		    if ( nControlState & CTRL_STATE_DEFAULT )
- 		    {
--			int nIndicatorSize = kapp->style().pixelMetric(
--				QStyle::PM_ButtonDefaultIndicator, pWidget );
--			qBoundingRect.addCoords( -nIndicatorSize, -nIndicatorSize,
--				nIndicatorSize, nIndicatorSize );
--			bReturn = TRUE;
-+				int nIndicatorSize = kapp->style()->pixelMetric(
-+					QStyle::PM_ButtonDefaultIndicator, &aStyleOption, pWidget );
-+				qBoundingRect.adjust( -nIndicatorSize, -nIndicatorSize,
-+					nIndicatorSize, nIndicatorSize );
-+				bReturn = TRUE;
- 		    }
- 		    break;
- 	    }
- 	    break;
- 
--        // Metrics of the radio button
--        case CTRL_RADIOBUTTON:
--            pWidget = pWidgetPainter->radioButton( rControlRegion );
-+    // Metrics of the radio button
-+    case CTRL_RADIOBUTTON:
-+        pWidget = pWidgetPainter->radioButton( rControlRegion );
-+        aStyleOption.initFrom( pWidget );
- 
--            if ( nPart == PART_ENTIRE_CONTROL )
--            {
--                qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth, pWidget ) );
--                qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight, pWidget ) );
-+        if ( nPart == PART_ENTIRE_CONTROL )
-+        {
-+            qRect.setWidth( kapp->style()->pixelMetric(
-+				QStyle::PM_ExclusiveIndicatorWidth, &aStyleOption, pWidget ) );
-+            qRect.setHeight( kapp->style()->pixelMetric(
-+				QStyle::PM_ExclusiveIndicatorHeight, &aStyleOption, pWidget ) );
- 
--                bReturn = TRUE;
--            }
--            break;
-+            bReturn = TRUE;
-+        }
-+        break;
- 
--        // Metrics of the check box
--        case CTRL_CHECKBOX:
--            pWidget = pWidgetPainter->checkBox( rControlRegion );
-+    // Metrics of the check box
-+    case CTRL_CHECKBOX:
-+        pWidget = pWidgetPainter->checkBox( rControlRegion );
-+        aStyleOption.initFrom( pWidget );
- 
--            if ( nPart == PART_ENTIRE_CONTROL )
--            {
--                qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_IndicatorWidth, pWidget ) );
--                qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_IndicatorHeight, pWidget ) );
-+        if ( nPart == PART_ENTIRE_CONTROL )
-+        {
-+            qRect.setWidth( kapp->style()->pixelMetric(
-+				QStyle::PM_IndicatorWidth, &aStyleOption, pWidget ) );
-+            qRect.setHeight( kapp->style()->pixelMetric(
-+				QStyle::PM_IndicatorHeight, &aStyleOption, pWidget ) );
- 
--                bReturn = TRUE;
--            }
--            break;
-+            bReturn = TRUE;
-+        }
-+        break;
- 
- 	// Metrics of the combo box
- 	case CTRL_COMBOBOX:
- 	case CTRL_LISTBOX:
- 	    pWidget = pWidgetPainter->comboBox( rControlRegion, ( nType == CTRL_COMBOBOX ) );
-+        aStyleOption.initFrom( pWidget );
-+
- 	    switch ( nPart )
- 	    {
- 		case PART_BUTTON_DOWN:
--		    qRect = kapp->style().querySubControlMetrics(
--			    QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxArrow );
--		    qRect.setLeft( kapp->style().querySubControlMetrics(
--			    QStyle::CC_ComboBox, pWidget,
-+		    qRect = kapp->style()->subControlRect(
-+			    QStyle::CC_ComboBox, &aStyleOption, QStyle::SC_ComboBoxArrow );
-+		    qRect.setLeft( kapp->style()->subControlRect(
-+			    QStyle::CC_ComboBox, &aStyleOption,
- 			    QStyle::SC_ComboBoxEditField ).right() + 1 );
--            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
-+       	    qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
- 		    bReturn = TRUE;
- 		    break;
- 
- 		case PART_SUB_EDIT:
--		    qRect = kapp->style().querySubControlMetrics(
--			    QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxEditField );
--            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
-+		    qRect = kapp->style()->subControlRect(
-+		    	QStyle::CC_ComboBox, &aStyleOption, QStyle::SC_ComboBoxEditField );
-+       	    qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
- 		    bReturn = TRUE;
- 		    break;
- 	    }
-@@ -1636,28 +1673,30 @@
- 
- 	// Metrics of the spin box
- 	case CTRL_SPINBOX:
--	    pWidget = pWidgetPainter->spinWidget( rControlRegion );
-+	    pWidget = pWidgetPainter->spinBox( rControlRegion );
-+        aStyleOption.initFrom( pWidget );
-+
- 	    switch ( nPart )
- 	    {
- 		case PART_BUTTON_UP:
--		    qRect = kapp->style().querySubControlMetrics(
--			    QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetUp );
-+		    qRect = kapp->style()->subControlRect(
-+			    QStyle::CC_SpinBox, &aStyleOption, QStyle::SC_SpinBoxUp );
- 		    bReturn = TRUE;
--            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
-+            qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
- 		    break;
- 
- 		case PART_BUTTON_DOWN:
--		    qRect = kapp->style().querySubControlMetrics(
--			    QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetDown );
-+		    qRect = kapp->style()->subControlRect(
-+			    QStyle::CC_SpinBox, &aStyleOption, QStyle::SC_SpinBoxDown );
- 		    bReturn = TRUE;
--            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
-+            qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
- 		    break;
- 
-         case PART_SUB_EDIT:
--		    qRect = kapp->style().querySubControlMetrics(
--			    QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetEditField );
--            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
-+		    qRect = kapp->style()->subControlRect(
-+			    QStyle::CC_SpinBox, &aStyleOption, QStyle::SC_SpinBoxEditField );
- 		    bReturn = TRUE;
-+            qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
- 		    break;
- 	    }
- 	    break;
-@@ -1667,63 +1706,65 @@
- 	    pWidget = pWidgetPainter->scrollBar( rControlRegion,
- 		    ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT ),
- 		    ImplControlValue() );
-+        aStyleOption.initFrom( pWidget );
-+
- 	    switch ( nPart )
- 	    {
- 		case PART_BUTTON_LEFT:
- 		case PART_BUTTON_UP:
--		    qRect = kapp->style().querySubControlMetrics(
--			    QStyle::CC_ScrollBar, pWidget, QStyle::SC_ScrollBarSubLine );
-+		    qRect = kapp->style()->subControlRect(
-+			    QStyle::CC_ScrollBar, &aStyleOption, QStyle::SC_ScrollBarSubLine );
- 
- 		    // Workaround for Platinum style scroll bars. It makes the
- 		    // left/up button invisible.
- 		    if ( nPart == PART_BUTTON_LEFT )
- 		    {
--			if ( qRect.left() > kapp->style().querySubControlMetrics(
--				    QStyle::CC_ScrollBar, pWidget,
-+				if ( qRect.left() > kapp->style()->subControlRect(
-+				    QStyle::CC_ScrollBar, &aStyleOption,
- 				    QStyle::SC_ScrollBarSubPage ).left() )
--			{
--			    qRect.setLeft( 0 );
--			    qRect.setRight( 0 );
--			}
-+				{
-+				    qRect.setLeft( 0 );
-+				    qRect.setRight( 0 );
-+				}
- 		    }
- 		    else
- 		    {
--			if ( qRect.top() > kapp->style().querySubControlMetrics(
--				    QStyle::CC_ScrollBar, pWidget,
-+				if ( qRect.top() > kapp->style()->subControlRect(
-+				    QStyle::CC_ScrollBar, &aStyleOption,
- 				    QStyle::SC_ScrollBarSubPage ).top() )
--			{
--			    qRect.setTop( 0 );
--			    qRect.setBottom( 0 );
--			}
-+				{
-+			    	qRect.setTop( 0 );
-+				    qRect.setBottom( 0 );
-+				}
- 		    }
--            
--            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
-+ 
-+            qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
- 
- 		    bReturn = TRUE;
- 		    break;
- 
- 		case PART_BUTTON_RIGHT:
- 		case PART_BUTTON_DOWN:
--		    qRect = kapp->style().querySubControlMetrics(
--			    QStyle::CC_ScrollBar, pWidget, QStyle::SC_ScrollBarAddLine );
-+		    qRect = kapp->style()->subControlRect(
-+			    QStyle::CC_ScrollBar, &aStyleOption, QStyle::SC_ScrollBarAddLine );
- 
- 		    // Workaround for Platinum and 3 button style scroll bars.
- 		    // It makes the right/down button bigger.
- 		    if ( nPart == PART_BUTTON_RIGHT )
--			qRect.setLeft( kapp->style().querySubControlMetrics(
--				    QStyle::CC_ScrollBar, pWidget,
-+				qRect.setLeft( kapp->style()->subControlRect(
-+				    QStyle::CC_ScrollBar, &aStyleOption,
- 				    QStyle::SC_ScrollBarAddPage ).right() + 1 );
- 		    else
--			qRect.setTop( kapp->style().querySubControlMetrics(
--				    QStyle::CC_ScrollBar, pWidget,
-+				qRect.setTop( kapp->style()->subControlRect(
-+				    QStyle::CC_ScrollBar, &aStyleOption,
- 				    QStyle::SC_ScrollBarAddPage ).bottom() + 1 );
- 
--            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
-+            qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
- 
- 		    bReturn = TRUE;
- 		    break;
- 	    }
--            break;
-+        break;
-     }
- 
-     // Fill rNativeBoundingRegion and rNativeContentRegion
-@@ -1747,8 +1788,8 @@
- // KDESalFrame implementation
- // -----------------------------------------------------------------------
- 
--KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nStyle ) :
--    X11SalFrame( pParent, nStyle )
-+KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nState ) :
-+    X11SalFrame( pParent, nState )
- {
- }
- 
-@@ -1771,16 +1812,16 @@
- 
- /** Helper function to read untranslated text entry from KConfig configuration repository.
- */
--static OUString readEntryUntranslated( KConfig *pConfig, const char *pKey )
-+static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey )
- {
--    return OUString::createFromAscii( pConfig->readEntryUntranslated( pKey ).ascii() );
-+    return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() );
- }
- 
- /** Helper function to read color from KConfig configuration repository.
- */
--static Color readColor( KConfig *pConfig, const char *pKey )
-+static Color readColor( KConfigGroup *pGroup, const char *pKey )
- {
--    return toColor( pConfig->readColorEntry( pKey ) );
-+    return toColor( pGroup->readEntry( pKey, QColor(Qt::white) ) );
- }
- 
- /** Helper function to add information to Font from QFont.
-@@ -1793,7 +1834,7 @@
-     QFontInfo qFontInfo( rQFont );
-     
-     // set family name
--    aInfo.m_aFamilyName = String( rQFont.family().utf8(), RTL_TEXTENCODING_UTF8 );
-+    aInfo.m_aFamilyName = String( (const char *) rQFont.family().toUtf8(), RTL_TEXTENCODING_UTF8 );
- 
-     // set italic
-     aInfo.m_eItalic = ( qFontInfo.italic()? psp::italic::Italic: psp::italic::Upright );
-@@ -1883,59 +1924,62 @@
- 	bool bSetTitleFont = false;
- 
-     // WM settings
--    KConfig *pConfig = KGlobal::config();
-+    KConfig *pConfig = KGlobal::config().data();
-     if ( pConfig )
-     {
--        pConfig->setGroup( "WM" );
-+        KConfigGroup aGroup = pConfig->group( "WM" );
-         const char *pKey;
- 
-         pKey = "activeBackground";
--        if ( pConfig->hasKey( pKey ) )
--            aStyleSettings.SetActiveColor( readColor( pConfig, pKey ) );
-+        if ( aGroup.hasKey( pKey ) )
-+            aStyleSettings.SetActiveColor( readColor( &aGroup, pKey ) );
- 
-         pKey = "activeBlend";
--        if ( pConfig->hasKey( pKey ) )
--            aStyleSettings.SetActiveColor2( readColor( pConfig, pKey ) );
-+        if ( aGroup.hasKey( pKey ) )
-+            aStyleSettings.SetActiveColor2( readColor( &aGroup, pKey ) );
- 
-         pKey = "inactiveBackground";
--        if ( pConfig->hasKey( pKey ) )
--            aStyleSettings.SetDeactiveColor( readColor( pConfig, pKey ) );
-+        if ( aGroup.hasKey( pKey ) )
-+            aStyleSettings.SetDeactiveColor( readColor( &aGroup, pKey ) );
- 
-         pKey = "inactiveBlend";
--        if ( pConfig->hasKey( pKey ) )
--            aStyleSettings.SetDeactiveColor2( readColor( pConfig, pKey ) );
-+        if ( aGroup.hasKey( pKey ) )
-+            aStyleSettings.SetDeactiveColor2( readColor( &aGroup, pKey ) );
- 
-         pKey = "inactiveForeground";
--        if ( pConfig->hasKey( pKey ) )
--            aStyleSettings.SetDeactiveTextColor( readColor( pConfig, pKey ) );
-+        if ( aGroup.hasKey( pKey ) )
-+            aStyleSettings.SetDeactiveTextColor( readColor( &aGroup, pKey ) );
- 
-         pKey = "activeForeground";
--        if ( pConfig->hasKey( pKey ) )
--            aStyleSettings.SetActiveTextColor( readColor( pConfig, pKey ) );
-+        if ( aGroup.hasKey( pKey ) )
-+            aStyleSettings.SetActiveTextColor( readColor( &aGroup, pKey ) );
- 
-         pKey = "titleFont";
--        if ( pConfig->hasKey( pKey ) )
-+        if ( aGroup.hasKey( pKey ) )
-         {
--            Font aFont = toFont( pConfig->readFontEntry( pKey ), rSettings.GetUILocale() );
-+            Font aFont = toFont( aGroup.readEntry( pKey, QFont() ), rSettings.GetUILocale() );
-             aStyleSettings.SetTitleFont( aFont );
- 			bSetTitleFont = true;
-         }
- 
--        pConfig->setGroup( "Icons" );
-+        aGroup = pConfig->group( "Icons" );
- 
-         pKey = "Theme";
--        if ( pConfig->hasKey( pKey ) )
--            aStyleSettings.SetPreferredSymbolsStyleName( readEntryUntranslated( pConfig, pKey ) );
-+        if ( aGroup.hasKey( pKey ) )
-+            aStyleSettings.SetPreferredSymbolsStyleName( readEntryUntranslated( &aGroup, pKey ) );
-     }
- 
-     // General settings
--    QColorGroup qColorGroup = kapp->palette().active();
-+    QPalette qPalette = kapp->palette();
-+
-+    Color aFore = toColor( qPalette.color( QPalette::Active, QPalette::WindowText ) );
-+    Color aBack = toColor( qPalette.color( QPalette::Active, QPalette::Window ) );
-+    Color aText = toColor( qPalette.color( QPalette::Active, QPalette::Text ) );
-+    Color aBase = toColor( qPalette.color( QPalette::Active, QPalette::Base ) );
-+    Color aButn = toColor( qPalette.color( QPalette::Active, QPalette::ButtonText ) );
-+    Color aMid = toColor( qPalette.color( QPalette::Active, QPalette::Mid ) );
-+    Color aHigh = toColor( qPalette.color( QPalette::Active, QPalette::Highlight ) );
- 
--    Color aFore = toColor( qColorGroup.foreground() );
--    Color aBack = toColor( qColorGroup.background() );
--    Color aText = toColor( qColorGroup.text() );
--    Color aBase = toColor( qColorGroup.base() );
--    
-     // Foreground
-     aStyleSettings.SetRadioCheckTextColor( aFore );
-     aStyleSettings.SetLabelTextColor( aFore );
-@@ -1955,14 +1999,14 @@
-     aStyleSettings.SetWindowColor( aBase );
-     
-     // Buttons
--    aStyleSettings.SetButtonTextColor( toColor( qColorGroup.buttonText() ) );
--    aStyleSettings.SetButtonRolloverTextColor( toColor( qColorGroup.buttonText() ) );
-+    aStyleSettings.SetButtonTextColor( aButn );
-+    aStyleSettings.SetButtonRolloverTextColor( aButn );
- 
-     // Disable color
--    aStyleSettings.SetDisableColor( toColor( qColorGroup.mid() ) );
-+    aStyleSettings.SetDisableColor( aMid );
- 
-     // Workspace
--    aStyleSettings.SetWorkspaceColor( toColor( qColorGroup.mid() ) );
-+    aStyleSettings.SetWorkspaceColor( aMid );
- 
-     // Background
-     aStyleSettings.Set3DColors( aBack );
-@@ -1981,8 +2025,8 @@
-     }
- 
-     // Selection
--    aStyleSettings.SetHighlightColor( toColor( qColorGroup.highlight() ) );
--    aStyleSettings.SetHighlightTextColor( toColor( qColorGroup.highlightedText() ) );
-+    aStyleSettings.SetHighlightColor( aHigh );
-+    aStyleSettings.SetHighlightTextColor( aHigh );
- 
-     // Font
-     Font aFont = toFont( kapp->font(), rSettings.GetUILocale() );
-@@ -2005,7 +2049,6 @@
-     aStyleSettings.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
- 
-     KMainWindow qMainWindow;
--    qMainWindow.createGUI( "/dev/null" ); // hack
- 
-     // Menu
-     aStyleSettings.SetSkipDisabledInMenus( TRUE );
-@@ -2013,41 +2056,41 @@
-     if ( pMenuBar )
-     {
-         // Color
--        QColorGroup qMenuCG = pMenuBar->colorGroup();
-+        QPalette qMenuCG = pMenuBar->palette();
-         
-         // Menu text and background color, theme specific
--        Color aMenuFore = toColor( qMenuCG.foreground() );
--        Color aMenuBack = toColor( qMenuCG.background() );
--        if ( kapp->style().inherits( "LightStyleV2" ) ||
--             kapp->style().inherits( "LightStyleV3" ) ||
--             ( kapp->style().inherits( "QMotifStyle" ) && !kapp->style().inherits( "QSGIStyle" ) ) ||
--             kapp->style().inherits( "QWindowsStyle" ) )
-+        Color aMenuFore = toColor( qMenuCG.color( QPalette::WindowText ) );
-+        Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) );
-+        if ( kapp->style()->inherits( "LightStyleV2" ) ||
-+             kapp->style()->inherits( "LightStyleV3" ) ||
-+             ( kapp->style()->inherits( "QMotifStyle" ) && !kapp->style()->inherits( "QSGIStyle" ) ) ||
-+             kapp->style()->inherits( "QWindowsStyle" ) )
-         {
--            aMenuFore = toColor( qMenuCG.buttonText() );
--            aMenuBack = toColor( qMenuCG.button() );
-+            aMenuFore = toColor( qMenuCG.color( QPalette::ButtonText ) );
-+            aMenuBack = toColor( qMenuCG.color( QPalette::Button ) );
-         }
-         
-         aStyleSettings.SetMenuTextColor( aMenuFore );
-         aStyleSettings.SetMenuColor( aMenuBack );
-         aStyleSettings.SetMenuBarColor( aMenuBack );
- 
--        aStyleSettings.SetMenuHighlightColor( toColor ( qMenuCG.highlight() ) );
-+        aStyleSettings.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
- 
-         // Menu items higlight text color, theme specific
--        if ( kapp->style().inherits( "HighContrastStyle" ) ||
--             kapp->style().inherits( "KeramikStyle" ) ||
--             kapp->style().inherits( "QWindowsStyle" ) ||
--             kapp->style().inherits( "ThinKeramikStyle" ) ||
--             kapp->style().inherits( "PlastikStyle" ) )
-+        if ( kapp->style()->inherits( "HighContrastStyle" ) ||
-+             kapp->style()->inherits( "KeramikStyle" ) ||
-+             kapp->style()->inherits( "QWindowsStyle" ) ||
-+             kapp->style()->inherits( "ThinKeramikStyle" ) ||
-+             kapp->style()->inherits( "PlastikStyle" ) )
-         {
--            aStyleSettings.SetMenuHighlightTextColor( toColor ( qMenuCG.highlightedText() ) );
-+            aStyleSettings.SetMenuHighlightTextColor( toColor ( qMenuCG.color( QPalette::HighlightedText ) ) );
-         }
-         else
-             aStyleSettings.SetMenuHighlightTextColor( aMenuFore );
-         
-         // set special menubar higlight text color
--        if ( kapp->style().inherits( "HighContrastStyle" ) )
--            ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.highlightedText() );
-+        if ( kapp->style()->inherits( "HighContrastStyle" ) )
-+            ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.color( QPalette::HighlightedText ) );
-         else
-             ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = aMenuFore;
- 
-@@ -2065,7 +2108,7 @@
-     }
- 
-     // Scroll bar size
--    aStyleSettings.SetScrollBarSize( kapp->style().pixelMetric( QStyle::PM_ScrollBarExtent ) );
-+    aStyleSettings.SetScrollBarSize( kapp->style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
-     
-     // #i59364# high contrast mode
-     bool bHC = ( aStyleSettings.GetFaceColor().IsDark() ||
-@@ -2132,9 +2175,9 @@
- // -----------------------------------------------------------------------
- 
- SalFrame *
--KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nStyle )
-+KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nState )
- {
--	return new KDESalFrame( pParent, nStyle );
-+	return new KDESalFrame( pParent, nState );
- }
- 
- // -----------------------------------------------------------------------
---- vcl/unx/kde/kdedata.cxx.ark	2008-10-06 16:19:14.114200454 +0200
-+++ vcl/unx/kde/kdedata.cxx	2008-10-06 16:22:26.500076020 +0200
-@@ -238,6 +238,8 @@ void KDEData::Init()
- extern "C" {
-     VCL_DLLPUBLIC SalInstance* create_SalInstance( oslModule )
-     {
-+#if QT_VERSION < 0x040000
-+	// Qt 3.x support needs >= 3.2.2 - any 4.x should be ok
-         rtl::OString aVersion( qVersion() );
- #if OSL_DEBUG_LEVEL > 1
-         fprintf( stderr, "qt version string is \"%s\"\n", aVersion.getStr() );
-@@ -255,6 +257,7 @@ extern "C" {
- #endif
-             return NULL;
-         }
-+#endif
-         
-         KDESalInstance* pInstance = new KDESalInstance( new SalYieldMutex() );
- #if OSL_DEBUG_LEVEL > 1
commit 63199f75a0116f95df28733b37e3d990c943eea6
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 17:29:39 2009 +0200

    Added [KDE4Experimental] section for kde4-kab.diff.
    
    * patches/dev300/apply: New section.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 9898fee..02c8ef4 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -33,7 +33,7 @@ Experimental: VBAUntested, ArkOnlyExperimental, \
 	      UnUsedButNotYetRemovedFromSVN, WebDAVUpstream, \
 	      PostgreSQL, SELinux, VOSremoval, Glib2, \
 	      UnitBootstrap, RadioButtons, UnstableLibwpd, WWInProgress, \
-	      MinGW, CalcExperimental, Mono24
+	      KDE4Experimental, MinGW, CalcExperimental, Mono24
 DebianLooseSections: DebianBaseNoHelpContent
 # Optional sections
 Optional : DejaVuFonts, NovellOnlyExtensionFixes, Win32OnlyExtensionFixes, Linux32OnlyExtensionFixes
@@ -2775,9 +2775,9 @@ kde4-plugin-detection.diff
 kde4-vcl-prj.diff
 kde4-vcl.diff
 
-# Not yet ported to co-exist with KDE3 stuff
-#kde4-kab.diff
-#kde4-kdebe.diff
+[ KDE4Experimental ]
+# Not yet ported to co-exist with the KDE3 stuff
+kde4-kab.diff
 
 
 [ UnstableLibwpd ]


More information about the ooo-build-commit mailing list