From 5b99530ed4e08c679026b66bf4feb351645b687d Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 26 Mar 2008 19:10:14 +0000 Subject: need to create the Freesound dir if it does not already exist git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3189 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/sfdb_freesound_mootcher.cc | 17 +++++++---------- gtk2_ardour/sfdb_freesound_mootcher.h | 1 - 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/sfdb_freesound_mootcher.cc b/gtk2_ardour/sfdb_freesound_mootcher.cc index 484df19941..ba9b4052c8 100644 --- a/gtk2_ardour/sfdb_freesound_mootcher.cc +++ b/gtk2_ardour/sfdb_freesound_mootcher.cc @@ -75,17 +75,14 @@ const char* Mootcher::changeWorkingDir(const char *saveLocation) // int pos2 = basePath.find_last_of("/"); if(basePath.length() != (pos2+1)) basePath += "/"; - // add a check if the given directory exists - createResourceLocation(); - return basePath.c_str(); -} + + // create Freesound directory and sound dir + std::string sndLocation = basePath; + mkdir(sndLocation.c_str(), 0x777); + sndLocation += "snd"; + mkdir(sndLocation.c_str(), 0x777); -//------------------------------------------------------------------------ -void Mootcher::createResourceLocation() -{ - // create a snd directory - std::string sndLocation = basePath + "snd"; - mkdir(sndLocation.c_str(), 0x777); + return basePath.c_str(); } //------------------------------------------------------------------------ diff --git a/gtk2_ardour/sfdb_freesound_mootcher.h b/gtk2_ardour/sfdb_freesound_mootcher.h index af5f4e0bab..3cfbd414d4 100644 --- a/gtk2_ardour/sfdb_freesound_mootcher.h +++ b/gtk2_ardour/sfdb_freesound_mootcher.h @@ -55,7 +55,6 @@ public: private: const char* changeWorkingDir(const char *saveLocation); - void createResourceLocation(); std::string getXmlFile(std::string ID, int &length); void GetXml(std::string ID, struct MemoryStruct &xml_page); -- cgit v1.2.3