From 8e640722c62692818ab840d50b3758f89a41a54e Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Wed, 25 Nov 2015 16:48:41 -0500 Subject: Imported Upstream version 3.0.7 --- Plugins/DbAndroid/dbandroidconnectionfactory.cpp | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Plugins/DbAndroid/dbandroidconnectionfactory.cpp (limited to 'Plugins/DbAndroid/dbandroidconnectionfactory.cpp') diff --git a/Plugins/DbAndroid/dbandroidconnectionfactory.cpp b/Plugins/DbAndroid/dbandroidconnectionfactory.cpp new file mode 100644 index 0000000..22377b4 --- /dev/null +++ b/Plugins/DbAndroid/dbandroidconnectionfactory.cpp @@ -0,0 +1,28 @@ +#include "dbandroidconnectionfactory.h" +#include "dbandroidjsonconnection.h" +#include "dbandroidshellconnection.h" + +DbAndroidConnectionFactory::DbAndroidConnectionFactory(DbAndroid* plugin) : + plugin(plugin) +{ +} + +DbAndroidConnection* DbAndroidConnectionFactory::create(const QString& url, QObject* parent) +{ + return create(DbAndroidUrl(url), parent); +} + +DbAndroidConnection* DbAndroidConnectionFactory::create(const DbAndroidUrl& url, QObject* parent) +{ + switch (url.getMode()) + { + case DbAndroidMode::SHELL: + return new DbAndroidShellConnection(plugin, parent); + case DbAndroidMode::NETWORK: + case DbAndroidMode::USB: + return new DbAndroidJsonConnection(plugin, parent); + case DbAndroidMode::null: + break; + } + return nullptr; +} -- cgit v1.2.3