- fixed compilation on windows

Sun, 07 Sep 2014 01:13:20 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 07 Sep 2014 01:13:20 +0300
changeset 882
2f3cc8e045d5
parent 881
82a9c3549db1
child 883
69b8adc9a669

- fixed compilation on windows

src/actions.cc file | annotate | diff | comparison | revisions
src/addObjectDialog.cc file | annotate | diff | comparison | revisions
src/crashCatcher.cc file | annotate | diff | comparison | revisions
src/extPrograms.cc file | annotate | diff | comparison | revisions
src/glRenderer.cc file | annotate | diff | comparison | revisions
src/ldConfig.cc file | annotate | diff | comparison | revisions
src/ldDocument.cc file | annotate | diff | comparison | revisions
src/ldObject.cc file | annotate | diff | comparison | revisions
src/main.cc file | annotate | diff | comparison | revisions
src/mainWindow.cc file | annotate | diff | comparison | revisions
src/mainWindow.h file | annotate | diff | comparison | revisions
src/partDownloader.cc file | annotate | diff | comparison | revisions
src/primitives.cc file | annotate | diff | comparison | revisions
--- a/src/actions.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/actions.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -383,7 +383,7 @@
 
 	if (not f.open (QIODevice::ReadOnly))
 	{
-		CriticalError (format ("Couldn't open %1 (%2)", fname, f.errorString()));
+		Critical (format ("Couldn't open %1 (%2)", fname, f.errorString()));
 		return;
 	}
 
@@ -420,7 +420,7 @@
 
 	if (not file.open (QIODevice::WriteOnly | QIODevice::Text))
 	{
-		CriticalError (format ("Unable to open %1 for writing (%2)", fname, file.errorString()));
+		Critical (format ("Unable to open %1 for writing (%2)", fname, file.errorString()));
 		return;
 	}
 
@@ -489,7 +489,7 @@
 				"PNG images (*.png);;JPG images (*.jpg);;BMP images (*.bmp);;All Files (*.*)");
 
 	if (not fname.isEmpty() and not img.save (fname))
-		CriticalError (format ("Couldn't open %1 for writing to save screencap: %2", fname, strerror (errno)));
+		Critical (format ("Couldn't open %1 for writing to save screencap: %2", fname, strerror (errno)));
 
 	delete[] imgdata;
 }
--- a/src/addObjectDialog.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/addObjectDialog.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -116,7 +116,7 @@
 
 		default:
 		{
-			CriticalError (format ("Unhandled LDObject type %1 (%2) in AddObjectDialog", (int) type, typeName));
+			Critical (format ("Unhandled LDObject type %1 (%2) in AddObjectDialog", (int) type, typeName));
 		} return;
 	}
 
@@ -377,7 +377,7 @@
 
 			if (not file)
 			{
-				CriticalError (format ("Couldn't open `%1': %2", name, strerror (errno)));
+				Critical (format ("Couldn't open `%1': %2", name, strerror (errno)));
 				return;
 			}
 
--- a/src/crashCatcher.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/crashCatcher.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -149,7 +149,7 @@
 #ifdef __unix__
 	AssertionFailureText = format ("%1:%2: %3: %4", file, line, funcname, expr);
 #else
-	bombBox (format (
+	DisplayBombBox (format (
 		"<p><b>File</b>: <tt>%1</tt><br />"
 		"<b>Line</b>: <tt>%2</tt><br />"
 		"<b>Function:</b> <tt>%3</tt></p>"
--- a/src/extPrograms.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/extPrograms.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -195,7 +195,7 @@
 
 	if (not f.open (QIODevice::WriteOnly | QIODevice::Text))
 	{
-		CriticalError (format ("Couldn't open temporary file %1 for writing: %2\n", fname, f.errorString()));
+		Critical (format ("Couldn't open temporary file %1 for writing: %2\n", fname, f.errorString()));
 		return;
 	}
 
@@ -259,7 +259,7 @@
 
 	if (not proc.waitForStarted())
 	{
-		CriticalError (format ("Couldn't start %1: %2\n", g_extProgNames[prog], ProcessExtProgError (prog, proc)));
+		Critical (format ("Couldn't start %1: %2\n", g_extProgNames[prog], ProcessExtProgError (prog, proc)));
 		return false;
 	}
 
@@ -280,7 +280,7 @@
 
 	if (not err.isEmpty())
 	{
-		CriticalError (format ("%1 failed: %2\n", g_extProgNames[prog], err));
+		Critical (format ("%1 failed: %2\n", g_extProgNames[prog], err));
 		QString filename ("externalProgramOutput.txt");
 		QFile file (filename);
 
@@ -315,7 +315,7 @@
 
 	if (not f.open (QIODevice::ReadOnly))
 	{
-		CriticalError (format ("Couldn't open temporary file %1 for reading.\n", fname));
+		Critical (format ("Couldn't open temporary file %1 for reading.\n", fname));
 		return;
 	}
 
@@ -481,7 +481,7 @@
 
 		if (inCol == cutCol)
 		{
-			CriticalError ("Cannot use the same color group for both input and cutter!");
+			Critical ("Cannot use the same color group for both input and cutter!");
 			continue;
 		}
 
@@ -575,7 +575,7 @@
 
 		if (in1Col == in2Col)
 		{
-			CriticalError ("Cannot use the same color group for both inputs!");
+			Critical ("Cannot use the same color group for both inputs!");
 			continue;
 		}
 
@@ -641,7 +641,7 @@
 
 		if (in1Col == in2Col)
 		{
-			CriticalError ("Cannot use the same color group for both input and cutter!");
+			Critical ("Cannot use the same color group for both input and cutter!");
 			continue;
 		}
 
--- a/src/glRenderer.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/glRenderer.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -827,8 +827,13 @@
 
 	// Update 2d position
 	m_mousePosition = ev->pos();
+	m_globalpos = ev->globalPos();
+
+#ifndef USE_QT5
 	m_mousePositionF = ev->posF();
-	m_globalpos = ev->globalPos();
+#else
+	m_mousePositionF = ev->localPos();
+#endif
 
 	// Calculate 3d position of the cursor
 	m_position3D = (camera() != EFreeCamera) ? coordconv2_3 (m_mousePosition, true) : Origin;
@@ -1199,7 +1204,7 @@
 
 	if (img->isNull())
 	{
-		CriticalError (tr ("Failed to load overlay image!"));
+		Critical (tr ("Failed to load overlay image!"));
 		currentDocumentData().overlays[cam].invalid = true;
 		delete img;
 		return false;
--- a/src/ldConfig.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/ldConfig.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -47,7 +47,7 @@
 
 	if (fp == null)
 	{
-		CriticalError (QObject::tr ("Unable to open LDConfig.ldr for parsing."));
+		Critical (QObject::tr ("Unable to open LDConfig.ldr for parsing."));
 		return;
 	}
 
--- a/src/ldDocument.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/ldDocument.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -732,7 +732,7 @@
 		{
 			// Tell the user loading failed.
 			setlocale (LC_ALL, "C");
-			CriticalError (format (QObject::tr ("Failed to open %1: %2"), path, strerror (errno)));
+			Critical (format (QObject::tr ("Failed to open %1: %2"), path, strerror (errno)));
 		}
 
 		g_loadingMainFile = false;
--- a/src/ldObject.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/ldObject.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -86,7 +86,7 @@
 
 	// In case someone does, we cannot really continue execution. We must abort,
 	// give the user a chance to save their documents though.
-	CriticalError ("Created too many objects. Execution cannot continue. You have a "
+	Critical ("Created too many objects. Execution cannot continue. You have a "
 		"chance to save any changes to documents, then restart.");
 	(void) IsSafeToCloseAll();
 	Exit();
--- a/src/main.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/main.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -61,7 +61,7 @@
 		if (Config::Save())
 			print ("Configuration file successfully created.\n");
 		else
-			CriticalError ("Failed to create configuration file!\n");
+			Critical ("Failed to create configuration file!\n");
 	}
 
 	LDPaths::initPaths();
--- a/src/mainWindow.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/mainWindow.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -816,7 +816,7 @@
 
 // =============================================================================
 //
-void CriticalError (const QString& message)
+void Critical (const QString& message)
 {
 	QMessageBox::critical (g_win, MainWindow::tr ("Error"), message,
 		(QMessageBox::Close), QMessageBox::Close);
--- a/src/mainWindow.h	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/mainWindow.h	Sun Sep 07 01:13:20 2014 +0300
@@ -328,7 +328,7 @@
 bool Confirm (const QString& message);
 
 //! Displays an error prompt with the given \c message
-void CriticalError (const QString& message);
+void Critical (const QString& message);
 
 //! Makes an icon of \c size x \c size pixels to represent \c colinfo
 QIcon MakeColorIcon (LDColor colinfo, const int size);
--- a/src/partDownloader.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/partDownloader.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -44,7 +44,7 @@
 
 	if (path.isEmpty() or not QDir (path).exists())
 	{
-		CriticalError (PartDownloader::tr ("You need to specify a valid path for "
+		Critical (PartDownloader::tr ("You need to specify a valid path for "
 			"downloaded files in the configuration to download paths."));
 
 		(new ConfigDialog (ConfigDialog::DownloadTab, null))->exec();
@@ -373,7 +373,7 @@
 		print ("Creating %1...\n", dirpath);
 
 		if (not dir.mkpath (dirpath))
-			CriticalError (format (tr ("Couldn't create the directory %1!"), dirpath));
+			Critical (format (tr ("Couldn't create the directory %1!"), dirpath));
 	}
 
 	setNetworkReply (networkManager()->get (QNetworkRequest (QUrl (url))));
@@ -448,7 +448,7 @@
 	if (networkReply()->error() != QNetworkReply::NoError)
 	{
 		if (isPrimary() and not prompt()->isAborted())
-			CriticalError (networkReply()->errorString());
+			Critical (networkReply()->errorString());
 
 		print ("Unable to download %1: %2\n", m_destinaton, networkReply()->errorString());
         setState (State::Failed);
@@ -543,7 +543,7 @@
 
 		if (not filePointer()->open (QIODevice::WriteOnly))
 		{
-			CriticalError (format (tr ("Couldn't open %1 for writing: %2"), filePath(), strerror (errno)));
+			Critical (format (tr ("Couldn't open %1 for writing: %2"), filePath(), strerror (errno)));
             setState (State::Failed);
 			networkReply()->abort();
 			updateToTable();
--- a/src/primitives.cc	Sat Sep 06 23:21:28 2014 +0300
+++ b/src/primitives.cc	Sun Sep 07 01:13:20 2014 +0300
@@ -168,7 +168,7 @@
 		QFile conf (path);
 
 		if (not conf.open (QIODevice::WriteOnly | QIODevice::Text))
-			CriticalError (format ("Couldn't write primitive list %1: %2",
+			Critical (format ("Couldn't write primitive list %1: %2",
 				path, conf.errorString()));
 		else
 		{
@@ -292,7 +292,7 @@
 
 	if (not f.open (QIODevice::ReadOnly))
 	{
-		CriticalError (format (QObject::tr ("Failed to open primitive categories: %1"), f.errorString()));
+		Critical (format (QObject::tr ("Failed to open primitive categories: %1"), f.errorString()));
 		return;
 	}
 

mercurial