Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -166,9 +166,9 @@ void GLCanvas::wheelEvent(QWheelEvent* event) { · 165 unmodified lines | ||
| 166 | 166 | Application::getInstance()->wheelEvent(event); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | −void messageHandler(QtMsgType type, const char* message) { | |
| 170 | − fprintf(stdout, "%s", message); | |
| 171 | − LogDisplay::instance.addMessage(message); | |
| 169 | +void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) { | |
| 170 | + fprintf(stdout, "%s", message.toLocal8Bit().constData()); | |
| 171 | + LogDisplay::instance.addMessage(message.toLocal8Bit().constData()); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | Application::Application(int& argc, char** argv, timeval &startup_time) : |
| @@ -223,7 +223,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 48 unmodified lines | ||
| 223 | 223 | _applicationStartupTime = startup_time; |
| 224 | 224 | _window->setWindowTitle("Interface"); |
| 225 | 225 | |
| 226 | − qInstallMsgHandler(messageHandler); | |
| 226 | + qInstallMessageHandler(messageHandler); | |
| 227 | 227 | |
| 228 | 228 | unsigned int listenPort = 0; // bind to an ephemeral port by default |
| 229 | 229 | const char** constArgv = const_cast<const char**>(argv); |
| @@ -1217,7 +1217,7 @@ void Application::editPreferences() { · 987 unmodified lines | ||
| 1217 | 1217 | |
| 1218 | 1218 | if (domainServerHostname->text().size() > 0) { |
| 1219 | 1219 | // the user input a new hostname, use that |
| 1220 | − newHostname = domainServerHostname->text().toAscii(); | |
| 1220 | + newHostname = domainServerHostname->text().toLocal8Bit(); | |
| 1221 | 1221 | } else { |
| 1222 | 1222 | // the user left the field blank, use the default hostname |
| 1223 | 1223 | newHostname = QByteArray(DEFAULT_DOMAIN_HOSTNAME); |
| @@ -1513,12 +1513,12 @@ bool Application::sendVoxelsOperation(VoxelNode* node, void* extraData) { · 289 unmodified lines | ||
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | void Application::exportVoxels() { |
| 1516 | − QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); | |
| 1516 | + QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); | |
| 1517 | 1517 | QString suggestedName = desktopLocation.append("/voxels.svo"); |
| 1518 | 1518 | |
| 1519 | 1519 | QString fileNameString = QFileDialog::getSaveFileName(_glWidget, tr("Export Voxels"), suggestedName, |
| 1520 | 1520 | tr("Sparse Voxel Octree Files (*.svo)")); |
| 1521 | − QByteArray fileNameAscii = fileNameString.toAscii(); | |
| 1521 | + QByteArray fileNameAscii = fileNameString.toLocal8Bit(); | |
| 1522 | 1522 | const char* fileName = fileNameAscii.data(); |
| 1523 | 1523 | VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s); |
| 1524 | 1524 | if (selectedNode) { |
| @@ -1533,11 +1533,11 @@ void Application::exportVoxels() { · 8 unmodified lines | ||
| 1533 | 1533 | |
| 1534 | 1534 | const char* IMPORT_FILE_TYPES = "Sparse Voxel Octree Files, Square PNG, Schematic Files (*.svo *.png *.schematic)"; |
| 1535 | 1535 | void Application::importVoxelsToClipboard() { |
| 1536 | − QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); | |
| 1536 | + QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); | |
| 1537 | 1537 | QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels to Clipboard"), desktopLocation, |
| 1538 | 1538 | tr(IMPORT_FILE_TYPES)); |
| 1539 | 1539 | |
| 1540 | − QByteArray fileNameAscii = fileNameString.toAscii(); | |
| 1540 | + QByteArray fileNameAscii = fileNameString.toLocal8Bit(); | |
| 1541 | 1541 | const char* fileName = fileNameAscii.data(); |
| 1542 | 1542 | |
| 1543 | 1543 | _clipboardTree.eraseAllVoxels(); |
| @@ -1567,11 +1567,11 @@ void Application::importVoxelsToClipboard() { · 23 unmodified lines | ||
| 1567 | 1567 | } |
| 1568 | 1568 | |
| 1569 | 1569 | void Application::importVoxels() { |
| 1570 | − QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); | |
| 1570 | + QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); | |
| 1571 | 1571 | QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels"), desktopLocation, |
| 1572 | 1572 | tr(IMPORT_FILE_TYPES)); |
| 1573 | 1573 | |
| 1574 | − QByteArray fileNameAscii = fileNameString.toAscii(); | |
| 1574 | + QByteArray fileNameAscii = fileNameString.toLocal8Bit(); | |
| 1575 | 1575 | const char* fileName = fileNameAscii.data(); |
| 1576 | 1576 | |
| 1577 | 1577 | VoxelTree importVoxels; |
| @@ -2005,7 +2005,7 @@ void Application::update(float deltaTime) { · 427 unmodified lines | ||
| 2005 | 2005 | |
| 2006 | 2006 | // Set where I am looking based on my mouse ray (so that other people can see) |
| 2007 | 2007 | glm::vec3 eyePosition; |
| 2008 | − if (_isLookingAtOtherAvatar = isLookingAtOtherAvatar(mouseRayOrigin, mouseRayDirection, eyePosition)) { | |
| 2008 | + if ((_isLookingAtOtherAvatar = isLookingAtOtherAvatar(mouseRayOrigin, mouseRayDirection, eyePosition))) { | |
| 2009 | 2009 | // If the mouse is over another avatar's head... |
| 2010 | 2010 | glm::vec3 myLookAtFromMouse(eyePosition); |
| 2011 | 2011 | _myAvatar.getHead().setLookAtPosition(myLookAtFromMouse); |
| @@ -2270,7 +2270,7 @@ void Application::updateAvatar(float deltaTime) { · 258 unmodified lines | ||
| 2270 | 2270 | _viewFrustum.computePickRay(MIDPOINT_OF_SCREEN, MIDPOINT_OF_SCREEN, screenCenterRayOrigin, screenCenterRayDirection); |
| 2271 | 2271 | |
| 2272 | 2272 | glm::vec3 eyePosition; |
| 2273 | − if (_isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition)) { | |
| 2273 | + if ((_isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition))) { | |
| 2274 | 2274 | glm::vec3 myLookAtFromMouse(eyePosition); |
| 2275 | 2275 | _myAvatar.getHead().setLookAtPosition(myLookAtFromMouse); |
| 2276 | 2276 | } |
| @@ -3584,7 +3584,7 @@ void Application::saveSettings(QSettings* settings) { · 1307 unmodified lines | ||
| 3584 | 3584 | } |
| 3585 | 3585 | |
| 3586 | 3586 | void Application::importSettings() { |
| 3587 | − QString locationDir(QDesktopServices::displayName(QDesktopServices::DesktopLocation)); | |
| 3587 | + QString locationDir(QStandardPaths::displayName(QStandardPaths::DesktopLocation)); | |
| 3588 | 3588 | QString fileName = QFileDialog::getOpenFileName(_window, |
| 3589 | 3589 | tr("Open .ini config file"), |
| 3590 | 3590 | locationDir, |
| @@ -3596,7 +3596,7 @@ void Application::importSettings() { · 5 unmodified lines | ||
| 3596 | 3596 | } |
| 3597 | 3597 | |
| 3598 | 3598 | void Application::exportSettings() { |
| 3599 | − QString locationDir(QDesktopServices::displayName(QDesktopServices::DesktopLocation)); | |
| 3599 | + QString locationDir(QStandardPaths::displayName(QStandardPaths::DesktopLocation)); | |
| 3600 | 3600 | QString fileName = QFileDialog::getSaveFileName(_window, |
| 3601 | 3601 | tr("Save .ini config file"), |
| 3602 | 3602 | locationDir, |