aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/DbAndroid/dbandroidconnectionfactory.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-11-25 16:48:49 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-11-25 16:48:49 -0500
commit7412693e086a7eafaa7ea861164caf523943e5fa (patch)
tree0aee322e40572df306b9813546c7a12b3093bcea /Plugins/DbAndroid/dbandroidconnectionfactory.cpp
parent640196993d31cf5d6fdf36386990ec05f473a048 (diff)
parent8e640722c62692818ab840d50b3758f89a41a54e (diff)
Merge tag 'upstream/3.0.7'
Upstream version 3.0.7 # gpg: Signature made Wed 25 Nov 2015 04:48:48 PM EST using RSA key ID EBE9BD91 # gpg: Good signature from "Unit 193 <unit193@gmail.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.org>" # gpg: aka "Unit 193 <unit193@ubuntu.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.com>"
Diffstat (limited to 'Plugins/DbAndroid/dbandroidconnectionfactory.cpp')
-rw-r--r--Plugins/DbAndroid/dbandroidconnectionfactory.cpp28
1 files changed, 28 insertions, 0 deletions
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;
+}