Skip to content
This repository
Browse code

Remove AddFileFolder(..) without return value

  • Loading branch information...
commit a115d4f9ccdee6404842f807302abe78c462c87b 1 parent 20a5367
Rawk authored May 07, 2013

Showing 36 changed files with 121 additions and 176 deletions. Show diff stats Hide diff stats

  1. 3  xbmc/Application.cpp
  2. 2  xbmc/CueDocument.cpp
  3. 4  xbmc/Favourites.cpp
  4. 38  xbmc/FileItem.cpp
  5. 46  xbmc/Util.cpp
  6. 6  xbmc/addons/Addon.cpp
  7. 14  xbmc/addons/AddonCallbacksGUI.cpp
  8. 2  xbmc/cdrip/CDDARipper.cpp
  9. 3  xbmc/dbwrappers/sqlitedataset.cpp
  10. 6  xbmc/dialogs/GUIDialogFileBrowser.cpp
  11. 2  xbmc/filesystem/CurlFile.cpp
  12. 4  xbmc/filesystem/RarManager.cpp
  13. 22  xbmc/filesystem/SpecialProtocol.cpp
  14. 6  xbmc/filesystem/StackDirectory.cpp
  15. 7  xbmc/guilib/GUIColorManager.cpp
  16. 3  xbmc/input/ButtonTranslator.cpp
  17. 2  xbmc/interfaces/Builtins.cpp
  18. 5  xbmc/interfaces/legacy/WindowXML.cpp
  19. 14  xbmc/music/MusicDatabase.cpp
  20. 2  xbmc/music/dialogs/GUIDialogMusicInfo.cpp
  21. 2  xbmc/music/dialogs/GUIDialogSongInfo.cpp
  22. 6  xbmc/music/infoscanner/MusicInfoScanner.cpp
  23. 7  xbmc/music/windows/GUIWindowMusicPlaylist.cpp
  24. 5  xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp
  25. 6  xbmc/network/upnp/UPnP.cpp
  26. 4  xbmc/settings/MediaSettings.cpp
  27. 2  xbmc/utils/FileOperationJob.cpp
  28. 2  xbmc/utils/FileUtils.cpp
  29. 11  xbmc/utils/ScraperUrl.cpp
  30. 17  xbmc/utils/URIUtils.cpp
  31. 10  xbmc/utils/URIUtils.h
  32. 10  xbmc/utils/test/TestURIUtils.cpp
  33. 11  xbmc/video/VideoDatabase.cpp
  34. 2  xbmc/video/VideoInfoScanner.cpp
  35. 6  xbmc/video/windows/GUIWindowVideoNav.cpp
  36. 5  xbmc/video/windows/GUIWindowVideoPlaylist.cpp
3  xbmc/Application.cpp
@@ -1808,8 +1808,7 @@ void CApplication::LoadSkin(const SkinPtr& skin)
1808 1808
   g_fontManager.LoadFonts(CSettings::Get().GetString("lookandfeel.font"));
1809 1809
 
1810 1810
   // load in the skin strings
1811  
-  CStdString langPath;
1812  
-  URIUtils::AddFileToFolder(skin->Path(), "language", langPath);
  1811
+  CStdString langPath = URIUtils::AddFileToFolder(skin->Path(), "language");
1813 1812
   URIUtils::AddSlashAtEnd(langPath);
1814 1813
 
1815 1814
   g_localizeStrings.LoadSkinStrings(langPath, CSettings::Get().GetString("locale.language"));
2  xbmc/CueDocument.cpp
@@ -362,7 +362,7 @@ bool CCueDocument::ResolvePath(CStdString &strPath, const CStdString &strBase)
362 362
 
363 363
   CStdString strFilename = URIUtils::GetFileName(strPath);
364 364
 
365  
-  URIUtils::AddFileToFolder(strDirectory, strFilename, strPath);
  365
+  strPath = URIUtils::AddFileToFolder(strDirectory, strFilename);
366 366
 
367 367
   // i *hate* windows
368 368
   if (!CFile::Exists(strPath))
4  xbmc/Favourites.cpp
@@ -40,7 +40,7 @@ bool CFavourites::Load(CFileItemList &items)
40 40
     CFavourites::LoadFavourites(favourites, items);
41 41
   else
42 42
     CLog::Log(LOGDEBUG, "CFavourites::Load - no system favourites found, skipping");
43  
-  URIUtils::AddFileToFolder(CProfilesManager::Get().GetProfileUserDataFolder(), "favourites.xml", favourites);
  43
+  favourites = URIUtils::AddFileToFolder(CProfilesManager::Get().GetProfileUserDataFolder(), "favourites.xml");
44 44
   if(XFILE::CFile::Exists(favourites))
45 45
     CFavourites::LoadFavourites(favourites, items);
46 46
   else
@@ -108,7 +108,7 @@ bool CFavourites::Save(const CFileItemList &items)
108 108
     rootNode->InsertEndChild(favNode);
109 109
   }
110 110
 
111  
-  URIUtils::AddFileToFolder(CProfilesManager::Get().GetProfileUserDataFolder(), "favourites.xml", favourites);
  111
+  favourites = URIUtils::AddFileToFolder(CProfilesManager::Get().GetProfileUserDataFolder(), "favourites.xml");
112 112
   return doc.SaveFile(favourites);
113 113
 }
114 114
 
38  xbmc/FileItem.cpp
@@ -2321,13 +2321,13 @@ void CFileItemList::StackFolders()
2321 2321
         {
2322 2322
           CStdString path;
2323 2323
           CStdString dvdPath;
2324  
-          URIUtils::AddFileToFolder(item->GetPath(), "VIDEO_TS.IFO", path);
  2324
+          path = URIUtils::AddFileToFolder(item->GetPath(), "VIDEO_TS.IFO");
2325 2325
           if (CFile::Exists(path))
2326 2326
             dvdPath = path;
2327 2327
           else
2328 2328
           {
2329  
-            URIUtils::AddFileToFolder(item->GetPath(), "VIDEO_TS", dvdPath);
2330  
-            URIUtils::AddFileToFolder(dvdPath, "VIDEO_TS.IFO", path);
  2329
+            dvdPath = URIUtils::AddFileToFolder(item->GetPath(), "VIDEO_TS");
  2330
+            path = URIUtils::AddFileToFolder(dvdPath, "VIDEO_TS.IFO");
2331 2331
             dvdPath.Empty();
2332 2332
             if (CFile::Exists(path))
2333 2333
               dvdPath = path;
@@ -2335,13 +2335,13 @@ void CFileItemList::StackFolders()
2335 2335
 #ifdef HAVE_LIBBLURAY
2336 2336
           if (dvdPath.IsEmpty())
2337 2337
           {
2338  
-            URIUtils::AddFileToFolder(item->GetPath(), "index.bdmv", path);
  2338
+            path = URIUtils::AddFileToFolder(item->GetPath(), "index.bdmv");
2339 2339
             if (CFile::Exists(path))
2340 2340
               dvdPath = path;
2341 2341
             else
2342 2342
             {
2343  
-              URIUtils::AddFileToFolder(item->GetPath(), "BDMV", dvdPath);
2344  
-              URIUtils::AddFileToFolder(dvdPath, "index.bdmv", path);
  2343
+              dvdPath = URIUtils::AddFileToFolder(item->GetPath(), "BDMV");
  2344
+              path = URIUtils::AddFileToFolder(dvdPath, "index.bdmv");
2345 2345
               dvdPath.Empty();
2346 2346
               if (CFile::Exists(path))
2347 2347
                 dvdPath = path;
@@ -2685,11 +2685,11 @@ CStdString CFileItem::GetTBNFile() const
2685 2685
     URIUtils::GetParentPath(m_strPath,strPath);
2686 2686
     CFileItem item(CStackDirectory::GetFirstStackedFile(strFile),false);
2687 2687
     CStdString strTBNFile = item.GetTBNFile();
2688  
-    URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strTBNFile),strReturn);
  2688
+    strReturn = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(strTBNFile));
2689 2689
     if (CFile::Exists(strReturn))
2690 2690
       return strReturn;
2691 2691
 
2692  
-    URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(strFile)),strFile);
  2692
+    strFile = URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(strFile)));
2693 2693
   }
2694 2694
 
2695 2695
   if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile))
@@ -2697,7 +2697,7 @@ CStdString CFileItem::GetTBNFile() const
2697 2697
     CStdString strPath, strParent;
2698 2698
     URIUtils::GetDirectory(strFile,strPath);
2699 2699
     URIUtils::GetParentPath(strPath,strParent);
2700  
-    URIUtils::AddFileToFolder(strParent,URIUtils::GetFileName(m_strPath),strFile);
  2700
+    strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(m_strPath));
2701 2701
   }
2702 2702
 
2703 2703
   CURL url(strFile);
@@ -2766,7 +2766,7 @@ CStdString CFileItem::GetLocalArt(const std::string &artFile, bool useFolder) co
2766 2766
     */
2767 2767
     CStdString strPath;
2768 2768
     URIUtils::GetParentPath(m_strPath,strPath);
2769  
-    URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(strFile)),strFile);
  2769
+    strFile = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(strFile)));
2770 2770
   }
2771 2771
 
2772 2772
   if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile))
@@ -2774,7 +2774,7 @@ CStdString CFileItem::GetLocalArt(const std::string &artFile, bool useFolder) co
2774 2774
     CStdString strPath, strParent;
2775 2775
     URIUtils::GetDirectory(strFile,strPath);
2776 2776
     URIUtils::GetParentPath(strPath,strParent);
2777  
-    URIUtils::AddFileToFolder(strParent,URIUtils::GetFileName(strFile),strFile);
  2777
+    strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(strFile));
2778 2778
   }
2779 2779
 
2780 2780
   if (IsMultiPath())
@@ -2808,7 +2808,6 @@ CStdString CFileItem::GetLocalArt(const std::string &artFile, bool useFolder) co
2808 2808
 
2809 2809
 CStdString CFileItem::GetFolderThumb(const CStdString &folderJPG /* = "folder.jpg" */) const
2810 2810
 {
2811  
-  CStdString folderThumb;
2812 2811
   CStdString strFolder = m_strPath;
2813 2812
 
2814 2813
   if (IsStack() ||
@@ -2821,8 +2820,7 @@ CStdString CFileItem::GetFolderThumb(const CStdString &folderJPG /* = "folder.jp
2821 2820
   if (IsMultiPath())
2822 2821
     strFolder = CMultiPathDirectory::GetFirstPath(m_strPath);
2823 2822
 
2824  
-  URIUtils::AddFileToFolder(strFolder, folderJPG, folderThumb);
2825  
-  return folderThumb;
  2823
+  return URIUtils::AddFileToFolder(strFolder, folderJPG);
2826 2824
 }
2827 2825
 
2828 2826
 CStdString CFileItem::GetMovieName(bool bUseFolderNames /* = false */) const
@@ -2895,17 +2893,17 @@ CStdString CFileItem::GetLocalFanart() const
2895 2893
     CStackDirectory dir;
2896 2894
     CStdString strPath2;
2897 2895
     strPath2 = dir.GetStackedTitlePath(strFile);
2898  
-    URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strPath2),strFile);
  2896
+    strFile = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(strPath2));
2899 2897
     CFileItem item(dir.GetFirstStackedFile(m_strPath),false);
2900 2898
     CStdString strTBNFile(URIUtils::ReplaceExtension(item.GetTBNFile(), "-fanart"));
2901  
-    URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strTBNFile),strFile2);
  2899
+    strFile2 = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(strTBNFile));
2902 2900
   }
2903 2901
   if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile))
2904 2902
   {
2905 2903
     CStdString strPath, strParent;
2906 2904
     URIUtils::GetDirectory(strFile,strPath);
2907 2905
     URIUtils::GetParentPath(strPath,strParent);
2908  
-    URIUtils::AddFileToFolder(strParent,URIUtils::GetFileName(m_strPath),strFile);
  2906
+    strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(m_strPath));
2909 2907
   }
2910 2908
 
2911 2909
   // no local fanart available for these
@@ -3151,17 +3149,17 @@ CStdString CFileItem::FindTrailer() const
3151 3149
     CStackDirectory dir;
3152 3150
     CStdString strPath2;
3153 3151
     strPath2 = dir.GetStackedTitlePath(strFile);
3154  
-    URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strPath2),strFile);
  3152
+    strFile = URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strPath2));
3155 3153
     CFileItem item(dir.GetFirstStackedFile(m_strPath),false);
3156 3154
     CStdString strTBNFile(URIUtils::ReplaceExtension(item.GetTBNFile(), "-trailer"));
3157  
-    URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strTBNFile),strFile2);
  3155
+    strFile2 = URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strTBNFile));
3158 3156
   }
3159 3157
   if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile))
3160 3158
   {
3161 3159
     CStdString strPath, strParent;
3162 3160
     URIUtils::GetDirectory(strFile,strPath);
3163 3161
     URIUtils::GetParentPath(strPath,strParent);
3164  
-    URIUtils::AddFileToFolder(strParent,URIUtils::GetFileName(m_strPath),strFile);
  3162
+    strFile = URIUtils::AddFileToFolder(strParent,URIUtils::GetFileName(m_strPath));
3165 3163
   }
3166 3164
 
3167 3165
   // no local trailer available for these
46  xbmc/Util.cpp
@@ -1318,56 +1318,49 @@ int CUtil::GetMatchingSource(const CStdString& strPath1, VECSOURCES& VECSOURCES,
1318 1318
 
1319 1319
 CStdString CUtil::TranslateSpecialSource(const CStdString &strSpecial)
1320 1320
 {
1321  
-  CStdString strReturn=strSpecial;
1322 1321
   if (!strSpecial.IsEmpty() && strSpecial[0] == '$')
1323 1322
   {
1324 1323
     if (strSpecial.Left(5).Equals("$HOME"))
1325  
-      URIUtils::AddFileToFolder("special://home/", strSpecial.Mid(5), strReturn);
  1324
+      return URIUtils::AddFileToFolder("special://home/", strSpecial.Mid(5));
1326 1325
     else if (strSpecial.Left(10).Equals("$SUBTITLES"))
1327  
-      URIUtils::AddFileToFolder("special://subtitles/", strSpecial.Mid(10), strReturn);
  1326
+      return URIUtils::AddFileToFolder("special://subtitles/", strSpecial.Mid(10));
1328 1327
     else if (strSpecial.Left(9).Equals("$USERDATA"))
1329  
-      URIUtils::AddFileToFolder("special://userdata/", strSpecial.Mid(9), strReturn);
  1328
+      return URIUtils::AddFileToFolder("special://userdata/", strSpecial.Mid(9));
1330 1329
     else if (strSpecial.Left(9).Equals("$DATABASE"))
1331  
-      URIUtils::AddFileToFolder("special://database/", strSpecial.Mid(9), strReturn);
  1330
+      return URIUtils::AddFileToFolder("special://database/", strSpecial.Mid(9));
1332 1331
     else if (strSpecial.Left(11).Equals("$THUMBNAILS"))
1333  
-      URIUtils::AddFileToFolder("special://thumbnails/", strSpecial.Mid(11), strReturn);
  1332
+      return URIUtils::AddFileToFolder("special://thumbnails/", strSpecial.Mid(11));
1334 1333
     else if (strSpecial.Left(11).Equals("$RECORDINGS"))
1335  
-      URIUtils::AddFileToFolder("special://recordings/", strSpecial.Mid(11), strReturn);
  1334
+      return URIUtils::AddFileToFolder("special://recordings/", strSpecial.Mid(11));
1336 1335
     else if (strSpecial.Left(12).Equals("$SCREENSHOTS"))
1337  
-      URIUtils::AddFileToFolder("special://screenshots/", strSpecial.Mid(12), strReturn);
  1336
+      return URIUtils::AddFileToFolder("special://screenshots/", strSpecial.Mid(12));
1338 1337
     else if (strSpecial.Left(15).Equals("$MUSICPLAYLISTS"))
1339  
-      URIUtils::AddFileToFolder("special://musicplaylists/", strSpecial.Mid(15), strReturn);
  1338
+      return URIUtils::AddFileToFolder("special://musicplaylists/", strSpecial.Mid(15));
1340 1339
     else if (strSpecial.Left(15).Equals("$VIDEOPLAYLISTS"))
1341  
-      URIUtils::AddFileToFolder("special://videoplaylists/", strSpecial.Mid(15), strReturn);
  1340
+      return URIUtils::AddFileToFolder("special://videoplaylists/", strSpecial.Mid(15));
1342 1341
     else if (strSpecial.Left(7).Equals("$CDRIPS"))
1343  
-      URIUtils::AddFileToFolder("special://cdrips/", strSpecial.Mid(7), strReturn);
  1342
+      return URIUtils::AddFileToFolder("special://cdrips/", strSpecial.Mid(7));
1344 1343
     // this one will be removed post 2.0
1345 1344
     else if (strSpecial.Left(10).Equals("$PLAYLISTS"))
1346  
-      URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), strSpecial.Mid(10), strReturn);
  1345
+      return URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), strSpecial.Mid(10));
1347 1346
   }
1348  
-  return strReturn;
  1347
+  return strSpecial;
1349 1348
 }
1350 1349
 
1351 1350
 CStdString CUtil::MusicPlaylistsLocation()
1352 1351
 {
1353 1352
   vector<CStdString> vec;
1354  
-  CStdString strReturn;
1355  
-  URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "music", strReturn);
1356  
-  vec.push_back(strReturn);
1357  
-  URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "mixed", strReturn);
1358  
-  vec.push_back(strReturn);
1359  
-  return XFILE::CMultiPathDirectory::ConstructMultiPath(vec);;
  1353
+  vec.push_back(URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "music"));
  1354
+  vec.push_back(URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "mixed"));
  1355
+  return XFILE::CMultiPathDirectory::ConstructMultiPath(vec);
1360 1356
 }
1361 1357
 
1362 1358
 CStdString CUtil::VideoPlaylistsLocation()
1363 1359
 {
1364 1360
   vector<CStdString> vec;
1365  
-  CStdString strReturn;
1366  
-  URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "video", strReturn);
1367  
-  vec.push_back(strReturn);
1368  
-  URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "mixed", strReturn);
1369  
-  vec.push_back(strReturn);
1370  
-  return XFILE::CMultiPathDirectory::ConstructMultiPath(vec);;
  1361
+  vec.push_back(URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "video"));
  1362
+  vec.push_back(URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "mixed"));
  1363
+  return XFILE::CMultiPathDirectory::ConstructMultiPath(vec);
1371 1364
 }
1372 1365
 
1373 1366
 void CUtil::DeleteMusicDatabaseDirectoryCache()
@@ -1568,8 +1561,7 @@ CStdString CUtil::GetDefaultFolderThumb(const CStdString &folderThumb)
1568 1561
 
1569 1562
 void CUtil::GetSkinThemes(vector<CStdString>& vecTheme)
1570 1563
 {
1571  
-  CStdString strPath;
1572  
-  URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(),"media",strPath);
  1564
+  CStdString strPath = URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(), "media");
1573 1565
   CFileItemList items;
1574 1566
   CDirectory::GetDirectory(strPath, items);
1575 1567
   // Search for Themes in the Current skin!
6  xbmc/addons/Addon.cpp
@@ -252,7 +252,7 @@ CAddon::CAddon(const cp_extension_t *ext)
252 252
 {
253 253
   BuildLibName(ext);
254 254
   BuildProfilePath();
255  
-  URIUtils::AddFileToFolder(Profile(), "settings.xml", m_userSettingsPath);
  255
+  m_userSettingsPath = URIUtils::AddFileToFolder(Profile(), "settings.xml");
256 256
   m_enabled = true;
257 257
   m_hasSettings = true;
258 258
   m_hasStrings = false;
@@ -280,7 +280,7 @@ CAddon::CAddon(const AddonProps &props)
280 280
   if (props.libname.IsEmpty()) BuildLibName();
281 281
   else m_strLibName = props.libname;
282 282
   BuildProfilePath();
283  
-  URIUtils::AddFileToFolder(Profile(), "settings.xml", m_userSettingsPath);
  283
+  m_userSettingsPath = URIUtils::AddFileToFolder(Profile(), "settings.xml");
284 284
   m_enabled = true;
285 285
   m_hasSettings = true;
286 286
   m_hasStrings = false;
@@ -299,7 +299,7 @@ CAddon::CAddon(const CAddon &rhs, const AddonPtr &parent)
299 299
   m_userSettingsLoaded = rhs.m_userSettingsLoaded;
300 300
   m_hasSettings = rhs.m_hasSettings;
301 301
   BuildProfilePath();
302  
-  URIUtils::AddFileToFolder(Profile(), "settings.xml", m_userSettingsPath);
  302
+  m_userSettingsPath = URIUtils::AddFileToFolder(Profile(), "settings.xml");
303 303
   m_strLibName  = rhs.m_strLibName;
304 304
   m_enabled = rhs.Enabled();
305 305
   m_hasStrings  = false;
14  xbmc/addons/AddonCallbacksGUI.cpp
@@ -187,10 +187,9 @@ GUIHANDLE CAddonCallbacksGUI::Window_New(void *addonData, const char *xmlFilenam
187 187
     if (!XFILE::CFile::Exists(strSkinPath))
188 188
     {
189 189
       /* Check for the matching folder for the skin in the fallback skins folder */
190  
-      CStdString basePath;
191  
-      URIUtils::AddFileToFolder(guiHelper->m_addon->Path(), "resources", basePath);
192  
-      URIUtils::AddFileToFolder(basePath, "skins", basePath);
193  
-      URIUtils::AddFileToFolder(basePath, URIUtils::GetFileName(g_SkinInfo->Path()), basePath);
  190
+      CStdString basePath = URIUtils::AddFileToFolder(guiHelper->m_addon->Path(), "resources");
  191
+      basePath = URIUtils::AddFileToFolder(basePath, "skins");
  192
+      basePath = URIUtils::AddFileToFolder(basePath, URIUtils::GetFileName(g_SkinInfo->Path()));
194 193
       strSkinPath = g_SkinInfo->GetSkinPath(xmlFilename, &res, basePath);
195 194
       if (!XFILE::CFile::Exists(strSkinPath))
196 195
       {
@@ -206,10 +205,9 @@ GUIHANDLE CAddonCallbacksGUI::Window_New(void *addonData, const char *xmlFilenam
206 205
     //FIXME make this static method of current skin?
207 206
     CStdString str("none");
208 207
     AddonProps props(str, ADDON_SKIN, str, str);
209  
-    CStdString basePath;
210  
-    URIUtils::AddFileToFolder(guiHelper->m_addon->Path(), "resources", basePath);
211  
-    URIUtils::AddFileToFolder(basePath, "skins", basePath);
212  
-    URIUtils::AddFileToFolder(basePath, defaultSkin, basePath);
  208
+    CStdString basePath = URIUtils::AddFileToFolder(guiHelper->m_addon->Path(), "resources");
  209
+    basePath = URIUtils::AddFileToFolder(basePath, "skins");
  210
+    basePath = URIUtils::AddFileToFolder(basePath, defaultSkin);
213 211
     props.path = basePath;
214 212
 
215 213
     CSkinInfo skinInfo(props);
2  xbmc/cdrip/CDDARipper.cpp
@@ -193,7 +193,7 @@ bool CCDDARipper::CreateAlbumDir(const MUSIC_INFO::CMusicInfoTag& infoTag, CStdS
193 193
 
194 194
   if (!strAlbumDir.IsEmpty())
195 195
   {
196  
-    URIUtils::AddFileToFolder(strDirectory, strAlbumDir, strDirectory);
  196
+    strDirectory = URIUtils::AddFileToFolder(strDirectory, strAlbumDir);
197 197
     URIUtils::AddSlashAtEnd(strDirectory);
198 198
   }
199 199
 
3  xbmc/dbwrappers/sqlitedataset.cpp
@@ -211,8 +211,7 @@ int SqliteDatabase::connect(bool create) {
211 211
 
212 212
   //CLog::Log(LOGDEBUG, "Connecting to sqlite:%s:%s", host.c_str(), db.c_str());
213 213
 
214  
-  CStdString db_fullpath;
215  
-  URIUtils::AddFileToFolder(host, db, db_fullpath);
  214
+  CStdString db_fullpath = URIUtils::AddFileToFolder(host, db);
216 215
 
217 216
   try
218 217
   {
6  xbmc/dialogs/GUIDialogFileBrowser.cpp
@@ -205,7 +205,6 @@ bool CGUIDialogFileBrowser::OnMessage(CGUIMessage& message)
205 205
       {
206 206
         if (m_browsingForFolders == 2)
207 207
         {
208  
-          CStdString strTest;
209 208
           int iItem = m_viewControl.GetSelectedItem();
210 209
 
211 210
           CStdString strPath;
@@ -214,7 +213,7 @@ bool CGUIDialogFileBrowser::OnMessage(CGUIMessage& message)
214 213
           else
215 214
             strPath = (*m_vecItems)[iItem]->GetPath();
216 215
 
217  
-          URIUtils::AddFileToFolder(strPath,"1",strTest);
  216
+          CStdString strTest = URIUtils::AddFileToFolder(strPath, "1");
218 217
           CFile file;
219 218
           if (file.OpenForWrite(strTest,true))
220 219
           {
@@ -252,8 +251,7 @@ bool CGUIDialogFileBrowser::OnMessage(CGUIMessage& message)
252 251
         CStdString strInput;
253 252
         if (CGUIKeyboardFactory::ShowAndGetInput(strInput,g_localizeStrings.Get(119),false))
254 253
         {
255  
-          CStdString strPath;
256  
-          URIUtils::AddFileToFolder(m_vecItems->GetPath(),strInput,strPath);
  254
+          CStdString strPath = URIUtils::AddFileToFolder(m_vecItems->GetPath(), strInput);
257 255
           if (CDirectory::Create(strPath))
258 256
             Update(m_vecItems->GetPath());
259 257
           else
2  xbmc/filesystem/CurlFile.cpp
@@ -476,7 +476,7 @@ void CCurlFile::SetCommonOptions(CReadState* state)
476 476
   // Enable cookie engine for current handle to re-use them in future requests
477 477
   CStdString strCookieFile;
478 478
   CStdString strTempPath = CSpecialProtocol::TranslatePath(g_advancedSettings.m_cachePath);
479  
-  URIUtils::AddFileToFolder(strTempPath, "cookies.dat", strCookieFile);
  479
+  strCookieFile = URIUtils::AddFileToFolder(strTempPath, "cookies.dat");
480 480
 
481 481
   g_curlInterface.easy_setopt(h, CURLOPT_COOKIEFILE, strCookieFile.c_str());
482 482
   g_curlInterface.easy_setopt(h, CURLOPT_COOKIEJAR, strCookieFile.c_str());
4  xbmc/filesystem/RarManager.cpp
@@ -136,8 +136,8 @@ bool CRarManager::CacheRarredFile(CStdString& strPathInCache, const CStdString&
136 136
   strPath.Replace('/', '\\');
137 137
 #endif
138 138
   //g_charsetConverter.unknownToUTF8(strPath);
139  
-  CStdString strCachedPath;
140  
-  URIUtils::AddFileToFolder(strDir + "rarfolder%04d", URIUtils::GetFileName(strPathInRar), strCachedPath);
  139
+  CStdString strCachedPath = URIUtils::AddFileToFolder(strDir + "rarfolder%04d",
  140
+                                           URIUtils::GetFileName(strPathInRar));
141 141
   strCachedPath = CUtil::GetNextPathname(strCachedPath, 9999);
142 142
   if (strCachedPath.IsEmpty())
143 143
   {
22  xbmc/filesystem/SpecialProtocol.cpp
@@ -129,25 +129,25 @@ CStdString CSpecialProtocol::TranslatePath(const CURL &url)
129 129
     RootDir = FullFileName;
130 130
 
131 131
   if (RootDir.Equals("subtitles"))
132  
-    URIUtils::AddFileToFolder(CSettings::Get().GetString("subtitles.custompath"), FileName, translatedPath);
  132
+    translatedPath = URIUtils::AddFileToFolder(CSettings::Get().GetString("subtitles.custompath"), FileName);
133 133
   else if (RootDir.Equals("userdata"))
134  
-    URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), FileName, translatedPath);
  134
+    translatedPath = URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), FileName);
135 135
   else if (RootDir.Equals("database"))
136  
-    URIUtils::AddFileToFolder(CProfilesManager::Get().GetDatabaseFolder(), FileName, translatedPath);
  136
+    translatedPath = URIUtils::AddFileToFolder(CProfilesManager::Get().GetDatabaseFolder(), FileName);
137 137
   else if (RootDir.Equals("thumbnails"))
138  
-    URIUtils::AddFileToFolder(CProfilesManager::Get().GetThumbnailsFolder(), FileName, translatedPath);
  138
+    translatedPath = URIUtils::AddFileToFolder(CProfilesManager::Get().GetThumbnailsFolder(), FileName);
139 139
   else if (RootDir.Equals("recordings") || RootDir.Equals("cdrips"))
140  
-    URIUtils::AddFileToFolder(CSettings::Get().GetString("audiocds.recordingpath"), FileName, translatedPath);
  140
+    translatedPath = URIUtils::AddFileToFolder(CSettings::Get().GetString("audiocds.recordingpath"), FileName);
141 141
   else if (RootDir.Equals("screenshots"))
142  
-    URIUtils::AddFileToFolder(CSettings::Get().GetString("debug.screenshotpath"), FileName, translatedPath);
  142
+    translatedPath = URIUtils::AddFileToFolder(CSettings::Get().GetString("debug.screenshotpath"), FileName);
143 143
   else if (RootDir.Equals("musicplaylists"))
144  
-    URIUtils::AddFileToFolder(CUtil::MusicPlaylistsLocation(), FileName, translatedPath);
  144
+    translatedPath = URIUtils::AddFileToFolder(CUtil::MusicPlaylistsLocation(), FileName);
145 145
   else if (RootDir.Equals("videoplaylists"))
146  
-    URIUtils::AddFileToFolder(CUtil::VideoPlaylistsLocation(), FileName, translatedPath);
  146
+    translatedPath = URIUtils::AddFileToFolder(CUtil::VideoPlaylistsLocation(), FileName);
147 147
   else if (RootDir.Equals("skin"))
148  
-    URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(), FileName, translatedPath);
  148
+    translatedPath = URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(), FileName);
149 149
   else if (RootDir.Equals("logpath"))
150  
-    URIUtils::AddFileToFolder(g_advancedSettings.m_logFolder, FileName, translatedPath);
  150
+    translatedPath = URIUtils::AddFileToFolder(g_advancedSettings.m_logFolder, FileName);
151 151
 
152 152
 
153 153
   // from here on, we have our "real" special paths
@@ -162,7 +162,7 @@ CStdString CSpecialProtocol::TranslatePath(const CURL &url)
162 162
   {
163 163
     CStdString basePath = GetPath(RootDir);
164 164
     if (!basePath.IsEmpty())
165  
-      URIUtils::AddFileToFolder(basePath, FileName, translatedPath);
  165
+      translatedPath = URIUtils::AddFileToFolder(basePath, FileName);
166 166
     else
167 167
       translatedPath.clear();
168 168
   }
6  xbmc/filesystem/StackDirectory.cpp
@@ -48,7 +48,6 @@ namespace XFILE
48 48
     {
49 49
       CStdString file = files[i];
50 50
       CFileItemPtr item(new CFileItem(file));
51  
-      //URIUtils::AddFileToFolder(folder, file, item->GetPath());
52 51
       item->SetPath(file);
53 52
       item->m_bIsFolder = false;
54 53
       items.Add(item);
@@ -159,7 +158,7 @@ namespace XFILE
159 158
   {
160 159
     // the stacked files are always in volume order, so just get up to the first filename
161 160
     // occurence of " , "
162  
-    CStdString path, file, folder;
  161
+    CStdString file, folder;
163 162
     int pos = strPath.Find(" , ");
164 163
     if (pos > 0)
165 164
       URIUtils::Split(strPath.Left(pos), folder, file);
@@ -169,9 +168,8 @@ namespace XFILE
169 168
     // remove "stack://" from the folder
170 169
     folder = folder.Mid(8);
171 170
     file.Replace(",,", ",");
172  
-    URIUtils::AddFileToFolder(folder, file, path);
173 171
 
174  
-    return path;
  172
+    return URIUtils::AddFileToFolder(folder, file);
175 173
   }
176 174
 
177 175
   bool CStackDirectory::GetPaths(const CStdString& strPath, vector<CStdString>& vecPaths)
7  xbmc/guilib/GUIColorManager.cpp
@@ -52,9 +52,8 @@ void CGUIColorManager::Load(const CStdString &colorFile)
52 52
     LoadXML(xmlDoc);
53 53
 
54 54
   // first load the default color map if it exists
55  
-  CStdString path, basePath;
56  
-  URIUtils::AddFileToFolder(g_SkinInfo->Path(), "colors", basePath);
57  
-  URIUtils::AddFileToFolder(basePath, "defaults.xml", path);
  55
+  CStdString basePath = URIUtils::AddFileToFolder(g_SkinInfo->Path(), "colors");
  56
+  CStdString path = URIUtils::AddFileToFolder(basePath, "defaults.xml");
58 57
 
59 58
   if (xmlDoc.LoadFile(CSpecialProtocol::TranslatePathConvertCase(path)))
60 59
     LoadXML(xmlDoc);
@@ -63,7 +62,7 @@ void CGUIColorManager::Load(const CStdString &colorFile)
63 62
   if (colorFile.CompareNoCase("SKINDEFAULT") == 0)
64 63
     return; // nothing to do
65 64
 
66  
-  URIUtils::AddFileToFolder(basePath, colorFile, path);
  65
+  path = URIUtils::AddFileToFolder(basePath, colorFile);
67 66
   CLog::Log(LOGINFO, "Loading colors from %s", path.c_str());
68 67
 
69 68
   if (xmlDoc.LoadFile(path))
3  xbmc/input/ButtonTranslator.cpp
@@ -564,8 +564,7 @@ bool CButtonTranslator::Load(bool AlwaysLoad)
564 564
 #else
565 565
 #define REMOTEMAP "IRSSmap.xml"
566 566
 #endif
567  
-  CStdString lircmapPath;
568  
-  URIUtils::AddFileToFolder("special://xbmc/system/", REMOTEMAP, lircmapPath);
  567
+  CStdString lircmapPath = URIUtils::AddFileToFolder("special://xbmc/system/", REMOTEMAP);
569 568
   lircRemotesMap.clear();
570 569
   if(CFile::Exists(lircmapPath))
571 570
     success |= LoadLircMap(lircmapPath);
2  xbmc/interfaces/Builtins.cpp
@@ -1421,7 +1421,7 @@ int CBuiltins::Execute(const CStdString& execString)
1421 1421
       else
1422 1422
       {
1423 1423
         if (URIUtils::HasSlashAtEnd(path))
1424  
-          URIUtils::AddFileToFolder(path, "musicdb.xml", path);
  1424
+          path = URIUtils::AddFileToFolder(path, "musicdb.xml");
1425 1425
         CMusicDatabase musicdatabase;
1426 1426
         musicdatabase.Open();
1427 1427
         musicdatabase.ExportToXML(path, singleFile, thumbs, overwrite);
5  xbmc/interfaces/legacy/WindowXML.cpp
@@ -512,9 +512,8 @@ namespace XBMCAddon
512 512
     {
513 513
       TRACE;
514 514
       // Path where the language strings reside
515  
-      CStdString pathToLanguageFile = m_scriptPath;
516  
-      URIUtils::AddFileToFolder(pathToLanguageFile, "resources", pathToLanguageFile);
517  
-      URIUtils::AddFileToFolder(pathToLanguageFile, "language", pathToLanguageFile);
  515
+      CStdString pathToLanguageFile = URIUtils::AddFileToFolder(m_scriptPath, "resources");
  516
+      pathToLanguageFile = URIUtils::AddFileToFolder(pathToLanguageFile, "language");
518 517
       URIUtils::AddSlashAtEnd(pathToLanguageFile);
519 518
 
520 519
       // allocate a bunch of strings
14  xbmc/music/MusicDatabase.cpp
@@ -949,7 +949,7 @@ CSong CMusicDatabase::GetSongFromDataset(bool bWithMusicDbPath/*=false*/)
949 949
 
950 950
   // Get filename with full path
951 951
   if (!bWithMusicDbPath)
952  
-    URIUtils::AddFileToFolder(m_pDS->fv(song_strPath).get_asString(), m_pDS->fv(song_strFileName).get_asString(), song.strFileName);
  952
+    song.strFileName = URIUtils::AddFileToFolder(m_pDS->fv(song_strPath).get_asString(), m_pDS->fv(song_strFileName).get_asString());
953 953
   else
954 954
   {
955 955
     CStdString strFileName = m_pDS->fv(song_strFileName).get_asString();
@@ -990,8 +990,7 @@ void CMusicDatabase::GetFileItemFromDataset(const dbiplus::sql_record* const rec
990 990
   item->GetMusicInfoTag()->SetComment(record->at(song_comment).get_asString());
991 991
   item->GetMusicInfoTag()->SetPlayCount(record->at(song_iTimesPlayed).get_asInt());
992 992
   item->GetMusicInfoTag()->SetLastPlayed(record->at(song_lastplayed).get_asString());
993  
-  CStdString strRealPath;
994  
-  URIUtils::AddFileToFolder(record->at(song_strPath).get_asString(), record->at(song_strFileName).get_asString(), strRealPath);
  993
+  CStdString strRealPath = URIUtils::AddFileToFolder(record->at(song_strPath).get_asString(), record->at(song_strFileName).get_asString());
995 994
   item->GetMusicInfoTag()->SetURL(strRealPath);
996 995
   item->GetMusicInfoTag()->SetCompilation(record->at(song_bCompilation).get_asInt() == 1);
997 996
   item->GetMusicInfoTag()->SetAlbumArtist(record->at(song_strAlbumArtists).get_asString());
@@ -2017,8 +2016,7 @@ bool CMusicDatabase::CleanupSongsByIds(const CStdString &strSongIds)
2017 2016
     CStdString strSongsToDelete = "";
2018 2017
     while (!m_pDS->eof())
2019 2018
     { // get the full song path
2020  
-      CStdString strFileName;
2021  
-      URIUtils::AddFileToFolder(m_pDS->fv("path.strPath").get_asString(), m_pDS->fv("song.strFileName").get_asString(), strFileName);
  2019
+      CStdString strFileName = URIUtils::AddFileToFolder(m_pDS->fv("path.strPath").get_asString(), m_pDS->fv("song.strFileName").get_asString());
2022 2020
 
2023 2021
       //  Special case for streams inside an ogg file. (oggstream)
2024 2022
       //  The last dir in the path is the ogg file that
@@ -4597,8 +4595,7 @@ void CMusicDatabase::ExportToXML(const CStdString &xmlFile, bool singleFiles, bo
4597 4595
           CLog::Log(LOGDEBUG, "%s - Not exporting item %s as it does not exist", __FUNCTION__, strPath.c_str());
4598 4596
         else
4599 4597
         {
4600  
-          CStdString nfoFile;
4601  
-          URIUtils::AddFileToFolder(strPath, "album.nfo", nfoFile);
  4598
+          CStdString nfoFile = URIUtils::AddFileToFolder(strPath, "album.nfo");
4602 4599
           if (overwrite || !CFile::Exists(nfoFile))
4603 4600
           {
4604 4601
             if (!xmlDoc.SaveFile(nfoFile))
@@ -4682,8 +4679,7 @@ void CMusicDatabase::ExportToXML(const CStdString &xmlFile, bool singleFiles, bo
4682 4679
           CLog::Log(LOGDEBUG, "%s - Not exporting item %s as it does not exist", __FUNCTION__, strPath.c_str());
4683 4680
         else
4684 4681
         {
4685  
-          CStdString nfoFile;
4686  
-          URIUtils::AddFileToFolder(strPath, "artist.nfo", nfoFile);
  4682
+          CStdString nfoFile = URIUtils::AddFileToFolder(strPath, "artist.nfo");
4687 4683
           if (overwrite || !CFile::Exists(nfoFile))
4688 4684
           {
4689 4685
             if (!xmlDoc.SaveFile(nfoFile))
2  xbmc/music/dialogs/GUIDialogMusicInfo.cpp
@@ -373,7 +373,7 @@ void CGUIDialogMusicInfo::OnGetThumb()
373 373
     database.Open();
374 374
     CStdString strArtistPath;
375 375
     if (database.GetArtistPath(m_artist.idArtist,strArtistPath))
376  
-      URIUtils::AddFileToFolder(strArtistPath,"folder.jpg",localThumb);
  376
+      localThumb = URIUtils::AddFileToFolder(strArtistPath, "folder.jpg");
377 377
   }
378 378
   else
379 379
     localThumb = m_albumItem->GetUserMusicThumb();
2  xbmc/music/dialogs/GUIDialogSongInfo.cpp
@@ -262,7 +262,7 @@ void CGUIDialogSongInfo::OnGetThumb()
262 262
   // Grab the thumbnail from the web
263 263
   /*
264 264
   CStdString thumbFromWeb;
265  
-  URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath, "allmusicThumb.jpg", thumbFromWeb);
  265
+  thumbFromWeb = URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath, "allmusicThumb.jpg");
266 266
   if (DownloadThumbnail(thumbFromWeb))
267 267
   {
268 268
     CFileItemPtr item(new CFileItem("thumb://allmusic.com", false));
6  xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -1152,8 +1152,7 @@ INFO_RET CMusicInfoScanner::DownloadAlbumInfo(const CAlbum& album, ADDON::Scrape
1152 1152
   }
1153 1153
 
1154 1154
   // handle nfo files
1155  
-  CStdString strNfo;
1156  
-  URIUtils::AddFileToFolder(album.strPath, "album.nfo", strNfo);
  1155
+  CStdString strNfo = URIUtils::AddFileToFolder(album.strPath, "album.nfo");
1157 1156
   CNfoFile::NFOResult result = CNfoFile::NO_NFO;
1158 1157
   CNfoFile nfoReader;
1159 1158
   if (XFILE::CFile::Exists(strNfo))
@@ -1366,8 +1365,7 @@ INFO_RET CMusicInfoScanner::DownloadArtistInfo(const CArtist& artist, ADDON::Scr
1366 1365
   }
1367 1366
 
1368 1367
   // handle nfo files
1369  
-  CStdString strNfo;
1370  
-  URIUtils::AddFileToFolder(artist.strPath, "artist.nfo", strNfo);
  1368
+  CStdString strNfo = URIUtils::AddFileToFolder(artist.strPath, "artist.nfo");
1371 1369
   CNfoFile::NFOResult result=CNfoFile::NO_NFO;
1372 1370
   CNfoFile nfoReader;
1373 1371
   if (XFILE::CFile::Exists(strNfo))
7  xbmc/music/windows/GUIWindowMusicPlaylist.cpp
@@ -284,11 +284,10 @@ void CGUIWindowMusicPlayList::SavePlayList()
284 284
   if (CGUIKeyboardFactory::ShowAndGetInput(strNewFileName, g_localizeStrings.Get(16012), false))
285 285
   {
286 286
     // need 2 rename it
287  
-    CStdString strFolder, strPath;
288  
-    URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "music", strFolder);
289  
-    strNewFileName= CUtil::MakeLegalFileName( strNewFileName );
  287
+    CStdString strFolder = URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "music");
  288
+    strNewFileName = CUtil::MakeLegalFileName(strNewFileName);
290 289
     strNewFileName += ".m3u";
291  
-    URIUtils::AddFileToFolder(strFolder, strNewFileName, strPath);
  290
+    CStdString strPath = URIUtils::AddFileToFolder(strFolder, strNewFileName);
292 291
 
293 292
     // get selected item
294 293
     int iItem = m_viewControl.GetSelectedItem();
5  xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp
@@ -396,9 +396,8 @@ void CGUIWindowMusicPlaylistEditor::OnSavePlaylist()
396 396
   { // save playlist as an .m3u
397 397
     PLAYLIST::CPlayListM3U playlist;
398 398
     playlist.Add(*m_playlist);
399  
-    CStdString path, strBase;
400  
-    URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "music", strBase);
401  
-    URIUtils::AddFileToFolder(strBase, name + ".m3u", path);
  399
+    CStdString strBase = URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "music");
  400
+    CStdString path = URIUtils::AddFileToFolder(strBase, name + ".m3u");
402 401
     playlist.Save(path);
403 402
     m_strLoadedPlaylist = name;
404 403
   }
6  xbmc/network/upnp/UPnP.cpp
@@ -527,8 +527,7 @@ CUPnP::StartServer()
527 527
     if (!m_ServerHolder->m_Device.IsNull()) return false;
528 528
 
529 529
     // load upnpserver.xml
530  
-    CStdString filename;
531  
-    URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml", filename);
  530
+    CStdString filename = URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml");
532 531
     CUPnPSettings::Get().Load(filename);
533 532
 
534 533
     // create the server with a XBox compatible friendlyname and UUID from upnpserver.xml if found
@@ -607,8 +606,7 @@ bool CUPnP::StartRenderer()
607 606
 {
608 607
     if (!m_RendererHolder->m_Device.IsNull()) return false;
609 608
 
610  
-    CStdString filename;
611  
-    URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml", filename);
  609
+    CStdString filename = URIUtils::AddFileToFolder(CProfilesManager::Get().GetUserDataFolder(), "upnpserver.xml");
612 610
     CUPnPSettings::Get().Load(filename);
613 611
 
614 612
     m_RendererHolder->m_Device = CreateRenderer(CUPnPSettings::Get().GetRendererPort());
4  xbmc/settings/MediaSettings.cpp
@@ -275,12 +275,12 @@ void CMediaSettings::OnSettingAction(const CSetting *setting)
275 275
 
276 276
         if ( retVal == 1 )
277 277
         {
278  
-          URIUtils::AddFileToFolder(path, "karaoke.html", path);
  278
+          path = URIUtils::AddFileToFolder(path, "karaoke.html");
279 279
           musicdatabase.ExportKaraokeInfo( path, true );
280 280
         }
281 281
         else
282 282
         {
283  
-          URIUtils::AddFileToFolder(path, "karaoke.csv", path);
  283
+          path = URIUtils::AddFileToFolder(path, "karaoke.csv");
284 284
           musicdatabase.ExportKaraokeInfo( path, false );
285 285
         }
286 286
         musicdatabase.Close();
2  xbmc/utils/FileOperationJob.cpp
@@ -180,7 +180,7 @@ bool CFileOperationJob::DoProcess(FileAction action, CFileItemList & items, cons
180 180
 
181 181
       CStdString strnewDestFile;
182 182
       if(!strDestFile.IsEmpty()) // only do this if we have a destination
183  
-        URIUtils::AddFileToFolder(strDestFile, strFileName, strnewDestFile);
  183
+        strnewDestFile = URIUtils::AddFileToFolder(strDestFile, strFileName);
184 184
 
185 185
       if (pItem->m_bIsFolder)
186 186
       {
2  xbmc/utils/FileUtils.cpp
@@ -71,7 +71,7 @@ bool CFileUtils::RenameFile(const CStdString &strFile)
71 71
         CStdString filePath(paths[i]);
72 72
         URIUtils::RemoveSlashAtEnd(filePath);
73 73
         URIUtils::GetDirectory(filePath, filePath);
74  
-        URIUtils::AddFileToFolder(filePath, strFileName, filePath);
  74
+        filePath = URIUtils::AddFileToFolder(filePath, strFileName);
75 75
         if (CFile::Rename(paths[i], filePath))
76 76
           success = true;
77 77
       }
11  xbmc/utils/ScraperUrl.cpp
@@ -207,9 +207,8 @@ bool CScraperUrl::Get(const SUrlEntry& scrURL, std::string& strHTML, XFILE::CCur
207 207
 
208 208
   if (!scrURL.m_cache.IsEmpty())
209 209
   {
210  
-    URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath,
211  
-                              "scrapers/"+cacheContext+"/"+scrURL.m_cache,
212  
-                              strCachePath);
  210
+    strCachePath = URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath,
  211
+                              "scrapers/" + cacheContext + "/" + scrURL.m_cache);
213 212
     if (XFILE::CFile::Exists(strCachePath))
214 213
     {
215 214
       XFILE::CFile file;
@@ -257,10 +256,8 @@ bool CScraperUrl::Get(const SUrlEntry& scrURL, std::string& strHTML, XFILE::CCur
257 256
 
258 257
   if (!scrURL.m_cache.IsEmpty())
259 258
   {
260  
-    CStdString strCachePath;
261  
-    URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath,
262  
-                              "scrapers/"+cacheContext+"/"+scrURL.m_cache,
263  
-                              strCachePath);
  259
+    CStdString strCachePath = URIUtils::AddFileToFolder(g_advancedSettings.m_cachePath,
  260
+                              "scrapers/" + cacheContext + "/" + scrURL.m_cache);
264 261
     XFILE::CFile file;
265 262
     if (file.OpenForWrite(strCachePath,true))
266 263
       file.Write(strHTML.data(),strHTML.size());
17  xbmc/utils/URIUtils.cpp
@@ -932,24 +932,21 @@ bool URIUtils::CompareWithoutSlashAtEnd(const CStdString& strPath1, const CStdSt
932 932
   return strc1.Equals(strc2);
933 933
 }
934 934
 
935  
-void URIUtils::AddFileToFolder(const CStdString& strFolder, 
936  
-                                const CStdString& strFile,
937  
-                                CStdString& strResult)
  935
+CStdString URIUtils::AddFileToFolder(const CStdString& strFolder, 
  936
+                                const CStdString& strFile)
938 937
 {
939 938
   if (IsURL(strFolder))
940 939
   {
941 940
     CURL url(strFolder);
942 941
     if (url.GetFileName() != strFolder)
943 942
     {
944  
-      AddFileToFolder(url.GetFileName(), strFile, strResult);
945  
-      url.SetFileName(strResult);
946  
-      strResult = url.Get();
947  
-      return;
  943
+      url.SetFileName(AddFileToFolder(url.GetFileName(), strFile));
  944
+      return url.Get();
948 945
     }
949 946
   }
950 947
 
951  
-  strResult = strFolder;
952  
-  if(!strResult.IsEmpty())
  948
+  CStdString strResult = strFolder;
  949
+  if (!strResult.IsEmpty())
953 950
     AddSlashAtEnd(strResult);
954 951
 
955 952
   // Remove any slash at the start of the file
@@ -963,6 +960,8 @@ void URIUtils::AddFileToFolder(const CStdString& strFolder,
963 960
     strResult.Replace('\\', '/');
964 961
   else
965 962
     strResult.Replace('/', '\\');
  963
+
  964
+  return strResult;
966 965
 }
967 966
 
968 967
 CStdString URIUtils::GetDirectory(const CStdString &filePath)
10  xbmc/utils/URIUtils.h
@@ -107,15 +107,7 @@ class URIUtils
107 107
                                 const CStdString& strFilePathInArchive,
108 108
                                 const CStdString& strPwd="");
109 109
 
110  
-  static void AddFileToFolder(const CStdString& strFolder,
111  
-                              const CStdString& strFile, CStdString& strResult);
112  
-  static CStdString AddFileToFolder(const CStdString &strFolder, 
113  
-                                    const CStdString &strFile)
114  
-  {
115  
-    CStdString result;
116  
-    AddFileToFolder(strFolder, strFile, result);
117  
-    return result;
118  
-  }
  110
+  static CStdString AddFileToFolder(const CStdString &strFolder, const CStdString &strFile);
119 111
 
120 112
   static bool ProtocolHasParentInHostname(const CStdString& prot);
121 113
   static bool ProtocolHasEncodedHostname(const CStdString& prot);
10  xbmc/utils/test/TestURIUtils.cpp
@@ -450,14 +450,8 @@ TEST_F(TestURIUtils, CreateArchivePath)
450 450
 
451 451
 TEST_F(TestURIUtils, AddFileToFolder)
452 452
 {
453  
-  CStdString ref, var;
454  
-
455  
-  ref = "/path/to/file";
456  
-  URIUtils::AddFileToFolder("/path/to", "file", var);
457  
-  EXPECT_STREQ(ref.c_str(), var.c_str());
458  
-
459  
-  var.clear();
460  
-  var = URIUtils::AddFileToFolder("/path/to", "file");
  453
+  CStdString ref = "/path/to/file";
  454
+  CStdString var = URIUtils::AddFileToFolder("/path/to", "file");
461 455
   EXPECT_STREQ(ref.c_str(), var.c_str());
462 456
 }
463 457
 
11  xbmc/video/VideoDatabase.cpp
@@ -8290,8 +8290,7 @@ void CVideoDatabase::DumpToDummyFiles(const CStdString &path)
8290 8290
   {
8291 8291
     // create a folder in this directory
8292 8292
     CStdString showName = CUtil::MakeLegalFileName(items[i]->GetVideoInfoTag()->m_strShowTitle);
8293  
-    CStdString TVFolder;
8294  
-    URIUtils::AddFileToFolder(showPath, showName, TVFolder);
  8293
+    CStdString TVFolder = URIUtils::AddFileToFolder(showPath, showName);
8295 8294
     if (CDirectory::Create(TVFolder))
8296 8295
     { // right - grab the episodes and dump them as well
8297 8296
       CFileItemList episodes;
@@ -8303,8 +8302,7 @@ void CVideoDatabase::DumpToDummyFiles(const CStdString &path)
8303 8302
         CStdString episode;
8304 8303
         episode.Format("%s.s%02de%02d.avi", showName.c_str(), tag->m_iSeason, tag->m_iEpisode);
8305 8304
         // and make a file
8306  
-        CStdString episodePath;
8307  
-        URIUtils::AddFileToFolder(TVFolder, episode, episodePath);
  8305
+        CStdString episodePath = URIUtils::AddFileToFolder(TVFolder, episode);
8308 8306
         CFile file;
8309 8307
         if (file.OpenForWrite(episodePath))
8310 8308
           file.Close();
@@ -8655,8 +8653,7 @@ void CVideoDatabase::ExportToXML(const CStdString &path, bool singleFiles /* = f
8655 8653
         }
8656 8654
         else
8657 8655
         {
8658  
-          CStdString nfoFile;
8659  
-          URIUtils::AddFileToFolder(tvshow.m_strPath, "tvshow.nfo", nfoFile);
  8656
+          CStdString nfoFile = URIUtils::AddFileToFolder(tvshow.m_strPath, "tvshow.nfo");
8660 8657
 
8661 8658
           if (overwrite || !CFile::Exists(nfoFile, false))
8662 8659
           {
@@ -9088,7 +9085,7 @@ void CVideoDatabase::ConstructPath(CStdString& strDest, const CStdString& strPat
9088 9085
       URIUtils::IsInArchive(strFileName) || URIUtils::IsPlugin(strPath))
9089 9086
     strDest = strFileName;
9090 9087
   else
9091  
-    URIUtils::AddFileToFolder(strPath, strFileName, strDest);
  9088
+    strDest = URIUtils::AddFileToFolder(strPath, strFileName);
9092 9089
 }
9093 9090
 
9094 9091
 void CVideoDatabase::SplitPath(const CStdString& strFileNameAndPath, CStdString& strPath, CStdString& strFileName)
2  xbmc/video/VideoInfoScanner.cpp
@@ -1808,7 +1808,7 @@ namespace VIDEO
1808 1808
         || (info->Content() == CONTENT_TVSHOWS && !pItem->m_bIsFolder))
1809 1809
       strNfoFile = GetnfoFile(pItem, bGrabAny);
1810 1810
     if (info->Content() == CONTENT_TVSHOWS && pItem->m_bIsFolder)
1811  
-      URIUtils::AddFileToFolder(pItem->GetPath(), "tvshow.nfo", strNfoFile);
  1811
+      strNfoFile = URIUtils::AddFileToFolder(pItem->GetPath(), "tvshow.nfo");
1812 1812
 
1813 1813
     CNfoFile::NFOResult result=CNfoFile::NO_NFO;
1814 1814
     if (!strNfoFile.IsEmpty() && CFile::Exists(strNfoFile))
6  xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -1187,8 +1187,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
1187 1187
       bool local=false;
1188 1188
       if (button == CONTEXT_BUTTON_SET_ARTIST_THUMB)
1189 1189
       {
1190  
-        CStdString strThumb;
1191  
-        URIUtils::AddFileToFolder(artistPath,"folder.jpg",strThumb);
  1190
+        CStdString strThumb = URIUtils::AddFileToFolder(artistPath, "folder.jpg");
1192 1191
         if (XFILE::CFile::Exists(strThumb))
1193 1192
         {
1194 1193
           CFileItemPtr pItem(new CFileItem(strThumb,false));
@@ -1204,8 +1203,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
1204 1203
       if (button == CONTEXT_BUTTON_SET_ACTOR_THUMB)
1205 1204
       {
1206 1205
         CStdString picturePath;
1207  
-        CStdString strThumb;
1208  
-        URIUtils::AddFileToFolder(picturePath,"folder.jpg",strThumb);
  1206
+        CStdString strThumb = URIUtils::AddFileToFolder(picturePath, "folder.jpg");
1209 1207
         if (XFILE::CFile::Exists(strThumb))
1210 1208
         {
1211 1209
           CFileItemPtr pItem(new CFileItem(strThumb,false));
5  xbmc/video/windows/GUIWindowVideoPlaylist.cpp
@@ -375,11 +375,10 @@ void CGUIWindowVideoPlaylist::SavePlayList()
375 375
   if (CGUIKeyboardFactory::ShowAndGetInput(strNewFileName, g_localizeStrings.Get(16012), false))
376 376
   {
377 377
     // need 2 rename it
378  
-    CStdString strPath, strFolder;
379  
-    URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "video", strFolder);
  378
+    CStdString strFolder = URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), "video");
380 379
     strNewFileName = CUtil::MakeLegalFileName(strNewFileName);
381 380
     strNewFileName += ".m3u";
382  
-    URIUtils::AddFileToFolder(strFolder, strNewFileName, strPath);
  381
+    CStdString strPath = URIUtils::AddFileToFolder(strFolder, strNewFileName);
383 382
 
384 383
     CPlayListM3U playlist;
385 384
     playlist.Add(*m_vecItems);

0 notes on commit a115d4f

Please sign in to comment.
Something went wrong with that request. Please try again.