Skip to content

Commit

Permalink
fix: adds missing return statements
Browse files Browse the repository at this point in the history
so the project builds without any compile errors on macOS high sierra (10.13.x)
  • Loading branch information
gingerr authored and lwouis committed Oct 28, 2019
1 parent d9a23c2 commit 4b517ff
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions alt-tab-macos/logic/Preferences.swift
Expand Up @@ -99,11 +99,11 @@ class Preferences {
}

private static func preferencesVersion(_ url: URL) throws -> Int {
try Int(loadFromDisk(url)["version"] ?? "0").orThrow()
return try Int(loadFromDisk(url)["version"] ?? "0").orThrow()
}

private static func loadFromDisk(_ url: URL) throws -> [String: String] {
try JSONDecoder().decode([String: String].self, from: Data(contentsOf: url))
return try JSONDecoder().decode([String: String].self, from: Data(contentsOf: url))
}

private static func handleNoFileOrOldFile(_ userFile: URL) throws {
Expand Down Expand Up @@ -132,7 +132,7 @@ class Preferences {
}

private static func fileFromPreferencesFolder(_ fileName: String) -> URL {
FileManager.default
return FileManager.default
.urls(for: .libraryDirectory, in: .userDomainMask)
.first!
.appendingPathComponent("Preferences", isDirectory: true)
Expand Down
2 changes: 1 addition & 1 deletion alt-tab-macos/logic/WindowManager.swift
Expand Up @@ -17,7 +17,7 @@ class OpenWindow {
}

func computeIcon() -> NSImage? {
NSRunningApplication(processIdentifier: ownerPid!)?.icon
return NSRunningApplication(processIdentifier: ownerPid!)?.icon
}

func computeThumbnail() -> NSImage {
Expand Down
4 changes: 2 additions & 2 deletions alt-tab-macos/ui/Application.swift
Expand Up @@ -91,7 +91,7 @@ class Application: NSApplication, NSApplicationDelegate, NSWindowDelegate {
}

func cellWithStep(_ step: Int) -> Int {
selectedOpenWindow + step < 0 ? openWindows.count - 1 : (selectedOpenWindow + step) % openWindows.count
return selectedOpenWindow + step < 0 ? openWindows.count - 1 : (selectedOpenWindow + step) % openWindows.count
}

func cycleSelection(_ step: Int) {
Expand Down Expand Up @@ -130,6 +130,6 @@ class Application: NSApplication, NSApplicationDelegate, NSWindowDelegate {
}

func currentlySelectedWindow() -> OpenWindow? {
openWindows.count > selectedOpenWindow ? openWindows[selectedOpenWindow] : nil
return openWindows.count > selectedOpenWindow ? openWindows[selectedOpenWindow] : nil
}
}
2 changes: 1 addition & 1 deletion alt-tab-macos/ui/PreferencesPanel.swift
Expand Up @@ -25,7 +25,7 @@ class PreferencesPanel: NSPanel, NSTextViewDelegate {
}

private func makeLabelsAndInputs() -> [[NSView]] {
[
return [
makeLabelWithDropdown(\PreferencesPanel.theme, "Main window theme", "theme", Preferences.themeMacro.labels),
makeLabelWithDropdown(\PreferencesPanel.metaKey, "Meta key to activate the app", "metaKey", Preferences.metaKeyMacro.labels),
makeLabelWithInput(\PreferencesPanel.tabKeyCode, "Tab key (NSEvent.keyCode)", "tabKeyCode"),
Expand Down
2 changes: 1 addition & 1 deletion alt-tab-macos/ui/ThumbnailsPanel.swift
Expand Up @@ -58,7 +58,7 @@ class ThumbnailsPanel: NSPanel, NSCollectionViewDataSource, NSCollectionViewDele

func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
// debugPrint("collectionView: count items", openWindows.count)
application!.openWindows.count
return application!.openWindows.count
}

func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
Expand Down

0 comments on commit 4b517ff

Please sign in to comment.