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

void KalleryFunctions::insertFile ( QString &  sourceName,
QTextStream &  destStream 
) [private]

Insert the content of sourceName file into the destStream text stream (another file).

Parameters:
sourceName the file containing the text to insert
destStream a text stream where to append the text

Definition at line 1214 of file kalleryfunctions.cpp.

References mainWidget.

Referenced by createHtmls().

{  
  QString tmpString;

  if (sourceName.isEmpty())
    return;
  QFile sourceFile(sourceName);
  if (!sourceFile.open(IO_ReadOnly))
  {
    KMessageBox::error(mainWidget,i18n("Cannot open the file %1 for reading.").arg(sourceName),i18n("Input/Output error"));
    return;
  }
  QTextStream sourceStream(&sourceFile);
  sourceStream.setEncoding(QTextStream::UnicodeUTF8);

  while (! sourceStream.atEnd())
  {
    tmpString = sourceStream.readLine() + "\n";
    destStream << tmpString;
  }

  sourceFile.close();
}


Generated by  Doxygen 1.6.0   Back to index