Bug 236566 - System tray icon displayed 2 times
Summary: System tray icon displayed 2 times
Status: RESOLVED FIXED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: Git (master)
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: Thorsten Staerk
URL:
Keywords:
: 271216 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-06 13:17 UTC by Michał Zając
Modified: 2011-10-09 15:35 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.3


Attachments
Screenshot of the bug (35.66 KB, image/jpeg)
2010-05-06 13:18 UTC, Michał Zając
Details
Screenshot with wrong behaviour and additional misplaced icons on the clock (11.23 KB, image/png)
2010-05-13 14:15 UTC, Jonathan
Details
Screenshot of two row system tray (7.48 KB, image/png)
2010-05-13 14:17 UTC, Jonathan
Details
systemtray and ktimetracker (20.74 KB, patch)
2010-09-16 20:07 UTC, Dr. Faust
Details
Screenshot of the system tray (17.52 KB, image/png)
2011-01-28 03:10 UTC, Simon Yuan
Details
In a vertical layout is clear that there are two entries (102.35 KB, image/png)
2011-07-12 16:02 UTC, Aitor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Zając 2010-05-06 13:17:52 UTC
Version:            (using KDE 4.4.2)
Installed from:    Ubuntu Packages

When you run KTimeTracker the icon behaves as if there are two instances of KTimeTracker (one without an icon) which makes the tray contain an empty entry.
Also, the option in KTimeTracker to remove the tray icon has no effect at all.
Comment 1 Michał Zając 2010-05-06 13:18:23 UTC
Created attachment 43309 [details]
Screenshot of the bug
Comment 2 Jonathan 2010-05-13 14:15:18 UTC
Created attachment 43535 [details]
Screenshot with wrong behaviour and additional misplaced icons on the clock
Comment 3 Jonathan 2010-05-13 14:17:24 UTC
Created attachment 43536 [details]
Screenshot of two row system tray
Comment 4 Jonathan 2010-05-13 14:20:46 UTC
I can approve this bug. I added two additional screenshots which show the wrong behaviour. The screenshots are from two different computers both running KDE 4.4.3. I first saw this with KDE 4.4.0, it worked well with 4.4.x.

In the first screenshot (attachment (id=43535)) there are also some of the system tray icons misplaced which appear on the clock. This might be related to this bug.
Comment 5 Thorsten Staerk 2010-05-14 19:27:10 UTC
Thank you for the report. I am on a trip and cannot try to reproduce. Will be back in june. Any patch is appreciated.
Comment 6 Dr. Faust 2010-09-16 20:07:20 UTC
Created attachment 51728 [details]
systemtray and ktimetracker
Comment 7 Dr. Faust 2010-09-16 20:08:44 UTC
Comment on attachment 51728 [details]
systemtray and ktimetracker

I confirm this bug on FreeBSD 8.1 & KDE 4.4.5
Comment 8 Dr. Faust 2010-09-16 20:09:52 UTC
Comment on attachment 51728 [details]
systemtray and ktimetracker

I confirm this bug on FreeBSD 8.1 & KDE 4.4.5
Comment 9 Andrey Starkin 2010-09-17 10:44:51 UTC
I confirm on Gentoo amd64 & KDE-4.5.1
Comment 10 Sergei Andreev 2010-11-19 21:08:34 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 Simon Yuan 2011-01-28 03:10:41 UTC
Created attachment 56551 [details]
Screenshot of the system tray

This attachment shows the icons are not rendered at the correct places.
Comment 12 Simon Yuan 2011-01-28 03:14:19 UTC
Just want to add that this bug (shown in the attached screenshot) was observed on Arch Linux i686 using KDE SC 4.6.0.

Notice Skype's system tray icon is rendered out of place, and there's a gap in the extender as well. The gap appeared after quiting kmix, restarting kmix doesn't remove the gap.
Comment 13 Christoph Feck 2011-04-23 20:03:37 UTC
*** Bug 271216 has been marked as a duplicate of this bug. ***
Comment 14 Erik Boritsch 2011-05-07 10:27:08 UTC
KDE SC 4.6.2 on Kubuntu 11.04, confirming this bug. There are two instances of ktimetracker in the tray.
Comment 15 Anton 2011-06-02 20:24:01 UTC
I have the same setup as Comment #14: KDE 4.6.2 (Kubuntu 11.04). I can also confirm this bug. 

It is unchanged from KDE 4.4.2 (Mint 9).
Comment 16 thomi_ch 2011-06-29 06:33:32 UTC
Hey all that are affected

Won't this bug be fixed? Will be nice to have correct systray icons ;)

thanks
thomi
Comment 17 Aitor 2011-07-12 16:01:36 UTC
Still in KTimeTracker 4.6.90
Comment 18 Aitor 2011-07-12 16:02:46 UTC
Created attachment 61815 [details]
In a vertical layout is clear that there are two entries
Comment 19 Thorsten Staerk 2011-09-20 11:15:05 UTC
Preliminary patch, needs to be tested, cleaned and refined:
diff --git a/ktimetracker/ktimetrackerpart.cpp b/ktimetracker/ktimetrackerpart.cpp
index f466370..45c856d 100644
--- a/ktimetracker/ktimetrackerpart.cpp
+++ b/ktimetracker/ktimetrackerpart.cpp
@@ -97,8 +97,6 @@ bool ktimetrackerpart::openFile(QString icsfile)
 {
     mMainWidget->openFile(icsfile);
     emit setWindowCaption(icsfile);
-    if ( KTimeTrackerSettings::trayIcon() ) mTray = new TrayIcon( this );
-    else mTray = new TrayIcon( );
 
     // connections
     connect( mMainWidget, SIGNAL(totalTimesChanged(long,long)),
@@ -107,11 +105,6 @@ bool ktimetrackerpart::openFile(QString icsfile)
            this, SLOT(setStatusBar(QString)) );
     connect( mMainWidget, SIGNAL(setCaption(QString)),
            this, SIGNAL(setWindowCaption(QString)) );
-    connect( mTray, SIGNAL(quitSelected()), SLOT(quit()) );
-    connect( mMainWidget, SIGNAL(timersActive()), mTray, SLOT(startClock()) );
-    connect( mMainWidget, SIGNAL(timersInactive()), mTray, SLOT(stopClock()) );
-    connect( mMainWidget, SIGNAL(tasksChanged(QList<Task*>)),
-           mTray, SLOT(updateToolTip(QList<Task*>)));
     return true;
 }
 
diff --git a/ktimetracker/ktimetrackerpart.h b/ktimetracker/ktimetrackerpart.h
index 1b308df..dff0654 100644
--- a/ktimetracker/ktimetrackerpart.h
+++ b/ktimetracker/ktimetrackerpart.h
@@ -44,7 +44,6 @@ class ktimetrackerpart : public KParts::ReadWritePart
 
   private:
     void               makeMenus();
-    TrayIcon          *mTray;
     TimetrackerWidget *mMainWidget;
Comment 20 Thorsten Staerk 2011-09-20 11:16:19 UTC
No more screenshots, please! It is clear that this is a bug and should be fixed. Please provide patches instead of screenshots :)
Comment 21 Thorsten Staerk 2011-09-20 11:25:36 UTC
Fixed. The problem was that we wanted 
(a) a standalone application ktimetracker
(b) a kontact plugin for ktimetracker

So we created a kpart (that created a trayicon) and the mainwindow (in the standalone application) continued to create a trayicon -> two trayicons were created for the standalone application.

Also, quitting via the menu item "quit" works now.
Comment 22 Thorsten Staerk 2011-09-20 13:15:41 UTC
Never closed a 217 votes bug on ktimetracker before. People, please test :)
Comment 24 Thorsten Staerk 2011-10-09 15:32:57 UTC
Git commit ff4ab352188edddd55baa8e2f7dfa26d1dc530ed by Thorsten Staerk.
Committed on 09/10/2011 at 17:31.
Pushed by tstaerk into branch 'KDE/4.7'.

Only display icon in system tray once. Backport from master.
BUGS:236566

M  +0    -7    ktimetracker/ktimetrackerpart.cpp

http://commits.kde.org/kdepim/ff4ab352188edddd55baa8e2f7dfa26d1dc530ed