[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
committed by
Max Wilfinger
parent
c83d117386
commit
ee29d8c915
@@ -1813,22 +1813,28 @@ void MainWindow::registerQuickLookExtensions()
|
||||
// Get the path to FreeCAD.app/Contents/PlugIns
|
||||
QString appPath = QApplication::applicationDirPath();
|
||||
QString plugInsPath = appPath + "/../PlugIns";
|
||||
|
||||
|
||||
QString thumbnailExt = plugInsPath + "/FreeCADThumbnailExtension.appex";
|
||||
QString previewExt = plugInsPath + "/FreeCADPreviewExtension.appex";
|
||||
|
||||
|
||||
// Check if extensions exist before attempting registration
|
||||
if (QFileInfo::exists(thumbnailExt) && QFileInfo::exists(previewExt)) {
|
||||
// Register extensions with pluginkit
|
||||
QProcess::execute("pluginkit", QStringList() << "-a" << thumbnailExt);
|
||||
QProcess::execute("pluginkit", QStringList() << "-a" << previewExt);
|
||||
|
||||
|
||||
// Activate extensions
|
||||
QProcess::execute("pluginkit", QStringList() << "-e" << "use" << "-i" << "org.freecad.FreeCAD.quicklook.thumbnail");
|
||||
QProcess::execute("pluginkit", QStringList() << "-e" << "use" << "-i" << "org.freecad.FreeCAD.quicklook.preview");
|
||||
|
||||
QProcess::execute(
|
||||
"pluginkit",
|
||||
QStringList() << "-e" << "use" << "-i" << "org.freecad.FreeCAD.quicklook.thumbnail"
|
||||
);
|
||||
QProcess::execute(
|
||||
"pluginkit",
|
||||
QStringList() << "-e" << "use" << "-i" << "org.freecad.FreeCAD.quicklook.preview"
|
||||
);
|
||||
|
||||
quickLookRegistered = true;
|
||||
|
||||
|
||||
// Optional: Log successful registration (will appear in system notification)
|
||||
Base::Console().log("QuickLook extensions registered successfully\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user