Skip to content

Commit 7266340

Browse files
Les MelnychukNSExceptional
authored andcommitted
Fix code style
1 parent af59b79 commit 7266340

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ - (BOOL)close {
102102
}
103103

104104
- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName {
105-
NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@",tableName];
105+
NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@", tableName];
106106
return [self executeQuery:sql];
107107
}
108108

@@ -145,9 +145,9 @@ - (NSString *)executeNonSelectQuery:(NSString *)sql {
145145
int columnIdx = 0;
146146

147147
for (columnIdx = 0; columnIdx < columnCount; columnIdx++) {
148-
149148
NSString *columnName = [NSString stringWithUTF8String:sqlite3_column_name(pstmt, columnIdx)];
150149
id objectValue = [self objectForColumnIndex:columnIdx stmt:pstmt];
150+
151151
[dict setObject:objectValue forKey:columnName];
152152
}
153153

Classes/GlobalStateExplorers/SQLExecutionControllers/FLEXSQLCommandExecutionViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
@interface FLEXSQLCommandExecutionViewController: UIViewController
1313
@property (nonatomic) BOOL isSelectionType;
14-
@property (nonatomic) FLEXSQLiteDatabaseManager* dbManager;
14+
@property (nonatomic) FLEXSQLiteDatabaseManager *dbManager;
1515
@end

Classes/GlobalStateExplorers/SQLExecutionControllers/FLEXSQLCommandExecutionViewController.m

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#import <objc/runtime.h>
1616

1717
@interface FLEXSQLCommandExecutionViewController ()
18-
@property (nonatomic) UITextView* textView;
19-
@property (nonatomic) UIButton* submitButton;
20-
@property (nonatomic) UILabel* statusLabel;
18+
@property (nonatomic) UITextView *textView;
19+
@property (nonatomic) UIButton *submitButton;
20+
@property (nonatomic) UILabel *statusLabel;
2121
@end
2222

2323
@implementation FLEXSQLCommandExecutionViewController
@@ -39,30 +39,30 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
3939
- (void)addOtherUIElementsAndPositionThem {
4040
if(textView == nil) {
4141
textView = [UITextView new];
42-
textView.backgroundColor = [UIColor colorWithWhite: 0.9 alpha: 1.0];
42+
textView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
4343
textView.textColor = [UIColor blackColor];
4444

45-
[self.view addSubview: textView];
45+
[self.view addSubview:textView];
4646
}
4747

4848
if(submitButton == nil) {
4949
submitButton = [UIButton new];
5050

51-
[submitButton setTitleColor:[UIColor blueColor] forState: UIControlStateNormal];
52-
[submitButton setBackgroundColor: [UIColor colorWithWhite: 0.9 alpha: 1.0]];
51+
[submitButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
52+
[submitButton setBackgroundColor:[UIColor colorWithWhite:0.9 alpha:1.0]];
5353

54-
[submitButton setTitle: @"Submit" forState: UIControlStateNormal];
55-
[submitButton addTarget: self action:@selector(submitPressed) forControlEvents: UIControlEventTouchUpInside];
54+
[submitButton setTitle:@"Submit" forState:UIControlStateNormal];
55+
[submitButton addTarget:self action:@selector(submitPressed) forControlEvents:UIControlEventTouchUpInside];
5656

57-
[self.view addSubview: submitButton];
57+
[self.view addSubview:submitButton];
5858
}
5959

6060
if(statusLabel == nil) {
6161
statusLabel = [UILabel new];
6262

6363
statusLabel.textAlignment = NSTextAlignmentCenter;
6464
statusLabel.textColor = [UIColor blackColor];
65-
[self.view addSubview: statusLabel];
65+
[self.view addSubview:statusLabel];
6666
}
6767

6868
self.view.backgroundColor = [UIColor whiteColor];
@@ -83,25 +83,25 @@ - (void)submitPressed {
8383
NSString* text = textView.text == nil ? @"" : textView.text;
8484

8585
if (isSelectionType) {
86-
NSString* errorString;
87-
NSArray<NSDictionary<NSString *, id> *> *responce = [self.dbManager executeSelectionQuery: text and: &errorString];
86+
NSString *errorString;
87+
NSArray<NSDictionary<NSString *, id> *> *responce = [dbManager executeSelectionQuery:text error:&errorString];
8888

8989
if (responce == nil) {
90-
[self presentOnErrorAlert: errorString];
90+
[self presentOnErrorAlert:errorString];
9191
return;
9292
}
9393

9494
NSMutableArray<NSString *> *tables = [NSMutableArray<NSString *> new];
9595

9696
for (NSDictionary<NSString *, id> *dict in responce) {
9797
for (NSString *key in [dict allKeys]) {
98-
if ([tables containsObject: key] == false) {
99-
[tables addObject: key];
98+
if ([tables containsObject:key] == false) {
99+
[tables addObject:key];
100100
}
101101
}
102102
}
103103

104-
FLEXTableContentViewController *contentViewController = [[FLEXTableContentViewController alloc] init];
104+
FLEXTableContentViewController *contentViewController = [FLEXTableContentViewController new];
105105

106106
contentViewController.contentsArray = responce;
107107
contentViewController.columnsArray = [tables copy];
@@ -110,7 +110,7 @@ - (void)submitPressed {
110110

111111
[self.navigationController pushViewController:contentViewController animated:YES];
112112
} else {
113-
NSString* errorMessage = [self.dbManager executeNonSelectQuery: text];
113+
NSString* errorMessage = [self.dbManager executeNonSelectQuery:text];
114114

115115
statusLabel.text = errorMessage == nil ? @"SUCCESS" : errorMessage;
116116
}
@@ -119,15 +119,15 @@ - (void)submitPressed {
119119

120120
- (void)presentOnErrorAlert: (NSString *)message
121121
{
122-
UIAlertController * alert = [UIAlertController
122+
UIAlertController *alert = [UIAlertController
123123
alertControllerWithTitle:@"SQL Execution error !!!"
124-
message: message
124+
message:message
125125
preferredStyle:UIAlertControllerStyleAlert];
126126

127-
UIAlertAction* okButton = [UIAlertAction
127+
UIAlertAction *okButton = [UIAlertAction
128128
actionWithTitle:@"Ok"
129129
style:UIAlertActionStyleDestructive
130-
handler: nil];
130+
handler:nil];
131131

132132
[alert addAction:okButton];
133133
[self presentViewController:alert animated:YES completion:nil];

0 commit comments

Comments
 (0)