Skip to content

Cleanup minor things #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/audioplayers/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: audioplayers_tizen_example
description: Demonstrates how to use the audioplayers plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
audioplayers: ^0.18.3
Expand Down
2 changes: 1 addition & 1 deletion packages/battery/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: battery_example
description: Demonstrates how to use the battery_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
battery: ^2.0.1
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/tizen/src/camera_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

static uint64_t Timestamp() {
struct timeval tv;
gettimeofday(&tv, NULL);
gettimeofday(&tv, nullptr);
return (uint64_t)tv.tv_sec * 1000UL + tv.tv_usec / 1000UL;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: connectivity_example
description: Demonstrates how to use the connectivity_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
connectivity: ^3.0.3
Expand Down
2 changes: 1 addition & 1 deletion packages/device_info/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: device_info_example
description: Demonstrates how to use the device_info_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
device_info_tizen:
Expand Down
2 changes: 1 addition & 1 deletion packages/device_info/tizen/src/device_info_tizen_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DeviceInfoTizenPlugin : public flutter::Plugin {
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
LOG_INFO("method : %s", method_call.method_name().data());

char *value = NULL;
char *value = nullptr;
flutter::EncodableMap msg;
int ret;
bool hasResult = false;
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tts/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_tts_tizen_example
description: Demonstrates how to use the flutter_tts_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand All @@ -18,7 +18,7 @@ dev_dependencies:
sdk: flutter
integration_test_tizen:
path: ../../integration_test/

flutter:
uses-material-design: true

Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: image_picker_tizen_example
description: Demonstrates how to use the image_picker_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/image_picker/tizen/src/image_picker_tizen_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class ImagePickerTizenPlugin : public flutter::Plugin {
void PickContent() {
if (mime_type_.size() == 0) return;

app_control_h handle = NULL;
app_control_h handle = nullptr;
int ret = app_control_create(&handle);
RET_IF_ERROR(ret);

Expand Down Expand Up @@ -255,7 +255,7 @@ class ImagePickerTizenPlugin : public flutter::Plugin {
return;
}

char **value = NULL;
char **value = nullptr;
int count = 0;
int ret = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED,
&value, &count);
Expand Down
14 changes: 7 additions & 7 deletions packages/image_picker/tizen/src/image_resize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ bool ImageResize::TransformImage(transformation_h transform_h,
image_util_image_h& dst_image) {
unsigned int org_width;
unsigned int org_height;
int ret = image_util_get_image(src_image, &org_width, &org_height, NULL, NULL,
NULL);
int ret = image_util_get_image(src_image, &org_width, &org_height, nullptr,
nullptr, nullptr);
if (ret != IMAGE_UTIL_ERROR_NONE) {
LOG_ERROR("image_util_get_image fail! [%s]",
imageUitlErrorToString(ret).c_str());
Expand Down Expand Up @@ -170,9 +170,9 @@ bool ImageResize::Resize(const std::string& src_file, std::string& dst_file) {
}

// ===========================================================
image_util_image_h src_image = NULL;
image_util_image_h dst_image = NULL;
image_util_decode_h decode_h = NULL;
image_util_image_h src_image = nullptr;
image_util_image_h dst_image = nullptr;
image_util_decode_h decode_h = nullptr;

int ret = image_util_decode_create(&decode_h);
if (ret != IMAGE_UTIL_ERROR_NONE) {
Expand All @@ -190,7 +190,7 @@ bool ImageResize::Resize(const std::string& src_file, std::string& dst_file) {
}

// ===========================================================
transformation_h transform_h = NULL;
transformation_h transform_h = nullptr;
ret = image_util_transform_create(&transform_h);
if (ret != IMAGE_UTIL_ERROR_NONE) {
LOG_ERROR("image_util_transform_create fail! [%s]",
Expand Down Expand Up @@ -246,7 +246,7 @@ bool ImageResize::Resize(const std::string& src_file, std::string& dst_file) {
}
}

image_util_encode_h encode_h = NULL;
image_util_encode_h encode_h = nullptr;
ret = image_util_encode_create(encoder_type, &encode_h);
if (ret != IMAGE_UTIL_ERROR_NONE) {
LOG_ERROR("image_util_encode_create fail! [%s]",
Expand Down
2 changes: 1 addition & 1 deletion packages/integration_test/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: integration_test_example
description: Demonstrates how to use the integration_test_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion packages/package_info/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: package_info_example
description: Demonstrates how to use the package_info_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand Down
20 changes: 10 additions & 10 deletions packages/package_info/tizen/src/package_info_tizen_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,46 +98,46 @@ class PackageInfoTizenPlugin : public flutter::Plugin {
return;
}

char *app_id = NULL;
char *pkg_name = NULL;
char *version = NULL;
char *label = NULL;
package_info_h package_info = NULL;
char *app_id = nullptr;
char *pkg_name = nullptr;
char *version = nullptr;
char *label = nullptr;
package_info_h package_info = nullptr;
flutter::EncodableMap msg;

int ret = app_get_id(&app_id);
if (ret != APP_ERROR_NONE || app_id == NULL) {
if (ret != APP_ERROR_NONE || app_id == nullptr) {
result->Error(std::to_string(ret), "Failed to get app_id",
flutter::EncodableValue(appErrorToString(ret)));
goto cleanup;
}
LOG_INFO("app id : %s\n", app_id);

ret = package_info_create(app_id, &package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) {
if (ret != PACKAGE_MANAGER_ERROR_NONE || package_info == nullptr) {
result->Error(std::to_string(ret), "Failed to create package_info",
flutter::EncodableValue(packageErrorToString(ret)));
goto cleanup;
}

ret = package_info_get_label(package_info, &label);
if (ret != PACKAGE_MANAGER_ERROR_NONE || label == NULL) {
if (ret != PACKAGE_MANAGER_ERROR_NONE || label == nullptr) {
result->Error(std::to_string(ret), "Failed to get app name",
flutter::EncodableValue(packageErrorToString(ret)));
goto cleanup;
}
LOG_INFO("package label : %s\n", label);

ret = package_info_get_package(package_info, &pkg_name);
if (ret != PACKAGE_MANAGER_ERROR_NONE || pkg_name == NULL) {
if (ret != PACKAGE_MANAGER_ERROR_NONE || pkg_name == nullptr) {
result->Error(std::to_string(ret), "Failed to get package name",
flutter::EncodableValue(packageErrorToString(ret)));
goto cleanup;
}
LOG_INFO("package name : %s\n", pkg_name);

ret = package_info_get_version(package_info, &version);
if (ret != PACKAGE_MANAGER_ERROR_NONE || version == NULL) {
if (ret != PACKAGE_MANAGER_ERROR_NONE || version == nullptr) {
result->Error(std::to_string(ret), "Failed to get version",
flutter::EncodableValue(packageErrorToString(ret)));
goto cleanup;
Expand Down
2 changes: 1 addition & 1 deletion packages/path_provider/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: path_provider_tizen_example
description: Demonstrates how to use the path_provider_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void AppSettingsManager::OpenAppSettings(OnAppSettingsOpened success_callback,
}

app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING);
result = app_control_send_launch_request(service, NULL, NULL);
result = app_control_send_launch_request(service, nullptr, nullptr);
app_control_destroy(service);
if (result == APP_CONTROL_ERROR_NONE) {
LOG_DEBUG("successed to open app settings");
Expand Down
2 changes: 1 addition & 1 deletion packages/sensors/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sensors_example
description: Demonstrates how to use the sensors plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/share/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: share_example
description: Demonstrates how to use the share_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
sdk: flutter
image_picker: ^0.7.3
image_picker_tizen:
path: ../../image_picker/
share: ^2.0.1
share: ^2.0.1
share_tizen:
path: ../

Expand Down
2 changes: 1 addition & 1 deletion packages/share/tizen/src/share_tizen_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class ShareTizenPlugin : public flutter::Plugin {
ret = app_control_set_launch_mode(handle, APP_CONTROL_LAUNCH_MODE_GROUP);
RET_IF_ERROR(ret);

ret = app_control_send_launch_request(handle, NULL, NULL);
ret = app_control_send_launch_request(handle, nullptr, nullptr);
RET_IF_ERROR(ret);

if (handle) {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared_preferences/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: shared_preferences_tizen_example
description: Demonstrates how to use the shared_preferences_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion packages/url_launcher/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: url_launcher_example
description: Demonstrates how to use the url_launcher_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand Down
8 changes: 4 additions & 4 deletions packages/video_player/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: video_player_example
description: Demonstrates how to use the video_player_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
flutter:
Expand All @@ -23,9 +23,9 @@ dev_dependencies:
flutter:
uses-material-design: true
assets:
- assets/flutter-mark-square-64.png
- assets/Butterfly-209.mp4
- assets/bumble_bee_captions.srt
- assets/flutter-mark-square-64.png
- assets/Butterfly-209.mp4
- assets/bumble_bee_captions.srt

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/wakelock/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wakelock_tizen_example
description: Demonstrates how to use the wakelock_tizen plugin.
publish_to: 'none'
publish_to: "none"

environment:
sdk: ">=2.12.0 <3.0.0"
Expand All @@ -22,4 +22,3 @@ dev_dependencies:
sdk: flutter
integration_test_tizen:
path: ../../integration_test/

4 changes: 2 additions & 2 deletions packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ void WebView::DispatchCompositionEndEvent(const char* str, int size) {
void WebView::ShowPanel() {
LOG_DEBUG("WebView::ShowPanel()");
if (!context_) {
LOG_ERROR("Ecore_IMF_Context NULL");
LOG_ERROR("Ecore_IMF_Context nullptr");
return;
}
ecore_imf_context_input_panel_show(context_);
Expand All @@ -714,7 +714,7 @@ void WebView::ShowPanel() {
void WebView::HidePanel() {
LOG_DEBUG("WebView::HidePanel()");
if (!context_) {
LOG_ERROR("Ecore_IMF_Context NULL");
LOG_ERROR("Ecore_IMF_Context nullptr");
return;
}
ecore_imf_context_reset(context_);
Expand Down
2 changes: 1 addition & 1 deletion packages/wifi_info_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wifi_info_flutter_tizen_example
description: Demonstrates how to use the wifi_info_flutter_tizen plugin.
publish_to: 'none'
publish_to: "none"

dependencies:
connectivity: ^3.0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class WifiInfoFlutterTizenPlugin : public flutter::Plugin {
std::string GetWifiInfo(WifiInfoType type) {
std::string result;
wifi_manager_ap_h current_ap = nullptr;
char *name = NULL;
char *name = nullptr;
int errorcode;

errorcode = wifi_manager_get_connected_ap(m_wifi_manager, &current_ap);
Expand Down Expand Up @@ -85,7 +85,7 @@ class WifiInfoFlutterTizenPlugin : public flutter::Plugin {
} else if (method_call.method_name().compare("wifiBSSID") == 0) {
replay = GetWifiInfo(WifiInfoType::BSSID);
} else if (method_call.method_name().compare("wifiIPAddress") == 0) {
char *ip_addr = NULL;
char *ip_addr = nullptr;
if (connection_get_ip_address(m_connection,
CONNECTION_ADDRESS_FAMILY_IPV4,
&ip_addr) != CONNECTION_ERROR_NONE) {
Expand Down