[Qgis-developer] configpath vs optionspath

Martin Dobias wonder.sk at gmail.com
Tue May 22 12:56:21 PDT 2012


Hi Nathan

On Mon, May 21, 2012 at 11:45 PM, Nathan Woodrow <madmanwoo at gmail.com> wrote:
> Hi all,
>
> I'm trying to understand when one would use --configpath vs --optionspath.
> I understand that --configpath can be set the path to look for things
> like python plugins etc but optionspath seems to do nothing.

The idea behind --configpath is to use the given path for everything
user-specific, that is:
1. QSettings configuration (into .ini file in that path)
2. anything that normally appears under ~/.qgis

The --optionspath overrides just the QSettings part - and probably it
should be removed since the --configpath seems to be what people want
to use.

>  Even when set the settings
> are still stored in the registry in windows.   In the code they both seem to
> be doing the same thing in two different places (lines, 318, 421, 484
> in main.cpp) :
>
> QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, argv[++i] );
>
> which doesn't seem to do anything unless you also use:
>
> QSettings::setDefaultFormat( QSettings::IniFormat );
>
> so that you have:
>
> QSettings::setDefaultFormat( QSettings::IniFormat );
> QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, argv[++i] );
>
> I added the setDefaultFormat line for all three cases
> (https://gist.github.com/2764906)
> but now if you supply configpath it will create the ini in the config
> path rather then the
> optionspath.
>
> I'm just wondering what the correct behaviour is meant to be.
>
> Is configpath meant to just set the location for the python plugins,
> etc, and optionspath
> meant to set the path to the ini file?  If this is the case I have a
> patch ready to commit
> to fix this.

Looks like a bug to me. Probably it was tested just on Linux which
uses IniFormat by default...

Martin


More information about the Qgis-developer mailing list