Adium

Changeset 19087

Show
Ignore:
Timestamp:
02/26/2007 09:12:54 PM (2 years ago)
Author:
eharris
Message:

Fixes #2463

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/adium-1.0/Source/ESiTunesPlugin.m

    r18175 r19087  
    136136 * Retains new information, requests immediate content update and lets the plugin know what iTunes is doing. 
    137137 */ 
    138 - (void)setiTunesCurrentInfo:(NSDictionary *)newInfo 
    139 
    140         if (newInfo != iTunesCurrentInfo) { 
    141                 [iTunesCurrentInfo release]; 
    142                 iTunesCurrentInfo = [newInfo retain]; 
    143  
    144                 [self setiTunesIsStopped:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_STOPPED]]; 
    145                 [self setiTunesIsPaused:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_PAUSED]]; 
    146  
    147                 [[adium notificationCenter] postNotificationName:Adium_RequestImmediateDynamicContentUpdate object:nil]; 
    148         } 
    149 
     138 - (void)setiTunesCurrentInfo:(NSDictionary *)newInfo 
     139 { 
     140        if (newInfo != iTunesCurrentInfo) { 
     141                NSTimeInterval time = 5.0; 
     142                [iTunesCurrentInfo release]; 
     143                iTunesCurrentInfo = [newInfo retain]; 
     144 
     145                [self setiTunesIsStopped:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_STOPPED]]; 
     146                [self setiTunesIsPaused:[[newInfo objectForKey:PLAYER_STATE] isEqualToString:KEY_PAUSED]]; 
     147         
     148        //Cancel any requests we had to fire updates. 
     149        [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(fireUpdateiTunesInfo) object:nil]; 
     150        //fire an iTunes update in three seconds. 
     151        [self performSelector:@selector(fireUpdateiTunesInfo) withObject:nil afterDelay:3.0]; 
     152        } 
     153 } 
     154 
     155 -(void)fireUpdateiTunesInfo 
     156 { 
     157     [[adium notificationCenter] postNotificationName:Adium_RequestImmediateDynamicContentUpdate object:nil]; 
     158 } 
    150159 
    151160#pragma mark -