MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / openDatabase

Method openDatabase

app/src/Sessions/DatabaseManager.cpp:425–442  ·  view source on GitHub ↗

* @brief Prompts the user to pick a .db file from the SQLite workspace folder. */

Source from the content-addressed store, hash-verified

423 * @brief Prompts the user to pick a .db file from the SQLite workspace folder.
424 */
425void Sessions::DatabaseManager::openDatabase()
426{
427 auto* dialog = new QFileDialog(qApp->activeWindow(),
428 tr("Open Session File"),
429 Misc::WorkspaceManager::instance().path("Session Databases"),
430 tr("Session files (*.db)"));
431
432 dialog->setFileMode(QFileDialog::ExistingFile);
433 dialog->setAttribute(Qt::WA_DeleteOnClose);
434
435 connect(dialog, &QFileDialog::fileSelected, this, [this](const QString& path) {
436 if (path.isEmpty())
437 return;
438
439 QMetaObject::invokeMethod(this, [this, path]() { openDatabase(path); }, Qt::QueuedConnection);
440 });
441 dialog->open();
442}
443
444/**
445 * @brief Dispatches an asynchronous open + initial cache fetch to the worker.

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.80
activeWindowMethod · 0.45
pathMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected