Changeset 4848
- Timestamp:
- Jan 27, 2008, 8:12:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/dialogs.c
r4782 r4848 357 357 } 358 358 359 static gboolean 360 countActiveTorrents( GtkTreeModel * model, 361 GtkTreePath * path UNUSED, 362 GtkTreeIter * iter, 363 gpointer activeTorrentCount ) 364 { 365 int status = -1; 366 gtk_tree_model_get( model, iter, MC_STATUS, &status, -1 ); 367 if( status != TR_STATUS_STOPPED ) 368 *(int*)activeTorrentCount += 1; 369 return FALSE; /* keep iterating */ 370 } 371 359 372 void 360 373 askquit( TrCore * core, … … 366 379 GtkWidget * wind; 367 380 GtkWidget * dontask; 381 GtkTreeModel * model; 382 int activeTorrentCount; 368 383 369 384 /* if the user doesn't want to be asked, don't ask */ … … 373 388 } 374 389 375 /* if there aren't any torrents, don't ask */ 376 if( !tr_torrentCount( tr_core_handle( core ) ) ) { 390 /* if there aren't any active torrents, don't ask */ 391 model = tr_core_model( core ); 392 activeTorrentCount = 0; 393 gtk_tree_model_foreach( model, countActiveTorrents, &activeTorrentCount ); 394 if( !activeTorrentCount ) { 377 395 func( cbdata ); 378 396 return;
Note: See TracChangeset
for help on using the changeset viewer.