Clarify error messages

pull/13/head
Werner Sembach 3 years ago
parent 6d3bde274a
commit 399c7de836

@ -95,13 +95,13 @@ int setup_gnome(int lockfile_arg) {
// get a new glib settings context to read the touchpad configuration of the current user // get a new glib settings context to read the touchpad configuration of the current user
touchpad_settings = g_settings_new("org.gnome.desktop.peripherals.touchpad"); touchpad_settings = g_settings_new("org.gnome.desktop.peripherals.touchpad");
if (!touchpad_settings) { if (!touchpad_settings) {
cerr << "main(...): g_settings_new(...) failed." << endl; cerr << "setup_gnome(...): g_settings_new(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
// sync on config change // sync on config change
if (g_signal_connect(touchpad_settings, "changed::send-events", G_CALLBACK(send_events_handler), NULL) < 1) { if (g_signal_connect(touchpad_settings, "changed::send-events", G_CALLBACK(send_events_handler), NULL) < 1) {
cerr << "main(...): g_signal_connect(...) failed." << endl; cerr << "setup_gnome(...): g_signal_connect(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -113,11 +113,11 @@ int setup_gnome(int lockfile_arg) {
"org.gnome.SessionManager", "org.gnome.SessionManager",
NULL, NULL); NULL, NULL);
if (session_manager_properties == NULL) { if (session_manager_properties == NULL) {
cerr << "main(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl; cerr << "setup_gnome(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (g_signal_connect(session_manager_properties, "g-properties-changed", G_CALLBACK(session_manager_properties_changed_handler), touchpad_settings) < 1) { if (g_signal_connect(session_manager_properties, "g-properties-changed", G_CALLBACK(session_manager_properties_changed_handler), touchpad_settings) < 1) {
cerr << "main(...): g_signal_connect(...) failed." << endl; cerr << "setup_gnome(...): g_signal_connect(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -129,11 +129,11 @@ int setup_gnome(int lockfile_arg) {
"org.gnome.Mutter.DisplayConfig", "org.gnome.Mutter.DisplayConfig",
NULL, NULL); NULL, NULL);
if (display_config_properties == NULL) { if (display_config_properties == NULL) {
cerr << "main(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl; cerr << "setup_gnome(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (g_signal_connect(display_config_properties, "g-properties-changed", G_CALLBACK(display_config_properties_changed_handler), touchpad_settings) < 1) { if (g_signal_connect(display_config_properties, "g-properties-changed", G_CALLBACK(display_config_properties_changed_handler), touchpad_settings) < 1) {
cerr << "main(...): g_signal_connect(...) failed." << endl; cerr << "setup_gnome(...): g_signal_connect(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }

@ -169,7 +169,7 @@ int setup_kde(int lockfile_arg) {
"org.kde.kded5", "org.kde.kded5",
NULL, NULL); NULL, NULL);
if (kded5 == NULL) { if (kded5 == NULL) {
cerr << "main(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl; cerr << "setup_kde(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
GVariant *loadedModulesParam = g_dbus_proxy_call_sync(kded5, "loadedModules", NULL, G_DBUS_CALL_FLAGS_NONE, G_MAXINT, NULL, NULL); GVariant *loadedModulesParam = g_dbus_proxy_call_sync(kded5, "loadedModules", NULL, G_DBUS_CALL_FLAGS_NONE, G_MAXINT, NULL, NULL);
@ -195,12 +195,12 @@ int setup_kde(int lockfile_arg) {
g_variant_unref(loadedModulesParam); g_variant_unref(loadedModulesParam);
} else { } else {
g_object_unref(kded5); // not needed anymore g_object_unref(kded5); // not needed anymore
cerr << "main(...): g_dbus_proxy_call_sync(...) failed." << endl; cerr << "setup_kde(...): g_dbus_proxy_call_sync(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
g_object_unref(kded5); // not needed anymore g_object_unref(kded5); // not needed anymore
if (object_path == NULL) { if (object_path == NULL) {
cerr << "main(...): Could not find touchpad module in kded. Is it disabled?" << endl; cerr << "setup_kde(...): Could not find touchpad module in kded. Is it disabled?" << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -212,11 +212,11 @@ int setup_kde(int lockfile_arg) {
"org.kde.touchpad", "org.kde.touchpad",
NULL, NULL); NULL, NULL);
if (kded5_modules_touchpad == NULL) { if (kded5_modules_touchpad == NULL) {
cerr << "main(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl; cerr << "setup_kde(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (g_signal_connect(kded5_modules_touchpad, "g-signal", G_CALLBACK(kded5_modules_touchpad_handler), NULL) < 1) { if (g_signal_connect(kded5_modules_touchpad, "g-signal", G_CALLBACK(kded5_modules_touchpad_handler), NULL) < 1) {
cerr << "main(...): g_signal_connect(...) failed." << endl; cerr << "setup_kde(...): g_signal_connect(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -228,17 +228,17 @@ int setup_kde(int lockfile_arg) {
"org.kde.Solid.PowerManagement.Actions.SuspendSession", "org.kde.Solid.PowerManagement.Actions.SuspendSession",
NULL, NULL); NULL, NULL);
if (solid_power_management == NULL) { if (solid_power_management == NULL) {
cerr << "main(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl; cerr << "setup_kde(...): g_dbus_proxy_new_for_bus_sync(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (g_signal_connect(solid_power_management, "g-signal", G_CALLBACK(solid_power_management_handler), NULL) < 1) { if (g_signal_connect(solid_power_management, "g-signal", G_CALLBACK(solid_power_management_handler), NULL) < 1) {
cerr << "main(...): g_signal_connect(...) failed." << endl; cerr << "setup_kde(...): g_signal_connect(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
// sync on start // sync on start
if (kded5_modules_touchpad_init(kded5_modules_touchpad) == EXIT_FAILURE) { if (kded5_modules_touchpad_init(kded5_modules_touchpad) == EXIT_FAILURE) {
cerr << "main(...): kded5_modules_touchpad_init(...) failed." << endl; cerr << "setup_kde(...): kded5_modules_touchpad_init(...) failed." << endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }

Loading…
Cancel
Save