diff --git a/shell/main.cpp b/shell/main.cpp index 9f196755e..29e6cbc52 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -53,7 +53,7 @@ int main(int argc, char** argv) KApplication app; // see if we are starting with session management - if (app.isRestored()) + if (app.isSessionRestored()) { RESTORE(oKular::Shell); } else { diff --git a/shell/shell.cpp b/shell/shell.cpp index b46a36c53..b87ee3e13 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,7 @@ Shell::Shell() init(); } -Shell::Shell(const KURL &url) +Shell::Shell(const KUrl &url) : KParts::MainWindow(0, "oKular::Shell"), m_menuBarWasShown(true), m_toolBarWasShown(true) { m_openUrl = url; @@ -92,7 +93,7 @@ void Shell::init() m_part = 0; return; } - connect( this, SIGNAL( restoreDocument(const KURL &, int) ),m_part, SLOT( restoreDocument(const KURL &, int))); + connect( this, SIGNAL( restoreDocument(const KUrl &, int) ),m_part, SLOT( restoreDocument(const KUrl &, int))); connect( this, SIGNAL( saveDocumentRestoreInfo(KConfig*) ), m_part, SLOT( saveDocumentRestoreInfo(KConfig*))); connect( m_part, SIGNAL( enablePrintAction(bool) ), m_printAction, SLOT( setEnabled(bool))); @@ -120,7 +121,7 @@ Shell::~Shell() if ( m_tempfile ) delete m_tempfile; } -void Shell::openURL( const KURL & url ) +void Shell::openURL( const KUrl & url ) { if ( m_part ) { @@ -154,7 +155,7 @@ void Shell::writeSettings() void Shell::setupActions() { KAction * openAction = KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - m_recent = KStdAction::openRecent( this, SLOT( openURL( const KURL& ) ), actionCollection() ); + m_recent = KStdAction::openRecent( this, SLOT( openURL( const KUrl& ) ), actionCollection() ); connect( m_recent, SIGNAL( activated() ), openAction, SLOT( activate() ) ); m_recent->setWhatsThis( i18n( "Click to open a file or Click and hold to select a recent file" ) ); m_printAction = KStdAction::print( m_part, SLOT( slotPrint() ), actionCollection() ); @@ -184,7 +185,7 @@ void Shell::readProperties(KConfig* config) // in 'saveProperties' if(m_part) { - KURL url ( config->readPathEntry( "URL" ) ); + KUrl url ( config->readPathEntry( "URL" ) ); if ( url.isValid() ) emit restoreDocument(url, config->readNumEntry( "Page", 1 )); } } @@ -249,7 +250,7 @@ QStringList* Shell::fileFormats() } -bool Shell::handleCompressed(KURL & url, const QString &path, const KMimeType::Ptr mimetype) +bool Shell::handleCompressed(KUrl & url, const QString &path, const KMimeType::Ptr mimetype) { // we are working with a compressed file, decompressing @@ -343,7 +344,7 @@ void Shell::fileOpen() if (m_fileformats) { - KURL url = KFileDialog::getOpenURL( QString::null, m_fileformats->join("\n") );//getOpenFileName(); + KUrl url = KFileDialog::getOpenURL( QString::null, m_fileformats->join("\n") );//getOpenFileName(); bool reallyOpen=!url.isEmpty(); if (reallyOpen) { diff --git a/shell/shell.h b/shell/shell.h index 63b86520b..de5a453d3 100644 --- a/shell/shell.h +++ b/shell/shell.h @@ -48,7 +48,7 @@ class Part; /** * Open an url */ - Shell(const KURL &url); + Shell(const KUrl &url); /** * Default Destructor @@ -82,18 +82,18 @@ class Part; void slotUpdateFullScreen(); void slotShowMenubar(); - void openURL( const KURL & url ); + void openURL( const KUrl & url ); void delayedOpen(); signals: - void restoreDocument(const KURL &url, int page); + void restoreDocument(const KUrl &url, int page); void saveDocumentRestoreInfo(KConfig* config); private: void setupAccel(); void setupActions(); void init(); - bool handleCompressed(KURL & url, const QString &path, const KMimeType::Ptr mimetype); + bool handleCompressed(KUrl & url, const QString &path, const KMimeType::Ptr mimetype); QStringList* fileFormats(); private: @@ -106,7 +106,7 @@ class Part; KToggleAction* m_showMenuBarAction; KToggleAction* m_showToolBarAction; bool m_menuBarWasShown, m_toolBarWasShown; - KURL m_openUrl; + KUrl m_openUrl; }; }