@@ -1217,26 +1217,7 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath
1217
1217
1218
1218
// Plugin white list:
1219
1219
QStringList pluginList;
1220
-
1221
- // Make the bundled application look good on, e.g., Xfce
1222
- // Note: http://code.qt.io/qt/qtstyleplugins.git must be compiled (using libgtk2.0-dev)
1223
- // https://askubuntu.com/a/910143
1224
- // https://askubuntu.com/a/748186
1225
- // This functionality used to come as part of Qt by default in earlier versions
1226
- // At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself)
1227
- pluginList.append (" platformthemes/libqgtk2.so" );
1228
- pluginList.append (" styles/libqgtk2style.so" );
1229
-
1230
- // Always bundle iconengines,imageformats
1231
- // https://github.com/probonopd/linuxdeployqt/issues/82
1232
- // https://github.com/probonopd/linuxdeployqt/issues/325
1233
- // FIXME
1234
- // The following does NOT work;
1235
- // findDependencyInfo: "ldd: /usr/local/Qt-5.9.3/plugins/iconengines: not regular file"
1236
- // pluginList.append("iconengines");
1237
- // pluginList.append("imageformats");
1238
- // TODO: Need to traverse the directories and add each contained plugin individually
1239
-
1220
+
1240
1221
LogDebug () << " deploymentInfo.deployedLibraries before attempting to bundle required plugins:" << deploymentInfo.deployedLibraries ;
1241
1222
1242
1223
// Platform plugin:
@@ -1257,16 +1238,42 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath
1257
1238
pluginList.append(QStringLiteral("platformthemes/") + plugin);
1258
1239
}
1259
1240
*/
1260
- // All image formats (svg if QtSvg library is used)
1261
- QStringList imagePlugins = QDir (pluginSourcePath + QStringLiteral (" /imageformats" )).entryList (QStringList () << QStringLiteral (" *.so" ));
1262
- foreach (const QString &plugin, imagePlugins) {
1263
- if (plugin.contains (QStringLiteral (" qsvg" ))) {
1264
- if (containsHowOften (deploymentInfo.deployedLibraries , " libQt5Svg" )) {
1265
- pluginList.append (QStringLiteral (" imageformats/" ) + plugin);
1266
- }
1241
+
1242
+ // Make the bundled application look good on, e.g., Xfce
1243
+ // Note: http://code.qt.io/qt/qtstyleplugins.git must be compiled (using libgtk2.0-dev)
1244
+ // https://askubuntu.com/a/910143
1245
+ // https://askubuntu.com/a/748186
1246
+ // This functionality used to come as part of Qt by default in earlier versions
1247
+ // At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself)
1248
+ QStringList extraQtPluginsAdded = { " platformthemes/libqgtk2.so" , " styles/libqgtk2style.so" };
1249
+ foreach (const QString &plugin, extraQtPluginsAdded) {
1250
+ if (QFile::exists (pluginSourcePath + " /" + plugin)) {
1251
+ pluginList.append (plugin);
1252
+ LogDebug () << plugin << " appended" ;
1267
1253
} else {
1268
- pluginList.append (QStringLiteral (" imageformats/" ) + plugin);
1254
+ LogWarning () <<" Plugin" << pluginSourcePath + " /" + plugin << " not found, skipping" ;
1255
+ }
1269
1256
}
1257
+ // Always bundle iconengines,imageformats
1258
+ // https://github.com/probonopd/linuxdeployqt/issues/82
1259
+ // https://github.com/probonopd/linuxdeployqt/issues/325
1260
+ // FIXME
1261
+ // The following does NOT work;
1262
+ // findDependencyInfo: "ldd: /usr/local/Qt-5.9.3/plugins/iconengines: not regular file"
1263
+ // pluginList.append("iconengines");
1264
+ // pluginList.append("imageformats");
1265
+ // TODO: Need to traverse the directories and add each contained plugin individually
1266
+ QStringList extraQtPluginDirs = { " iconengines" , " imageformats" };
1267
+ foreach (const QString &plugin, extraQtPluginDirs) {
1268
+ QDir pluginDirectory (pluginSourcePath + " /" + plugin);
1269
+ if (pluginDirectory.exists ()) {
1270
+ // If it is a plugin directory we will deploy the entire directory
1271
+ QStringList plugins = pluginDirectory.entryList (QStringList () << QStringLiteral (" *.so" ));
1272
+ foreach (const QString &pluginFile, plugins) {
1273
+ pluginList.append (plugin + " /" + pluginFile);
1274
+ LogDebug () << plugin + " /" + pluginFile << " appended" ;
1275
+ }
1276
+ }
1270
1277
}
1271
1278
}
1272
1279
0 commit comments