Apply the changed function names in context-common & rename non-class functions 05/138505/2
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 12 Jul 2017 10:06:18 +0000 (19:06 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 12 Jul 2017 10:28:42 +0000 (19:28 +0900)
Change-Id: Iea7aea26b677645b29580fb6e2bd07f29e120f76
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/server/JobInfoDatabase.cpp
src/server/JobManager.cpp
src/server/JobSchedulerService.cpp

index 05f9e65..19de08b 100644 (file)
@@ -28,7 +28,7 @@ using namespace ctx;
 static Database* __database = NULL;
 static unsigned int __numDBConnection = 0;
 
-static const char* __getTableName(uid_t uid)
+static const char* __get_table_name(uid_t uid)
 {
        static char tableName[24] = {0};
 
@@ -36,7 +36,7 @@ static const char* __getTableName(uid_t uid)
        return tableName;
 }
 
-static void __initDatabase(uid_t uid)
+static void __init_database(uid_t uid)
 {
        char* query = sqlite3_mprintf(
                        "CREATE TABLE IF NOT EXISTS [%s] (" \
@@ -44,7 +44,7 @@ static void __initDatabase(uid_t uid)
                                "owner TEXT NOT NULL," \
                                "jobInfo TEXT NOT NULL," \
                                "state TEXT NOT NULL DEFAULT ''" \
-                       ")", __getTableName(uid));
+                       ")", __get_table_name(uid));
 
        __database->execute(query, NULL);
 
@@ -64,7 +64,7 @@ static bool __open(uid_t uid)
                }
        }
 
-       __initDatabase(uid);
+       __init_database(uid);
 
        ++__numDBConnection;
        return true;
@@ -98,7 +98,7 @@ void JobInfoDatabase::add(JobInfo* jobInfo, const std::string& owner)
 {
        char* query = sqlite3_mprintf(
                        "INSERT INTO [%s] (jobId, owner, jobInfo) VALUES (%d, '%s', '%s')",
-                       __getTableName(__uid), jobInfo->getId(), owner.c_str(), jobInfo->serialize().c_str());
+                       __get_table_name(__uid), jobInfo->getId(), owner.c_str(), jobInfo->serialize().c_str());
 
        __database->execute(query, NULL);
 
@@ -108,7 +108,7 @@ void JobInfoDatabase::add(JobInfo* jobInfo, const std::string& owner)
 void JobInfoDatabase::remove(int jobId)
 {
        char* query = sqlite3_mprintf(
-                       "DELETE FROM [%s] WHERE jobId = %d", __getTableName(__uid), jobId);
+                       "DELETE FROM [%s] WHERE jobId = %d", __get_table_name(__uid), jobId);
 
        __database->execute(query, NULL);
 
@@ -119,7 +119,7 @@ void JobInfoDatabase::setStarted(int jobId, bool started)
 {
        char* query = sqlite3_mprintf(
                        "UPDATE [%s] SET state = '%s' WHERE jobId = %d",
-                       __getTableName(__uid), started ? ST_STARTED : EMPTY_STR, jobId);
+                       __get_table_name(__uid), started ? ST_STARTED : EMPTY_STR, jobId);
 
        __database->execute(query, NULL);
 
@@ -132,7 +132,7 @@ std::vector<std::pair<std::string, JobInfo*>> JobInfoDatabase::getAll()
        std::vector<std::shared_ptr<Tuple>> queryResult;
 
        char* query = sqlite3_mprintf(
-                       "SELECT owner, jobInfo, state FROM [%s]", __getTableName(__uid));
+                       "SELECT owner, jobInfo, state FROM [%s]", __get_table_name(__uid));
 
        __database->execute(query, &queryResult);
 
index 69a5c3b..35be0bf 100644 (file)
@@ -241,7 +241,7 @@ void JobManager::__verifyAction(JobInfo* jobInfo, IClient* owner)
        // App Control
        verified = [&]()->bool {
                JobAppControl* appControlAction = dynamic_cast<JobAppControl*>(action);
-               IF_FAIL_RETURN(!util::isSystem(__uid), false);
+               IF_FAIL_RETURN(!util::is_system(__uid), false);
                IF_FAIL_RETURN(appControlAction, false);
                IF_FAIL_RETURN(appControlAction->getAppControl(), false);
                return true;
@@ -251,7 +251,7 @@ void JobManager::__verifyAction(JobInfo* jobInfo, IClient* owner)
        // Notification
        verified = [&]()->bool {
                JobNotification* notiAction = dynamic_cast<JobNotification*>(action);
-               IF_FAIL_RETURN(!util::isSystem(__uid), false);
+               IF_FAIL_RETURN(!util::is_system(__uid), false);
                IF_FAIL_RETURN(notiAction, false);
                IF_FAIL_RETURN(!(notiAction->getTitle().empty()), false);
                return true;
index 0f10b94..e9ca584 100644 (file)
@@ -88,7 +88,7 @@ void JobSchedulerService::onUserDeactivated(uid_t uid)
 
 JobManager* JobSchedulerService::getJobManager(uid_t uid)
 {
-       if (util::isSystem(uid))
+       if (util::is_system(uid))
                uid = ROOT_UID;
 
        auto it = __jobManagers.find(uid);