Skip to content

Commit be32bea

Browse files
committed
ready to fix compat switch
1 parent ba6a654 commit be32bea

File tree

6 files changed

+32
-13
lines changed

6 files changed

+32
-13
lines changed

TODO

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
- try:
2+
3+
./nip2 ~/Desktop/test.ws ../share/nip2/data/examples/logo/logo2.ws
4+
5+
then drag logo2 tab to test.ws
6+
7+
every time we swicth tabs and rebuild the toolkitmenu, it grows
8+
9+
the top set of itenms are the valid ones, the lower ones cause a segv
10+
11+
we don't seem to be removing old items in toolkitview_destroy()
12+
113
- get this sometimes on shutdown?
214

315
(nip2:11768): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)'

src/mainw.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ static void
128128
mainw_finalize( GObject *gobject )
129129
{
130130
#ifdef DEBUG
131-
#endif /*DEBUG*/
132131
printf( "mainw_finalize: %p\n", gobject );
132+
#endif /*DEBUG*/
133133

134134
g_return_if_fail( gobject != NULL );
135135
g_return_if_fail( IS_MAINW( gobject ) );
@@ -148,8 +148,8 @@ mainw_dispose( GObject *object )
148148
mainw = MAINW( object );
149149

150150
#ifdef DEBUG
151-
#endif /*DEBUG*/
152151
printf( "mainw_dispose\n" );
152+
#endif /*DEBUG*/
153153

154154
IM_FREEF( g_source_remove, mainw->refresh_timeout );
155155

@@ -422,8 +422,8 @@ mainw_refresh_timeout_cb( gpointer user_data )
422422
Workspace *ws;
423423

424424
#ifdef DEBUG
425-
printf( "mainw_refresh_timeout_cb: %p\n", mainw );
426425
#endif /*DEBUG*/
426+
printf( "mainw_refresh_timeout_cb: %p\n", mainw );
427427

428428
mainw_status_update( mainw );
429429
mainw_free_update( mainw );
@@ -471,8 +471,12 @@ mainw_refresh_timeout_cb( gpointer user_data )
471471
workspace_jump_update( ws, mainw->jump_to_column_menu );
472472

473473
if( mainw->kitg != ws->kitg ) {
474+
printf( "mainw_refresh_timeout_cb: unreffing old "
475+
"kitgview\n" );
474476
UNREF( mainw->kitgview );
475477

478+
printf( "mainw_refresh_timeout_cb: building new "
479+
"kitgview\n" );
476480
mainw->kitgview = TOOLKITGROUPVIEW(
477481
model_view_new( MODEL( ws->kitg ), NULL ) );
478482
g_object_ref( G_OBJECT( mainw->kitgview ) );

src/toolkitgroupview.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ static void
3939
toolkitgroupview_finalize( GObject *gobject )
4040
{
4141
#ifdef DEBUG
42-
printf( "toolkitgroupview_finalize: %p\n", gobject );
4342
#endif /*DEBUG*/
43+
printf( "toolkitgroupview_finalize: %p\n", gobject );
4444

4545
G_OBJECT_CLASS( parent_class )->finalize( gobject );
4646
}

src/toolkitview.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ toolkitview_destroy( GtkObject *object )
5151
kview = TOOLKITVIEW( object );
5252

5353
#ifdef DEBUG
54-
printf( "toolkitview_destroy: %p\n", object );
5554
#endif /*DEBUG*/
55+
printf( "toolkitview_destroy: %p\n", object );
56+
printf( "toolkitview_destroy: menu = %p\n", kview->menu );
57+
printf( "toolkitview_destroy: item = %p\n", kview->item );
58+
59+
5660

5761
DESTROY_GTK( kview->menu );
5862
DESTROY_GTK( kview->item );
@@ -64,8 +68,8 @@ static void
6468
toolkitview_finalize( GObject *gobject )
6569
{
6670
#ifdef DEBUG
67-
printf( "toolkitview_finalize: %p\n", gobject );
6871
#endif /*DEBUG*/
72+
printf( "toolkitview_finalize: %p\n", gobject );
6973

7074
G_OBJECT_CLASS( parent_class )->finalize( gobject );
7175
}
@@ -75,6 +79,8 @@ toolkitview_finalize( GObject *gobject )
7579
static void
7680
toolkitview_destroy_cb( GtkWidget *widget, Toolkitview *kview )
7781
{
82+
printf( "toolkitview_destroy_cb: %p\n", kview );
83+
7884
kview->menu = NULL;
7985
kview->item = NULL;
8086
kview->destroy_sid = 0;
@@ -117,9 +123,6 @@ toolkitview_refresh( vObject *vobject )
117123
char path[256];
118124
GtkWidget *item;
119125

120-
if( !iwnd )
121-
printf( "poop:\n" );
122-
123126
kview->menu = gtk_menu_new();
124127
gtk_menu_set_accel_group( GTK_MENU( kview->menu ),
125128
iwnd->accel_group );

src/workspacegroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ workspacegroup_dispose( GObject *gobject )
121121
wsg = WORKSPACEGROUP( gobject );
122122

123123
#ifdef DEBUG
124-
#endif /*DEBUG*/
125124
printf( "workspacegroup_dispose %s\n", IOBJECT( wsg )->name );
125+
#endif /*DEBUG*/
126126

127127
IM_FREEF( g_source_remove, wsg->autosave_timeout );
128128

@@ -140,8 +140,8 @@ workspacegroup_finalize( GObject *gobject )
140140
wsg = WORKSPACEGROUP( gobject );
141141

142142
#ifdef DEBUG
143-
#endif /*DEBUG*/
144143
printf( "workspacegroup_finalize %s\n", IOBJECT( wsg )->name );
144+
#endif /*DEBUG*/
145145

146146
G_OBJECT_CLASS( parent_class )->finalize( gobject );
147147
}

src/workspacegroupview.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ workspacegroupview_page_removed_cb( GtkNotebook *notebook,
237237
Workspacegroup *wsg = WORKSPACEGROUP( VOBJECT( wsgview )->iobject );
238238

239239
/*
240-
*/
241240
Workspace *ws = WORKSPACE( VOBJECT( wview )->iobject );
242241
243242
if( wsg )
244243
printf( "workspacegroupview_page_removed_cb: "
245244
"wsg = %s, ws = %s\n",
246245
NN( IOBJECT( wsg )->name ),
247246
NN( IOBJECT( ws )->name ) );
247+
*/
248248
}
249249

250250
static void
@@ -260,9 +260,9 @@ workspacegroupview_page_added_cb( GtkNotebook *notebook,
260260
Mainw *mainw = MAINW( iwindow_get_root( GTK_WIDGET( notebook ) ) );
261261

262262
/*
263-
*/
264263
printf( "workspacegroupview_page_added_cb: wsg = %s, ws = %s\n",
265264
NN( IOBJECT( wsg )->name ), NN( IOBJECT( ws )->name ) );
265+
*/
266266

267267
filemodel_set_window_hint( FILEMODEL( wsg ), IWINDOW( mainw ) );
268268
}

0 commit comments

Comments
 (0)