Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

void RecentFilesAction::saveEntries (  ) 

Saves the current recent files entries to a given KConfig object. You can provide the name of the group used to load the entries. If the groupname is empty, entries are saved to a group called 'RecentFiles'

This method does not effect the active group of KConfig.

Definition at line 102 of file recentfilesaction.cpp.

Referenced by addURL().

      KConfig * config = KGlobal::config();
      QString     key;
      QString     value;
      QString     oldGroup;
      QStringList lst = items();

      oldGroup = config->group();

      config->deleteGroup( m_configGroupName, true );
      config->setGroup( m_configGroupName );

    // write file list
      for( unsigned int i = 1 ; i <= lst.count() ; i++ )
            key = QString( "File%1" ).arg( i );
            value = lst[ i - 1 ];
            config->writePathEntry( key, value );

      config->setGroup( oldGroup );

Generated by  Doxygen 1.6.0   Back to index