Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tiwag on May 29, 2005, 06:07:45 pm

Title: default workspace doesn't load at startup
Post by: tiwag on May 29, 2005, 06:07:45 pm
after an update today to the latest CVS version (at the time of writing)
i can't any longer use a default workspace.

regardless if i select in
"Setting->Environment->On application start-up:"
"Open default workspace"
it always opens a blank workspace (with no title!, only a blank " ")

If i create my favorite workspace and select
"File->Save Workspace"
and save my workspace as
"Documents and Settings\CurrentUser\.Codeblocks\default.workspace"
it doesn't load this as default workspace when i start C::B the next time.

This was working for me before i updated from CVS and leads me to the question: How can i save a default workspace now?
Title: default workspace doesn't load at startup
Post by: mandrav on May 29, 2005, 06:44:27 pm
I fixed the "Save workspace" and "Save workspace as" commands which didn't work. Apparently, it broke the default workspace handling  :oops:
Let me take a look and fix it.

Yiannis.
Title: default workspace doesn't load at startup
Post by: mandrav on May 29, 2005, 06:55:51 pm
Fixed it. Here's the patch if you need it until anonymous CVS is up-to-date.

Code
--- sdk/projectmanager.1.60.cpp	Sun May 29 11:50:46 2005
+++ sdk/projectmanager.cpp Sun May 29 19:50:27 2005
@@ -784,7 +784,9 @@
     if (!CloseWorkspace())
         return false; // didn't close
     m_IsLoadingWorkspace=true;    
-    m_pWorkspace = new cbWorkspace(filename);
+// TODO (mandrav#1#): Change default value for 'filename' to DEFAULT_WORKSPACE and
+//                    remove the ternary operator in "new cbWorkspace()" below
+    m_pWorkspace = new cbWorkspace(filename.IsEmpty() ? DEFAULT_WORKSPACE : filename);
     m_IsLoadingWorkspace=false;
     Manager::Get()->GetEditorManager()->RebuildOpenedFilesTree();
     SANITY_CHECK(false);


Yiannis.
Title: default workspace doesn't load at startup
Post by: tiwag on May 29, 2005, 08:35:38 pm
hi Yiannis !
thanks a lot