Commit e48b8d33 authored by hjk's avatar hjk
Browse files

PluginManager: Fix auto test compilation



Change-Id: I8bad921b057948fa639387757c630f9be10c8f6a
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent ea7e8cc0
......@@ -45,25 +45,25 @@ bool MyPlugin1::initialize(const QStringList & /*arguments*/, QString *errorStri
{
initializeCalled = true;
QObject *obj = new QObject;
obj->setObjectName("MyPlugin1");
obj->setObjectName(QLatin1String("MyPlugin1"));
addAutoReleasedObject(obj);
bool found2 = false;
bool found3 = false;
foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) {
if (object->objectName() == "MyPlugin2")
if (object->objectName() == QLatin1String("MyPlugin2"))
found2 = true;
else if (object->objectName() == "MyPlugin3")
else if (object->objectName() == QLatin1String("MyPlugin3"))
found3 = true;
}
if (found2 && found3)
return true;
if (errorString) {
QString error = "object(s) missing from plugin(s):";
QString error = QLatin1String("object(s) missing from plugin(s):");
if (!found2)
error.append(" plugin2");
error.append(QLatin1String(" plugin2"));
if (!found3)
error.append(" plugin3");
error.append(QLatin1String(" plugin3"));
*errorString = error;
}
return false;
......@@ -75,7 +75,7 @@ void MyPlugin1::extensionsInitialized()
return;
// don't do this at home, it's just done here for the test
QObject *obj = new QObject;
obj->setObjectName("MyPlugin1_running");
obj->setObjectName(QLatin1String("MyPlugin1_running"));
addAutoReleasedObject(obj);
}
......
......@@ -45,7 +45,7 @@ bool MyPlugin2::initialize(const QStringList &, QString *)
{
initializeCalled = true;
QObject *obj = new QObject;
obj->setObjectName("MyPlugin2");
obj->setObjectName(QLatin1String("MyPlugin2"));
addAutoReleasedObject(obj);
return true;
......@@ -57,7 +57,7 @@ void MyPlugin2::extensionsInitialized()
return;
// don't do this at home, it's just done here for the test
QObject *obj = new QObject;
obj->setObjectName("MyPlugin2_running");
obj->setObjectName(QLatin1String("MyPlugin2_running"));
addAutoReleasedObject(obj);
}
......
......@@ -45,18 +45,18 @@ bool MyPlugin3::initialize(const QStringList & /*arguments*/, QString *errorStri
{
initializeCalled = true;
QObject *obj = new QObject;
obj->setObjectName("MyPlugin3");
obj->setObjectName(QLatin1String("MyPlugin3"));
addAutoReleasedObject(obj);
bool found2 = false;
foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) {
if (object->objectName() == "MyPlugin2")
if (object->objectName() == QLatin1String("MyPlugin2"))
found2 = true;
}
if (found2)
return true;
if (errorString)
*errorString = "object from plugin2 could not be found";
*errorString = QLatin1String("object from plugin2 could not be found");
return false;
}
......@@ -66,7 +66,7 @@ void MyPlugin3::extensionsInitialized()
return;
// don't do this at home, it's just done here for the test
QObject *obj = new QObject;
obj->setObjectName("MyPlugin3_running");
obj->setObjectName(QLatin1String("MyPlugin3_running"));
addAutoReleasedObject(obj);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment