| 419 | } |
| 420 | |
| 421 | void MainWindow::setFilePath(QString path, bool updateBinder) |
| 422 | { |
| 423 | if (QFile::exists(path)) |
| 424 | path = QFileInfo(path).canonicalFilePath(); |
| 425 | LOG_INFO(INFO_OF(path)); |
| 426 | if (filePath == path) |
| 427 | { |
| 428 | updateWatcher(); |
| 429 | return; |
| 430 | } |
| 431 | filePath = path; |
| 432 | if (updateBinder) |
| 433 | FileProblemBinder::set(path, problemURL); |
| 434 | if (!isUntitled()) |
| 435 | { |
| 436 | auto recentFiles = SettingsHelper::getRecentFiles(); |
| 437 | recentFiles.removeAll(filePath); |
| 438 | recentFiles.push_front(filePath); |
| 439 | if (recentFiles.length() > MAX_NUMBER_OF_RECENT_FILES) |
| 440 | recentFiles.erase(recentFiles.begin() + MAX_NUMBER_OF_RECENT_FILES, recentFiles.end()); |
| 441 | SettingsHelper::setRecentFiles(recentFiles); |
| 442 | |
| 443 | emit requestUpdateLanguageServerFilePath(this, path); |
| 444 | } |
| 445 | emit editorFileChanged(); |
| 446 | updateWatcher(); |
| 447 | } |
| 448 | |
| 449 | void MainWindow::setProblemURL(const QString &url) |
| 450 | { |
nothing calls this directly
no outgoing calls
no test coverage detected