summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/caja-application.c2
-rw-r--r--src/caja-bookmarks-window.c2
-rw-r--r--src/caja-connect-server-dialog.c2
-rw-r--r--src/caja-convert-metadata.c2
-rw-r--r--src/caja-desktop-window.c4
-rw-r--r--src/caja-file-management-properties.c2
-rw-r--r--src/caja-location-dialog.c2
-rw-r--r--src/caja-main.c51
-rw-r--r--src/caja-pathbar.c4
-rw-r--r--src/caja-property-browser.c2
-rw-r--r--src/caja-window-menus.c28
-rw-r--r--src/caja-window.c6
-rw-r--r--src/file-manager/fm-directory-view.c18
-rw-r--r--src/file-manager/fm-icon-view.c7
-rw-r--r--src/file-manager/fm-list-view.c7
-rw-r--r--src/file-manager/fm-properties-window.c4
17 files changed, 100 insertions, 45 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 84ee8b5f..189c1f5f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,7 @@ libexec_PROGRAMS = \
caja-convert-metadata \
$(NULL)
-INCLUDES = \
+AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/cut-n-paste-code \
-I$(top_builddir)/libcaja-private \
diff --git a/src/caja-application.c b/src/caja-application.c
index b4f180f5..3f4282c0 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -76,7 +76,7 @@
#include <libcaja-extension/caja-menu-provider.h>
#include <libcaja-private/caja-autorun.h>
#define MATE_DESKTOP_USE_UNSTABLE_API
-#include <libmateui/mate-bg.h>
+#include <libmate-desktop/mate-bg.h>
#include "glibcompat.h" /* for g_list_free_full */
diff --git a/src/caja-bookmarks-window.c b/src/caja-bookmarks-window.c
index 4b13a1ee..4a63a4f5 100644
--- a/src/caja-bookmarks-window.c
+++ b/src/caja-bookmarks-window.c
@@ -145,7 +145,7 @@ caja_bookmarks_window_response_callback (GtkDialog *dialog,
GError *error = NULL;
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "ghelp:user-guide#goscaja-36",
+ "help:user-guide#goscaja-36",
gtk_get_current_event_time (), &error);
if (error)
diff --git a/src/caja-connect-server-dialog.c b/src/caja-connect-server-dialog.c
index 6c6036fe..d27958e1 100644
--- a/src/caja-connect-server-dialog.c
+++ b/src/caja-connect-server-dialog.c
@@ -685,7 +685,7 @@ connect_dialog_response_cb (CajaConnectServerDialog *dialog,
case GTK_RESPONSE_HELP :
error = NULL;
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "ghelp:user-guide#caja-server-connect",
+ "help:user-guide#caja-server-connect",
gtk_get_current_event_time (), &error);
if (error)
{
diff --git a/src/caja-convert-metadata.c b/src/caja-convert-metadata.c
index faf44e87..5ea7a13b 100644
--- a/src/caja-convert-metadata.c
+++ b/src/caja-convert-metadata.c
@@ -338,7 +338,9 @@ main (int argc, char *argv[])
GError *error = NULL;
int i;
+#if !GLIB_CHECK_VERSION (2, 36, 0)
g_type_init ();
+#endif
context = g_option_context_new ("<caja metadata files> - convert caja metadata");
g_option_context_add_main_entries (context, entries, NULL);
diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c
index aabc0468..4ef0b976 100644
--- a/src/caja-desktop-window.c
+++ b/src/caja-desktop-window.c
@@ -207,7 +207,11 @@ set_desktop_window_id (CajaDesktopWindow *window,
root_window = gdk_screen_get_root_window (
gtk_window_get_screen (GTK_WINDOW (window)));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ window_xid = GDK_WINDOW_XID (gdkwindow);
+#else
window_xid = GDK_WINDOW_XWINDOW (gdkwindow);
+#endif
gdk_property_change (root_window,
gdk_atom_intern ("CAJA_DESKTOP_WINDOW_ID", FALSE),
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index 066befa0..0d517fee 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -209,7 +209,7 @@ preferences_show_help (GtkWindow *parent,
g_assert (helpfile != NULL);
g_assert (sect_id != NULL);
- help_string = g_strdup_printf ("ghelp:%s#%s", helpfile, sect_id);
+ help_string = g_strdup_printf ("help:%s#%s", helpfile, sect_id);
gtk_show_uri (gtk_window_get_screen (parent),
help_string, gtk_get_current_event_time (),
diff --git a/src/caja-location-dialog.c b/src/caja-location-dialog.c
index ec102300..37d091bd 100644
--- a/src/caja-location-dialog.c
+++ b/src/caja-location-dialog.c
@@ -95,7 +95,7 @@ response_callback (CajaLocationDialog *dialog,
case GTK_RESPONSE_HELP :
error = NULL;
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "ghelp:user-guide#caja-open-location",
+ "help:user-guide#caja-open-location",
gtk_get_current_event_time (), &error);
if (error)
{
diff --git a/src/caja-main.c b/src/caja-main.c
index 1d74cd78..dcd9df11 100644
--- a/src/caja-main.c
+++ b/src/caja-main.c
@@ -329,11 +329,11 @@ main (int argc, char *argv[])
gboolean perform_self_check;
CajaApplication *application;
GOptionContext *context;
- GFile *file;
- GFileInfo *fileinfo;
- GAppInfo *appinfo;
- char *uri;
- char **uris;
+ GFile *file = NULL;
+ GFileInfo *fileinfo = NULL;
+ GAppInfo *appinfo = NULL;
+ char *uri = NULL;
+ char **uris = NULL;
GPtrArray *uris_array;
GError *error;
int i;
@@ -522,7 +522,6 @@ main (int argc, char *argv[])
else
{
/* Convert args to URIs */
- uris = NULL;
if (remaining != NULL)
{
uris_array = g_ptr_array_new ();
@@ -535,33 +534,43 @@ main (int argc, char *argv[])
if (uri)
{
fileinfo = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
- if (g_file_info_get_file_type(fileinfo) == G_FILE_TYPE_DIRECTORY)
+ if (fileinfo && g_file_info_get_file_type(fileinfo) == G_FILE_TYPE_DIRECTORY)
{
g_ptr_array_add (uris_array, uri);
}
else
{
- g_object_unref (fileinfo);
+ if (fileinfo)
+ g_object_unref (fileinfo);
fileinfo = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
- appinfo = g_app_info_get_default_for_type (g_file_info_get_content_type (fileinfo), TRUE);
- if (appinfo)
+ if (fileinfo)
{
- if (g_strcmp0 (g_app_info_get_executable (appinfo), "caja") != 0)
- {
- g_app_info_launch_default_for_uri (uri, NULL, NULL);
- }
- else
+ appinfo = g_app_info_get_default_for_type (g_file_info_get_content_type (fileinfo), TRUE);
+ if (appinfo)
{
- fprintf (stderr, _("caja: set erroneously as default application for '%s' content type.\n"),
- g_file_info_get_content_type (fileinfo));
+ if (g_strcmp0 (g_app_info_get_executable (appinfo), "caja") != 0)
+ {
+ g_app_info_launch_default_for_uri (uri, NULL, NULL);
+ }
+ else
+ {
+ fprintf (stderr, _("caja: set erroneously as default application for '%s' content type.\n"),
+ g_file_info_get_content_type (fileinfo));
+ }
+ g_object_unref (appinfo);
}
- g_object_unref (appinfo);
+ g_free (uri);
+ }
+ else
+ {
+ g_ptr_array_add (uris_array, uri);
}
- g_free (uri);
}
- g_object_unref (fileinfo);
+ if (fileinfo)
+ g_object_unref (fileinfo);
}
- g_object_unref (file);
+ if (file)
+ g_object_unref (file);
}
}
if (uris_array->len == 0)
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index 9de3ea03..e2d07edc 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -856,7 +856,7 @@ caja_path_bar_size_allocate (GtkWidget *widget,
if (need_sliders && direction == GTK_TEXT_DIR_RTL)
{
#if GTK_CHECK_VERSION(3,0,0)
- if (child_allocation.x - path_bar->spacing - path_bar->slider_width < widget_allocation.x) {
+ if (child_allocation.x - path_bar->spacing - path_bar->slider_width < widget_allocation.x)
#else
if (child_allocation.x - path_bar->spacing - path_bar->slider_width < widget_allocation.x + border_width)
#endif
@@ -869,7 +869,7 @@ caja_path_bar_size_allocate (GtkWidget *widget,
if (need_sliders && direction == GTK_TEXT_DIR_LTR)
{
#if GTK_CHECK_VERSION(3,0,0)
- if (child_allocation.x + child_allocation.width + path_bar->spacing + path_bar->slider_width > widget_allocation.x + allocation_width) {
+ if (child_allocation.x + child_allocation.width + path_bar->spacing + path_bar->slider_width > widget_allocation.x + allocation_width)
#else
if (child_allocation.x + child_allocation.width + path_bar->spacing + path_bar->slider_width > widget_allocation.x + border_width + allocation_width)
#endif
diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c
index 7d9b33d2..59a17181 100644
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -1642,7 +1642,7 @@ help_button_callback (GtkWidget *widget, GtkWidget *property_browser)
GtkWidget *dialog;
gtk_show_uri (gtk_widget_get_screen (property_browser),
- "ghelp:user-guide#goscaja-50",
+ "help:user-guide#goscaja-50",
gtk_get_current_event_time (), &error);
if (error)
diff --git a/src/caja-window-menus.c b/src/caja-window-menus.c
index 82d4c4d6..c511aaac 100644
--- a/src/caja-window-menus.c
+++ b/src/caja-window-menus.c
@@ -574,20 +574,36 @@ action_caja_manual_callback (GtkAction *action,
if (CAJA_IS_DESKTOP_WINDOW (window))
{
-#if GTK_CHECK_VERSION(2, 24, 0)
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkScreen *screen;
+ GdkAppLaunchContext *launch_context;
+ GAppInfo *app_info = NULL;
+ app_info = g_app_info_create_from_commandline ("mate-help",
+ NULL,
+ G_APP_INFO_CREATE_NONE,
+ &error);
+ if (error == NULL)
+ {
+ screen = gtk_window_get_screen(GTK_WINDOW(window));
+ launch_context = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_screen (launch_context, screen);
+ g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), &error);
+ g_object_unref (launch_context);
+ }
+ if (app_info != NULL)
+ g_object_unref (app_info);
+#else
+#if GTK_CHECK_VERSION (2, 24, 0)
gdk_spawn_command_line_on_screen(gtk_window_get_screen(GTK_WINDOW(window)), "mate-help", &error);
#else
-
-
-
g_spawn_command_line_async("mate-help", &error);
#endif
-
+#endif
}
else
{
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (window)),
- "ghelp:user-guide#goscaja-1",
+ "help:user-guide#goscaja-1",
gtk_get_current_event_time (), &error);
}
diff --git a/src/caja-window.c b/src/caja-window.c
index 782e2607..365c3696 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -189,10 +189,10 @@ caja_window_init (CajaWindow *window)
g_signal_connect_object (caja_signaller_get_current (), "popup_menu_changed",
G_CALLBACK (caja_window_load_extension_menus), window, G_CONNECT_SWAPPED);
+/* Keep the main event loop alive as long as the window exists */
#if GTK_CHECK_VERSION(3, 0, 0)
- gtk_quit_add_destroy (1, GTK_WIDGET (window));
-
- /* Keep the main event loop alive as long as the window exists */
+ /* FIXME: port to GtkApplication with GTK3 */
+ //gtk_quit_add_destroy (1, GTK_WIDGET (window));
caja_main_event_loop_register (GTK_WIDGET (window));
#else
gtk_quit_add_destroy (1, GTK_OBJECT (window));
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 8b1afaaf..9c90a518 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -1168,7 +1168,7 @@ pattern_select_response_cb (GtkWidget *dialog, int response, gpointer user_data)
case GTK_RESPONSE_HELP :
error = NULL;
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "ghelp:user-guide#caja-select-pattern",
+ "help:user-guide#caja-select-pattern",
gtk_get_current_event_time (), &error);
if (error) {
eel_show_error_dialog (_("There was an error displaying help."), error->message,
@@ -10098,7 +10098,23 @@ fm_directory_view_move_copy_items (const GList *item_uris,
if (screen == NULL) {
screen = gdk_screen_get_default ();
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkAppLaunchContext *launch_context;
+ GAppInfo *app_info = NULL;
+ app_info = g_app_info_create_from_commandline (command,
+ NULL,
+ G_APP_INFO_CREATE_NONE,
+ NULL);
+ if (app_info != NULL) {
+ launch_context = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_screen (launch_context, screen);
+ g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), NULL);
+ g_object_unref (launch_context);
+ g_object_unref (app_info);
+ }
+#else
gdk_spawn_command_line_on_screen (screen, command, NULL);
+#endif
g_free (command);
return;
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index c624610a..6ab19c4e 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -2061,7 +2061,7 @@ icon_container_activate_alternate_callback (CajaIconContainer *container,
g_assert (FM_IS_ICON_VIEW (icon_view));
g_assert (container == get_icon_container (icon_view));
- open_in_tab = FALSE;
+ open_in_tab = TRUE;
window_info = fm_directory_view_get_caja_window (FM_DIRECTORY_VIEW (icon_view));
@@ -2170,6 +2170,8 @@ audio_child_died (GPid pid,
{
FMIconView *icon_view;
+ g_return_if_fail (FM_IS_ICON_VIEW (data));
+
icon_view = FM_ICON_VIEW (data);
icon_view->details->audio_preview_child_watch = 0;
@@ -2637,12 +2639,11 @@ fm_icon_view_icon_text_changed_callback (CajaIconContainer *container,
FMIconView *icon_view)
{
g_assert (CAJA_IS_FILE (file));
- g_assert (new_name != NULL);
/* Don't allow a rename with an empty string. Revert to original
* without notifying the user.
*/
- if (new_name[0] == '\0')
+ if ((new_name == NULL) || (new_name[0] == '\0'))
{
return;
}
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 72e3f55c..c92e0c12 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -1739,7 +1739,14 @@ create_and_set_up_tree_view (FMListView *view)
view->details->file_name_column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_expand (view->details->file_name_column, TRUE);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkStyleContext *context;
+ context = gtk_widget_get_style_context (GTK_WIDGET(view));
+ font_size = PANGO_PIXELS (pango_font_description_get_size (
+ gtk_style_context_get_font (context, GTK_STATE_FLAG_NORMAL)));
+#else
font_size = PANGO_PIXELS (pango_font_description_get_size (GTK_WIDGET(view)->style->font_desc));
+#endif
gtk_tree_view_column_set_min_width (view->details->file_name_column, 20*font_size);
g_object_ref_sink (view->details->file_name_column);
view->details->file_name_column_num = column_num;
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index a62fbec5..854de866 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -42,7 +42,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
-#include <libmateui/mate-desktop-thumbnail.h>
+#include <libmate-desktop/mate-desktop-thumbnail.h>
#include <libcaja-extension/caja-property-page-provider.h>
#include <libcaja-private/caja-entry.h>
#include <libcaja-private/caja-file-attributes.h>
@@ -5520,7 +5520,7 @@ real_response (GtkDialog *dialog,
switch (response) {
case GTK_RESPONSE_HELP:
gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "ghelp:user-guide#goscaja-51",
+ "help:user-guide#goscaja-51",
gtk_get_current_event_time (),
&error);
if (error != NULL) {