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

bool KalleryFunctions::writeDescriptions ( const QString &  fileName,
QValueList< OptionType::Description > &  descList 
)

Write the descriptions from descList into the file.

Parameters:
fileName the target file
descList the descriptions
Returns:
true in case of success, false otherwise

Definition at line 1186 of file kalleryfunctions.cpp.

References mainWidget.

Referenced by Kallery::accept().

{
  QFile outFile(fileName.latin1()) ;
  if (!outFile.open(IO_WriteOnly))
  {
    KMessageBox::error(mainWidget,i18n("Cannot open the description file %1 for writing.").arg(fileName),i18n("Input/Output error"));    
    return false;
  }

  QTextStream out(&outFile);
  out.setEncoding(QTextStream::UnicodeUTF8);

  for (uint i =0; i < descList.count(); i++)
  {
    descList[i].comment.replace(QRegExp("\n"),"<br>");
    out << descList[i].comment << "\n";
  }

  outFile.close();

  return true;
}


Generated by  Doxygen 1.6.0   Back to index