mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove extraneous get { from a bunch of read-only accessors.
This commit is contained in:
@@ -126,14 +126,12 @@ class AddFeedController: AddFeedWindowControllerDelegate, FeedFinderDelegate {
|
||||
private extension AddFeedController {
|
||||
|
||||
var urlStringFromPasteboard: String? {
|
||||
get {
|
||||
if let urlString = NSPasteboard.rs_urlString(from: NSPasteboard.general) {
|
||||
return urlString.rs_normalizedURL()
|
||||
}
|
||||
return nil
|
||||
if let urlString = NSPasteboard.rs_urlString(from: NSPasteboard.general) {
|
||||
return urlString.rs_normalizedURL()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
struct AccountAndFolderSpecifier {
|
||||
let account: Account
|
||||
let folder: Folder?
|
||||
|
||||
@@ -33,14 +33,12 @@ class AddFeedWindowController : NSWindowController {
|
||||
fileprivate var folderTreeController: TreeController!
|
||||
|
||||
private var userEnteredTitle: String? {
|
||||
get {
|
||||
var s = nameTextField.stringValue
|
||||
s = s.rs_stringWithCollapsedWhitespace()
|
||||
if s.isEmpty {
|
||||
return nil
|
||||
}
|
||||
return s
|
||||
var s = nameTextField.stringValue
|
||||
s = s.rs_stringWithCollapsedWhitespace()
|
||||
if s.isEmpty {
|
||||
return nil
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
var hostWindow: NSWindow!
|
||||
|
||||
@@ -9,12 +9,10 @@
|
||||
import AppKit
|
||||
|
||||
class MainWindowSplitView: NSSplitView {
|
||||
|
||||
|
||||
private let splitViewDividerColor = NSColor(calibratedWhite: 0.65, alpha: 1.0)
|
||||
|
||||
|
||||
override var dividerColor: NSColor {
|
||||
get {
|
||||
return splitViewDividerColor
|
||||
}
|
||||
return splitViewDividerColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,9 +75,7 @@ class SidebarCell : NSTableCellView {
|
||||
}
|
||||
|
||||
override var isFlipped: Bool {
|
||||
get {
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private func commonInit() {
|
||||
|
||||
@@ -25,11 +25,9 @@ final class SidebarStatusBarView: NSView {
|
||||
}
|
||||
|
||||
override var isFlipped: Bool {
|
||||
get {
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
override func awakeFromNib() {
|
||||
|
||||
progressIndicator.isHidden = true
|
||||
|
||||
@@ -27,36 +27,30 @@ class UnreadCountView : NSView {
|
||||
}
|
||||
}
|
||||
var unreadCountString: String {
|
||||
get {
|
||||
return unreadCount < 1 ? "" : "\(unreadCount)"
|
||||
}
|
||||
return unreadCount < 1 ? "" : "\(unreadCount)"
|
||||
}
|
||||
|
||||
private var intrinsicContentSizeIsValid = false
|
||||
private var _intrinsicContentSize = NSZeroSize
|
||||
|
||||
override var intrinsicContentSize: NSSize {
|
||||
get {
|
||||
if !intrinsicContentSizeIsValid {
|
||||
var size = NSZeroSize
|
||||
if unreadCount > 0 {
|
||||
size = textSize()
|
||||
size.width += (padding.left + padding.right)
|
||||
size.height += (padding.top + padding.bottom)
|
||||
}
|
||||
_intrinsicContentSize = size
|
||||
intrinsicContentSizeIsValid = true
|
||||
if !intrinsicContentSizeIsValid {
|
||||
var size = NSZeroSize
|
||||
if unreadCount > 0 {
|
||||
size = textSize()
|
||||
size.width += (padding.left + padding.right)
|
||||
size.height += (padding.top + padding.bottom)
|
||||
}
|
||||
return _intrinsicContentSize
|
||||
_intrinsicContentSize = size
|
||||
intrinsicContentSizeIsValid = true
|
||||
}
|
||||
return _intrinsicContentSize
|
||||
}
|
||||
|
||||
override var isFlipped: Bool {
|
||||
get {
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
override func invalidateIntrinsicContentSize() {
|
||||
|
||||
intrinsicContentSizeIsValid = false
|
||||
|
||||
@@ -23,14 +23,12 @@ class TimelineTableRowView : NSTableRowView {
|
||||
// }
|
||||
|
||||
private var cellView: TimelineTableCellView? {
|
||||
get {
|
||||
for oneSubview in subviews {
|
||||
if let foundView = oneSubview as? TimelineTableCellView {
|
||||
return foundView
|
||||
}
|
||||
for oneSubview in subviews {
|
||||
if let foundView = oneSubview as? TimelineTableCellView {
|
||||
return foundView
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
override var isEmphasized: Bool {
|
||||
@@ -50,10 +48,7 @@ class TimelineTableRowView : NSTableRowView {
|
||||
}
|
||||
|
||||
var gridRect: NSRect {
|
||||
get {
|
||||
// return NSMakeRect(floor(cellAppearance.boxLeftMargin), NSMaxY(bounds) - 1.0, NSWidth(bounds), 1)
|
||||
return NSMakeRect(0.0, NSMaxY(bounds) - 1.0, NSWidth(bounds), 1)
|
||||
}
|
||||
return NSMakeRect(0.0, NSMaxY(bounds) - 1.0, NSWidth(bounds), 1)
|
||||
}
|
||||
|
||||
override func drawSeparator(in dirtyRect: NSRect) {
|
||||
|
||||
@@ -18,15 +18,11 @@ class TimelineViewController: NSViewController, UndoableCommandRunner {
|
||||
@IBOutlet var contextualMenuDelegate: TimelineContextualMenuDelegate?
|
||||
|
||||
var selectedArticles: [Article] {
|
||||
get {
|
||||
return Array(articles.articlesForIndexes(tableView.selectedRowIndexes))
|
||||
}
|
||||
return Array(articles.articlesForIndexes(tableView.selectedRowIndexes))
|
||||
}
|
||||
|
||||
var hasAtLeastOneSelectedArticle: Bool {
|
||||
get {
|
||||
return tableView.selectedRow != -1
|
||||
}
|
||||
return tableView.selectedRow != -1
|
||||
}
|
||||
|
||||
var articles = ArticleArray() {
|
||||
@@ -105,9 +101,7 @@ class TimelineViewController: NSViewController, UndoableCommandRunner {
|
||||
}
|
||||
|
||||
private var oneSelectedArticle: Article? {
|
||||
get {
|
||||
return selectedArticles.count == 1 ? selectedArticles.first : nil
|
||||
}
|
||||
return selectedArticles.count == 1 ? selectedArticles.first : nil
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
||||
Reference in New Issue
Block a user