You are not logged in.

1

Friday, September 3rd 2004, 8:04pm

configuration files

Hello,
It's rather a general question about kde. Suppose I want to save some kind of information for future work with the user. I can save it in some file at his home directory or in the /etc folder. Can someone please explain me what is the rule for that, how you approach it and other tips/hints...

R. alex

Latem

Beginner

Posts: 31

Location: New Brunswick, Canada

Occupation: Student/Programmer

  • Send private message

2

Saturday, September 4th 2004, 12:17am

Depends on the kind of application, and what kind of settings, But usually, you should definitely save it somewhere in their user's home directory. That way every user keeps their own settings.

Here's a good link:

http://www.kdevelop.org/3.0/doc/tutorial_settings/

and specifically related to your issue is part 3.

Also there is the Qini class in the QtForum wiki which works pretty good.

Latem
The march of progress:
C:
printf("%10.2f", x);
C++:
cout << setw(10) << setprecision(2) << showpoint << x;
Java:
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);

3

Saturday, September 4th 2004, 10:43am

Thanx!!! That's is the best thing I could wish to find!

Thomas

Beginner

Posts: 4

Location: Socorro, New Mexico, USA

Occupation: Software Engineer

  • Send private message

4

Saturday, September 4th 2004, 3:25pm

RE: configuration files

Give QSettings a try!

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

5

Saturday, September 4th 2004, 5:14pm

If you are creating an application for a recent KDE release, have a look at the KConfig tutorial

http://developer.kde.org/documentation/t…/kconfigxt.html

Cheers,
_
Qt/KDE Developer
Debian User