[nautilus] general: use new DEBUG macros instead of nautilus_debug_log
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] general: use new DEBUG macros instead of nautilus_debug_log
- Date: Thu, 2 Dec 2010 13:31:14 +0000 (UTC)
commit 218670bd1f1f9d8f980460c9f2ed721ff57c04a7
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Dec 2 14:28:26 2010 +0100
general: use new DEBUG macros instead of nautilus_debug_log
libnautilus-private/nautilus-file-operations.c | 1 -
libnautilus-private/nautilus-icon-container.c | 10 ++--
libnautilus-private/nautilus-icon-dnd.c | 7 +-
libnautilus-private/nautilus-mime-actions.c | 27 +++------
libnautilus-private/nautilus-tree-view-drag-dest.c | 20 ++++---
src/file-manager/fm-directory-view.c | 44 ++++++--------
src/file-manager/fm-error-reporting.c | 8 +-
src/file-manager/fm-list-view.c | 14 ++---
src/file-manager/fm-tree-view.c | 22 +++----
src/nautilus-application-smclient.c | 40 ++++++++++---
src/nautilus-application.c | 62 ++++++++++++++-----
src/nautilus-places-sidebar.c | 9 ++-
src/nautilus-window-manage-views.c | 19 +++----
13 files changed, 155 insertions(+), 128 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index e351fdf..2aab84f 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -38,7 +38,6 @@
#include "nautilus-file-operations.h"
-#include "nautilus-debug-log.h"
#include "nautilus-file-changes-queue.h"
#include "nautilus-lib-self-check-functions.h"
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index cbb977d..0df550b 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -29,7 +29,6 @@
#include <math.h>
#include "nautilus-icon-container.h"
-#include "nautilus-debug-log.h"
#include "nautilus-global-preferences.h"
#include "nautilus-icon-private.h"
#include "nautilus-lib-self-check-functions.h"
@@ -49,6 +48,9 @@
#include <stdio.h>
#include <string.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_ICON_CONTAINER
+#include "nautilus-debug.h"
+
#define TAB_NAVIGATION_DISABLED
/* Interval for updating the rubberband selection, in milliseconds. */
@@ -4671,8 +4673,7 @@ button_release_event (GtkWidget *widget,
nautilus_icon_container_did_not_drag (container, event);
} else {
nautilus_icon_dnd_end_drag (container);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "end drag from icon container");
+ DEBUG ("Ending drag from icon container");
}
break;
case DRAG_STATE_STRETCH:
@@ -4744,8 +4745,7 @@ motion_notify_event (GtkWidget *widget,
event,
canvas_x,
canvas_y);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "begin drag from icon container");
+ DEBUG ("Beginning drag from icon container");
}
break;
case DRAG_STATE_STRETCH:
diff --git a/libnautilus-private/nautilus-icon-dnd.c b/libnautilus-private/nautilus-icon-dnd.c
index 569de09..d324fa9 100644
--- a/libnautilus-private/nautilus-icon-dnd.c
+++ b/libnautilus-private/nautilus-icon-dnd.c
@@ -35,7 +35,6 @@
#include <math.h>
#include "nautilus-icon-dnd.h"
-#include "nautilus-debug-log.h"
#include "nautilus-file-dnd.h"
#include "nautilus-icon-private.h"
#include "nautilus-link.h"
@@ -60,6 +59,9 @@
#include <stdio.h>
#include <string.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_ICON_CONTAINER
+#include "nautilus-debug.h"
+
static const GtkTargetEntry drag_types [] = {
{ NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE, 0, NAUTILUS_ICON_DND_GNOME_ICON_LIST },
{ NAUTILUS_ICON_DND_URI_LIST_TYPE, 0, NAUTILUS_ICON_DND_URI_LIST },
@@ -390,8 +392,7 @@ get_direct_save_filename (GdkDragContext *context)
/* Verify that the file name provided by the source is valid */
if (*prop_text == '\0' ||
strchr ((const gchar *) prop_text, G_DIR_SEPARATOR) != NULL) {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "Invalid filename provided by XDS drag site");
+ DEBUG ("Invalid filename provided by XDS drag site");
g_free (prop_text);
return NULL;
}
diff --git a/libnautilus-private/nautilus-mime-actions.c b/libnautilus-private/nautilus-mime-actions.c
index 1373f09..cf34b54 100644
--- a/libnautilus-private/nautilus-mime-actions.c
+++ b/libnautilus-private/nautilus-mime-actions.c
@@ -41,7 +41,9 @@
#include "nautilus-desktop-icon-file.h"
#include "nautilus-global-preferences.h"
#include "nautilus-signaller.h"
-#include "nautilus-debug-log.h"
+
+#define DEBUG_FLAG NAUTILUS_DEBUG_MIME
+#include "nautilus-debug.h"
typedef enum {
ACTIVATION_ACTION_LAUNCH_DESKTOP_FILE,
@@ -1323,8 +1325,7 @@ search_for_application_mime_type (ActivateParametersInstall *parameters_install,
(GAsyncReadyCallback) search_for_application_dbus_call_notify_cb,
parameters_install);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "InstallMimeType method invoked for %s", mime_type);
+ DEBUG ("InstallMimeType method invoked for %s", mime_type);
}
static void
@@ -1501,9 +1502,7 @@ untrusted_launcher_response_callback (GtkDialog *dialog,
case RESPONSE_RUN:
screen = gtk_widget_get_screen (GTK_WIDGET (parameters->parent_window));
uri = nautilus_file_get_uri (parameters->file);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "directory view activate_callback launch_desktop_file window=%p: %s",
- parameters->parent_window, uri);
+ DEBUG ("Launching untrusted launcher %s", uri);
nautilus_launch_desktop_file (screen, uri, NULL,
parameters->parent_window);
g_free (uri);
@@ -1584,9 +1583,7 @@ activate_desktop_file (ActivateParameters *parameters,
}
uri = nautilus_file_get_uri (file);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "directory view activate_callback launch_desktop_file window=%p: %s",
- parameters->parent_window, uri);
+ DEBUG ("Launching trusted launcher %s", uri);
nautilus_launch_desktop_file (screen, uri, NULL,
parameters->parent_window);
g_free (uri);
@@ -1693,9 +1690,7 @@ activate_files (ActivateParameters *parameters)
quoted_path = g_shell_quote (executable_path);
name = nautilus_file_get_name (file);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "directory view activate_callback launch_file window=%p: %s",
- parameters->parent_window, quoted_path);
+ DEBUG ("Launching file name %s, path %s", name, quoted_path);
nautilus_launch_application_from_command (screen, name, quoted_path, FALSE, NULL);
g_free (name);
@@ -1714,9 +1709,7 @@ activate_files (ActivateParameters *parameters)
quoted_path = g_shell_quote (executable_path);
name = nautilus_file_get_name (file);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "directory view activate_callback launch_in_terminal window=%p: %s",
- parameters->parent_window, quoted_path);
+ DEBUG ("Launching in terminal file name %s, quoted path %s", name, quoted_path);
nautilus_launch_application_from_command (screen, name, quoted_path, TRUE, NULL);
g_free (name);
@@ -2298,9 +2291,7 @@ nautilus_mime_activate_files (GtkWindow *parent_window,
return;
}
- nautilus_debug_log_with_file_list (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER, files,
- "nautilus_mime_activate_files window=%p",
- parent_window);
+ DEBUG_FILES (files, "Calling activate_files() with files:");
parameters = g_new0 (ActivateParameters, 1);
parameters->slot_info = slot_info;
diff --git a/libnautilus-private/nautilus-tree-view-drag-dest.c b/libnautilus-private/nautilus-tree-view-drag-dest.c
index f11d075..f290d58 100644
--- a/libnautilus-private/nautilus-tree-view-drag-dest.c
+++ b/libnautilus-private/nautilus-tree-view-drag-dest.c
@@ -29,19 +29,24 @@
*/
#include <config.h>
+
#include "nautilus-tree-view-drag-dest.h"
-#include <eel/eel-gtk-macros.h>
-#include <gtk/gtk.h>
#include "nautilus-file-dnd.h"
#include "nautilus-file-changes-queue.h"
#include "nautilus-icon-dnd.h"
#include "nautilus-link.h"
#include "nautilus-marshal.h"
-#include "nautilus-debug-log.h"
+
+#include <eel/eel-gtk-macros.h>
+#include <gtk/gtk.h>
+
#include <stdio.h>
#include <string.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_LIST_VIEW
+#include "nautilus-debug.h"
+
#define AUTO_SCROLL_MARGIN 20
#define HOVER_EXPAND_TIMEOUT 1
@@ -874,8 +879,7 @@ get_direct_save_filename (GdkDragContext *context)
/* Verify that the file name provided by the source is valid */
if (*prop_text == '\0' ||
strchr ((const gchar *) prop_text, G_DIR_SEPARATOR) != NULL) {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "Invalid filename provided by XDS drag site");
+ DEBUG ("Invalid filename provided by XDS drag site");
g_free (prop_text);
return NULL;
}
@@ -917,12 +921,10 @@ set_direct_save_uri (NautilusTreeViewDragDest *dest,
dest->details->direct_save_uri = uri;
} else {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "Invalid filename provided by XDS drag site");
+ DEBUG ("Invalid filename provided by XDS drag site");
}
} else {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "Could not retrieve XDS drop destination");
+ DEBUG ("Could not retrieve XDS drop destination");
}
return uri != NULL;
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 18d50d1..dbda0ed 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -54,7 +54,6 @@
#include <libnautilus-extension/nautilus-menu-provider.h>
#include <libnautilus-private/nautilus-clipboard.h>
#include <libnautilus-private/nautilus-clipboard-monitor.h>
-#include <libnautilus-private/nautilus-debug-log.h>
#include <libnautilus-private/nautilus-desktop-icon-file.h>
#include <libnautilus-private/nautilus-desktop-directory.h>
#include <libnautilus-private/nautilus-search-directory.h>
@@ -77,6 +76,9 @@
#include <libnautilus-private/nautilus-signaller.h>
#include <libnautilus-private/nautilus-icon-names.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_DIRECTORY_VIEW
+#include <libnautilus-private/nautilus-debug.h>
+
/* Minimum starting update inverval */
#define UPDATE_INTERVAL_MIN 100
/* Maximum update interval */
@@ -846,8 +848,7 @@ open_location (FMDirectoryView *directory_view,
g_assert (new_uri != NULL);
window = fm_directory_view_get_containing_window (directory_view);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "directory view open_location window=%p: %s", window, new_uri);
+ DEBUG ("open_location window=%p: %s", window, new_uri);
location = g_file_new_for_uri (new_uri);
nautilus_window_slot_info_open_location (directory_view->details->slot,
location, mode, flags, NULL);
@@ -1439,8 +1440,7 @@ action_new_launcher_callback (GtkAction *action,
parent_uri = fm_directory_view_get_backing_uri (view);
window = fm_directory_view_get_containing_window (view);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "directory view create new launcher in window=%p: %s", window, parent_uri);
+ DEBUG ("Create new launcher in window=%p: %s", window, parent_uri);
nautilus_launch_application_from_command (gtk_widget_get_screen (GTK_WIDGET (view)),
"gnome-desktop-item-edit",
"gnome-desktop-item-edit",
@@ -3156,10 +3156,8 @@ files_added_callback (NautilusDirectory *directory,
window = fm_directory_view_get_containing_window (view);
uri = fm_directory_view_get_uri (view);
- nautilus_debug_log_with_file_list (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_ASYNC, files,
- "files added in window %p: %s",
- window,
- uri ? uri : "(no directory)");
+ DEBUG_FILES (files, "Files added in window %p: %s",
+ window, uri ? uri : "(no directory)");
g_free (uri);
schedule_changes (view);
@@ -3183,10 +3181,8 @@ files_changed_callback (NautilusDirectory *directory,
window = fm_directory_view_get_containing_window (view);
uri = fm_directory_view_get_uri (view);
- nautilus_debug_log_with_file_list (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_ASYNC, files,
- "files changed in window %p: %s",
- window,
- uri ? uri : "(no directory)");
+ DEBUG_FILES (files, "Files changed in window %p: %s",
+ window, uri ? uri : "(no directory)");
g_free (uri);
schedule_changes (view);
@@ -5158,9 +5154,10 @@ run_script_callback (GtkAction *action, gpointer callback_data)
name = nautilus_file_get_name (launch_parameters->file);
/* FIXME: handle errors with dialog? Or leave up to each script? */
window = fm_directory_view_get_containing_window (launch_parameters->directory_view);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "directory view run_script_callback, window=%p, name=\"%s\", script_path=\"%s\" (omitting script parameters)",
- window, name, local_file_path);
+
+ DEBUG ("run_script_callback, name=\"%s\", script_path=\"%s\" (omitting script parameters)",
+ name, local_file_path);
+
nautilus_launch_application_from_command_array (screen, name, quoted_path, FALSE,
(const char * const *) parameters);
g_free (name);
@@ -9166,20 +9163,15 @@ schedule_update_status (FMDirectoryView *view)
void
fm_directory_view_notify_selection_changed (FMDirectoryView *view)
{
- GList *selection;
GtkWindow *window;
+ GList *selection;
g_return_if_fail (FM_IS_DIRECTORY_VIEW (view));
- if (nautilus_debug_log_is_domain_enabled (NAUTILUS_DEBUG_LOG_DOMAIN_USER)) {
- selection = fm_directory_view_get_selection (view);
-
- window = fm_directory_view_get_containing_window (view);
- nautilus_debug_log_with_file_list (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER, selection,
- "selection changed in window %p",
- window);
- nautilus_file_list_free (selection);
- }
+ selection = fm_directory_view_get_selection (view);
+ window = fm_directory_view_get_containing_window (view);
+ DEBUG_FILES (selection, "Selection changed in window %p", window);
+ nautilus_file_list_free (selection);
view->details->selection_was_removed = FALSE;
diff --git a/src/file-manager/fm-error-reporting.c b/src/file-manager/fm-error-reporting.c
index 56f85a6..69db967 100644
--- a/src/file-manager/fm-error-reporting.c
+++ b/src/file-manager/fm-error-reporting.c
@@ -28,11 +28,13 @@
#include <string.h>
#include <glib/gi18n.h>
-#include <libnautilus-private/nautilus-debug-log.h>
#include <libnautilus-private/nautilus-file.h>
#include <eel/eel-string.h>
#include <eel/eel-stock-dialogs.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_DIRECTORY_VIEW
+#include <libnautilus-private/nautilus-debug.h>
+
#define NEW_NAME_TAG "Nautilus: new name"
#define MAXIMUM_DISPLAYED_FILE_NAME_LENGTH 50
@@ -346,9 +348,7 @@ fm_rename_file (NautilusFile *file,
g_free (wait_message);
uri = nautilus_file_get_uri (file);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "rename file old=\"%s\", new=\"%s\"",
- uri, new_name);
+ DEBUG ("Renaming file %s to %s", uri, new_name);
g_free (uri);
/* Start the rename. */
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 31d09c9..a83c8b0 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -46,7 +46,6 @@
#include <libnautilus-private/nautilus-clipboard-monitor.h>
#include <libnautilus-private/nautilus-column-chooser.h>
#include <libnautilus-private/nautilus-column-utilities.h>
-#include <libnautilus-private/nautilus-debug-log.h>
#include <libnautilus-private/nautilus-dnd.h>
#include <libnautilus-private/nautilus-file-dnd.h>
#include <libnautilus-private/nautilus-file-utilities.h>
@@ -60,6 +59,9 @@
#include <libnautilus-private/nautilus-clipboard.h>
#include <libnautilus-private/nautilus-cell-renderer-text-ellipsized.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_LIST_VIEW
+#include <libnautilus-private/nautilus-debug.h>
+
struct FMListViewDetails {
GtkTreeView *tree_view;
FMListModel *model;
@@ -856,10 +858,7 @@ row_expanded_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *pa
char *uri;
uri = nautilus_directory_get_uri (directory);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "list view row expanded window=%p: %s",
- fm_directory_view_get_containing_window (FM_DIRECTORY_VIEW (view)),
- uri);
+ DEBUG ("Row expaded callback for uri %s", uri);
g_free (uri);
fm_directory_view_add_subdirectory (FM_DIRECTORY_VIEW (view), directory);
@@ -943,10 +942,7 @@ row_collapsed_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *p
uri = nautilus_file_get_uri (file);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "list view row collapsed window=%p: %s",
- fm_directory_view_get_containing_window (FM_DIRECTORY_VIEW (view)),
- uri);
+ DEBUG ("Row collapsed callback for uri %s", uri);
g_free (uri);
unload_data = g_new (struct UnloadDelayData, 1);
diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c
index 3df30f0..acc99a8 100644
--- a/src/file-manager/fm-tree-view.c
+++ b/src/file-manager/fm-tree-view.c
@@ -42,7 +42,6 @@
#include <libnautilus-private/nautilus-clipboard.h>
#include <libnautilus-private/nautilus-clipboard-monitor.h>
#include <libnautilus-private/nautilus-desktop-icon-file.h>
-#include <libnautilus-private/nautilus-debug-log.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file-operations.h>
#include <libnautilus-private/nautilus-file-utilities.h>
@@ -55,6 +54,9 @@
#include <libnautilus-private/nautilus-window-info.h>
#include <libnautilus-private/nautilus-window-slot-info.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_LIST_VIEW
+#include <libnautilus-private/nautilus-debug.h>
+
typedef struct {
GObject parent;
} FMTreeViewProvider;
@@ -360,9 +362,7 @@ got_activation_uri_callback (NautilusFile *file, gpointer callback_data)
uri = nautilus_file_get_activation_uri (file);
if (nautilus_file_is_launcher (file)) {
file_uri = nautilus_file_get_uri (file);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "tree view launch_desktop_file window=%p: %s",
- view->details->window, file_uri);
+ DEBUG ("Tree sidebar, launching %s", file_uri);
nautilus_launch_desktop_file (screen, file_uri, NULL, NULL);
g_free (file_uri);
} else if (uri != NULL
@@ -374,9 +374,8 @@ got_activation_uri_callback (NautilusFile *file, gpointer callback_data)
/* Non-local executables don't get launched. They act like non-executables. */
if (file_uri == NULL) {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "tree view window_info_open_location window=%p: %s",
- view->details->window, uri);
+ DEBUG ("Tree sidebar, opening location %s", uri);
+
location = g_file_new_for_uri (uri);
nautilus_window_slot_info_open_location
(slot,
@@ -386,9 +385,7 @@ got_activation_uri_callback (NautilusFile *file, gpointer callback_data)
NULL);
g_object_unref (location);
} else {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "tree view launch_application_from_command window=%p: %s",
- view->details->window, file_uri);
+ DEBUG ("Tree sidebar, launching application for %s", file_uri);
nautilus_launch_application_from_command (screen, NULL, file_uri, FALSE, NULL);
g_free (file_uri);
}
@@ -404,9 +401,8 @@ got_activation_uri_callback (NautilusFile *file, gpointer callback_data)
view->details->selection_location = g_strdup (uri);
}
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "tree view window_info_open_location window=%p: %s",
- view->details->window, uri);
+ DEBUG ("Tree sidebar, opening location %s", uri);
+
location = g_file_new_for_uri (uri);
nautilus_window_slot_info_open_location
(slot,
diff --git a/src/nautilus-application-smclient.c b/src/nautilus-application-smclient.c
index 611c76a..c5baa0f 100644
--- a/src/nautilus-application-smclient.c
+++ b/src/nautilus-application-smclient.c
@@ -31,6 +31,9 @@
#include <eel/eel-vfs-extensions.h>
#include <libxml/xmlsave.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_SMCLIENT
+#include <libnautilus-private/nautilus-debug.h>
+
static char *
nautilus_application_get_session_data (NautilusApplication *self)
{
@@ -74,6 +77,9 @@ nautilus_application_get_session_data (NautilusApplication *self)
tmp = nautilus_bookmark_get_uri (bookmark);
xmlNewProp (bookmark_node, "uri", tmp);
+
+ DEBUG ("Saving history information for uri %s", tmp);
+
g_free (tmp);
if (nautilus_bookmark_get_has_custom_name (bookmark)) {
@@ -109,6 +115,7 @@ nautilus_application_get_session_data (NautilusApplication *self)
continue;
}
+ DEBUG ("Saving opened window for uri %s", tmp);
win_node = xmlNewChild (root_node, NULL, "window", NULL);
xmlNewProp (win_node, "location", tmp);
@@ -163,9 +170,9 @@ nautilus_application_get_session_data (NautilusApplication *self)
ctx = xmlSaveToBuffer (buffer, "UTF-8", XML_SAVE_FORMAT);
if (xmlSaveDoc (ctx, doc) < 0 ||
xmlSaveFlush (ctx) < 0) {
- g_message ("failed to save session");
+ DEBUG ("Failed to save session");
}
-
+
xmlSaveClose(ctx);
data = g_strndup (buffer->content, buffer->use);
xmlBufferFree (buffer);
@@ -182,6 +189,8 @@ smclient_save_state_cb (EggSMClient *client,
{
char *data;
+ DEBUG ("Received SaveState signal from the SMClient");
+
data = nautilus_application_get_session_data (application);
if (data != NULL) {
@@ -198,6 +207,8 @@ static void
smclient_quit_cb (EggSMClient *client,
NautilusApplication *application)
{
+ DEBUG ("Received Quit signal from the SMClient");
+
nautilus_application_quit (application);
}
@@ -226,14 +237,18 @@ nautilus_application_smclient_load (NautilusApplication *application,
GKeyFile *state_file;
char *data;
+ DEBUG ("Loading session data");
+
nautilus_application_smclient_initialize (application);
if (!egg_sm_client_is_resumed (application->smclient)) {
+ DEBUG ("SMClient not resumed");
return;
}
state_file = egg_sm_client_get_state_file (application->smclient);
if (!state_file) {
+ DEBUG ("No SMClient state file");
return;
}
@@ -242,6 +257,7 @@ nautilus_application_smclient_load (NautilusApplication *application,
"documents",
NULL);
if (data == NULL) {
+ DEBUG ("No SMClient session data");
return;
}
@@ -282,6 +298,8 @@ nautilus_application_smclient_load (NautilusApplication *application,
icon = g_icon_new_for_string (icon_str, NULL);
}
location = g_file_new_for_uri (uri);
+
+ DEBUG ("Adding %s to the history list", name);
emit_change |= nautilus_add_to_history_list_no_notify (location, name, has_custom_name, icon);
@@ -294,7 +312,7 @@ nautilus_application_smclient_load (NautilusApplication *application,
xmlFree (uri);
xmlFree (icon_str);
} else {
- g_message ("unexpected bookmark node %s while parsing session data", bookmark_node->name);
+ DEBUG ("Unexpected bookmark node %s while parsing session data", bookmark_node->name);
bail = TRUE;
continue;
}
@@ -312,14 +330,14 @@ nautilus_application_smclient_load (NautilusApplication *application,
type = xmlGetProp (node, "type");
if (type == NULL) {
- g_message ("empty type node while parsing session data");
+ DEBUG ("Empty type node while parsing session data");
bail = TRUE;
continue;
}
location_uri = xmlGetProp (node, "location");
if (location_uri == NULL) {
- g_message ("empty location node while parsing session data");
+ DEBUG ("Empty location node while parsing session data");
bail = TRUE;
xmlFree (type);
continue;
@@ -370,6 +388,8 @@ nautilus_application_smclient_load (NautilusApplication *application,
} else {
slot = nautilus_window_open_slot (window->details->active_pane, NAUTILUS_WINDOW_OPEN_SLOT_APPEND);
}
+
+ DEBUG ("Resuming navigation window slot for uri %s", slot_uri);
location = g_file_new_for_uri (slot_uri);
nautilus_window_slot_open_location (slot, location, FALSE);
@@ -391,6 +411,8 @@ nautilus_application_smclient_load (NautilusApplication *application,
g_object_unref (location);
}
} else if (!strcmp (type, "spatial")) {
+ DEBUG ("Resuming spatial window for uri %s", location_uri);
+
location = g_file_new_for_uri (location_uri);
window = nautilus_application_get_spatial_window (application, NULL, NULL,
location, gdk_screen_get_default (),
@@ -400,14 +422,14 @@ nautilus_application_smclient_load (NautilusApplication *application,
g_object_unref (location);
} else {
- g_message ("unknown window type \"%s\" while parsing session data", type);
+ DEBUG ("Unknown window type \"%s\" while parsing session data", type);
bail = TRUE;
}
xmlFree (type);
xmlFree (location_uri);
} else {
- g_message ("unexpected node %s while parsing session data", node->name);
+ DEBUG ("Unexpected node %s while parsing session data", node->name);
bail = TRUE;
continue;
}
@@ -421,7 +443,7 @@ nautilus_application_smclient_load (NautilusApplication *application,
g_free (data);
if (bail) {
- g_message ("failed to load session");
+ DEBUG ("Failed to load session");
}
}
@@ -430,6 +452,8 @@ nautilus_application_smclient_startup (NautilusApplication *self)
{
g_assert (self->smclient == NULL);
+ DEBUG ("Starting up SMClient");
+
egg_sm_client_set_mode (EGG_SM_CLIENT_MODE_DISABLED);
self->smclient = egg_sm_client_get ();
}
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 6f3a320..53daca4 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -54,7 +54,6 @@
#include "nautilus-window-slot.h"
#include <libnautilus-private/nautilus-dbus-manager.h>
-#include <libnautilus-private/nautilus-debug-log.h>
#include <libnautilus-private/nautilus-desktop-link-monitor.h>
#include <libnautilus-private/nautilus-directory-private.h>
#include <libnautilus-private/nautilus-file-utilities.h>
@@ -66,6 +65,9 @@
#include <libnautilus-private/nautilus-undo-manager.h>
#include <libnautilus-extension/nautilus-menu-provider.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_APPLICATION
+#include <libnautilus-private/nautilus-debug.h>
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -280,6 +282,7 @@ ck_session_proxy_signal_cb (GDBusProxy *proxy,
if (g_strcmp0 (signal_name, "ActiveChanged") == 0) {
g_variant_get (parameters, "(b)", &application->session_is_active);
+ DEBUG ("ConsoleKit session is active %d", application->session_is_active);
}
}
@@ -303,6 +306,7 @@ ck_call_is_active_cb (GDBusProxy *proxy,
}
g_variant_get (variant, "(b)", &application->session_is_active);
+ DEBUG ("ConsoleKit session is active %d", application->session_is_active);
g_variant_unref (variant);
}
@@ -364,6 +368,8 @@ ck_get_current_session_cb (GDBusConnection *connection,
g_variant_get (variant, "(&o)", &session_path);
+ DEBUG ("Found ConsoleKit session at path %s", session_path);
+
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
@@ -503,7 +509,7 @@ open_window (NautilusApplication *application,
{
GFile *location;
NautilusWindow *window;
- gboolean existing;
+ gboolean existing, open_in_browser;
if (uri == NULL) {
location = g_file_new_for_path (g_get_home_dir ());
@@ -511,10 +517,14 @@ open_window (NautilusApplication *application,
location = g_file_new_for_uri (uri);
}
+ open_in_browser = browser_window ||
+ g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER);
+
+ DEBUG ("Opening new window at uri %s, browser %d", uri, open_in_browser);
+
existing = FALSE;
- if (browser_window ||
- g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
+ if (open_in_browser) {
window = nautilus_application_create_navigation_window (application,
startup_id,
screen);
@@ -677,6 +687,9 @@ nautilus_application_create_desktop_windows (NautilusApplication *application)
NAUTILUS_PREFERENCES_EXIT_WITH_LAST_WINDOW);
for (i = 0; i < screens; i++) {
+
+ DEBUG ("Creating a desktop window for screen %d", i);
+
selection_widget = get_desktop_manager_selection (display, i);
if (selection_widget != NULL) {
window = nautilus_desktop_window_new (application,
@@ -932,8 +945,8 @@ create_window (NautilusApplication *application,
static void
spatial_window_destroyed_callback (void *user_data, GObject *window)
{
- nautilus_application_spatial_window_list = g_list_remove (nautilus_application_spatial_window_list, window);
-
+ nautilus_application_spatial_window_list =
+ g_list_remove (nautilus_application_spatial_window_list, window);
}
NautilusWindow *
@@ -945,7 +958,6 @@ nautilus_application_get_spatial_window (NautilusApplication *application,
gboolean *existing)
{
NautilusWindow *window;
- gchar *uri;
g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
@@ -957,6 +969,8 @@ nautilus_application_get_spatial_window (NautilusApplication *application,
*existing = TRUE;
}
+ DEBUG ("returning existing spatial window");
+
return window;
}
@@ -992,12 +1006,8 @@ nautilus_application_get_spatial_window (NautilusApplication *application,
g_object_weak_ref (G_OBJECT (window),
spatial_window_destroyed_callback, NULL);
- uri = g_file_get_uri (location);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "present NEW spatial window=%p: %s",
- window, uri);
- g_free (uri);
-
+ DEBUG ("Creating new spatial window");
+
return window;
}
@@ -1056,10 +1066,8 @@ nautilus_application_create_navigation_window (NautilusApplication *application,
}
g_free (geometry_string);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "create new navigation window=%p",
- window);
-
+ DEBUG ("Creating a new navigation window");
+
return window;
}
@@ -1094,12 +1102,18 @@ mount_added_callback (GVolumeMonitor *monitor,
{
NautilusDirectory *directory;
GFile *root;
+ gchar *uri;
if (!application->session_is_active) {
return;
}
root = g_mount_get_root (mount);
+ uri = g_file_get_uri (root);
+
+ DEBUG ("Added mount at uri %s", uri);
+ g_free (uri);
+
directory = nautilus_directory_get_existing (root);
g_object_unref (root);
if (directory != NULL) {
@@ -1153,6 +1167,7 @@ mount_removed_callback (GVolumeMonitor *monitor,
NautilusWindowSlot *force_no_close_slot;
GFile *root, *computer;
gboolean unclosed_slot;
+ gchar *uri;
close_list = NULL;
force_no_close_slot = NULL;
@@ -1162,6 +1177,11 @@ mount_removed_callback (GVolumeMonitor *monitor,
window_list = gtk_application_get_windows (GTK_APPLICATION (application));
root = g_mount_get_root (mount);
+ uri = g_file_get_uri (root);
+
+ DEBUG ("Removed mount at uri %s", uri);
+ g_free (uri);
+
/* Construct a list of windows to be closed. Do not add the non-closable windows to the list. */
for (node = window_list; node != NULL; node = node->next) {
window = NAUTILUS_WINDOW (node->data);
@@ -1417,6 +1437,10 @@ nautilus_application_command_line (GApplication *app,
no_desktop = FALSE;
}
+ DEBUG ("Parsing command line, no_default_window %d browser %d, quit %d, "
+ "self checks %d, no_desktop %d",
+ no_default_window, browser_window, kill_shell, perform_self_check, no_desktop);
+
exit_with_last_window =
g_settings_get_boolean (nautilus_preferences,
NAUTILUS_PREFERENCES_EXIT_WITH_LAST_WINDOW);
@@ -1516,6 +1540,8 @@ nautilus_application_startup (GApplication *app)
*/
G_APPLICATION_CLASS (nautilus_application_parent_class)->startup (app);
+ DEBUG ("Application startup");
+
/* create an undo manager */
self->undo_manager = nautilus_undo_manager_new ();
@@ -1555,6 +1581,8 @@ nautilus_application_startup (GApplication *app)
static void
nautilus_application_quit_mainloop (GApplication *app)
{
+ DEBUG ("Quitting mainloop");
+
nautilus_icon_info_clear_caches ();
nautilus_application_save_accel_map (NULL);
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 52611bf..17040fa 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -33,7 +33,6 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libnautilus-private/nautilus-debug-log.h>
#include <libnautilus-private/nautilus-dnd.h>
#include <libnautilus-private/nautilus-bookmark.h>
#include <libnautilus-private/nautilus-global-preferences.h>
@@ -52,6 +51,9 @@
#include "nautilus-places-sidebar.h"
#include "nautilus-window.h"
+#define DEBUG_FLAG NAUTILUS_DEBUG_PLACES
+#include <libnautilus-private/nautilus-debug.h>
+
#define EJECT_BUTTON_XPAD 6
#define ICON_CELL_XPAD 6
@@ -1813,9 +1815,8 @@ open_selected_bookmark (NautilusPlacesSidebar *sidebar,
gtk_tree_model_get (model, &iter, PLACES_SIDEBAR_COLUMN_URI, &uri, -1);
if (uri != NULL) {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "activate from places sidebar window=%p: %s",
- sidebar->window, uri);
+ DEBUG ("Activating bookmark %s", uri);
+
location = g_file_new_for_uri (uri);
/* Navigate to the clicked location */
if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) == 0) {
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 4baa7d2..7968852 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -52,7 +52,6 @@
#include <gdk/gdkx.h>
#include <glib/gi18n.h>
#include <libnautilus-extension/nautilus-location-widget-provider.h>
-#include <libnautilus-private/nautilus-debug-log.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file.h>
@@ -66,6 +65,9 @@
#include <libnautilus-private/nautilus-window-info.h>
#include <libnautilus-private/nautilus-window-slot-info.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_WINDOW
+#include <libnautilus-private/nautilus-debug.h>
+
/* FIXME bugzilla.gnome.org 41243:
* We should use inheritance instead of these special cases
* for the desktop window.
@@ -505,11 +507,9 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
old_uri = g_strdup ("(none)");
}
new_uri = g_file_get_uri (location);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "window %p open location: old=\"%s\", new=\"%s\"",
- window,
- old_uri,
- new_uri);
+
+ DEBUG ("Opening location, old: %s, new: %s", old_uri, new_uri);
+
g_free (old_uri);
g_free (new_uri);
@@ -1754,8 +1754,7 @@ end_location_change (NautilusWindowSlot *slot)
uri = nautilus_window_slot_get_location_uri (slot);
if (uri) {
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "finished loading window %p: %s", window, uri);
+ DEBUG ("Finished loading window for uri %s", uri);
g_free (uri);
}
@@ -2031,9 +2030,7 @@ nautilus_window_slot_set_content_view (NautilusWindowSlot *slot,
g_assert (NAUTILUS_IS_WINDOW (window));
uri = nautilus_window_slot_get_location_uri (slot);
- nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
- "change view of window %p: \"%s\" to \"%s\"",
- window, uri, id);
+ DEBUG ("Change view of window %s to %s", uri, id);
g_free (uri);
if (nautilus_window_slot_content_view_matches_iid (slot, id)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]