Skip to content

Commit

Permalink
Merge branch 'FreeCAD:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sasobadovinac authored Sep 13, 2024
2 parents eafcbcb + 5d87b26 commit e92a687
Show file tree
Hide file tree
Showing 1,030 changed files with 95,466 additions and 88,986 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/actions/linux/generateCacheKey/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ inputs:
compiler:
description: "Binary name/path of compiler to be used"
required: true
qt_major_version:
description: "Major version number of qt to be used"
required: true
outputs:
cacheKey:
description: "Cache key with distro and compiler version"
Expand All @@ -39,6 +42,6 @@ runs:
- id: generateCacheKey
shell: bash -l {0}
run: |
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)-qt${{ inputs.qt_major_version }}
echo "Generated cache key : $cacheKey"
echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/actions/windows/getCcache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ runs:
id: getCached
with:
path: ${{ inputs.ccachebindir }}
key: ccacheforwin
key: ccacheforwin-${{ inputs.ccacheversion }}
- name: Download ccache
shell: bash
if: steps.getCached.outputs.cache-hit != 'true'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/actions/windows/getLibpack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ inputs:
libpackdownloadurl:
description: "URL where to download libpack"
required: false
default: https://github.com/FreeCAD/FreeCAD-LibPack/releases/download/2.10/LibPack-0.21-V2.10.7z
default: https://github.com/FreeCAD/FreeCAD-LibPack/releases/download/3.0.0RC4/LibPack-1.0.0-v3.0.0RC4-Release.7z
libpackname:
description: "Libpack name (once downloaded)"
required: false
default: LibPack-0.21-V2.10
default: LibPack-1.0.0-v3.0.0RC4-Release

runs:
using: "composite"
Expand All @@ -59,7 +59,7 @@ runs:
id: getCached
with:
path: ${{ inputs.libpackdir }}
key: libpackforwin
key: libpackforwin-${{ inputs.libpackname }}
- name: Download libpack
shell: bash
if: steps.getCached.outputs.cache-hit != 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sub_buildUbuntu2004.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sub_buildUbuntu2204Conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/sub_buildUbuntu2204CondaQt6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 6
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.CCACHE_DIR }}
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}-qt6
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-qt6-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-qt6-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-
- name: Print CCache statistics before build, reset stats and print config
run: |
ccache -s
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/sub_buildWindows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,6 @@ jobs:
-DFREECAD_USE_PCH=OFF
-DFREECAD_RELEASE_PDB=OFF
-DFREECAD_LIBPACK_DIR="${{ env.libpackdir }}"
-DPYTHON_DEBUG_LIBRARY="${{ env.libpackdir }}bin/libs/python38_d.lib"
-DPYTHON_EXECUTABLE="${{ env.libpackdir }}bin/python.exe"
-DPYTHON_INCLUDE_DIR="${{ env.libpackdir }}bin/include"
-DPYTHON_LIBRARY="${{ env.libpackdir }}bin/libs/python38.lib"
-DXercesC_INCLUDE_DIR="${{ env.libpackdir }}include"
-DXercesC_LIBRARY_RELEASE="${{ env.libpackdir }}lib/xerces-c_3.lib"
-DXercesC_LIBRARY_DEBUG="${{ env.libpackdir }}lib/xerces-c_3D.lib"
-DFREECAD_COPY_DEPEND_DIRS_TO_BUILD=ON
-DFREECAD_COPY_LIBPACK_BIN_TO_BUILD=ON
-DFREECAD_COPY_PLUGINS_BIN_TO_BUILD=ON
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ files: |
tests/src|
src/Mod/AddonManager|
src/Mod/Assembly|
src/Mod/CAM|
src/Mod/Cloud|
src/Mod/Drawing|
src/Mod/Fem|
Expand Down
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ endif()

project(FreeCAD)

set(PACKAGE_VERSION_NAME "Vulcan")
set(PACKAGE_VERSION_MAJOR "0")
set(PACKAGE_VERSION_MINOR "22")
set(PACKAGE_VERSION_MAJOR "1")
set(PACKAGE_VERSION_MINOR "0")
set(PACKAGE_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
set(PACKAGE_VERSION_SUFFIX "RC1") # either "dev" for development snapshot or "" (empty string)
set(PACKAGE_BUILD_VERSION "0") # used when the same FreeCAD version will be re-released (for example using an updated LibPack)

set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
Expand Down
6 changes: 4 additions & 2 deletions cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ macro(CompilerChecksAndSetups)
endif()

# Escape the two plus chars as otherwise cmake complains about invalid regex
if(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+20")
if(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+23")
set(CMAKE_CXX_STANDARD 23)
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+20")
set(CMAKE_CXX_STANDARD 20)
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+17")
else()#Enabled C++17
set(CMAKE_CXX_STANDARD 17)
endif()

Expand Down
1 change: 1 addition & 0 deletions conda/environment-qt6.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dependencies:
- xorg-x11-server-xvfb-cos7-aarch64 # [linux and aarch64]
- sed # [unix]
- ccache
- clang-format
- cmake
- coin3d
- compilers
Expand Down
1 change: 1 addition & 0 deletions conda/environment.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dependencies:
- xorg-x11-server-xvfb-cos7-aarch64 # [linux and aarch64]
- sed # [unix]
- ccache
- clang-format
- cmake
- coin3d
- compilers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

// stdlib
#include <exception>
#include <stdexcept>
#include <iterator>
#include <memory>

Expand Down
2 changes: 1 addition & 1 deletion src/3rdParty/OndselSolver
Submodule OndselSolver updated 186 files
6 changes: 5 additions & 1 deletion src/3rdParty/libE57Format/src/CheckedFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#elif defined(__OpenBSD__)
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#elif defined( __APPLE__ )
#include <sys/types.h>
#include <unistd.h>
Expand Down Expand Up @@ -483,7 +487,7 @@ uint64_t CheckedFile::lseek64( int64_t offset, int whence )
#endif
#elif defined( __linux__ )
int64_t result = ::lseek64( fd_, offset, whence );
#elif defined( __APPLE__ )
#elif defined( __APPLE__ ) || defined(__OpenBSD__)
int64_t result = ::lseek( fd_, offset, whence );
#else
#error "no supported OS platform defined"
Expand Down
41 changes: 40 additions & 1 deletion src/App/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3323,7 +3323,46 @@ void Application::ExtractUserPath()
mConfig["UserMacroPath"] = Base::FileInfo::pathToString(macro) + PATHSEP;
}

#if defined (FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_BSD)
// TODO: Consider using this for all UNIX-like OSes
#if defined(__OpenBSD__)
#include <cstdio>
#include <cstdlib>
#include <sys/param.h>
#include <QCoreApplication>

std::string Application::FindHomePath(const char* sCall)
{
// We have three ways to start this application either use one of the two executables or
// import the FreeCAD.so module from a running Python session. In the latter case the
// Python interpreter is already initialized.
std::string absPath;
std::string homePath;
if (Py_IsInitialized()) {
// Note: realpath is known to cause a buffer overflow because it
// expands the given path to an absolute path of unknown length.
// Even setting PATH_MAX does not necessarily solve the problem
// for sure but the risk of overflow is rather small.
char resolved[PATH_MAX];
char* path = realpath(sCall, resolved);
if (path)
absPath = path;
}
else {
int argc = 1;
QCoreApplication app(argc, (char**)(&sCall));
absPath = QCoreApplication::applicationFilePath().toStdString();
}

// should be an absolute path now
std::string::size_type pos = absPath.find_last_of("/");
homePath.assign(absPath,0,pos);
pos = homePath.find_last_of("/");
homePath.assign(homePath,0,pos+1);

return homePath;
}

#elif defined (FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_BSD)
#include <cstdio>
#include <cstdlib>
#include <sys/param.h>
Expand Down
1 change: 1 addition & 0 deletions src/App/Branding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Branding::Branding()
filter.push_back("SplashAlignment");
filter.push_back("SplashTextColor");
filter.push_back("SplashInfoColor");
filter.push_back("SplashWarningColor");

filter.push_back("StartWorkbench");

Expand Down
8 changes: 4 additions & 4 deletions src/App/ComplexGeoData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,10 @@ void ComplexGeoData::readElements(Base::XMLReader& reader, size_t count)
}
}
}
_elementMap->setElementName(IndexedName(reader.getAttribute("value"), types),
MappedName(reader.getAttribute("key")),
Tag,
&sids);
ensureElementMap()->setElementName(IndexedName(reader.getAttribute("value"), types),
MappedName(reader.getAttribute("key")),
Tag,
&sids);
}
if (invalid_count != 0) {
FC_ERR("Found " << invalid_count << " invalid string id"); // NOLINT
Expand Down
18 changes: 18 additions & 0 deletions src/App/Link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2309,6 +2309,24 @@ bool LinkElement::canDelete() const {
return !owner || !owner->getDocument()->getObjectByID(_LinkOwner.getValue());
}

App::Link* LinkElement::getLinkGroup() const
{
std::vector<App::DocumentObject*> inList = getInList();
for (auto* obj : inList) {
auto* link = dynamic_cast<App::Link*>(obj);
if (!link) {
continue;
}
std::vector<App::DocumentObject*> elts = link->ElementList.getValues();
for (auto* elt : elts) {
if (elt == this) {
return link;
}
}
}
return nullptr;
}

//////////////////////////////////////////////////////////////////////////////////////////

namespace App {
Expand Down
2 changes: 2 additions & 0 deletions src/App/Link.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ class AppExport LinkElement : public App::DocumentObject, public App::LinkBaseEx
{
_handleChangedPropertyName(reader,TypeName,PropName);
}

App::Link* getLinkGroup() const;
};

using LinkElementPython = App::FeaturePythonT<LinkElement>;
Expand Down
5 changes: 5 additions & 0 deletions src/App/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ directly. If you did not intend to use a system-defined macro

using namespace App;
namespace fs = boost::filesystem;
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif

namespace MetadataInternal
{
Expand Down
5 changes: 5 additions & 0 deletions src/App/MetadataPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
#include "MetadataPy.cpp"

using namespace Base;
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif

// Returns a string which represents the object e.g. when printed in Python
std::string MetadataPy::representation() const
Expand Down
5 changes: 5 additions & 0 deletions src/App/ProjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
#include <Base/Stream.h>
#include <Base/XMLTools.h>

#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
using namespace App;

namespace {
Expand Down
6 changes: 6 additions & 0 deletions src/App/ProjectFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@
#include <string>
#include <xercesc/util/XercesDefs.hpp>

#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
namespace XERCES_CPP_NAMESPACE { class DOMNode; class DOMElement; class DOMDocument; }
#else
XERCES_CPP_NAMESPACE_BEGIN
class DOMDocument;
class DOMElement;
class DOMNode;
XERCES_CPP_NAMESPACE_END
#endif

namespace App
{
Expand Down
3 changes: 1 addition & 2 deletions src/App/Resources/translations/App_ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<location filename="../../Link.cpp" line="118"/>
<source>Stores the last user choice of whether to apply CopyOnChange setup to all links
that reference the same configurable object</source>
<translation type="unfinished">Stores the last user choice of whether to apply CopyOnChange setup to all links
that reference the same configurable object</translation>
<translation>동일한 물체를 참조하는 모든 연결에 CopyOnChange 설정을 적용할지 사용자의 최종 선택값을 저장</translation>
</message>
</context>
<context>
Expand Down
12 changes: 6 additions & 6 deletions src/App/Resources/translations/App_tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@ uygulanmayacağına ilişkin son kullanıcı seçimini saklar</translation>
<message>
<location filename="../../Origin.cpp" line="142"/>
<source>X-axis</source>
<translation type="unfinished">X-axis</translation>
<translation>X-ekseni</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="143"/>
<source>Y-axis</source>
<translation type="unfinished">Y-axis</translation>
<translation>Y-ekseni</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="144"/>
<source>Z-axis</source>
<translation type="unfinished">Z-axis</translation>
<translation>Z-ekseni</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="145"/>
<source>XY-plane</source>
<translation type="unfinished">XY-plane</translation>
<translation>XY-düzlemi</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="146"/>
<source>XZ-plane</source>
<translation type="unfinished">XZ-plane</translation>
<translation>XZ-düzlemi</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="147"/>
<source>YZ-plane</source>
<translation type="unfinished">YZ-plane</translation>
<translation>YZ-düzlemi</translation>
</message>
</context>
<context>
Expand Down
Loading

0 comments on commit e92a687

Please sign in to comment.