[Scummvm-git-logs] scummvm master -> b9e29cedfc1ad4ee5930245de059fb1701bea793

bluegr bluegr at gmail.com
Fri Jun 21 07:19:40 CEST 2019


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

Summary:
b9e29cedfc ANDROID: Move isConnectionLimited into OSystem


Commit: b9e29cedfc1ad4ee5930245de059fb1701bea793
    https://github.com/scummvm/scummvm/commit/b9e29cedfc1ad4ee5930245de059fb1701bea793
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-06-21T08:19:37+03:00

Commit Message:
ANDROID: Move isConnectionLimited into OSystem

Changed paths:
  R backends/networking/connection/islimited-android.cpp
  R backends/networking/connection/islimited-default.cpp
  R backends/networking/connection/islimited.h
    backends/module.mk
    backends/platform/android/android.cpp
    backends/platform/android/android.h
    common/system.cpp
    common/system.h
    gui/downloaddialog.cpp


diff --git a/backends/module.mk b/backends/module.mk
index e85e9d1..22b4a63 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -156,15 +156,6 @@ MODULE_OBJS += \
 endif
 endif
 
-# Connection::isLimited
-ifeq ($(BACKEND),android)
-MODULE_OBJS += \
-	networking/connection/islimited-android.o
-else
-MODULE_OBJS += \
-	networking/connection/islimited-default.o
-endif
-
 ifdef POSIX
 MODULE_OBJS += \
 	fs/posix/posix-fs.o \
diff --git a/backends/networking/connection/islimited-android.cpp b/backends/networking/connection/islimited-android.cpp
deleted file mode 100644
index 8989f21..0000000
--- a/backends/networking/connection/islimited-android.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "backends/networking/connection/islimited.h"
-#include "backends/platform/android/jni.h"
-
-namespace Networking {
-namespace Connection {
-
-bool isLimited() {
-	return JNI::isConnectionLimited();
-}
-
-} // End of namespace Connection
-} // End of namespace Networking
-
diff --git a/backends/networking/connection/islimited-default.cpp b/backends/networking/connection/islimited-default.cpp
deleted file mode 100644
index a993077..0000000
--- a/backends/networking/connection/islimited-default.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "backends/networking/connection/islimited.h"
-#include "common/textconsole.h"
-
-namespace Networking {
-namespace Connection {
-
-bool isLimited() {
-	warning("Networking::Connection::isLimited(): not limited by default");
-	return false;
-}
-
-} // End of namespace Connection
-} // End of namespace Networking
-
diff --git a/backends/networking/connection/islimited.h b/backends/networking/connection/islimited.h
deleted file mode 100644
index b23d31d..0000000
--- a/backends/networking/connection/islimited.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef NETWORKING_CONNECTION_ISLIMITED_H
-#define NETWORKING_CONNECTION_ISLIMITED_H
-
-namespace Networking {
-namespace Connection {
-
-/**
-* Returns whether connection's limited (if available on the target system).
-*
-* Returns true if connection seems limited.
-*/
-bool isLimited();
-
-} // End of namespace Connection
-} // End of namespace Networking
-
-#endif /*NETWORKING_CONNECTION_ISLIMITED_H*/
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index beb9516..4f1b852 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -603,6 +603,10 @@ bool OSystem_Android::setTextInClipboard(const Common::String &text) {
 	return JNI::setTextInClipboard(text);
 }
 
+bool OSystem_Android::isConnectionLimited() {
+	return JNI::isConnectionLimited();
+}
+
 Common::String OSystem_Android::getSystemProperty(const char *name) const {
 	char value[PROP_VALUE_MAX];
 
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 64c4d9c..d88df6b 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -293,6 +293,7 @@ public:
 	virtual bool hasTextInClipboard();
 	virtual Common::String getTextFromClipboard();
 	virtual bool setTextInClipboard(const Common::String &text);
+	virtual bool isConnectionLimited();
 	virtual Common::String getSystemLanguage() const;
 };
 
diff --git a/common/system.cpp b/common/system.cpp
index 93cf98c..9f6dc60 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -192,6 +192,11 @@ Common::String OSystem::getSystemLanguage() const {
 	return "en_US";
 }
 
+bool OSystem::isConnectionLimited() {
+	warning("OSystem::isConnectionLimited(): not limited by default");
+	return false;
+}
+
 Common::TimerManager *OSystem::getTimerManager() {
 	return _timerManager;
 }
diff --git a/common/system.h b/common/system.h
index 87b478b..c66b5f6 100644
--- a/common/system.h
+++ b/common/system.h
@@ -1482,6 +1482,13 @@ public:
 	 */
 	virtual Common::String getSystemLanguage() const;
 
+	/**
+	 * Returns whether connection's limited (if available on the target system).
+	 *
+	 * Returns true if connection seems limited.
+	 */
+	virtual bool isConnectionLimited();
+
 	//@}
 };
 
diff --git a/gui/downloaddialog.cpp b/gui/downloaddialog.cpp
index 4df7dc7..526a895 100644
--- a/gui/downloaddialog.cpp
+++ b/gui/downloaddialog.cpp
@@ -22,7 +22,6 @@
 
 #include "gui/downloaddialog.h"
 #include "backends/cloud/cloudmanager.h"
-#include "backends/networking/connection/islimited.h"
 #include "common/config-manager.h"
 #include "common/translation.h"
 #include "engines/metaengine.h"
@@ -114,7 +113,7 @@ void DownloadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
 }
 
 bool DownloadDialog::selectDirectories() {
-	if (Networking::Connection::isLimited()) {
+	if (g_system->isConnectionLimited()) {
 		MessageDialog alert(_("It looks like your connection is limited. "
 			"Do you really want to download files with it?"), _("Yes"), _("No"));
 		if (alert.runModal() != GUI::kMessageOK)





More information about the Scummvm-git-logs mailing list