[rkward-cvs] SF.net SVN: rkward:[2951] trunk/rkward/rkward/windows/rkworkplace.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Jul 16 10:15:22 UTC 2010


Revision: 2951
          http://rkward.svn.sourceforge.net/rkward/?rev=2951&view=rev
Author:   tfry
Date:     2010-07-16 10:15:22 +0000 (Fri, 16 Jul 2010)

Log Message:
-----------
Save workplace-windows in the correct order

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

Modified: trunk/rkward/rkward/windows/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.cpp	2010-07-15 18:44:35 UTC (rev 2950)
+++ trunk/rkward/rkward/windows/rkworkplace.cpp	2010-07-16 10:15:22 UTC (rev 2951)
@@ -485,16 +485,20 @@
 QString RKWorkplace::makeWorkplaceDescription (const QString &sep, bool quote) {
 	RK_TRACE (APP);
 
+	// window order in the workplace view may have changed with respect to our list. Thus we first generate a properly sorted list
+	RKWorkplaceObjectList list = getObjectList (RKMDIWindow::DocumentWindow, RKMDIWindow::Detached);
+	for (int i=0; i < wview->count (); ++i) {
+		list.append (static_cast<RKMDIWindow*> (wview->widget (i)));
+	}
+	
 	QString workplace_description;
 	bool first = true;
-	for (RKWorkplaceObjectList::const_iterator it = windows.constBegin (); it != windows.constEnd (); ++it) {
-		if ((*it)->isToolWindow ()) continue;
-
+	foreach (RKMDIWindow *win, list) {
 		if (first) first = false;
 		else workplace_description.append (sep);
 
-		if (!quote) workplace_description.append ((*it)->getDescription ());
-		else workplace_description.append (RObject::rQuote ((*it)->getDescription ()));
+		if (!quote) workplace_description.append (win->getDescription ());
+		else workplace_description.append (RObject::rQuote (win->getDescription ()));
 	}
 	return workplace_description;
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list