From e3c0784bef84cb6c4d185f0ecf97610a86a96ead Mon Sep 17 00:00:00 2001 From: dborth Date: Tue, 16 Jun 2009 08:38:26 +0000 Subject: [PATCH] improve 7z error messages, minor bugfixes --- source/ngc/gcunzip.cpp | 22 ++++++++++++---------- source/ngc/networkop.cpp | 4 +++- source/ngc/oggplayer.c | 1 + source/ngc/preferences.cpp | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/source/ngc/gcunzip.cpp b/source/ngc/gcunzip.cpp index 52dcecd..c370b39 100644 --- a/source/ngc/gcunzip.cpp +++ b/source/ngc/gcunzip.cpp @@ -266,15 +266,15 @@ typedef struct _SzFileInStream } SzFileInStream; // 7zip error list -static char szerrormsg[][30] = { - "7z: Data error", - "7z: Out of memory", - "7z: CRC Error", - "7z: Not implemented", - "7z: Fail", - "7z: Data read failure", - "7z: Archive error", - "7z: Dictionary too large", +static char szerrormsg[][50] = { + "File is corrupt.", // 7z: Data error + "Archive contains too many files.", // 7z: Out of memory + "File is corrupt (CRC mismatch).", // 7z: CRC Error + "File uses unsupported compression settings.", // 7z: Not implemented + "File is corrupt.", // 7z: Fail + "Failed to read file data.", // 7z: Data read failure + "File is corrupt.", // 7z: Archive error + "File uses too high of compression settings.", // 7z: Dictionary too large }; static SZ_RESULT SzRes; @@ -316,7 +316,9 @@ Is7ZipFile (char *buffer) // display an error message static void SzDisplayError(SZ_RESULT res) { - ErrorPrompt(szerrormsg[(res - 1)]); + char msg[1024]; + sprintf(msg, "7z decompression failed: %s", szerrormsg[(res - 1)]); + ErrorPrompt(msg); } // function used by the 7zip SDK to read data from SD/USB/DVD/SMB diff --git a/source/ngc/networkop.cpp b/source/ngc/networkop.cpp index 2da73a9..df81cab 100644 --- a/source/ngc/networkop.cpp +++ b/source/ngc/networkop.cpp @@ -281,7 +281,6 @@ ConnectShare (bool silent) GCSettings.smbshare, GCSettings.smbip)) { networkShareInit = true; - sprintf(rootdir, "smb:"); } if(!silent) @@ -292,6 +291,9 @@ ConnectShare (bool silent) ErrorPrompt("Failed to connect to network share."); } + if(networkShareInit) + sprintf(rootdir, "smb:"); + return networkShareInit; } diff --git a/source/ngc/oggplayer.c b/source/ngc/oggplayer.c index a84a17f..f5ff0f6 100644 --- a/source/ngc/oggplayer.c +++ b/source/ngc/oggplayer.c @@ -30,6 +30,7 @@ #include "oggplayer.h" #include +#include /* OGG control */ diff --git a/source/ngc/preferences.cpp b/source/ngc/preferences.cpp index a041ba9..3e392e2 100644 --- a/source/ngc/preferences.cpp +++ b/source/ngc/preferences.cpp @@ -342,7 +342,7 @@ SavePrefs (bool silent) // We'll save using the first available method (probably SD) since this // is the method preferences will be loaded from by default if(method == METHOD_AUTO) - autoSaveMethod(silent); + method = autoSaveMethod(silent); if(method == METHOD_AUTO) return false;