| 1140 | } |
| 1141 | |
| 1142 | bool 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 | |
| 1164 | boost::signals2::connection OrganizerCore::onAboutToRun( |
| 1165 | const std::function<bool(const QString&, const QDir&, const QString&)>& func) |
no test coverage detected