Skip to content

Commit 5129506

Browse files
Steveice10TheAssassin
Steveice10
authored andcommitted
Support deploying Qt 6 multimedia plugins.
1 parent cc77019 commit 5129506

6 files changed

+62
-7
lines changed

src/deployers/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ set(CLASSES
1212
SqlPluginsDeployer
1313
PositioningPluginsDeployer
1414
LocationPluginsDeployer
15-
MultimediaPluginsDeployer
15+
Multimedia5PluginsDeployer
16+
Multimedia6PluginsDeployer
1617
WebEnginePluginsDeployer
1718
QmlPluginsDeployer
1819
Qt3DPluginsDeployer

src/deployers/MultimediaPluginsDeployer.cpp renamed to src/deployers/Multimedia5PluginsDeployer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
#include <linuxdeploy/core/log.h>
66

77
// local headers
8-
#include "MultimediaPluginsDeployer.h"
8+
#include "Multimedia5PluginsDeployer.h"
99

1010
using namespace linuxdeploy::plugin::qt;
1111
using namespace linuxdeploy::core::log;
1212

1313
namespace fs = std::filesystem;
1414

15-
bool MultimediaPluginsDeployer::deploy() {
15+
bool Multimedia5PluginsDeployer::deploy() {
1616
// calling the default code is optional, but it won't hurt for now
1717
if (!BasicPluginsDeployer::deploy())
1818
return false;

src/deployers/MultimediaPluginsDeployer.h renamed to src/deployers/Multimedia5PluginsDeployer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace linuxdeploy {
66
namespace plugin {
77
namespace qt {
8-
class MultimediaPluginsDeployer : public BasicPluginsDeployer {
8+
class Multimedia5PluginsDeployer : public BasicPluginsDeployer {
99
public:
1010
// we can just use the base class's constructor
1111
using BasicPluginsDeployer::BasicPluginsDeployer;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// system headers
2+
#include <filesystem>
3+
4+
// library headers
5+
#include <linuxdeploy/core/log.h>
6+
7+
// local headers
8+
#include "Multimedia6PluginsDeployer.h"
9+
10+
using namespace linuxdeploy::plugin::qt;
11+
using namespace linuxdeploy::core::log;
12+
13+
namespace fs = std::filesystem;
14+
15+
bool Multimedia6PluginsDeployer::deploy() {
16+
// calling the default code is optional, but it won't hurt for now
17+
if (!BasicPluginsDeployer::deploy())
18+
return false;
19+
20+
if (fs::exists(qtPluginsPath / "multimedia")) {
21+
ldLog() << "Deploying multimedia plugins" << std::endl;
22+
23+
for (fs::directory_iterator i(qtPluginsPath / "multimedia"); i != fs::directory_iterator(); ++i) {
24+
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/multimedia/"))
25+
return false;
26+
}
27+
} else {
28+
ldLog() << LD_WARNING << "Missing Qt 6 multimedia plugins, skipping." << std::endl;
29+
}
30+
31+
return true;
32+
}
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 Multimedia6PluginsDeployer : 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: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#include "BearerPluginsDeployer.h"
66
#include "GamepadPluginsDeployer.h"
77
#include "LocationPluginsDeployer.h"
8-
#include "MultimediaPluginsDeployer.h"
8+
#include "Multimedia5PluginsDeployer.h"
9+
#include "Multimedia6PluginsDeployer.h"
910
#include "PrintSupportPluginsDeployer.h"
1011
#include "PositioningPluginsDeployer.h"
1112
#include "QmlPluginsDeployer.h"
@@ -70,8 +71,12 @@ std::vector<std::shared_ptr<PluginsDeployer>> PluginsDeployerFactory::getDeploye
7071
return {getInstance<PositioningPluginsDeployer>(moduleName)};
7172
}
7273

73-
if (qtMajorVersion < 6 && moduleName == "multimedia") {
74-
return {getInstance<MultimediaPluginsDeployer>(moduleName)};
74+
if (moduleName == "multimedia") {
75+
if (qtMajorVersion < 6) {
76+
return {getInstance<Multimedia5PluginsDeployer>(moduleName)};
77+
} else {
78+
return {getInstance<Multimedia6PluginsDeployer>(moduleName)};
79+
}
7580
}
7681

7782
if (moduleName == "webenginecore") {

0 commit comments

Comments
 (0)