cheese r833 - in trunk: . src
- From: dgsiegel svn gnome org
- To: svn-commits-list gnome org
- Subject: cheese r833 - in trunk: . src
- Date: Mon, 4 Aug 2008 22:17:10 +0000 (UTC)
Author: dgsiegel
Date: Mon Aug 4 22:17:10 2008
New Revision: 833
URL: http://svn.gnome.org/viewvc/cheese?rev=833&view=rev
Log:
small syntax cleanup
Modified:
trunk/ChangeLog
trunk/src/cheese-countdown.c
trunk/src/cheese-effect-chooser.c
trunk/src/cheese-fileutil.c
trunk/src/cheese-fileutil.h
trunk/src/cheese-gconf.c
trunk/src/cheese-gconf.h
trunk/src/cheese-no-camera.h
trunk/src/cheese-prefs-webcam-combo.c
trunk/src/cheese-thumb-view.c
trunk/src/cheese-thumb-view.h
trunk/src/cheese-webcam.c
trunk/src/cheese-window.c
trunk/src/cheese.c
Modified: trunk/src/cheese-countdown.c
==============================================================================
--- trunk/src/cheese-countdown.c (original)
+++ trunk/src/cheese-countdown.c Mon Aug 4 22:17:10 2008
@@ -107,7 +107,7 @@
}
l = (max + min) / 2;
- if (fabs(max - min) < 0.0001)
+ if (fabs (max - min) < 0.0001)
{
h = 0;
s = 0;
@@ -473,7 +473,7 @@
PANGO_WEIGHT_BOLD,
PANGO_STYLE_NORMAL);
cairo_fill (pContext);
- g_free(number);
+ g_free (number);
/* draw the camera */
cairo_set_source_surface (pContext,
@@ -572,7 +572,7 @@
priv->text.a = 1.0f;
/* create/load svg-icon */
- g_free(priv->pSurface);
+ g_free (priv->pSurface);
priv->pSurface = create_surface_from_svg (widget, PACKAGE_DATADIR "/pixmaps/camera-icon.svg");
}
Modified: trunk/src/cheese-effect-chooser.c
==============================================================================
--- trunk/src/cheese-effect-chooser.c (original)
+++ trunk/src/cheese-effect-chooser.c Mon Aug 4 22:17:10 2008
@@ -183,7 +183,7 @@
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 0.09);
- gchar *name = gettext(card->name);
+ gchar *name = gettext (card->name);
cairo_text_extents (cr, name, &extents);
x = 0.5 - (extents.width / 2 + extents.x_bearing);
y = 0.92 - (extents.height / 2 + extents.y_bearing);
@@ -307,7 +307,7 @@
static void
cheese_effect_chooser_init (CheeseEffectChooser *effect_chooser)
{
- gtk_widget_add_events (GTK_WIDGET(effect_chooser), GDK_BUTTON_PRESS_MASK);
+ gtk_widget_add_events (GTK_WIDGET (effect_chooser), GDK_BUTTON_PRESS_MASK);
g_signal_connect (G_OBJECT (effect_chooser),"button_press_event",
G_CALLBACK (cheese_effect_chooser_button_press_event_cb), NULL);
Modified: trunk/src/cheese-fileutil.c
==============================================================================
--- trunk/src/cheese-fileutil.c (original)
+++ trunk/src/cheese-fileutil.c Mon Aug 4 22:17:10 2008
@@ -118,7 +118,8 @@
file = g_file_new_for_path (filename);
- if (g_file_query_exists (file, NULL)) {
+ if (g_file_query_exists (file, NULL))
+ {
num = 1;
if (mode == CHEESE_MEDIA_MODE_PHOTO)
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, PHOTO_NAME_SUFFIX);
@@ -127,7 +128,8 @@
file = g_file_new_for_path (filename);
- while (g_file_query_exists (file, NULL)) {
+ while (g_file_query_exists (file, NULL))
+ {
num++;
if (mode == CHEESE_MEDIA_MODE_PHOTO)
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, PHOTO_NAME_SUFFIX);
@@ -176,13 +178,15 @@
//get the path from gconf, xdg or hardcoded
g_object_get (gconf, "gconf_prop_video_path", &v_path, NULL);
- if (!v_path || strcmp (v_path, "") == 0){
+ if (!v_path || strcmp (v_path, "") == 0)
+ {
//get xdg
v_path = g_strjoin (G_DIR_SEPARATOR_S, g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS), "Webcam", NULL);
- if (strcmp (v_path, "") == 0){
+ if (strcmp (v_path, "") == 0)
+ {
//get "~/.gnome2/cheese/media"
- v_path = g_strjoin (G_DIR_SEPARATOR_S, g_get_home_dir(), ".gnome2", "cheese", "media", NULL);
+ v_path = g_strjoin (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2", "cheese", "media", NULL);
}
}
priv->video_path = v_path;
@@ -190,12 +194,14 @@
//get the path from gconf, xdg or hardcoded
g_object_get (gconf, "gconf_prop_photo_path", &p_path, NULL);
- if (!p_path || strcmp (p_path, "") == 0){
+ if (!p_path || strcmp (p_path, "") == 0)
+ {
//get xdg
p_path = g_strjoin (G_DIR_SEPARATOR_S, g_get_user_special_dir (G_USER_DIRECTORY_PICTURES), "Webcam", NULL);
- if (strcmp (p_path, "") == 0){
+ if (strcmp (p_path, "") == 0)
+ {
//get "~/.gnome2/cheese/media"
- p_path = g_strjoin (G_DIR_SEPARATOR_S, g_get_home_dir(), ".gnome2", "cheese", "media", NULL);
+ p_path = g_strjoin (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2", "cheese", "media", NULL);
}
}
priv->photo_path = p_path;
Modified: trunk/src/cheese-fileutil.h
==============================================================================
--- trunk/src/cheese-fileutil.h (original)
+++ trunk/src/cheese-fileutil.h Mon Aug 4 22:17:10 2008
@@ -53,7 +53,7 @@
} CheeseMediaMode;
-GType cheese_fileutil_get_type(void);
+GType cheese_fileutil_get_type (void);
CheeseFileUtil *cheese_fileutil_new (void);
gchar *cheese_fileutil_get_video_path (CheeseFileUtil *fileutil);
gchar *cheese_fileutil_get_photo_path (CheeseFileUtil *fileutil);
Modified: trunk/src/cheese-gconf.c
==============================================================================
--- trunk/src/cheese-gconf.c (original)
+++ trunk/src/cheese-gconf.c Mon Aug 4 22:17:10 2008
@@ -79,7 +79,7 @@
else
effects = g_strjoin (",", effects, tmp->data, NULL);
- tmp = g_slist_next(tmp);
+ tmp = g_slist_next (tmp);
}
g_value_set_string (value, effects);
@@ -140,12 +140,13 @@
break;
case GCONF_PROP_SELECTED_EFFECTS:
- if (g_value_get_string (value) == NULL) {
+ if (g_value_get_string (value) == NULL)
+ {
list = NULL;
}
else
{
- effects = g_strsplit(g_value_get_string (value), ",", 12);
+ effects = g_strsplit (g_value_get_string (value), ",", 12);
for (i = 0; effects[i] != NULL; i++)
{
list = g_slist_append (list, effects[i]);
@@ -268,7 +269,7 @@
cheese_gconf_init (CheeseGConf *gconf)
{
CheeseGConfPrivate* priv = CHEESE_GCONF_GET_PRIVATE (gconf);
- priv->client = gconf_client_get_default();
+ priv->client = gconf_client_get_default ();
}
CheeseGConf *
Modified: trunk/src/cheese-gconf.h
==============================================================================
--- trunk/src/cheese-gconf.h (original)
+++ trunk/src/cheese-gconf.h Mon Aug 4 22:17:10 2008
@@ -51,7 +51,7 @@
GCONF_PROP_PHOTO_PATH
};
-GType cheese_gconf_get_type(void);
+GType cheese_gconf_get_type (void);
CheeseGConf *cheese_gconf_new ();
G_END_DECLS
Modified: trunk/src/cheese-no-camera.h
==============================================================================
--- trunk/src/cheese-no-camera.h (original)
+++ trunk/src/cheese-no-camera.h Mon Aug 4 22:17:10 2008
@@ -23,7 +23,7 @@
G_BEGIN_DECLS
-GtkWidget* cheese_no_camera_message_area (void);
+GtkWidget *cheese_no_camera_message_area (void);
G_END_DECLS
Modified: trunk/src/cheese-prefs-webcam-combo.c
==============================================================================
--- trunk/src/cheese-prefs-webcam-combo.c (original)
+++ trunk/src/cheese-prefs-webcam-combo.c Mon Aug 4 22:17:10 2008
@@ -128,13 +128,14 @@
/* If the selected device is not the same device as the one in gconf, the
selected device isn't available or was set by --hal-device. Set it now.
Not sure if this is desired behavior */
- if (num_devices > 0) {
+ if (num_devices > 0)
+ {
g_object_get (prefs_widget->gconf, priv->webcam_device_key, &gconf_device_name, NULL);
- if (strcmp(selected_device->video_device, gconf_device_name) != 0)
+ if (strcmp (selected_device->video_device, gconf_device_name) != 0)
{
- g_object_set(prefs_widget->gconf, priv->webcam_device_key, selected_device->video_device, NULL);
+ g_object_set (prefs_widget->gconf, priv->webcam_device_key, selected_device->video_device, NULL);
}
- g_free(gconf_device_name);
+ g_free (gconf_device_name);
}
gtk_list_store_clear (priv->list_store);
Modified: trunk/src/cheese-thumb-view.c
==============================================================================
--- trunk/src/cheese-thumb-view.c (original)
+++ trunk/src/cheese-thumb-view.c Mon Aug 4 22:17:10 2008
@@ -123,25 +123,29 @@
g_warning ("could not load thumbnail %s (%s)\n", filename, mime_type);
}
}
- g_object_unref(info);
+ g_object_unref (info);
g_free (thumb_loc);
g_free (uri);
- if (!pixbuf) {
+ if (!pixbuf)
+ {
gchar *escape = NULL;
GError *error = NULL;
escape = g_strrstr (mime_type, "/");
if (escape != NULL) *escape = '-';
pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
- mime_type,
- 96,
- GTK_ICON_LOOKUP_GENERIC_FALLBACK,
- &error);
- if (error) {
+ mime_type,
+ 96,
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+ &error);
+ if (error)
+ {
g_warning ("%s", error->message);
return;
}
- } else {
+ }
+ else
+ {
eog_thumbnail_add_frame (&pixbuf);
}
@@ -170,7 +174,7 @@
CheeseThumbViewThreadData *data;
- data = g_new0(CheeseThumbViewThreadData, 1);
+ data = g_new0 (CheeseThumbViewThreadData, 1);
data->thumb_view = g_object_ref (thumb_view);
data->file = g_object_ref (file);
@@ -235,7 +239,7 @@
{
GtkTreePath *tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->store), &iter);
gtk_icon_view_select_path (GTK_ICON_VIEW (thumb_view), tree_path);
- gtk_tree_path_free(tree_path);
+ gtk_tree_path_free (tree_path);
}
}
@@ -476,7 +480,8 @@
g_signal_connect (priv->video_file_monitor, "changed", G_CALLBACK (cheese_thumb_view_monitor_cb), thumb_view);
//if both paths are the same, make only one file monitor and point twice to the file monitor (photo_file_monitor = video_file_monitor)
- if (strcmp (path_videos, path_photos) != 0) {
+ if (strcmp (path_videos, path_photos) != 0)
+ {
//connect signal to photo path
file = g_file_new_for_path (path_photos);
priv->photo_file_monitor = g_file_monitor_directory (file, 0, NULL, NULL);
@@ -500,7 +505,7 @@
g_signal_connect (G_OBJECT (thumb_view), "drag-data-get",
G_CALLBACK (cheese_thumb_view_on_drag_data_get_cb), NULL);
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE (priv->store),
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (priv->store),
THUMBNAIL_URL_COLUMN, GTK_SORT_ASCENDING);
cheese_thumb_view_fill (thumb_view);
Modified: trunk/src/cheese-thumb-view.h
==============================================================================
--- trunk/src/cheese-thumb-view.h (original)
+++ trunk/src/cheese-thumb-view.h Mon Aug 4 22:17:10 2008
@@ -44,7 +44,7 @@
} CheeseThumbViewClass;
-GType cheese_thumb_view_get_type(void);
+GType cheese_thumb_view_get_type (void);
GtkWidget *cheese_thumb_view_new ();
GList *cheese_thumb_view_get_selected_images_list (CheeseThumbView *thumb_view);
char *cheese_thumb_view_get_selected_image (CheeseThumbView *thumb_view);
Modified: trunk/src/cheese-webcam.c
==============================================================================
--- trunk/src/cheese-webcam.c (original)
+++ trunk/src/cheese-webcam.c Mon Aug 4 22:17:10 2008
@@ -199,14 +199,14 @@
gst_structure_get_int (structure, "height", &height);
stride = buffer->size/height;
- pixbuf = gdk_pixbuf_new_from_data(GST_BUFFER_DATA (buffer), GDK_COLORSPACE_RGB,
- FALSE, bits_per_pixel, width, height, stride,
- NULL, NULL);
+ pixbuf = gdk_pixbuf_new_from_data (GST_BUFFER_DATA (buffer), GDK_COLORSPACE_RGB,
+ FALSE, bits_per_pixel, width, height, stride,
+ NULL, NULL);
gdk_pixbuf_save (pixbuf, priv->photo_filename, "jpeg", NULL, NULL);
g_object_unref (G_OBJECT (pixbuf));
- g_signal_handler_disconnect (G_OBJECT(priv->photo_sink),
+ g_signal_handler_disconnect (G_OBJECT (priv->photo_sink),
priv->photo_handler_signal_id);
g_signal_emit (webcam, webcam_signals[PHOTO_SAVED], 0);
@@ -217,7 +217,7 @@
{
CheeseWebcamPrivate* priv = CHEESE_WEBCAM_GET_PRIVATE (webcam);
- if (GST_MESSAGE_TYPE(message) == GST_MESSAGE_EOS)
+ if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_EOS)
{
g_print ("Received EOS message\n");
g_signal_emit (webcam, webcam_signals [VIDEO_SAVED], 0);
@@ -262,10 +262,10 @@
if (!libhal_ctx_init (hal_ctx, &error))
{
- if (dbus_error_is_set(&error))
+ if (dbus_error_is_set (&error))
{
g_error ("error: libhal_ctx_init: %s: %s\n", error.name, error.message);
- dbus_error_free(&error);
+ dbus_error_free (&error);
}
g_error ("Could not initialise connection to hald.\n"
"Normally this means the HAL daemon (hald) is not running or not ready");
@@ -277,7 +277,7 @@
if (dbus_error_is_set (&error))
{
g_error ("error: %s: %s\n", error.name, error.message);
- dbus_error_free(&error);
+ dbus_error_free (&error);
return;
}
@@ -309,7 +309,7 @@
if (dbus_error_is_set (&error))
{
g_error ("error: %s: %s\n", error.name, error.message);
- dbus_error_free(&error);
+ dbus_error_free (&error);
return;
}
priv->webcam_devices[i].video_device = g_strdup (device);
@@ -749,36 +749,36 @@
if ((priv->effect_filter = gst_element_factory_make ("identity", "effect")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "identity");
+ cheese_webcam_set_error_element_not_found (error, "identity");
return FALSE;
}
if ((priv->csp_post_effect = gst_element_factory_make ("ffmpegcolorspace", "csp_post_effect")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "ffmpegcolorspace");
+ cheese_webcam_set_error_element_not_found (error, "ffmpegcolorspace");
return FALSE;
}
if ((tee = gst_element_factory_make ("tee", "tee")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "tee");
+ cheese_webcam_set_error_element_not_found (error, "tee");
return FALSE;
}
if ((save_queue = gst_element_factory_make ("queue", "save_queue")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "queue");
+ cheese_webcam_set_error_element_not_found (error, "queue");
return FALSE;
}
if ((video_display_queue = gst_element_factory_make ("queue", "video_display_queue")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "queue");
+ cheese_webcam_set_error_element_not_found (error, "queue");
return FALSE;
}
if ((video_scale = gst_element_factory_make ("videoscale", "video_scale")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "videoscale");
+ cheese_webcam_set_error_element_not_found (error, "videoscale");
return FALSE;
}
@@ -787,7 +787,7 @@
if ((video_sink = gst_element_factory_make ("gconfvideosink", "video_sink")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "gconfvideosink");
+ cheese_webcam_set_error_element_not_found (error, "gconfvideosink");
return FALSE;
}
@@ -828,12 +828,12 @@
if ((csp_photo_save_bin = gst_element_factory_make ("ffmpegcolorspace", "csp_photo_save_bin")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "ffmpegcolorspace");
+ cheese_webcam_set_error_element_not_found (error, "ffmpegcolorspace");
return FALSE;
}
if ((priv->photo_sink = gst_element_factory_make ("fakesink", "photo_sink")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "fakesink");
+ cheese_webcam_set_error_element_not_found (error, "fakesink");
return FALSE;
}
@@ -875,44 +875,44 @@
if ((priv->audio_source = gst_element_factory_make ("gconfaudiosrc", "audio_source")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "gconfaudiosrc");
+ cheese_webcam_set_error_element_not_found (error, "gconfaudiosrc");
return FALSE;
}
if ((audio_queue = gst_element_factory_make ("queue", "audio_queue")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "queue");
+ cheese_webcam_set_error_element_not_found (error, "queue");
return FALSE;
}
if ((audio_convert = gst_element_factory_make ("audioconvert", "audio_convert")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "audioconvert");
+ cheese_webcam_set_error_element_not_found (error, "audioconvert");
return FALSE;
}
if ((audio_enc = gst_element_factory_make ("vorbisenc", "audio_enc")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "vorbisenc");
+ cheese_webcam_set_error_element_not_found (error, "vorbisenc");
return FALSE;
}
if ((video_save_csp = gst_element_factory_make ("ffmpegcolorspace", "video_save_csp")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "ffmpegcolorspace");
+ cheese_webcam_set_error_element_not_found (error, "ffmpegcolorspace");
return FALSE;
}
if ((video_enc = gst_element_factory_make ("theoraenc", "video_enc")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "theoraenc");
+ cheese_webcam_set_error_element_not_found (error, "theoraenc");
return FALSE;
}
g_object_set (video_enc, "keyframe-force", 1, NULL);
if ((video_save_rate = gst_element_factory_make ("videorate", "video_save_rate")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "videorate");
+ cheese_webcam_set_error_element_not_found (error, "videorate");
return FALSE;
}
if ((video_save_scale = gst_element_factory_make ("videoscale", "video_save_scale")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "videoscale");
+ cheese_webcam_set_error_element_not_found (error, "videoscale");
return FALSE;
}
/* Use bilinear scaling */
@@ -920,12 +920,12 @@
if ((mux = gst_element_factory_make ("oggmux", "mux")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "oggmux");
+ cheese_webcam_set_error_element_not_found (error, "oggmux");
return FALSE;
}
if ((priv->video_file_sink = gst_element_factory_make ("filesink", "video_file_sink")) == NULL)
{
- cheese_webcam_set_error_element_not_found(error, "filesink");
+ cheese_webcam_set_error_element_not_found (error, "filesink");
return FALSE;
}
@@ -1095,7 +1095,7 @@
effect_filter = gst_parse_bin_from_description (effects_pipeline_desc, TRUE, &err);
if (!effect_filter || (err != NULL))
{
- g_error_free(err);
+ g_error_free (err);
g_error ("ERROR effect_filter\n");
}
cheese_webcam_change_effect_filter (webcam, effect_filter);
@@ -1218,8 +1218,8 @@
{
case PROP_VIDEO_WINDOW:
priv->video_window = g_value_get_pointer (value);
- g_signal_connect(priv->video_window, "expose-event",
- G_CALLBACK(cheese_webcam_expose_cb), self);
+ g_signal_connect (priv->video_window, "expose-event",
+ G_CALLBACK(cheese_webcam_expose_cb), self);
break;
case PROP_DEVICE_NAME:
g_free (priv->device_name);
@@ -1406,7 +1406,7 @@
devices_arr = g_array_sized_new (FALSE,
TRUE,
- sizeof(CheeseWebcamDevice),
+ sizeof (CheeseWebcamDevice),
priv->num_webcam_devices);
devices_arr = g_array_append_vals (devices_arr,
priv->webcam_devices,
@@ -1417,7 +1417,7 @@
void
cheese_webcam_set_device_by_dev_file (CheeseWebcam *webcam, char *file)
{
- g_object_set(webcam, "device_name", file, NULL);
+ g_object_set (webcam, "device_name", file, NULL);
}
void
@@ -1427,9 +1427,9 @@
int i;
for (i = 0; i < priv->num_webcam_devices; i++)
{
- if (strcmp(priv->webcam_devices[i].hal_udi, udi) == 0)
+ if (strcmp (priv->webcam_devices[i].hal_udi, udi) == 0)
{
- g_object_set(webcam, "device_name", priv->webcam_devices[i].video_device, NULL);
+ g_object_set (webcam, "device_name", priv->webcam_devices[i].video_device, NULL);
break;
}
}
Modified: trunk/src/cheese-window.c
==============================================================================
--- trunk/src/cheese-window.c (original)
+++ trunk/src/cheese-window.c Mon Aug 4 22:17:10 2008
@@ -168,7 +168,7 @@
_("Failed to open browser to show:\n%s"), url);
gtk_dialog_run (GTK_DIALOG (error_dialog));
gtk_widget_destroy (error_dialog);
- g_error_free(error);
+ g_error_free (error);
}
}
@@ -192,7 +192,7 @@
_("Failed to open email client to send message to:\n%s"), email);
gtk_dialog_run (GTK_DIALOG (error_dialog));
gtk_widget_destroy (error_dialog);
- g_error_free(error);
+ g_error_free (error);
}
g_free (uri);
}
@@ -317,7 +317,7 @@
_("Failed to launch program to show:\n%s"), uri);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- g_error_free(error);
+ g_error_free (error);
}
g_free (uri);
}
@@ -382,9 +382,9 @@
gtk_widget_destroy (dlg);
g_free (header);
}
- g_free(target_filename);
+ g_free (target_filename);
}
- g_free(filename);
+ g_free (filename);
gtk_widget_destroy (dialog);
}
@@ -426,12 +426,12 @@
if (delete_all)
{
g_print ("deleting %s\n", g_file_get_basename (l->data));
- if (!g_file_delete (l->data, NULL, &error)) {
- cheese_window_delete_error_dialog (cheese_window,
- l->data,
- error != NULL ? error->message : _("Unknown Error"));
- g_error_free(error);
- error = NULL;
+ if (!g_file_delete (l->data, NULL, &error))
+ {
+ cheese_window_delete_error_dialog (cheese_window, l->data,
+ error != NULL ? error->message : _("Unknown Error"));
+ g_error_free (error);
+ error = NULL;
}
}
else
@@ -447,7 +447,8 @@
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (question_dialog),
"%s", secondary);
gtk_dialog_add_button (GTK_DIALOG (question_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- if (list_length > 1) {
+ if (list_length > 1)
+ {
/* no need for all those buttons we have a single file to delete */
gtk_dialog_add_button (GTK_DIALOG (question_dialog), CHEESE_BUTTON_SKIP, CHEESE_RESPONSE_SKIP);
gtk_dialog_add_button (GTK_DIALOG (question_dialog), CHEESE_BUTTON_SKIP_ALL, CHEESE_RESPONSE_SKIP_ALL);
@@ -458,7 +459,7 @@
gtk_widget_destroy (question_dialog);
g_free (primary);
g_free (secondary);
- g_error_free(error);
+ g_error_free (error);
error = NULL;
switch (response)
{
@@ -467,11 +468,12 @@
delete_all = TRUE;
case GTK_RESPONSE_ACCEPT:
g_print ("deleting %s\n", g_file_get_basename (l->data));
- if (!g_file_delete (l->data, NULL, &error)) {
+ if (!g_file_delete (l->data, NULL, &error))
+ {
cheese_window_delete_error_dialog (cheese_window,
l->data,
error != NULL ? error->message : _("Unknown Error"));
- g_error_free(error);
+ g_error_free (error);
error = NULL;
}
break;
@@ -603,7 +605,7 @@
if (e_book_get_self (&contact, &book, NULL) && filename)
{
char *name = e_contact_get (contact, E_CONTACT_FULL_NAME);
- g_print("Setting Account Photo for %s\n", name);
+ g_print ("Setting Account Photo for %s\n", name);
pixbuf = gdk_pixbuf_new_from_file_at_scale (filename, MAX_PHOTO_HEIGHT,
MAX_PHOTO_WIDTH, TRUE, NULL);
@@ -622,7 +624,7 @@
"compression", "9", NULL);
e_contact_set (contact, E_CONTACT_PHOTO, &photo);
- if (!e_book_commit_contact(book, contact, &error))
+ if (!e_book_commit_contact (book, contact, &error))
{
char *header;
GtkWidget *dlg;
@@ -826,7 +828,7 @@
{
if (gtk_notebook_get_current_page (GTK_NOTEBOOK (cheese_window->notebook)) == 1)
{
- gtk_notebook_set_current_page (GTK_NOTEBOOK(cheese_window->notebook), 0);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook), 0);
gtk_label_set_text_with_mnemonic (GTK_LABEL (cheese_window->label_effects), _("_Effects"));
gtk_widget_set_sensitive (cheese_window->take_picture, TRUE);
if (cheese_window->webcam_mode == WEBCAM_MODE_PHOTO)
@@ -945,7 +947,7 @@
cheese_window_countdown_hide_cb (gpointer data)
{
CheeseWindow *cheese_window = (CheeseWindow *) data;
- gtk_notebook_set_current_page(GTK_NOTEBOOK(cheese_window->notebook_bar), 0);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook_bar), 0);
}
void
@@ -987,9 +989,9 @@
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
_("Unable to open help file for Cheese"));
- gtk_dialog_run(GTK_DIALOG(d));
- gtk_widget_destroy(d);
- g_error_free(error);
+ gtk_dialog_run (GTK_DIALOG (d));
+ gtk_widget_destroy (d);
+ g_error_free (error);
}
}
}
@@ -1045,11 +1047,11 @@
g_object_get (cheese_window->gconf, "gconf_prop_countdown", &countdown, NULL);
if (countdown)
{
- cheese_countdown_start((CheeseCountdown *) cheese_window->countdown,
- cheese_window_countdown_picture_cb,
- cheese_window_countdown_hide_cb,
- (gpointer) cheese_window);
- gtk_notebook_set_current_page (GTK_NOTEBOOK(cheese_window->notebook_bar), 1);
+ cheese_countdown_start ((CheeseCountdown *) cheese_window->countdown,
+ cheese_window_countdown_picture_cb,
+ cheese_window_countdown_hide_cb,
+ (gpointer) cheese_window);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook_bar), 1);
}
else
{
@@ -1236,7 +1238,7 @@
return;
gtk_container_add (GTK_CONTAINER (cheese_window->message_area_frame), cheese_window->message_area);
- gtk_widget_show (GTK_WIDGET(cheese_window->message_area));
+ gtk_widget_show (GTK_WIDGET (cheese_window->message_area));
}
static void
@@ -1247,7 +1249,7 @@
GtkBuilder* builder;
#ifdef HILDON
- HildonProgram *program = hildon_program_get_instance();
+ HildonProgram *program = hildon_program_get_instance ();
GtkWidget *menu;
GtkWidget *menuitem;
#else
@@ -1290,20 +1292,20 @@
/* Reparent widgets in case we use hildon. This saves us maintaining two
GtkBuilder ui files
*/
- cheese_window->window = hildon_window_new();
- cheese_window->main_hbox = gtk_hbox_new(FALSE, 0);
- hildon_program_add_window (program, HILDON_WINDOW(cheese_window->window));
- gtk_container_add (GTK_CONTAINER(cheese_window->window), cheese_window->main_hbox);
- gtk_widget_ref(cheese_window->thumb_scrollwindow);
- gtk_widget_ref(cheese_window->video_vbox);
- gtk_container_remove(GTK_CONTAINER(cheese_window->video_vbox), cheese_window->thumb_scrollwindow);
- gtk_container_remove(GTK_CONTAINER(cheese_window->main_vbox),cheese_window->video_vbox);
- gtk_box_pack_start (GTK_BOX(cheese_window->main_hbox), cheese_window->video_vbox, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX(cheese_window->main_hbox), GTK_WIDGET(cheese_window->thumb_scrollwindow), FALSE, FALSE, 0);
- gtk_widget_destroy(cheese_window->main_vbox);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(cheese_window->thumb_scrollwindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_widget_unref(cheese_window->thumb_scrollwindow);
- gtk_widget_unref(cheese_window->video_vbox);
+ cheese_window->window = hildon_window_new ();
+ cheese_window->main_hbox = gtk_hbox_new (FALSE, 0);
+ hildon_program_add_window (program, HILDON_WINDOW (cheese_window->window));
+ gtk_container_add (GTK_CONTAINER (cheese_window->window), cheese_window->main_hbox);
+ gtk_widget_ref (cheese_window->thumb_scrollwindow);
+ gtk_widget_ref (cheese_window->video_vbox);
+ gtk_container_remove (GTK_CONTAINER (cheese_window->video_vbox), cheese_window->thumb_scrollwindow);
+ gtk_container_remove (GTK_CONTAINER (cheese_window->main_vbox),cheese_window->video_vbox);
+ gtk_box_pack_start (GTK_BOX (cheese_window->main_hbox), cheese_window->video_vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (cheese_window->main_hbox), GTK_WIDGET (cheese_window->thumb_scrollwindow), FALSE, FALSE, 0);
+ gtk_widget_destroy (cheese_window->main_vbox);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (cheese_window->thumb_scrollwindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_widget_unref (cheese_window->thumb_scrollwindow);
+ gtk_widget_unref (cheese_window->video_vbox);
#endif
g_object_unref (builder);
@@ -1444,20 +1446,20 @@
}
#ifdef HILDON
- menu = gtk_menu_new();
- menuitem = gtk_menu_item_new_with_label(_("Quit"));
- g_signal_connect(menuitem,"activate",
- GTK_SIGNAL_FUNC(cheese_window_cmd_close),
- cheese_window);
- gtk_menu_append(menu, menuitem);
+ menu = gtk_menu_new ();
+ menuitem = gtk_menu_item_new_with_label (_("Quit"));
+ g_signal_connect (menuitem,"activate",
+ GTK_SIGNAL_FUNC (cheese_window_cmd_close),
+ cheese_window);
+ gtk_menu_append (menu, menuitem);
menuitem = gtk_menu_item_new_with_label(_("About"));
- g_signal_connect(menuitem,"activate",
- GTK_SIGNAL_FUNC(cheese_window_cmd_about),
- cheese_window);
- gtk_menu_append(menu, menuitem);
+ g_signal_connect (menuitem,"activate",
+ GTK_SIGNAL_FUNC (cheese_window_cmd_about),
+ cheese_window);
+ gtk_menu_append (menu, menuitem);
- hildon_window_set_menu (HILDON_WINDOW(cheese_window->window),GTK_MENU(menu));
+ hildon_window_set_menu (HILDON_WINDOW (cheese_window->window),GTK_MENU (menu));
#else
menubar = gtk_ui_manager_get_widget (cheese_window->ui_manager, "/MainMenu");
gtk_box_pack_start (GTK_BOX (cheese_window->main_vbox), menubar, FALSE, FALSE, 0);
@@ -1476,13 +1478,13 @@
gtk_action_group_set_sensitive (cheese_window->actions_file, FALSE);
action = gtk_ui_manager_get_action (cheese_window->ui_manager, "/MainMenu/Edit/Effects");
- gtk_action_connect_proxy (GTK_ACTION(action), GTK_WIDGET(cheese_window->button_effects));
+ gtk_action_connect_proxy (GTK_ACTION (action), GTK_WIDGET (cheese_window->button_effects));
/* Default handlers for closing the application */
g_signal_connect (cheese_window->window, "destroy",
G_CALLBACK (cheese_window_cmd_close), cheese_window);
g_signal_connect (cheese_window->window, "delete_event",
- G_CALLBACK(cheese_window_delete_event_cb), NULL);
+ G_CALLBACK (cheese_window_delete_event_cb), NULL);
g_signal_connect (cheese_window->take_picture, "clicked",
G_CALLBACK (cheese_window_action_button_clicked_cb), cheese_window);
@@ -1524,14 +1526,14 @@
GTK_BUTTONS_OK,
"%s", error->message);
- g_error_free(error);
+ g_error_free (error);
- g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_window_set_title(GTK_WINDOW (dialog), "Critical Error");
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ gtk_window_set_title (GTK_WINDOW (dialog), "Critical Error");
gtk_dialog_run (GTK_DIALOG (dialog));
// Clean up and exit
- cheese_window_cmd_close(NULL, cheese_window);
+ cheese_window_cmd_close (NULL, cheese_window);
gdk_threads_leave ();
}
@@ -1546,11 +1548,11 @@
cheese_webcam_play (cheese_window->webcam);
gdk_threads_enter ();
- gtk_notebook_set_current_page (GTK_NOTEBOOK(cheese_window->notebook), 0);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook), 0);
ephy_spinner_stop (EPHY_SPINNER (cheese_window->throbber));
if (cheese_webcam_get_num_webcam_devices (cheese_window->webcam) == 0)
{
- message_area = cheese_no_camera_message_area();
+ message_area = cheese_no_camera_message_area ();
g_signal_connect (message_area,
"response",
@@ -1582,7 +1584,7 @@
gtk_widget_show_all (cheese_window->window);
ephy_spinner_start (EPHY_SPINNER (cheese_window->throbber));
- gtk_notebook_set_current_page (GTK_NOTEBOOK(cheese_window->notebook), 2);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook), 2);
cheese_window->webcam_mode = WEBCAM_MODE_PHOTO;
cheese_window->recording = FALSE;
Modified: trunk/src/cheese.c
==============================================================================
--- trunk/src/cheese.c (original)
+++ trunk/src/cheese.c Mon Aug 4 22:17:10 2008
@@ -38,7 +38,7 @@
char *hal_device_id;
} CheeseOptions;
-void cheese_print_handler(char *string)
+void cheese_print_handler (char *string)
{
static FILE *fp = NULL;
GDir *dir;
@@ -52,7 +52,8 @@
path = cheese_fileutil_get_log_path (fileutil);
dir = g_dir_open (path, 0, NULL);
- if (!dir) {
+ if (!dir)
+ {
return;
}
@@ -93,11 +94,11 @@
g_set_application_name (_("Cheese"));
context = g_option_context_new (N_("- Take photos and videos with your webcam, with fun graphical effects"));
- g_option_context_add_main_entries(context, options, GETTEXT_PACKAGE);
+ g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
g_option_context_add_group (context, gst_init_get_option_group ());
- g_option_context_parse(context, &argc, &argv, NULL);
- g_option_context_free(context);
+ g_option_context_parse (context, &argc, &argv, NULL);
+ g_option_context_free (context);
gtk_init (&argc, &argv);
gst_init (&argc, &argv);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]