- Timestamp:
- 09/05/12 21:30:08 (10 years ago)
- Branches:
- master, qt5
- Children:
- a8f8b5d
- Parents:
- 1f12b6b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sql/sqlengine.cpp
r1f12b6b r9b5a80ff 47 47 48 48 void SqlEngine::open() { 49 // we may have to create the directory of the database 49 50 QFileInfo dbFilenameInfo(dbFilename); 50 dbFilenameInfo.absoluteDir().mkpath("."); // TODO: handle error 51 52 // First possibility (works with Linux, not tested on Windows: 53 // QDir cwd; 54 // cwd.mkpath(dbFilenameInfo.absolutePath()); 55 56 // Second possibility (works on Windows) 57 dbFilenameInfo.absoluteDir().mkpath("."); 58 59 // We don't have to handle errors because in worst case, opening the database will fail 60 // and db.isOpen() returns false. 51 61 db = QSqlDatabase::addDatabase("QSQLITE"); 52 62 db.setDatabaseName(dbFilename);
Note: See TracChangeset
for help on using the changeset viewer.