Page MenuHomePhabricator

File open dialog should remember last path
Closed, ResolvedPublic

Assigned To
None
Authored By
nolden
Oct 23 2009, 2:35 PM
Referenced Files
F354: FixOfBug2746.patch
Nov 5 2009, 3:53 PM
F353: FixOfBug2746.patch
Nov 5 2009, 2:34 PM
F352: ChangeRequest.txt
Nov 5 2009, 2:32 PM
F351: FixOfBug2746.patch
Nov 2 2009, 6:25 PM

Related Objects

Event Timeline

Fixed the bug, but the core commit didn't work at first go. I'll try it again on Thursday the 5th of November, but feel free to do it earlier with the attached patch.

Two little improvements:

  • please have a look at QDir http://doc.trolltech.com/4.5/qdir.html for the path manipuilation, it's probably safer than std::string operations.
  • if a static member is only used in one function, you can also move it inside the implementation of that function

Tried to implement the improvements.

  • I didn't find a way to extract the path name out of a String which contains path and file (extract "C:\temp\" out of "C:\temp\test.stl" for example) with the class QDir. As far as I understand you already need a seperated path to construct a QDir object.
  • The second improvement works fine, modified the sourcecode accordingly.

I'll add two attachments now: new version of the patch and a change request for core modifications to commit the patch.

Change Request for core commit

fix of T2746 (new version from 2009-11-05)

Hi Alfred,

the solution is nice and simple, but please check

http://doc.trolltech.com/4.5/qfileinfo.html#pathx

for a more standard replacement of your method GetPath().

As for the change request, please copy it to

http://mitk.org/wiki/ChangeRequests/2746 (using the template suggested there)

and:

  • instead of "add / modificate a few methods in the class QmitkFileOpenAction" you could write "remember used path in a static variable and reuse it for the next File/Open action" [because every change is "add/mod a bit.."
  • there is a test-framework for gui tests (talk to Sascha), but a quick manual test would be sufficient

Implemented the suggested solution with qfileinfo. I'll add a patch with the new source code. Unfortuantely I've to leave in a few minutes and so there is no time left to write a new change request. I'll do this on monday.

new version no. 2 from 2009-11-05

[SVN revision 19969]
FIX (#2746): Added a static variable to class the QmitkFileOpenAction. In this variable the last directory from where a file was opened is stored to start in this directory again in the next file-open-process.

Created a change request which was accepted and then committed the changes. The
continous clients accepted the commit without errors, so in my opinion the bug
is solved

Merging "applicazion modules" component with "ExtApp plugins"