Commit 555b5dba authored by Paolo Bacchilega's avatar Paolo Bacchilega

file source: simplified the can_cut virtual function

Removed the file argument, which was unused.
parent 67c19671
......@@ -1150,14 +1150,6 @@ gth_file_source_catalogs_copy (GthFileSource *file_source,
}
static gboolean
gth_file_source_catalogs_can_cut (GthFileSource *file_source,
GFile *file)
{
return g_file_has_uri_scheme (file, "catalog");
}
static gboolean
gth_file_source_catalogs_is_reorderable (GthFileSource *file_source)
{
......@@ -1485,7 +1477,6 @@ gth_file_source_catalogs_class_init (GthFileSourceCatalogsClass *class)
file_source_class->rename = gth_file_source_catalogs_rename;
file_source_class->for_each_child = gth_file_source_catalogs_for_each_child;
file_source_class->copy = gth_file_source_catalogs_copy;
file_source_class->can_cut = gth_file_source_catalogs_can_cut;
file_source_class->is_reorderable = gth_file_source_catalogs_is_reorderable;
file_source_class->reorder = gth_file_source_catalogs_reorder;
file_source_class->remove = gth_file_source_catalogs_remove;
......
......@@ -261,7 +261,7 @@ gth_file_list_drag_data_received (GtkWidget *file_view,
file_source = gth_browser_get_location_source (browser);
move = gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE;
if (move && ! gth_file_source_can_cut (file_source, (GFile *) selected_files->data)) {
if (move && ! gth_file_source_can_cut (file_source)) {
GtkWidget *dialog;
int response;
......@@ -1089,7 +1089,6 @@ fm__gth_browser_update_sensitivity_cb (GthBrowser *browser)
BrowserData *data;
GthFileSource *file_source;
int n_selected;
GthFileData *location_data;
gboolean sensitive;
GthFileData *folder;
......@@ -1099,8 +1098,7 @@ fm__gth_browser_update_sensitivity_cb (GthBrowser *browser)
file_source = gth_browser_get_location_source (browser);
n_selected = gth_file_selection_get_n_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
location_data = gth_browser_get_location_data (browser);
sensitive = (n_selected > 0) && (file_source != NULL) && (location_data != NULL) && gth_file_source_can_cut (file_source, location_data->file);
sensitive = (n_selected > 0) && (file_source != NULL) && gth_file_source_can_cut (file_source);
gth_window_enable_action (GTH_WINDOW (browser), "edit-cut", sensitive);
sensitive = (n_selected > 0) && (file_source != NULL);
......
......@@ -228,14 +228,6 @@ gth_file_source_selections_copy (GthFileSource *file_source,
}
static gboolean
gth_file_source_selections_can_cut (GthFileSource *file_source,
GFile *file)
{
return g_file_has_uri_scheme (file, "selection");
}
static gboolean
gth_file_source_selections_is_reorderable (GthFileSource *file_source)
{
......@@ -307,7 +299,6 @@ gth_file_source_selections_class_init (GthFileSourceSelectionsClass *class)
file_source_class->rename = gth_file_source_selections_rename;
file_source_class->for_each_child = gth_file_source_selections_for_each_child;
file_source_class->copy = gth_file_source_selections_copy;
file_source_class->can_cut = gth_file_source_selections_can_cut;
file_source_class->is_reorderable = gth_file_source_selections_is_reorderable;
file_source_class->reorder = gth_file_source_selections_reorder;
file_source_class->remove = gth_file_source_selections_remove;
......
......@@ -2840,9 +2840,7 @@ folder_tree_drag_data_get_cb (GtkWidget *widget,
return;
if (gdk_drag_context_get_actions (drag_context) & GDK_ACTION_MOVE) {
GdkDragAction action =
gth_file_source_can_cut (file_source, file_data->file) ?
GDK_ACTION_MOVE : GDK_ACTION_COPY;
GdkDragAction action = gth_file_source_can_cut (file_source) ? GDK_ACTION_MOVE : GDK_ACTION_COPY;
gdk_drag_status (drag_context, action, time);
}
......
......@@ -408,8 +408,7 @@ gth_file_source_vfs_copy (GthFileSource *file_source,
static gboolean
gth_file_source_vfs_can_cut (GthFileSource *file_source,
GFile *file)
gth_file_source_vfs_can_cut (GthFileSource *file_source)
{
return TRUE;
}
......
......@@ -831,8 +831,7 @@ base_rename (GthFileSource *file_source,
static gboolean
base_can_cut (GthFileSource *file_source,
GFile *file)
base_can_cut (GthFileSource *file_source)
{
return FALSE;
}
......@@ -1335,10 +1334,9 @@ gth_file_source_copy (GthFileSource *file_source,
gboolean
gth_file_source_can_cut (GthFileSource *file_source,
GFile *file)
gth_file_source_can_cut (GthFileSource *file_source)
{
return GTH_FILE_SOURCE_GET_CLASS (G_OBJECT (file_source))->can_cut (file_source, file);
return GTH_FILE_SOURCE_GET_CLASS (G_OBJECT (file_source))->can_cut (file_source);
}
......
......@@ -113,8 +113,7 @@ struct _GthFileSourceClass
DialogCallback dialog_callback,
ReadyCallback callback,
gpointer data);
gboolean (*can_cut) (GthFileSource *file_source,
GFile *file);
gboolean (*can_cut) (GthFileSource *file_source);
void (*monitor_entry_points) (GthFileSource *file_source);
void (*monitor_directory) (GthFileSource *file_source,
GFile *file,
......@@ -205,8 +204,7 @@ void gth_file_source_copy (GthFileSource *file
DialogCallback dialog_callback,
ReadyCallback ready_callback,
gpointer data);
gboolean gth_file_source_can_cut (GthFileSource *file_source,
GFile *file);
gboolean gth_file_source_can_cut (GthFileSource *file_source);
void gth_file_source_monitor_entry_points (GthFileSource *file_source);
void gth_file_source_monitor_directory (GthFileSource *file_source,
GFile *file,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment