Remove g_win uses from actionsEdit.cpp

Sat, 29 Aug 2015 19:21:49 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sat, 29 Aug 2015 19:21:49 +0300
changeset 955
39d789d675fc
parent 954
7feaa1a3c438
child 956
2af18ba2665f

Remove g_win uses from actionsEdit.cpp

src/actionsEdit.cpp file | annotate | diff | comparison | revisions
--- a/src/actionsEdit.cpp	Sat Aug 29 19:18:40 2015 +0300
+++ b/src/actionsEdit.cpp	Sat Aug 29 19:21:49 2015 +0300
@@ -144,18 +144,18 @@
 		// Delete the subfile now as it's been inlined.
 		ref->destroy();
 	});
-
-	g_win->refresh();
 }
 
 void MainWindow::slot_actionInline()
 {
 	DoInline (false);
+	refresh();
 }
 
 void MainWindow::slot_actionInlineDeep()
 {
 	DoInline (true);
+	refresh();
 }
 
 // =============================================================================
@@ -231,7 +231,7 @@
 	LDColor defaultcol = getSelectedColor();
 
 	// Show the dialog to the user now and ask for a color.
-	if (ColorSelector::selectColor (color, defaultcol, g_win))
+	if (ColorSelector::selectColor (color, defaultcol, this))
 	{
 		for (LDObject* obj : objs)
 		{
@@ -320,23 +320,23 @@
 
 // =============================================================================
 //
-static void MoveSelection (const bool up)
+static void MoveSelection (MainWindow* win, bool up)
 {
 	LDObjectList objs = Selection();
 	LDObject::moveObjects (objs, up);
-	g_win->buildObjList();
+	win->buildObjList();
 }
 
 // =============================================================================
 //
 void MainWindow::slot_actionMoveUp()
 {
-	MoveSelection (true);
+	MoveSelection (this, true);
 }
 
 void MainWindow::slot_actionMoveDown()
 {
-	MoveSelection (false);
+	MoveSelection (this, false);
 }
 
 // =============================================================================
@@ -360,8 +360,6 @@
 
 	for (LDObject* obj : Selection())
 		obj->move (vect);
-
-	g_win->refresh();
 }
 
 // =============================================================================
@@ -507,7 +505,7 @@
 //
 void MainWindow::slot_actionReplaceCoords()
 {
-	QDialog* dlg = new QDialog (g_win);
+	QDialog* dlg = new QDialog (this);
 	Ui::ReplaceCoordsUI ui;
 	ui.setupUi (dlg);
 
@@ -705,7 +703,7 @@
 void MainWindow::slot_actionSplitLines()
 {
 	bool ok;
-	int segments = QInputDialog::getInt (g_win, APPNAME, "Amount of segments:", cfg::SplitLinesSegments, 0,
+	int segments = QInputDialog::getInt (this, APPNAME, "Amount of segments:", cfg::SplitLinesSegments, 0,
 		std::numeric_limits<int>::max(), 1, &ok);
 
 	if (not ok)
@@ -754,5 +752,5 @@
 	}
 
 	buildObjList();
-	g_win->refresh();
+	refresh();
 }

mercurial