Explorar o código

Merge remote-tracking branch 'sascha/pluginfw-application-support'

* sascha/pluginfw-application-support:
  Fix regression making sure the Qt4 moc considers target include paths.
  Correctly rethrow exceptions and improve error messages.
  Make BuildUrl more robust for file urls
Sascha Zelzer %!s(int64=10) %!d(string=hai) anos
pai
achega
8a2d4e09de

+ 1 - 1
CMake/ctkMacroBuildPlugin.cmake

@@ -198,7 +198,7 @@ macro(ctkMacroBuildPlugin)
       # this is a workaround for Visual Studio. The relative include paths in the generated
       # moc files can get very long and can't be resolved by the MSVC compiler.
       foreach(moc_src ${MY_MOC_SRCS})
-        QT4_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} ${MY_MOC_OPTIONS} ${target})
+        QT4_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} ${MY_MOC_OPTIONS} TARGET ${lib_name})
       endforeach()
     endif()
     QT4_WRAP_UI(MY_UI_CPP ${MY_UI_FORMS})

+ 1 - 1
Libs/PluginFramework/ctkDefaultApplicationLauncher.cpp

@@ -88,7 +88,7 @@ QVariant ctkDefaultApplicationLauncher::start(const QVariant& defaultContext)
     {
       if (!relaunch || (context->getPlugin()->getState() != ctkPlugin::ACTIVE))
       {
-        throw e;
+        throw;
       }
       qWarning() << "Application error:" << e.what();
     }

+ 2 - 2
Libs/PluginFramework/ctkLocationManager.cpp

@@ -71,9 +71,9 @@ static bool isInitialized = false;
 //----------------------------------------------------------------------------
 static QUrl BuildUrl(const QString& location, bool trailingSlash)
 {
-  QUrl result(location);
+  QUrl result(location,QUrl::StrictMode);
 
-  if (!result.isValid() || result.scheme().isEmpty())
+  if (!result.isValid() || result.scheme().compare("file", Qt::CaseInsensitive) != 0)
   {
     result = QUrl::fromLocalFile(location);
   }

+ 6 - 1
Libs/PluginFramework/ctkPluginFrameworkLauncher.cpp

@@ -460,10 +460,15 @@ QVariant ctkPluginFrameworkLauncher::run(const QVariant& argument)
     }
     return d->appLauncher->reStart(argument);
   }
+  catch (const ctkException& e)
+  {
+    qWarning() << "Application launch failed:" << e.printStackTrace();
+    throw;
+  }
   catch (const std::exception& e)
   {
     qWarning() << "Application launch failed:" << e.what();
-    throw e;
+    throw;
   }
 }