From b40ba0cf91603b695f1f2380cbd39966a458f22f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 27 Sep 2009 19:58:24 +0200 Subject: Use Unicode-aware String class instead of std::string --- .../UserConfigBackendHome.cpp | 22 +++++++++++----------- .../UserConfigBackendHome/UserConfigBackendHome.h | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/modules/UserConfigBackendHome') 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; -- cgit v1.2.3