Commit d7256489 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix loading the plugins again on OSX

We have two (well, three, but the tests don't work yet) situations:
after make install, and after deploying. After install, plugins are
in lib/kritaplugins, after deploy in PlugIns. To avoid trying to
load way too many plugins, assume that all Krita plugins start with
"krita".

Also, move all dockers to plugins/dockers, from plugins/extensions/dockers.
parent 43ac0ea7
......@@ -75,7 +75,7 @@ set(kritasketch_kritaintegrationmodels_SRCS
models/ColorProfileModel.cpp
)
set(KRITA_COLORSELECTORNG_SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins/extensions/dockers/advancedcolorselector")
set(KRITA_COLORSELECTORNG_SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins/dockers/advancedcolorselector")
set(KRITA_COLORSELECTORNG_SOURCES
${KRITA_COLORSELECTORNG_SOURCE_DIR}/kis_my_paint_shade_selector.cpp
${KRITA_COLORSELECTORNG_SOURCE_DIR}/kis_color_patches.cpp
......
......@@ -18,11 +18,11 @@
#include "ColorSelectorItem.h"
#include <plugins/extensions/dockers/advancedcolorselector/kis_color_selector_component.h>
#include <plugins/extensions/dockers/advancedcolorselector/kis_color_selector_ring.h>
#include <plugins/extensions/dockers/advancedcolorselector/kis_color_selector_triangle.h>
#include <plugins/extensions/dockers/advancedcolorselector/kis_color_selector_simple.h>
#include <plugins/extensions/dockers/advancedcolorselector/kis_color_selector_wheel.h>
#include <plugins/dockers/advancedcolorselector/kis_color_selector_component.h>
#include <plugins/dockers/advancedcolorselector/kis_color_selector_ring.h>
#include <plugins/dockers/advancedcolorselector/kis_color_selector_triangle.h>
#include <plugins/dockers/advancedcolorselector/kis_color_selector_simple.h>
#include <plugins/dockers/advancedcolorselector/kis_color_selector_wheel.h>
#include <kis_canvas2.h>
#include <KisViewManager.h>
#include <kis_canvas_resource_provider.h>
......
......@@ -45,7 +45,7 @@ KoJsonTrader::KoJsonTrader()
QDir appDir(qApp->applicationDirPath());
appDir.cdUp();
#ifdef Q_OS_MAC
// Help Krita run without deplo
// Help Krita run without deployment
QDir d(appDir);
d.cd("../../../");
searchDirs << d;
......@@ -59,7 +59,11 @@ KoJsonTrader::KoJsonTrader()
Q_FOREACH (QString entry, dir.entryList()) {
QFileInfo info(dir, entry);
#ifdef Q_OS_MAC
if (info.isDir() && (info.fileName().contains("lib") || info.fileName().contains("PlugIns"))) {
if (info.isDir() && info.fileName().contains("PlugIns")) {
m_pluginPath = info.absoluteFilePath();
break;
}
else if (info.isDir() && (info.fileName().contains("lib"))) {
#else
if (info.isDir() && info.fileName().contains("lib")) {
#endif
......@@ -93,7 +97,7 @@ KoJsonTrader::KoJsonTrader()
break;
}
}
debugPlugin << "KoJsonTrader will load its plugins from" << m_pluginPath;
qInfo() << "KoJsonTrader will load its plugins from" << m_pluginPath;
}
}
......@@ -110,7 +114,7 @@ QList<QPluginLoader *> KoJsonTrader::query(const QString &servicetype, const QSt
QDirIterator dirIter(m_pluginPath, QDirIterator::Subdirectories);
while (dirIter.hasNext()) {
dirIter.next();
if (dirIter.fileInfo().isFile()) {
if (dirIter.fileInfo().isFile() && dirIter.fileName().startsWith("krita")) {
debugPlugin << dirIter.fileName();
QPluginLoader *loader = new QPluginLoader(dirIter.filePath());
QJsonObject json = loader->metaData().value("MetaData").toObject();
......
project(calligradockers)
set(calligradockers_SRCS
shapeproperties/ShapePropertiesDocker.cpp
shapeproperties/ShapePropertiesDockerFactory.cpp
shapecollection/CollectionShapeFactory.cpp
shapecollection/ShapeCollectionDocker.cpp
shapecollection/CollectionItemModel.cpp
shapecollection/OdfCollectionLoader.cpp
Plugin.cpp
)
add_library(krita_docker_defaults MODULE ${calligradockers_SRCS})
target_link_libraries(krita_docker_defaults kritawidgets)
install(TARGETS krita_docker_defaults DESTINATION ${CALLIGRA_PLUGIN_INSTALL_DIR})
add_subdirectory(defaultdockers)
add_subdirectory(smallcolorselector)
add_subdirectory(specificcolorselector)
add_subdirectory(digitalmixer)
add_subdirectory(advancedcolorselector)
add_subdirectory(presetdocker)
add_subdirectory(historydocker)
add_subdirectory(channeldocker)
add_subdirectory(imagedocker)
add_subdirectory(artisticcolorselector)
add_subdirectory(tasksetdocker)
add_subdirectory(compositiondocker)
add_subdirectory(patterndocker)
add_subdirectory(griddocker)
if(HAVE_OCIO)
add_subdirectory(lut)
endif()
add_subdirectory(overview)
add_subdirectory(palettedocker)
add_subdirectory(colorslider)
add_subdirectory(animation)
add_subdirectory(presethistory)
add_subdirectory(shapedockers)
......@@ -35,7 +35,12 @@ ki18n_wrap_ui(KRITA_ANIMATIONDOCKER_SOURCES
onion_skins_docker.ui
)
add_library(kritaanimationdocker SHARED ${KRITA_ANIMATIONDOCKER_SOURCES})
if (WIN32)
add_library(kritaanimationdocker SHARED ${KRITA_ANIMATIONDOCKER_SOURCES})
else()
add_library(kritaanimationdocker MODULE ${KRITA_ANIMATIONDOCKER_SOURCES})
endif()
generate_export_header(kritaanimationdocker BASE_NAME kritaanimationdocker EXPORT_MACRO_NAME KRITAANIMATIONDOCKER_EXPORT)
target_link_libraries(kritaanimationdocker kritaui)
install(TARGETS kritaanimationdocker DESTINATION ${CALLIGRA_PLUGIN_INSTALL_DIR})
......
This diff is collapsed.