A week ago, quicklook stopped working with .m
and .h
files. Instead, it's showing me a .m
or .h
thumbnail. I think that day a message box popped up and I didn't read it — I answered the question hastily — but I wasn't doing anything with the system. Anyway, now I've lost the quicklook for these file types.
It still works for all other default files. I tried to copy the ".qlgenerator" files from another mac, which has the same OS version… and it still didn't work.
I tried to disk verify/repair permissions, it indicated something concerning .qlgenerator files, but I thought "It's probably because of my copy-paste-replace by intruder files that probably changed some permissions". Anyway, it didn't solve the problem.
I also tried running qlmanage -r
, and restarting my mac. The problem persists.
The other mac is still showing the default way (aka, with quicklook previews) for these file types.
Any idea on what went wrong? Do you think that that message box that I answered hastily is responsible for that? I feel that it is, but I'm not sure, because I wasn't configuring the system or anything, nor even anything that is related neither to quicklook (I didn't know that this feature had a name back then) nor xcode… I'm lost.
EDIT
As @Bootle suggested, i ran
qlmanage -p FILE
and surprisingly, the Quicklook opened the file correctly, i.e. you can see the content of the file and the default XCode coloring for it.
Additionally, the following output was printed in the terminal.
So any more hints?
EDIT
New hints emerged after checking the log from the console after @StvnW 's edit.
i'm attaching the logs image after ordering quicklook on a file
UPDATE
The solution was because i was keeping older versions of XCodes since 3.6.2 ^_^ and other versions, i put all of them together in a folder where i disallowed myself the permission to access it. Thus they became inaccessible to the system too. And problem was solved, the system (or QL) fixed itself to the latest official XCode application.
But this is thanks to the below answer that gave me that hint from the debugging. I guess other people who have this same problem should follow his answer. I'm marking this response as the correct answer
Best Answer
You might consider simply using QLStephen which will add proper QuickLook support for all text files regardless of their extensions. It will also properly handle files without extensions (e.g.
README
,Makefile
). What I like about it is that you don't have to maintain a list of extensions; QLStephen detects text files automatically. QLStephen is independent of XCode and is a QL plugin that you drop into/Library/QuickLook/
or~/Library/QuickLook/
.The fact that I am also named Steven is purely coincidental.
Edit: Debugging QuickLook based on more info from OP:
Turn on QuickLook logging:
Here is some reference logging output (written to Console):
Stock Xcode installed:
Third-party generator (QLColorCode) installed:
Since things work for you when calling
qlmanage
from the command line, you might be able to compare the logs written to Console with the output from manually invoking on the command line and spot the issue. With only Xcode installed: