Changeset 11737


Ignore:
Timestamp:
Jan 21, 2011, 2:58:58 AM (11 years ago)
Author:
jordan
Message:

(trunk gtk) #3916 "Reorder the list when metadata is downloaded" -- fixed.

When tr_info.name changes, update the collated name in the main window's TreeStore?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r11709 r11737  
    12831283    tr_bool oldFinished, newFinished;
    12841284    tr_priority_t oldPriority, newPriority;
     1285    char * oldCollatedName, * newCollatedName;
    12851286    char * oldTrackers, * newTrackers;
    12861287    double oldUpSpeed, newUpSpeed;
     
    12881289    gboolean oldActive, newActive;
    12891290    const tr_stat * st;
     1291    const tr_info * inf;
    12901292    TrTorrent * gtor;
    12911293    tr_torrent * tor;
     
    12941296    gtk_tree_model_get( model, iter,
    12951297                        MC_TORRENT, &gtor,
     1298                        MC_NAME_COLLATED, &oldCollatedName,
    12961299                        MC_ACTIVE, &oldActive,
    12971300                        MC_ACTIVITY, &oldActivity,
     
    13131316    newUpSpeed = st->pieceUploadSpeed_KBps;
    13141317    newDownSpeed = st->pieceDownloadSpeed_KBps;
     1318    inf = tr_torrent_info( gtor );
     1319    newCollatedName = g_utf8_strdown( inf->name ? inf->name : "", -1 );
    13151320
    13161321    /* updating the model triggers off resort/refresh,
     
    13211326        || ( newPriority != oldPriority )
    13221327        || gtr_strcmp0( oldTrackers, newTrackers )
     1328        || gtr_strcmp0( oldCollatedName, newCollatedName )
    13231329        || gtr_compare_double( newUpSpeed, oldUpSpeed, 3 )
    13241330        || gtr_compare_double( newDownSpeed, oldDownSpeed, 3 ) )
     
    13271333                            MC_ACTIVE, newActive,
    13281334                            MC_ACTIVITY, newActivity,
     1335                            MC_NAME_COLLATED, &newCollatedName,
    13291336                            MC_FINISHED, newFinished,
    13301337                            MC_PRIORITY, newPriority,
     
    13371344    /* cleanup */
    13381345    g_object_unref( gtor );
     1346    g_free( newCollatedName );
     1347    g_free( oldCollatedName );
    13391348    g_free( newTrackers );
    13401349    g_free( oldTrackers );
Note: See TracChangeset for help on using the changeset viewer.