Skip to content

Commit d0e65fb

Browse files
committed
Add deployer for printsupport module
1 parent 8f37917 commit d0e65fb

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

src/deployers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ set(CLASSES
1616
QmlPluginsDeployer
1717
Qt3DPluginsDeployer
1818
GamepadPluginsDeployer
19+
PrintSupportPluginsDeployer
1920
)
2021

2122
# TODO: CMake <= 3.7 (at least!) doesn't allow for using OBJECT libraries with target_link_libraries

src/deployers/PluginsDeployerFactory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "BearerPluginsDeployer.h"
66
#include "GamepadPluginsDeployer.h"
77
#include "MultimediaPluginsDeployer.h"
8+
#include "PrintSupportPluginsDeployer.h"
89
#include "PositioningPluginsDeployer.h"
910
#include "QmlPluginsDeployer.h"
1011
#include "Qt3DPluginsDeployer.h"
@@ -74,6 +75,10 @@ std::vector<std::shared_ptr<PluginsDeployer>> PluginsDeployerFactory::getDeploye
7475
return {getInstance<GamepadPluginsDeployer>(moduleName)};
7576
}
7677

78+
if (moduleName == "printsupport") {
79+
return {getInstance<PrintSupportPluginsDeployer>(moduleName)};
80+
}
81+
7782
// fallback
7883
return {getInstance<BasicPluginsDeployer>(moduleName)};
7984
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// library headers
2+
#include <linuxdeploy/core/log.h>
3+
#include <boost/filesystem.hpp>
4+
5+
// local headers
6+
#include "PrintSupportPluginsDeployer.h"
7+
8+
using namespace linuxdeploy::plugin::qt;
9+
using namespace linuxdeploy::core::log;
10+
11+
namespace bf = boost::filesystem;
12+
13+
bool PrintSupportPluginsDeployer::deploy() {
14+
// calling the default code is optional, but it won't hurt for now
15+
if (!BasicPluginsDeployer::deploy())
16+
return false;
17+
18+
ldLog() << "Deploying printsupport plugins" << std::endl;
19+
20+
for (bf::directory_iterator i(qtPluginsPath / "printsupport"); i != bf::directory_iterator(); ++i) {
21+
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/printsupport/"))
22+
return false;
23+
}
24+
}
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 PrintSupportPluginsDeployer : 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+
}

0 commit comments

Comments
 (0)