X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffs%2Fwindows%2Fdir_location.cpp;h=4c3b8668438d52d09c1b4816e745563b544dd75e;hb=c2530205a67e5d0b341827287151978652b91aaa;hp=ea542be3a75abcf87b68fec82edc83734bfa93a6;hpb=e2b5cb6cd61bf8c6f56f624cc835233df92288da;p=libs%2Fcore.git diff --git a/source/fs/windows/dir_location.cpp b/source/fs/windows/dir_location.cpp index ea542be..4c3b866 100644 --- a/source/fs/windows/dir_location.cpp +++ b/source/fs/windows/dir_location.cpp @@ -1,4 +1,5 @@ #include +#include #include "dir.h" using namespace std; @@ -14,10 +15,12 @@ Path get_home_dir() return "."; } -Path get_user_data_dir(const string &appname) +Path get_user_data_dir() { + const string &appname = Application::get_name(); if(appname.empty()) - throw invalid_argument("get_user_data_dir"); + throw logic_error("no application name"); + char datadir[MAX_PATH]; if(SHGetFolderPath(0, CSIDL_LOCAL_APPDATA, 0, 0, datadir)==S_OK) return Path(datadir)/appname;