Quellcode durchsuchen

Make BuildUrl more robust for file urls

Marco Nolden vor 10 Jahren
Ursprung
Commit
b7a75b5599
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      Libs/PluginFramework/ctkLocationManager.cpp

+ 2 - 2
Libs/PluginFramework/ctkLocationManager.cpp

@@ -71,9 +71,9 @@ static bool isInitialized = false;
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 static QUrl BuildUrl(const QString& location, bool trailingSlash)
 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);
     result = QUrl::fromLocalFile(location);
   }
   }