/*! \fn UniversalPana::updateBrowser() */ void UniversalPana::updateBrowser(const QString& file) { if (! (QFile::exists(file) ) ) { showIntroduction(); return; } QString text; QFile f_file(file); if( f_file.open(IO_ReadOnly) ) { QTextStream stream( &f_file ); stream.setEncoding( QTextStream::UnicodeUTF8 ); QString line; while ( !stream.atEnd() ) { line = stream.readLine(); // line of text excluding '\n' text += QString("\n") + line; } f_file.close(); text=text.replace("<img id='current_box-largecover-image' ", "<img id='current_box-largecover-image' width=70 height=70 "); browser->begin(); browser->write(text); browser->end(); } else browser->openURL(file); }
bool TestExtFile::test_file() { Variant f = f_fopen("test/test_ext_file.tmp", "w"); f_fputs(f, "testing\nfile\n"); f_fclose(f); Variant items = f_file("test/test_ext_file.tmp"); VS(items, CREATE_VECTOR2("testing\n", "file\n")); return Count(true); }