# HG changeset patch # User Teemu Piippo # Date 1410041600 -10800 # Node ID 2f3cc8e045d5ad8170985f018fb5c8ff9faa8d45 # Parent 82a9c3549db1b2fba30f1086b9a7e13a3a5d7535 - fixed compilation on windows diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/actions.cc --- 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; } diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/addObjectDialog.cc --- 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; } diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/crashCatcher.cc --- 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 ( "

File: %1
" "Line: %2
" "Function: %3

" diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/extPrograms.cc --- 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; } diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/glRenderer.cc --- 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; diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/ldConfig.cc --- 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; } diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/ldDocument.cc --- 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; diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/ldObject.cc --- 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(); diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/main.cc --- 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(); diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/mainWindow.cc --- 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); diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/mainWindow.h --- 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); diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/partDownloader.cc --- 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(); diff -r 82a9c3549db1 -r 2f3cc8e045d5 src/primitives.cc --- 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; }