/// Loads data for testing the 'testFileName' file. void loadTestFileData(const char* testFileName) { fileName = getTestFileFullPath(SAMPLE_FILES_DIR, testFileName); const char* fileContent = loadTestFile(SAMPLE_FILES_DIR, testFileName, true); // must be binary mode! int fileSize = (int)fgetsize(fileName.c_str()); const WCHAR* wtestFileName = toWideChar(testFileName); FileData fileData; fileData.setName(wtestFileName); fileData.setSize(fileSize); fileData.setBody(fileContent, fileSize); unsigned long tstamp = getFileModTime(fileName); StringBuffer modTime = unixTimeToString(tstamp, true); // file's mod time is already in UTC WString wmodTime; wmodTime = modTime; fileData.setModified(wmodTime); fileDataContent = fileData.format(); fileDataSize = (int)strlen(fileDataContent); delete [] wtestFileName; delete [] fileContent; }
char* LOSyncSource::getNewCard(bool isAdd) { int suffix = (isAdd ? count : count+2); StringBuffer filetest; if (useSif) { filetest.sprintf("sif%i.txt", suffix); } else { filetest.sprintf("vcard%i.txt", suffix); } char* card = loadTestFile("LOItemTest", filetest.c_str(), true); count++; return card; }
void KMilion::setupActions() { //akcja uruchomienia gry KAction* runAction = new KAction(this); runAction->setText(i18n("&Run Quiz")); runAction->setIcon(KIcon("system-run")); runAction->setShortcut(Qt::CTRL + Qt::Key_R); actionCollection()->addAction("run", runAction); connect(runAction, SIGNAL(triggered(bool)), this, SLOT(runGame())); // KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection()); KStandardAction::open(editorWidget,SLOT(loadTestFile()),actionCollection()); KStandardAction::save(editorWidget,SLOT(saveTestFileOld()),actionCollection()); KStandardAction::saveAs(editorWidget,SLOT(saveTestFileNew()),actionCollection()); KStandardAction::openNew(editorWidget, SLOT(createTestFileNew()), actionCollection()); }
SoundMixer::SoundMixer(std::string resPath) { init(); loadTestFile(resPath); }