src/gui.cc

changeset 590
7aec744ce97b
parent 587
507e5d5c348c
child 600
209e3f1f7b2c
--- a/src/gui.cc	Mon Dec 23 11:57:32 2013 +0200
+++ b/src/gui.cc	Mon Dec 23 16:10:36 2013 +0200
@@ -121,7 +121,7 @@
 
 // =============================================================================
 // -----------------------------------------------------------------------------
-KeySequenceConfig& ForgeWindow::shortcutForAction (QAction* act)
+KeySequenceConfig* ForgeWindow::shortcutForAction (QAction* act)
 {	str keycfgname = fmt ("key_%1", act->objectName());
 	return KeySequenceConfig::getByName (keycfgname);
 }
@@ -130,8 +130,11 @@
 // -----------------------------------------------------------------------------
 void ForgeWindow::updateActionShortcuts()
 {	for (QAction* act : findChildren<QAction*>())
-		if (!act->objectName().isEmpty())
-			act->setShortcut (shortcutForAction (act));
+	{	KeySequenceConfig* cfg = shortcutForAction (act);
+
+		if (cfg)
+			act->setShortcut (cfg->getValue());
+	}
 }
 
 // =============================================================================
@@ -194,7 +197,7 @@
 QList<LDQuickColor> quickColorsFromConfig()
 {	QList<LDQuickColor> colors;
 
-	for (str colorname : gui_colortoolbar.value.split (":"))
+	for (str colorname : gui_colortoolbar.split (":"))
 	{	if (colorname == "|")
 			colors << LDQuickColor::getSeparator();
 		else
@@ -795,7 +798,7 @@
 
 	if (colinfo->index == maincolor)
 	{	// Use the user preferences for main color here
-		col = gl_maincolor.value;
+		col = gl_maincolor;
 		col.setAlphaF (gl_maincolor_alpha);
 	}
 

mercurial