[Xfce4-commits] r25343 - in squeeze/trunk: libsqueeze src

Stephan Arts stephan at xfce.org
Fri Mar 30 17:18:35 CEST 2007


Author: stephan
Date: 2007-03-30 15:18:35 +0000 (Fri, 30 Mar 2007)
New Revision: 25343

Modified:
   squeeze/trunk/libsqueeze/command-builder.c
   squeeze/trunk/libsqueeze/xfce-launch-command.c
   squeeze/trunk/src/archive_store.c
   squeeze/trunk/src/main_window.c
   squeeze/trunk/src/notebook.c
Log:
Fix segfault when opening/extracting on by clicking on file



Modified: squeeze/trunk/libsqueeze/command-builder.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder.c	2007-03-30 08:57:18 UTC (rev 25342)
+++ squeeze/trunk/libsqueeze/command-builder.c	2007-03-30 15:18:35 UTC (rev 25343)
@@ -119,7 +119,7 @@
 lsq_command_builder_build_open(LSQCommandBuilder *builder, LSQArchive *archive, GSList *files)
 {
 	LSQArchiveCommand *extract = builder->build_extract(builder, archive, lsq_tempfs_get_root_dir(archive), files);
-	LSQArchiveCommand *launch = lsq_xfce_launch_command_new("Execute", 
+	LSQArchiveCommand *launch = lsq_xfce_launch_command_new(_("Execute"), 
 	                                                 archive, lsq_tempfs_get_root_dir(archive), files);
 	LSQArchiveCommand *macro = lsq_macro_command_new(archive);
 

Modified: squeeze/trunk/libsqueeze/xfce-launch-command.c
===================================================================
--- squeeze/trunk/libsqueeze/xfce-launch-command.c	2007-03-30 08:57:18 UTC (rev 25342)
+++ squeeze/trunk/libsqueeze/xfce-launch-command.c	2007-03-30 15:18:35 UTC (rev 25343)
@@ -141,8 +141,11 @@
 	                                                       "org.xfce.FileManager");
 	
 	archive_command->archive = archive;
-	xfce_launch_command->files = g_strconcat(prefix, files->data, NULL);
+	if(comment)
+		archive_command->comment = g_strdup(comment);
 
+	xfce_launch_command->files = g_strconcat(prefix, lsq_archive_iter_get_path(files->data), NULL);
+
 	return archive_command;
 }
 

Modified: squeeze/trunk/src/archive_store.c
===================================================================
--- squeeze/trunk/src/archive_store.c	2007-03-30 08:57:18 UTC (rev 25342)
+++ squeeze/trunk/src/archive_store.c	2007-03-30 15:18:35 UTC (rev 25343)
@@ -1124,7 +1124,7 @@
 #ifdef DEBUG
 			g_debug("file clicked");
 #endif
-			g_signal_emit(store, sq_archive_store_signals[SQ_ARCHIVE_STORE_SIGNAL_FILE_ACTIVATED], 0, lsq_archive_iter_get_path(entry), NULL); 
+			g_signal_emit(store, sq_archive_store_signals[SQ_ARCHIVE_STORE_SIGNAL_FILE_ACTIVATED], 0, entry, NULL); 
 			return;
 		}
 

Modified: squeeze/trunk/src/main_window.c
===================================================================
--- squeeze/trunk/src/main_window.c	2007-03-30 08:57:18 UTC (rev 25342)
+++ squeeze/trunk/src/main_window.c	2007-03-30 15:18:35 UTC (rev 25343)
@@ -104,7 +104,7 @@
 static void
 cb_sq_main_window_notebook_page_removed(SQNotebook *, gpointer);
 static void
-cb_sq_main_window_notebook_file_activated(SQNotebook *, gchar *, gpointer);
+cb_sq_main_window_notebook_file_activated(SQNotebook *, LSQArchiveIter *, gpointer);
  static void cb_sq_main_window_notebook_state_changed(SQNotebook *, LSQArchive *, gpointer);
 
 static void
@@ -1015,7 +1015,7 @@
 }
 
 static void
-cb_sq_main_window_notebook_file_activated(SQNotebook *notebook, gchar *path, gpointer data)
+cb_sq_main_window_notebook_file_activated(SQNotebook *notebook, LSQArchiveIter *iter, gpointer data)
 {
 	GtkWindow *window = GTK_WINDOW(data);
 	LSQArchive *lp_archive = NULL;
@@ -1028,12 +1028,12 @@
 	gint result = gtk_dialog_run(GTK_DIALOG(dialog));
 	gtk_widget_hide(dialog);
 
-	GSList *filenames = g_slist_prepend(NULL, path);
+	GSList *files = g_slist_prepend(NULL, iter);
 	switch(result)
 	{
 		case GTK_RESPONSE_OK: /* VIEW */
 			sq_notebook_get_active_archive(SQ_NOTEBOOK(notebook), &lp_archive);
-			if(lsq_archive_view(lp_archive, filenames))
+			if(lsq_archive_view(lp_archive, files))
 			{
 				GtkWidget *warning_dialog = gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, _("Squeeze cannot view this file.\nthe application to support this is missing."));
 				if(warning_dialog)
@@ -1053,10 +1053,10 @@
 				extract_archive_path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(extr_dialog));
 				if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SQ_EXTRACT_ARCHIVE_DIALOG(extr_dialog)->all_files_radio)))
 				{
-					g_slist_free(filenames);
-					filenames = NULL;
+					g_slist_free(files);
+					files = NULL;
 				}
-				if(lsq_archive_extract(lp_archive, extract_archive_path, filenames))
+				if(lsq_archive_extract(lp_archive, extract_archive_path, files))
 				{
 					GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window), 
 																	 GTK_DIALOG_DESTROY_WITH_PARENT, 
@@ -1076,7 +1076,7 @@
 		case GTK_RESPONSE_CANCEL: /* CANCEL */
 			break;
 	}
-	g_slist_free(filenames);
+	g_slist_free(files);
 	gtk_widget_destroy(dialog);
 }
 

Modified: squeeze/trunk/src/notebook.c
===================================================================
--- squeeze/trunk/src/notebook.c	2007-03-30 08:57:18 UTC (rev 25342)
+++ squeeze/trunk/src/notebook.c	2007-03-30 15:18:35 UTC (rev 25343)
@@ -56,7 +56,7 @@
 static void
 cb_notebook_archive_state_changed(LSQArchive *archive, SQNotebook *notebook);
 static void
-cb_notebook_file_activated(SQArchiveStore *, gchar *, SQNotebook *);
+cb_notebook_file_activated(SQArchiveStore *, LSQArchiveIter *, SQNotebook *);
 
 static void
 cb_sq_notebook_page_switched(SQNotebook *notebook, GtkNotebookPage *, guint page_nr, gpointer data);
@@ -720,9 +720,9 @@
 }
 
 static void
-cb_notebook_file_activated(SQArchiveStore *store, gchar *path, SQNotebook *notebook)
+cb_notebook_file_activated(SQArchiveStore *store, LSQArchiveIter *iter, SQNotebook *notebook)
 {
-	g_signal_emit(G_OBJECT(notebook), sq_notebook_signals[SQ_NOTEBOOK_SIGNAL_FILE_ACTIVATED], 0, path, NULL);
+	g_signal_emit(G_OBJECT(notebook), sq_notebook_signals[SQ_NOTEBOOK_SIGNAL_FILE_ACTIVATED], 0, iter, NULL);
 }
 
 gboolean



More information about the Xfce4-commits mailing list