From aa71b7ccf0d075eaab9966b8689ac2328617244c Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 23 Jan 2013 06:54:18 +0100 Subject: [PATCH] Adhere to naming convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given constraint-based layouts, we’re more likely to create views in code, and as helper functions are often involved, it makes sense to name them so that we can quickly get a list of all helpers (via search), either for copy/paste or for evaluating wether or not it makes sense to move all helpers to a single library. Since helpers are declared with static storage, they do not pollute the global namespace. --- Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm | 10 +++++----- Frameworks/layout/tests/t_layout.mm | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm b/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm index 4b9dc641..cd18370d 100644 --- a/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm +++ b/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm @@ -1,7 +1,7 @@ #import "OFBHeaderView.h" #import -static NSButton* ImageButton (NSString* imageName) +static NSButton* OakCreateImageButton (NSString* imageName) { NSButton* res = [NSButton new]; @@ -18,7 +18,7 @@ static NSButton* ImageButton (NSString* imageName) return res; } -static NSPopUpButton* PopUpButton () +static NSPopUpButton* OakCreatePopUpButton () { NSPopUpButton* res = [NSPopUpButton new]; [[res cell] setBackgroundStyle:NSBackgroundStyleLight]; @@ -39,10 +39,10 @@ static NSPopUpButton* PopUpButton () { if(self = [super initWithFrame:aRect]) { - self.folderPopUpButton = PopUpButton(); - self.goBackButton = ImageButton(NSImageNameGoLeftTemplate); + self.folderPopUpButton = OakCreatePopUpButton(); + self.goBackButton = OakCreateImageButton(NSImageNameGoLeftTemplate); self.goBackButton.toolTip = @"Go Back"; - self.goForwardButton = ImageButton(NSImageNameGoRightTemplate); + self.goForwardButton = OakCreateImageButton(NSImageNameGoRightTemplate); self.goForwardButton.toolTip = @"Go Forward"; self.darkDividerView = OakCreateViewWithColor([NSColor colorWithCalibratedWhite:0.551 alpha:1.000]); diff --git a/Frameworks/layout/tests/t_layout.mm b/Frameworks/layout/tests/t_layout.mm index e896ff74..eeaaf5a7 100644 --- a/Frameworks/layout/tests/t_layout.mm +++ b/Frameworks/layout/tests/t_layout.mm @@ -391,7 +391,7 @@ private: } @end -static NSScrollView* CreateTextView (NSRect aRect = NSMakeRect(0, 0, 600, 800)) +static NSScrollView* OakCreateTextView (NSRect aRect = NSMakeRect(0, 0, 600, 800)) { NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:aRect]; NSSize textViewSize = [NSScrollView contentSizeForFrameSize:aRect.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder]; @@ -425,6 +425,6 @@ class LayoutTests : public CxxTest::TestSuite public: void test_layout () { - OakSetupApplicationWithView(CreateTextView()); + OakSetupApplicationWithView(OakCreateTextView()); } };