From 2ed4507666bb8dbf7b4f77b7f0da6658288324e0 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 14 Jun 2008 12:48:04 +0000 Subject: [PATCH] Code cosmetic: Sanitize NODETYPE_BASETABLE constant from superflous "BASE" --- components/heidisql/include/const.inc | 2 +- source/childwin.pas | 14 +++++++------- source/helpers.pas | 2 +- source/loaddata.pas | 2 +- source/main.pas | 4 ++-- source/selectdbobject.pas | 2 +- source/usermanager.pas | 8 ++++---- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/components/heidisql/include/const.inc b/components/heidisql/include/const.inc index 52027097..6d8df263 100644 --- a/components/heidisql/include/const.inc +++ b/components/heidisql/include/const.inc @@ -225,7 +225,7 @@ const // Node types of Virtual Tree nodes NODETYPE_DEFAULT = 0; - NODETYPE_BASETABLE = 1; + NODETYPE_TABLE = 1; NODETYPE_VIEW = 2; NODETYPE_DB = 3; NODETYPE_COLUMN = 4; diff --git a/source/childwin.pas b/source/childwin.pas index 71300286..c9e48ae3 100644 --- a/source/childwin.pas +++ b/source/childwin.pas @@ -1572,7 +1572,7 @@ begin lblDataTop.Caption := ActiveDatabase + '.' + SelectedTable + ': '; - if GetSelectedNodeType = NODETYPE_BASETABLE then begin + if GetSelectedNodeType = NODETYPE_TABLE then begin // Get rowcount from table rows_total := StrToInt64( GetVar( 'SELECT COUNT(*) FROM ' + mask( SelectedTable ), 0 ) ); lblDataTop.Caption := lblDataTop.Caption + FormatNumber( rows_total ) + ' records total'; @@ -1822,10 +1822,10 @@ begin // Treat tables slightly different than views case GetDBObjectType( ds.Fields) of - NODETYPE_BASETABLE: // A normal table + NODETYPE_TABLE: // A normal table begin VTRowDataListTables[i-1].ImageIndex := ICONINDEX_TABLE; - VTRowDataListTables[i-1].NodeType := NODETYPE_BASETABLE; + VTRowDataListTables[i-1].NodeType := NODETYPE_TABLE; // Records if ds.FindField('Rows') <> nil then ListCaptions.Add( FormatNumber( FieldContent('Rows') ) ) @@ -2160,7 +2160,7 @@ begin // Check type of first selected node, to en-/disable certain menu items if NodeSelected then begin NodeData := ListTables.GetNodeData( SelectedNodes[0] ); - tableSelected := NodeData.NodeType = NODETYPE_BASETABLE; + tableSelected := NodeData.NodeType = NODETYPE_TABLE; ViewSelected := NodeData.NodeType = NODETYPE_VIEW; end; @@ -2838,7 +2838,7 @@ var begin ObjName := Fields[0].AsString; case GetDBObjectType(Fields) of - NODETYPE_BASETABLE: ObjType := 'table'; + NODETYPE_TABLE: ObjType := 'table'; NODETYPE_VIEW: ObjType := 'view'; else ObjType := 'unknown'; end; @@ -4024,7 +4024,7 @@ begin menuAlterDatabase.Hint := STR_NOTSUPPORTED else menuAlterDatabase.Hint := 'Rename and/or modify character set of database'; - menuTreeAlterTable.Enabled := (L = 2) and (GetSelectedNodeType = NODETYPE_BASETABLE); + menuTreeAlterTable.Enabled := (L = 2) and (GetSelectedNodeType = NODETYPE_TABLE); Mainform.actEditView.Enabled := (L = 2) and (GetSelectedNodeType = NODETYPE_VIEW); MainForm.DropTablesAndViews.Enabled := (L = 2); end; @@ -6645,7 +6645,7 @@ begin ds := FetchDbTableList(Databases[Node.Parent.Index]); ds.RecNo := Node.Index+1; case GetDBObjectType(ds.Fields) of - NODETYPE_BASETABLE: + NODETYPE_TABLE: if Kind = ikSelected then ImageIndex := ICONINDEX_TABLE_HIGHLIGHT else ImageIndex := ICONINDEX_TABLE; diff --git a/source/helpers.pas b/source/helpers.pas index c09d242b..4f182f68 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -2198,7 +2198,7 @@ begin but for views which is missing its tables, it says "Views bla references invalid..." } - Result := NODETYPE_BASETABLE; + Result := NODETYPE_TABLE; if (TableStatus.Count>=3) // Result from SHOW TABLE STATUS and TableStatus[1].IsNull // Engine column is NULL for views and TableStatus[2].IsNull then diff --git a/source/loaddata.pas b/source/loaddata.pas index 1bee518e..2419335b 100644 --- a/source/loaddata.pas +++ b/source/loaddata.pas @@ -142,7 +142,7 @@ begin ds := Mainform.ChildWin.FetchDbTableList(comboDatabase.Text); while not ds.Eof do begin // Only display tables, skip views etc. - if GetDBObjectType(ds.Fields) = NODETYPE_BASETABLE then begin + if GetDBObjectType(ds.Fields) = NODETYPE_TABLE then begin comboTable.Items.Add(ds.Fields[0].AsString); count := comboTable.Items.Count-1; if (comboDatabase.Text = seldb) and (comboTable.Items[count] = seltable) then diff --git a/source/main.pas b/source/main.pas index 54cde31d..0d510c6c 100644 --- a/source/main.pas +++ b/source/main.pas @@ -1101,12 +1101,12 @@ begin Views := TStringlist.Create; if Childwin.PageControlMain.ActivePage = Childwin.tabDatabase then begin // Invoked from one of the various buttons, SheetDatabase is the active page, drop highlighted table(s). - Tables := GetVTCaptions(Childwin.ListTables, True, 0, NODETYPE_BASETABLE); + Tables := GetVTCaptions(Childwin.ListTables, True, 0, NODETYPE_TABLE); Views := GetVTCaptions(Childwin.ListTables, True, 0, NODETYPE_VIEW); end else begin // Invoked from one of the various buttons, drop table selected in tree view. case Childwin.GetSelectedNodeType of - NODETYPE_BASETABLE: Tables.Add(Childwin.SelectedTable); + NODETYPE_TABLE: Tables.Add(Childwin.SelectedTable); NODETYPE_VIEW: Views.Add(Childwin.SelectedTable) end; end; diff --git a/source/selectdbobject.pas b/source/selectdbobject.pas index 4a5eadab..43213e67 100644 --- a/source/selectdbobject.pas +++ b/source/selectdbobject.pas @@ -180,7 +180,7 @@ begin ds := CWin.FetchDbTableList(CWin.Databases[Node.Parent.Index]); ds.RecNo := Node.Index+1; case GetDBObjectType(ds.Fields) of - NODETYPE_BASETABLE: ImageIndex := ICONINDEX_TABLE; + NODETYPE_TABLE: ImageIndex := ICONINDEX_TABLE; NODETYPE_VIEW: ImageIndex := ICONINDEX_VIEW; end; end; diff --git a/source/usermanager.pas b/source/usermanager.pas index 88cbe0ff..42ec6cbb 100644 --- a/source/usermanager.pas +++ b/source/usermanager.pas @@ -445,7 +445,7 @@ begin case u.Privileges[i].DBOType of NODETYPE_DEFAULT: Icon := ICONINDEX_SERVER; NODETYPE_DB: Icon := ICONINDEX_DB; - NODETYPE_BASETABLE: Icon := ICONINDEX_TABLE; + NODETYPE_TABLE: Icon := ICONINDEX_TABLE; NODETYPE_VIEW: Icon := ICONINDEX_VIEW; NODETYPE_COLUMN: Icon := ICONINDEX_FIELD; end; @@ -1056,7 +1056,7 @@ begin TableName := mask(PRIVTABLE_DB); SetFieldName := ''; end; - NODETYPE_BASETABLE: begin + NODETYPE_TABLE: begin TableSet := dsTables; TableName := mask(PRIVTABLE_TABLES); SetFieldName := 'table_priv'; @@ -1618,7 +1618,7 @@ begin case FDBOType of NODETYPE_DEFAULT: Result := Result + 'Server privileges'; NODETYPE_DB: Result := Result + 'Database: '; - NODETYPE_BASETABLE: Result := Result + 'Table: '; + NODETYPE_TABLE: Result := Result + 'Table: '; NODETYPE_COLUMN: Result := Result + 'Column: '; end; Result := Result + GetDBOKey; @@ -1664,7 +1664,7 @@ begin DBONames.Add(Fields.FieldByName('Db').AsString); end; if Fields.FindField('Table_name') <> nil then begin - DBOType := NODETYPE_BASETABLE; + DBOType := NODETYPE_TABLE; DBONames.Add(Fields.FieldByName('Table_name').AsString); end; if Fields.FindField('Column_name') <> nil then begin