From f342bf15af676f08e4fe51590441857311926189 Mon Sep 17 00:00:00 2001 From: Martin Riedel Date: Mon, 10 Jul 2023 15:01:44 -0400 Subject: [PATCH] feat: PR-related cleanup - updated build instructions - added user-agent header to webdav calls - Generalized popDriveNotActive to popRemoteNotActive - Updated version identifier presented in app - Removed some commented code --- Makefile | 2 +- README.MD | 2 +- inc/data.h | 4 ++-- romfs/lang/de.txt | 2 +- romfs/lang/en-GB.txt | 2 +- romfs/lang/en-US.txt | 2 +- romfs/lang/es-419.txt | 2 +- romfs/lang/es.txt | 2 +- romfs/lang/fr-CA.txt | 2 +- romfs/lang/fr.txt | 2 +- romfs/lang/it.txt | 2 +- romfs/lang/ja.txt | 2 +- romfs/lang/ko.txt | 2 +- romfs/lang/nl.txt | 2 +- romfs/lang/pt.txt | 2 +- romfs/lang/ru.txt | 2 +- romfs/lang/zh-CN.txt | 2 +- romfs/lang/zh-TW.txt | 2 +- src/fs/remote.cpp | 2 -- src/ui/fld.cpp | 2 +- src/ui/uistr.cpp | 2 +- src/webdav.cpp | 8 +------- 22 files changed, 22 insertions(+), 30 deletions(-) diff --git a/Makefile b/Makefile index 4f07669..aaea6a5 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ INCLUDES := inc inc/ui inc/fs inc/gfx EXEFS_SRC := exefs_src APP_TITLE := JKSV APP_AUTHOR := JK -APP_VERSION := 02.23.2023 +APP_VERSION := 07.10.2023 ROMFS := romfs ICON := icon.jpg diff --git a/README.MD b/README.MD index 66aa5f5..4766f73 100644 --- a/README.MD +++ b/README.MD @@ -98,7 +98,7 @@ This started as a simple, straight port of my 3DS save manager I publicly releas ## Building: 1. Requires [devkitPro](https://devkitpro.org/) and [libnx](https://github.com/switchbrew/libnx) -2. `dkp-pacman -S switch-curl switch-freetype switch-libjpeg-turbo switch-libjson-c switch-libpng switch-libwebp switch-sdl2 switch-sdl2_gfx switch-sdl2_image switch-zlib` +2. `dkp-pacman -S switch-curl switch-freetype switch-libjpeg-turbo switch-tinyxml2 switch-libjson-c switch-libpng switch-libwebp switch-sdl2 switch-sdl2_gfx switch-sdl2_image switch-zlib` ## Credits and Thanks: * [shared-font](https://github.com/switchbrew/switch-portlibs-examples) example by yellows8 for loading system font with Freetype. All other font handling code (converting to SDL2, resizing on the fly, checking for glyphs, cache, etc) is my own. diff --git a/inc/data.h b/inc/data.h index 5b871d6..603cde1 100644 --- a/inc/data.h +++ b/inc/data.h @@ -7,8 +7,8 @@ #include "gfx.h" -#define BLD_MON 02 -#define BLD_DAY 23 +#define BLD_MON 07 +#define BLD_DAY 10 #define BLD_YEAR 2023 namespace data diff --git a/romfs/lang/de.txt b/romfs/lang/de.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/de.txt +++ b/romfs/lang/de.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/en-GB.txt b/romfs/lang/en-GB.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/en-GB.txt +++ b/romfs/lang/en-GB.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/en-US.txt b/romfs/lang/en-US.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/en-US.txt +++ b/romfs/lang/en-US.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/es-419.txt b/romfs/lang/es-419.txt index df0b6bf..6f13cc5 100644 --- a/romfs/lang/es-419.txt +++ b/romfs/lang/es-419.txt @@ -84,7 +84,7 @@ popChangeOutputFolder = 0, "Se cambia #%s# por #%s#" #CHANGED=============================================> popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/es.txt b/romfs/lang/es.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/es.txt +++ b/romfs/lang/es.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/fr-CA.txt b/romfs/lang/fr-CA.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/fr-CA.txt +++ b/romfs/lang/fr-CA.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/fr.txt b/romfs/lang/fr.txt index 337d021..51a2121 100644 --- a/romfs/lang/fr.txt +++ b/romfs/lang/fr.txt @@ -66,7 +66,7 @@ popCPUBoostEnabled = 0, "CPU Boost activé pour les ZIP." popChangeOutputError = 0, "#%s# contient des caractères incorrects ou non-ASCII." popChangeOutputFolder = 0, "#%s# modifié en #%s#" popDriveFailed = 0, "Echec du démarrage de Google Drive." -popDriveNotActive = 0, "Google Drive n'est pas utilisable" +popRemoteNotActive = 0, "Remote n'est pas utilisable" popDriveStarted = 0, "Google Drive lancé avec succès." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/it.txt b/romfs/lang/it.txt index f5fdb11..a4a1400 100644 --- a/romfs/lang/it.txt +++ b/romfs/lang/it.txt @@ -66,7 +66,7 @@ popCPUBoostEnabled = 0, "CPU Boost Abilitato per ZIP." popChangeOutputError = 0, "#%s# contiene caratteri illeciti o non-ASCII." popChangeOutputFolder = 0, "#%s# cambiato in #%s#" popDriveFailed = 0, "Impossibile avviare Google Drive." -popDriveNotActive = 0, "Google Drive non è Disponibile" +popRemoteNotActive = 0, "Remote non è Disponibile" popDriveStarted = 0, "Google Drive avviato con successo." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/ja.txt b/romfs/lang/ja.txt index 4cfbf19..31641d3 100644 --- a/romfs/lang/ja.txt +++ b/romfs/lang/ja.txt @@ -84,7 +84,7 @@ popChangeOutputFolder = 0, "#%s# から #%s# に変更" #CHANGED=============================================> popDriveFailed = 0, "Google Driveの起動に失敗しました。" -popDriveNotActive = 0, "Googleドライブは使用できません" +popRemoteNotActive = 0, "Remoteドライブは使用できません" popDriveStarted = 0, "Google Driveが正常に起動しました。" popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/ko.txt b/romfs/lang/ko.txt index 5e7408e..f7b5d27 100644 --- a/romfs/lang/ko.txt +++ b/romfs/lang/ko.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "ZIP를 위한 CPU 부스트가 활성화되었습니다 popChangeOutputError = 0, "#%s#에 잘못된 또는 ASCII가 아닌 문자가 포함되어 있습니다." popChangeOutputFolder = 0, "#%s#이(가) #%s#로 변경되었습니다." popDriveFailed = 0, "구글 드라이브 시작에 실패했습니다." -popDriveNotActive = 0, "구글 드라이브를 사용할 수 없습니다." +popRemoteNotActive = 0, "구글 드라이브를 사용할 수 없습니다." popDriveStarted = 0, "구글 드라이브가 성공적으로 시작되었습니다." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/nl.txt b/romfs/lang/nl.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/nl.txt +++ b/romfs/lang/nl.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/pt.txt b/romfs/lang/pt.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/pt.txt +++ b/romfs/lang/pt.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/ru.txt b/romfs/lang/ru.txt index f5cdee6..090e6ee 100644 --- a/romfs/lang/ru.txt +++ b/romfs/lang/ru.txt @@ -67,7 +67,7 @@ popCPUBoostEnabled = 0, "CPU Boost Enabled for ZIP." popChangeOutputError = 0, "#%s# contains illegal or non-ASCII characters." popChangeOutputFolder = 0, "#%s# changed to #%s#" popDriveFailed = 0, "Failed to start Google Drive." -popDriveNotActive = 0, "Google Drive is not available" +popRemoteNotActive = 0, "Remote is not available" popDriveStarted = 0, "Google Drive started successfully." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/zh-CN.txt b/romfs/lang/zh-CN.txt index b6c3cda..bcf2353 100644 --- a/romfs/lang/zh-CN.txt +++ b/romfs/lang/zh-CN.txt @@ -66,7 +66,7 @@ popCPUBoostEnabled = 0, "为ZIP压缩启用CPU超频。" popChangeOutputError = 0, "#%s#包含非法或者非ASCII的字符。" popChangeOutputFolder = 0, "#%s#更改到#%s#" popDriveFailed = 0, "Google Drive启动失败。" -popDriveNotActive = 0, "Google Drive不可用。" +popRemoteNotActive = 0, "Remote不可用。" popDriveStarted = 0, "Google Drive启动成功。" popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/romfs/lang/zh-TW.txt b/romfs/lang/zh-TW.txt index 214850b..3404cb4 100644 --- a/romfs/lang/zh-TW.txt +++ b/romfs/lang/zh-TW.txt @@ -66,7 +66,7 @@ popCPUBoostEnabled = 0, "壓縮ZIP時將啟用CPU超頻." popChangeOutputError = 0, "#%s# 包含非法或者非ASCII字元." popChangeOutputFolder = 0, "#%s# 更改到 #%s#" popDriveFailed = 0, "無法啟用Google雲端硬碟." -popDriveNotActive = 0, "沒有可用的Google雲端硬碟." +popRemoteNotActive = 0, "沒有可用的Remote雲端硬碟." popDriveStarted = 0, "Google雲端硬碟已正確啟用." popWebdavStarted = 0, "Webdav started successfully." popWebdavFailed =, 0, "Failed to start Webdav." diff --git a/src/fs/remote.cpp b/src/fs/remote.cpp index 3c2d473..1e0bef2 100644 --- a/src/fs/remote.cpp +++ b/src/fs/remote.cpp @@ -129,8 +129,6 @@ void fs::webDavInit() { } } -// webdav->listInit(rfsRootID); - rfs = webdav; ui::showPopMessage(POP_FRAME_DEFAULT, ui::getUICString("popWebdavStarted", 0)); } \ No newline at end of file diff --git a/src/ui/fld.cpp b/src/ui/fld.cpp index 71424ef..9aa3406 100644 --- a/src/ui/fld.cpp +++ b/src/ui/fld.cpp @@ -155,7 +155,7 @@ static void fldFuncUpload(void *a) if(fs::rfs) ui::newThread(fldFuncUpload_t, a, NULL); else - ui::showPopMessage(POP_FRAME_DEFAULT, ui::getUICString("popDriveNotActive", 0)); + ui::showPopMessage(POP_FRAME_DEFAULT, ui::getUICString("popRemoteNotActive", 0)); } static void fldFuncDownload_t(void *a) diff --git a/src/ui/uistr.cpp b/src/ui/uistr.cpp index 9feb86e..1da1748 100644 --- a/src/ui/uistr.cpp +++ b/src/ui/uistr.cpp @@ -287,7 +287,7 @@ void ui::initStrings() addUIString("popSVIExported", 0, "SVI Exported."); addUIString("popDriveStarted", 0, "Google Drive started successfully."); addUIString("popDriveFailed", 0, "Failed to start Google Drive."); - addUIString("popDriveNotActive", 0, "Google Drive is not available"); + addUIString("popRemoteNotActive", 0, "Remote is not available"); addUIString("popWebdavStarted", 0, "Webdav started successfully."); addUIString("popWebdavFailed", 0, "Failed to start Webdav."); diff --git a/src/webdav.cpp b/src/webdav.cpp index 3e878f1..151497e 100644 --- a/src/webdav.cpp +++ b/src/webdav.cpp @@ -7,6 +7,7 @@ rfs::WebDav::WebDav(const std::string& origin, const std::string& username, cons { curl = curl_easy_init(); if (curl) { + curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT); if (!username.empty()) curl_easy_setopt(curl, CURLOPT_USERNAME, username.c_str()); @@ -300,13 +301,6 @@ std::vector rfs::WebDav::parseXMLResponse(const std::string& xml) continue; // do not push parent to list (we are only interested in the children) } -// fs::logWrite("WebDav: Adding %s with\n", item.name.c_str()); -// fs::logWrite("WebDav: ID: %s\n", item.id.c_str()); -// fs::logWrite("WebDav: ParentID: %s\n", item.parent.c_str()); -// fs::logWrite("WebDav: Directory?: %s\n", item.isDir ? "yes" : "no"); -// fs::logWrite("WebDav: Size: %u\n", item.size); - - items.push_back(item); }