Summary: | no mainWindow restore on exec kopete | ||
---|---|---|---|
Product: | [Applications] kopete | Reporter: | Kees van Wijk <cvanwijk> |
Component: | general | Assignee: | Kopete Developers <kopete-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Kees van Wijk
2004-02-28 00:22:59 UTC
working on it! (or as lilachaze would say, "Mine!") CVS commit by mattr: Fix bug 76323. Restore the window when attempting to run a second instance of kopete. [BACKPORT] CCMAIL: 76323-done@bugs.kde.org M +22 -0 kopete.cpp 1.170.2.2 M +2 -0 kopete.h 1.81.2.1 --- kdenetwork/kopete/kopete/kopete.cpp #1.170.2.1:1.170.2.2 @@ -216,4 +216,26 @@ void Kopete::slotAllPluginsLoaded() } +int Kopete::newInstance() +{ + kdDebug(14000) << k_funcinfo << endl; + + /** The following three lines work around the problem that + * Kopete has multiple main windows, so qapp->mainWidget() + * returns 0, which breaks the normal + * KUniqueApplication::newInstance() that raises the window + * when we run a new instance. + * + * 1. Set the main widget to the contact list window + * 2. Call KUniqueApplication::newInstance() + * 3. Set the main widget back to 0 + */ + + setMainWidget( m_mainWindow ); + int kUniqAppReturnCode = KUniqueApplication::newInstance(); + setMainWidget( 0L ); + + return kUniqAppReturnCode; +} + void Kopete::quitKopete() { --- kdenetwork/kopete/kopete/kopete.h #1.81:1.81.2.1 @@ -49,4 +49,6 @@ public: bool isShuttingDown() const { return m_isShuttingDown; } + virtual int newInstance(); + public slots: /** |