MCPcopy Create free account
hub / github.com/Tencent/libpag / getOutputPath

Method getOutputPath

exporter/src/ui/export/ExportWindow.cpp:62–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62std::string ExportWindow::getOutputPath() {
63 if (itemHandle == nullptr) {
64 return "";
65 }
66 std::string itemName = GetItemName(itemHandle) + ".pag";
67
68 QDir dir(GetProjectPath());
69 QString defaultPath = dir.filePath(itemName.data());
70 QFileDialog dialog(QApplication::topLevelWidgets().value(0), QObject::tr("Select Storage Path"),
71 defaultPath);
72 dialog.setAcceptMode(QFileDialog::AcceptSave);
73 dialog.setDefaultSuffix("pag");
74
75 if (dialog.exec() == QDialog::Accepted) {
76 QStringList selectedFiles = dialog.selectedFiles();
77 if (!selectedFiles.isEmpty()) {
78 return selectedFiles.first().toStdString();
79 }
80 }
81
82 return "";
83}
84
85void ExportWindow::init() {
86 if (QThread::currentThread() != app->thread()) {

Callers

nothing calls this directly

Calls 6

GetItemNameFunction · 0.85
GetProjectPathFunction · 0.85
valueMethod · 0.80
execMethod · 0.80
dataMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected