2009/10/22 Graeme Geldenhuys <[email protected]>: > > You can still use GetAppConfigDir, just override the > OnGetApplicationName event and return the common application name you > want to use.
In the event that other developers do not know how to use this feature, here is a code example. It seems not many developers know about this feature. Lets say the default ApplicationName returns "project1", but no matter what my actual application name is, I would like to return a specific (custom) name instead. This means that GetAppConfigDir(False) would normally have return the following path under Linux: /home/<user>/.config/project1 With the code below, it will always return: /home/<user>/.config/tutoradmin ----------------------------- implemenation // This function overrides the default application name function MyCustomApplicationName: string; begin Result := 'tutoradmin'; end; constructor TMainForm.Create(AOwner: TComponent ); begin inherited Create(AOwner); OnGetApplicationName := @MyCustomApplicationName; lCfg := GetAppConfigDir(False) + PathDelim + 'settings.ini'; end; ----------------------------- > > > -- > Regards, > - Graeme - > > > _______________________________________________ > fpGUI - a cross-platform Free Pascal GUI toolkit > http://opensoft.homeip.net/fpgui/ > -- Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
