[Scummvm-cvs-logs] scummvm master -> b2a1566860ee21cd4bfe7f26ee43f80927fc677a

fuzzie fuzzie at fuzzie.org
Mon Jun 6 12:34:34 CEST 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6842227ac2 COMMON: Add kInfo LogMessageType.
b2a1566860 DETECTOR: Change printf calls to use logMessage.


Commit: 6842227ac2796edb6d82cbf0095c806fa6e738f6
    https://github.com/scummvm/scummvm/commit/6842227ac2796edb6d82cbf0095c806fa6e738f6
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-06-06T03:26:01-07:00

Commit Message:
COMMON: Add kInfo LogMessageType.

Changed paths:
    backends/platform/android/android.cpp
    common/system.cpp
    common/system.h



diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 5ae0239..bb20184 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -575,6 +575,10 @@ void OSystem_Android::addSysArchivesToSearchSet(Common::SearchSet &s,
 void OSystem_Android::logMessage(LogMessageType::Type type,
 									const char *message) {
 	switch (type) {
+	case LogMessageType::kInfo:
+		__android_log_write(ANDROID_LOG_INFO, android_log_tag, message);
+		break;
+
 	case LogMessageType::kDebug:
 		__android_log_write(ANDROID_LOG_DEBUG, android_log_tag, message);
 		break;
diff --git a/common/system.cpp b/common/system.cpp
index 1f2f8cc..34fc076 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -79,7 +79,7 @@ void OSystem::fatalError() {
 void OSystem::logMessage(LogMessageType::Type type, const char *message) {
 	FILE *output = 0;
 
-	if (type == LogMessageType::kDebug)
+	if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
 		output = stdout;
 	else
 		output = stderr;
diff --git a/common/system.h b/common/system.h
index b7fc870..243343c 100644
--- a/common/system.h
+++ b/common/system.h
@@ -73,6 +73,7 @@ struct TimeDate {
 namespace LogMessageType {
 
 enum Type {
+	kInfo,
 	kError,
 	kWarning,
 	kDebug


Commit: b2a1566860ee21cd4bfe7f26ee43f80927fc677a
    https://github.com/scummvm/scummvm/commit/b2a1566860ee21cd4bfe7f26ee43f80927fc677a
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-06-06T03:32:09-07:00

Commit Message:
DETECTOR: Change printf calls to use logMessage.

Also make the strings translatable.

Changed paths:
    engines/advancedDetector.cpp
    po/POTFILES
    po/scummvm.pot



diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index d093c95..2ee32b2 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -20,9 +20,6 @@
  *
  */
 
-// FIXME: Avoid using printf
-#define FORBIDDEN_SYMBOL_EXCEPTION_printf
-
 #include "common/debug.h"
 #include "common/util.h"
 #include "common/hash-str.h"
@@ -30,7 +27,9 @@
 #include "common/macresman.h"
 #include "common/md5.h"
 #include "common/config-manager.h"
+#include "common/system.h"
 #include "common/textconsole.h"
+#include "common/translation.h"
 
 #include "engines/advancedDetector.h"
 
@@ -366,14 +365,18 @@ static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSiz
 	//
 	// Might also be helpful to display the full path (for when this is used
 	// from the mass detector).
-	printf("The game in '%s' seems to be unknown.\n", path.getPath().c_str());
-	printf("Please, report the following data to the ScummVM team along with name\n");
-	printf("of the game you tried to add and its version/language/etc.:\n");
+	Common::String report = Common::String::format(_("The game in '%s' seems to be unknown."), path.getPath().c_str()) + "\n";
+	report += _("Please, report the following data to the ScummVM team along with name");
+	report += "\n";
+	report += _("of the game you tried to add and its version/language/etc.:");
+	report += "\n";
 
 	for (SizeMD5Map::const_iterator file = filesSizeMD5.begin(); file != filesSizeMD5.end(); ++file)
-		printf("  {\"%s\", 0, \"%s\", %d},\n", file->_key.c_str(), file->_value.md5.c_str(), file->_value.size);
+		report += Common::String::format("  {\"%s\", 0, \"%s\", %d},\n", file->_key.c_str(), file->_value.md5.c_str(), file->_value.size);
+
+	report += "\n";
 
-	printf("\n");
+	g_system->logMessage(LogMessageType::kInfo, report.c_str());
 }
 
 static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams &params);
@@ -626,10 +629,14 @@ static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParam
 	if (matchedDesc) { // We got a match
 		matched.push_back(matchedDesc);
 		if (params.flags & kADFlagPrintWarningOnFileBasedFallback) {
-			printf("Your game version has been detected using filename matching as a\n");
-			printf("variant of %s.\n", matchedDesc->gameid);
-			printf("If this is an original and unmodified version, please report any\n");
-			printf("information previously printed by ScummVM to the team.\n");
+			Common::String report = Common::String::format(_("Your game version has been detected using "
+				"filename matching as a variant of %s."), matchedDesc->gameid);
+			report += "\n";
+			report += _("If this is an original and unmodified version, please report any");
+			report += "\n";
+			report += _("information previously printed by ScummVM to the team.");
+			report += "\n";
+			g_system->logMessage(LogMessageType::kInfo, report.c_str());
 		}
 	}
 
diff --git a/po/POTFILES b/po/POTFILES
index b2fa545..fc14daf 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -19,6 +19,7 @@ base/main.cpp
 common/error.cpp
 common/util.cpp
 
+engines/advancedDetector.cpp
 engines/dialogs.cpp
 engines/scumm/dialogs.cpp
 engines/scumm/help.cpp
diff --git a/po/scummvm.pot b/po/scummvm.pot
index ec87aed..ff41b69 100644
--- a/po/scummvm.pot
+++ b/po/scummvm.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ScummVM 1.4.0git\n"
 "Report-Msgid-Bugs-To: scummvm-devel at lists.sf.net\n"
-"POT-Creation-Date: 2011-06-06 11:59+0200\n"
+"POT-Creation-Date: 2011-06-06 12:30+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -1074,6 +1074,34 @@ msgctxt "lowres"
 msgid "Hercules Amber"
 msgstr ""
 
+#: engines/advancedDetector.cpp:368
+#, c-format
+msgid "The game in '%s' seems to be unknown."
+msgstr ""
+
+#: engines/advancedDetector.cpp:369
+msgid "Please, report the following data to the ScummVM team along with name"
+msgstr ""
+
+#: engines/advancedDetector.cpp:371
+msgid "of the game you tried to add and its version/language/etc.:"
+msgstr ""
+
+#: engines/advancedDetector.cpp:632
+#, c-format
+msgid ""
+"Your game version has been detected using filename matching as a variant of %"
+"s."
+msgstr ""
+
+#: engines/advancedDetector.cpp:635
+msgid "If this is an original and unmodified version, please report any"
+msgstr ""
+
+#: engines/advancedDetector.cpp:637
+msgid "information previously printed by ScummVM to the team."
+msgstr ""
+
 #: engines/dialogs.cpp:84
 msgid "~R~esume"
 msgstr ""






More information about the Scummvm-git-logs mailing list