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

List:       kde-devel
Subject:    Help - KStdAction::openRecent
From:       Jason Wood <jasonwood () blueyonder ! co ! uk>
Date:       2003-12-02 15:23:05
[Download RAW message or body]

Hi,

I am developing an application that started life as a Kdevelop 2.0 project. It 
uses the KStdAction::openRecent in order to use recent files, but it is not 
working.

Opening/saving files works as expected, and entries are added to the recent 
files menu and are persisted on exit.

The problem is that whenever the slot associated with the action 
(slotFileOpenRecent) is called, the url that it receives is always empty. I 
cannot see anything wrong with my code, but on the other hand my app is the 
only one that seems to suffer from this :-) Does anyone know what might be 
going wrong?


The action is created with the following line :

KRecentFilesAction*fileOpenRecent; 	 // member function is the main class.

fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const 
KURL&)), actionCollection());


When opening/Save As'ing a document, we do this :

fileOpenRecent->addURL( url );


I save the entries on exit like this :

fileOpenRecent->saveEntries(config,"Recent Files");


Load them back in like this :

fileOpenRecent->loadEntries(config,"Recent Files");


And the slot itself is :

void KdenliveApp::slotFileOpenRecent(const KURL& url)
{
  slotStatusMsg(i18n("Opening file..."));

  if(!saveModified())
  {
     // here saving wasn't successful
  }
  else
  {
	kdWarning() << "Opening url " << url.path() << endl;
	doc->openDocument(url);
	setCaption(url.fileName(), false);
  }

  slotStatusMsg(i18n("Ready."));
}

Cheers,
Jason

-- 
Jason Wood
Homepage : www.uchian.pwp.blueyonder.co.uk

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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