When are KMainWindow::saveProperties() and restoreProperties() called?

Kurt De Smet kurt.de.smet at skynet.be
Sat Jan 15 15:15:47 GMT 2005


Please do send kevelop related mail to me again

----- Original Message -----
From: "Richard Dale" <Richard_Dale at tipitina.demon.co.uk>
To: <kdevelop at kdevelop.org>
Sent: Saturday, January 15, 2005 2:48 PM
Subject: When are KMainWindow::saveProperties() and restoreProperties()
called?


> The KDevelop C++ KDE app framework has saveProperties() and
> restoreProperties() methods in a KMainWindow subclass to save and restore
> defaults via KConfig. But they don't seem to get called when I run a test
> app. Does anyone know how they can be enabled?
>
> -- Richard
>
> void CppTryProj::saveProperties(KConfig *config)
> {
>     // the 'config' object points to the session managed
>     // config file.  anything you write here will be available
>     // later when this app is restored
>
>     if (!m_view->currentURL().isEmpty()) {
> #if KDE_IS_VERSION(3,1,3)
>         config->writePathEntry("lastURL", m_view->currentURL());
> #else
>         config->writeEntry("lastURL", m_view->currentURL());
> #endif
>     }
> }
>
> void CppTryProj::readProperties(KConfig *config)
> {
>     // the 'config' object points to the session managed
>     // config file.  this function is automatically called whenever
>     // the app is being restored.  read in here whatever you wrote
>     // in 'saveProperties'
>
>     QString url = config->readPathEntry("lastURL");
>
>     if (!url.isEmpty())
>         m_view->openURL(KURL(url));
> }
>
> -
> to unsubscribe from this list send an email to
kdevelop-request at kdevelop.org with the following body:
> unsubscribe »your-email-address«
>
>



-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list