Registered Member
|
I'm trying to create a KConfigDialog for a program I am making but I have no idea how KConfigSkeleton works. I've spent 2 days reading the KDE API on KConfig and things related to it, but no progress has been made. Can someone give me an example of how I can setup KConfigSkeleton so I can pass it into KConfigDialog()?
I believe a KConfigDialog is created with:
But from here I get stuck at KConfigSkeleton. |
Administrator
|
First, you need to use KConfigXT. You can then call ClassName::self() to get a KConfigSkeleton, where ClassName comes from your *.kcfg file. See techbase.kde.org for a tutorial and System Settings in KDE SVN for an example.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thanks for pointing me in the right direction.
I've set up my kcfg and kcfgc files and added the two lines into my CMakeLists.txt, but I can't get my program to compile. The compiler can't find my the new .cpp and .h file is supposed to be created. It's not created in fact. Settings.kcfgc:
Settings.kcfg:
|
Administrator
|
Can you please post your CMakeLists.txt?
You should have a statement similar to this in it:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Maybe the location of kde4_add_kcfg_files is wrong. |
Administrator
|
Can you send me a copy of the source so I can experiment? You may need to re-run CMake in the build directory in case it missed your changes somehow.
Also, try adding ${CMAKE_CURRENT_SOURCE_DIR} to your include directories, and the following CMake statement:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Hmm, anyway to attach the code? If not I'll give you all the relevant code (I can give it all but I have libraries that do other things not relevant to this).
Source code:
Header file:
|
Administrator
|
A tarball of your project should be enough. I can't see anything wrong with those two files you have posted though. You can't upload files to the forum however, I'd recommend sending them to my email address, or posting it on a public site where I can download it from. My email address is (my forum username here)@kde.org.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
In your CMakeLists.txt, below your kde4_add_kfcg line, try adding this:
then run cmake and you should see a line saying "KReminder_SRCS..." scroll by, it will show you the names of the class files which kconfig_compiler has supposedly generated. Check if they exist (ln -l ....) I expect in your case they will be named Settings.{h,cpp} -- make sure they don't conflict with anything else in your code. Finally, wherever you access the configuration, you sould have an
or similar line. If still no luck, try running xmllint in your .kcfg file to make sure it's well-formed.
The last thing to try is run kconfig_compiler by hand on your input files, see what comes out:
then
to see what has been generated, if anything. Hope this helps a bit. |
Registered Member
|
Thanks for your help everyone.
I'm currently digging up my code after a clean install of my OS. Apparently, a milestone of openSUSE 11.4 and KDE 4.6 Beta2 are not a good combination, who would have thought? So I'll get back to you about my results on KConfig. |
Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]