[Geany-devel] Proposed patch to fix issues with command line file loading

weltall weltall2 at xxxxx
Thu Jan 27 09:20:26 UTC 2011


Hi,
I've noticed various issues with file loading from command line:
1) if the option load last session is not enabled project files can't be
opened from command line: this happens because the code to handle them
is wrapped in a prefs.load_lastsession if so the only way to load them
from command line is having that option true.
2) trying to open a file (eg from double clicking in nautilus) will
screw your session as command line loading of single files ignores your
session opened files, except if geany was already opened.

So to fix those issues I've reorganized the code in the
load_startup_file function in order to:
1) load the project files ignoring the session if a project file was
specified at command line
2) allow to load more files in addition to the project file (removing so
the limitation imposed there artificially - possible improvement to this
would be adding a flag to open_cl_files as argument in order to avoid
that pointer toying)
3) the open_cl_files is called after loading the session so the
specifically selected files are opened last and so are automatically
selected (what you would expect when opening a file from nautilus)
4) if the option to load last session is not enabled and there isn't a
project file being loaded from command line and a project is not being
loaded we just try to load files from command line if any

Stefano Angeleri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loadfix.diff
Type: text/x-patch
Size: 2607 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20110127/1ce4458a/attachment.bin>


More information about the Devel mailing list