Skip to content

Commit

Permalink
Removed superfluous function.
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraRozier committed Aug 18, 2015
1 parent f44bac6 commit b2f4081
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
8 changes: 5 additions & 3 deletions MapExporter/KP_MapExporter_Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@
if GetFiles(fMapPath, FileList, DirList) then // Put all files into a stringList and check if result is true
Begin
Try
// As Pascal hates to create directories by itself, check if it is there, if not make it.
if not SysUtils.DirectoryExists(ExtractFilePath(Application.ExeName) + PathDelim + 'Exported maps') then
mkDir(ExtractFilePath(Application.ExeName) + PathDelim + 'Exported maps');
// Create .kpmap tarball in write-mode.
TarFileWriter := TTarWriter.Create(ExtractFilePath(Application.ExeName) + PathDelim + 'Exported maps'
+ PathDelim + fMapName + '.kpmap');
For i := 0 to DirList.Count - 1 do
if DirList[i] = '.' then // Also a Unix character, means current Directory. Change it to MapName.
if DirList[i] = '.' then // A Unix character, means current Directory. Change it to MapName.
TarFileWriter.AddDir(AnsiString(fMapName), Now)
else
TarFileWriter.AddDir(AnsiString(fMapName + '/' + DirList[i]), Now);
Expand All @@ -81,11 +80,14 @@
OutPutList: TStringList;
Begin
OutPutList := TStringList.Create;
OutPutList.Clear;
OutPutList.Delimiter := PathDelim;
OutPutList.StrictDelimiter := True; // Requires Delphi 2006 or newer.
if SelectDirectory('Select a directory', ExtractFilePath(Application.ExeName), fMapPath) then
Begin
fMapPath := fMapPath + PathDelim;
edtMapFolderPath.Text := fMapPath;
Split(PathDelim, ExcludeTrailingPathDelimiter(fMapPath), OutPutList);
OutPutList.DelimitedText := ExcludeTrailingPathDelimiter(fMapPath);
fMapName := OutPutList[OutPutList.Count - 1];
lblFileName.Caption := fMapName;
end;
Expand Down
24 changes: 12 additions & 12 deletions MapExporter/MapExporter.dproj.local
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899-12-30 00:00:00.000.164,C:\Users\Thimo\Desktop\KMR en KP\Delphi\KP_MapTools.inc=</Transaction>
<Transaction>1899-12-30 00:00:00.000.898,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\KP_MapTools.inc</Transaction>
<Transaction>1899-12-30 00:00:00.000.616,C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\KP_ToolCommonTypes.pas=</Transaction>
<Transaction>1899-12-30 00:00:00.000.546,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\KP_ToolUtils.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.963,C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\MapExporter.dproj=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KPMapCompress.dproj</Transaction>
<Transaction>1899-12-30 00:00:00.000.147,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\KP_ToolCommonTypes.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.164,C:\Users\Thimo\Desktop\KMR en KP\Delphi\KP_MapTools.inc=</Transaction>
<Transaction>1899-12-30 00:00:00.000.266,C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\MapExporter.manifest=C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\New1.manifest</Transaction>
<Transaction>1899-12-30 00:00:00.000.546,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\KP_ToolUtils.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.521,C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KP_MapExporter_Main.pas=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\Unit3.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.147,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\KP_ToolCommonTypes.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.616,C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\KP_ToolCommonTypes.pas=</Transaction>
<Transaction>1899-12-30 00:00:00.000.639,C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\KP_MapExporter_Main.dfm=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KP_MapExporter_Main.dfm</Transaction>
<Transaction>1899-12-30 00:00:00.000.280,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\New1.manifest</Transaction>
<Transaction>1899-12-30 00:00:00.000.197,C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KPMapCompress.dproj=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\Project4.dproj</Transaction>
<Transaction>1899-12-30 00:00:00.000.073,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\LibTar.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.898,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\KP_MapTools.inc</Transaction>
<Transaction>1899-12-30 00:00:00.000.851,C:\Users\Thimo\Desktop\KMR en KP\Delphi\KP_MapTools.inc=C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\New1.inc</Transaction>
<Transaction>1899-12-30 00:00:00.000.521,C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KP_MapExporter_Main.dfm=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\Unit3.dfm</Transaction>
<Transaction>1899-12-30 00:00:00.000.639,C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\KP_MapExporter_Main.pas=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KP_MapExporter_Main.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.073,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\src\LibTar.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.197,C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KPMapCompress.dproj=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\Project4.dproj</Transaction>
<Transaction>1899-12-30 00:00:00.000.280,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\New1.manifest</Transaction>
<Transaction>1899-12-30 00:00:00.000.225,=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\Unit3.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.639,C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\KP_MapExporter_Main.dfm=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KP_MapExporter_Main.dfm</Transaction>
<Transaction>1899-12-30 00:00:00.000.989,C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\MapExporter.dproj=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\MapExporter.dproj</Transaction>
<Transaction>1899-12-30 00:00:00.000.639,C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\KP_MapExporter_Main.pas=C:\Users\Thimo\Documents\Embarcadero\Studio\Projects\KP_MapExporter_Main.pas</Transaction>
<Transaction>2015-08-18 12:08:07.542,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\New1.inc</Transaction>
<Transaction>2015-08-18 12:15:31.851,C:\Users\Thimo\Desktop\KMR en KP\Delphi\KP_MapTools.inc=C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\New1.inc</Transaction>
<Transaction>1899-12-30 00:00:00.000.542,=C:\Users\Thimo\Desktop\KMR en KP\Delphi\MapExporter\New1.inc</Transaction>
</Transactions>
</BorlandProject>
11 changes: 0 additions & 11 deletions src/KP_ToolUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
UNITSUFFIX: Array[0..7] of String = ( '', 'K', 'M', 'G', 'T', 'E', 'Z', 'Y' );
CONVERTBYTEVAL: Word = 1024;


Procedure RegisterFileType;
Procedure Split(Delimiter: Char; Str: String; ListOfStrings: TStrings) ;
Function GetFiles(Const StartDir: String; Const FileList, DirList: TStrings): Boolean;
Function convertUnits(aValueToConvert: Int64; aBaseValue: Integer): String;

Expand Down Expand Up @@ -47,15 +45,6 @@
end;
end;

// Split text to string list
Procedure Split(Delimiter: Char; Str: String; ListOfStrings: TStrings) ;
Begin
ListOfStrings.Clear;
ListOfStrings.Delimiter := Delimiter;
ListOfStrings.StrictDelimiter := True; // Requires Delphi 2006 or newer.
ListOfStrings.DelimitedText := Str;
end;

Function GetFiles(Const StartDir: String; Const FileList, DirList: TStrings): Boolean;
Var
SRec, SubDirSRec: TSearchRec;
Expand Down

0 comments on commit b2f4081

Please sign in to comment.