Close any current connection and switch back to using the saved
| 609 | |
| 610 | // Close any current connection and switch back to using the saved |
| 611 | void ProjectFileIO::RestoreConnection() |
| 612 | { |
| 613 | auto &curConn = CurrConn(); |
| 614 | if (curConn) |
| 615 | { |
| 616 | if (!curConn->Close()) |
| 617 | { |
| 618 | // Store an error message |
| 619 | SetDBError( |
| 620 | XO("Failed to restore connection") |
| 621 | ); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | curConn = std::move(mPrevConn); |
| 626 | SetFileName(mPrevFileName); |
| 627 | mTemporary = mPrevTemporary; |
| 628 | |
| 629 | mPrevFileName.clear(); |
| 630 | } |
| 631 | |
| 632 | void ProjectFileIO::UseConnection(Connection &&conn, const FilePath &filePath) |
| 633 | { |
no test coverage detected