Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

namespace {

static QString PREFIX_EXECUTABLE = "executable:";
static QString PREFIX_PARAMETER_GROUP = "paramGroup:";
static QString PREFIX_PARAMETER_CONTAINER = "paramContainer:";
static QString PREFIX_PARAMETER = "parameter:";
static constexpr QLatin1String PREFIX_EXECUTABLE{"executable:", static_cast<int>(sizeof("executable:") - 1)};
static constexpr QLatin1String PREFIX_PARAMETER_GROUP{"paramGroup:", static_cast<int>(sizeof("paramGroup:") - 1)};
static constexpr QLatin1String PREFIX_PARAMETER_CONTAINER{"paramContainer:", static_cast<int>(sizeof("paramContainer:") - 1)};
static constexpr QLatin1String PREFIX_PARAMETER{"parameter:", static_cast<int>(sizeof("parameter:") - 1)};

}

Expand Down
4 changes: 2 additions & 2 deletions Libs/PluginFramework/ctkBasicLocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#include <QReadLocker>
#include <QWriteLocker>

static const QString PROP_OSGI_LOCKING = "blueberry.locking";
static const QString DEFAULT_LOCK_FILENAME = ".metadata/.lock";
static constexpr QLatin1String PROP_OSGI_LOCKING{"blueberry.locking", static_cast<int>(sizeof("blueberry.locking") - 1)};
static constexpr QLatin1String DEFAULT_LOCK_FILENAME{".metadata/.lock", static_cast<int>(sizeof(".metadata/.lock") - 1)};


//----------------------------------------------------------------------------
Expand Down
26 changes: 13 additions & 13 deletions Libs/PluginFramework/ctkLocationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@
namespace {

// Constants for configuration location discovery
static const QString CTK = "commontk";
static const QString PRODUCT_SITE_MARKER = ".commontkproduct";
static const QString PRODUCT_SITE_ID = "id";
static const QString PRODUCT_SITE_VERSION = "version";
static constexpr QLatin1String CTK{"commontk", static_cast<int>(sizeof("commontk") - 1)};
static constexpr QLatin1String PRODUCT_SITE_MARKER{".commontkproduct", static_cast<int>(sizeof(".commontkproduct") - 1)};
static constexpr QLatin1String PRODUCT_SITE_ID{"id", static_cast<int>(sizeof("id") - 1)};
static constexpr QLatin1String PRODUCT_SITE_VERSION{"version", static_cast<int>(sizeof("version") - 1)};

static const QString CONFIG_DIR = "configuration";
static constexpr QLatin1String CONFIG_DIR{"configuration", static_cast<int>(sizeof("configuration") - 1)};

// Data mode constants for user, configuration and data locations.
static const QString NONE = "@none";
static const QString NO_DEFAULT = "@noDefault";
static const QString USER_HOME = "@user.home";
static const QString USER_DIR = "@user.dir";
static constexpr QLatin1String NONE{"@none", static_cast<int>(sizeof("@none") - 1)};
static constexpr QLatin1String NO_DEFAULT{"@noDefault", static_cast<int>(sizeof("@noDefault") - 1)};
static constexpr QLatin1String USER_HOME{"@user.home", static_cast<int>(sizeof("@user.home") - 1)};
static constexpr QLatin1String USER_DIR{"@user.dir", static_cast<int>(sizeof("@user.dir") - 1)};
// Placeholder for hashcode of installation directory
static const QString INSTALL_HASH_PLACEHOLDER = "@install.hash";
static constexpr QLatin1String INSTALL_HASH_PLACEHOLDER{"@install.hash", static_cast<int>(sizeof("@install.hash") - 1)};

static const QString INSTANCE_DATA_AREA_PREFIX = ".metadata/.plugins/";
static constexpr QLatin1String INSTANCE_DATA_AREA_PREFIX{".metadata/.plugins/", static_cast<int>(sizeof(".metadata/.plugins/") - 1)};

static QScopedPointer<ctkBasicLocation> installLocation;
static QScopedPointer<ctkBasicLocation> configurationLocation;
Expand Down Expand Up @@ -138,7 +138,7 @@ ctkBasicLocation* BuildLocation(const QString& property, const QUrl& defaultLoca
int idx = location.indexOf(INSTALL_HASH_PLACEHOLDER);
if (idx == 0)
{
throw ctkRuntimeException("The location cannot start with '" + INSTALL_HASH_PLACEHOLDER + "': " + location);
throw ctkRuntimeException(QString("The location cannot start with '") + INSTALL_HASH_PLACEHOLDER + "': " + location);
}
else if (idx > 0)
{
Expand Down Expand Up @@ -280,7 +280,7 @@ static QString ComputeDefaultUserAreaLocation(const QString& pathAppendage)
QFileInfo installDir(installURL.toLocalFile());
QString installDirHash = GetInstallDirHash();

QString appName = "." + CTK;
QString appName = QString(".") + CTK;
QFileInfo ctkProduct(QDir(installDir.absoluteFilePath()), PRODUCT_SITE_MARKER);
if (ctkProduct.exists())
{
Expand Down
14 changes: 0 additions & 14 deletions Libs/PluginFramework/ctkPluginFrameworkDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@
#include "ctkPluginFrameworkDebug_p.h"

#include "ctkPluginFrameworkDebugOptions_p.h"
#include "ctkPluginFrameworkProperties_p.h"

static QString CTK_OSGI = "org.commontk.pluginfw";

QString ctkPluginFrameworkDebug::OPTION_DEBUG_GENERAL = CTK_OSGI + "/debug";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_FRAMEWORK = CTK_OSGI + "/debug/framework";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_ERRORS = CTK_OSGI + "/debug/errors";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_HOOKS = CTK_OSGI + "/debug/hooks";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_LAZY_ACTIVATION = CTK_OSGI + "/debug/lazy_activation";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_LDAP = CTK_OSGI + "/debug/ldap";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_SERVICE_REFERENCE = CTK_OSGI + "/debug/service_reference";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_STARTLEVEL = CTK_OSGI + "/debug/startlevel";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_URL = CTK_OSGI + "/debug/url";
QString ctkPluginFrameworkDebug::OPTION_DEBUG_RESOLVE = CTK_OSGI + "/debug/resolve";

//----------------------------------------------------------------------------
ctkPluginFrameworkDebug::ctkPluginFrameworkDebug()
Expand Down
43 changes: 33 additions & 10 deletions Libs/PluginFramework/ctkPluginFrameworkDebug_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifndef CTKPLUGINFRAMEWORKDEBUG_P_H
#define CTKPLUGINFRAMEWORKDEBUG_P_H

// Qt includes
#include <QLatin1String>

#include "ctkPluginFramework_global.h"

/**
Expand All @@ -34,63 +37,83 @@ class ctkPluginFrameworkDebug
public:
ctkPluginFrameworkDebug();

static QString OPTION_DEBUG_GENERAL;
static constexpr QLatin1String OPTION_DEBUG_GENERAL{
"org.commontk.pluginfw/debug",
static_cast<int>(sizeof("org.commontk.pluginfw/debug") - 1)};
bool enabled;

/**
* Report error handling events.
*/
static QString OPTION_DEBUG_ERRORS;
static constexpr QLatin1String OPTION_DEBUG_ERRORS{
"org.commontk.pluginfw/debug/errors",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/errors") - 1)};
bool errors;

/**
* Report pluginfw create, init, start, stop
*/
static QString OPTION_DEBUG_FRAMEWORK;
static constexpr QLatin1String OPTION_DEBUG_FRAMEWORK{
"org.commontk.pluginfw/debug/framework",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/framework") - 1)};
bool framework;

/**
* Report hooks handling
*/
static QString OPTION_DEBUG_HOOKS;
static constexpr QLatin1String OPTION_DEBUG_HOOKS{
"org.commontk.pluginfw/debug/hooks",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/hooks") - 1)};
bool hooks;

/**
* Report triggering of lazy activation
*/
static QString OPTION_DEBUG_LAZY_ACTIVATION;
static constexpr QLatin1String OPTION_DEBUG_LAZY_ACTIVATION{
"org.commontk.pluginfw/debug/lazy_activation",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/lazy_activation") - 1)};
bool lazy_activation;

/**
* Report LDAP handling
*/
static QString OPTION_DEBUG_LDAP;
static constexpr QLatin1String OPTION_DEBUG_LDAP{
"org.commontk.pluginfw/debug/ldap",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/ldap") - 1)};
bool ldap;

/**
* Print information about service reference lookups
* and rejections due to missing permissions
* for calling plug-ins.
*/
static QString OPTION_DEBUG_SERVICE_REFERENCE;
static constexpr QLatin1String OPTION_DEBUG_SERVICE_REFERENCE{
"org.commontk.pluginfw/debug/service_reference",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/service_reference") - 1)};
bool service_reference;

/**
* Report startlevel.
*/
static QString OPTION_DEBUG_STARTLEVEL;
static constexpr QLatin1String OPTION_DEBUG_STARTLEVEL{
"org.commontk.pluginfw/debug/startlevel",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/startlevel") - 1)};
bool startlevel;

/**
* Report url
*/
static QString OPTION_DEBUG_URL;
static constexpr QLatin1String OPTION_DEBUG_URL{
"org.commontk.pluginfw/debug/url",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/url") - 1)};
bool url;

/**
* Report plug-in resolve progress
*/
static QString OPTION_DEBUG_RESOLVE;
static constexpr QLatin1String OPTION_DEBUG_RESOLVE{
"org.commontk.pluginfw/debug/resolve",
static_cast<int>(sizeof("org.commontk.pluginfw/debug/resolve") - 1)};
bool resolve;

};
Expand Down
2 changes: 1 addition & 1 deletion Libs/PluginFramework/ctkPluginFrameworkLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const QString ctkPluginFrameworkLauncher::PROP_APPLICATION_LAUNCHDEFAULT = "ctk.

const QString ctkPluginFrameworkLauncher::PROP_OSGI_RELAUNCH = "ctk.pluginfw.relaunch";

static const QString PROP_FORCED_RESTART = "ctk.forcedRestart";
static constexpr QLatin1String PROP_FORCED_RESTART{"ctk.forcedRestart", static_cast<int>(sizeof("ctk.forcedRestart") - 1)};

class ctkPluginFrameworkLauncherPrivate
{
Expand Down
Loading