From 079c5682ad5abff5edc404ecbc6c1fdbf87eeecc Mon Sep 17 00:00:00 2001 From: Tardigrade-nx Date: Tue, 6 Jul 2021 22:07:42 +0200 Subject: [PATCH] Disabled 'Size' option on 351ELEC for now. --- Makefile | 2 +- build_RG351.sh | 2 +- src/fileUtils.cpp | 7 +------ src/mainWindow.cpp | 2 ++ src/window.cpp | 1 - 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index ddb0ada..43b9dec 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ endif SRC = $(wildcard src/*.cpp) OBJ = $(patsubst %cpp,%o,$(SRC)) -COMPILER_FLAGS = $(shell $(SDL2_CONFIG) --cflags) -Wall -pedantic -Wfatal-errors -DDEVICE_$(DEVICE) -DSTART_PATH=\"$(START_PATH)\" -DRES_PATH=\"$(RES_PATH)\" +COMPILER_FLAGS = $(shell $(SDL2_CONFIG) --cflags) -Wall -pedantic -Wfatal-errors -DDEVICE_$(DEVICE) -DSTART_PATH=\"$(START_PATH)\" -DRES_PATH=\"$(RES_PATH)\" -DFIRMWARE_$(FIRMWARE) LINKER_FLAGS = $(shell $(SDL2_CONFIG) --libs) -lSDL2_image -lSDL2_ttf all : $(OBJ) diff --git a/build_RG351.sh b/build_RG351.sh index 900ea11..97bfe19 100755 --- a/build_RG351.sh +++ b/build_RG351.sh @@ -15,7 +15,7 @@ build351Files() { START_PATH="$3" RES_PATH="$4" make clean - make CC="$TOOLCHAIN_DIR"/bin/aarch64-libreelec-linux-gnueabi-g++ DEVICE="$DEVICE" SDL2_CONFIG="$TOOLCHAIN_DIR"/aarch64-libreelec-linux-gnueabi/sysroot/usr/bin/sdl2-config START_PATH="$START_PATH" RES_PATH="$RES_PATH" + make CC="$TOOLCHAIN_DIR"/bin/aarch64-libreelec-linux-gnueabi-g++ DEVICE="$DEVICE" SDL2_CONFIG="$TOOLCHAIN_DIR"/aarch64-libreelec-linux-gnueabi/sysroot/usr/bin/sdl2-config START_PATH="$START_PATH" RES_PATH="$RES_PATH" FIRMWARE="$FIRMWARE" mkdir -p build/351Files cp -r 351Files README.md res build/351Files cp launchers/"$FIRMWARE"/351Files.sh build diff --git a/src/fileUtils.cpp b/src/fileUtils.cpp index f3b251f..c56674f 100644 --- a/src/fileUtils.cpp +++ b/src/fileUtils.cpp @@ -320,7 +320,7 @@ void FileUtils::renameFile(const std::string &p_file1, const std::string &p_file unsigned long long int FileUtils::getDirSize(const std::string &p_path) { // Execute command 'du' - std::string l_line = "du -s " + p_path; + std::string l_line = "du -bs " + p_path; char l_buffer[256]; FILE *l_pipe = popen(l_line.c_str(), "r"); if (l_pipe == NULL) @@ -339,10 +339,5 @@ unsigned long long int FileUtils::getDirSize(const std::string &p_path) unsigned long long int l_result = 0; std::istringstream iss(l_line); iss >> l_result; - // Convert to bytes - if (std::getenv("POSIXLY_CORRECT") != NULL) - l_result *= 512; - else - l_result *= 1024; return l_result; } diff --git a/src/mainWindow.cpp b/src/mainWindow.cpp index 2f19251..b6f02d9 100644 --- a/src/mainWindow.cpp +++ b/src/mainWindow.cpp @@ -313,8 +313,10 @@ void MainWindow::openContextMenu(void) l_dialog.addOption("Delete", 3, g_iconTrash); if (nbSelected == 1) l_dialog.addOption("Rename", 9, g_iconEdit); + #ifndef FIRMWARE_351ELEC if (m_fileLister.getNbSelected('d') > 0) l_dialog.addOption("Size", 4, g_iconDisk); + #endif l_dialog.addOption("Select all", 5, g_iconSelect); l_dialog.addOption("Select none", 6, g_iconNone); l_dialog.addOption("New directory", 7, g_iconNewDir); diff --git a/src/window.cpp b/src/window.cpp index 29c6b64..16de41f 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -204,7 +204,6 @@ int IWindow::execute(void) // Render all windows void IWindow::renderAll(void) { - //~ INHIBIT(std::cout << "renderAll - " << g_windows.size() << " windows\n";) if (g_windows.empty()) return; // First window to draw is the last that is fullscreen