Changeset 11096


Ignore:
Timestamp:
Aug 2, 2010, 4:30:24 PM (12 years ago)
Author:
charles
Message:

(trunk qt) #2050 "properties dialog changes seem to undo themselves" -- better fix

Location:
trunk/qt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/my-valgrind.sh

    r8579 r11096  
    33export G_DEBUG=gc-friendly
    44export GLIBCXX_FORCE_NEW=1
    5 valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=64 --log-file=x-valgrind --show-reachable=yes ./qtr
     5valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=32 --log-file=x-valgrind --show-reachable=yes ./transmission-qt
  • trunk/qt/prefs-dialog.cc

    r11094 r11096  
    5858{
    5959    const int key( sender( )->property( PREF_KEY ).toInt( ) );
    60     myPrefs.set( key, checked );
     60    setPref( key, checked );
    6161}
    6262
     
    8787    const QDoubleSpinBox * d = qobject_cast<const QDoubleSpinBox*>( spin );
    8888    if( d != 0 )
    89         myPrefs.set( key, d->value( ) );
     89        setPref( key, d->value( ) );
    9090    else
    91         myPrefs.set( key, qobject_cast<const QSpinBox*>(spin)->value( ) );
     91        setPref( key, qobject_cast<const QSpinBox*>(spin)->value( ) );
    9292}
    9393
     
    153153    const int key( sender()->property( PREF_KEY ).toInt( ) );
    154154    const int seconds( QTime().secsTo( time ) );
    155     myPrefs.set( key, seconds / 60 );
     155    setPref( key, seconds / 60 );
    156156}
    157157
     
    173173{
    174174    const int key( sender()->property( PREF_KEY ).toInt( ) );
    175     myPrefs.set( key, text );
     175    setPref( key, text );
    176176}
    177177
     
    256256{
    257257    const int value = qobject_cast<QComboBox*>(sender())->itemData(i).toInt();
    258     myPrefs.set( Prefs::ALT_SPEED_LIMIT_TIME_DAY, value );
     258    setPref( Prefs::ALT_SPEED_LIMIT_TIME_DAY, value );
    259259}
    260260
     
    459459{
    460460    const int value( qobject_cast<QComboBox*>(sender())->itemData(i).toInt( ) );
    461     myPrefs.set( Prefs::ENCRYPTION, value );
     461    setPref( Prefs::ENCRYPTION, value );
    462462}
    463463
     
    553553PrefsDialog :: onLocationSelected( const QString& path, int key )
    554554{
    555     myPrefs.set( key, path );
    556     updatePref( key );
     555    setPref( key, path );
    557556}
    558557
     
    669668         << Prefs :: INCOMPLETE_DIR_ENABLED;
    670669    foreach( int key, keys )
    671         updatePref( key );
     670        refreshPref( key );
    672671
    673672    // if it's a remote session, disable the preferences
     
    685684}
    686685
     686void
     687PrefsDialog :: setPref( int key, const QVariant& v )
     688{
     689    myPrefs.set( key, v );
     690    refreshPref( key );
     691}
     692
    687693/***
    688694****
     
    707713
    708714void
    709 PrefsDialog :: updatePref( int key )
     715PrefsDialog :: refreshPref( int key )
    710716{
    711717    switch( key )
  • trunk/qt/prefs-dialog.h

    r11094 r11096  
    4747        void timeChanged( const QTime& );
    4848        void textChanged( const QString& );
    49         void updatePref( int key );
     49        void refreshPref( int key );
    5050        void encryptionEdited( int );
    5151        void altSpeedDaysEdited( int );
     
    7878
    7979    private:
     80        void setPref( int key, const QVariant& v );
    8081        bool isAllowed( int key ) const;
    8182        QWidget * createTorrentsTab( );
Note: See TracChangeset for help on using the changeset viewer.