MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / slotExport

Method slotExport

App/Client/Recent/FrmRecent.cpp:597–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597void CFrmRecent::slotExport()
598{
599 QString filename = QFileDialog::getSaveFileName(
600 this, tr("Export recent"),
601 RabbitCommon::CDir::Instance()->GetDirUserDocument(),
602 tr("JSON (*.json)"));
603
604 if (!filename.isEmpty()) {
605 QFileInfo fi(filename);
606 if(0 == fi.suffix().compare("json", Qt::CaseInsensitive)) {
607 if (m_Database.ExportToJsonFile(filename)) {
608 QMessageBox::information(
609 this, tr("Success"),
610 tr("Successfully exported recent to json file"));
611 } else {
612 QString szErr = tr("Failed to export recent to json file: %1").arg(filename) + "\n";
613 if(!m_Database.GetError().isEmpty())
614 szErr += "\n" + tr("Error: ") + m_Database.GetError();
615 QMessageBox::critical(this, tr("Failure"), szErr);
616 }
617 return;
618 }
619 }
620}
621
622void CFrmRecent::InitialDrop()
623{

Callers

nothing calls this directly

Calls 3

ExportToJsonFileMethod · 0.80
GetErrorMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected