MCPcopy Create free account
hub / github.com/KDAB/GammaRay / saveFileLogConfig

Method saveFileLogConfig

ui/tools/messagehandler/messagehandlerwidget.cpp:231–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231void MessageHandlerWidget::saveFileLogConfig(bool all)
232{
233 QString fileName = QFileDialog::getSaveFileName(this,
234 tr("Save File"),
235 {},
236 tr("Config Files (*.ini)"));
237
238 if (!fileName.isEmpty()) {
239 QFile file(fileName);
240 if (!file.open(QFile::WriteOnly)) {
241 qWarning() << "Failed to save file" << fileName << file.errorString();
242 return;
243 }
244
245 QByteArray config;
246 auto model = ui->categoriesView->model();
247 model->metaObject()->invokeMethod(model, "exportLoggingConfig", Q_RETURN_ARG(QByteArray, config), Q_ARG(bool, all), Q_ARG(bool, true));
248 file.write(config);
249 }
250}
251
252void MessageHandlerWidget::exportModLogConfig()
253{

Callers

nothing calls this directly

Calls 6

writeMethod · 0.80
isEmptyMethod · 0.45
errorStringMethod · 0.45
modelMethod · 0.45
invokeMethodMethod · 0.45
metaObjectMethod · 0.45

Tested by

no test coverage detected