[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdegames/ksirtet/ksirtet
From:       David Faure <faure () kde ! org>
Date:       2007-06-29 22:34:27
Message-ID: 200706300034.28279.faure () kde ! org
[Download RAW message or body]

On Saturday 30 June 2007, Nicolas Roffet wrote:
> +       if ( KApplication::kApplication()->isSessionRestored() )
> +               kRestoreMainWindows<KSMainWindow>();
> +       else {
> +               KSMainWindow *mw = new KSMainWindow;
> +               mw->show();
> +       }
> +       return KApplication::kApplication()->exec();

Strange way of writing it. Surely you have kapplication instance in this block already,
so this could be written much simpler+shorter(+safer, in case it doesn't have a kapp one day) as:

+       if ( app.isSessionRestored() )
+               kRestoreMainWindows<KSMainWindow>();
+       else {
+               KSMainWindow *mw = new KSMainWindow;
+               mw->show();
+       }
+       return app.exec();


-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic