Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AppEngine::readTasklistFromFile(QString filename)
- {
- tasklist.clear();
- filename = ( filename == "" ? "tasklist_db.txt" : filename );
- QFile tasklistDB( filename );
- tasklistDB.open(QIODevice::ReadOnly);
- QTextStream textStream( &tasklistDB );
- while( !textStream.atEnd() )
- {
- int ID = textStream.readLine().trimmed().toInt();
- QString dateOfCreation = textStream.readLine();
- QString dateTaskFinished = textStream.readLine();
- QString name = textStream.readLine();
- QString content = textStream.readLine();
- bool done = ( textStream.readLine().trimmed() == "1" ? true : false );
- int priority = textStream.readLine().trimmed().toInt();
- tasklist.add( Task( ID, dateOfCreation, dateTaskFinished,
- name, content, done, priority ) );
- }
- tasklistDB.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement