[rkward-cvs] SF.net SVN: rkward-code:[4559] trunk/rkward/rkward/windows

tfry at users.sf.net tfry at users.sf.net
Sun Feb 24 18:57:36 UTC 2013


Revision: 4559
          http://sourceforge.net/p/rkward/code/4559
Author:   tfry
Date:     2013-02-24 18:57:34 +0000 (Sun, 24 Feb 2013)
Log Message:
-----------
Revert r4554, and try a different fix, instead.

Revision Links:
--------------
    http://sourceforge.net/p/rkward/code/4554

Modified Paths:
--------------
    trunk/rkward/rkward/windows/rktoolwindowbar.cpp
    trunk/rkward/rkward/windows/rkworkplace.cpp

Modified: trunk/rkward/rkward/windows/rktoolwindowbar.cpp
===================================================================
--- trunk/rkward/rkward/windows/rktoolwindowbar.cpp	2013-02-24 18:56:42 UTC (rev 4558)
+++ trunk/rkward/rkward/windows/rktoolwindowbar.cpp	2013-02-24 18:57:34 UTC (rev 4559)
@@ -344,7 +344,7 @@
 
 	RKMDIWindow *win = RKToolWindowList::findToolWindowById (action->data ().toString ());
 	if (action->isChecked ()) {
-		addWidget (win);
+		RKWorkplace::mainWorkplace ()->placeInToolWindowBar (win, position ());
 	} else {
 		RK_ASSERT (win->tool_window_bar == this);
 		removeWidget (win);

Modified: trunk/rkward/rkward/windows/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.cpp	2013-02-24 18:56:42 UTC (rev 4558)
+++ trunk/rkward/rkward/windows/rkworkplace.cpp	2013-02-24 18:57:34 UTC (rev 4559)
@@ -231,6 +231,7 @@
 	RK_TRACE (APP);
 
 	RK_ASSERT (window->isToolWindow ());
+	bool needs_registration = (!window->tool_window_bar && (position != RKToolWindowList::Nowhere));
 	if ((position < 0) || (position >= TOOL_WINDOW_BAR_COUNT)) {
 		RK_ASSERT (position == RKToolWindowList::Nowhere);	// should never happen...
 		position = RKToolWindowList::Nowhere;		// ... but let's set this explicitly, in case of a broken workplace representation
@@ -241,12 +242,8 @@
 		tool_window_bars[position]->addWidget (window);
 	}
 
-	if (!windows.contains (window)) {	// first time, we see this window?
-		addWindow (window, true);
-		// In other cases, the part is added from addWindow()->attachWindow(). Probably, this could be simplified, but I don't dare
-		// touch it as long as it works. If parts are not added, part (de-)activation will not work, properly
-		if (window->isAttached () && !window->tool_window_bar) RKWardMainWindow::getMain ()->partManager ()->addPart (window->getPart ()); 
-	}
+	if (!windows.contains (window)) addWindow (window, true);	// first time we see this window
+	else if (needs_registration) attachWindow (window);
 }
 
 bool RKWorkplace::openAnyUrl (const KUrl &url, const QString &known_mimetype, bool force_external) {





More information about the rkward-tracker mailing list