goat3d

diff goatview/src/goatview.cc @ 84:022b13ed975b

minor gui fix
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 12 May 2014 07:37:30 +0300
parents 57e745dd13c2
children 91e3aa1a60c3
line diff
     1.1 --- a/goatview/src/goatview.cc	Mon May 12 07:22:52 2014 +0300
     1.2 +++ b/goatview/src/goatview.cc	Mon May 12 07:37:30 2014 +0300
     1.3 @@ -24,12 +24,11 @@
     1.4  {
     1.5  	glview = 0;
     1.6  
     1.7 -	QSettings *settings = new QSettings;
     1.8 -	resize(settings->value("main/size", QSize(1024, 768)).toSize());
     1.9 -	move(settings->value("main/pos", QPoint(100, 100)).toPoint());
    1.10 -	use_nodes = settings->value("use_nodes", true).toBool();
    1.11 -	use_lighting = settings->value("use_lighting", true).toBool();
    1.12 -	delete settings;
    1.13 +	QSettings settings;
    1.14 +	resize(settings.value("main/size", QSize(1024, 768)).toSize());
    1.15 +	move(settings.value("main/pos", QPoint(100, 100)).toPoint());
    1.16 +	use_nodes = settings.value("use_nodes", true).toBool();
    1.17 +	use_lighting = settings.value("use_lighting", true).toBool();
    1.18  
    1.19  	make_center();	// must be first
    1.20  	make_menu();
    1.21 @@ -46,12 +45,11 @@
    1.22  
    1.23  void GoatView::closeEvent(QCloseEvent *ev)
    1.24  {
    1.25 -	QSettings *settings = new QSettings;
    1.26 -	settings->setValue("main/size", size());
    1.27 -	settings->setValue("main/pos", pos());
    1.28 -	settings->setValue("use_nodes", use_nodes);
    1.29 -	settings->setValue("use_lighting", use_lighting);
    1.30 -	delete settings;
    1.31 +	QSettings settings;
    1.32 +	settings.setValue("main/size", size());
    1.33 +	settings.setValue("main/pos", pos());
    1.34 +	settings.setValue("use_nodes", use_nodes);
    1.35 +	settings.setValue("use_lighting", use_lighting);
    1.36  }
    1.37  
    1.38  
    1.39 @@ -193,6 +191,8 @@
    1.40  
    1.41  static void update_tree(QTreeWidget *tree)
    1.42  {
    1.43 +	tree->clear();
    1.44 +
    1.45  	if(!scene) return;
    1.46  
    1.47  	int num_nodes = goat3d_get_node_count(scene);