From 854766b04d559dd58d15858abb47eba151689e21 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Wed, 19 Aug 2015 15:56:24 -0700 Subject: [PATCH] Only display CIA info if successfully obtained. --- source/ui.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/source/ui.cpp b/source/ui.cpp index f73c6a9..20e007a 100644 --- a/source/ui.cpp +++ b/source/ui.cpp @@ -287,27 +287,27 @@ void uiGetDirContents(std::vector &elements, const std::strin std::string extension = fs::extension(path); if(extension.compare("cia") == 0) { app::App app; - app::ciaInfo(&app, path, fs::SD); + if(app::ciaInfo(&app, path, fs::SD) == app::APP_SUCCESS) { + std::stringstream titleId; + titleId << "0x" << std::setfill('0') << std::setw(16) << std::hex << app.titleId; - std::stringstream titleId; - titleId << "0x" << std::setfill('0') << std::setw(16) << std::hex << app.titleId; + std::stringstream uniqueId; + uniqueId << "0x" << std::setfill('0') << std::setw(8) << std::hex << app.uniqueId; - std::stringstream uniqueId; - uniqueId << "0x" << std::setfill('0') << std::setw(8) << std::hex << app.uniqueId; + std::stringstream version; + version << "0x" << std::setfill('0') << std::hex << app.version; - std::stringstream version; - version << "0x" << std::setfill('0') << std::hex << app.version; + std::stringstream size; + size << "" << app.size << " bytes (" << std::fixed << std::setprecision(2) << app.size / 1024.0f / 1024.0f << "MB)"; - std::stringstream size; - size << "" << app.size << " bytes (" << std::fixed << std::setprecision(2) << app.size / 1024.0f / 1024.0f << "MB)"; - - info.push_back("Installed Size: " + size.str()); - info.push_back("Title ID: " + titleId.str()); - info.push_back("Unique ID: " + uniqueId.str()); - info.push_back("Product Code: " + std::string(app.productCode)); - info.push_back("Platform: " + app::platformString(app.platform)); - info.push_back("Category: " + app::categoryString(app.category)); - info.push_back("Version: " + version.str()); + info.push_back("Installed Size: " + size.str()); + info.push_back("Title ID: " + titleId.str()); + info.push_back("Unique ID: " + uniqueId.str()); + info.push_back("Product Code: " + std::string(app.productCode)); + info.push_back("Platform: " + app::platformString(app.platform)); + info.push_back("Category: " + app::categoryString(app.category)); + info.push_back("Version: " + version.str()); + } } elements.push_back({path, name, info});