[gnomemm] gconf(mm) buggy?



hi,

after problems with gconf-signals concerning an application which i wrote, featuring gconf, i created a simple test app - and it has the same problems. either the gui freezes and i have to kill the app or it even segfaults even if i don't do anything with the gui in the signal handler.
it happens when i play around in the configuration editor changing key values - in my app it happens on every change, in the test app after some time.

am i doing something wrong? any hint is welcome, of course.


--
triendl klaus



here is the test program:



#include <gtkmm.h>
#include <gconfmm.h>
#include <iostream>
#include <list>

using namespace std;
using Glib::ustring;


Glib::RefPtr <Gnome::Conf::Client> gb_pClient;

class MyWindow: public Gtk::Window
{
public:
	MyWindow()
		: Gtk::Window()
	{
		Gtk::VBox* pVBoxWhole = manage(new Gtk::VBox(false));
		Gtk::Button* pButton = manage(new Gtk::Button("test"));
		pVBoxWhole->pack_start(*pButton);
		add(*pVBoxWhole);
		
		ustring strDir = "/apps/file-roller/ui";
		gb_pClient->add_dir(strDir, Gnome::Conf::CLIENT_PRELOAD_ONELEVEL);
		list <Gnome::Conf::Entry> contEntries = gb_pClient->all_entries(strDir);

		cerr << "contEntries.size()=" << contEntries.size() << endl;
		list <Gnome::Conf::Entry>::const_iterator it = contEntries.begin();
		for (; it != contEntries.end(); it++)
		{
			const Gnome::Conf::Value& value = gb_pClient->get(it->get_key());
			cerr << "GConf: " << it->get_key() << "=" << value.get_type();
			if (value.get_type() == 2)
				cerr << ", value=" << value.get_int();
			else if (value.get_type() == 4)
				cerr << ", value=" << value.get_bool();
			else if (value.get_type() == 1)
				cerr << ", value=" << value.get_string();
			cerr << endl;
		}
	
		gb_pClient->signal_value_changed().connect(SigC::slot(*this, &MyWindow::on_value_changed));
		show_all_children();
	}
	
	void on_value_changed(const ustring& strKey, const Gnome::Conf::Value& value)
	{
		cerr << "MyWindow::on_value_changed()" << endl;
		cerr << "strKey=" << strKey << endl;
	}
};


int main(int argc, char** argv)
{
	Gnome::Conf::init();
	gb_pClient = Gnome::Conf::Client::get_default_client();
	Gtk::Main main(argc, argv);
	MyWindow mw;
	main.run(mw);
	return 0;
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]