bool ComplicationConnector::EmitSignal(IGDBus::SigType type,
std::string target_id, std::string id, int sub_id, std::string cmd,
GVariant* data) {
- GError* err = NULL;
+ GError* err = nullptr;
gboolean result = TRUE;
std::string path = util::EncodeStr(
type == IGDBus::Complication ?
LOGI("emit : %s, %s, %d, %s", target_id.c_str(), id.c_str(), sub_id,
cmd.c_str());
- LOGI("emit signal %s, %s", name.empty() ? NULL : name.c_str(), path.c_str());
+ LOGI("emit signal %s, %s", name.empty() ? nullptr : name.c_str(), path.c_str());
result = g_dbus_connection_emit_signal(
impl_->conn_,
- name.empty() ? NULL : name.c_str(),
+ name.empty() ? nullptr : name.c_str(),
path.c_str(),
COMPLICATION_INTERFACE,
cmd.c_str(), data, &err);
if (result == FALSE) {
LOGE("g_dbus_connection_emit_signal() is failed");
- if (err != NULL) {
+ if (err != nullptr) {
LOGE("g_dbus_connection_emit_signal() err : %s",
err->message);
g_error_free(err);
}
void ComplicationConnector::WatchPackageEvent(IPackageManager::IPackageEvent* pe) {
- if (impl_->pkgmgr_client_ == NULL) {
+ if (impl_->pkgmgr_client_ == nullptr) {
impl_->pkgmgr_client_ = pkgmgr_client_new(PC_LISTENING);
- if (impl_->pkgmgr_client_ == NULL) {
+ if (impl_->pkgmgr_client_ == nullptr) {
LOGE("fail to create pkgmgr client");
return;
}
if (pkgmgr_client_listen_status(impl_->pkgmgr_client_ ,
- impl_->PkgmgrPackageStatusCb, NULL) <= 0) {
+ impl_->PkgmgrPackageStatusCb, nullptr) <= 0) {
LOGE("fail to listen pkg status");
pkgmgr_client_free(impl_->pkgmgr_client_);
+ impl_->pkgmgr_client_ = nullptr;
return;
}
LOGI("listen pkg status");
impl_->package_listener_list_.remove(pe);
if (impl_->package_listener_list_.size() == 0) {
pkgmgr_client_free(impl_->pkgmgr_client_);
- impl_->pkgmgr_client_ = NULL;
+ impl_->pkgmgr_client_ = nullptr;
}
}
int ComplicationConnector::Init() {
- GError* error = NULL;
+ GError* error = nullptr;
std::string encoded_name;
int owner_id;
std::unique_ptr<Impl> tmp_impl;
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
- tmp_impl->conn_ = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
- if (tmp_impl->conn_ == NULL) {
- if (error != NULL) {
+ tmp_impl->conn_ = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error);
+ if (tmp_impl->conn_ == nullptr) {
+ if (error != nullptr) {
LOGE("Failed to get dbus [%s]", error->message);
g_error_free(error);
}
}
tmp_impl->pkgmgr_client_ = pkgmgr_client_new(PC_LISTENING);
- if (tmp_impl->pkgmgr_client_ == NULL) {
+ if (tmp_impl->pkgmgr_client_ == nullptr) {
LOGE("fail to create pkgmgr client");
return WATCHFACE_COMPLICATION_ERROR_IO_ERROR;
}
LOGI("own name %s", encoded_name.c_str());
owner_id = g_bus_own_name_on_connection(tmp_impl->conn_, encoded_name.c_str(),
G_BUS_NAME_OWNER_FLAGS_NONE,
- NULL, NULL, NULL, NULL);
+ nullptr, nullptr, nullptr, nullptr);
if (!owner_id) {
g_object_unref(tmp_impl->conn_);
LOGE("g_bus_own_name_on_connection, error");