BuildRequires: pkgconfig(capi-appfw-package-manager)
BuildRequires: pkgconfig(capi-content-media-content)
BuildRequires: pkgconfig(capi-media-metadata-extractor)
-BuildRequires: pkgconfig(libtzplatform-config)
%if %{with wayland}
%define display_type wayland
#include <msg_storage.h>
#include <email-api.h>
-#include <tzplatform_config.h>
#include "common/logger.h"
#include "common/platform_exception.h"
char strDBName[64];
memset(strDBName, 0x00, sizeof(strDBName));
- snprintf(strDBName, sizeof(strDBName), "%s/%s",
- tzplatform_getenv(TZ_USER_DB), MSG_DB_NAME);
+ snprintf(strDBName, sizeof(strDBName), "%s", MSG_DB_NAME);
int err = db_util_open(strDBName, &sqlHandle, DB_UTIL_REGISTER_HOOK_METHOD);
if (SQLITE_OK != err) {
- LoggerE("DB connecting fail [%d]", err);
+ LoggerE("Failed to connect to database '%s', error: [%d]", strDBName, err);
+ sqlHandle = nullptr;
return MSG_ERR_DB_CONNECT;
}
*resultsCount = 0;
freeTable(results);
- connect();
+ if (MSG_SUCCESS != connect()) {
+ LoggerE("Failed to connect to database.");
+ return MSG_ERR_DB_CONNECT;
+ }
char* error_msg = NULL;
err = sqlite3_get_table(sqlHandle, sqlQuery.c_str(), results,
namespace messaging {
// =================================================================
-#define MSG_DB_NAME ".msg_service.db"
+#define MSG_DB_NAME "/usr/dbspace/.msg_service.db"
#define MSG_MESSAGE_TABLE_NAME "MSG_MESSAGE_TABLE"
#define MSG_FOLDER_TABLE_NAME "MSG_FOLDER_TABLE"
#define MSG_ADDRESS_TABLE_NAME "MSG_ADDRESS_TABLE"