瀏覽代碼

Make BuildUrl more robust for file urls

Marco Nolden 10 年之前
父節點
當前提交
b7a75b5599
共有 1 個文件被更改,包括 2 次插入2 次删除
  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)
 {
-  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);
   }