diff --git a/kdesdk-3.96.2-fix-kompare.patch b/kdesdk-3.96.2-fix-kompare.patch index 5ffaa2b..88990ae 100644 --- a/kdesdk-3.96.2-fix-kompare.patch +++ b/kdesdk-3.96.2-fix-kompare.patch @@ -95,14 +95,8 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparenavtreepart/komparenavtreepart.h kde diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/CMakeLists.txt kdesdk-3.96.2-fix-kompare/kompare/komparepart/CMakeLists.txt --- kdesdk-3.96.2-orig/kompare/komparepart/CMakeLists.txt 2007-07-26 12:38:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/CMakeLists.txt 2007-12-05 00:45:07.000000000 +0100 -@@ -5,11 +5,13 @@ - ########### next target ############### - - set(komparepart_PART_SRCS -+ kompare_qsplitter.cpp - kompare_part.cpp - kompareconnectwidget.cpp ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/CMakeLists.txt 2007-12-10 11:01:58.000000000 +0100 +@@ -10,6 +10,7 @@ komparesplitter.cpp komparelistview.cpp kompareprefdlg.cpp @@ -110,7 +104,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/CMakeLists.txt kdesdk-3.96.2-fi komparesaveoptionswidget.cpp ) -@@ -19,7 +21,7 @@ +@@ -19,7 +20,7 @@ @@ -121,7 +115,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/CMakeLists.txt kdesdk-3.96.2-fi diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareconnectwidget.cpp --- kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareconnectwidget.cpp 2007-12-05 02:48:41.000000000 +0100 ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareconnectwidget.cpp 2007-12-10 12:27:29.000000000 +0100 @@ -20,10 +20,15 @@ ***************************************************************************/ @@ -139,13 +133,20 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk #include -@@ -41,18 +46,19 @@ - ViewSettings* settings, +@@ -36,23 +41,22 @@ + + using namespace Diff2; + +-KompareConnectWidgetFrame::KompareConnectWidgetFrame( KompareListView* left, +- KompareListView* right, +- ViewSettings* settings, ++KompareConnectWidgetFrame::KompareConnectWidgetFrame( ViewSettings* settings, KompareSplitter* parent, const char* name ) : - QSplitterHandle(Horizontal, (QSplitter *)parent, name), -+ KompareQSplitterHandle(Qt::Horizontal, (KompareQSplitter *)parent), - m_wid ( left, right, settings, this, name ), +- m_wid ( left, right, settings, this, name ), ++ QSplitterHandle(Qt::Horizontal, (QSplitter *)parent), ++ m_wid ( settings, this, name ), m_label ( "", this ), m_layout ( this ) { @@ -163,7 +164,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk bottomLine->setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed) ); bottomLine->setFixedHeight(1); m_layout.setSpacing(0); -@@ -68,14 +74,15 @@ +@@ -68,14 +72,16 @@ QSize KompareConnectWidgetFrame::sizeHint() const { @@ -173,6 +174,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk static int kMouseOffset; ++#if 0 void KompareConnectWidgetFrame::mouseMoveEvent( QMouseEvent *e ) { - if ( !(e->state()&LeftButton) ) @@ -181,15 +183,14 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk return; QCOORD pos = s->pick( parentWidget()->mapFromGlobal(e->globalPos()) ) -@@ -86,14 +93,14 @@ +@@ -86,31 +92,29 @@ void KompareConnectWidgetFrame::mousePressEvent( QMouseEvent *e ) { - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) kMouseOffset = s->pick( e->pos() ); -- QSplitterHandle::mousePressEvent(e); -+ KompareQSplitterHandle::mousePressEvent(e); + QSplitterHandle::mousePressEvent(e); } void KompareConnectWidgetFrame::mouseReleaseEvent( QMouseEvent *e ) @@ -199,7 +200,18 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk QCOORD pos = s->pick( parentWidget()->mapFromGlobal(e->globalPos()) ) - kMouseOffset; ((KompareSplitter*)s)->moveSplitter( pos, id() ); -@@ -110,7 +117,7 @@ + } + } ++#endif + +-KompareConnectWidget::KompareConnectWidget( KompareListView* left, KompareListView* right, +- ViewSettings* settings, QWidget* parent, const char* name ) ++KompareConnectWidget::KompareConnectWidget( ViewSettings* settings, QWidget* parent, const char* name ) + : QWidget(parent, name), + m_settings( settings ), +- m_leftView( left ), +- m_rightView( right ), + m_selectedModel( 0 ), m_selectedDifference( 0 ) { // connect( m_settings, SIGNAL( settingsChanged() ), this, SLOT( slotDelayedRepaint() ) ); @@ -208,7 +220,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ) ); setFocusProxy( parent->parentWidget() ); } -@@ -157,10 +164,10 @@ +@@ -157,17 +161,22 @@ // kDebug(8106) << "KompareConnectWidget::paintEvent()" << endl; QPixmap pixbuf(size()); @@ -216,13 +228,30 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk - QPainter* p = &paint; + Q3Painter paint(&pixbuf); + Q3Painter* p = &paint; ++ ++ p->fillRect( 0, 0, pixbuf.width(), pixbuf.height(), QColor(Qt::white).dark(110) ); - p->fillRect( 0, 0, pixbuf.width(), pixbuf.height(), white.dark(110) ); -+ p->fillRect( 0, 0, pixbuf.width(), pixbuf.height(), QColor(Qt::white).dark(110) ); ++ KompareSplitter* splitter = static_cast( parent()->parent() ); ++ int count = splitter->count(); ++ KompareListView *leftView = count >= 2 ? static_cast( splitter->widget(0) )->view() : 0; ++ KompareListView *rightView = count >= 2 ? static_cast( splitter->widget(1) )->view() : 0; - if ( m_selectedModel ) +- if ( m_selectedModel ) ++ if ( m_selectedModel && leftView && rightView ) { -@@ -179,7 +186,7 @@ +- int firstL = m_leftView->firstVisibleDifference(); +- int firstR = m_rightView->firstVisibleDifference(); +- int lastL = m_leftView->lastVisibleDifference(); +- int lastR = m_rightView->lastVisibleDifference(); ++ int firstL = leftView->firstVisibleDifference(); ++ int firstR = rightView->firstVisibleDifference(); ++ int lastL = leftView->lastVisibleDifference(); ++ int lastR = rightView->lastVisibleDifference(); + + int first = firstL < 0 ? firstR : qMin( firstL, firstR ); + int last = lastL < 0 ? lastR : qMax( lastL, lastR ); +@@ -179,7 +188,7 @@ { const DifferenceList* differences = const_cast(m_selectedModel)->differences(); DifferenceListConstIterator diffIt = differences->at( first ); @@ -231,7 +260,25 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk QRect leftRect, rightRect; -@@ -211,8 +218,8 @@ +@@ -190,13 +199,13 @@ + + if ( QApplication::reverseLayout() ) + { +- leftRect = m_rightView->itemRect( i ); +- rightRect = m_leftView->itemRect( i ); ++ leftRect = rightView->itemRect( i ); ++ rightRect = leftView->itemRect( i ); + } + else + { +- leftRect = m_leftView->itemRect( i ); +- rightRect = m_rightView->itemRect( i ); ++ leftRect = leftView->itemRect( i ); ++ rightRect = rightView->itemRect( i ); + } + + int tl = leftRect.top(); +@@ -211,8 +220,8 @@ br = br <= 32767 ? br : 32767; // kDebug(8106) << "drawing: " << tl << " " << tr << " " << bl << " " << br << endl; @@ -242,7 +289,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk QColor color = m_settings->colorForDifferenceType( diff->type(), selected, diff->applied() ).dark(110); p->setPen( color ); -@@ -229,16 +236,16 @@ +@@ -229,16 +238,16 @@ } } @@ -262,7 +309,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk if ( tl != tr ) { -@@ -252,12 +259,12 @@ +@@ -252,12 +261,12 @@ } } @@ -277,7 +324,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk if ( bl != br ) { -@@ -271,9 +278,9 @@ +@@ -271,9 +280,9 @@ } } @@ -291,15 +338,16 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.cpp kdesdk for( uint i = 0; i < bottomBezier.size(); i++ ) diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.h kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareconnectwidget.h --- kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.h 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareconnectwidget.h 2007-12-04 23:15:59.000000000 +0100 ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareconnectwidget.h 2007-12-10 11:35:05.000000000 +0100 @@ -22,8 +22,14 @@ #ifndef KOMPARECONNECTWIDGET_H #define KOMPARECONNECTWIDGET_H -#include "kompare_qsplitter.h" - #include +-#include ++#include ++#include +#include -+#include "kompare_qsplitter.h" +//Added by qt3to4: +#include +#include @@ -308,7 +356,17 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.h kdesdk-3 namespace Diff2 { class DiffModel; -@@ -52,9 +58,9 @@ +@@ -37,8 +43,7 @@ + Q_OBJECT + + public: +- KompareConnectWidget( KompareListView* left, KompareListView* right, +- ViewSettings* settings, QWidget* parent, const char* name = 0 ); ++ KompareConnectWidget( ViewSettings* settings, QWidget* parent, const char* name = 0 ); + ~KompareConnectWidget(); + + public slots: +@@ -52,16 +57,13 @@ protected: void paintEvent( QPaintEvent* e ); @@ -321,16 +379,33 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareconnectwidget.h kdesdk-3 private: ViewSettings* m_settings; -@@ -66,7 +72,7 @@ + +- KompareListView* m_leftView; +- KompareListView* m_rightView; +- + const Diff2::DiffModel* m_selectedModel; const Diff2::Difference* m_selectedDifference; }; - --class KompareConnectWidgetFrame : public QSplitterHandle -+class KompareConnectWidgetFrame : public KompareQSplitterHandle +@@ -70,8 +72,7 @@ { Q_OBJECT public: -@@ -89,7 +95,7 @@ +- KompareConnectWidgetFrame( KompareListView* left, KompareListView* right, +- ViewSettings* settings, KompareSplitter* parent, const char* name = 0 ); ++ KompareConnectWidgetFrame( ViewSettings* settings, KompareSplitter* parent, const char* name = 0 ); + ~KompareConnectWidgetFrame(); + + QSize sizeHint() const; +@@ -82,14 +83,16 @@ + // stop the parent QSplitterHandle painting + void paintEvent( QPaintEvent* /* e */ ) { } + ++#if 0 + void mouseMoveEvent( QMouseEvent * ); + void mousePressEvent( QMouseEvent * ); + void mouseReleaseEvent( QMouseEvent * ); ++#endif + private: KompareConnectWidget m_wid; QLabel m_label; @@ -747,1716 +822,327 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompare_part.h kdesdk-3.96.2-fi + void diffString(const QString&); protected: - /** -@@ -215,7 +216,7 @@ - KAction* m_swap; - KAction* m_diffStats; - -- KTempFile* m_tempDiff; -+ KTemporaryFile* m_tempDiff; - - struct Kompare::Info m_info; - }; -diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.cpp kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.cpp ---- kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.cpp 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.cpp 2007-12-06 03:00:39.000000000 +0100 -@@ -17,8 +17,6 @@ - ** - ***************************************************************************/ - --#include -- - #include - #include - #include -@@ -30,22 +28,36 @@ - - // implementation - --KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KDialogBase( IconList, i18n( "Preferences" ), Help|Default|Ok|Apply|Cancel, Ok, 0, 0, true, true ) -+KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KPageDialog( 0 ) - { -+ setFaceType( KPageDialog::List ); -+ setWindowTitle( i18n( "Preferences" ) ); -+ setButtons( Help|Default|Ok|Apply|Cancel ); -+ setDefaultButton( Ok ); -+ setModal( true ); -+ showButtonSeparator( true ); -+ - // ok i need some stuff in that pref dlg... -- setIconListAllVisible(true); -+ //setIconListAllVisible(true); - -- QVBox* frame; -- frame = addVBoxPage( i18n( "View" ), i18n( "View Settings" ), UserIcon( "diff_view" ) ); -- m_viewPage = new ViewPage( frame ); -+ m_viewPage = new ViewPage(); -+ KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) ); -+ item->setHeader( i18n( "View Settings" ) ); - m_viewPage->setSettings( viewSets ); - -- frame = addVBoxPage( i18n( "Diff" ), i18n( "Diff Settings" ), UserIcon( "diff_specific" ) ); -- m_diffPage = new DiffPage( frame ); -+ m_diffPage = new DiffPage(); -+ item = addPage( m_diffPage, i18n( "Diff" ) ); -+ item->setHeader( i18n( "Diff Settings" ) ); - m_diffPage->setSettings( diffSets ); - - // frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) ); - -+ connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) ); -+ connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) ); -+ connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) ); -+ connect( this, SIGNAL(okClicked()), SLOT(slotOk()) ); -+ connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) ); -+ - adjustSize(); - } - -@@ -90,7 +102,7 @@ - m_viewPage->apply(); - m_diffPage->apply(); - -- KDialogBase::slotOk(); -+ //accept(); - } - - /** No descriptions */ -@@ -100,7 +112,7 @@ - m_viewPage->restore(); - m_diffPage->restore(); - -- KDialogBase::slotCancel(); -+ //reject(); - } - - #include "kompareprefdlg.moc" -diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.h kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.h ---- kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.h 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.h 2007-12-04 21:53:23.000000000 +0100 -@@ -20,14 +20,14 @@ - #ifndef KOMPAREPREFDLG_H - #define KOMPAREPREFDLG_H - --#include -+#include - - class DiffPage; - class DiffSettings; - class ViewPage; - class ViewSettings; - --class KomparePrefDlg : public KDialogBase -+class KomparePrefDlg : public KPageDialog - { - Q_OBJECT - public: -diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompare_qsplitter.cpp kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompare_qsplitter.cpp ---- kdesdk-3.96.2-orig/kompare/komparepart/kompare_qsplitter.cpp 1970-01-01 01:00:00.000000000 +0100 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompare_qsplitter.cpp 2007-12-05 08:27:24.000000000 +0100 -@@ -0,0 +1,1374 @@ -+/**************************************************************************** -+** $Id: qt/qsplitter.cpp 3.3.8 edited Jan 11 14:39 $ -+** -+** Implementation of KompareQSplitter class -+** -+** Created : 980105 -+** -+** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. -+** -+** This file is part of the widgets module of the Qt GUI Toolkit. -+** -+** This file may be distributed and/or modified under the terms of the -+** GNU General Public License version 2 as published by the Free Software -+** Foundation and appearing in the file LICENSE.GPL included in the -+** packaging of this file. -+** -+** See http://www.trolltech.com/gpl/ for GPL licensing information. -+** -+** Contact info@trolltech.com if any conditions of this licensing are -+** not clear to you. -+** -+**********************************************************************/ -+ -+#include "kompare_qsplitter.h" -+#ifndef QT_NO_SPLITTER -+ -+#include "qlayout.h" -+//Added by qt3to4: -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "qlayoutengine_p.h" -+#include "qapplication.h" -+#include "qbitmap.h" -+#include "qdrawutil.h" -+#include -+#include "qobject.h" -+#include "qpainter.h" -+#include "q3ptrlist.h" -+#include "qstyle.h" -+#include -+ -+#include "kompare_qsplitter.moc" -+ -+using namespace Qt; -+ -+static int mouseOffset; -+static int opaqueOldPos = -1; // this assumes that there's only one mouse -+ -+static QPoint toggle( QWidget *w, QPoint pos ) -+{ -+ QSize minS = qSmartMinSize( w ); -+ return -pos - QPoint( minS.width(), minS.height() ); -+} -+ -+static bool isCollapsed( QWidget *w ) -+{ -+ return w->x() < 0 || w->y() < 0; -+} -+ -+static QPoint topLeft( QWidget *w ) -+{ -+ if ( isCollapsed(w) ) { -+ return toggle( w, w->pos() ); -+ } else { -+ return w->pos(); -+ } -+} -+ -+static QPoint bottomRight( QWidget *w ) -+{ -+ if ( isCollapsed(w) ) { -+ return toggle( w, w->pos() ) - QPoint( 1, 1 ); -+ } else { -+ return w->geometry().bottomRight(); -+ } -+} -+ -+KompareQSplitterHandle::KompareQSplitterHandle( Qt::Orientation o, KompareQSplitter *parent, -+ const char * name ) -+ : QWidget( parent, name ) -+{ -+ s = parent; -+ setOrientation( o ); -+} -+ -+QSize KompareQSplitterHandle::sizeHint() const -+{ -+ int hw = s->handleWidth(); -+ QStyleOption option; -+ option.initFrom(s); -+ return parentWidget()->style()->sizeFromContents( QStyle::CT_Splitter, &option, -+ QSize(hw, hw), s ) -+ .expandedTo( QApplication::globalStrut() ); -+} -+ -+void KompareQSplitterHandle::setOrientation( Qt::Orientation o ) -+{ -+ orient = o; -+#ifndef QT_NO_CURSOR -+ setCursor( o == Qt::Horizontal ? splitHCursor : splitVCursor ); -+#endif -+} -+ -+void KompareQSplitterHandle::mouseMoveEvent( QMouseEvent *e ) -+{ -+ if ( !(e->state()&LeftButton) ) -+ return; -+ QCOORD pos = s->pick( parentWidget()->mapFromGlobal(e->globalPos()) ) -+ - mouseOffset; -+ if ( opaque() ) { -+ s->moveSplitter( pos, id() ); -+ } else { -+ s->setRubberband( s->adjustPos(pos, id()) ); -+ } -+} -+ -+void KompareQSplitterHandle::mousePressEvent( QMouseEvent *e ) -+{ -+ if ( e->button() == LeftButton ) -+ mouseOffset = s->pick( e->pos() ); -+} -+ -+void KompareQSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) -+{ -+ if ( !opaque() && e->button() == LeftButton ) { -+ QCOORD pos = s->pick( parentWidget()->mapFromGlobal(e->globalPos()) ) -+ - mouseOffset; -+ s->setRubberband( -1 ); -+ s->moveSplitter( pos, id() ); -+ } -+} -+ -+void KompareQSplitterHandle::paintEvent( QPaintEvent * ) -+{ -+ QPainter p(this); -+ QStyleOption opt(0); -+ opt.rect = rect(); -+ opt.palette = colorGroup(); -+ if (orientation() == Qt::Horizontal) -+ opt.state = QStyle::State_Horizontal; -+ else -+ opt.state = QStyle::State_None; -+ if (isEnabled()) -+ opt.state |= QStyle::State_Enabled; -+ parentWidget()->style()->drawControl(QStyle::CE_Splitter, &opt, &p, s); -+} -+ -+QCOORD KompareQSplitterLayoutStruct::getSizer( Qt::Orientation orient ) -+{ -+ if ( sizer == -1 ) { -+ QSize s = wid->sizeHint(); -+ if ( !s.isValid() || wid->testAttribute(Qt::WA_Resized) ) -+ s = wid->size(); -+ sizer = ( orient == Horizontal ) ? s.width() : s.height(); -+ } -+ return sizer; -+} -+ -+ -+/*! -+ \class KompareQSplitter -+ \brief The KompareQSplitter class implements a splitter widget. -+ -+ \ingroup organizers -+ \mainclass -+ -+ A splitter lets the user control the size of child widgets by -+ dragging the boundary between the children. Any number of widgets -+ may be controlled by a single splitter. -+ -+ To show a QListBox, a QListView and a QTextEdit side by side: -+ \code -+ KompareQSplitter *split = new KompareQSplitter( parent ); -+ QListBox *lb = new QListBox( split ); -+ QListView *lv = new QListView( split ); -+ QTextEdit *ed = new QTextEdit( split ); -+ \endcode -+ -+ KompareQSplitter lays out its children horizontally (side by side); you -+ can use setOrientation(KompareQSplitter::Vertical) to lay out the -+ children vertically. -+ -+ By default, all widgets can be as large or as small as the user -+ wishes, between the \l minimumSizeHint() (or \l minimumSize()) -+ and \l maximumSize() of the widgets. Use setResizeMode() to -+ specify that a widget should keep its size when the splitter is -+ resized, or set the stretch component of the \l sizePolicy. -+ -+ Although KompareQSplitter normally resizes the children only at the end -+ of a resize operation, if you call setOpaqueResize(TRUE) the -+ widgets are resized as often as possible. -+ -+ The initial distribution of size between the widgets is determined -+ by the initial size of each widget. You can also use setSizes() to -+ set the sizes of all the widgets. The function sizes() returns the -+ sizes set by the user. -+ -+ If you hide() a child its space will be distributed among the -+ other children. It will be reinstated when you show() it again. It -+ is also possible to reorder the widgets within the splitter using -+ moveToFirst() and moveToLast(). -+ -+ \sa QTabBar -+*/ -+ -+ -+/*! -+ Constructs a horizontal splitter with the \a parent and \a name -+ arguments being passed on to the QFrame constructor. -+*/ -+ -+KompareQSplitter::KompareQSplitter( QWidget *parent, const char *name ) -+ : Q3Frame( parent, name ) -+{ -+ setAttribute(WA_PaintUnclipped); -+ orient = Qt::Horizontal; -+ init(); -+} -+ -+ -+/*! -+ Constructs a splitter with orientation \a o with the \a parent and -+ \a name arguments being passed on to the QFrame constructor. -+*/ -+ -+KompareQSplitter::KompareQSplitter( Qt::Orientation o, QWidget *parent, const char *name ) -+ : Q3Frame( parent, name ) -+{ -+ setAttribute(WA_PaintUnclipped); -+ orient = o; -+ init(); -+} -+ -+ -+/*! -+ Destroys the splitter and any children. -+*/ -+ -+KompareQSplitter::~KompareQSplitter() -+{ -+ delete d; -+} -+ -+ -+void KompareQSplitter::init() -+{ -+ d = new KompareQSplitterPrivate; -+ d->list.setAutoDelete( TRUE ); -+ QSizePolicy sp( QSizePolicy::Expanding, QSizePolicy::Preferred ); -+ if ( orient == Qt::Vertical ) -+ sp.transpose(); -+ setSizePolicy( sp ); -+ setAttribute(Qt::WA_WState_OwnSizePolicy, false); -+} -+ -+/*! -+ \fn void KompareQSplitter::refresh() -+ -+ Updates the splitter's state. You should not need to call this -+ function. -+*/ -+ -+ -+/*! -+ \property KompareQSplitter::orientation -+ \brief the orientation of the splitter -+ -+ By default the orientation is horizontal (the widgets are side by -+ side). The possible orientations are \c Horizontal and -+ \c Vertical. -+*/ -+ -+void KompareQSplitter::setOrientation( Qt::Orientation o ) -+{ -+ if ( orient == o ) -+ return; -+ -+ if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) ) { -+ QSizePolicy sp = sizePolicy(); -+ sp.transpose(); -+ setSizePolicy( sp ); -+ setAttribute(Qt::WA_WState_OwnSizePolicy, false); -+ } -+ -+ orient = o; -+ -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( s->isHandle ) -+ ((KompareQSplitterHandle*)s->wid)->setOrientation( o ); -+ s = d->list.next(); -+ } -+ recalc( isVisible() ); -+} -+ -+/*! -+ \property KompareQSplitter::childrenCollapsible -+ \brief whether child widgets can be resized down to size 0 by the user -+ -+ By default, children are collapsible. It is possible to enable -+ and disable the collapsing of individual children; see -+ setCollapsible(). -+*/ -+ -+void KompareQSplitter::setChildrenCollapsible( bool collapse ) -+{ -+ d->childrenCollapsible = collapse; -+} -+ -+bool KompareQSplitter::childrenCollapsible() const -+{ -+ return d->childrenCollapsible; -+} -+ -+/*! -+ Sets whether the child widget \a w is collapsible to \a collapse. -+ -+ By default, children are collapsible, meaning that the user can -+ resize them down to size 0, even if they have a non-zero -+ minimumSize() or minimumSizeHint(). This behavior can be changed -+ on a per-widget basis by calling this function, or globally for -+ all the widgets in the splitter by setting the \l -+ childrenCollapsible property. -+ -+ \sa childrenCollapsible -+*/ -+ -+void KompareQSplitter::setCollapsible( QWidget *w, bool collapse ) -+{ -+ findWidget( w )->collapsible = collapse ? 1 : 0; -+} -+ -+/*! -+ \reimp -+*/ -+void KompareQSplitter::resizeEvent( QResizeEvent * ) -+{ -+ doResize(); -+} -+ -+KompareQSplitterLayoutStruct *KompareQSplitter::findWidget( QWidget *w ) -+{ -+ processChildEvents(); -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( s->wid == w ) -+ return s; -+ s = d->list.next(); -+ } -+ return addWidget( w ); -+} -+ -+/* -+ Inserts the widget \a w at the end (or at the beginning if \a -+ prepend is TRUE) of the splitter's list of widgets. -+ -+ It is the responsibility of the caller to make sure that \a w is -+ not already in the splitter and to call recalcId() if needed. (If -+ \a prepend is TRUE, then recalcId() is very probably needed.) -+*/ -+ -+KompareQSplitterLayoutStruct *KompareQSplitter::addWidget( QWidget *w, bool prepend ) -+{ -+ KompareQSplitterLayoutStruct *s; -+ KompareQSplitterHandle *newHandle = 0; -+ if ( d->list.count() > 0 ) { -+ s = new KompareQSplitterLayoutStruct; -+ s->resizeMode = KeepSize; -+ QString tmp = "qt_splithandle_"; -+ tmp += w->name(); -+ newHandle = new KompareQSplitterHandle( orientation(), this ); -+ newHandle->setObjectName( tmp.ascii() ); -+ s->wid = newHandle; -+ newHandle->setId( d->list.count() ); -+ s->isHandle = TRUE; -+ s->sizer = pick( newHandle->sizeHint() ); -+ if ( prepend ) -+ d->list.prepend( s ); -+ else -+ d->list.append( s ); -+ } -+ s = new KompareQSplitterLayoutStruct; -+ s->resizeMode = DefaultResizeMode; -+ s->wid = w; -+ s->isHandle = FALSE; -+ if ( prepend ) -+ d->list.prepend( s ); -+ else -+ d->list.append( s ); -+ if ( newHandle && isVisible() ) -+ newHandle->show(); // will trigger sending of post events -+ return s; -+} -+ -+ -+/*! -+ Tells the splitter that the child widget described by \a c has -+ been inserted or removed. -+*/ -+ -+void KompareQSplitter::childEvent( QChildEvent *c ) -+{ -+ if ( c->type() == QEvent::ChildAdded ) { -+ if ( !c->child()->isWidgetType() ) -+ return; -+ -+ if ( ((QWidget*)c->child())->windowFlags() & Qt::WType_TopLevel ) -+ return; -+ -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( s->wid == c->child() ) -+ return; -+ s = d->list.next(); -+ } -+ addWidget( (QWidget*)c->child() ); -+ recalc( isVisible() ); -+ } else if ( c->type() == QEvent::ChildRemoved ) { -+ KompareQSplitterLayoutStruct *prev = 0; -+ if ( d->list.count() > 1 ) -+ prev = d->list.at( 1 ); // yes, this is correct -+ KompareQSplitterLayoutStruct *curr = d->list.first(); -+ while ( curr ) { -+ if ( curr->wid == c->child() ) { -+ d->list.removeRef( curr ); -+ if ( prev && prev->isHandle ) { -+ QWidget *w = prev->wid; -+ d->list.removeRef( prev ); -+ delete w; // will call childEvent() -+ } -+ recalcId(); -+ doResize(); -+ return; -+ } -+ prev = curr; -+ curr = d->list.next(); -+ } -+ } -+} -+ -+ -+/*! -+ Displays a rubber band at position \a p. If \a p is negative, the -+ rubber band is removed. -+*/ -+ -+void KompareQSplitter::setRubberband( int p ) -+{ -+ if (p < 0) { -+ if (d->rubberBand) -+ d->rubberBand->hide(); -+ return; -+ } -+ QRect r = contentsRect(); -+ const int rBord = 3; // customizable? -+ int hw = handleWidth(); -+ if (!d->rubberBand) { -+ //QBoolBlocker block(d->blockChildAdd); -+ d->rubberBand = new QRubberBand(QRubberBand::Line, this); -+ } -+ if (orient == Qt::Horizontal) -+ d->rubberBand->setGeometry(QRect(QPoint(p + hw / 2 - rBord, r.y()), -+ QSize(2 * rBord, r.height()))); -+ else -+ d->rubberBand->setGeometry(QRect(QPoint(r.x(), p + hw / 2 - rBord), -+ QSize(r.width(), 2 * rBord))); -+ if (!d->rubberBand->isVisible()) -+ d->rubberBand->show(); -+} -+ -+ -+/*! -+ \reimp -+*/ -+ -+bool KompareQSplitter::event( QEvent *e ) -+{ -+ switch ( e->type() ) { -+ case QEvent::Show: -+ if ( !d->firstShow ) -+ break; -+ d->firstShow = FALSE; -+ // fall through -+ case QEvent::LayoutRequest: -+ recalc( isVisible() ); -+ break; -+ default: -+ ; -+ } -+ return QWidget::event( e ); -+} -+ -+ -+#if 0 -+/*! -+ \obsolete -+ -+ Draws the splitter handle in the rectangle described by \a x, \a y, -+ \a w, \a h using painter \a p. -+ \sa QStyle::drawPrimitive() -+*/ -+ -+// ### Remove this in 4.0 -+ -+void KompareQSplitter::drawSplitter( QPainter *p, -+ QCOORD x, QCOORD y, QCOORD w, QCOORD h ) -+{ -+ style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(), -+ (orientation() == Qt::Horizontal ? -+ QStyle::State_Horizontal : 0)); -+} -+#endif -+ -+ -+/*! -+ Returns the ID of the widget to the right of or below the widget -+ \a w, or 0 if there is no such widget (i.e. it is either not in -+ this KompareQSplitter or \a w is at the end). -+*/ -+ -+int KompareQSplitter::idAfter( QWidget* w ) const -+{ -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ bool seen_w = FALSE; -+ while ( s ) { -+ if ( s->isHandle && seen_w ) -+ return d->list.at(); -+ if ( !s->isHandle && s->wid == w ) -+ seen_w = TRUE; -+ s = d->list.next(); -+ } -+ return 0; -+} -+ -+ -+/*! -+ Moves the left/top edge of the splitter handle with ID \a id as -+ close as possible to position \a p, which is the distance from the -+ left (or top) edge of the widget. -+ -+ For Arabic, Hebrew and other right-to-left languages the layout is -+ reversed. \a p is then the distance from the right (or top) edge -+ of the widget. -+ -+ \sa idAfter() -+*/ -+void KompareQSplitter::moveSplitter( QCOORD p, int id ) -+{ -+ KompareQSplitterLayoutStruct *s = d->list.at( id ); -+ int farMin; -+ int min; -+ int max; -+ int farMax; -+ -+ p = adjustPos( p, id, &farMin, &min, &max, &farMax ); -+ int oldP = pick( s->wid->pos() ); -+ -+ if ( QApplication::reverseLayout() && orient == Qt::Horizontal ) { -+ int q = p + s->wid->width(); -+ doMove( FALSE, q, id - 1, -1, (q > oldP), (p > max) ); -+ doMove( TRUE, q, id, -1, (q > oldP), (p < min) ); -+ } else { -+ doMove( FALSE, p, id, +1, (p < oldP), (p > max) ); -+ doMove( TRUE, p, id - 1, +1, (p < oldP), (p < min) ); -+ } -+ storeSizes(); -+} -+ -+ -+void KompareQSplitter::setGeo( QWidget *w, int p, int s, bool splitterMoved ) -+{ -+ QRect r; -+ if ( orient == Qt::Horizontal ) { -+ if ( QApplication::reverseLayout() && orient == Qt::Horizontal -+ && !splitterMoved ) -+ p = contentsRect().width() - p - s; -+ r.setRect( p, contentsRect().y(), s, contentsRect().height() ); -+ } else { -+ r.setRect( contentsRect().x(), p, contentsRect().width(), s ); -+ } -+ -+ /* -+ Hide the child widget, but without calling hide() so that the -+ splitter handle is still shown. -+ */ -+ if ( !w->isHidden() && s <= 0 && pick(qSmartMinSize(w)) > 0 ) -+ r.moveTopLeft( toggle(w, r.topLeft()) ); -+ w->setGeometry( r ); -+} -+ -+ -+void KompareQSplitter::doMove( bool backwards, int pos, int id, int delta, bool upLeft, -+ bool mayCollapse ) -+{ -+ if ( id < 0 || id >= (int) d->list.count() ) -+ return; -+ -+ KompareQSplitterLayoutStruct *s = d->list.at( id ); -+ QWidget *w = s->wid; -+ -+ int nextId = backwards ? id - delta : id + delta; -+ -+ if ( w->isHidden() ) { -+ doMove( backwards, pos, nextId, delta, upLeft, TRUE ); -+ } else { -+ if ( s->isHandle ) { -+ int dd = s->getSizer( orient ); -+ int nextPos = backwards ? pos - dd : pos + dd; -+ int left = backwards ? pos - dd : pos; -+ setGeo( w, left, dd, TRUE ); -+ doMove( backwards, nextPos, nextId, delta, upLeft, mayCollapse ); -+ } else { -+ int dd = backwards ? pos - pick( topLeft(w) ) -+ : pick( bottomRight(w) ) - pos + 1; -+ if ( dd > 0 || (!isCollapsed(w) && !mayCollapse) ) { -+ dd = QMAX( pick(qSmartMinSize(w)), -+ QMIN(dd, pick(w->maximumSize())) ); -+ } else { -+ dd = 0; -+ } -+ setGeo( w, backwards ? pos - dd : pos, dd, TRUE ); -+ doMove( backwards, backwards ? pos - dd : pos + dd, nextId, delta, -+ upLeft, TRUE ); -+ } -+ } -+} -+ -+int KompareQSplitter::findWidgetJustBeforeOrJustAfter( int id, int delta, int &collapsibleSize ) -+{ -+ id += delta; -+ do { -+ QWidget *w = d->list.at( id )->wid; -+ if ( !w->isHidden() ) { -+ if ( collapsible(d->list.at(id)) ) -+ collapsibleSize = pick( qSmartMinSize(w) ); -+ return id; -+ } -+ id += 2 * delta; // go to previous (or next) widget, skip the handle -+ } while ( id >= 0 && id < (int)d->list.count() ); -+ -+ return -1; -+} -+ -+void KompareQSplitter::getRange( int id, int *farMin, int *min, int *max, int *farMax ) -+{ -+ int n = d->list.count(); -+ if ( id <= 0 || id >= n - 1 ) -+ return; -+ -+ int collapsibleSizeBefore = 0; -+ int idJustBefore = findWidgetJustBeforeOrJustAfter( id, -1, collapsibleSizeBefore ); -+ -+ int collapsibleSizeAfter = 0; -+ int idJustAfter = findWidgetJustBeforeOrJustAfter( id, +1, collapsibleSizeAfter ); -+ -+ int minBefore = 0; -+ int minAfter = 0; -+ int maxBefore = 0; -+ int maxAfter = 0; -+ int i; -+ -+ for ( i = 0; i < id; i++ ) -+ addContribution( i, &minBefore, &maxBefore, i == idJustBefore ); -+ for ( i = id; i < n; i++ ) -+ addContribution( i, &minAfter, &maxAfter, i == idJustAfter ); -+ -+ QRect r = contentsRect(); -+ int farMinVal; -+ int minVal; -+ int maxVal; -+ int farMaxVal; -+ -+ int smartMinBefore = QMAX( minBefore, pick(r.size()) - maxAfter ); -+ int smartMaxBefore = QMIN( maxBefore, pick(r.size()) - minAfter ); -+ -+ if ( orient == Qt::Vertical || !QApplication::reverseLayout() ) { -+ minVal = pick( r.topLeft() ) + smartMinBefore; -+ maxVal = pick( r.topLeft() ) + smartMaxBefore; -+ -+ farMinVal = minVal; -+ if ( minBefore - collapsibleSizeBefore >= pick(r.size()) - maxAfter ) -+ farMinVal -= collapsibleSizeBefore; -+ farMaxVal = maxVal; -+ if ( pick(r.size()) - (minAfter - collapsibleSizeAfter) <= maxBefore ) -+ farMaxVal += collapsibleSizeAfter; -+ } else { -+ int hw = handleWidth(); -+ minVal = r.width() - smartMaxBefore - hw; -+ maxVal = r.width() - smartMinBefore - hw; -+ -+ farMinVal = minVal; -+ if ( pick(r.size()) - (minAfter - collapsibleSizeAfter) <= maxBefore ) -+ farMinVal -= collapsibleSizeAfter; -+ farMaxVal = maxVal; -+ if ( minBefore - collapsibleSizeBefore >= pick(r.size()) - maxAfter ) -+ farMaxVal += collapsibleSizeBefore; -+ } -+ -+ if ( farMin ) -+ *farMin = farMinVal; -+ if ( min ) -+ *min = minVal; -+ if ( max ) -+ *max = maxVal; -+ if ( farMax ) -+ *farMax = farMaxVal; -+} -+ -+/*! -+ Returns the valid range of the splitter with ID \a id in \a *min -+ and \a *max if \a min and \a max are not 0. -+ -+ \sa idAfter() -+*/ -+ -+void KompareQSplitter::getRange( int id, int *min, int *max ) -+{ -+ getRange( id, min, 0, 0, max ); -+} -+ -+ -+/*! -+ Returns the closest legal position to \a pos of the widget with ID -+ \a id. -+ -+ \sa idAfter() -+*/ -+ -+int KompareQSplitter::adjustPos( int pos, int id ) -+{ -+ int x, i, n, u; -+ return adjustPos( pos, id, &u, &n, &i, &x ); -+} -+ -+int KompareQSplitter::adjustPos( int pos, int id, int *farMin, int *min, int *max, -+ int *farMax ) -+{ -+ const int Threshold = 40; -+ -+ getRange( id, farMin, min, max, farMax ); -+ -+ if ( pos >= *min ) { -+ if ( pos <= *max ) { -+ return pos; -+ } else { -+ int delta = pos - *max; -+ int width = *farMax - *max; -+ -+ if ( delta > width / 2 && delta >= QMIN(Threshold, width) ) { -+ return *farMax; -+ } else { -+ return *max; -+ } -+ } -+ } else { -+ int delta = *min - pos; -+ int width = *min - *farMin; -+ -+ if ( delta > width / 2 && delta >= QMIN(Threshold, width) ) { -+ return *farMin; -+ } else { -+ return *min; -+ } -+ } -+} -+ -+bool KompareQSplitter::collapsible( KompareQSplitterLayoutStruct *s ) -+{ -+ if (pick(qSmartMinSize(s->wid)) == 1) -+ return FALSE; -+ if ( s->collapsible != Default ) { -+ return (bool) s->collapsible; -+ } else { -+ return d->childrenCollapsible; -+ } -+} -+ -+void KompareQSplitter::doResize() -+{ -+ QRect r = contentsRect(); -+ int n = d->list.count(); -+ QVector a( n ); -+ -+ for ( int pass = 0; pass < 2; pass++ ) { -+ int numAutoWithStretch = 0; -+ int numAutoWithoutStretch = 0; -+ -+ for ( int i = 0; i < n; i++ ) { -+ a[i].init(); -+ KompareQSplitterLayoutStruct *s = d->list.at( i ); -+ if ( s->wid->isHidden() || isCollapsed(s->wid) ) { -+ a[i].maximumSize = 0; -+ } else if ( s->isHandle ) { -+ a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer; -+ a[i].empty = FALSE; -+ } else { -+ int mode = s->resizeMode; -+ int stretch = 1; -+ -+ if ( mode == DefaultResizeMode ) { -+ QSizePolicy p = s->wid->sizePolicy(); -+ int sizePolicyStretch = -+ pick( QSize(p.horStretch(), p.verStretch()) ); -+ if ( sizePolicyStretch > 0 ) { -+ mode = Stretch; -+ stretch = sizePolicyStretch; -+ numAutoWithStretch++; -+ } else { -+ /* -+ Do things differently on the second pass, -+ if there's one. A second pass is necessary -+ if it was found out during the first pass -+ that all DefaultResizeMode items are -+ KeepSize items. In that case, we make them -+ all Stretch items instead, for a more Qt -+ 3.0-compatible behavior. -+ */ -+ mode = ( pass == 0 ) ? KeepSize : Stretch; -+ numAutoWithoutStretch++; -+ } -+ } -+ -+ a[i].minimumSize = pick( qSmartMinSize(s->wid) ); -+ a[i].maximumSize = pick( s->wid->maximumSize() ); -+ a[i].empty = FALSE; -+ -+ if ( mode == Stretch ) { -+ if ( s->getSizer(orient) > 1 ) -+ stretch *= s->getSizer( orient ); -+ // QMIN(): ad hoc work-around for layout engine limitation -+ a[i].stretch = QMIN( stretch, 8192 ); -+ a[i].sizeHint = a[i].minimumSize; -+ } else if ( mode == KeepSize ) { -+ a[i].sizeHint = s->getSizer( orient ); -+ } else { // mode == FollowSizeHint -+ a[i].sizeHint = pick( s->wid->sizeHint() ); -+ } -+ } -+ } -+ -+ // a second pass would yield the same results -+ if ( numAutoWithStretch > 0 || numAutoWithoutStretch == 0 ) -+ break; -+ } -+ -+ qGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 ); -+ -+ for ( int i = 0; i < n; i++ ) { -+ KompareQSplitterLayoutStruct *s = d->list.at(i); -+ setGeo( s->wid, a[i].pos, a[i].size, FALSE ); -+ } -+} -+ -+void KompareQSplitter::recalc( bool update ) -+{ -+ int fi = 2 * frameWidth(); -+ int maxl = fi; -+ int minl = fi; -+ int maxt = QWIDGETSIZE_MAX; -+ int mint = fi; -+ int n = d->list.count(); -+ bool first = TRUE; -+ -+ /* -+ Splitter handles before the first visible widget or right -+ before a hidden widget must be hidden. -+ */ -+ for ( int i = 0; i < n; i++ ) { -+ KompareQSplitterLayoutStruct *s = d->list.at( i ); -+ if ( !s->isHandle ) { -+ KompareQSplitterLayoutStruct *p = 0; -+ if ( i > 0 ) -+ p = d->list.at( i - 1 ); -+ -+ // may trigger new recalc -+ if ( p && p->isHandle ) -+ p->wid->setHidden( first || s->wid->isHidden() ); -+ -+ if ( !s->wid->isHidden() ) -+ first = FALSE; -+ } -+ } -+ -+ bool empty = TRUE; -+ for ( int j = 0; j < n; j++ ) { -+ KompareQSplitterLayoutStruct *s = d->list.at( j ); -+ if ( !s->wid->isHidden() ) { -+ empty = FALSE; -+ if ( s->isHandle ) { -+ minl += s->getSizer( orient ); -+ maxl += s->getSizer( orient ); -+ } else { -+ QSize minS = qSmartMinSize( s->wid ); -+ minl += pick( minS ); -+ maxl += pick( s->wid->maximumSize() ); -+ mint = QMAX( mint, trans(minS) ); -+ int tm = trans( s->wid->maximumSize() ); -+ if ( tm > 0 ) -+ maxt = QMIN( maxt, tm ); -+ } -+ } -+ } -+ if ( empty ) { -+ if ( qobject_cast(parentWidget()) ) { -+ // nested splitters; be nice -+ maxl = maxt = 0; -+ } else { -+ // KompareQSplitter with no children yet -+ maxl = QWIDGETSIZE_MAX; -+ } -+ } else { -+ maxl = QMIN( maxl, QWIDGETSIZE_MAX ); -+ } -+ if ( maxt < mint ) -+ maxt = mint; -+ -+ if ( orient == Qt::Horizontal ) { -+ setMaximumSize( maxl, maxt ); -+ setMinimumSize( minl, mint ); -+ } else { -+ setMaximumSize( maxt, maxl ); -+ setMinimumSize( mint, minl ); -+ } -+ if ( update ) -+ doResize(); -+ else -+ d->firstShow = TRUE; -+} -+ -+/*! -+ \enum KompareQSplitter::ResizeMode -+ -+ This enum type describes how KompareQSplitter will resize each of its -+ child widgets. -+ -+ \value Auto The widget will be resized according to the stretch -+ factors set in its sizePolicy(). -+ -+ \value Stretch The widget will be resized when the splitter -+ itself is resized. -+ -+ \value KeepSize KompareQSplitter will try to keep the widget's size -+ unchanged. -+ -+ \value FollowSizeHint KompareQSplitter will resize the widget when the -+ widget's size hint changes. -+*/ -+ -+/*! -+ Sets resize mode of widget \a w to \a mode. (The default is \c -+ Auto.) -+*/ -+ -+void KompareQSplitter::setResizeMode( QWidget *w, ResizeMode mode ) -+{ -+ findWidget( w )->resizeMode = mode; -+} -+ -+ -+/*! -+ \property KompareQSplitter::opaqueResize -+ \brief whether resizing is opaque -+ -+ Opaque resizing is off by default. -+*/ -+ -+bool KompareQSplitter::opaqueResize() const -+{ -+ return d->opaque; -+} -+ -+ -+void KompareQSplitter::setOpaqueResize( bool on ) -+{ -+ d->opaque = on; -+} -+ -+ -+/*! -+ Moves widget \a w to the leftmost/top position. -+*/ -+ -+void KompareQSplitter::moveToFirst( QWidget *w ) -+{ -+ processChildEvents(); -+ bool found = FALSE; -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( s->wid == w ) { -+ found = TRUE; -+ KompareQSplitterLayoutStruct *p = d->list.prev(); -+ if ( p ) { // not already at first place -+ d->list.take(); // take p -+ d->list.take(); // take s -+ d->list.prepend( p ); -+ d->list.prepend( s ); -+ } -+ break; -+ } -+ s = d->list.next(); -+ } -+ if ( !found ) -+ addWidget( w, TRUE ); -+ recalcId(); -+} -+ -+ -+/*! -+ Moves widget \a w to the rightmost/bottom position. -+*/ -+ -+void KompareQSplitter::moveToLast( QWidget *w ) -+{ -+ processChildEvents(); -+ bool found = FALSE; -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( s->wid == w ) { -+ found = TRUE; -+ d->list.take(); // take s -+ KompareQSplitterLayoutStruct *p = d->list.current(); -+ if ( p ) { // the splitter handle after s -+ d->list.take(); // take p -+ d->list.append( p ); -+ } -+ d->list.append( s ); -+ break; -+ } -+ s = d->list.next(); -+ } -+ if ( !found ) -+ addWidget( w ); -+ recalcId(); -+} -+ -+ -+void KompareQSplitter::recalcId() -+{ -+ int n = d->list.count(); -+ for ( int i = 0; i < n; i++ ) { -+ KompareQSplitterLayoutStruct *s = d->list.at( i ); -+ if ( s->isHandle ) -+ ((KompareQSplitterHandle*)s->wid)->setId( i ); -+ } -+} -+ -+ -+/*! -+ \reimp -+*/ -+QSize KompareQSplitter::sizeHint() const -+{ -+ ensurePolished(); -+ int l = 0; -+ int t = 0; -+ if ( !children().isEmpty() ) { -+ const QObjectList c = children(); -+ QListIterator it( c ); -+ QObject * o; -+ -+ while( it.hasNext() ) { -+ o = it.next(); -+ if ( o->isWidgetType() && !((QWidget*)o)->isHidden() ) { -+ QSize s = ((QWidget*)o)->sizeHint(); -+ if ( s.isValid() ) { -+ l += pick( s ); -+ t = QMAX( t, trans( s ) ); -+ } -+ } -+ } -+ } -+ return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l ); -+} -+ -+ -+/*! -+ \reimp -+*/ -+ -+QSize KompareQSplitter::minimumSizeHint() const -+{ -+ ensurePolished(); -+ int l = 0; -+ int t = 0; -+ if ( !children().isEmpty() ) { -+ const QObjectList c = children(); -+ QListIterator it( c ); -+ QObject * o; -+ -+ while( it.hasNext() ) { -+ o = it.next(); -+ if ( o->isWidgetType() && !((QWidget*)o)->isHidden() ) { -+ QSize s = qSmartMinSize( (QWidget*)o ); -+ if ( s.isValid() ) { -+ l += pick( s ); -+ t = QMAX( t, trans( s ) ); -+ } -+ } -+ } -+ } -+ return orientation() == Qt::Horizontal ? QSize( l, t ) : QSize( t, l ); -+} -+ -+ -+void KompareQSplitter::storeSizes() -+{ -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( !s->isHandle ) -+ s->sizer = pick( s->wid->size() ); -+ s = d->list.next(); -+ } -+} -+ -+ -+void KompareQSplitter::addContribution( int id, int *min, int *max, -+ bool mayCollapse ) -+{ -+ KompareQSplitterLayoutStruct *s = d->list.at( id ); -+ if ( !s->wid->isHidden() ) { -+ if ( s->isHandle ) { -+ *min += s->getSizer( orient ); -+ *max += s->getSizer( orient ); -+ } else { -+ if ( mayCollapse || !isCollapsed(s->wid) ) -+ *min += pick( qSmartMinSize(s->wid) ); -+ *max += pick( s->wid->maximumSize() ); -+ } -+ } -+} -+ -+ -+/*! -+ Returns a list of the size parameters of all the widgets in this -+ splitter. -+ -+ If the splitter's orientation is horizontal, the list is a list of -+ widget widths; if the orientation is vertical, the list is a list -+ of widget heights. -+ -+ Giving the values to another splitter's setSizes() function will -+ produce a splitter with the same layout as this one. -+ -+ Note that if you want to iterate over the list, you should iterate -+ over a copy, e.g. -+ \code -+ QValueList list = mySplitter.sizes(); -+ QValueList::Iterator it = list.begin(); -+ while( it != list.end() ) { -+ myProcessing( *it ); -+ ++it; -+ } -+ \endcode -+ -+ \sa setSizes() -+*/ -+ -+Q3ValueList KompareQSplitter::sizes() const -+{ -+ ensurePolished(); -+ -+ Q3ValueList list; -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( !s->isHandle ) -+ list.append( isCollapsed(s->wid) ? 0 : pick(s->wid->size())); -+ s = d->list.next(); -+ } -+ return list; -+} -+ -+/*! -+ Sets the size parameters to the values given in the \a list. If -+ the splitter is horizontal, the values set the widths of each -+ widget going from left to right. If the splitter is vertical, the -+ values set the heights of each widget going from top to bottom. -+ Extra values in the \a list are ignored. -+ -+ If \a list contains too few values, the result is undefined but -+ the program will still be well-behaved. -+ -+ Note that the values in \a list should be the height/width that -+ the widgets should be resized to. -+ -+ \sa sizes() -+*/ -+ -+void KompareQSplitter::setSizes( Q3ValueList list ) -+{ -+ processChildEvents(); -+ Q3ValueList::Iterator it = list.begin(); -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s && it != list.end() ) { -+ if ( !s->isHandle ) { -+ s->sizer = QMAX( *it, 0 ); -+ int smartMinSize = pick( qSmartMinSize(s->wid) ); -+ // Make sure that we reset the collapsed state. -+ if ( s->sizer == 0 ) { -+ if ( collapsible(s) && smartMinSize > 0 ) { -+ s->wid->move( -1, -1 ); -+ } else { -+ s->sizer = smartMinSize; -+ s->wid->move( 0, 0 ); -+ } -+ } else { -+ if ( s->sizer < smartMinSize ) -+ s->sizer = smartMinSize; -+ s->wid->move( 0, 0 ); -+ } -+ ++it; -+ } -+ s = d->list.next(); -+ } -+ doResize(); -+} -+ -+/*! -+ \property KompareQSplitter::handleWidth -+ \brief the width of the splitter handle -+*/ -+ -+int KompareQSplitter::handleWidth() const -+{ -+ if ( d->handleWidth > 0 ) { -+ return d->handleWidth; -+ } else { -+ QStyleOption option; -+ option.initFrom(this); -+ return style()->pixelMetric( QStyle::PM_SplitterWidth, &option, this ); -+ } -+} -+ -+void KompareQSplitter::setHandleWidth( int width ) -+{ -+ d->handleWidth = width; -+ updateHandles(); -+} -+ -+/*! -+ Processes all posted child events, ensuring that the internal state of -+ the splitter is kept consistent. -+*/ -+ -+void KompareQSplitter::processChildEvents() -+{ -+ QApplication::sendPostedEvents( this, QEvent::ChildAdded ); -+} -+ -+/*! -+ \reimp -+*/ -+ -+void KompareQSplitter::styleChange( QStyle& old ) -+{ -+ updateHandles(); -+ Q3Frame::styleChange( old ); -+} -+ -+void KompareQSplitter::updateHandles() -+{ -+ int hw = handleWidth(); -+ KompareQSplitterLayoutStruct *s = d->list.first(); -+ while ( s ) { -+ if ( s->isHandle ) -+ s->sizer = hw; -+ s = d->list.next(); -+ } -+ recalc( isVisible() ); -+} -+ -+#if 0 /*ndef QT_NO_TEXTSTREAM*/ -+/*! -+ \relates KompareQSplitter -+ -+ Writes the sizes and the hidden state of the widgets in the -+ splitter \a splitter to the text stream \a ts. -+ -+ \sa operator>>(), sizes(), QWidget::isHidden() -+*/ -+ -+Q3TextStream& operator<<( Q3TextStream& ts, const KompareQSplitter& splitter ) -+{ -+ KompareQSplitterLayoutStruct *s = splitter.d->list.first(); -+ bool first = TRUE; -+ ts << "["; -+ -+ while ( s != 0 ) { -+ if ( !s->isHandle ) { -+ if ( !first ) -+ ts << ","; -+ -+ if ( s->wid->isHidden() ) { -+ ts << "H"; -+ } else if ( isCollapsed(s->wid) ) { -+ ts << 0; -+ } else { -+ ts << s->getSizer( splitter.orientation() ); -+ } -+ first = FALSE; -+ } -+ s = splitter.d->list.next(); -+ } -+ ts << "]" << endl; -+ return ts; -+} -+ -+/*! -+ \relates KompareQSplitter -+ -+ Reads the sizes and the hidden state of the widgets in the -+ splitter \a splitter from the text stream \a ts. The sizes must -+ have been previously written by the operator<<() function. -+ -+ \sa operator<<(), setSizes(), QWidget::hide() -+*/ -+ -+Q3TextStream& operator>>( Q3TextStream& ts, KompareQSplitter& splitter ) -+{ -+#undef SKIP_SPACES -+#define SKIP_SPACES() \ -+ while ( line[i].isSpace() ) \ -+ i++ -+ -+ splitter.processChildEvents(); -+ KompareQSplitterLayoutStruct *s = splitter.d->list.first(); -+ QString line = ts.readLine(); -+ int i = 0; -+ -+ SKIP_SPACES(); -+ if ( line[i] == '[' ) { -+ i++; -+ SKIP_SPACES(); -+ while ( line[i] != ']' ) { -+ while ( s != 0 && s->isHandle ) -+ s = splitter.d->list.next(); -+ if ( s == 0 ) -+ break; + /** +@@ -215,7 +216,7 @@ + KAction* m_swap; + KAction* m_diffStats; + +- KTempFile* m_tempDiff; ++ KTemporaryFile* m_tempDiff; + + struct Kompare::Info m_info; + }; +diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.cpp kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.cpp +--- kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.cpp 2006-10-26 04:18:11.000000000 +0200 ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.cpp 2007-12-06 03:00:39.000000000 +0100 +@@ -17,8 +17,6 @@ + ** + ***************************************************************************/ + +-#include +- + #include + #include + #include +@@ -30,22 +28,36 @@ + + // implementation + +-KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KDialogBase( IconList, i18n( "Preferences" ), Help|Default|Ok|Apply|Cancel, Ok, 0, 0, true, true ) ++KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KPageDialog( 0 ) + { ++ setFaceType( KPageDialog::List ); ++ setWindowTitle( i18n( "Preferences" ) ); ++ setButtons( Help|Default|Ok|Apply|Cancel ); ++ setDefaultButton( Ok ); ++ setModal( true ); ++ showButtonSeparator( true ); + -+ if ( line[i].upper() == 'H' ) { -+ s->wid->hide(); -+ i++; -+ } else { -+ s->wid->show(); -+ int dim = 0; -+ while ( line[i].digitValue() >= 0 ) { -+ dim *= 10; -+ dim += line[i].digitValue(); -+ i++; -+ } -+ s->sizer = dim; -+ if ( dim == 0 ) -+ splitter.setGeo( s->wid, 0, 0, FALSE ); -+ } -+ SKIP_SPACES(); -+ if ( line[i] == ',' ) { -+ i++; -+ } else { -+ break; -+ } -+ SKIP_SPACES(); -+ s = splitter.d->list.next(); -+ } -+ } -+ splitter.doResize(); -+ return ts; -+} -+#endif + // ok i need some stuff in that pref dlg... +- setIconListAllVisible(true); ++ //setIconListAllVisible(true); + +- QVBox* frame; +- frame = addVBoxPage( i18n( "View" ), i18n( "View Settings" ), UserIcon( "diff_view" ) ); +- m_viewPage = new ViewPage( frame ); ++ m_viewPage = new ViewPage(); ++ KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) ); ++ item->setHeader( i18n( "View Settings" ) ); + m_viewPage->setSettings( viewSets ); + +- frame = addVBoxPage( i18n( "Diff" ), i18n( "Diff Settings" ), UserIcon( "diff_specific" ) ); +- m_diffPage = new DiffPage( frame ); ++ m_diffPage = new DiffPage(); ++ item = addPage( m_diffPage, i18n( "Diff" ) ); ++ item->setHeader( i18n( "Diff Settings" ) ); + m_diffPage->setSettings( diffSets ); + + // frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) ); + ++ connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) ); ++ connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) ); ++ connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) ); ++ connect( this, SIGNAL(okClicked()), SLOT(slotOk()) ); ++ connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) ); + -+#endif + adjustSize(); + } + +@@ -90,7 +102,7 @@ + m_viewPage->apply(); + m_diffPage->apply(); + +- KDialogBase::slotOk(); ++ //accept(); + } + + /** No descriptions */ +@@ -100,7 +112,7 @@ + m_viewPage->restore(); + m_diffPage->restore(); + +- KDialogBase::slotCancel(); ++ //reject(); + } + + #include "kompareprefdlg.moc" +diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.h kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.h +--- kdesdk-3.96.2-orig/kompare/komparepart/kompareprefdlg.h 2006-10-26 04:18:11.000000000 +0200 ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompareprefdlg.h 2007-12-04 21:53:23.000000000 +0100 +@@ -20,14 +20,14 @@ + #ifndef KOMPAREPREFDLG_H + #define KOMPAREPREFDLG_H + +-#include ++#include + + class DiffPage; + class DiffSettings; + class ViewPage; + class ViewSettings; + +-class KomparePrefDlg : public KDialogBase ++class KomparePrefDlg : public KPageDialog + { + Q_OBJECT + public: diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/kompare_qsplitter.h kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompare_qsplitter.h --- kdesdk-3.96.2-orig/kompare/komparepart/kompare_qsplitter.h 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompare_qsplitter.h 2007-12-04 23:57:59.000000000 +0100 -@@ -1,7 +1,15 @@ -+//Added by qt3to4: -+#include -+#include -+#include -+#include -+#include -+#include -+ - /**************************************************************************** - ** - ** ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/kompare_qsplitter.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,213 +0,0 @@ +-/**************************************************************************** +-** +-** -** Definition of QSplitter class -+** Definition of KompareQSplitter class - ** - ** Created : 980105 - ** -@@ -21,39 +29,41 @@ - ** - **********************************************************************/ - +-** +-** Created : 980105 +-** +-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +-** +-** This file is part of the widgets module of the Qt GUI Toolkit. +-** +-** This file may be distributed and/or modified under the terms of the +-** GNU General Public License version 2 as published by the Free Software +-** Foundation and appearing in the file LICENSE.GPL included in the +-** packaging of this file. +-** +-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +-** +-** See http://www.trolltech.com/gpl/ for GPL licensing information. +-** +-**********************************************************************/ +- -#ifndef QSPLITTER_H -#define QSPLITTER_H -+#ifndef KOMPAREQSPLITTER_H -+#define KOMPAREQSPLITTER_H - - #ifndef QT_H +- +-#ifndef QT_H -#include "qframe.h" -#include "qvaluelist.h" -+#include "q3frame.h" -+#include "q3valuelist.h" - #endif // QT_H - - #ifndef QT_NO_SPLITTER - - +-#endif // QT_H +- +-#ifndef QT_NO_SPLITTER +- +- -//class QSplitterHandle; -class QSplitterLayoutStruct; -class QTextStream; -+//class KompareQSplitterHandle; -+class KompareQSplitterLayoutStruct; -+class Q3TextStream; -+class QRubberBand; - +- -class QSplitterPrivate -+class KompareQSplitterPrivate - { - public: +-{ +-public: - QSplitterPrivate() -+ KompareQSplitterPrivate() - : opaque( FALSE ), firstShow( TRUE ), childrenCollapsible( TRUE ), - handleWidth( 0 ) { } - +- : opaque( FALSE ), firstShow( TRUE ), childrenCollapsible( TRUE ), +- handleWidth( 0 ) { } +- - QPtrList list; -+ Q3PtrList list; - bool opaque : 8; - bool firstShow : 8; - bool childrenCollapsible : 8; - int handleWidth; -+ QRubberBand *rubberBand; - }; - +- bool opaque : 8; +- bool firstShow : 8; +- bool childrenCollapsible : 8; +- int handleWidth; +-}; +- -class Q_EXPORT QSplitter : public QFrame -+class KompareQSplitter : public Q3Frame - { - Q_OBJECT +-{ +- Q_OBJECT - Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) -+ Q_PROPERTY( Qt::Orientation orientation READ orientation WRITE setOrientation ) - Q_PROPERTY( bool opaqueResize READ opaqueResize WRITE setOpaqueResize ) - Q_PROPERTY( int handleWidth READ handleWidth WRITE setHandleWidth ) - Q_PROPERTY( bool childrenCollapsible READ childrenCollapsible WRITE setChildrenCollapsible ) -@@ -62,12 +72,12 @@ - // ### Qt 4.0: remove Auto from public API - enum ResizeMode { Stretch, KeepSize, FollowSizeHint, Auto }; - +- Q_PROPERTY( bool opaqueResize READ opaqueResize WRITE setOpaqueResize ) +- Q_PROPERTY( int handleWidth READ handleWidth WRITE setHandleWidth ) +- Q_PROPERTY( bool childrenCollapsible READ childrenCollapsible WRITE setChildrenCollapsible ) +- +-public: +- // ### Qt 4.0: remove Auto from public API +- enum ResizeMode { Stretch, KeepSize, FollowSizeHint, Auto }; +- - QSplitter( QWidget* parent = 0, const char* name = 0 ); - QSplitter( Orientation, QWidget* parent = 0, const char* name = 0 ); - ~QSplitter(); -+ KompareQSplitter( QWidget* parent = 0, const char* name = 0 ); -+ KompareQSplitter( Qt::Orientation, QWidget* parent = 0, const char* name = 0 ); -+ ~KompareQSplitter(); - +- - virtual void setOrientation( Orientation ); - Orientation orientation() const { return orient; } -+ virtual void setOrientation( Qt::Orientation ); -+ Qt::Orientation orientation() const { return orient; } - - // ### Qt 4.0: make setChildrenCollapsible() and setCollapsible() virtual - -@@ -86,8 +96,8 @@ - QSize sizeHint() const; - QSize minimumSizeHint() const; - +- +- // ### Qt 4.0: make setChildrenCollapsible() and setCollapsible() virtual +- +- void setChildrenCollapsible( bool ); +- bool childrenCollapsible() const; +- +- void setCollapsible( QWidget *w, bool ); +- virtual void setResizeMode( QWidget *w, ResizeMode ); +- virtual void setOpaqueResize( bool = TRUE ); +- bool opaqueResize() const; +- +- void moveToFirst( QWidget * ); +- void moveToLast( QWidget * ); +- +- void refresh() { recalc( TRUE ); } +- QSize sizeHint() const; +- QSize minimumSizeHint() const; +- - QValueList sizes() const; - void setSizes( QValueList ); -+ Q3ValueList sizes() const; -+ void setSizes( Q3ValueList ); - - int handleWidth() const; - void setHandleWidth( int ); -@@ -101,8 +111,10 @@ - int idAfter( QWidget* ) const; - - void moveSplitter( QCOORD pos, int id ); -+#if 0 - virtual void drawSplitter( QPainter*, QCOORD x, QCOORD y, - QCOORD w, QCOORD h ); -+#endif - void styleChange( QStyle& ); - int adjustPos( int, int ); - virtual void setRubberband( int ); -@@ -118,10 +130,10 @@ - void getRange( int id, int *, int *, int *, int * ); - void addContribution( int, int *, int *, bool ); - int adjustPos( int, int, int *, int *, int *, int * ); +- +- int handleWidth() const; +- void setHandleWidth( int ); +- +-protected: +- void childEvent( QChildEvent * ); +- +- bool event( QEvent * ); +- void resizeEvent( QResizeEvent * ); +- +- int idAfter( QWidget* ) const; +- +- void moveSplitter( QCOORD pos, int id ); +- virtual void drawSplitter( QPainter*, QCOORD x, QCOORD y, +- QCOORD w, QCOORD h ); +- void styleChange( QStyle& ); +- int adjustPos( int, int ); +- virtual void setRubberband( int ); +- void getRange( int id, int *, int * ); +- +-public: // private (: +- enum { DefaultResizeMode = 3 }; +- +- void init(); +- void recalc( bool update = FALSE ); +- void doResize(); +- void storeSizes(); +- void getRange( int id, int *, int *, int *, int * ); +- void addContribution( int, int *, int *, bool ); +- int adjustPos( int, int, int *, int *, int *, int * ); - bool collapsible( QSplitterLayoutStruct * ); -+ bool collapsible( KompareQSplitterLayoutStruct * ); - void processChildEvents(); +- void processChildEvents(); - QSplitterLayoutStruct *findWidget( QWidget * ); - QSplitterLayoutStruct *addWidget( QWidget *, bool prepend = FALSE ); -+ KompareQSplitterLayoutStruct *findWidget( QWidget * ); -+ KompareQSplitterLayoutStruct *addWidget( QWidget *, bool prepend = FALSE ); - void recalcId(); - void doMove( bool backwards, int pos, int id, int delta, bool upLeft, - bool mayCollapse ); -@@ -130,46 +142,46 @@ - void updateHandles(); - - inline QCOORD pick( const QPoint &p ) const +- void recalcId(); +- void doMove( bool backwards, int pos, int id, int delta, bool upLeft, +- bool mayCollapse ); +- void setGeo( QWidget *w, int pos, int size, bool splitterMoved ); +- int findWidgetJustBeforeOrJustAfter( int id, int delta, int &collapsibleSize ); +- void updateHandles(); +- +- inline QCOORD pick( const QPoint &p ) const - { return orient == Horizontal ? p.x() : p.y(); } -+ { return orient == Qt::Horizontal ? p.x() : p.y(); } - inline QCOORD pick( const QSize &s ) const +- inline QCOORD pick( const QSize &s ) const - { return orient == Horizontal ? s.width() : s.height(); } -+ { return orient == Qt::Horizontal ? s.width() : s.height(); } - - inline QCOORD trans( const QPoint &p ) const +- +- inline QCOORD trans( const QPoint &p ) const - { return orient == Vertical ? p.x() : p.y(); } -+ { return orient == Qt::Vertical ? p.x() : p.y(); } - inline QCOORD trans( const QSize &s ) const +- inline QCOORD trans( const QSize &s ) const - { return orient == Vertical ? s.width() : s.height(); } -+ { return orient == Qt::Vertical ? s.width() : s.height(); } - +- - QSplitterPrivate *d; -+ KompareQSplitterPrivate *d; - +- - Orientation orient; - friend class QSplitterHandle; -+ Qt::Orientation orient; -+ friend class KompareQSplitterHandle; - - #ifndef QT_NO_TEXTSTREAM - // moc doesn't like these. +- +-#ifndef QT_NO_TEXTSTREAM +-// moc doesn't like these. -// friend Q_EXPORT QTextStream& operator<<( QTextStream&, const QSplitter& ); -// friend Q_EXPORT QTextStream& operator>>( QTextStream&, QSplitter& ); -+// friend QTextStream& operator<<( QTextStream&, const KompareQSplitter& ); -+// friend QTextStream& operator>>( QTextStream&, KompareQSplitter& ); - #endif - - public: - #if defined(Q_DISABLE_COPY) +-#endif +- +-public: +-#if defined(Q_DISABLE_COPY) - QSplitter( const QSplitter & ); - QSplitter& operator=( const QSplitter & ); -+ KompareQSplitter( const KompareQSplitter & ); -+ KompareQSplitter& operator=( const KompareQSplitter & ); - #endif - }; - - #ifndef QT_NO_TEXTSTREAM +-#endif +-}; +- +-#ifndef QT_NO_TEXTSTREAM -Q_EXPORT QTextStream& operator<<( QTextStream&, const QSplitter& ); -Q_EXPORT QTextStream& operator>>( QTextStream&, QSplitter& ); -+//Q3TextStream& operator<<( Q3TextStream&, const KompareQSplitter& ); -+//Q3TextStream& operator>>( Q3TextStream&, KompareQSplitter& ); - #endif - +-#endif +- -class QSplitterHandle : public QWidget -+class KompareQSplitterHandle : public QWidget - { - Q_OBJECT - public: +-{ +- Q_OBJECT +-public: - QSplitterHandle( Orientation o, - QSplitter *parent, const char* name=0 ); - void setOrientation( Orientation o ); - Orientation orientation() const { return orient; } -+ KompareQSplitterHandle( Qt::Orientation o, -+ KompareQSplitter *parent, const char* name=0 ); -+ void setOrientation( Qt::Orientation o ); -+ Qt::Orientation orientation() const { return orient; } - - bool opaque() const { return s->opaqueResize(); } - -@@ -185,16 +197,16 @@ - void mouseReleaseEvent( QMouseEvent * ); - - public: // private (: +- +- bool opaque() const { return s->opaqueResize(); } +- +- QSize sizeHint() const; +- +- int id() const { return myId; } // d->list.at(id())->wid == this +- void setId( int i ) { myId = i; } +- +-protected: +- void paintEvent( QPaintEvent * ); +- void mouseMoveEvent( QMouseEvent * ); +- void mousePressEvent( QMouseEvent * ); +- void mouseReleaseEvent( QMouseEvent * ); +- +-public: // private (: - Orientation orient; -+ Qt::Orientation orient; - bool opaq; - int myId; - +- bool opaq; +- int myId; +- - QSplitter *s; -+ KompareQSplitter *s; - }; - - const uint Default = 2; - +-}; +- +-const uint Default = 2; +- -class QSplitterLayoutStruct : public Qt -+class KompareQSplitterLayoutStruct - { - public: - QCOORD sizer; -@@ -203,11 +215,11 @@ - uint resizeMode : 2; - QWidget *wid; - +-{ +-public: +- QCOORD sizer; +- uint isHandle : 1; +- uint collapsible : 2; +- uint resizeMode : 2; +- QWidget *wid; +- - QSplitterLayoutStruct() -+ KompareQSplitterLayoutStruct() - : sizer( -1 ), collapsible( Default ) { } +- : sizer( -1 ), collapsible( Default ) { } - QCOORD getSizer( Orientation orient ); -+ QCOORD getSizer( Qt::Orientation orient ); - }; - - #endif // QT_NO_SPLITTER - +-}; +- +-#endif // QT_NO_SPLITTER +- -#endif // QSPLITTER_H -+#endif // KOMPAREQSPLITTER_H diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/komparesaveoptionsbase.cpp kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesaveoptionsbase.cpp --- kdesdk-3.96.2-orig/kompare/komparepart/komparesaveoptionsbase.cpp 1970-01-01 01:00:00.000000000 +0100 +++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesaveoptionsbase.cpp 2007-12-04 22:20:07.000000000 +0100 @@ -3191,40 +1877,86 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/komparesaveoptionswidget.cpp kd } diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/komparesplitter.cpp kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesplitter.cpp --- kdesdk-3.96.2-orig/kompare/komparepart/komparesplitter.cpp 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesplitter.cpp 2007-12-05 08:27:33.000000000 +0100 -@@ -20,6 +20,13 @@ ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesplitter.cpp 2007-12-10 12:39:02.000000000 +0100 +@@ -1,12 +1,12 @@ +-/*************************************************************************** +- komparesplitter.cpp - description +- ------------------- +- begin : Wed Jan 14 2004 +- copyright : (C) 2004 by Jeff Snyder +- email : jeff@caffeinated.me.uk +-****************************************************************************/ ++/************************************************************************** ++** komparesplitter.cpp ++** ------------------- ++** begin : Wed Jan 14 2004 ++** copyright : (c) 2004-2005 by Jeff Snyder ++** email : jeff-webcvsspam@caffeinated.me.uk ++***************************************************************************/ + +-/*************************************************************************** ++/************************************************************************** + ** + ** This program is free software; you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by +@@ -15,41 +15,56 @@ + ** + ***************************************************************************/ + ++// associated header + #include "komparesplitter.h" + ++// qt #include #include #include -+//Added by qt3to4: ++#include ++#include ++#include ++#include ++#include ++#include +#include -+#include -+#include ++#include ++#include +#include +#include +#include ++// kde #include #include -@@ -36,20 +43,20 @@ + #include + +-#include "diffmodel.h" +-#include "difference.h" +-#include "viewsettings.h" +-#include "kompare_part.h" ++// kompare + #include "komparelistview.h" ++#include "viewsettings.h" + #include "kompareconnectwidget.h" ++#include "diffmodel.h" ++#include "difference.h" + + using namespace Diff2; - KompareSplitter::KompareSplitter( ViewSettings *settings, QWidget * parent, +-KompareSplitter::KompareSplitter( ViewSettings *settings, QWidget * parent, ++KompareSplitter::KompareSplitter( ViewSettings *settings, QWidget *parent, const char *name) : - QSplitter( Horizontal, parent, name ), -+ KompareQSplitter( Qt::Horizontal, parent, name ), ++ QSplitter( Qt::Horizontal, parent, name ), m_settings( settings ) { -- QFrame *scrollFrame = new QFrame( parent, "scrollFrame" ); -+ Q3Frame *scrollFrame = new Q3Frame( parent, "scrollFrame" ); - reparent( scrollFrame, *(new QPoint()), false ); + QFrame *scrollFrame = new QFrame( parent, "scrollFrame" ); +- reparent( scrollFrame, *(new QPoint()), false ); ++ reparent( scrollFrame, QPoint(), false ); // Set up the scrollFrame -- scrollFrame->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); + scrollFrame->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); - scrollFrame->setLineWidth(scrollFrame->style().pixelMetric(QStyle::PM_DefaultFrameWidth)); -- QGridLayout *pairlayout = new QGridLayout(scrollFrame); -+ scrollFrame->setFrameStyle( Q3Frame::NoFrame | Q3Frame::Plain ); + scrollFrame->setLineWidth(scrollFrame->style()->pixelMetric(QStyle::PM_DefaultFrameWidth)); -+ Q3GridLayout *pairlayout = new Q3GridLayout(scrollFrame); + QGridLayout *pairlayout = new QGridLayout(scrollFrame); pairlayout->setSpacing(0); - m_vScroll = new QScrollBar( QScrollBar::Vertical, scrollFrame ); + m_vScroll = new QScrollBar( Qt::Vertical, scrollFrame ); @@ -3234,19 +1966,17 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/komparesplitter.cpp kdesdk-3.96 pairlayout->addWidget( m_hScroll, 1, 0 ); new KompareListViewFrame(true, m_settings, this, "source"); -@@ -57,15 +64,15 @@ +@@ -57,28 +72,27 @@ pairlayout->addWidget( this, 0, 0 ); // set up our looks - setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - setLineWidth( style().pixelMetric( QStyle::PM_DefaultFrameWidth ) ); -+ setFrameStyle( Q3Frame::StyledPanel | Q3Frame::Sunken ); + setLineWidth( style()->pixelMetric( QStyle::PM_DefaultFrameWidth ) ); setHandleWidth(50); setChildrenCollapsible( false ); -- setFrameStyle( QFrame::NoFrame ); -+ setFrameStyle( Q3Frame::NoFrame ); + setFrameStyle( QFrame::NoFrame ); setSizePolicy( QSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored )); setOpaqueResize( true ); - setFocusPolicy( QWidget::WheelFocus ); @@ -3254,485 +1984,930 @@ diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/komparesplitter.cpp kdesdk-3.96 connect( this, SIGNAL(configChanged()), SLOT(slotConfigChanged()) ); connect( this, SIGNAL(configChanged()), SLOT(slotDelayedRepaintHandles()) ); -@@ -100,17 +107,17 @@ - \a prepend is TRUE, then recalcId() is very probably needed.) - */ + connect( this, SIGNAL(configChanged()), SLOT(slotDelayedUpdateScrollBars()) ); + + // scrolling +- connect( m_vScroll, SIGNAL(valueChanged(int)), SLOT(scrollToId(int)) ); +- connect( m_vScroll, SIGNAL(sliderMoved(int)), SLOT(scrollToId(int)) ); ++ connect( m_vScroll, SIGNAL(valueChanged(int)), SLOT(slotScrollToId(int)) ); ++ connect( m_vScroll, SIGNAL(sliderMoved(int)), SLOT(slotScrollToId(int)) ); + connect( m_hScroll, SIGNAL(valueChanged(int)), SIGNAL(setXOffset(int)) ); + connect( m_hScroll, SIGNAL(sliderMoved(int)), SIGNAL(setXOffset(int)) ); + + m_scrollTimer=new QTimer(); +- restartTimer = false; ++ m_restartTimer = false; + connect (m_scrollTimer, SIGNAL(timeout()), SLOT(timerTimeout()) ); + + // we need to receive childEvents now so that d->list is ready for when +@@ -89,414 +103,57 @@ + slotUpdateScrollBars(); + } +-KompareSplitter::~KompareSplitter(){} +- +-/* +- Inserts the widget \a w at the end (or at the beginning if \a +- prepend is TRUE) of the splitter's list of widgets. +- +- It is the responsibility of the caller to make sure that \a w is +- not already in the splitter and to call recalcId() if needed. (If +- \a prepend is TRUE, then recalcId() is very probably needed.) +-*/ +- -QSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, bool prepend ) -+KompareQSplitterLayoutStruct *KompareSplitter::addWidget( KompareListViewFrame *w, bool prepend ) - { - /* This function is *not* a good place to make connections to and from - * the KompareListView. Make them in the KompareListViewFrame constructor - * instad - that way the connections get made upon creation, not upon the - * next processing of the event queue. */ - +-{ +- /* This function is *not* a good place to make connections to and from +- * the KompareListView. Make them in the KompareListViewFrame constructor +- * instad - that way the connections get made upon creation, not upon the +- * next processing of the event queue. */ +- - QSplitterLayoutStruct *s; -+ KompareQSplitterLayoutStruct *s; - KompareConnectWidgetFrame *newHandle = 0; - if ( d->list.count() > 0 ) { +- KompareConnectWidgetFrame *newHandle = 0; +- if ( d->list.count() > 0 ) { - s = new QSplitterLayoutStruct; -+ s = new KompareQSplitterLayoutStruct; - s->resizeMode = KeepSize; - QString tmp = "qt_splithandle_"; - tmp += w->name(); -@@ -128,7 +135,7 @@ - else - d->list.append( s ); - } +- s->resizeMode = KeepSize; +- QString tmp = "qt_splithandle_"; +- tmp += w->name(); +- KompareListView *lw = +- ((KompareListViewFrame*)(prepend?w:d->list.last()->wid))->view(); +- KompareListView *rw = +- ((KompareListViewFrame*)(prepend?d->list.first()->wid:w))->view(); +- newHandle = new KompareConnectWidgetFrame(lw, rw, m_settings, this, tmp.latin1()); +- s->wid = newHandle; +- newHandle->setId( d->list.count() ); +- s->isHandle = TRUE; +- s->sizer = pick( newHandle->sizeHint() ); +- if ( prepend ) +- d->list.prepend( s ); +- else +- d->list.append( s ); +- } - s = new QSplitterLayoutStruct; -+ s = new KompareQSplitterLayoutStruct; - s->resizeMode = DefaultResizeMode; - s->wid = w; - s->isHandle = FALSE; -@@ -151,10 +158,10 @@ - if ( !c->child()->isWidgetType() ) - return; - +- s->resizeMode = DefaultResizeMode; +- s->wid = w; +- s->isHandle = FALSE; +- if ( prepend ) d->list.prepend( s ); +- else d->list.append( s ); +- if ( newHandle && isVisible() ) +- newHandle->show(); // will trigger sending of post events +- return s; +-} +- +- +-/*! +- Tells the splitter that the child widget described by \a c has +- been inserted or removed. +-*/ +- +-void KompareSplitter::childEvent( QChildEvent *c ) +-{ +- if ( c->type() == QEvent::ChildInserted ) { +- if ( !c->child()->isWidgetType() ) +- return; +- - if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) -+ if ( ((QWidget*)c->child())->windowFlags() & Qt::WType_TopLevel ) - return; - +- return; +- - QSplitterLayoutStruct *s = d->list.first(); -+ KompareQSplitterLayoutStruct *s = d->list.first(); - while ( s ) { - if ( s->wid == c->child() ) - return; -@@ -163,10 +170,10 @@ - addWidget( (KompareListViewFrame*)c->child() ); - recalc( isVisible() ); - } else if ( c->type() == QEvent::ChildRemoved ) { +- while ( s ) { +- if ( s->wid == c->child() ) +- return; +- s = d->list.next(); +- } +- addWidget( (KompareListViewFrame*)c->child() ); +- recalc( isVisible() ); +- } else if ( c->type() == QEvent::ChildRemoved ) { - QSplitterLayoutStruct *prev = 0; -+ KompareQSplitterLayoutStruct *prev = 0; - if ( d->list.count() > 1 ) - prev = d->list.at( 1 ); // yes, this is correct +- if ( d->list.count() > 1 ) +- prev = d->list.at( 1 ); // yes, this is correct - QSplitterLayoutStruct *curr = d->list.first(); -+ KompareQSplitterLayoutStruct *curr = d->list.first(); - while ( curr ) { - if ( curr->wid == c->child() ) { - d->list.removeRef( curr ); -@@ -186,7 +193,7 @@ - } - - // This is from a private qt header (kernel/qlayoutengine_p.h). sorry. +- while ( curr ) { +- if ( curr->wid == c->child() ) { +- d->list.removeRef( curr ); +- if ( prev && prev->isHandle ) { +- QWidget *w = prev->wid; +- d->list.removeRef( prev ); +- delete w; // will call childEvent() +- } +- recalcId(); +- doResize(); +- return; +- } +- prev = curr; +- curr = d->list.next(); +- } +- } +-} +- +-// This is from a private qt header (kernel/qlayoutengine_p.h). sorry. -QSize qSmartMinSize( QWidget *w ); -+QSize qSmartMinSize( const QWidget *w ); - - static QPoint toggle( QWidget *w, QPoint pos ) +- +-static QPoint toggle( QWidget *w, QPoint pos ) ++KompareSplitter::~KompareSplitter() { -@@ -219,7 +226,7 @@ +- QSize minS = qSmartMinSize( w ); +- return -pos - QPoint( minS.width(), minS.height() ); + } - void KompareSplitter::moveSplitter( QCOORD p, int id ) - { +-static bool isCollapsed( QWidget *w ) +-{ +- return w->x() < 0 || w->y() < 0; +-} +- +-static QPoint topLeft( QWidget *w ) +-{ +- if ( isCollapsed(w) ) { +- return toggle( w, w->pos() ); +- } else { +- return w->pos(); +- } +-} +- +-static QPoint bottomRight( QWidget *w ) +-{ +- if ( isCollapsed(w) ) { +- return toggle( w, w->pos() ) - QPoint( 1, 1 ); +- } else { +- return w->geometry().bottomRight(); +- } +-} +- +-void KompareSplitter::moveSplitter( QCOORD p, int id ) +-{ - QSplitterLayoutStruct *s = d->list.at( id ); -+ KompareQSplitterLayoutStruct *s = d->list.at( id ); - int farMin; - int min; - int max; -@@ -230,7 +237,7 @@ - int* ws = new int[d->list.count()]; - QWidget *w = 0; - bool upLeft; +- int farMin; +- int min; +- int max; +- int farMax; +- p = adjustPos( p, id, &farMin, &min, &max, &farMax ); +- int oldP = pick( s->wid->pos() ); +- int* poss = new int[d->list.count()]; +- int* ws = new int[d->list.count()]; +- QWidget *w = 0; +- bool upLeft; - if ( QApplication::reverseLayout() && orient == Horizontal ) { -+ if ( QApplication::reverseLayout() && orient == Qt::Horizontal ) { - int q = p + s->wid->width(); - doMove( FALSE, q, id - 1, -1, (p > max), poss, ws ); - doMove( TRUE, q, id, -1, (p < min), poss, ws ); -@@ -260,7 +267,7 @@ - void KompareSplitter::doMove( bool backwards, int pos, int id, int delta, - bool mayCollapse, int* positions, int* widths ) - { +- int q = p + s->wid->width(); +- doMove( FALSE, q, id - 1, -1, (p > max), poss, ws ); +- doMove( TRUE, q, id, -1, (p < min), poss, ws ); +- upLeft = (q > oldP); +- } else { +- doMove( FALSE, p, id, +1, (p > max), poss, ws ); +- doMove( TRUE, p, id - 1, +1, (p < min), poss, ws ); +- upLeft = (p < oldP); +- } +- if ( upLeft ) { +- int count = d->list.count(); +- for ( int id = 0; id < count; ++id ) { +- w = d->list.at( id )->wid; +- if( !w->isHidden() ) +- setGeo( w, poss[id], ws[id], TRUE ); +- } +- } else { +- for ( int id = d->list.count() - 1; id >= 0; --id ) { +- w = d->list.at( id )->wid; +- if( !w->isHidden() ) +- setGeo( w, poss[id], ws[id], TRUE ); +- } +- } +- storeSizes(); +-} +- +-void KompareSplitter::doMove( bool backwards, int pos, int id, int delta, +- bool mayCollapse, int* positions, int* widths ) +-{ - QSplitterLayoutStruct *s; -+ KompareQSplitterLayoutStruct *s; - QWidget *w; - for ( ; id >= 0 && id < (int)d->list.count(); - id = backwards ? id - delta : id + delta ) { -@@ -295,7 +302,7 @@ - - void KompareSplitter::slotSetSelection( const DiffModel* model, const Difference* diff ) +- QWidget *w; +- for ( ; id >= 0 && id < (int)d->list.count(); +- id = backwards ? id - delta : id + delta ) { +- s = d->list.at( id ); +- w = s->wid; +- if ( w->isHidden() ) { +- mayCollapse = TRUE; +- } else { +- if ( s->isHandle ) { +- int dd = s->getSizer( orient ); +- int nextPos = backwards ? pos - dd : pos + dd; +- positions[id] = pos; +- widths[id] = dd; +- pos = nextPos; +- } else { +- int dd = backwards ? pos - pick( topLeft(w) ) +- : pick( bottomRight(w) ) - pos + 1; +- if ( dd > 0 || (!isCollapsed(w) && !mayCollapse) ) { +- dd = qMax( pick(qSmartMinSize(w)), +- qMin(dd, pick(w->maximumSize())) ); +- } else { +- dd = 0; +- } +- positions[id] = backwards ? pos - dd : pos; +- widths[id] = dd; +- pos = backwards ? pos - dd : pos + dd; +- mayCollapse = TRUE; +- } +- } +- } +-} +- +-void KompareSplitter::slotSetSelection( const DiffModel* model, const Difference* diff ) ++QSplitterHandle* KompareSplitter::createHandle() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - { - if ( curr->isHandle ) -@@ -315,7 +322,7 @@ - - void KompareSplitter::slotSetSelection( const Difference* diff ) - { +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if ( curr->isHandle ) +- ((KompareConnectWidgetFrame*) +- curr->wid)->wid()->slotSetSelection( model, diff ); +- else +- { +- ((KompareListViewFrame*) +- curr->wid)->view()->slotSetSelection( model, diff ); +- ((KompareListViewFrame*) +- curr->wid)->slotSetModel( model ); +- } +- } +- slotDelayedRepaintHandles(); +- slotDelayedUpdateScrollBars(); +-} +- +-void KompareSplitter::slotSetSelection( const Difference* diff ) +-{ - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( curr->isHandle ) - ((KompareConnectWidgetFrame*) -@@ -329,7 +336,7 @@ - - void KompareSplitter::slotApplyDifference( bool apply ) - { +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( curr->isHandle ) +- ((KompareConnectWidgetFrame*) +- curr->wid)->wid()->slotSetSelection( diff ); +- else +- ((KompareListViewFrame*) +- curr->wid)->view()->slotSetSelection( diff ); +- slotDelayedRepaintHandles(); +- slotDelayedUpdateScrollBars(); +-} +- +-void KompareSplitter::slotApplyDifference( bool apply ) +-{ - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( !curr->isHandle ) - ((KompareListViewFrame*) -@@ -339,7 +346,7 @@ - - void KompareSplitter::slotApplyAllDifferences( bool apply ) - { +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( !curr->isHandle ) +- ((KompareListViewFrame*) +- curr->wid)->view()->slotApplyDifference( apply ); +- slotDelayedRepaintHandles(); +-} +- +-void KompareSplitter::slotApplyAllDifferences( bool apply ) +-{ - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( !curr->isHandle ) - ((KompareListViewFrame*) -@@ -350,7 +357,7 @@ - - void KompareSplitter::slotApplyDifference( const Difference* diff, bool apply ) - { +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( !curr->isHandle ) +- ((KompareListViewFrame*) +- curr->wid)->view()->slotApplyAllDifferences( apply ); +- slotDelayedRepaintHandles(); +- scrollToId( scrollTo ); // FIXME! +-} +- +-void KompareSplitter::slotApplyDifference( const Difference* diff, bool apply ) +-{ - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( !curr->isHandle ) - ((KompareListViewFrame*) -@@ -360,7 +367,7 @@ - - void KompareSplitter::slotDifferenceClicked( const Difference* diff ) - { +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( !curr->isHandle ) +- ((KompareListViewFrame*) +- curr->wid)->view()->slotApplyDifference( diff, apply ); +- slotDelayedRepaintHandles(); +-} +- +-void KompareSplitter::slotDifferenceClicked( const Difference* diff ) +-{ - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( !curr->isHandle ) - ((KompareListViewFrame*) -@@ -370,7 +377,7 @@ - - void KompareSplitter::slotConfigChanged() - { +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( !curr->isHandle ) +- ((KompareListViewFrame*) +- curr->wid)->view()->setSelectedDifference( diff, false ); +- emit selectionChanged( diff ); +-} +- +-void KompareSplitter::slotConfigChanged() +-{ - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) { - if ( !curr->isHandle ) - { -@@ -386,7 +393,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) { +- if ( !curr->isHandle ) +- { +- ((KompareListViewFrame*) +- curr->wid)->view()->setSpaces( m_settings->m_tabToNumberOfSpaces ); +- ((KompareListViewFrame*) +- curr->wid)->view()->setFont( m_settings->m_font ); +- ((KompareListViewFrame*) +- curr->wid)->view()->update(); +- } +- } ++ return new KompareConnectWidgetFrame(m_settings, this); + } void KompareSplitter::slotDelayedRepaintHandles() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( curr->isHandle ) - ((KompareConnectWidgetFrame*)curr->wid)->wid()->slotDelayedRepaint(); -@@ -394,7 +401,7 @@ - - void KompareSplitter::repaintHandles() - { +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( curr->isHandle ) +- ((KompareConnectWidgetFrame*)curr->wid)->wid()->slotDelayedRepaint(); +-} +- +-void KompareSplitter::repaintHandles() +-{ - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( curr->isHandle ) - ((KompareConnectWidgetFrame*)curr->wid)->wid()->repaint(); -@@ -443,26 +450,26 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( curr->isHandle ) +- ((KompareConnectWidgetFrame*)curr->wid)->wid()->repaint(); +-} +- +-// Scrolling stuff +-/* +- * limit updating to once every 50 msec with a qtimer +- * FIXME: i'm a nasty hack +- */ +- +-void KompareSplitter::wheelEvent( QWheelEvent* e ) +-{ +- // scroll lines... +- if ( e->orientation() == Qt::Vertical ) +- { +- if ( e->state() & Qt::ControlModifier ) +- if ( e->delta() < 0 ) // scroll down one page +- m_vScroll->addPage(); +- else // scroll up one page +- m_vScroll->subtractPage(); +- else +- if ( e->delta() < 0 ) // scroll down +- m_vScroll->addLine(); +- else // scroll up +- m_vScroll->subtractLine(); +- } +- else +- { +- if ( e->state() & Qt::ControlModifier ) +- if ( e->delta() < 0 ) // scroll right one page +- m_hScroll->addPage(); +- else // scroll left one page +- m_hScroll->subtractPage(); +- else +- if ( e->delta() < 0 ) // scroll to the right +- m_hScroll->addLine(); +- else // scroll to the left +- m_hScroll->subtractLine(); +- } +- e->accept(); +- repaintHandles(); ++ QTimer::singleShot(0, this, SLOT(slotRepaintHandles())); + } + +-void KompareSplitter::keyPressEvent( QKeyEvent* e ) ++void KompareSplitter::slotRepaintHandles() { - //keyboard scrolling - switch ( e->key() ) { +- //keyboard scrolling +- switch ( e->key() ) { - case Key_Right: - case Key_L: -+ case Qt::Key_Right: -+ case Qt::Key_L: - m_hScroll->addLine(); - break; +- m_hScroll->addLine(); +- break; - case Key_Left: - case Key_H: -+ case Qt::Key_Left: -+ case Qt::Key_H: - m_hScroll->subtractLine(); - break; +- m_hScroll->subtractLine(); +- break; - case Key_Up: - case Key_K: -+ case Qt::Key_Up: -+ case Qt::Key_K: - m_vScroll->subtractLine(); - break; +- m_vScroll->subtractLine(); +- break; - case Key_Down: - case Key_J: +- m_vScroll->addLine(); +- break; +- case Key_PageDown: +- m_vScroll->addPage(); +- break; +- case Key_PageUp: +- m_vScroll->subtractPage(); +- break; +- } +- e->accept(); +- repaintHandles(); ++ const int end = count(); ++ for ( int i = 1; i < end; ++i ) ++ handle(i)->update(); + } + + void KompareSplitter::timerTimeout() + { +- if ( restartTimer ) +- restartTimer = false; ++ if ( m_restartTimer ) ++ m_restartTimer = false; + else + m_scrollTimer->stop(); + +- slotDelayedRepaintHandles(); ++ slotDelayedRepaintHandles(); + +- emit scrollViewsToId( scrollTo ); ++ emit scrollViewsToId( m_scrollTo ); ++ slotRepaintHandles(); ++ m_vScroll->setValue( m_scrollTo ); + } + +-void KompareSplitter::scrollToId( int id ) ++void KompareSplitter::slotScrollToId( int id ) + { +- scrollTo = id; ++ m_scrollTo = id; + +- if( restartTimer ) ++ if( m_restartTimer ) + return; + + if( m_scrollTimer->isActive() ) + { +- restartTimer = true; ++ m_restartTimer = true; + } + else + { + emit scrollViewsToId( id ); +- slotDelayedRepaintHandles(); ++ slotRepaintHandles(); ++ m_vScroll->setValue( id ); + m_scrollTimer->start(30, false); + } + } +@@ -552,55 +209,106 @@ + m_vScroll->setValue( scrollId() ); + } + +-/* FIXME: this should return the scrollId() from the listview containing the ++void KompareSplitter::keyPressEvent( QKeyEvent* e ) ++{ ++ //keyboard scrolling ++ switch ( e->key() ) { ++ case Qt::Key_Right: ++ case Qt::Key_L: ++ m_hScroll->addLine(); ++ break; ++ case Qt::Key_Left: ++ case Qt::Key_H: ++ m_hScroll->subtractLine(); ++ break; ++ case Qt::Key_Up: ++ case Qt::Key_K: ++ m_vScroll->subtractLine(); ++ break; + case Qt::Key_Down: + case Qt::Key_J: - m_vScroll->addLine(); - break; -- case Key_PageDown: ++ m_vScroll->addLine(); ++ break; + case Qt::Key_PageDown: - m_vScroll->addPage(); - break; -- case Key_PageUp: ++ m_vScroll->addPage(); ++ break; + case Qt::Key_PageUp: - m_vScroll->subtractPage(); - break; - } -@@ -558,7 +565,7 @@ ++ m_vScroll->subtractPage(); ++ break; ++ } ++ e->accept(); ++ slotRepaintHandles(); ++} ++ ++void KompareSplitter::slotScroll( QWheelEvent* e ) ++{ ++ if ( e->orientation() == Qt::Vertical ) ++ { ++ if ( e->state() & Qt::ControlButton ) { ++ if ( e->delta() < 0 ) // scroll down one page ++ m_vScroll->addPage(); ++ else // scroll up one page ++ m_vScroll->subtractPage(); ++ } else { ++ if ( e->delta() < 0 ) // scroll down ++ m_vScroll->addLine(); ++ else // scroll up ++ m_vScroll->subtractLine(); ++ } ++ } ++ else ++ { ++ if ( e->state() & Qt::ControlButton ) { ++ if ( e->delta() < 0 ) // scroll right one page ++ m_hScroll->addPage(); ++ else // scroll left one page ++ m_hScroll->subtractPage(); ++ } else { ++ if ( e->delta() < 0 ) // scroll to the right ++ m_hScroll->addLine(); ++ else // scroll to the left ++ m_hScroll->subtractLine(); ++ } ++ } ++ e->accept(); ++ slotDelayedRepaintHandles(); ++} ++ ++/* FIXME: this should return/the scrollId() from the listview containing the + * /base/ of the diff. but there's bigger issues with that atm. + */ int KompareSplitter::scrollId() { - QSplitterLayoutStruct *curr = d->list.first(); -+ KompareQSplitterLayoutStruct *curr = d->list.first(); - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( !curr->isHandle ) - return ((KompareListViewFrame*) curr->wid)->view()->scrollId(); -@@ -567,7 +574,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( !curr->isHandle ) +- return ((KompareListViewFrame*) curr->wid)->view()->scrollId(); ++ if(widget(0)) ++ return listView(0)->scrollId(); + return minVScrollId(); + } int KompareSplitter::lineSpacing() { - QSplitterLayoutStruct *curr = d->list.first(); -+ KompareQSplitterLayoutStruct *curr = d->list.first(); - for ( curr = d->list.first(); curr; curr = d->list.next() ) - if ( !curr->isHandle ) - return ((KompareListViewFrame*) -@@ -577,7 +584,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- if ( !curr->isHandle ) +- return ((KompareListViewFrame*) +- curr->wid)->view()->fontMetrics().lineSpacing(); ++ if(widget(0)) ++ return listView(0)->fontMetrics().lineSpacing(); + return 1; + } int KompareSplitter::pageSize() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - { - if ( !curr->isHandle ) -@@ -591,7 +598,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if ( !curr->isHandle ) +- { +- KompareListView *view = ((KompareListViewFrame*) curr->wid)->view(); +- return view->visibleHeight() - QStyle::PM_ScrollBarExtent; +- } ++ if(widget(0)) { ++ KompareListView *view = listView(0); ++ return view->visibleHeight() - QStyle::PM_ScrollBarExtent; + } + return 1; + } bool KompareSplitter::needVScrollBar() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; int pagesize = pageSize(); - for ( curr = d->list.first(); curr; curr = d->list.next() ) - { -@@ -608,7 +615,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if( !curr->isHandle ) +- { +- KompareListView *view = ((KompareListViewFrame*) curr->wid)->view(); +- if( view ->contentsHeight() > pagesize) +- return true; +- } ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ KompareListView *view = listView(i); ++ if( view ->contentsHeight() > pagesize) ++ return true; + } + return false; + } +@@ -608,83 +316,64 @@ int KompareSplitter::minVScrollId() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; int min = -1; int mSId; - for ( curr = d->list.first(); curr; curr = d->list.next() ) -@@ -624,7 +631,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if(!curr->isHandle) { +- KompareListView* view = ((KompareListViewFrame*)curr->wid)->view(); +- mSId = view->minScrollId(); +- if (mSId < min || min == -1) min = mSId; +- } ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ mSId = listView(i)->minScrollId(); ++ if (mSId < min || min == -1) ++ min = mSId; + } + return ( min == -1 ) ? 0 : min; + } int KompareSplitter::maxVScrollId() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; int max = 0; int mSId; - for ( curr = d->list.first(); curr; curr = d->list.next() ) -@@ -641,7 +648,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if ( !curr->isHandle ) +- { +- mSId = ((KompareListViewFrame*)curr->wid)->view()->maxScrollId(); +- if ( mSId > max ) +- max = mSId; +- } ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ mSId = listView(i)->maxScrollId(); ++ if ( mSId > max ) ++ max = mSId; + } + return max; + } bool KompareSplitter::needHScrollBar() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; - for ( curr = d->list.first(); curr; curr = d->list.next() ) - { - if( !curr->isHandle ) -@@ -656,7 +663,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if( !curr->isHandle ) +- { +- KompareListView *view = ((KompareListViewFrame*) curr->wid)->view(); +- if ( view->contentsWidth() > view->visibleWidth() ) +- return true; +- } ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ KompareListView *view = listView(i); ++ if ( view->contentsWidth() > view->visibleWidth() ) ++ return true; + } + return false; + } int KompareSplitter::maxHScrollId() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; int max = 0; int mHSId; - for ( curr = d->list.first(); curr; curr = d->list.next() ) -@@ -674,7 +681,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if( !curr->isHandle ) +- { +- KompareListView *view = ((KompareListViewFrame*) curr->wid)->view(); +- mHSId = view->contentsWidth() - view->visibleWidth(); +- if ( mHSId > max ) +- max = mHSId; +- } ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ KompareListView *view = listView(i); ++ mHSId = view->contentsWidth() - view->visibleWidth(); ++ if ( mHSId > max ) ++ max = mHSId; + } + return max; + } int KompareSplitter::maxContentsX() { - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; int max = 0; int mCX; - for ( curr = d->list.first(); curr; curr = d->list.next() ) -@@ -696,7 +703,7 @@ +- for ( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if ( !curr->isHandle ) +- { +- mCX = ((KompareListViewFrame*) curr->wid)->view()->contentsX(); +- if ( mCX > max ) +- max = mCX; +- } ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ mCX = listView(i)->contentsX(); ++ if ( mCX > max ) ++ max = mCX; + } + return max; + } +@@ -696,18 +385,93 @@ // despite the fact that *noone* has a pgright and pgleft key :P // But we do have mousewheels with horizontal scrolling functionality, // pressing shift and scrolling then goes left and right one page at the time - QSplitterLayoutStruct *curr; -+ KompareQSplitterLayoutStruct *curr; int min = -1; int vW; - for( curr = d->list.first(); curr; curr = d->list.next() ) +- for( curr = d->list.first(); curr; curr = d->list.next() ) +- { +- if ( !curr->isHandle ) { +- vW = ((KompareListViewFrame*)curr->wid)->view()->visibleWidth(); +- if ( vW < min || min == -1 ) +- min = vW; +- } ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ vW = listView(i)->visibleWidth(); ++ if ( vW < min || min == -1 ) ++ min = vW; + } + return ( min == -1 ) ? 0 : min; + } + ++KompareListView* KompareSplitter::listView( int index ) ++{ ++ return static_cast(widget(index))->view(); ++} ++ ++KompareConnectWidget* KompareSplitter::connectWidget( int index ) ++{ ++ return static_cast(handle(index))->wid(); ++} ++ ++void KompareSplitter::slotSetSelection( const DiffModel* model, const Difference* diff ) ++{ ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ connectWidget(i)->slotSetSelection( model, diff ); ++ listView(i)->slotSetSelection( model, diff ); ++ static_cast(widget(i))->slotSetModel( model ); ++ } ++ ++ slotDelayedRepaintHandles(); ++ slotDelayedUpdateScrollBars(); ++} ++ ++void KompareSplitter::slotSetSelection( const Difference* diff ) ++{ ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ connectWidget(i)->slotSetSelection( diff ); ++ listView(i)->slotSetSelection( diff ); ++ } ++ ++ slotDelayedRepaintHandles(); ++ slotDelayedUpdateScrollBars(); ++} ++ ++void KompareSplitter::slotApplyDifference( bool apply ) ++{ ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) ++ listView(i)->slotApplyDifference( apply ); ++ slotDelayedRepaintHandles(); ++} ++ ++void KompareSplitter::slotApplyAllDifferences( bool apply ) ++{ ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) ++ listView(i)->slotApplyAllDifferences( apply ); ++ slotDelayedRepaintHandles(); ++ slotScrollToId( m_scrollTo ); // FIXME! ++} ++ ++void KompareSplitter::slotApplyDifference( const Difference* diff, bool apply ) ++{ ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) ++ listView(i)->slotApplyDifference( diff, apply ); ++ slotDelayedRepaintHandles(); ++} ++ ++void KompareSplitter::slotDifferenceClicked( const Difference* diff ) ++{ ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) ++ listView(i)->setSelectedDifference( diff, false ); ++ emit selectionChanged( diff ); ++} ++ ++void KompareSplitter::slotConfigChanged() ++{ ++ const int end = count(); ++ for ( int i = 0; i < end; ++i ) { ++ KompareListView *view = listView(i); ++ view->setSpaces( m_settings->m_tabToNumberOfSpaces ); ++ view->setFont( m_settings->m_font ); ++ view->update(); ++ } ++} + #include "komparesplitter.moc" diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/komparesplitter.h kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesplitter.h --- kdesdk-3.96.2-orig/kompare/komparepart/komparesplitter.h 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesplitter.h 2007-12-05 00:14:37.000000000 +0100 -@@ -21,13 +21,17 @@ - #include "kompare_qsplitter.h" ++++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/komparesplitter.h 2007-12-10 11:58:39.000000000 +0100 +@@ -18,16 +18,15 @@ + #ifndef _KOMPARESPLITTER_H_ + #define _KOMPARESPLITTER_H_ - #include -+//Added by qt3to4: -+#include -+#include -+#include +-#include "kompare_qsplitter.h" ++#include - #include "komparelistview.h" +-#include +- +-#include "komparelistview.h" #include "komparemodellist.h" -class QSplitterLayoutStruct; -class QTextStream; --class QSplitterHandle; -+class KompareQSplitterLayoutStruct; -+class Q3TextStream; -+class KompareQSplitterHandle; + class QSplitterHandle; ++class QTimer; ++class QScrollBar; ++class QWheelEvent; ++class QKeyEvent; namespace Diff2 { class DiffModel; -@@ -35,7 +39,7 @@ +@@ -35,28 +34,38 @@ } class ViewSettings; --class KompareSplitter : public QSplitter -+class KompareSplitter : public KompareQSplitter ++class KompareListView; ++class KompareConnectWidget; ++ + class KompareSplitter : public QSplitter { Q_OBJECT -@@ -82,7 +86,7 @@ - void timerTimeout(); + public: +- KompareSplitter(ViewSettings *settings, QWidget *parent=0, const char *name = 0); ++ KompareSplitter(ViewSettings *settings, QWidget *parent, const char *name = 0); + ~KompareSplitter(); - private: -- QSplitterLayoutStruct *addWidget(KompareListViewFrame *w, -+ KompareQSplitterLayoutStruct *addWidget(KompareListViewFrame *w, - bool prepend = FALSE ); - - void doMove( bool backwards, int pos, int id, int delta, -diff -Nur kdesdk-3.96.2-orig/kompare/komparepart/qlayoutengine_p.h kdesdk-3.96.2-fix-kompare/kompare/komparepart/qlayoutengine_p.h ---- kdesdk-3.96.2-orig/kompare/komparepart/qlayoutengine_p.h 1970-01-01 01:00:00.000000000 +0100 -+++ kdesdk-3.96.2-fix-kompare/kompare/komparepart/qlayoutengine_p.h 2007-12-05 00:00:39.000000000 +0100 -@@ -0,0 +1,133 @@ -+/**************************************************************************** -+** -+** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. -+** -+** This file is part of the QtGui module of the Qt Toolkit. -+** -+** This file may be used under the terms of the GNU General Public -+** License version 2.0 as published by the Free Software Foundation -+** and appearing in the file LICENSE.GPL included in the packaging of -+** this file. Please review the following information to ensure GNU -+** General Public Licensing requirements will be met: -+** http://trolltech.com/products/qt/licenses/licensing/opensource/ -+** -+** If you are unsure which license is appropriate for your use, please -+** review the following information: -+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -+** or contact the sales department at sales@trolltech.com. -+** -+** In addition, as a special exception, Trolltech gives you certain -+** additional rights. These rights are described in the Trolltech GPL -+** Exception version 1.0, which can be found at -+** http://www.trolltech.com/products/qt/gplexception/ and in the file -+** GPL_EXCEPTION.txt in this package. -+** -+** In addition, as a special exception, Trolltech, as the sole copyright -+** holder for Qt Designer, grants users of the Qt/Eclipse Integration -+** plug-in the right for the Qt/Eclipse Integration to link to -+** functionality provided by Qt Designer and its related libraries. -+** -+** Trolltech reserves all rights not expressly granted herein. -+** -+** Trolltech ASA (c) 2007 -+** -+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+** -+****************************************************************************/ -+ -+#ifndef QLAYOUTENGINE_P_H -+#define QLAYOUTENGINE_P_H -+ -+// -+// W A R N I N G -+// ------------- -+// -+// This file is not part of the Qt API. It exists purely as an -+// implementation detail. This header file may change from version to -+// version without notice, or even be removed. -+// -+// We mean it. -+// -+ -+#include "QtGui/qlayoutitem.h" -+#include "QtGui/qstyle.h" -+ -+template class QVector; -+ -+struct QLayoutStruct -+{ -+ inline void init(int stretchFactor = 0, int minSize = 0) { -+ stretch = stretchFactor; -+ minimumSize = sizeHint = minSize; -+ maximumSize = QLAYOUTSIZE_MAX; -+ expansive = false; -+ empty = true; -+ spacing = 0; -+ } -+ -+ int smartSizeHint() { -+ return (stretch > 0) ? minimumSize : sizeHint; -+ } -+ int effectiveSpacer(int uniformSpacer) const { -+ Q_ASSERT(uniformSpacer >= 0 || spacing >= 0); -+ return (uniformSpacer >= 0) ? uniformSpacer : spacing; -+ } -+ -+ // parameters -+ int stretch; -+ int sizeHint; -+ int maximumSize; -+ int minimumSize; -+ bool expansive; -+ bool empty; -+ int spacing; -+ -+ // temporary storage -+ bool done; -+ -+ // result -+ int pos; -+ int size; -+}; -+ -+ -+Q_GUI_EXPORT void qGeomCalc(QVector &chain, int start, int count, -+ int pos, int space, int spacer = -1); -+Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, -+ const QSize &minSize, const QSize &maxSize, -+ const QSizePolicy &sizePolicy); -+Q_GUI_EXPORT QSize qSmartMinSize(const QWidgetItem *i); -+Q_GUI_EXPORT QSize qSmartMinSize(const QWidget *w); -+Q_GUI_EXPORT QSize qSmartMaxSize(const QSize &sizeHint, -+ const QSize &minSize, const QSize &maxSize, -+ const QSizePolicy &sizePolicy, Qt::Alignment align = 0); -+Q_GUI_EXPORT QSize qSmartMaxSize(const QWidgetItem *i, Qt::Alignment align = 0); -+Q_GUI_EXPORT QSize qSmartMaxSize(const QWidget *w, Qt::Alignment align = 0); -+ -+int qSmartSpacing(const QLayout *layout, QStyle::PixelMetric pm); + signals: +- void selectionChanged( const Diff2::Difference* diff ); +- + void configChanged(); + + void scrollViewsToId( int id ); + void setXOffset( int x ); + ++ void selectionChanged( const Diff2::Difference* diff ); + -+/* -+ Modify total maximum (max), total expansion (exp), and total empty -+ when adding boxmax/boxexp. + public slots: ++ void slotScrollToId( int id ); ++ void slotDelayedUpdateScrollBars(); ++ void slotUpdateScrollBars(); ++ void slotDelayedUpdateVScrollValue(); ++ void slotUpdateVScrollValue(); ++ void slotScroll( QWheelEvent* e ); ++ void keyPressEvent( QKeyEvent* e ); + -+ Expansive boxes win over non-expansive boxes. -+ Non-empty boxes win over empty boxes. -+*/ -+static inline void qMaxExpCalc(int & max, bool &exp, bool &empty, -+ int boxmax, bool boxexp, bool boxempty) -+{ -+ if (exp) { -+ if (boxexp) -+ max = qMax(max, boxmax); -+ } else { -+ if (boxexp || empty && (!boxempty || max == 0)) -+ max = boxmax; -+ else if (empty == boxempty) -+ max = qMin(max, boxmax); -+ } -+ exp = exp || boxexp; -+ empty = empty && boxempty; -+} + void slotApplyDifference( bool apply ); + void slotApplyAllDifferences( bool apply ); + void slotApplyDifference( const Diff2::Difference* diff, bool apply ); + +- // to update the list views + void slotSetSelection( const Diff2::DiffModel* model, const Diff2::Difference* diff ); + void slotSetSelection( const Diff2::Difference* diff ); + +@@ -64,35 +73,28 @@ + + void slotConfigChanged(); + +- void scrollToId( int id ); +- void slotDelayedUpdateScrollBars(); +- void slotUpdateScrollBars(); +- void slotDelayedUpdateVScrollValue(); +- void slotUpdateVScrollValue(); +- + protected: +- void childEvent( QChildEvent * ); +- void wheelEvent( QWheelEvent* e ); +- void keyPressEvent( QKeyEvent* e ); +- + void moveSplitter( QCOORD pos, int id ); + +-private slots: ++ ViewSettings* settings() const { return m_settings; } + -+#endif // QLAYOUTENGINE_P_H ++protected slots: + void slotDelayedRepaintHandles(); ++ void slotRepaintHandles(); + void timerTimeout(); + + private: +- QSplitterLayoutStruct *addWidget(KompareListViewFrame *w, +- bool prepend = FALSE ); ++ // override from QSplitter ++ QSplitterHandle* createHandle(); + +- void doMove( bool backwards, int pos, int id, int delta, +- bool mayCollapse, int* positions, int* widths ); ++ void setCursor( int id, const QCursor& cursor ); ++ void unsetCursor( int id ); + +- void repaintHandles(); ++protected: ++ KompareListView* listView( int index ); ++ KompareConnectWidget* connectWidget( int index ); + +- QTimer* m_scrollTimer; +- bool restartTimer; +- int scrollTo; ++private: + + // Scrollbars. all this just for the goddamn scrollbars. i hate them. + int scrollId(); +@@ -106,6 +108,10 @@ + int maxContentsX(); + int minVisibleWidth(); + ++ QTimer* m_scrollTimer; ++ bool m_restartTimer; ++ int m_scrollTo; ++ + ViewSettings* m_settings; + QScrollBar* m_vScroll; + QScrollBar* m_hScroll; diff -Nur kdesdk-3.96.2-orig/kompare/kompare_shell.cpp kdesdk-3.96.2-fix-kompare/kompare/kompare_shell.cpp --- kdesdk-3.96.2-orig/kompare/kompare_shell.cpp 2007-10-03 13:46:58.000000000 +0200 +++ kdesdk-3.96.2-fix-kompare/kompare/kompare_shell.cpp 2007-12-05 08:06:28.000000000 +0100 @@ -4350,17 +3525,27 @@ diff -Nur kdesdk-3.96.2-orig/kompare/libdialogpages/diffsettings.cpp kdesdk-3.96 #include "diffsettings.moc" diff -Nur kdesdk-3.96.2-orig/kompare/libdialogpages/filespage.cpp kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filespage.cpp --- kdesdk-3.96.2-orig/kompare/libdialogpages/filespage.cpp 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filespage.cpp 2007-12-06 02:52:26.000000000 +0100 ++++ kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filespage.cpp 2007-12-10 12:32:42.000000000 +0100 @@ -32,7 +32,7 @@ #include "filessettings.h" #include "filespage.h" -FilesPage::FilesPage( QWidget* parent ) : PageBase( parent ), m_URLChanged( false ) -+FilesPage::FilesPage() : PageBase(), m_URLChanged( false ) ++FilesPage::FilesPage() : PageBase() { QWidget* page = new QWidget( this ); QVBoxLayout* layout = new QVBoxLayout( page ); -@@ -101,29 +101,29 @@ +@@ -50,9 +50,6 @@ + m_secondURLComboBox->setObjectName( "DestURLComboBox" ); + m_secondURLRequester = new KUrlRequester( m_secondURLComboBox, m_secondGB ); + +- connect( m_firstURLRequester, SIGNAL( urlSelected( const QString & ) ), SLOT( setSecondURL( const QString & ) ) ); +- connect( m_secondURLRequester, SIGNAL( urlSelected( const QString & ) ), SLOT( setFirstURL( const QString & ) ) ); +- + m_thirdGB = new Q3GroupBox( 1, Qt::Vertical, i18n( "Encoding" ), page ); + m_encodingComboBox = new QComboBox( false, m_thirdGB, "encoding_combobox" ); + m_encodingComboBox->insertStringList( KGlobal::charsets()->availableEncodingNames() ); +@@ -101,29 +98,29 @@ { // kDebug() << "first : " << m_firstURLComboBox->currentText() << endl; // kDebug() << "second: " << m_secondURLComboBox->currentText() << endl; @@ -4398,7 +3583,7 @@ diff -Nur kdesdk-3.96.2-orig/kompare/libdialogpages/filespage.cpp kdesdk-3.96.2- m_encodingComboBox->setCurrentText( m_settings->m_encoding ); } -@@ -143,10 +143,10 @@ +@@ -143,31 +140,11 @@ void FilesPage::setDefaults() { @@ -4413,9 +3598,30 @@ diff -Nur kdesdk-3.96.2-orig/kompare/libdialogpages/filespage.cpp kdesdk-3.96.2- m_encodingComboBox->setCurrentText( "Default" ); } +-void FilesPage::setFirstURL( const QString &url ) +-{ +- QString _url = url; +- if ( !m_URLChanged ) +- { +- m_firstURLRequester->setUrl( _url.remove( url.section( '/', -1 ) ) ); +- m_URLChanged = true; +- } +-} +- +-void FilesPage::setSecondURL( const QString &url ) +-{ +- QString _url = url; +- if ( !m_URLChanged ) +- { +- m_secondURLRequester->setUrl( _url.remove( url.section( '/', -1 ) ) ); +- m_URLChanged = true; +- } +-} +- + #include "filespage.moc" diff -Nur kdesdk-3.96.2-orig/kompare/libdialogpages/filespage.h kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filespage.h --- kdesdk-3.96.2-orig/kompare/libdialogpages/filespage.h 2006-10-26 04:18:11.000000000 +0200 -+++ kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filespage.h 2007-12-06 02:55:06.000000000 +0100 ++++ kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filespage.h 2007-12-10 12:20:22.000000000 +0100 @@ -37,7 +37,7 @@ { Q_OBJECT @@ -4425,6 +3631,17 @@ diff -Nur kdesdk-3.96.2-orig/kompare/libdialogpages/filespage.h kdesdk-3.96.2-fi virtual ~FilesPage(); public: +@@ -60,10 +60,6 @@ + virtual void apply(); + virtual void setDefaults(); + +-protected slots: +- void setFirstURL( const QString & ); +- void setSecondURL( const QString & ); +- + private: + Q3GroupBox* m_firstGB; + Q3GroupBox* m_secondGB; diff -Nur kdesdk-3.96.2-orig/kompare/libdialogpages/filessettings.cpp kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filessettings.cpp --- kdesdk-3.96.2-orig/kompare/libdialogpages/filessettings.cpp 2006-10-26 04:18:11.000000000 +0200 +++ kdesdk-3.96.2-fix-kompare/kompare/libdialogpages/filessettings.cpp 2007-12-04 19:30:38.000000000 +0100 diff --git a/kdesdk.spec b/kdesdk.spec index 6144a10..a3c119e 100644 --- a/kdesdk.spec +++ b/kdesdk.spec @@ -1,6 +1,6 @@ Name: kdesdk Version: 3.97.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The KDE Software Development Kit (SDK) Group: User Interface/Desktops @@ -171,6 +171,9 @@ rm -rf %{buildroot} %{_kde4_libdir}/kde4/devel/* %changelog +* Mon Dec 10 2007 Kevin Kofler 3.97.0-2 +- updated fix-kompare patch (rev 5) + * Sat Dec 08 2007 Kevin Kofler 3.97.0-1 - update to 3.97.0 (KDE 4.0 RC2)