Add my name

Fix readSettings

svn path=/trunk/kdegraphics/kpdf/; revision=251067
remotes/origin/kpdf-3.2
Laurent Montel 23 years ago
parent e4241f84bc
commit 5c58b57682
  1. 16
      kpdf/kpdf_shell.cpp
  2. 1
      kpdf/kpdf_shell.h
  3. 4
      kpdf/main.cpp

@ -16,6 +16,7 @@
#include <kstatusbar.h>
#include <kstdaction.h>
#include <kurl.h>
#include <kdebug.h>
using namespace KPDF;
@ -92,7 +93,7 @@ Shell::setupActions()
recent = KStdAction::openRecent( this, SLOT( openURL( const KURL& ) ),
actionCollection() );
KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
KStdAction::quit(kapp, SLOT(quit()), actionCollection());
KStdAction::quit( this, SLOT(slotQuit()), actionCollection());
//createStandardStatusBarAction();
setStandardToolBarMenuEnabled(true);
@ -102,20 +103,23 @@ Shell::setupActions()
}
void
Shell::saveProperties(KConfig* /*config*/)
Shell::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
config->writePathEntry( "URL", m_part->url().prettyURL() );
}
void
Shell::readProperties(KConfig* /*config*/)
void Shell::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'
KURL url = config->readPathEntry( "URL" );
if ( url.isValid() )
openURL( url );
}
void
@ -165,4 +169,8 @@ Shell::applyNewToolbarConfig()
applyMainWindowSettings(KGlobal::config(), "MainWindow");
}
void Shell::slotQuit()
{
kapp->closeAllWindows();
}
// vim:ts=2:sw=2:tw=78:et

@ -56,6 +56,7 @@ namespace KPDF
void optionsConfigureKeys();
void optionsConfigureToolbars();
void slotQuit();
void applyNewToolbarConfig();
public slots:

@ -12,7 +12,7 @@ static const char* version = "v0.3";
static KCmdLineOptions options[] =
{
{ "+[URL]", I18N_NOOP("Document to open."), 0 },
{ 0, 0, 0 }
KCmdLineLastOption
};
int main(int argc, char** argv)
@ -30,7 +30,7 @@ int main(int argc, char** argv)
about.addAuthor("Wilco Greven", 0, "greven@kde.org");
about.addAuthor("Christophe Devriese", 0, "oelewapperke@oelewapperke.org");
about.addAuthor("Laurent Montel", 0, "montel@kde.org");
KCmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions( options );

Loading…
Cancel
Save