Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some improvements #17

Merged
merged 3 commits into from
Jul 3, 2013
Merged

Commits on Sep 2, 2012

  1. Configuration menu
    Copy the full SHA
    b31aa53 View commit details
    Browse the repository at this point in the history
  2. Make preview generation more robust; stop previewing binary files.

    * Check candidate files with file(1) to decide whether they are text or binary, and to determine their encoding.
    * Upgrade to ARC (note this drops support for 10.6 32-bit and below)
    * Use QLPreviewSetURLRepresentation() instead of reading the entire file (!) with -[stringWithContentsOfURL].
    * Add extra compiler warning flags
    
    Note that the inclusion of BSD licensed RegexKitLite will require a credit.
    nickhutchinson committed Sep 2, 2012
    Configuration menu
    Copy the full SHA
    c1369b3 View commit details
    Browse the repository at this point in the history
  3. Add support for thumbnail generation.

    According to the (awful) documentation in the QuickLook header files, for this to work the QLNeedsToBeRunInMainThread Info.plist key has to be set to true.
    
    Thumbnails are badged according to the following heuristic:
    - If the file has an extension of < 10 characters, use that.
    - If the file has a well-known MIME type (determined by file(1)), look up its corresponding badge string and use that.
    - If the file has no extension, but a well-known filename (e.g. "Makefile"), look up its corresponding badge string and use that.
    - Is the file executable? If so, assume it's a script, and badge it with "SCRIPT".
    - Otherwise, badge it with "TEXT".
    
    This heuristic could probably be improved. Currently the mappings of well-known filenames and MIME-types to badge strings are hard-coded in GenerateThumbnailForURL.m. Perhaps these should be moved into an external plist.
    nickhutchinson committed Sep 2, 2012
    Configuration menu
    Copy the full SHA
    c6cf191 View commit details
    Browse the repository at this point in the history