diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-04-08 03:30:04 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-04-08 03:30:04 -0500 |
| commit | 3de4056df4ea5d0afbcea388ad8d681daea1aac3 (patch) | |
| tree | fc5978451f9f51b84268f45bd2fa6f5d4a17baaf /libs/uibase/src | |
| parent | 5ba23a6d7a40052d9e1d4bd0cf018cfe7814d03a (diff) | |
Remove NaK/Rust dependency, port remaining functionality to native C++
Replace NaK Rust crate and nak_ffi with native C++ implementations:
- Game detection (Steam, Heroic, Bottles), VDF parser, icon extraction
- Prefix symlinks, SLR manager, Steam path detection
- Known games database
Add FUSE VFS optimizations: zero-copy reads via fuse_reply_data,
default_permissions mount option, FUSE_CAP_ASYNC_DIO, FUSE_CAP_EXPIRE_ONLY,
lookup cache parent index, cached mode bits, increased I/O buffer sizes.
Update build system, prefix setup, and various fixes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'libs/uibase/src')
| -rw-r--r-- | libs/uibase/src/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | libs/uibase/src/utility.cpp | 12 |
2 files changed, 18 insertions, 10 deletions
diff --git a/libs/uibase/src/CMakeLists.txt b/libs/uibase/src/CMakeLists.txt index 3015be3..5660289 100644 --- a/libs/uibase/src/CMakeLists.txt +++ b/libs/uibase/src/CMakeLists.txt @@ -187,8 +187,20 @@ target_link_libraries(uibase PUBLIC Qt6::Widgets Qt6::Network Qt6::QuickWidgets PRIVATE spdlog::spdlog_header_only Qt6::Qml Qt6::Quick) -if(NOT WIN32 AND TARGET mo2::nak_ffi) - target_link_libraries(uibase PRIVATE mo2::nak_ffi) +if(NOT WIN32) + # Native C++ ports of game detection, Steam/Proton detection, SLR management, + # icon extraction, and prefix symlinks (formerly in Rust nak_ffi). + # Use BUILD_INTERFACE to avoid "prefixed in the source directory" CMake error. + target_include_directories(uibase + PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/src>) + target_sources(uibase PRIVATE + ${CMAKE_SOURCE_DIR}/src/src/gamedetection.cpp + ${CMAKE_SOURCE_DIR}/src/src/steamdetection.cpp + ${CMAKE_SOURCE_DIR}/src/src/vdfparser.cpp + ${CMAKE_SOURCE_DIR}/src/src/iconextractor.cpp + ${CMAKE_SOURCE_DIR}/src/src/prefixsymlinks.cpp + ${CMAKE_SOURCE_DIR}/src/src/slrmanager.cpp + ) endif() # installation diff --git a/libs/uibase/src/utility.cpp b/libs/uibase/src/utility.cpp index e6811af..94cbc77 100644 --- a/libs/uibase/src/utility.cpp +++ b/libs/uibase/src/utility.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <uibase/log.h> #include <uibase/report.h> #ifndef _WIN32 -#include <nak_ffi.h> +#include "iconextractor.h" #endif #include <QApplication> #include <QBuffer> @@ -946,15 +946,12 @@ QIcon iconForExecutable(const QString& filePath) cache.insert(cacheKey, icon); return icon; #else - // Extract icon from PE executable via NaK (pelite-based, no external tools). + // Extract icon from PE executable (native C++ parser, no external tools). QIcon icon; { - const QByteArray pathUtf8 = fi.absoluteFilePath().toUtf8(); - NakIconData icoData = nak_extract_exe_icon(pathUtf8.constData()); - if (icoData.data && icoData.len > 0) { - QByteArray ba(reinterpret_cast<const char*>(icoData.data), - static_cast<qsizetype>(icoData.len)); + QByteArray ba = extractExeIcon(fi.absoluteFilePath()); + if (!ba.isEmpty()) { QBuffer buf(&ba); buf.open(QIODevice::ReadOnly); QImageReader reader(&buf, "ico"); @@ -978,7 +975,6 @@ QIcon iconForExecutable(const QString& filePath) } } } - nak_icon_data_free(icoData); } } |
