Komics is a KUniqueApplication so it does not need a lock file to prevent the user from opening a new instance of it. When the app closes in a abd way (for example due to an X crash) it doesn't delete the lock file and tells the user to manually delete it instead of checking if the pid that owns the lock is already running. Trying to correct that I found that Komics was a KUniqueApplication and thus didn't need the lock file. It needed a few changes to work. I made those changes reading the KDE api. If the changes don't work for you let me know.
Created attachment 92223 [details, diff] No lock file usage patch
Comment on attachment 92223 [details, diff] No lock file usage patch >--- komics/src/main.cpp.orig 2004-10-10 13:54:07.000000000 -0300 >+++ komics/src/main.cpp 2006-07-19 14:12:37.000000000 -0300 >@@ -23,19 +23,22 @@ > I18N_NOOP(__comment), KAboutData::License_GPL_V2, > "(C) 2003 Natella Roberto", 0, "roberto.natella@virgilio.it" ); > >- about.addAuthor("Roberto Natella", 0, >- "roberto.natella@virgilio.it", "http://www.orson.it/" ); >+ about.addAuthor("Roberto Natella", 0, >+ "roberto.natella@virgilio.it", "http://www.orson.it/" ); > >- KCmdLineArgs::init( argc, argv, &about); >+ KCmdLineArgs::init( argc, argv, &about); > >- KApplication::disableAutoDcopRegistration(); >+ KApplication::disableAutoDcopRegistration(); >+ >+ if (!KUniqueApplication::start()) { >+ fprintf(stderr, i18n( QString("Unable to start the application. Another instance was already started.") )); >+ exit(0); >+ } > KUniqueApplication app; > >- if( !Komics::lock() ) >- return -1; > > Komics * komics = new Komics(0,new KConfig("libkomicsrc")); >- >+ > if( komics == NULL ) > return -1; > >@@ -46,8 +49,6 @@ > int ret = app.exec(); > delete komics; > >- Komics::unlock(); >- > return ret; > } > >--- komics/src/komics.cpp.orig 2004-10-10 17:14:19.000000000 -0300 >+++ komics/src/komics.cpp 2006-07-19 14:12:17.000000000 -0300 >@@ -1314,7 +1314,7 @@ > > return url; > } >- >+/* > bool Komics::lock() > { > QString lock = locateLocal("data", "komics/lock"); >@@ -1344,11 +1344,10 @@ > > return true; > } >- >+*/ > void Komics::shutDown() > { > writeHistory(); >- unlock(); > } > > KomicsApplet::KomicsApplet(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) >@@ -1394,17 +1393,17 @@ > { > KPanelApplet* init( QWidget *parent, const QString configFile ) > { >- >+/* > if(!Komics::lock()) > { > return 0; > } > else >- { >+ {*/ > KGlobal::locale()->insertCatalogue("Komics"); > return new KomicsApplet(configFile, KPanelApplet::Normal, > KPanelApplet::About | KPanelApplet::Preferences, > parent, "Komics"); >- } >+/* }*/ > } > }
Created attachment 92224 [details, diff] No lock file usage patch I sen't a wrong diff file. I'm sorry.
This problem has to be reported upstream, as this is not a Gentoo issue by itself. Please also consider for your future contributions to avoid changing stylistic bits when patching (indentation) as that makes the patch bigger and changes harder to evaluate.
(In reply to comment #4) > This problem has to be reported upstream, as this is not a Gentoo issue by > itself. Please also consider for your future contributions to avoid changing > stylistic bits when patching (indentation) as that makes the patch bigger and > changes harder to evaluate. > ack