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

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

Read the descriptions from a file into the descList.

Parameters:
fileName the file containing the descriptions
descList put the descriptions in this list
Returns:
true in case of success, false otherwise

Definition at line 1082 of file kalleryfunctions.cpp.

References OptionType::Description::comment, and mainWidget.

Referenced by openProject(), and DescSourcePage::slotLoadDescriptions().

{
  QFile inFile(fileName.latin1());
  QString tmpString;

  if (!inFile.open(IO_ReadOnly))
  {
    KMessageBox::error(mainWidget,i18n("Cannot open the description file %1 for reading.").arg(fileName),i18n("Input/Output error"));
    return false;
  }

  descList.clear();
  QTextStream in(&inFile);
  in.setEncoding(QTextStream::UnicodeUTF8);

  while (! in.atEnd())
  {
    tmpString = in.readLine();
    tmpString.replace(QRegExp("<br>"),"\n");
    OptionType::Description desc;
    desc.comment = tmpString;
    descList.append(desc);
  }
  inFile.close();

  return true;
}


Generated by  Doxygen 1.6.0   Back to index