diff options
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); } } |
