MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / previewFile

Method previewFile

src/organizercore.cpp:1142–1162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1140}
1141
1142bool OrganizerCore::previewFile(QWidget* parent, const QString& originName,
1143 const QString& path)
1144{
1145 if (!QFile::exists(path)) {
1146 reportError(tr("File '%1' not found.").arg(path));
1147 return false;
1148 }
1149
1150 PreviewDialog preview(path, parent);
1151
1152 QWidget* wid = m_PluginContainer->previewGenerator().genPreview(path);
1153 if (wid == nullptr) {
1154 reportError(tr("Failed to generate preview for %1").arg(path));
1155 return false;
1156 }
1157
1158 preview.addVariant(originName, wid);
1159 preview.exec();
1160
1161 return true;
1162}
1163
1164boost::signals2::connection OrganizerCore::onAboutToRun(
1165 const std::function<bool(const QString&, const QDir&, const QString&)>& func)

Callers 1

onPreviewMethod · 0.80

Calls 3

genPreviewMethod · 0.80
addVariantMethod · 0.80
execMethod · 0.45

Tested by

no test coverage detected