| 286 | } |
| 287 | |
| 288 | void ProjectCore::openProject() |
| 289 | { |
| 290 | QString iniPath = CustomPaths::user(CustomPaths::Flags::Configures) |
| 291 | + QDir::separator() + QString("project_record.support"); |
| 292 | QSettings setting(iniPath, QSettings::IniFormat); |
| 293 | QString lastPath = setting.value("recent_open_project").toString(); |
| 294 | |
| 295 | QFileDialog fileDialog; |
| 296 | fileDialog.setFileMode(QFileDialog::Directory); |
| 297 | fileDialog.setOption(QFileDialog::DontResolveSymlinks); |
| 298 | fileDialog.setWindowTitle(QFileDialog::tr("Open Project Directory")); |
| 299 | fileDialog.setDirectory(lastPath); |
| 300 | fileDialog.setWindowFlags(fileDialog.windowFlags() | Qt::WindowStaysOnTopHint); |
| 301 | if (fileDialog.exec() != QDialog::Accepted) |
| 302 | return; |
| 303 | QString projectPath = fileDialog.selectedUrls().first().path(); |
| 304 | confirmProjectKit(projectPath); |
| 305 | setting.setValue("recent_open_project", projectPath); // save open history |
| 306 | } |
| 307 | |
| 308 | void ProjectCore::confirmProjectKit(const QString &path) |
| 309 | { |
no test coverage detected