@ -63,7 +63,7 @@ ReplayGainFileListItem::ReplayGainFileListItem( ReplayGainFileListItem* parent )
ReplayGainFileListItem : : ~ ReplayGainFileListItem ( )
{ }
void ReplayGainFileListItem : : paintCell ( TQPainter * p , const TQColorGroup & cg , int column , int width , int tq alignment )
void ReplayGainFileListItem : : paintCell ( TQPainter * p , const TQColorGroup & cg , int column , int width , int alignment )
{
// NOTE speed up this function
// NOTE calculate the red color
@ -76,46 +76,46 @@ void ReplayGainFileListItem::paintCell( TQPainter *p, const TQColorGroup &cg, in
int margin = listView ( ) - > itemMargin ( ) ;
int w = width - 2 * margin ;
int h = height ( ) ;
TQRect textRect = p - > boundingRect ( margin , 0 , w , h , tq alignment, text ( column ) ) ;
TQRect textRect = p - > boundingRect ( margin , 0 , w , h , alignment, text ( column ) ) ;
if ( textRect . width ( ) > w ) {
tq alignment = TQt : : AlignRight | TQt : : SingleLine ;
alignment = TQt : : AlignRight | TQt : : SingleLine ;
}
}
if ( isSelected ( ) & & addingReplayGain ) {
_cg . setColor ( TQColorGroup : : Highlight , TQColor ( 215 , 62 , 62 ) ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , tq alignment ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , alignment ) ;
return ;
}
else if ( addingReplayGain & & column ! = listView ( ) - > sortColumn ( ) ) {
_cg . setColor ( TQColorGroup : : Base , TQColor ( 255 , 234 , 234 ) ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , tq alignment ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , alignment ) ;
return ;
}
else if ( addingReplayGain & & column = = listView ( ) - > sortColumn ( ) ) {
_cg . setColor ( TQColorGroup : : Base , TQColor ( 247 , 227 , 227 ) ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , tq alignment ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , alignment ) ;
return ;
}
if ( isSelected ( ) & & queued ) {
_cg . setColor ( TQColorGroup : : Highlight , TQColor ( 230 , 232 , 100 ) ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , tq alignment ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , alignment ) ;
return ;
}
else if ( queued & & column ! = listView ( ) - > sortColumn ( ) ) {
_cg . setColor ( TQColorGroup : : Base , TQColor ( 255 , 255 , 190 ) ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , tq alignment ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , alignment ) ;
return ;
}
else if ( queued & & column = = listView ( ) - > sortColumn ( ) ) {
_cg . setColor ( TQColorGroup : : Base , TQColor ( 255 , 243 , 168 ) ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , tq alignment ) ;
TQListViewItem : : paintCell ( p , _cg , column , width , alignment ) ;
return ;
}
KListViewItem : : paintCell ( p , _cg , column , width , tq alignment ) ;
KListViewItem : : paintCell ( p , _cg , column , width , alignment ) ;
}
void ReplayGainFileListItem : : setType ( Type type )
@ -836,18 +836,18 @@ void ReplayGainFileList::calcSelectedItemsGain()
if ( item - > type ( ) = = ReplayGainFileListItem : : File ) {
if ( item - > isSelected ( ) ) {
item - > queued = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
item - > mode = ReplayGainFileListItem : : force ;
}
}
else {
if ( item - > isSelected ( ) ) {
item - > queued = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
item - > mode = ReplayGainFileListItem : : force ;
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
sub_item - > queued = true ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
sub_item - > mode = ReplayGainFileListItem : : force ;
}
}
@ -855,11 +855,11 @@ void ReplayGainFileList::calcSelectedItemsGain()
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
if ( sub_item - > isSelected ( ) ) {
item - > queued = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
item - > mode = ReplayGainFileListItem : : force ;
for ( ReplayGainFileListItem * sub_item2 = item - > firstChild ( ) ; sub_item2 ! = 0 ; sub_item2 = sub_item2 - > nextSibling ( ) ) {
sub_item2 - > queued = true ;
sub_item2 - > tq repaint( ) ;
sub_item2 - > repaint( ) ;
sub_item2 - > mode = ReplayGainFileListItem : : force ;
}
break ;
@ -878,18 +878,18 @@ void ReplayGainFileList::removeSelectedItemsGain()
if ( item - > type ( ) = = ReplayGainFileListItem : : File ) {
if ( item - > isSelected ( ) & & ! item - > addingReplayGain ) {
item - > queued = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
item - > mode = ReplayGainFileListItem : : remove ;
}
}
else {
if ( item - > isSelected ( ) & & ! item - > addingReplayGain ) {
item - > queued = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
item - > mode = ReplayGainFileListItem : : remove ;
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
sub_item - > queued = true ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
sub_item - > mode = ReplayGainFileListItem : : remove ;
}
}
@ -897,7 +897,7 @@ void ReplayGainFileList::removeSelectedItemsGain()
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
if ( sub_item - > isSelected ( ) & & ! sub_item - > addingReplayGain ) {
sub_item - > queued = true ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
sub_item - > mode = ReplayGainFileListItem : : remove ;
}
}
@ -926,12 +926,12 @@ void ReplayGainFileList::calcReplayGain( ReplayGainFileListItem* item )
if ( item - > type ( ) = = ReplayGainFileListItem : : Album ) {
item - > queued = false ;
item - > addingReplayGain = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
if ( sub_item - > queued & & sub_item - > mode & ReplayGainFileListItem : : force ) force = true ; // NOTE can this be replaced by checking item?
sub_item - > queued = false ;
sub_item - > addingReplayGain = true ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
fileList + = sub_item - > filePathName ;
files + + ;
@ -953,10 +953,10 @@ void ReplayGainFileList::calcReplayGain( ReplayGainFileListItem* item )
else {
logger - > processCompleted ( logID , 0 ) ;
item - > addingReplayGain = false ;
item - > tq repaint( ) ;
item - > repaint( ) ;
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
sub_item - > addingReplayGain = false ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
}
processNextFile ( ) ;
}
@ -966,7 +966,7 @@ void ReplayGainFileList::calcReplayGain( ReplayGainFileListItem* item )
item - > queued = false ;
item - > addingReplayGain = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
files = 1 ;
timeCount = item - > time ;
@ -989,13 +989,13 @@ void ReplayGainFileList::removeReplayGain( ReplayGainFileListItem* item )
if ( item - > type ( ) = = ReplayGainFileListItem : : File ) {
item - > queued = false ;
item - > addingReplayGain = true ;
item - > tq repaint( ) ;
item - > repaint( ) ;
timeCount = item - > time ;
replayGain - > apply ( item - > filePathName , item - > mimeType , process , logID , ReplayGain : : remove ) ;
}
else {
item - > queued = false ;
item - > tq repaint( ) ;
item - > repaint( ) ;
processNextFile ( ) ;
}
}
@ -1201,43 +1201,43 @@ void ReplayGainFileList::processExit( KProcess* proc )
if ( item - > addingReplayGain ) {
processedTime + = item - > time ;
item - > addingReplayGain = false ;
item - > tq repaint( ) ;
item - > repaint( ) ;
item - > updateReplayGainCells ( tagEngine - > readTags ( KURL : : decode_string ( item - > filePathName ) ) ) ;
}
if ( item - > queued & & proc - > signalled ( ) ) {
item - > queued = false ;
item - > tq repaint( ) ;
item - > repaint( ) ;
}
}
else {
if ( item - > addingReplayGain ) {
item - > addingReplayGain = false ;
item - > tq repaint( ) ;
item - > repaint( ) ;
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
processedTime + = sub_item - > time ;
sub_item - > addingReplayGain = false ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
sub_item - > updateReplayGainCells ( tagEngine - > readTags ( KURL : : decode_string ( sub_item - > filePathName ) ) ) ;
}
}
if ( item - > queued & & proc - > signalled ( ) ) {
item - > queued = false ;
item - > tq repaint( ) ;
item - > repaint( ) ;
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
sub_item - > queued = false ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
}
}
for ( ReplayGainFileListItem * sub_item = item - > firstChild ( ) ; sub_item ! = 0 ; sub_item = sub_item - > nextSibling ( ) ) {
if ( sub_item - > addingReplayGain ) {
processedTime + = sub_item - > time ;
sub_item - > addingReplayGain = false ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
sub_item - > updateReplayGainCells ( tagEngine - > readTags ( KURL : : decode_string ( sub_item - > filePathName ) ) ) ;
}
if ( sub_item - > queued & & proc - > signalled ( ) ) {
sub_item - > queued = false ;
sub_item - > tq repaint( ) ;
sub_item - > repaint( ) ;
}
}
}