Logo Search packages:      
Sourcecode: ktechlab version File versions

void RecentFilesAction::addURL ( const KURL &  url  ) 

Add URL to recent files list.

Parameters:
url The URL of the file

Definition at line 42 of file recentfilesaction.cpp.

References saveEntries().

Referenced by KTechlab::addRecentFile().

{
      if ( url.isLocalFile() && !KGlobal::dirs()->relativeLocation("tmp", url.path()).startsWith("/"))
            return;
      
      QString file;
      if ( url.isLocalFile() && url.ref().isNull() && url.query().isNull() )
            file = url.path();
      else
            file = url.prettyURL();
      
      QStringList lst = items();

    // remove file if already in list
      lst.remove( file );

    // remove last item if already maxitems in list
      if( lst.count() == m_maxItems )
      {
        // remove last item
            lst.remove( lst.last() );
      }

    // add file to list
      lst.prepend( file );
      setItems( lst );
      
      saveEntries();
}


Generated by  Doxygen 1.6.0   Back to index