[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    setupGui strange interaction with KConfig
From:       Albert Astals Cid <astals11 () terra ! es>
Date:       2005-01-23 12:05:15
Message-ID: 200501231305.15573.astals11 () terra ! es
[Download RAW message or body]

Hi, look at this test, calling setupGui changes the group of the KInstance 
KConfig object. That is causing, for example bug 
http://bugs.kde.org/show_bug.cgi?id=97229 so i don't know if it may be 
causing any bug more.

Is this the correct behaviour? If it is it could be at least documented on the 
api.

Thanks

Albert

["test.cpp" (text/x-c++src)]

#include <kaboutdata.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kmainwindow.h>

class myWindow : public KMainWindow
{
	public:
		myWindow() : KMainWindow()
		{
			KConfig *cfg = kapp -> config();
			kdDebug() << cfg -> group() << endl;
	
			setupGUI();

			cfg = kapp -> config();
			kdDebug() << cfg -> group() << endl;

			show();
		}
};
	
int main(int argc, char *argv[])
{
	KAboutData about("test", "test", "0", "test", KAboutData::License_GPL);
	KCmdLineArgs::init(argc, argv, &about);
	KApplication app;

	app.setTopWidget(new myWindow());

	return app.exec();
}



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic