diff options
| author | 2015-11-25 16:48:41 -0500 | |
|---|---|---|
| committer | 2015-11-25 16:48:41 -0500 | |
| commit | 8e640722c62692818ab840d50b3758f89a41a54e (patch) | |
| tree | 38197eb1688a5afc338081ea17e15f938976e422 /Plugins/DbAndroid/dbandroidconnectionfactory.cpp | |
| parent | 9618f0ebbf4b88045247c01ce8c8f58203508ebf (diff) | |
Imported Upstream version 3.0.7upstream/3.0.7
Diffstat (limited to 'Plugins/DbAndroid/dbandroidconnectionfactory.cpp')
| -rw-r--r-- | Plugins/DbAndroid/dbandroidconnectionfactory.cpp | 28 |
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; +} |
