Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Files
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
444
Issues
444
List
Boards
Labels
Service Desk
Milestones
Merge Requests
30
Merge Requests
30
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
Files
Commits
8c92ecec
Commit
8c92ecec
authored
Jan 11, 2000
by
John Sullivan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added nautilus_gtk_signal_connect_free_data, and deployed it.
parent
3e6324f1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
126 additions
and
10 deletions
+126
-10
ChangeLog-20000414
ChangeLog-20000414
+12
-0
libnautilus-extensions/nautilus-gtk-extensions.c
libnautilus-extensions/nautilus-gtk-extensions.c
+26
-0
libnautilus-extensions/nautilus-gtk-extensions.h
libnautilus-extensions/nautilus-gtk-extensions.h
+6
-0
libnautilus-private/nautilus-gtk-extensions.c
libnautilus-private/nautilus-gtk-extensions.c
+26
-0
libnautilus-private/nautilus-gtk-extensions.h
libnautilus-private/nautilus-gtk-extensions.h
+6
-0
libnautilus/nautilus-gtk-extensions.c
libnautilus/nautilus-gtk-extensions.c
+26
-0
libnautilus/nautilus-gtk-extensions.h
libnautilus/nautilus-gtk-extensions.h
+6
-0
src/nautilus-window-manage-views.c
src/nautilus-window-manage-views.c
+9
-5
src/ntl-window-msgs.c
src/ntl-window-msgs.c
+9
-5
No files found.
ChangeLog-20000414
View file @
8c92ecec
2000-01-11 John Sullivan <sullivan@eazel.com>
* libnautilus/nautilus-gtk-extensions.h:
* libnautilus/nautilus-gtk-extensions.c:
(nautilus_gtk_signal_connect_free_data): New function,
convenience wrapper for gtk_signal_connect_full where
the destroy-function is g_free() and the other extra
values are the defaults.
* src/ntl-window-msgs.c: (nautilus_window_load_content_view_menu):
Use nautilus_gtk_signal_connect_free_data to avoid leaking the menu item's
signal's copy of the iid string.
2000-01-11 John Sullivan <sullivan@eazel.com>
Content view menu now works (can switch between List and Icon views).
...
...
libnautilus-extensions/nautilus-gtk-extensions.c
View file @
8c92ecec
...
...
@@ -28,6 +28,32 @@
#include <gnome.h>
/**
* nautilus_gtk_signal_connect_free_data:
*
* Attach a function pointer and user data to a signal, and free
* the user data when the signal is disconnected.
* @object: the object which emits the signal. For example, a button in the button press signal.
* @name: the name of the signal.
* @func: function pointer to attach to the signal.
* @data: the user data associated with the function. g_free() will be called on
* this user data when the signal is disconnected.
**/
guint
nautilus_gtk_signal_connect_free_data
(
GtkObject
*
object
,
const
gchar
*
name
,
GtkSignalFunc
func
,
gpointer
data
)
{
return
gtk_signal_connect_full
(
object
,
name
,
func
,
NULL
,
/* marshal */
data
,
(
GtkDestroyNotify
)
g_free
,
FALSE
,
/* is this an object signal? */
FALSE
);
/* invoke func after signal? */
}
/**
* nautilus_gtk_window_hide_retain_geometry:
*
...
...
libnautilus-extensions/nautilus-gtk-extensions.h
View file @
8c92ecec
...
...
@@ -29,6 +29,12 @@
#include <gtk/gtkwindow.h>
guint
nautilus_gtk_signal_connect_free_data
(
GtkObject
*
object
,
const
gchar
*
name
,
GtkSignalFunc
func
,
gpointer
data
);
void
nautilus_gtk_window_present
(
GtkWindow
*
window
);
#endif
/* NAUTILUS_GTK_EXTENSIONS_H */
libnautilus-private/nautilus-gtk-extensions.c
View file @
8c92ecec
...
...
@@ -28,6 +28,32 @@
#include <gnome.h>
/**
* nautilus_gtk_signal_connect_free_data:
*
* Attach a function pointer and user data to a signal, and free
* the user data when the signal is disconnected.
* @object: the object which emits the signal. For example, a button in the button press signal.
* @name: the name of the signal.
* @func: function pointer to attach to the signal.
* @data: the user data associated with the function. g_free() will be called on
* this user data when the signal is disconnected.
**/
guint
nautilus_gtk_signal_connect_free_data
(
GtkObject
*
object
,
const
gchar
*
name
,
GtkSignalFunc
func
,
gpointer
data
)
{
return
gtk_signal_connect_full
(
object
,
name
,
func
,
NULL
,
/* marshal */
data
,
(
GtkDestroyNotify
)
g_free
,
FALSE
,
/* is this an object signal? */
FALSE
);
/* invoke func after signal? */
}
/**
* nautilus_gtk_window_hide_retain_geometry:
*
...
...
libnautilus-private/nautilus-gtk-extensions.h
View file @
8c92ecec
...
...
@@ -29,6 +29,12 @@
#include <gtk/gtkwindow.h>
guint
nautilus_gtk_signal_connect_free_data
(
GtkObject
*
object
,
const
gchar
*
name
,
GtkSignalFunc
func
,
gpointer
data
);
void
nautilus_gtk_window_present
(
GtkWindow
*
window
);
#endif
/* NAUTILUS_GTK_EXTENSIONS_H */
libnautilus/nautilus-gtk-extensions.c
View file @
8c92ecec
...
...
@@ -28,6 +28,32 @@
#include <gnome.h>
/**
* nautilus_gtk_signal_connect_free_data:
*
* Attach a function pointer and user data to a signal, and free
* the user data when the signal is disconnected.
* @object: the object which emits the signal. For example, a button in the button press signal.
* @name: the name of the signal.
* @func: function pointer to attach to the signal.
* @data: the user data associated with the function. g_free() will be called on
* this user data when the signal is disconnected.
**/
guint
nautilus_gtk_signal_connect_free_data
(
GtkObject
*
object
,
const
gchar
*
name
,
GtkSignalFunc
func
,
gpointer
data
)
{
return
gtk_signal_connect_full
(
object
,
name
,
func
,
NULL
,
/* marshal */
data
,
(
GtkDestroyNotify
)
g_free
,
FALSE
,
/* is this an object signal? */
FALSE
);
/* invoke func after signal? */
}
/**
* nautilus_gtk_window_hide_retain_geometry:
*
...
...
libnautilus/nautilus-gtk-extensions.h
View file @
8c92ecec
...
...
@@ -29,6 +29,12 @@
#include <gtk/gtkwindow.h>
guint
nautilus_gtk_signal_connect_free_data
(
GtkObject
*
object
,
const
gchar
*
name
,
GtkSignalFunc
func
,
gpointer
data
);
void
nautilus_gtk_window_present
(
GtkWindow
*
window
);
#endif
/* NAUTILUS_GTK_EXTENSIONS_H */
src/nautilus-window-manage-views.c
View file @
8c92ecec
...
...
@@ -28,6 +28,7 @@
#include "ntl-window-private.h"
#include "ntl-index-panel.h"
#include "explorer-location-bar.h"
#include <libnautilus/nautilus-gtk-extensions.h>
struct
_NautilusWindowLoadInfo
{
/* These are the three states of loading in process.
...
...
@@ -274,11 +275,14 @@ nautilus_window_load_content_view_menu (NautilusWindow *window, NautilusNavigati
{
default_view_index
=
index
;
}
/* FIXME: copy of identifier->iid doesn't get freed */
gtk_signal_connect
(
GTK_OBJECT
(
menu_item
),
"activate"
,
GTK_SIGNAL_FUNC
(
view_menu_switch_views_cb
),
g_strdup
(
identifier
->
iid
));
/* Free copy of string when signal disconnected. */
nautilus_gtk_signal_connect_free_data
(
GTK_OBJECT
(
menu_item
),
"activate"
,
GTK_SIGNAL_FUNC
(
view_menu_switch_views_cb
),
g_strdup
(
identifier
->
iid
));
/* Store reference to window in item; no need to free this. */
gtk_object_set_user_data
(
GTK_OBJECT
(
menu_item
),
window
);
gtk_menu_append
(
GTK_MENU
(
new_menu
),
menu_item
);
gtk_widget_show
(
menu_item
);
...
...
src/ntl-window-msgs.c
View file @
8c92ecec
...
...
@@ -28,6 +28,7 @@
#include "ntl-window-private.h"
#include "ntl-index-panel.h"
#include "explorer-location-bar.h"
#include <libnautilus/nautilus-gtk-extensions.h>
struct
_NautilusWindowLoadInfo
{
/* These are the three states of loading in process.
...
...
@@ -274,11 +275,14 @@ nautilus_window_load_content_view_menu (NautilusWindow *window, NautilusNavigati
{
default_view_index
=
index
;
}
/* FIXME: copy of identifier->iid doesn't get freed */
gtk_signal_connect
(
GTK_OBJECT
(
menu_item
),
"activate"
,
GTK_SIGNAL_FUNC
(
view_menu_switch_views_cb
),
g_strdup
(
identifier
->
iid
));
/* Free copy of string when signal disconnected. */
nautilus_gtk_signal_connect_free_data
(
GTK_OBJECT
(
menu_item
),
"activate"
,
GTK_SIGNAL_FUNC
(
view_menu_switch_views_cb
),
g_strdup
(
identifier
->
iid
));
/* Store reference to window in item; no need to free this. */
gtk_object_set_user_data
(
GTK_OBJECT
(
menu_item
),
window
);
gtk_menu_append
(
GTK_MENU
(
new_menu
),
menu_item
);
gtk_widget_show
(
menu_item
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment