[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kdeui
From:       Matt Rogers <mattr () kde ! org>
Date:       2005-03-06 6:20:13
Message-ID: 20050306062013.E7A58E772 () office ! kde ! org
[Download RAW message or body]

CVS commit by mattr: 

Add a few clarifying comments.


  M +24 -14    kdockwidget.cpp   1.173


--- kdelibs/kdeui/kdockwidget.cpp  #1.172:1.173
@@ -346,7 +346,5 @@ void KDockWidgetHeader::setDragPanel( KD
   layout->activate();
   kdDebug(282)<<"KdockWidgetHeader::setDragPanel:minimum height="<<layout->minimumSize().height()<<endl;
-#ifdef __GNUC__
-#warning FIXME
-#endif
+  //FIXME somebody left this here, but we don't know what the hell it's for.
   drag->setFixedHeight( closeButton->height()); // /*layout->minimumS*/sizeHint().height() );
 }
@@ -950,10 +948,12 @@ KDockWidget* KDockWidget::manualDock( KD
   if (this == target)
     return 0L;  // docking to itself not possible
+
 //  kdDebug(282)<<"manualDock called "<<endl;
-  bool succes = true; // tested flag
+  bool success = true; // tested flag
 
-  // check allowed this dock submit this operations
+  // Check to make sure that we can dock in to the position wee
+  // were told to dock in to
   if ( !(eDocking & (int)dockPos) ){
-    succes = false;
+    success = false;
 //  kdDebug(282)<<"KDockWidget::manualDock(): success = false (1)"<<endl;
   }
@@ -979,25 +979,34 @@ KDockWidget* KDockWidget::manualDock( KD
   }
 
-  if (this!=tmpTarget) {
-    if (target && (target==dockManager()->d->mainDockWidget) && tmpTarget) {
+  //If we're not the target, and the target is our dock manager's main window
+  //dock into the temp target as chosen above
+  if ( tmpTarget && this != tmpTarget)
+  {
+    if ( target && target == dockManager()->d->mainDockWidget )
+    {
         return manualDock(tmpTarget,DockCenter,spliPos,pos,check,tabIndex);
     }
   }
 
-  // check allowed target submit this operations
+  // check if the target allows us to oock into the requested position
   if ( target && !(target->sDocking & (int)dockPos) ){
-    succes = false;
+    success = false;
 //  kdDebug(282)<<"KDockWidget::manualDock(): success = false (2)"<<endl;
   }
 
+  /* if we have a parent, and it's not a KDockSplitter, and we don't have a parent
+   * dock tab group, and our parent isn't a KDockContainer, and we have no explicit
+   * parent dock container...we can't do much yet */
   if ( parent() && !parent()->inherits("KDockSplitter") && !parentDockTabGroup() &&
         !(dynamic_cast<KDockContainer*>(parent())) && !parentDockContainer()){
 //  kdDebug(282)<<"KDockWidget::manualDock(): success = false (3)"<<endl;
 //  kdDebug(282)<<parent()->name()<<endl;
-    succes = false;
+    success = false;
   }
 
-//  kdDebug(282)<<"KDockWidget::manualDock(): success == false "<<endl;
-  if ( !succes ){
+  /* If all of our attempts to dock back so far have failed and we have a target
+   * and we're not being called recursively (i guess that's what check is for)
+   * then attempt to dock back to ourselves. */
+  if ( !success ){
     // try to make another manualDock
     KDockWidget* dock_result = 0L;
@@ -1021,4 +1030,5 @@ KDockWidget* KDockWidget::manualDock( KD
   d->blockHasUndockedSignal = false;
 
+  //we have no docking target, so we're undocking
   if ( !target ){
     move( pos );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic