Przeglądaj źródła

more namespace fixes

Sascha Zelzer 15 lat temu
rodzic
commit
e27d4c53cc

+ 1 - 1
Applications/ctkPluginBrowser/ctkPluginBrowser.cpp

@@ -115,7 +115,7 @@ void ctkPluginBrowser::pluginDoubleClicked(const QModelIndex& index)
     qDebug() << "Object Classes:" << ref->getProperty(PluginConstants::OBJECTCLASS).toStringList();
   }
 
-  ctkServiceReference* cliRef = plugin->getPluginContext()->getServiceReference("ctk::ICLIManager");
+  ctkServiceReference* cliRef = plugin->getPluginContext()->getServiceReference("ctkICLIManager");
   QObject* cliService = plugin->getPluginContext()->getService(cliRef);
   if (cliService)
     qDebug() << "Got service object: " << cliService->metaObject()->className();

+ 21 - 15
Libs/PluginFramework/ctkQtServiceRegistrationPrivate.cpp

@@ -26,23 +26,29 @@
 #include "ctkQtServiceRegistration_p.h"
 
 
-  ctkQtServiceRegistrationPrivate::ctkQtServiceRegistrationPrivate(ctkQtServiceRegistration* sr,
-                               ctkPluginPrivate* plugin,
-                               QtMobility::QServiceInterfaceDescriptor serviceDescriptor,
-                               const ServiceProperties& props)
-    : ctkServiceRegistrationPrivate(sr, plugin, 0, props),
-      serviceDescriptor(serviceDescriptor)
+ctkQtServiceRegistrationPrivate::ctkQtServiceRegistrationPrivate(ctkQtServiceRegistration* sr,
+                             ctkPluginPrivate* plugin,
+                             QtMobility::QServiceInterfaceDescriptor serviceDescriptor,
+                             const ServiceProperties& props)
+  : ctkServiceRegistrationPrivate(sr, plugin, 0, props),
+    serviceDescriptor(serviceDescriptor)
+{
+
+}
+
+QObject* ctkQtServiceRegistrationPrivate::getService()
+{
+  if (this->plugin->state != ctkPlugin::ACTIVE)
   {
-
-  }
-
-  QObject* ctkQtServiceRegistrationPrivate::getService()
-  {
-    if (this->plugin->state != ctkPlugin::ACTIVE)
+    try
     {
       this->plugin->q_func()->start(0);
     }
-    return this->plugin->fwCtx->services.qServiceManager.loadInterface(serviceDescriptor);
+    catch (const ctkPluginException& e)
+    {
+      qDebug() << e;
+      throw;
+    }
   }
-
-
+  return this->plugin->fwCtx->services.qServiceManager.loadInterface(serviceDescriptor);
+}

+ 2 - 1
Plugins/org.commontk.cli/ctkCLIPlugin.cpp

@@ -20,7 +20,8 @@ using namespace QtMobility;
 void ctkCLIPlugin::start(ctkPluginContext* context)
 {
   ctkCLIRegistry* registry = new ctkCLIRegistry();
-  context->registerService(QStringList("ctk::CLIRegistry"), registry);
+  context->registerService(QStringList("ctkCLIRegistry"), registry);
+
   std::cout << "Plugin A started\n";
 }
 

+ 4 - 8
Plugins/org.commontk.cli/ctkICLIManager.h

@@ -10,14 +10,10 @@
 
 #include <QObject>
 
-namespace ctk {
-
-  class ICLIManager : public QObject
-  {
-    Q_OBJECT
-  };
-
-}
+class ctkICLIManager : public QObject
+{
+  Q_OBJECT
+};
 
 
 #endif /* CTKICLIMANAGER_H_ */