Summary: | Wish: Option To Continue When KMail detects a lock | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Ender Wiggin <ender_wiggin30> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | error snapshot |
Description
Ender Wiggin
2003-07-04 17:33:26 UTC
Or, better yet, KMail shouldn't let a lock file behind after a proper shutdown. Can you describe what happened during shutdown that make KMail let the lock file behind? Does it crash? That's the ideal scenario but I have seen KMail crash and in real life there is no real guarantee that such a thing will never happen. Hence I believe that there should be an option to remove/steal the lock and continue. I have not seen it crash, I usually turn off the machine when I choose to logout of KDE. Somehow, someway a lock gets left behind. Also I have seen the cases where KMail crashed when logging out but one cannot capture the output since computer is shutting down. and remember that we can have this situatuin even if kmail didn't crash, but whole system did for example, i've installed buggy kde32beta2 and it often leads system to kernel panic, so the next time i have to delete this lock file by myself. i'm tired of this. Created attachment 5067 [details]
error snapshot
Right. forgot the comment. I get this error after X crashes (usually after playing with wine..) If there is no running Kmail, then the lock probably should get removed. I see this problem too. The basic problem for me is, that I'm using KMail on my laptop at home and in the company. In case KMail crashes at home, the lock will stay with hostname=laptop_home. Then, next time, when I start up KDE at work, my computer gets assigned a new hostname by DHCP, and suddenly KMail thinks the remaining lock belongs to a running KMail on another host. I agree, that this bug seems only to hurt a few users (like e.g. me), but the user should be able to decide to remove the lock and continue to start up KMail. Let's see, I'll try to do a patch now... Helge CVS commit by deller: - Add possibility to delete stale lock file when KMail detects a lock (#60753) - drop QTimer::singleShot() call to newInstance() slot - singleShot() was never used and there is no "newInstance()" slot available anyway. CCMAIL: 60753-done@bugs.kde.org M +18 -10 kmstartup.cpp 1.24 M +2 -7 main.cpp 1.192 --- kdepim/kmail/kmstartup.cpp #1.23:1.24 @@ -12,5 +12,5 @@ #include <ksimpleconfig.h> #include <kstandarddirs.h> -#include <knotifyclient.h> +#include <kmessagebox.h> #include <dcopclient.h> #include <kcrash.h> @@ -121,13 +121,21 @@ void lockOrDie() { if ( !first_instance ) { - QString msg = i18n("Only one instance of KMail can be run at " - "any one time. It is already running " - "with PID %1 on host %2 according to the lock file located " - "at %3.").arg(oldPid).arg(oldHostName).arg(lockLocation); + QString msg( i18n("<qt>" + "To prevent <b>major damage to your existing mails</b> KMail has " + "been locked by another instance of KMail which seems to run " + "on host %1 with process id (PID) %2.<br><br>" + "In case you are really sure that this instance is not running any " + "longer, press <b>Continue</b> to delete the stale lock file and " + "restart KMail afterwards again.<br><br>" + "If unsure, press <b>Cancel</b>." + "</qt>").arg(oldHostName).arg(oldPid) ); - KNotifyClient::userEvent( 0, msg, KNotifyClient::Messagebox, - KNotifyClient::Error ); - fprintf(stderr, "*** KMail is already running with PID %d on host %s\n", - oldPid, oldHostName.local8Bit().data()); + if (KMessageBox::Continue == KMessageBox::warningContinueCancel(0, + msg, i18n("Warning"), KStdGuiItem::cont(), QString::null, + KMessageBox::Dangerous) ) { + // remove stale lock file entry + config.writeEntry("pid", -1); + config.sync(); + } exit(1); } --- kdepim/kmail/main.cpp #1.191:1.192 @@ -11,5 +11,4 @@ #include "kmkernel.h" //control center #include "kmail_options.h" -#include <qtimer.h> #undef Status // stupid X headers @@ -52,10 +51,6 @@ void KMailApplication::commitData(QSessi int KMailApplication::newInstance() { - if (dcopClient()->isSuspended()) - { - // Try again later. - QTimer::singleShot( 100, this, SLOT(newInstance()) ); + if (!kmkernel) return 0; - } if (!kmkernel->firstInstance() || !kapp->isRestored()) On Friday 16 April 2004 6:55 pm, Helge Deller wrote: > ------- You are receiving this mail because: ------- > You are a voter for the bug, or are watching someone who is. > > http://bugs.kde.org/show_bug.cgi?id=60753 > deller kde org changed: > > What |Removed |Added > --------------------------------------------------------------------------- >- Status|NEW |RESOLVED > Resolution| |FIXED > > > > ------- Additional Comments From deller kde org 2004-04-17 01:55 ------- > CVS commit by deller: > ... Thank you very much!! Rich Jones -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQFAgPxYv9+aDc0/W1ARAqb8AJ4jgVTZ0hh3O7oWHWrltAXfafST1ACeOE+l b3QJ6ZeIsFZA0/MacZxdA/g= =+qnE -----END PGP SIGNATURE----- |