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

void Kconfigure::slotLogSave (  )  [private, slot]

Log options

Definition at line 244 of file kconfigure.cpp.

References filePath, logHtml, and logString.

Referenced by setupMenuBar().

{
      KConfig *config = KGlobal::config();
      QString filter;
      QString initDir = filePath;

      if( logString.isEmpty() || logString == QString::null )
            {
            KMessageBox::sorry(this, i18n("The log is empty.\n\nYou must start the log"), i18n("Sorry"), false);
            return;
            }

      if( config->readBoolEntry( "Log in dir", false ) )
            {
            initDir = config->readEntry( "Directory", "" );
            }

      if( logHtml )
            filter = "*.html,*.HTML|"+i18n("HTML Source");
      else
            filter = "*";

      QString fileSave =  KFileDialog::getSaveFileName( initDir, filter, 0,  i18n("Save log file") );

      if( !fileSave.isEmpty() )
      {
            QFile file( fileSave );
            if ( file.open( IO_WriteOnly ) )
            {
                  QTextStream stream(&file);
                  stream << logString;
                  file.close();
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index