rem: app.connect( &app, SIGNAL( saveYourself() ), a, SLOT( slotSaveNotes() ) ); app.connect( &app, SIGNAL( shutDown() ), a, SLOT( slotSaveNotes() ) );
context: int main( int argc, char* argv[] ){    KAboutData aboutData( "knotes", I18N_NOOP("KNotes"),        I18N_NOOP( KNOTES_VERSION ), I18N_NOOP( "KDE Notes" ), KAboutData::License_GPL,        I18N_NOOP("(c) 1997-2001, The KNotes Developers") );    aboutData.addAuthor("Michael Brade", "Maintainer", "brade@informatik.uni-muenchen.de");    aboutData.addAuthor("Bernd Johannes Wuebben", "Original KNotes Author", "wuebben@kde.org");    aboutData.addAuthor("Wynn Wilkes", "Ported KNotes to KDE 2", "wynnw@calderasystems.com");    aboutData.addAuthor("Matthias Ettrich",0, "ettrich@kde.org");    aboutData.addAuthor("Didier Belot",0, "dib@avo.fr");    aboutData.addAuthor("Harri Porten",0, "porten@kde.org");    aboutData.addAuthor("David Faure",0, "faure@kde.org");    aboutData.addAuthor("Dirk A. Mueller",0, "dmuell@gmx.net");    aboutData.addAuthor("Petter Reinholdtsen",0, "pere@td.org.uit.no");    aboutData.addAuthor("Carsten Pfeiffer",0, "pfeiffer@kde.org");    aboutData.addAuthor("Espen Sand",0, "espen@kde.org");    KCmdLineArgs::init( argc, argv, &aboutData );    KUniqueApplication::addCmdLineOptions();    // Check if unique application is already running...    if ( !KUniqueApplication::start() )    {        cerr << "KNotes is already running, exiting..." << endl;        return 1;    }    KUniqueApplication app;    KNotesApp* a = new KNotesApp();    app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );    app.connect( &app, SIGNAL( saveYourself() ), a, SLOT( slotSaveNotes() ) );    app.connect( &app, SIGNAL( shutDown() ), a, SLOT( slotSaveNotes() ) );    a->show();    int rval = app.exec();    delete a;    return rval;}