diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 19:58:24 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 19:58:24 +0200 |
commit | b40ba0cf91603b695f1f2380cbd39966a458f22f (patch) | |
tree | 1fec48ddc59eb1392fac38495b230e4b2cbf7528 /src/modules/UserConfigBackendHome | |
parent | e1d8490f0654a3da0b900407d80d91d8d0da68c8 (diff) | |
download | mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.tar mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.zip |
Use Unicode-aware String class instead of std::string
Diffstat (limited to 'src/modules/UserConfigBackendHome')
-rw-r--r-- | src/modules/UserConfigBackendHome/UserConfigBackendHome.cpp | 22 | ||||
-rw-r--r-- | src/modules/UserConfigBackendHome/UserConfigBackendHome.h | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/modules/UserConfigBackendHome/UserConfigBackendHome.cpp b/src/modules/UserConfigBackendHome/UserConfigBackendHome.cpp index d47e03b..e1db3b9 100644 --- a/src/modules/UserConfigBackendHome/UserConfigBackendHome.cpp +++ b/src/modules/UserConfigBackendHome/UserConfigBackendHome.cpp @@ -35,11 +35,11 @@ bool UserConfigBackendHome::handleConfigEntry(const Core::ConfigEntry &entry, bo if(entry[0].getKey().matches("UserManager")) { if(entry[1].getKey().matches("Skeleton")) { if(entry[2].isEmpty()) - skeleton = entry[1][0].extract(); + skeleton = entry[1][0]; } else if(entry[1].getKey().matches("HomeDir")) { if(entry[2].isEmpty()) - homeDir = entry[1][0].extract(); + homeDir = entry[1][0]; } else if(entry[1].getKey().matches("UserDirMode")) { if(entry[2].isEmpty()) { @@ -104,8 +104,8 @@ void UserConfigBackendHome::migrateOwner(const std::string &path, const Common:: } void UserConfigBackendHome::addUser(const Common::UserInfo &userInfo) throw(Core::Exception) { - boost::filesystem::path path(homeDir); - path /= userInfo.getUsername(); + boost::filesystem::path path(homeDir.extract()); + path /= userInfo.getUsername().extract(); boost::filesystem::create_directories(path); @@ -118,7 +118,7 @@ void UserConfigBackendHome::addUser(const Common::UserInfo &userInfo) throw(Core // TODO Error } - boost::filesystem::path skeletonPath(skeleton); + boost::filesystem::path skeletonPath(skeleton.extract()); if(!boost::filesystem::is_directory(skeletonPath)) return; @@ -161,11 +161,11 @@ void UserConfigBackendHome::addUser(const Common::UserInfo &userInfo) throw(Core } void UserConfigBackendHome::updateUser(const Common::UserInfo &oldUserInfo, const Common::UserInfo &userInfo) throw(Core::Exception) { - boost::filesystem::path oldPath(homeDir); - oldPath /= oldUserInfo.getUsername(); + boost::filesystem::path oldPath(homeDir.extract()); + oldPath /= oldUserInfo.getUsername().extract(); - boost::filesystem::path path(homeDir); - path /= userInfo.getUsername(); + boost::filesystem::path path(homeDir.extract()); + path /= userInfo.getUsername().extract(); if(oldPath != path) { try { @@ -202,8 +202,8 @@ void UserConfigBackendHome::updateUser(const Common::UserInfo &oldUserInfo, cons } void UserConfigBackendHome::deleteUser(const Common::UserInfo &userInfo) throw(Core::Exception) { - boost::filesystem::path path(homeDir); - path /= userInfo.getUsername(); + boost::filesystem::path path(homeDir.extract()); + path /= userInfo.getUsername().extract(); boost::filesystem::remove_all(path); } diff --git a/src/modules/UserConfigBackendHome/UserConfigBackendHome.h b/src/modules/UserConfigBackendHome/UserConfigBackendHome.h index f115d9e..e82795c 100644 --- a/src/modules/UserConfigBackendHome/UserConfigBackendHome.h +++ b/src/modules/UserConfigBackendHome/UserConfigBackendHome.h @@ -36,8 +36,8 @@ class UserConfigBackendHome : public Common::UserConfigBackend, private Core::Co private: Common::Application *application; - std::string skeleton; - std::string homeDir; + Core::String skeleton; + Core::String homeDir; unsigned long dirMode; boost::mutex mutex; |