Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_suite_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
export JAVA_HOME=/usr/lib/jvm/java-${{ matrix.JAVA_VERSION }}-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export LIBGL_ALWAYS_SOFTWARE=true
xvfb-run --auto-servernum make distrib -j4
xvfb-run --auto-servernum make debug -j4
- name: Create/Update GitHub release
if: ${{ matrix.os == 'ubuntu-22.04' && (github.event_name == 'push' || github.event_name == 'schedule') }}
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test_suite_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
matrix:
os: [macos-13]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +33,7 @@ jobs:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'test distribution') || contains(github.event.pull_request.labels.*.name, 'test suite') }}
strategy:
matrix:
os: [macos-13]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -53,7 +53,7 @@ jobs:
run: |
export JAVA_HOME="$(/usr/libexec/java_home -v 16)"
export PATH=/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin/:$PATH
make distrib -j4
make debug -j4
- name: Create/Update GitHub release
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule') }}
run: |
Expand All @@ -70,7 +70,7 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite mac') }}
strategy:
matrix:
os: [macos-13]
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }}
strategy:
matrix:
os: [macos-13]
os: [macos-14]
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_suite_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Webots Package Creation
run: |
export WEBOTS_HOME=$GITHUB_WORKSPACE
make distrib -j4
make debug -j4
- name: Create/Update GitHub release
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule') }}
run: |
Expand Down
7 changes: 6 additions & 1 deletion resources/translations/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1996-2024 Cyberbotics Ltd.
# Copyright 1996-2026 Cyberbotics Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,9 +37,14 @@ include $(WEBOTS_HOME_PATH)/resources/Makefile.os.include
WEBOTS_SRC_PATH = $(WEBOTS_HOME_PATH)/src/webots

ifeq ($(OSTYPE),windows)
ifdef CI
LUPDATE = lupdate-qt6
LRELEASE = lrelease-qt6
else
LUPDATE = lupdate
LRELEASE = lrelease
endif
else
QT_BINARIES_PATH = $(WEBOTS_HOME_PATH)/bin/qt

ifeq ($(OSTYPE),linux)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/msys64_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare -a BASE_PACKAGES=(
"zip" # robotbenchmark square path
"mingw-w64-x86_64-qt6-base" # Webots
"mingw-w64-x86_64-qt6-declarative" # Webots
"mingw-w64-x86_64-qt6-tools" # Webots (translation: lrelease-qt6 and lupdate-qt6)
"mingw-w64-x86_64-qt6-tools" # Webots (translation: lrelease and lupdate)
"mingw-w64-x86_64-qt6-translations" # Webots
"mingw-w64-x86_64-qt6-websockets" # Webots
"mingw-w64-x86_64-libzip" # Webots
Expand Down
7 changes: 7 additions & 0 deletions scripts/packaging/webots.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@
<url>https://cyberbotics.com/doc/reference/changelog-r2025</url>
</release>
</releases>
<keywords>
<keyword>robot simulator</keyword>
<keyword>robot development</keyword>
<keyword>robotics education</keyword>
<keyword>open source robotics</keyword>
<keyword>simulation software</keyword>
</keywords>
</component>
3 changes: 2 additions & 1 deletion src/webots/app/WbApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ void WbApplication::loadWorld(QString worldName, bool reloading, bool isLoadingA
emit preWorldLoaded(reloading);
// create a file in tmp path for ipc extern controllers
QFile loading_file(WbStandardPaths::webotsTmpPath() + "loading");
loading_file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
if (!loading_file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
WbLog::warning(tr("Could not create loading signal file: '%1'.").arg(loading_file.fileName()));

bool isFirstLoad = (mWorld == NULL);
delete mWorld;
Expand Down
5 changes: 4 additions & 1 deletion src/webots/core/WbIniParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ WbIniParser::WbIniParser(const QString &filename) {
QFile file(filename);
QString line;
QString section;
file.open(QIODevice::ReadOnly);
if (!file.open(QIODevice::ReadOnly)) {
mValid = false;
return;
}
mValid = true;
while (!file.atEnd()) {
line = file.readLine();
Expand Down
27 changes: 14 additions & 13 deletions src/webots/gui/WbGuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,25 +565,26 @@ static void setDarkTitlebar(HWND hwnd) {
void WbGuiApplication::updateStyleSheet() {
mThemeLoaded = WbPreferences::instance()->value("General/theme").toString();
QFile qssFile(WbStandardPaths::resourcesPath() + mThemeLoaded);
qssFile.open(QFile::ReadOnly);
QString styleSheet = QString::fromUtf8(qssFile.readAll());
QString styleSheet;
if (qssFile.open(QFile::ReadOnly))
styleSheet = QString::fromUtf8(qssFile.readAll());
else
WbLog::warning(tr("Could not open theme file: '%1'.").arg(qssFile.fileName()));

#ifdef __APPLE__
QFile macOSQssFile(WbStandardPaths::resourcesPath() + "stylesheet.macos.qss");
macOSQssFile.open(QFile::ReadOnly);
styleSheet += QString::fromUtf8(macOSQssFile.readAll());

const QString platformStylesheet = "stylesheet.macos.qss";
#elif defined(__linux__)
QFile linuxQssFile(WbStandardPaths::resourcesPath() + "stylesheet.linux.qss");
linuxQssFile.open(QFile::ReadOnly);
styleSheet += QString::fromUtf8(linuxQssFile.readAll());

const QString platformStylesheet = "stylesheet.linux.qss";
#elif _WIN32
QFile windowsQssFile(WbStandardPaths::resourcesPath() + "stylesheet.windows.qss");
windowsQssFile.open(QFile::ReadOnly);
styleSheet += QString::fromUtf8(windowsQssFile.readAll());
const QString platformStylesheet = "stylesheet.windows.qss";
#endif

QFile platformQssFile(WbStandardPaths::resourcesPath() + platformStylesheet);
if (platformQssFile.open(QFile::ReadOnly))
styleSheet += QString::fromUtf8(platformQssFile.readAll());
else
WbLog::warning(tr("Could not open stylesheet file: '%1'.").arg(platformQssFile.fileName()));

qApp->setStyleSheet(styleSheet);
#ifdef _WIN32
if (mThemeLoaded != "webots_classic.qss")
Expand Down
5 changes: 4 additions & 1 deletion src/webots/gui/WbMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2432,7 +2432,10 @@ void WbMainWindow::openFileInTextEditor(const QString &fileName, bool modify, bo
const QString webotsRepo = fileName.mid(0, index);

QFile localFile(fileToOpen);
localFile.open(QIODevice::ReadWrite);
if (!localFile.open(QIODevice::ReadWrite)) {
WbLog::error(tr("Could not open file for editing: '%1'.").arg(fileToOpen));
return;
}
const QString contents = QString(localFile.readAll());
QStringList lines = contents.split('\n');
for (QString &line : lines) {
Expand Down
6 changes: 5 additions & 1 deletion src/webots/gui/WbNewWorldWizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "WbApplicationInfo.hpp"
#include "WbFileUtil.hpp"
#include "WbLineEdit.hpp"
#include "WbLog.hpp"
#include "WbMessageBox.hpp"
#include "WbPreferences.hpp"
#include "WbProject.hpp"
Expand Down Expand Up @@ -49,7 +50,10 @@ int WbNewWorldWizard::exec() {

void WbNewWorldWizard::createWorldFile() {
QFile file(WbProject::current()->worldsPath() + fileName());
file.open(QIODevice::WriteOnly);
if (!file.open(QIODevice::WriteOnly)) {
WbLog::error(tr("Could not create world file: '%1'.").arg(file.fileName()));
return;
}
QByteArray worldContent;
worldContent.append(QString("#VRML_SIM %1 utf8\n").arg(WbApplicationInfo::version().toString(false)).toUtf8());
QStringList externProtoList;
Expand Down
5 changes: 2 additions & 3 deletions src/webots/nodes/WbBackground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,11 @@ void WbBackground::applySkyBoxToWren() {
} else { // otherwise, use a small uniform texture with the color of the sky
cm = wr_texture_cubemap_new();
size = 2;
const int size2 = size * size;
wr_texture_set_internal_format(WR_TEXTURE(cm), WR_TEXTURE_INTERNAL_FORMAT_RGBA8);
unsigned int data[size2];
unsigned int data[4];
const WbRgb &c = skyColor();
unsigned int color = c.redByte() * 0x10000 + c.greenByte() * 0x100 + c.blueByte();
for (int i = 0; i < size2; i++)
for (int i = 0; i < 4; i++)
data[i] = color;
for (int i = 0; i < 6; i++)
wr_texture_cubemap_set_data(cm, reinterpret_cast<const char *>(data), static_cast<WrTextureOrientation>(i));
Expand Down
5 changes: 4 additions & 1 deletion src/webots/scene_tree/WbSceneTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,10 @@ void WbSceneTree::openTemplateInstanceInTextEditor() {
tmpDir.mkdir(generatedProtos);
QFile file(
QString("%1%2/%3.generated_proto").arg(WbStandardPaths::webotsTmpPath()).arg(generatedProtos).arg(node->proto()->name()));
file.open(QIODevice::WriteOnly | QIODevice::Text);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
WbLog::error(tr("Could not create temporary file: '%1'.").arg(file.fileName()));
return;
}
file.write(node->protoInstanceTemplateContent());
file.close();
if (!file.fileName().isEmpty())
Expand Down
10 changes: 8 additions & 2 deletions src/webots/sound/WbWaveFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "WbWaveFile.hpp"

#include "WbLog.hpp"
#include "WbStandardPaths.hpp"

#include <QtCore/QDir>
Expand Down Expand Up @@ -187,7 +188,11 @@ void WbWaveFile::loadConvertedFile(int side) {
void WbWaveFile::loadConvertedFile(int side, const QString &filename) {
assert(mDevice == NULL);
mDevice = new QFile(filename);
mDevice->open(QIODevice::ReadOnly);
if (!mDevice->open(QIODevice::ReadOnly)) {
delete mDevice;
mDevice = NULL;
throw QObject::tr("Could not open audio device: '%1'.").arg(filename);
}
loadConvertedFile(side);
mDevice->close();
delete mDevice;
Expand Down Expand Up @@ -216,7 +221,8 @@ void WbWaveFile::loadFromFile(const QString &extension, int side) {
if (mDevice) {
inputFilename = WbStandardPaths::webotsTmpPath() + "input." + extension;
QFile input(inputFilename);
input.open(QFile::WriteOnly);
if (!input.open(QFile::WriteOnly))
throw QObject::tr("Could not create temporary audio file: '%1'.").arg(inputFilename);
input.write(mDevice->readAll());
input.close();
} else
Expand Down
Loading