From 68601672bf267ea4b6531790644533575915e029 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Fri, 11 Jan 2019 16:41:45 -0500 Subject: [PATCH 1/3] fix Xcode warnings, remove (not working) copy file build phase - Updated to the recommended Xcode settings and fixed deprecations. - The build phase to copy the plugin to `~/Library/Quicklook` does not work. - Also removed the build phase to run `qlmanage`. The removed build phases will be replaced by a Makefile. --- .../project.pbxproj | 84 +++++++++++-------- .../xcschemes/QuickLookStephen.xcscheme | 2 +- 2 files changed, 50 insertions(+), 36 deletions(-) diff --git a/QuickLookStephenProject/QuickLookStephen.xcodeproj/project.pbxproj b/QuickLookStephenProject/QuickLookStephen.xcodeproj/project.pbxproj index c9bb6b8..2563579 100644 --- a/QuickLookStephenProject/QuickLookStephen.xcodeproj/project.pbxproj +++ b/QuickLookStephenProject/QuickLookStephen.xcodeproj/project.pbxproj @@ -15,25 +15,11 @@ 8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */; }; 8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D5B49A704867FD3000E48DA /* InfoPlist.strings */; }; AE02F6EB0EDDFA6400CBA17D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE02F6EA0EDDFA6400CBA17D /* Cocoa.framework */; }; - AEF4F27A0EDD58F800A55543 /* QLStephen.qlgenerator in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8D576316048677EA00EA77CD /* QLStephen.qlgenerator */; }; C86B05270671AA6E00DD9006 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C86B05260671AA6E00DD9006 /* CoreServices.framework */; }; F28CFBFD0A3EC0AF000ABFF5 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */; }; F28CFC030A3EC0C6000ABFF5 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */; }; /* End PBXBuildFile section */ -/* Begin PBXCopyFilesBuildPhase section */ - AEF4F2780EDD58D400A55543 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "~/Library/Quicklook"; - dstSubfolderSpec = 0; - files = ( - AEF4F27A0EDD58F800A55543 /* QLStephen.qlgenerator in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 0107ABFC15C76F2900C65F1A /* QLSFileAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLSFileAttributes.h; sourceTree = ""; }; 0107ABFD15C76F2900C65F1A /* QLSFileAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = QLSFileAttributes.m; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; @@ -131,8 +117,6 @@ 8D57630F048677EA00EA77CD /* Resources */, 8D576311048677EA00EA77CD /* Sources */, 8D576313048677EA00EA77CD /* Frameworks */, - AEF4F2780EDD58D400A55543 /* CopyFiles */, - 698210201CC62DD000504BBF /* ShellScript */, ); buildRules = ( ); @@ -150,7 +134,7 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0730; + LastUpgradeCheck = 1010; }; buildConfigurationList = 2CA326220896AD4900168862 /* Build configuration list for PBXProject "QuickLookStephen" */; compatibilityVersion = "Xcode 3.2"; @@ -179,22 +163,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 698210201CC62DD000504BBF /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "qlmanage -r"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 8D576311048677EA00EA77CD /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -224,7 +192,7 @@ 2CA3261F0896AD4900168862 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; @@ -243,7 +211,7 @@ 2CA326200896AD4900168862 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -260,10 +228,33 @@ 2CA326230896AD4900168862 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; @@ -280,9 +271,32 @@ 2CA326240896AD4900168862 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; RUN_CLANG_STATIC_ANALYZER = YES; diff --git a/QuickLookStephenProject/QuickLookStephen.xcodeproj/xcshareddata/xcschemes/QuickLookStephen.xcscheme b/QuickLookStephenProject/QuickLookStephen.xcodeproj/xcshareddata/xcschemes/QuickLookStephen.xcscheme index f93a148..0b77832 100644 --- a/QuickLookStephenProject/QuickLookStephen.xcodeproj/xcshareddata/xcschemes/QuickLookStephen.xcscheme +++ b/QuickLookStephenProject/QuickLookStephen.xcodeproj/xcshareddata/xcschemes/QuickLookStephen.xcscheme @@ -1,6 +1,6 @@ Date: Fri, 11 Jan 2019 16:45:27 -0500 Subject: [PATCH 2/3] add Makefile --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3998620 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +.PHONY: QuickLookStephen debug clean + +QuickLookStephen: + xcodebuild SYMROOT=../build -project QuickLookStephenProject/QuickLookStephen.xcodeproj -configuration "Release" $(XC_OPTIONS) build + +debug: + xcodebuild SYMROOT=../build -project QuickLookStephenProject/QuickLookStephen.xcodeproj -configuration "Debug" $(XC_OPTIONS) build + +install: + @if [ -d "./build/Release/QLStephen.qlgenerator" ]; then \ + rm -rf ~/Library/QuickLook/QLStephen.qlgenerator ; \ + cp -r ./build/Release/QLStephen.qlgenerator ~/Library/QuickLook/ ; \ + qlmanage -r ; \ + else \ + echo "Sorry, nothing to install. You might want to build it first. ;-)"; \ + fi + +clean: + @rm -rf ./build From 6e9d0757dfebde980457f5c26d4784801a0129eb Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Fri, 11 Jan 2019 16:49:56 -0500 Subject: [PATCH 3/3] update README.md --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 032daad..2fd978a 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ QLStephen is a QuickLook plugin that lets you view plain text files without a fi CHANGELOG etc... - ## Installation ### Homebrew brew cask install qlstephen - -## MacPorts + +### MacPorts + port install qlstephen ### Pre-compiled @@ -25,11 +25,12 @@ QLStephen is a QuickLook plugin that lets you view plain text files without a fi * Copy the file into `/Library/QuickLook` or `~/Library/QuickLook` (You can create the `QuickLook` folder if it doesn’t exist) - ### Manually Compiled -Compiling the project yourself? The build process will copy the file into ~/Library/QuickLook. +Compiling the project yourself? Run: + make + make install ## Settings @@ -38,8 +39,7 @@ Compiling the project yourself? The build process will copy the file into ~/Libr To keep quickview fast the priview is limited in its number of shown bytes. The default value is 100kB. You can change this using the shell to set your own max size. - defaults write com.whomwah.quicklookstephen maxFileSize 102400 - + defaults write com.whomwah.quicklookstephen maxFileSize 102400 ## Trouble? @@ -47,15 +47,15 @@ If you’ve installed the plugin, but don’t see any changes: - Make sure you are editing (a) the correct plist of (b) the correct bundle. (For example, you might have two `QLStephen` plugins. It’s possible the plugin in - another directory—perhaps `/Library/QuickLook/`—is what is being read.) + another directory — perhaps `/Library/QuickLook/` — is what is being read.) - Run `qlmanage -r` in the Terminal. (This will restart QuickLook, which reloads all plugins.) +If you want to preview some text files that _do_ have extensions (e.g., `*.txt`), follow [these instructions](https://github.com/whomwah/qlstephen/issues/23). ## Why “QLStephen”? Because I was listening to [Adam and Joe](http://www.bbc.co.uk/blogs/adamandjoe/2009/06/test-1.shtml) when I first wrote it. - ## Authors **Original author:** Duncan Robertson @@ -68,7 +68,6 @@ Special thanks to the following people for submitting patches over the years: * [Tony](https://github.com/Zearin) * [Nicholas Hutchinson](https://github.com/nickhutchinson) - ## Contributing * Fork the project