Skip to content

Commit

Permalink
[Fix] Move add-on settings file to add-on user path
Browse files Browse the repository at this point in the history
  • Loading branch information
AchimTuran committed Sep 25, 2015
1 parent 0bc31e2 commit cf13262
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/FreeSurroundSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace ADDON;

std::string GetSettingsFile()
{
string settingFile = g_strAddonPath;
string settingFile = g_strUserPath;
if (settingFile.at(settingFile.size() - 1) == '\\' ||
settingFile.at(settingFile.size() - 1) == '/')
settingFile.append("ADSPFreeSurrAddonSettings.xml");
Expand Down
10 changes: 10 additions & 0 deletions src/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ using namespace ADDON;
#define snprintf _snprintf
#endif

#if defined(TARGET_WINDOWS)
#undef CreateDirectory
#endif


/* User adjustable settings are saved here.
* Default values are defined inside addon.h
Expand Down Expand Up @@ -91,6 +95,12 @@ ADDON_STATUS ADDON_Create(void* hdl, void* props)
g_strUserPath = adspprops->strUserPath;
g_strAddonPath = adspprops->strAddonPath;

// create addon user path
if (!KODI->DirectoryExists(g_strUserPath.c_str()))
{
KODI->CreateDirectory(g_strUserPath.c_str());
}

for (int i = 0; i < AE_DSP_STREAM_MAX_STREAMS; ++i)
g_usedDSPs[i] = NULL;

Expand Down

0 comments on commit cf13262

Please sign in to comment.