Skip to content

Commit c658754

Browse files
ntadejTheAssassin
authored andcommitted
Deploy QtLocation geoservices plugins
1 parent f79606b commit c658754

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

src/deployers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set(CLASSES
1111
SvgPluginsDeployer
1212
SqlPluginsDeployer
1313
PositioningPluginsDeployer
14+
LocationPluginsDeployer
1415
MultimediaPluginsDeployer
1516
WebEnginePluginsDeployer
1617
QmlPluginsDeployer
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// system headers
2+
#include <filesystem>
3+
4+
// library headers
5+
#include <linuxdeploy/core/log.h>
6+
7+
// local headers
8+
#include "LocationPluginsDeployer.h"
9+
10+
using namespace linuxdeploy::plugin::qt;
11+
using namespace linuxdeploy::core::log;
12+
13+
namespace fs = std::filesystem;
14+
15+
bool LocationPluginsDeployer::deploy() {
16+
// calling the default code is optional, but it won't hurt for now
17+
if (!BasicPluginsDeployer::deploy())
18+
return false;
19+
20+
ldLog() << "Deploying Location plugins" << std::endl;
21+
22+
for (fs::directory_iterator i(qtPluginsPath / "geoservices"); i != fs::directory_iterator(); ++i) {
23+
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geoservices/"))
24+
return false;
25+
}
26+
27+
return true;
28+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
#include "BasicPluginsDeployer.h"
4+
5+
namespace linuxdeploy {
6+
namespace plugin {
7+
namespace qt {
8+
class LocationPluginsDeployer : public BasicPluginsDeployer {
9+
public:
10+
// we can just use the base class's constructor
11+
using BasicPluginsDeployer::BasicPluginsDeployer;
12+
13+
bool deploy() override;
14+
};
15+
}
16+
}
17+
}

src/deployers/PluginsDeployerFactory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "PlatformPluginsDeployer.h"
55
#include "BearerPluginsDeployer.h"
66
#include "GamepadPluginsDeployer.h"
7+
#include "LocationPluginsDeployer.h"
78
#include "MultimediaPluginsDeployer.h"
89
#include "PrintSupportPluginsDeployer.h"
910
#include "PositioningPluginsDeployer.h"
@@ -61,6 +62,10 @@ std::vector<std::shared_ptr<PluginsDeployer>> PluginsDeployerFactory::getDeploye
6162
return {getInstance<SqlPluginsDeployer>(moduleName)};
6263
}
6364

65+
if (moduleName == "location") {
66+
return {getInstance<LocationPluginsDeployer>(moduleName)};
67+
}
68+
6469
if (moduleName == "positioning") {
6570
return {getInstance<PositioningPluginsDeployer>(moduleName)};
6671
}

0 commit comments

Comments
 (0)