Merge pull request #1590 from jmarshallnz/skin_setpath_specify_path
authorjmarshallnz <jcmarsha@gmail.com>
Sat, 13 Oct 2012 10:09:46 +0000 (03:09 -0700)
committerjmarshallnz <jcmarsha@gmail.com>
Sat, 13 Oct 2012 10:09:46 +0000 (03:09 -0700)
allow skin.setpath to take a second parameter of the path to search

xbmc/interfaces/Builtins.cpp

index b8e94b8..882aaa1 100644 (file)
@@ -1186,6 +1186,19 @@ int CBuiltins::Execute(const CStdString& execString)
     else // execute.Equals("skin.setpath"))
     {
       g_mediaManager.GetNetworkLocations(localShares);
+      if (params.size() > 1)
+      {
+        value = params[1];
+        URIUtils::AddSlashAtEnd(value);
+        bool bIsSource;
+        if (CUtil::GetMatchingSource(value,localShares,bIsSource) < 0) // path is outside shares - add it as a separate one
+        {
+          CMediaSource share;
+          share.strName = g_localizeStrings.Get(13278);
+          share.strPath = value;
+          localShares.push_back(share);
+        }
+      }
       if (CGUIDialogFileBrowser::ShowAndGetDirectory(localShares, g_localizeStrings.Get(1031), value))
         g_settings.SetSkinString(string, value);
     }