[Psi-Devel] Fwd: Psi Jabber Client - FS#32: Profile: move profile to %appdata% folder (windows only)
textshell-I1QKlO at neutronstar.dyndns.org
textshell-I1QKlO at neutronstar.dyndns.org
Mon Oct 15 10:19:08 PDT 2007
On Mon, Oct 15, 2007 at 07:38:26AM -0400, Hal Rottenberg wrote:
> Subject: Psi Jabber Client - FS#32: Profile: move profile to %appdata%
> With
> your permission, I would like to fix that and implement some migration
> routine in ApplicationInfo::homeDir(), which copies the profile from
> the old location and marks the old one as obsolete. Therefore I would
> implement a function profileCopy(const QString& sourceDir, const
> QString& targetDir, const bool maskAsObsolete) to copy the profile,
> which gets called by ApplicationInfo::homeDir().
> ----------
>
I think the usual way is just to let new version create the profile
in the right place if no profile is on the system and to let the program
load the profile from both places.
i.e. somethink like this.. with oldPath the old location and newPath the
new location:
if (QDir(newPath + "/PsiData").exists) {
return QDir(newPath + "/PsiData");
} else if (QDir(oldPath + "/PsiData").exists) {
return QDir(oldPath + "/PsiData");
} else {
QDir(newPath + "/PsiData").mkdir();
return QDir(newPath + "/PsiData");
}
I'm not sure this is actually better, but it seems to be the standard way
to do this (i.e. phonix -> firebird -> firefox and some other applications
that had their names changed did it this way).
And this is actually easier to implement, because it's just a bunch of
tests and doesn't need to copy files around. On the other hand psi would
need to keep checking in the old path for quite some time...
- Martin
More information about the Psi-Devel
mailing list