kdelibs/kdeui

Dominik Haumann dhdev at gmx.de
Fri Mar 4 23:42:10 CET 2005


CVS commit by dhaumann:

Fix missing statement (which fixes yet another bug(s) :)

The real patch is only:
+ if (fixedWidth0!=-1 || fixedHeight0!=-1) restoreFromForcedFixedSize((KDockWidget*)child0);
+ if (fixedWidth1!=-1 || fixedHeight1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1);
- if (fixedWidth0!=-1) restoreFromForcedFixedSize((KDockWidget*)child0);
- if (fixedWidth1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1);

Code cleanups bloat up the code, so don't be confused.

Backport follows.


  M +22 -52    kdockwidget_private.cpp   1.55


--- kdelibs/kdeui/kdockwidget_private.cpp  #1.54:1.55
@@ -73,60 +72,31 @@ void KDockSplitter::activate(QWidget *c0
   updateName();
   divider->show();
+
+  // without this resize event, things will not work. why exactly? :(
   resizeEvent(0);

-  // dominik: the following is still something I don't understand 100%
-  // I even think that this includes some bugs!
-  if (fixedWidth0!=-1) restoreFromForcedFixedSize((KDockWidget*)child0);
-  if (fixedWidth1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1);
-  if (((KDockWidget*)child0)->forcedFixedWidth()!=-1)
-  {
-   
 setForcedFixedWidth(((KDockWidget*)child0),((KDockWidget*)child0)->forcedF
ixedWidth()); -    //QTimer::singleShot(100,this,SLOT(delayedResize()));
-  }
-  else
-  if (((KDockWidget*)child1)->forcedFixedWidth()!=-1)
-  {
-   
 setForcedFixedWidth(((KDockWidget*)child1),((KDockWidget*)child1)->forcedF
ixedWidth()); -    //QTimer::singleShot(100,this,SLOT(delayedResize()));
-  }

-  if (((KDockWidget*)child0)->forcedFixedHeight()!=-1)
-  {
-   
 setForcedFixedHeight(((KDockWidget*)child0),((KDockWidget*)child0)->forced
FixedHeight()); -    //QTimer::singleShot(100,this,SLOT(delayedResize()));
-  }
-  else
-  if (((KDockWidget*)child1)->forcedFixedHeight()!=-1)
-  {
-   
 setForcedFixedHeight(((KDockWidget*)child1),((KDockWidget*)child1)->forced
FixedHeight()); -    //QTimer::singleShot(100,this,SLOT(delayedResize()));
-  }
-  /*
-  if (m_orientation == Horizontal) {
-    if (fixedHeight0!=-1)
 restoreFromForcedFixedSize((KDockWidget*)child0); -    if
 (fixedHeight1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1); + 
 KDockWidget* dw0 = (KDockWidget*) child0;
+  KDockWidget* dw1 = (KDockWidget*) child1;

-  } else {
-    if (fixedWidth0!=-1) restoreFromForcedFixedSize((KDockWidget*)child0);
-    if (fixedWidth1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1);
-  }
+  // if fixed size is set, restore first, to restore xpos correctly
+  if( fixedWidth0 != -1 || fixedHeight0 != -1 )
 restoreFromForcedFixedSize( dw0 ); +  if( fixedWidth1 != -1 ||
 fixedHeight1 != -1 ) restoreFromForcedFixedSize( dw1 );

-//   if (m_orientation == Vertical) {

-    if (((KDockWidget*)child0)->forcedFixedWidth()!=-1) {
-     
 setForcedFixedWidth(((KDockWidget*)child0),((KDockWidget*)child0)->forcedF
ixedWidth()); +  // now force fixed sizes, if they are set.
+  if( dw0->forcedFixedWidth() != -1 ) {
+    setForcedFixedWidth( dw0, dw0->forcedFixedWidth() );
     }
-    else if (((KDockWidget*)child1)->forcedFixedWidth()!=-1) {
-     
 setForcedFixedWidth(((KDockWidget*)child1),((KDockWidget*)child1)->forcedF
ixedWidth()); +  else if( dw1->forcedFixedWidth() != -1 ) {
+    setForcedFixedWidth( dw1, dw1->forcedFixedWidth() );
     }
-//    } else {
-    if (((KDockWidget*)child0)->forcedFixedHeight()!=-1) {
-     
 setForcedFixedHeight(((KDockWidget*)child0),((KDockWidget*)child0)->forced
FixedHeight()); +
+  if( dw0->forcedFixedHeight() != -1 ) {
+    setForcedFixedHeight (dw0, dw0->forcedFixedHeight() );
     }
-    else if (((KDockWidget*)child1)->forcedFixedHeight()!=-1) {
-     
 setForcedFixedHeight(((KDockWidget*)child1),((KDockWidget*)child1)->forced
FixedHeight()); +  else if( dw1->forcedFixedHeight() != -1 ) {
+    setForcedFixedHeight( dw1, dw1->forcedFixedHeight() );
     }
-//   }
-  */
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kmdi-devel/attachments/20050304/ce99459f/attachment.pgp


More information about the Kmdi-devel mailing list