ooo-build r13123 - in trunk: . patches/dev300



Author: brosenk
Date: Wed Jul  9 07:39:04 2008
New Revision: 13123
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13123&view=rev

Log:
Add patch to make the kde filepicker compile on kde4


Added:
   trunk/patches/dev300/kde4-fpicker.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Wed Jul  9 07:39:04 2008
@@ -2411,6 +2411,9 @@
 kde4-kde_headers.diff
 kde4-salnativewidgets-kde.diff
 
+# More KDE4 bits by Bernhard Rosenkraenzer
+kde4-fpicker.diff, i#90618, brosenk
+
 [ UnstableLibwpd ]
 config_office-testing.diff
 libwpd-testing.diff

Added: trunk/patches/dev300/kde4-fpicker.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/kde4-fpicker.diff	Wed Jul  9 07:39:04 2008
@@ -0,0 +1,463 @@
+--- ./config_office/configure.in.ark	2008-06-14 15:28:05.682810320 +0200
++++ ./config_office/configure.in	2008-06-14 15:28:32.734780743 +0200
+@@ -5655,7 +5655,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.ark	2008-06-16 09:22:16.469786207 +0200
++++ ./fpicker/source/unx/kde/kdecommandthread.cxx	2008-06-16 14:39:35.567978377 +0200
+@@ -55,6 +55,7 @@
+  *  All Rights Reserved.
+  *
+  *  Contributor(s): Jan Holesovsky <kendy openoffice org>
++ *                  Bernhard Rosenkraenzer <bero 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.ark	2008-06-14 15:44:59.451826118 +0200
++++ ./fpicker/source/unx/kde/kdecommandthread.hxx	2008-06-16 09:50:23.678817863 +0200
+@@ -55,6 +55,7 @@
+  *  All Rights Reserved.
+  *
+  *  Contributor(s): Jan Holesovsky <kendy openoffice org>
++ *                  Bernhard Rosenkraenzer <bero 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.ark	2008-06-16 14:51:49.116796955 +0200
++++ ./fpicker/source/unx/kde/kdefilepicker.cxx	2008-06-19 10:34:55.496658199 +0200
+@@ -64,14 +64,10 @@
+ 
+ #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>
+ 
+ #ifdef QT_NO_EMIT
+ #define emit
+@@ -95,24 +91,41 @@
+ 
+ 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 ) ),
++    : 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,7 +317,7 @@ void FileDialog::customEvent( QCustomEve
+                 break;
+             case CommandEvent::Exec:
+                 {
+-                    filterWidget->setEditable( false );
++                    filterWidget()->setEditable( false );
+                     QString qSelectedURL;
+                     setIsExecuting( true );
+                     bool bCanExit = false;
+@@ -322,7 +325,7 @@ void FileDialog::customEvent( QCustomEve
+                         setCanNotifySelection( true );
+                         exec();
+ 
+-                        KURL qLocalSelectedURL = mostLocalURL( selectedURL() );
++                        KUrl qLocalSelectedURL = mostLocalURL( selectedUrl() );
+ 
+                         qSelectedURL = addExtension( qLocalSelectedURL.url() );
+                         QString qProtocol( qLocalSelectedURL.protocol() );
+@@ -382,7 +385,9 @@ void FileDialog::appendControl( const QS
+ 
+     if ( rType == "checkbox" )
+     {
+-        QCheckBox *pCheckBox = new QCheckBox( qLabel, m_pCheckBoxes, rId.utf8() );
++        QCheckBox *pCheckBox = new QCheckBox( qLabel, m_pCheckBoxes, rId.toUtf8() );
++	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,23 +395,26 @@ 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, rId.toUtf8() );
++	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, rId.toUtf8() );
++	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*> *pList = m_pCustomWidget->queryList();
++    QCString qName( rId.toUtf8() );
++    QList<QObject*>::const_iterator it = pList->begin();
+     
+     for ( ; it != pList->end() && qName != (*it)->name(); ++it )
+         ;
+@@ -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 )
+@@ -488,7 +496,7 @@ void FileDialog::setValue( const QString
+         {
+             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" )
+@@ -583,7 +591,7 @@ QString FileDialog::addExtension( const 
+ 
+             int nIdx = (*it).find( '.', ::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() );
+@@ -641,7 +649,7 @@ 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, 106 ) );
+     if ( qLocalURL.isLocalFile() )
+         return qLocalURL.url();
+ 
+@@ -652,7 +660,7 @@ QString FileDialog::localCopy( const QSt
+         nExtensionPos = rFileName.find( '.' );
+ 
+     KTempFile qTempFile( QString::null, ( nExtensionPos < 0 )? QString(): rFileName.mid( nExtensionPos ) );
+-    KURL qDestURL;
++    KUrl qDestURL;
+     qDestURL.setPath( qTempFile.name() );
+ 
+     if ( !KIO::NetAccess::file_copy( rFileName, qDestURL, 0600, true, false, 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() << ::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
+--- ./fpicker/source/unx/kde/kdefilepicker.hxx.ark	2008-06-16 14:51:18.703910550 +0200
++++ ./fpicker/source/unx/kde/kdefilepicker.hxx	2008-06-16 16:28:26.293921027 +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;
+ 
+@@ -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 );
+ };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]