[Kmymoney-devel] Plugin Config File Install
Allan
agander93 at gmail.com
Sat Dec 31 11:34:19 UTC 2011
On 31/12/11 02:00, Jack Ostroff wrote:
> Hopefully I'm not being too simplistic, but
>
> On 2011.12.30 12:18, Allan wrote:
>>>> So, after installation, those two sections are available, and I load
>>>> into memory from the default config file the parameters for the
>>>> chosen profile. When the plugin is closed, the current parameters
>>>> are saved to the user's ~/.kde/4 config location, but this new file
>>>> contains only the one profile, the one that was first loaded.
>
> Will there be any other profile managment as part of the UI? Renaming
> profiles? Deleting profiles?
>
Yes, they are present at the moment - sort of. One can edit the profile
name via the combobox. At present,this actually works by creating a new
profile with the new name. It removes the old name, but doesn't, yet,
delete the old group in the config file.
> Now, think about a "future" scenario: the user has three profiles saved,
> and creates a new one. I assume you have to read in the current file (or
> have already done so) and take those three, add the new one, and write
> out four to the rc file. Therefore I assume you already have some way of
> saving an rc file including one or more profiles that have not just been
> used.
>
There isn't actually a 'future' problem. If the user has created a few
profiles, he has used them, one at a time, and they will have been
saved, at the end of that import process.
> Perhaps if there are no profiles saved in the local file (or there is no
> local file) then you automatically read in the sample profiles and save
> them, whether or not either of them was actually used.
This is closer to the problem. In normal use, the user will have
selected one profile, and that profile is read in and used to set up the
UI. When done, the current settings are saved locally to the current
profile. Any other profiles in the config will not have been read in,
or rather have been read in and discarded because the purpose is to set
up the UI. Again, this is not a problem. However, on the first run,
there is no local config file yet, as I haven't yet found a way to
detect where that distro has its ~/.kde or ~/.kde4 file. There appears
to be a KDEHOME variable, which sounded useful, but that presumably
would have had to be set by the distro, and mine is empty, and The
config got installed to root, I need to know this at compile time, to
tell cmake where to install the config file. So, I have to install to
the default location, /user/share/kde4/config. Then, on the first run,
if the user selects one of the two sample profiles, that profile, and
that profile alone, is read in and used to set up the UI. The other
sample profile remains on the config file, in /user/ etc. When the user
exits the import run, the current settings are saved, to the newly
created local config. As no other profiles have been read in, they
cannot be saved to the local config file. And that is the nub of the
problem - the creation of the first local config. Newly created
profiles will get saved, but not those in the default file.
>
> You could also have a button somewhere to "Reload all sample profiles"
>
> I don't think any of this actually solves the problem, but hopefully it
> might give you something to chew on.
>
> Jack
All that said, overnight I thought of a possibility so now to try it.
Allan
More information about the KMyMoney-devel
mailing list