namespace widget_service::parser {
int WidgetPluginParser::Insert(const std::string& pkgid) {
- std::string path = GetDbPath(GetTargetUid());
+ const auto* path = GetDbPath(GetTargetUid());
- if (access(path.c_str(), F_OK) == -1) {
- LOGD("db(%s) does not exist, create one", path.c_str());
+ if (access(path, F_OK) == -1) {
+ LOGD("db(%s) does not exist, create one", path);
return -1;
}
}
int WidgetPluginParser::Remove(const std::string& pkgid) {
- std::string path = GetDbPath(GetTargetUid());
+ const auto* path = GetDbPath(GetTargetUid());
- if (access(path.c_str(), F_OK) == -1) {
- LOGD("db(%s) does not exist, create one", path.c_str());
+ if (access(path, F_OK) == -1) {
+ LOGD("db(%s) does not exist, create one", path);
return -1;
}
std::string GetPreviewPath(std::string widget_id,
std::string size_type, uid_t uid) {
- std::string path = GetDbPath(uid);
+ const auto* path = GetDbPath(uid);
std::string preview_path;
- if (access(path.c_str(), F_OK) == -1) {
- LOGD("db(%s) does not exist, create one", path.c_str());
+ if (access(path, F_OK) == -1) {
+ LOGD("db(%s) does not exist, create one", path);
return "";
}
try {
- tizen_base::Database db(std::move(path), SQLITE_OPEN_READONLY, BusyHandler);
+ tizen_base::Database db(path, SQLITE_OPEN_READONLY, BusyHandler);
auto q = tizen_base::Database::Sql(
"SELECT preview FROM support_size WHERE "
std::vector<WidgetInfo::SupportSize> GetSupportedSizes(
uid_t uid, std::string widget_id) {
- std::string path = GetDbPath(uid);
+ const auto* path = GetDbPath(uid);
std::vector<WidgetInfo::SupportSize> sizes;
- if (access(path.c_str(), F_OK) == -1) {
- LOGD("db(%s) does not exist, create one", path.c_str());
+ if (access(path, F_OK) == -1) {
+ LOGD("db(%s) does not exist, create one", path);
throw std::exception();
}
try {
- tizen_base::Database db(std::move(path), SQLITE_OPEN_READONLY, BusyHandler);
+ tizen_base::Database db(path, SQLITE_OPEN_READONLY, BusyHandler);
auto q = tizen_base::Database::Sql(
"SELECT * FROM support_size WHERE classid=?")