[rkward-cvs] SF.net SVN: rkward:[3435] trunk/rkward/rkward/agents
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Mon Feb 14 12:44:06 UTC 2011
Revision: 3435
http://rkward.svn.sourceforge.net/rkward/?rev=3435&view=rev
Author: tfry
Date: 2011-02-14 12:44:06 +0000 (Mon, 14 Feb 2011)
Log Message:
-----------
Write workplace layout to correct location in 'Save As'
Modified Paths:
--------------
trunk/rkward/rkward/agents/rksaveagent.cpp
trunk/rkward/rkward/agents/rksaveagent.h
Modified: trunk/rkward/rkward/agents/rksaveagent.cpp
===================================================================
--- trunk/rkward/rkward/agents/rksaveagent.cpp 2011-02-14 12:40:34 UTC (rev 3434)
+++ trunk/rkward/rkward/agents/rksaveagent.cpp 2011-02-14 12:44:06 UTC (rev 3435)
@@ -2,7 +2,7 @@
rksaveagent - description
-------------------
begin : Sun Aug 29 2004
- copyright : (C) 2004, 2009, 2010 by Thomas Friedrichsmeier
+ copyright : (C) 2004, 2009, 2010, 2011 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -35,6 +35,7 @@
save_url = url;
RKSaveAgent::when_done = when_done;
RKSaveAgent::load_url = load_url;
+ previous_url = RObjectList::getObjectList ()->getWorkspaceURL ();
save_chain = 0;
if (save_url.isEmpty () || save_file_as) {
if (!askURL ()) {
@@ -46,6 +47,7 @@
RKWorkplace::mainWorkplace ()->flushAllData ();
save_chain = RKGlobals::rInterface ()->startChain (0);
+ RObjectList::getObjectList ()->setWorkspaceURL (save_url);
RKWorkplace::mainWorkplace ()->saveWorkplace (save_chain);
RKGlobals::rInterface ()->issueCommand (new RCommand ("save.image (\"" + save_url.toLocalFile () + "\")", RCommand::App, QString::null, this), save_chain);
}
@@ -69,6 +71,8 @@
void RKSaveAgent::rCommandDone (RCommand *command) {
RK_TRACE (APP);
if (command->hasError ()) {
+ RObjectList::getObjectList ()->setWorkspaceURL (previous_url);
+
int res;
if (when_done != DoNothing) {
res = KMessageBox::warningYesNoCancel (0, i18n ("Saving to file '%1' failed. What do you want to do?", save_url.path ()), i18n ("Save failed"), KGuiItem (i18n ("Try saving with a different filename")), KGuiItem (i18n ("Saving failed")));
@@ -88,8 +92,6 @@
// else
when_done = DoNothing;
- } else {
- RObjectList::getObjectList ()->setWorkspaceURL (save_url);
}
done ();
}
Modified: trunk/rkward/rkward/agents/rksaveagent.h
===================================================================
--- trunk/rkward/rkward/agents/rksaveagent.h 2011-02-14 12:40:34 UTC (rev 3434)
+++ trunk/rkward/rkward/agents/rksaveagent.h 2011-02-14 12:44:06 UTC (rev 3435)
@@ -2,7 +2,7 @@
rksaveagent - description
-------------------
begin : Sun Aug 29 2004
- copyright : (C) 2004, 2009 by Thomas Friedrichsmeier
+ copyright : (C) 2004, 2009, 2011 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -45,6 +45,7 @@
RCommandChain *save_chain;
KUrl save_url;
KUrl load_url;
+ KUrl previous_url;
DoneAction when_done;
};
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