Review Request: Ported KTimeTracker to KNotification

Thorsten Staerk dev at staerk.de
Mon Sep 28 21:13:09 CEST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1653/#review2487
-----------------------------------------------------------


I dislike if libraries change, like this change from KSystemTray to KNotification or however this is called ...

Here is your patch as I would like to commit:

emTrayIcon( 0 )                                                       
+  : KNotificationItem( 0 )                                                     
 {                                                                              
     setObjectName( "Ktimetracker Tray" );                                      
     // it is not convenient if every kpart gets an icon in the systray.        
@@ -86,7 +86,7 @@                                                               
 }                                                                              
                                                                                
 TrayIcon::TrayIcon()                                                           
-  : KSystemTrayIcon( 0 )                                                       
+  : KNotificationItem( 0 )                                                     
 // will display nothing at all                                                 
 {                                                                              
     setObjectName( "Ktimetracker Tray" );                                      
@@ -103,8 +103,7 @@                                                             
     if ( _taskActiveTimer )                                                    
     {                                                                          
         _taskActiveTimer->start(1000);                                         
-        setIcon( *(*icons)[_activeIcon] );                                     
-        show();                                                                
+        setIconByPixmap( *(*icons)[_activeIcon] );                             
     }                                                                          
     kDebug(5970) << "Leaving function";                                        
 }                                                                              
@@ -115,7 +114,6 @@                                                             
     if ( _taskActiveTimer )                                                    
     {                                                                          
         _taskActiveTimer->stop();                                              
-        show();                                                                
     }                                                                          
     kDebug(5970) << "Leaving function";                                        
 }                                                                              
@@ -123,14 +121,13 @@                                                           
 void TrayIcon::advanceClock()                                                  
 {                                                                              
     _activeIcon = (_activeIcon+1) % 8;                                         
-    setIcon( *(*icons)[_activeIcon]);                                          
+    setIconByPixmap( *(*icons)[_activeIcon]);                                  
 }                                                                              
                                                                                
 void TrayIcon::resetClock()                                                    
 {                                                                              
     _activeIcon = 0;                                                           
-    setIcon( *(*icons)[_activeIcon]);
-    show();
+    setIconByPixmap( *(*icons)[_activeIcon]);
 }

 void TrayIcon::initToolTip()
@@ -142,14 +139,14 @@
 {
     if ( activeTasks.isEmpty() )
     {
-        this->setToolTip( i18n("No active tasks") );
+        this->setToolTip( "ktimetracker", "ktimetracker", i18n("No active tasks") );
         return;
     }

     QFontMetrics fm( QToolTip::font() );
     const QString continued = i18n( ", ..." );
     const int buffer = fm.boundingRect( continued ).width();
-    const int desktopWidth = KGlobalSettings::desktopGeometry(parentWidget()).width();
+    const int desktopWidth = KGlobalSettings::desktopGeometry(associatedWidget()).width();
     const int maxWidth = desktopWidth - buffer;

     QString qTip;
@@ -174,7 +171,7 @@
         }
         qTip = s;
     }
-    this->setToolTip( qTip );
+    this->setToolTip( "ktimetracker", "ktimetracker", qTip );
 }

 #include "tray.moc"


- Thorsten


On 2009-09-19 20:16:41, Davide Bettio wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1653/
> -----------------------------------------------------------
> 
> (Updated 2009-09-19 20:16:41)
> 
> 
> Review request for KDE PIM and Plasma.
> 
> 
> Summary
> -------
> 
> KTimeTracker has been ported to KNotificationItem but I still have few issues that I've corrected with #if 0.
> It's not really clear to me how the notification works when KTimeTracker is a KPart.
> Anyway please don't use XPM pixmaps, use icons.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdepim/ktimetracker/ktimetrackerpart.cpp 1024122 
>   /trunk/KDE/kdepim/ktimetracker/tray.h 1024122 
>   /trunk/KDE/kdepim/ktimetracker/tray.cpp 1024122 
> 
> Diff: http://reviewboard.kde.org/r/1653/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Davide
> 
>



More information about the Plasma-devel mailing list