Commit fd73c59b authored by Tobias Koenig's avatar Tobias Koenig

Adapt to new KMainWindow API

svn path=/trunk/playground/graphics/okular/; revision=635671
parent e950a357
......@@ -1408,22 +1408,22 @@ void Part::doPrint(KPrinter &printer)
}
void Part::restoreDocument(KConfig* config)
void Part::restoreDocument(KConfigGroup &group)
{
KUrl url ( config->readPathEntry( "URL" ) );
KUrl url ( group.readPathEntry( "URL" ) );
if ( url.isValid() )
{
QString viewport = config->readEntry( "Viewport" );
QString viewport = group.readEntry( "Viewport" );
if (!viewport.isEmpty()) m_document->setNextDocumentViewport( Okular::DocumentViewport( viewport ) );
openUrl( url );
}
}
void Part::saveDocumentRestoreInfo(KConfig* config)
void Part::saveDocumentRestoreInfo(KConfigGroup &group)
{
config->writePathEntry( "URL", url().url() );
config->writeEntry( "Viewport", m_document->viewport().toString() );
group.writePathEntry( "URL", url().url() );
group.writeEntry( "Viewport", m_document->viewport().toString() );
}
......
......@@ -32,7 +32,7 @@ class QSplitter;
class QToolBox;
class KUrl;
class KConfig;
class KConfigGroup;
class KDirWatch;
class KToggleAction;
class KToggleFullScreenAction;
......@@ -148,8 +148,8 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
public slots:
// connected to Shell action (and browserExtension), not local one
void slotPrint();
void restoreDocument(KConfig* config);
void saveDocumentRestoreInfo(KConfig* config);
void restoreDocument(KConfigGroup &group);
void saveDocumentRestoreInfo(KConfigGroup &group);
void slotFileDirty( const QString& );
void slotDoFileDirty();
void psTransformEnded();
......
......@@ -90,8 +90,8 @@ void Shell::init()
m_part = 0;
return;
}
connect( this, SIGNAL( restoreDocument(KConfig*) ),m_part, SLOT( restoreDocument(KConfig*)));
connect( this, SIGNAL( saveDocumentRestoreInfo(KConfig*) ), m_part, SLOT( saveDocumentRestoreInfo(KConfig*)));
connect( this, SIGNAL( restoreDocument(KConfigGroup&) ),m_part, SLOT( restoreDocument(KConfigGroup&)));
connect( this, SIGNAL( saveDocumentRestoreInfo(KConfigGroup&) ), m_part, SLOT( saveDocumentRestoreInfo(KConfigGroup&)));
connect( m_part, SIGNAL( enablePrintAction(bool) ), m_printAction, SLOT( setEnabled(bool)));
readSettings();
......@@ -174,15 +174,15 @@ void Shell::setupActions()
m_fullScreenAction = KStandardAction::fullScreen( this, SLOT( slotUpdateFullScreen() ), this,actionCollection() );
}
void Shell::saveProperties(KConfig* config)
void Shell::saveProperties(KConfigGroup &group)
{
// the 'config' object points to the session managed
// config file. anything you write here will be available
// later when this app is restored
emit saveDocumentRestoreInfo(config);
emit saveDocumentRestoreInfo(group);
}
void Shell::readProperties(KConfig* config)
void Shell::readProperties(KConfigGroup &group)
{
// the 'config' object points to the session managed
// config file. this function is automatically called whenever
......@@ -190,7 +190,7 @@ void Shell::readProperties(KConfig* config)
// in 'saveProperties'
if(m_part)
{
emit restoreDocument(config);
emit restoreDocument(group);
}
}
......
......@@ -55,14 +55,14 @@ protected:
* This method is called when it is time for the app to save its
* properties for session management purposes.
*/
void saveProperties(KConfig*);
void saveProperties(KConfigGroup&);
/**
* This method is called when this app is restored. The KConfig
* object points to the session management config file that was saved
* with @ref saveProperties
*/
void readProperties(KConfig*);
void readProperties(KConfigGroup&);
void readSettings();
void writeSettings();
void setFullScreen( bool );
......@@ -79,8 +79,8 @@ private slots:
void delayedOpen();
signals:
void restoreDocument(KConfig* config);
void saveDocumentRestoreInfo(KConfig* config);
void restoreDocument(KConfigGroup &group);
void saveDocumentRestoreInfo(KConfigGroup &group);
private:
void setupAccel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment