Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Split Database out of BirneConnect, experimental support for monthly …

…financial reports

git-svn-id: https://svn.cocoanetics.com/myappsales/trunk@54 3a964c32-7461-4f60-ae82-ad05498e24dc
  • Loading branch information...
commit 4142833cb06d6861a51c6aee27a98bca5409e57e 1 parent cdc4e5f
oliver authored
Showing with 25,841 additions and 2,212 deletions.
  1. +562 −127 ASiST.xcodeproj/Oliver.mode1v3
  2. +23,616 −387 ASiST.xcodeproj/Oliver.pbxuser
  3. +10 −7 ASiST.xcodeproj/project.pbxproj
  4. +2 −0  App.m
  5. +0 −18 BirneConnect+Totals.h
  6. +0 −182 BirneConnect+Totals.m
  7. +1 −5 Classes/ASiSTAppDelegate.h
  8. +44 −6 Classes/ASiSTAppDelegate.m
  9. +6 −8 Classes/AppViewController.m
  10. +5 −90 Classes/BirneConnect.h
  11. +11 −922 Classes/BirneConnect.m
  12. +12 −15 Classes/ChartRootController.m
  13. +1 −0  Classes/Country.h
  14. +39 −0 Classes/Country.m
  15. +129 −123 Classes/GenericReportController.m
  16. +15 −15 Classes/Report.h
  17. +268 −196 Classes/Report.m
  18. +15 −18 Classes/ReportAppsController.m
  19. +0 −1  Classes/ReportRootController.h
  20. +12 −61 Classes/ReportRootController.m
  21. +17 −5 Classes/ReportViewController.m
  22. +1 −1  Classes/SettingsViewController.m
  23. +1 −1  Classes/StatusInfoController.m
  24. +56 −0 Database.h
  25. +935 −2 Database.m
  26. +11 −12 MyHTTPConnection.m
  27. +1 −1  Query.h
  28. +2 −3 Query.m
  29. +12 −2 Sale.h
  30. +55 −2 Sale.m
  31. +2 −2 update_0_to_1.sql
View
689 ASiST.xcodeproj/Oliver.mode1v3
@@ -202,24 +202,24 @@
<key>Content</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>A7C7EA58104664D900D413D0</string>
+ <string>A7E9E05F104990B10042FD91</string>
<key>PBXProjectModuleLabel</key>
- <string>DayReportCell.m</string>
+ <string>Database.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>A7C7EA59104664D900D413D0</string>
+ <string>A7E9E060104990B10042FD91</string>
<key>PBXProjectModuleLabel</key>
- <string>DayReportCell.m</string>
+ <string>Database.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>A7EB53F110484808005452BE</string>
+ <string>A7E9E8261049F0D80042FD91</string>
<key>history</key>
<array>
- <string>A7EB53AF1048431B005452BE</string>
+ <string>A7E9E061104990B10042FD91</string>
</array>
</dict>
<key>SplitCount</key>
@@ -235,7 +235,7 @@
<key>PBXModuleWindowStatusBarHidden2</key>
<false/>
<key>RubberWindowFrame</key>
- <string>462 269 1147 496 0 0 1440 878 </string>
+ <string>107 293 1147 496 0 0 1440 878 </string>
</dict>
</dict>
<dict>
@@ -256,11 +256,11 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>A7EB53F210484808005452BE</string>
+ <string>A7E9E8271049F0D80042FD91</string>
<key>history</key>
<array>
<string>A7C7E8B81045903C00D413D0</string>
- <string>A7EB53B01048431B005452BE</string>
+ <string>A781DCC31048754E003886F0</string>
</array>
<key>prevStack</key>
<array>
@@ -288,9 +288,55 @@
<key>Content</key>
<dict>
<key>PBXProjectModuleGUID</key>
+ <string>A73CED3110456D77008778BF</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>BirneConnect.m</string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A73CED3210456D77008778BF</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>BirneConnect.m</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>A7E9E8281049F0D80042FD91</string>
+ <key>history</key>
+ <array>
+ <string>A73CED3310456D77008778BF</string>
+ <string>A7E9DE4710496D610042FD91</string>
+ </array>
+ <key>prevStack</key>
+ <array>
+ <string>A73CED3510456D77008778BF</string>
+ <string>A73CED3610456D77008778BF</string>
+ </array>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ </dict>
+ <key>Geometry</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 20}, {1216, 607}}</string>
+ <key>PBXModuleWindowStatusBarHidden2</key>
+ <false/>
+ <key>RubberWindowFrame</key>
+ <string>632 167 1216 648 0 0 1440 878 </string>
+ </dict>
+ </dict>
+ <dict>
+ <key>Content</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
<string>A7EB491510469556005452BE</string>
<key>PBXProjectModuleLabel</key>
- <string>Report.h</string>
+ <string>Report.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -298,20 +344,21 @@
<key>PBXProjectModuleGUID</key>
<string>A7EB491610469556005452BE</string>
<key>PBXProjectModuleLabel</key>
- <string>Report.h</string>
+ <string>Report.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>A7EB53F310484808005452BE</string>
+ <string>A7E9E8291049F0D80042FD91</string>
<key>history</key>
<array>
+ <string>A7E9E0F4104995210042FD91</string>
<string>A7EB491710469556005452BE</string>
- <string>A7EB53B11048431B005452BE</string>
</array>
<key>prevStack</key>
<array>
<string>A7EB491910469556005452BE</string>
<string>A7EB491A10469556005452BE</string>
+ <string>A7E9E0F5104995210042FD91</string>
</array>
</dict>
<key>SplitCount</key>
@@ -334,30 +381,29 @@
<key>Content</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>A73CED3110456D77008778BF</string>
+ <string>A7E9DD67104957DF0042FD91</string>
<key>PBXProjectModuleLabel</key>
- <string>BirneConnect.m</string>
+ <string>Database.h</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>A73CED3210456D77008778BF</string>
+ <string>A7E9DD68104957DF0042FD91</string>
<key>PBXProjectModuleLabel</key>
- <string>BirneConnect.m</string>
+ <string>Database.h</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>A7EB53F410484808005452BE</string>
+ <string>A7E9E82A1049F0D80042FD91</string>
<key>history</key>
<array>
- <string>A73CED3310456D77008778BF</string>
- <string>A7EB53B21048431B005452BE</string>
+ <string>A7E9DD7B10495A940042FD91</string>
+ <string>A7E9DD7C10495A940042FD91</string>
</array>
<key>prevStack</key>
<array>
- <string>A73CED3510456D77008778BF</string>
- <string>A73CED3610456D77008778BF</string>
+ <string>A7E9DD7D10495A940042FD91</string>
</array>
</dict>
<key>SplitCount</key>
@@ -369,11 +415,51 @@
<key>Geometry</key>
<dict>
<key>Frame</key>
- <string>{{0, 20}, {1216, 607}}</string>
+ <string>{{0, 20}, {1147, 455}}</string>
+ <key>PBXModuleWindowStatusBarHidden2</key>
+ <false/>
+ <key>RubberWindowFrame</key>
+ <string>15 377 1147 496 0 0 1440 878 </string>
+ </dict>
+ </dict>
+ <dict>
+ <key>Content</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A7C7EA58104664D900D413D0</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>DayReportCell.m</string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A7C7EA59104664D900D413D0</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>DayReportCell.m</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>A7E9E82B1049F0D80042FD91</string>
+ <key>history</key>
+ <array>
+ <string>A781DCC21048754E003886F0</string>
+ </array>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ </dict>
+ <key>Geometry</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 20}, {1147, 455}}</string>
<key>PBXModuleWindowStatusBarHidden2</key>
<false/>
<key>RubberWindowFrame</key>
- <string>321 210 1216 648 0 0 1440 878 </string>
+ <string>462 269 1147 496 0 0 1440 878 </string>
</dict>
</dict>
</array>
@@ -445,8 +531,10 @@
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
+ <string>A7745D7E0F08D4600009DD76</string>
<string>080E96DDFE201D6D7F000001</string>
<string>A74A71D40EFB0651003B5191</string>
+ <string>A707A33F0FA61305004060D9</string>
<string>29B97315FDCFA39411CA2CEA</string>
<string>A7EB524F104825E3005452BE</string>
<string>29B97323FDCFA39411CA2CEA</string>
@@ -458,13 +546,14 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>32</integer>
- <integer>4</integer>
+ <integer>42</integer>
+ <integer>28</integer>
+ <integer>24</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 471}, {375, 673}}</string>
+ <string>{{0, 481}, {375, 673}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -485,7 +574,7 @@
<real>353</real>
</array>
<key>RubberWindowFrame</key>
- <string>56 139 1346 732 0 0 1440 878 </string>
+ <string>20 109 1346 732 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -503,7 +592,7 @@
<key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>BirneConnect+Totals.m</string>
+ <string>Database.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -511,11 +600,11 @@
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>BirneConnect+Totals.m</string>
+ <string>Database.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>A7EB53EF10484808005452BE</string>
+ <string>A7E9E8241049F0D80042FD91</string>
<key>history</key>
<array>
<string>A74A75640EFD99DC003B5191</string>
@@ -524,8 +613,6 @@
<string>A7A0A6610F2FBE5F00B8E937</string>
<string>A7AB0C300F31223C00085D99</string>
<string>A7AB0C310F31223C00085D99</string>
- <string>A7357CC10F335B4300502F15</string>
- <string>A70619560F358FDE00F605C1</string>
<string>A76D06740F3978140081C7EF</string>
<string>A76D09900F39BC3E0081C7EF</string>
<string>A76D09A70F39BE540081C7EF</string>
@@ -572,49 +659,36 @@
<string>A72F83590FF1F7E300870B9A</string>
<string>A70B01D50FF75AD300E872F5</string>
<string>A7A2496F10038EA500D6D106</string>
- <string>A7A24CF51005011000D6D106</string>
- <string>A79AAAFB1006B35800915637</string>
- <string>A79AAE871008AADF00915637</string>
<string>A7F2728B100B940300C5E8FF</string>
<string>A731C0D31017A53E00EFFF9F</string>
<string>A731C0D41017A53E00EFFF9F</string>
- <string>A778A5B4102F25D50038B5D8</string>
<string>A73479A910396B5500F8F8C1</string>
<string>A7347A031039E96700F8F8C1</string>
<string>A73CE86210428169008778BF</string>
<string>A73CE86710428169008778BF</string>
<string>A73CE9421042B258008778BF</string>
- <string>A73CE9E81042E18E008778BF</string>
<string>A73CEA0D1042E702008778BF</string>
<string>A73CEA101042E702008778BF</string>
<string>A73CEA3D1042E90E008778BF</string>
<string>A73CEA531042EE68008778BF</string>
- <string>A73CEAEA10433790008778BF</string>
<string>A73CEB0810433DE0008778BF</string>
<string>A73CEB3F10434296008778BF</string>
<string>A73CEB8B1043A671008778BF</string>
- <string>A73CEBDB104446DF008778BF</string>
<string>A73CECC410452B29008778BF</string>
- <string>A7C7E861104578BA00D413D0</string>
- <string>A7C7E8A81045903C00D413D0</string>
<string>A7C7E9051045986A00D413D0</string>
<string>A7C7E93610459F8600D413D0</string>
<string>A7C7EA3A104664D900D413D0</string>
<string>A7C7EA3B104664D900D413D0</string>
<string>A7EB490010469556005452BE</string>
- <string>A7EB493510469948005452BE</string>
- <string>A7EB49AD1046AB67005452BE</string>
<string>A7EB4A641046B77F005452BE</string>
<string>A7EB4AFD1046BF3E005452BE</string>
<string>A7EB4B181046C82A005452BE</string>
<string>A7EB4C281046F3BB005452BE</string>
- <string>A7EB4D191046FFFC005452BE</string>
<string>A7EB4D7E1047038C005452BE</string>
<string>A7EB4E401047AB9B005452BE</string>
<string>A7EB4E631047AD98005452BE</string>
<string>A7EB4E771047ADCF005452BE</string>
<string>A7EB4E841047CAB6005452BE</string>
- <string>A7EB4EA31047CCA3005452BE</string>
<string>A7EB4ED21047D0B8005452BE</string>
<string>A7EB4ED31047D0B8005452BE</string>
<string>A7EB4ED61047D0B8005452BE</string>
@@ -625,28 +699,42 @@
<string>A7EB4F311047D52B005452BE</string>
<string>A7EB4F321047D52B005452BE</string>
<string>A7EB4F6A1047D760005452BE</string>
- <string>A7EB4F791047DC14005452BE</string>
- <string>A7EB4FB31047F113005452BE</string>
<string>A7EB50081047FD2A005452BE</string>
- <string>A7EB505E1047FFA4005452BE</string>
- <string>A7EB514310480C0D005452BE</string>
- <string>A7EB517D10480CBE005452BE</string>
- <string>A7EB51C110481FCA005452BE</string>
<string>A7EB51C210481FCA005452BE</string>
- <string>A7EB51C310481FCA005452BE</string>
- <string>A7EB51C410481FCA005452BE</string>
- <string>A7EB51C510481FCA005452BE</string>
- <string>A7EB51C710481FCA005452BE</string>
- <string>A7EB5202104821F0005452BE</string>
- <string>A7EB52661048283C005452BE</string>
<string>A7EB52671048283C005452BE</string>
- <string>A7EB52D510482C5C005452BE</string>
<string>A7EB531D10483F53005452BE</string>
<string>A7EB5343104840E4005452BE</string>
- <string>A7EB53D8104846A2005452BE</string>
- <string>A7EB53D9104846A2005452BE</string>
- <string>A7EB53EC10484808005452BE</string>
- <string>A7EB53ED10484808005452BE</string>
+ <string>A781DCB61048754E003886F0</string>
+ <string>A7E9DD38104956D90042FD91</string>
+ <string>A7E9DF6E10498F380042FD91</string>
+ <string>A7E9E08F104991AD0042FD91</string>
+ <string>A7E9E0E4104995210042FD91</string>
+ <string>A7E9E0E6104995210042FD91</string>
+ <string>A7E9E124104996EF0042FD91</string>
+ <string>A7E9E15F104998B10042FD91</string>
+ <string>A7E9E2EC1049A4A40042FD91</string>
+ <string>A7E9E3581049C2D80042FD91</string>
+ <string>A7E9E3BF1049C6720042FD91</string>
+ <string>A7E9E3D51049C73E0042FD91</string>
+ <string>A7E9E4C41049D50C0042FD91</string>
+ <string>A7E9E4D21049D5620042FD91</string>
+ <string>A7E9E51D1049D7720042FD91</string>
+ <string>A7E9E5331049D9000042FD91</string>
+ <string>A7E9E56D1049DCFB0042FD91</string>
+ <string>A7E9E56E1049DCFB0042FD91</string>
+ <string>A7E9E5701049DCFB0042FD91</string>
+ <string>A7E9E59E1049DEA70042FD91</string>
+ <string>A7E9E5AD1049DF720042FD91</string>
+ <string>A7E9E6131049E3890042FD91</string>
+ <string>A7E9E6331049E4B30042FD91</string>
+ <string>A7E9E66B1049E59E0042FD91</string>
+ <string>A7E9E7091049EA650042FD91</string>
+ <string>A7E9E7331049EBB40042FD91</string>
+ <string>A7E9E7351049EBB40042FD91</string>
+ <string>A7E9E77C1049ECA00042FD91</string>
+ <string>A7E9E7C71049EDB50042FD91</string>
+ <string>A7E9E7C81049EDB50042FD91</string>
+ <string>A7E9E7C91049EDB50042FD91</string>
</array>
<key>prevStack</key>
<array>
@@ -740,16 +828,13 @@
<string>A7C632760FB2A0CD00FA8262</string>
<string>A7B7DFB50FBA056F005729FD</string>
<string>A7834F260FC44C4C000E1599</string>
- <string>A7ACC34F0FE62BE10014DB41</string>
<string>A72F83670FF1F7E300870B9A</string>
<string>A799B0300FF426D20079B31C</string>
<string>A757B5340FF90292000DC459</string>
<string>A731C0D71017A53E00EFFF9F</string>
<string>A778A5B6102F25D50038B5D8</string>
<string>A73CE87410428169008778BF</string>
- <string>A73CE8FA1042967B008778BF</string>
<string>A73CE9511042B258008778BF</string>
- <string>A73CE9891042C561008778BF</string>
<string>A73CE9A11042CAC4008778BF</string>
<string>A73CEA141042E702008778BF</string>
<string>A73CEA151042E702008778BF</string>
@@ -764,18 +849,366 @@
<string>A7C7E93D10459F8600D413D0</string>
<string>A7EB490E10469556005452BE</string>
<string>A7EB494010469948005452BE</string>
- <string>A7EB494410469948005452BE</string>
<string>A7EB4A911046B97D005452BE</string>
<string>A7EB4AB01046BAAF005452BE</string>
<string>A7EB4C151046F38B005452BE</string>
<string>A7EB4C1B1046F38B005452BE</string>
- <string>A7EB51D610481FCA005452BE</string>
- <string>A7EB520A104821F0005452BE</string>
<string>A7EB52991048299E005452BE</string>
- <string>A7EB53DB104846A2005452BE</string>
- <string>A7EB53DC104846A2005452BE</string>
- <string>A7EB53DD104846A2005452BE</string>
- <string>A7EB53EE10484808005452BE</string>
+ <string>A7E9DD3B104956D90042FD91</string>
+ <string>A7E9DE0410496D610042FD91</string>
+ <string>A7E9DE0610496D610042FD91</string>
+ <string>A7E9DE0710496D610042FD91</string>
+ <string>A7E9DE0910496D610042FD91</string>
+ <string>A7E9DE0B10496D610042FD91</string>
+ <string>A7E9DE0C10496D610042FD91</string>
+ <string>A7E9DE0D10496D610042FD91</string>
+ <string>A7E9DE0F10496D610042FD91</string>
+ <string>A7E9DE1110496D610042FD91</string>
+ <string>A7E9DE1310496D610042FD91</string>
+ <string>A7E9DE1510496D610042FD91</string>
+ <string>A7E9DE1610496D610042FD91</string>
+ <string>A7E9DE1810496D610042FD91</string>
+ <string>A7E9DE1A10496D610042FD91</string>
+ <string>A7E9DE1B10496D610042FD91</string>
+ <string>A7E9DE1C10496D610042FD91</string>
+ <string>A7E9DE1E10496D610042FD91</string>
+ <string>A7E9DE1F10496D610042FD91</string>
+ <string>A7E9DE2110496D610042FD91</string>
+ <string>A7E9DE2210496D610042FD91</string>
+ <string>A7E9DE2310496D610042FD91</string>
+ <string>A7E9DE2410496D610042FD91</string>
+ <string>A7E9DE2510496D610042FD91</string>
+ <string>A7E9DE2610496D610042FD91</string>
+ <string>A7E9DE2710496D610042FD91</string>
+ <string>A7E9DE2810496D610042FD91</string>
+ <string>A7E9DE2910496D610042FD91</string>
+ <string>A7E9DE2B10496D610042FD91</string>
+ <string>A7E9DE2C10496D610042FD91</string>
+ <string>A7E9DE2D10496D610042FD91</string>
+ <string>A7E9DE2E10496D610042FD91</string>
+ <string>A7E9DE3010496D610042FD91</string>
+ <string>A7E9DE3210496D610042FD91</string>
+ <string>A7E9DE3410496D610042FD91</string>
+ <string>A7E9DE3510496D610042FD91</string>
+ <string>A7E9DE3610496D610042FD91</string>
+ <string>A7E9DE3710496D610042FD91</string>
+ <string>A7E9DE3810496D610042FD91</string>
+ <string>A7E9DE3A10496D610042FD91</string>
+ <string>A7E9DE3B10496D610042FD91</string>
+ <string>A7E9DE3D10496D610042FD91</string>
+ <string>A7E9DE3E10496D610042FD91</string>
+ <string>A7E9DE3F10496D610042FD91</string>
+ <string>A7E9DE4010496D610042FD91</string>
+ <string>A7E9DE4110496D610042FD91</string>
+ <string>A7E9DE4310496D610042FD91</string>
+ <string>A7E9DEB0104972680042FD91</string>
+ <string>A7E9DEB5104972680042FD91</string>
+ <string>A7E9DF7910498F380042FD91</string>
+ <string>A7E9DF7A10498F380042FD91</string>
+ <string>A7E9DF7B10498F380042FD91</string>
+ <string>A7E9DF7C10498F380042FD91</string>
+ <string>A7E9DF7E10498F380042FD91</string>
+ <string>A7E9DF7F10498F380042FD91</string>
+ <string>A7E9DF8010498F380042FD91</string>
+ <string>A7E9DF8110498F380042FD91</string>
+ <string>A7E9DF8310498F380042FD91</string>
+ <string>A7E9DF8410498F380042FD91</string>
+ <string>A7E9DF8510498F380042FD91</string>
+ <string>A7E9DF8610498F380042FD91</string>
+ <string>A7E9DF8710498F380042FD91</string>
+ <string>A7E9DF8810498F380042FD91</string>
+ <string>A7E9DF8A10498F380042FD91</string>
+ <string>A7E9DF8C10498F380042FD91</string>
+ <string>A7E9DF8E10498F380042FD91</string>
+ <string>A7E9DF8F10498F380042FD91</string>
+ <string>A7E9DF9010498F380042FD91</string>
+ <string>A7E9DF9110498F380042FD91</string>
+ <string>A7E9DF9210498F380042FD91</string>
+ <string>A7E9DF9310498F380042FD91</string>
+ <string>A7E9DF9410498F380042FD91</string>
+ <string>A7E9DF9510498F380042FD91</string>
+ <string>A7E9DF9610498F380042FD91</string>
+ <string>A7E9DF9710498F380042FD91</string>
+ <string>A7E9DF9810498F380042FD91</string>
+ <string>A7E9DF9A10498F380042FD91</string>
+ <string>A7E9DF9B10498F380042FD91</string>
+ <string>A7E9DF9C10498F380042FD91</string>
+ <string>A7E9DF9D10498F380042FD91</string>
+ <string>A7E9DF9E10498F380042FD91</string>
+ <string>A7E9DF9F10498F380042FD91</string>
+ <string>A7E9DFA010498F380042FD91</string>
+ <string>A7E9DFA110498F380042FD91</string>
+ <string>A7E9DFA210498F380042FD91</string>
+ <string>A7E9DFA310498F380042FD91</string>
+ <string>A7E9DFA410498F380042FD91</string>
+ <string>A7E9DFA510498F380042FD91</string>
+ <string>A7E9DFA610498F380042FD91</string>
+ <string>A7E9DFA710498F380042FD91</string>
+ <string>A7E9DFA810498F380042FD91</string>
+ <string>A7E9DFA910498F380042FD91</string>
+ <string>A7E9DFAB10498F380042FD91</string>
+ <string>A7E9DFAF10498F380042FD91</string>
+ <string>A7E9DFB110498F380042FD91</string>
+ <string>A7E9DFB210498F380042FD91</string>
+ <string>A7E9DFB310498F380042FD91</string>
+ <string>A7E9DFB510498F380042FD91</string>
+ <string>A7E9DFB710498F380042FD91</string>
+ <string>A7E9DFB910498F380042FD91</string>
+ <string>A7E9DFBA10498F380042FD91</string>
+ <string>A7E9DFBB10498F380042FD91</string>
+ <string>A7E9DFBD10498F380042FD91</string>
+ <string>A7E9DFBE10498F380042FD91</string>
+ <string>A7E9DFBF10498F380042FD91</string>
+ <string>A7E9DFC110498F380042FD91</string>
+ <string>A7E9DFC210498F380042FD91</string>
+ <string>A7E9DFC310498F380042FD91</string>
+ <string>A7E9DFC410498F380042FD91</string>
+ <string>A7E9DFC510498F380042FD91</string>
+ <string>A7E9DFC610498F380042FD91</string>
+ <string>A7E9DFC710498F380042FD91</string>
+ <string>A7E9DFC810498F380042FD91</string>
+ <string>A7E9DFC910498F380042FD91</string>
+ <string>A7E9DFCB10498F380042FD91</string>
+ <string>A7E9DFCC10498F380042FD91</string>
+ <string>A7E9DFCE10498F380042FD91</string>
+ <string>A7E9DFCF10498F380042FD91</string>
+ <string>A7E9DFD010498F380042FD91</string>
+ <string>A7E9DFD110498F380042FD91</string>
+ <string>A7E9DFD310498F380042FD91</string>
+ <string>A7E9DFD410498F380042FD91</string>
+ <string>A7E9DFD510498F380042FD91</string>
+ <string>A7E9DFD610498F380042FD91</string>
+ <string>A7E9DFD710498F380042FD91</string>
+ <string>A7E9DFD810498F380042FD91</string>
+ <string>A7E9DFD910498F380042FD91</string>
+ <string>A7E9DFDB10498F380042FD91</string>
+ <string>A7E9DFDC10498F380042FD91</string>
+ <string>A7E9DFDD10498F380042FD91</string>
+ <string>A7E9DFDE10498F380042FD91</string>
+ <string>A7E9DFDF10498F380042FD91</string>
+ <string>A7E9DFE010498F380042FD91</string>
+ <string>A7E9DFE110498F380042FD91</string>
+ <string>A7E9DFE310498F380042FD91</string>
+ <string>A7E9DFE410498F380042FD91</string>
+ <string>A7E9DFE510498F380042FD91</string>
+ <string>A7E9DFE610498F380042FD91</string>
+ <string>A7E9DFE710498F380042FD91</string>
+ <string>A7E9DFE810498F380042FD91</string>
+ <string>A7E9DFE910498F380042FD91</string>
+ <string>A7E9DFEA10498F380042FD91</string>
+ <string>A7E9DFEB10498F380042FD91</string>
+ <string>A7E9DFEC10498F380042FD91</string>
+ <string>A7E9DFED10498F380042FD91</string>
+ <string>A7E9DFEE10498F380042FD91</string>
+ <string>A7E9DFF010498F380042FD91</string>
+ <string>A7E9DFF110498F380042FD91</string>
+ <string>A7E9DFFF10498F500042FD91</string>
+ <string>A7E9E038104990400042FD91</string>
+ <string>A7E9E0441049905C0042FD91</string>
+ <string>A7E9E0451049905C0042FD91</string>
+ <string>A7E9E0461049905C0042FD91</string>
+ <string>A7E9E0471049905C0042FD91</string>
+ <string>A7E9E054104990A70042FD91</string>
+ <string>A7E9E080104991420042FD91</string>
+ <string>A7E9E081104991420042FD91</string>
+ <string>A7E9E082104991420042FD91</string>
+ <string>A7E9E091104991AD0042FD91</string>
+ <string>A7E9E0A0104992670042FD91</string>
+ <string>A7E9E0A2104992670042FD91</string>
+ <string>A7E9E0B6104992920042FD91</string>
+ <string>A7E9E0B8104992920042FD91</string>
+ <string>A7E9E0BA104992920042FD91</string>
+ <string>A7E9E0E8104995210042FD91</string>
+ <string>A7E9E0E9104995210042FD91</string>
+ <string>A7E9E0EA104995210042FD91</string>
+ <string>A7E9E0EB104995210042FD91</string>
+ <string>A7E9E0EC104995210042FD91</string>
+ <string>A7E9E0ED104995210042FD91</string>
+ <string>A7E9E0EE104995210042FD91</string>
+ <string>A7E9E0F0104995210042FD91</string>
+ <string>A7E9E101104995350042FD91</string>
+ <string>A7E9E102104995350042FD91</string>
+ <string>A7E9E1151049962C0042FD91</string>
+ <string>A7E9E1161049962C0042FD91</string>
+ <string>A7E9E127104996EF0042FD91</string>
+ <string>A7E9E128104996EF0042FD91</string>
+ <string>A7E9E129104996EF0042FD91</string>
+ <string>A7E9E12A104996EF0042FD91</string>
+ <string>A7E9E12B104996EF0042FD91</string>
+ <string>A7E9E12C104996EF0042FD91</string>
+ <string>A7E9E12D104996EF0042FD91</string>
+ <string>A7E9E150104998280042FD91</string>
+ <string>A7E9E162104998B10042FD91</string>
+ <string>A7E9E16F104998C20042FD91</string>
+ <string>A7E9E19210499C470042FD91</string>
+ <string>A7E9E19310499C470042FD91</string>
+ <string>A7E9E19410499C470042FD91</string>
+ <string>A7E9E1F510499D350042FD91</string>
+ <string>A7E9E21110499D950042FD91</string>
+ <string>A7E9E21310499D950042FD91</string>
+ <string>A7E9E21510499D950042FD91</string>
+ <string>A7E9E21710499D950042FD91</string>
+ <string>A7E9E21810499D950042FD91</string>
+ <string>A7E9E22710499DF50042FD91</string>
+ <string>A7E9E24F1049A0060042FD91</string>
+ <string>A7E9E2501049A0060042FD91</string>
+ <string>A7E9E2511049A0060042FD91</string>
+ <string>A7E9E2521049A0060042FD91</string>
+ <string>A7E9E2531049A0060042FD91</string>
+ <string>A7E9E2541049A0060042FD91</string>
+ <string>A7E9E2551049A0060042FD91</string>
+ <string>A7E9E2561049A0060042FD91</string>
+ <string>A7E9E2571049A0060042FD91</string>
+ <string>A7E9E2581049A0060042FD91</string>
+ <string>A7E9E2591049A0060042FD91</string>
+ <string>A7E9E25A1049A0060042FD91</string>
+ <string>A7E9E25B1049A0060042FD91</string>
+ <string>A7E9E26F1049A0860042FD91</string>
+ <string>A7E9E27E1049A1280042FD91</string>
+ <string>A7E9E27F1049A1280042FD91</string>
+ <string>A7E9E2801049A1280042FD91</string>
+ <string>A7E9E28F1049A1BE0042FD91</string>
+ <string>A7E9E2901049A1BE0042FD91</string>
+ <string>A7E9E29C1049A1CB0042FD91</string>
+ <string>A7E9E2B11049A24C0042FD91</string>
+ <string>A7E9E2C51049A2AC0042FD91</string>
+ <string>A7E9E2D81049A3180042FD91</string>
+ <string>A7E9E2D91049A3180042FD91</string>
+ <string>A7E9E2DA1049A3180042FD91</string>
+ <string>A7E9E2F01049A4A40042FD91</string>
+ <string>A7E9E2F11049A4A40042FD91</string>
+ <string>A7E9E2F21049A4A40042FD91</string>
+ <string>A7E9E2F31049A4A40042FD91</string>
+ <string>A7E9E2F41049A4A40042FD91</string>
+ <string>A7E9E2F51049A4A40042FD91</string>
+ <string>A7E9E2F61049A4A40042FD91</string>
+ <string>A7E9E2F71049A4A40042FD91</string>
+ <string>A7E9E2F81049A4A40042FD91</string>
+ <string>A7E9E2F91049A4A40042FD91</string>
+ <string>A7E9E2FA1049A4A40042FD91</string>
+ <string>A7E9E2FB1049A4A40042FD91</string>
+ <string>A7E9E3311049C1510042FD91</string>
+ <string>A7E9E3321049C1510042FD91</string>
+ <string>A7E9E3331049C1510042FD91</string>
+ <string>A7E9E35C1049C2D80042FD91</string>
+ <string>A7E9E35D1049C2D80042FD91</string>
+ <string>A7E9E35E1049C2D80042FD91</string>
+ <string>A7E9E35F1049C2D80042FD91</string>
+ <string>A7E9E3601049C2D80042FD91</string>
+ <string>A7E9E3611049C2D80042FD91</string>
+ <string>A7E9E3621049C2D80042FD91</string>
+ <string>A7E9E3631049C2D80042FD91</string>
+ <string>A7E9E3701049C3A00042FD91</string>
+ <string>A7E9E3941049C4900042FD91</string>
+ <string>A7E9E3A11049C4AA0042FD91</string>
+ <string>A7E9E3A21049C4AA0042FD91</string>
+ <string>A7E9E3C11049C6720042FD91</string>
+ <string>A7E9E3C21049C6720042FD91</string>
+ <string>A7E9E3D71049C73E0042FD91</string>
+ <string>A7E9E3D81049C73E0042FD91</string>
+ <string>A7E9E3F91049C8810042FD91</string>
+ <string>A7E9E3FA1049C8810042FD91</string>
+ <string>A7E9E3FC1049C8810042FD91</string>
+ <string>A7E9E4091049C8E20042FD91</string>
+ <string>A7E9E40B1049C8E20042FD91</string>
+ <string>A7E9E40C1049C8E20042FD91</string>
+ <string>A7E9E4231049C91C0042FD91</string>
+ <string>A7E9E4241049C91C0042FD91</string>
+ <string>A7E9E4261049C91C0042FD91</string>
+ <string>A7E9E4271049C91C0042FD91</string>
+ <string>A7E9E43A1049C9360042FD91</string>
+ <string>A7E9E4461049C95C0042FD91</string>
+ <string>A7E9E45D1049C9820042FD91</string>
+ <string>A7E9E4761049CB4C0042FD91</string>
+ <string>A7E9E4781049CB4C0042FD91</string>
+ <string>A7E9E4921049CDF20042FD91</string>
+ <string>A7E9E4931049CDF20042FD91</string>
+ <string>A7E9E4951049CDF20042FD91</string>
+ <string>A7E9E4961049CDF20042FD91</string>
+ <string>A7E9E4A61049CE330042FD91</string>
+ <string>A7E9E4D41049D5620042FD91</string>
+ <string>A7E9E4D51049D5620042FD91</string>
+ <string>A7E9E4E51049D6700042FD91</string>
+ <string>A7E9E4E61049D6700042FD91</string>
+ <string>A7E9E4E71049D6700042FD91</string>
+ <string>A7E9E4E81049D6700042FD91</string>
+ <string>A7E9E4E91049D6700042FD91</string>
+ <string>A7E9E4EA1049D6700042FD91</string>
+ <string>A7E9E4EB1049D6700042FD91</string>
+ <string>A7E9E4EC1049D6700042FD91</string>
+ <string>A7E9E51F1049D7720042FD91</string>
+ <string>A7E9E5201049D7720042FD91</string>
+ <string>A7E9E5211049D7720042FD91</string>
+ <string>A7E9E5371049D9000042FD91</string>
+ <string>A7E9E5381049D9000042FD91</string>
+ <string>A7E9E5391049D9000042FD91</string>
+ <string>A7E9E53A1049D9000042FD91</string>
+ <string>A7E9E53B1049D9000042FD91</string>
+ <string>A7E9E5751049DCFB0042FD91</string>
+ <string>A7E9E5761049DCFB0042FD91</string>
+ <string>A7E9E5771049DCFB0042FD91</string>
+ <string>A7E9E5781049DCFB0042FD91</string>
+ <string>A7E9E5791049DCFB0042FD91</string>
+ <string>A7E9E57A1049DCFB0042FD91</string>
+ <string>A7E9E57B1049DCFB0042FD91</string>
+ <string>A7E9E57C1049DCFB0042FD91</string>
+ <string>A7E9E57D1049DCFB0042FD91</string>
+ <string>A7E9E57E1049DCFB0042FD91</string>
+ <string>A7E9E57F1049DCFB0042FD91</string>
+ <string>A7E9E5801049DCFB0042FD91</string>
+ <string>A7E9E5811049DCFB0042FD91</string>
+ <string>A7E9E5821049DCFB0042FD91</string>
+ <string>A7E9E5831049DCFB0042FD91</string>
+ <string>A7E9E5931049DE7B0042FD91</string>
+ <string>A7E9E5A11049DEA70042FD91</string>
+ <string>A7E9E5A21049DEA70042FD91</string>
+ <string>A7E9E5B11049DF720042FD91</string>
+ <string>A7E9E5B21049DF720042FD91</string>
+ <string>A7E9E5B31049DF720042FD91</string>
+ <string>A7E9E5B41049DF720042FD91</string>
+ <string>A7E9E5B51049DF720042FD91</string>
+ <string>A7E9E5B61049DF720042FD91</string>
+ <string>A7E9E5B71049DF720042FD91</string>
+ <string>A7E9E5C31049E0600042FD91</string>
+ <string>A7E9E5CF1049E0820042FD91</string>
+ <string>A7E9E5DB1049E0930042FD91</string>
+ <string>A7E9E5F81049E22A0042FD91</string>
+ <string>A7E9E6051049E2BB0042FD91</string>
+ <string>A7E9E6151049E3890042FD91</string>
+ <string>A7E9E6161049E3890042FD91</string>
+ <string>A7E9E6171049E3890042FD91</string>
+ <string>A7E9E6181049E3890042FD91</string>
+ <string>A7E9E6191049E3890042FD91</string>
+ <string>A7E9E61A1049E3890042FD91</string>
+ <string>A7E9E61B1049E3890042FD91</string>
+ <string>A7E9E61C1049E3890042FD91</string>
+ <string>A7E9E61D1049E3890042FD91</string>
+ <string>A7E9E6361049E4B30042FD91</string>
+ <string>A7E9E6371049E4B30042FD91</string>
+ <string>A7E9E6381049E4B30042FD91</string>
+ <string>A7E9E6481049E5550042FD91</string>
+ <string>A7E9E6491049E5550042FD91</string>
+ <string>A7E9E64A1049E5550042FD91</string>
+ <string>A7E9E64B1049E5550042FD91</string>
+ <string>A7E9E64C1049E5550042FD91</string>
+ <string>A7E9E66D1049E59E0042FD91</string>
+ <string>A7E9E6791049E5D90042FD91</string>
+ <string>A7E9E6861049E5E70042FD91</string>
+ <string>A7E9E6921049E6C50042FD91</string>
+ <string>A7E9E6AB1049E8530042FD91</string>
+ <string>A7E9E70B1049EA650042FD91</string>
+ <string>A7E9E70C1049EA650042FD91</string>
+ <string>A7E9E72A1049EB950042FD91</string>
+ <string>A7E9E7371049EBB40042FD91</string>
+ <string>A7E9E7381049EBB40042FD91</string>
+ <string>A7E9E7391049EBB40042FD91</string>
+ <string>A7E9E73A1049EBB40042FD91</string>
+ <string>A7E9E7581049EC090042FD91</string>
+ <string>A7E9E7721049EC870042FD91</string>
+ <string>A7E9E77E1049ECA00042FD91</string>
+ <string>A7E9E7CA1049EDB50042FD91</string>
+ <string>A7E9E7CB1049EDB50042FD91</string>
+ <string>A7E9E7CC1049EDB50042FD91</string>
</array>
</dict>
<key>SplitCount</key>
@@ -789,7 +1222,7 @@
<key>Frame</key>
<string>{{0, 0}, {949, 539}}</string>
<key>RubberWindowFrame</key>
- <string>56 139 1346 732 0 0 1440 878 </string>
+ <string>20 109 1346 732 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
@@ -814,7 +1247,7 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>A7EB53F010484808005452BE</string>
+ <string>A7E9E8251049F0D80042FD91</string>
<key>history</key>
<array>
<string>A74A75640EFD99DC003B5191</string>
@@ -917,12 +1350,10 @@
<string>A7EB490010469556005452BE</string>
<string>A7EB490110469556005452BE</string>
<string>A7EB493510469948005452BE</string>
- <string>A7EB49AD1046AB67005452BE</string>
<string>A7EB49C21046AC4C005452BE</string>
<string>A7EB4A641046B77F005452BE</string>
<string>A7EB4A891046B97D005452BE</string>
<string>A7EB4AA81046BAAF005452BE</string>
- <string>A7EB4AD51046BDAA005452BE</string>
<string>A7EB4AE91046BE43005452BE</string>
<string>A7EB4AFD1046BF3E005452BE</string>
<string>A7EB4B0D1046C6B2005452BE</string>
@@ -941,7 +1372,7 @@
<string>A7EB4E421047AB9B005452BE</string>
<string>A7EB4E431047AB9B005452BE</string>
<string>A7EB53B910484330005452BE</string>
- <string>A7EB53BA10484330005452BE</string>
+ <string>A781DCBF1048754E003886F0</string>
</array>
<key>prevStack</key>
<array>
@@ -1042,9 +1473,7 @@
<string>A731C0D71017A53E00EFFF9F</string>
<string>A778A5B6102F25D50038B5D8</string>
<string>A73CE87410428169008778BF</string>
- <string>A73CE8FA1042967B008778BF</string>
<string>A73CE9511042B258008778BF</string>
- <string>A73CE9891042C561008778BF</string>
<string>A73CE9A11042CAC4008778BF</string>
<string>A73CEA141042E702008778BF</string>
<string>A73CEA151042E702008778BF</string>
@@ -1065,7 +1494,6 @@
<string>A7EB4AB01046BAAF005452BE</string>
<string>A7EB4C151046F38B005452BE</string>
<string>A7EB4C1B1046F38B005452BE</string>
- <string>A7EB53BB10484330005452BE</string>
</array>
</dict>
<key>SplitCount</key>
@@ -1077,9 +1505,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 545}, {949, 43}}</string>
+ <string>{{0, 544}, {949, 43}}</string>
<key>RubberWindowFrame</key>
- <string>56 139 1346 732 0 0 1440 878 </string>
+ <string>20 109 1346 732 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
@@ -1099,7 +1527,7 @@
<key>Frame</key>
<string>{{0, 592}, {949, 99}}</string>
<key>RubberWindowFrame</key>
- <string>56 139 1346 732 0 0 1440 878 </string>
+ <string>20 109 1346 732 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -1124,9 +1552,9 @@
</array>
<key>TableOfContents</key>
<array>
- <string>A7EB53BD10484330005452BE</string>
+ <string>A7E9DD0B10494F380042FD91</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>A7EB53BE10484330005452BE</string>
+ <string>A7E9DD0C10494F380042FD91</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
@@ -1261,19 +1689,24 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>A7EB53D510484534005452BE</string>
- <string>A7EB53D710484534005452BE</string>
- <string>A78E2B7C0EFA2263002EB6D9</string>
- <string>A73CED3110456D77008778BF</string>
+ <string>A7E9E8151049EFEA0042FD91</string>
+ <string>A7E9E00710498F500042FD91</string>
+ <string>A7E9DFFC10498F380042FD91</string>
+ <string>1C530D57069F1CE1000CFCEE</string>
+ <string>1CD10A99069EF8BA00B06720</string>
+ <string>A7C7EA58104664D900D413D0</string>
+ <string>A7E9DD67104957DF0042FD91</string>
<string>A7EB491510469556005452BE</string>
+ <string>A73CED3110456D77008778BF</string>
+ <string>A7E9E01110498F810042FD91</string>
<string>A7C7E8B61045903C00D413D0</string>
- <string>A7C7EA58104664D900D413D0</string>
- <string>1CD10A99069EF8BA00B06720</string>
+ <string>A7E9E05F104990B10042FD91</string>
+ <string>A78E2B7C0EFA2263002EB6D9</string>
<string>1C78EAAD065D492600B07095</string>
<string>/Users/Oliver/Documents/iphone/Projects/ASiST/trunk/ASiST.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>56 139 1346 732 0 0 1440 878 </string>
+ <string>20 109 1346 732 0 0 1440 878 </string>
<key>WindowToolsV3</key>
<array>
<dict>
@@ -1289,32 +1722,34 @@
<key>Dock</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
- <string></string>
+ <string>BirneConnect.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {1108, 432}}</string>
+ <string>{{0, 0}, {1227, 462}}</string>
<key>RubberWindowFrame</key>
- <string>913 246 1108 632 0 0 1440 878 </string>
+ <string>646 160 1227 718 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>432pt</string>
+ <string>462pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXBuildLogShowsTranscriptDefaultKey</key>
- <string>{{0, 98}, {1108, 56}}</string>
+ <string>{{0, 181}, {1227, 29}}</string>
<key>PBXProjectModuleGUID</key>
<string>XCMainBuildResultsModuleGUID</string>
<key>PBXProjectModuleLabel</key>
@@ -1327,18 +1762,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 437}, {1108, 154}}</string>
+ <string>{{0, 467}, {1227, 210}}</string>
<key>RubberWindowFrame</key>
- <string>913 246 1108 632 0 0 1440 878 </string>
+ <string>646 160 1227 718 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Proportion</key>
- <string>154pt</string>
+ <string>210pt</string>
</dict>
</array>
<key>Proportion</key>
- <string>591pt</string>
+ <string>677pt</string>
</dict>
</array>
<key>Name</key>
@@ -1352,18 +1787,18 @@
<key>TableOfContents</key>
<array>
<string>A78E2B7C0EFA2263002EB6D9</string>
- <string>A7EB53D310484534005452BE</string>
+ <string>A7E9DD2B104952CE0042FD91</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildV3</string>
<key>WindowString</key>
- <string>913 246 1108 632 0 0 1440 878 </string>
+ <string>646 160 1227 718 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>A78E2B7C0EFA2263002EB6D9</string>
<key>WindowToolIsVisible</key>
- <false/>
+ <true/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
@@ -1446,10 +1881,10 @@
<key>Frame</key>
<string>{{615, 0}, {733, 379}}</string>
<key>RubberWindowFrame</key>
- <string>149 64 1348 751 0 0 1440 878 </string>
+ <string>561 109 1348 751 0 0 1440 878 </string>
</dict>
<key>RubberWindowFrame</key>
- <string>149 64 1348 751 0 0 1440 878 </string>
+ <string>561 109 1348 751 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXDebugSessionModule</string>
@@ -1472,22 +1907,22 @@
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
- <string>A7EB53C310484330005452BE</string>
+ <string>A7E9DD1110494F380042FD91</string>
<string>1C162984064C10D400B95A72</string>
- <string>A7EB53C410484330005452BE</string>
- <string>A7EB53C510484330005452BE</string>
- <string>A7EB53C610484330005452BE</string>
- <string>A7EB53C710484330005452BE</string>
- <string>A7EB53C810484330005452BE</string>
+ <string>A7E9DD1210494F380042FD91</string>
+ <string>A7E9DD1310494F380042FD91</string>
+ <string>A7E9DD1410494F380042FD91</string>
+ <string>A7E9DD1510494F380042FD91</string>
+ <string>A7E9DD1610494F380042FD91</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
<key>WindowString</key>
- <string>149 64 1348 751 0 0 1440 878 </string>
+ <string>561 109 1348 751 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>1CD10A99069EF8BA00B06720</string>
<key>WindowToolIsVisible</key>
- <true/>
+ <false/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
@@ -1512,7 +1947,7 @@
<key>PBXProjectModuleGUID</key>
<string>1CDD528C0622207200134675</string>
<key>PBXProjectModuleLabel</key>
- <string>ReportAppsController.m</string>
+ <string>Database.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
@@ -1521,7 +1956,7 @@
<key>Frame</key>
<string>{{0, 0}, {1130, 472}}</string>
<key>RubberWindowFrame</key>
- <string>164 91 1130 787 0 0 1440 878 </string>
+ <string>201 86 1130 787 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
@@ -1545,7 +1980,7 @@
<key>Frame</key>
<string>{{0, 477}, {1130, 269}}</string>
<key>RubberWindowFrame</key>
- <string>164 91 1130 787 0 0 1440 878 </string>
+ <string>201 86 1130 787 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
@@ -1568,13 +2003,13 @@
<key>TableOfContents</key>
<array>
<string>1C530D57069F1CE1000CFCEE</string>
- <string>A7EB49A81046AB59005452BE</string>
- <string>A7EB49A91046AB59005452BE</string>
+ <string>A7E9DE4D10496D610042FD91</string>
+ <string>A7E9DE4E10496D610042FD91</string>
<string>1CDD528C0622207200134675</string>
<string>1CD0528E0623707200166675</string>
</array>
<key>WindowString</key>
- <string>164 91 1130 787 0 0 1440 878 </string>
+ <string>201 86 1130 787 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>1C530D57069F1CE1000CFCEE</string>
<key>WindowToolIsVisible</key>
@@ -1611,7 +2046,7 @@
<key>Frame</key>
<string>{{0, 0}, {981, 442}}</string>
<key>RubberWindowFrame</key>
- <string>326 386 981 483 0 0 1440 878 </string>
+ <string>29 371 981 483 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXDebugCLIModule</string>
@@ -1634,13 +2069,13 @@
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
- <string>A7EB53D410484534005452BE</string>
+ <string>A7E9DFFA10498F380042FD91</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.consoleV3</string>
<key>WindowString</key>
- <string>326 386 981 483 0 0 1440 878 </string>
+ <string>29 371 981 483 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
@@ -1929,8 +2364,8 @@
<true/>
<key>TableOfContents</key>
<array>
- <string>A7EB49FD1046AF32005452BE</string>
- <string>A7EB49FE1046AF32005452BE</string>
+ <string>A7E9E01110498F810042FD91</string>
+ <string>A7E9E01210498F810042FD91</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>1CA1AED706398EBD00589147</string>
</array>
@@ -1939,7 +2374,7 @@
<key>WindowString</key>
<string>595 435 744 409 0 0 1440 878 </string>
<key>WindowToolGUID</key>
- <string>A7EB49FD1046AF32005452BE</string>
+ <string>A7E9E01110498F810042FD91</string>
<key>WindowToolIsVisible</key>
<true/>
</dict>
View
24,003 ASiST.xcodeproj/Oliver.pbxuser
23,616 additions, 387 deletions not shown
View
17 ASiST.xcodeproj/project.pbxproj
@@ -38,7 +38,6 @@
A7325BA00F21C9920053AEB1 /* ReportRootController.m in Sources */ = {isa = PBXBuildFile; fileRef = A7325B9F0F21C9920053AEB1 /* ReportRootController.m */; };
A7357AF80F3348C900502F15 /* StatusInfoController.m in Sources */ = {isa = PBXBuildFile; fileRef = A7357AF70F3348C900502F15 /* StatusInfoController.m */; };
A736BF360F4100B300126FD3 /* NIO.png in Resources */ = {isa = PBXBuildFile; fileRef = A736BF350F4100B300126FD3 /* NIO.png */; };
- A73CE851104271CC008778BF /* BirneConnect+Totals.m in Sources */ = {isa = PBXBuildFile; fileRef = A73CE850104271CC008778BF /* BirneConnect+Totals.m */; };
A73CEA021042E517008778BF /* ButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A73CEA011042E517008778BF /* ButtonCell.m */; };
A73CEB38104340A5008778BF /* EmptyNano.png in Resources */ = {isa = PBXBuildFile; fileRef = A73CEB37104340A5008778BF /* EmptyNano.png */; };
A73CEBC81044444D008778BF /* CalendarDayView.m in Sources */ = {isa = PBXBuildFile; fileRef = A73CEBC71044444D008778BF /* CalendarDayView.m */; };
@@ -320,8 +319,6 @@
A7357AF60F3348C900502F15 /* StatusInfoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusInfoController.h; sourceTree = "<group>"; };
A7357AF70F3348C900502F15 /* StatusInfoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusInfoController.m; sourceTree = "<group>"; };
A736BF350F4100B300126FD3 /* NIO.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NIO.png; sourceTree = "<group>"; };
- A73CE84F104271CC008778BF /* BirneConnect+Totals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "BirneConnect+Totals.h"; path = "../BirneConnect+Totals.h"; sourceTree = "<group>"; };
- A73CE850104271CC008778BF /* BirneConnect+Totals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "BirneConnect+Totals.m"; path = "../BirneConnect+Totals.m"; sourceTree = "<group>"; };
A73CEA001042E517008778BF /* ButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonCell.h; sourceTree = "<group>"; };
A73CEA011042E517008778BF /* ButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ButtonCell.m; sourceTree = "<group>"; };
A73CEB37104340A5008778BF /* EmptyNano.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = EmptyNano.png; sourceTree = "<group>"; };
@@ -625,8 +622,6 @@
1D3623250D0F684500981E51 /* ASiSTAppDelegate.m */,
A70D5A7A0F17A66700A6FE9B /* YahooFinance.h */,
A70D5A7B0F17A66700A6FE9B /* YahooFinance.m */,
- A73CE84F104271CC008778BF /* BirneConnect+Totals.h */,
- A73CE850104271CC008778BF /* BirneConnect+Totals.m */,
A7EDD37D0FA4E8C40079FE78 /* BirneConnect.h */,
A7EDD37E0FA4E8C40079FE78 /* BirneConnect.m */,
A780D1710F25D2F600C796FB /* ChartView.h */,
@@ -922,7 +917,6 @@
A7EDD3830FA4E8C40079FE78 /* Country.h */,
A7EDD3840FA4E8C40079FE78 /* Country.m */,
A74A75070EFD5FA3003B5191 /* apps.db */,
- A74A71D10EFB0644003B5191 /* schema.sql */,
A74A75450EFD7117003B5191 /* App.h */,
A74A75460EFD7117003B5191 /* App.m */,
A7EDD3850FA4E8C40079FE78 /* Report.h */,
@@ -1080,6 +1074,7 @@
A7EB524F104825E3005452BE /* SQL Scripts */ = {
isa = PBXGroup;
children = (
+ A74A71D10EFB0644003B5191 /* schema.sql */,
A7EB5258104825F9005452BE /* update_0_to_1.sql */,
);
name = "SQL Scripts";
@@ -1395,7 +1390,6 @@
A7EDD38D0FA4E8C40079FE78 /* Report.m in Sources */,
A7EDD38E0FA4E8C40079FE78 /* ReportViewController.m in Sources */,
A7ACC3230FE6290E0014DB41 /* NSString+Helpers.m in Sources */,
- A73CE851104271CC008778BF /* BirneConnect+Totals.m in Sources */,
A73CEA021042E517008778BF /* ButtonCell.m in Sources */,
A73CEBC81044444D008778BF /* CalendarDayView.m in Sources */,
A7C7E92B10459E3000D413D0 /* DayReportCell.m in Sources */,
@@ -1453,6 +1447,9 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
@@ -1488,6 +1485,9 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
@@ -1503,6 +1503,9 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
View
2  App.m
@@ -97,6 +97,8 @@ - (id) initWithTitle:(NSString *)a_title vendor_identifier:(NSString *)a_vendor_
apple_identifier = a_apple_identifier;
self.company_name = a_company_name;
+ isNew = YES;
+
[self insertIntoDatabase:database];
[self loadImageFromBirne];
View
18 BirneConnect+Totals.h
@@ -1,18 +0,0 @@
-//
-// SummaryMaker.h
-// ASiST
-//
-// Created by Oliver on 24.08.09.
-// Copyright 2009 Drobnik.com. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-#import "BirneConnect.h"
-
-
-@interface BirneConnect (Totals)
-
-- (void)getTotals;
-
-@end
View
182 BirneConnect+Totals.m
@@ -1,182 +0,0 @@
-//
-// SummaryMaker.m
-// ASiST
-//
-// Created by Oliver on 24.08.09.
-// Copyright 2009 Drobnik.com. All rights reserved.
-//
-
-#import "BirneConnect+Totals.h"
-#import "YahooFinance.h"
-
-
-@implementation BirneConnect (Totals)
-
-
-/*
- select app_id, royalty_currency, count(*), sum(royalty_price) from report r, sale s where r.id = s.report_id and report_type_id = 0 and type_id=1 group by app_id, royalty_currency;
- */
-
-// prepare a statement
-static sqlite3_stmt *total_statement = nil;
-
-
-- (void)getTotals
-{
- // return dictionary
- NSMutableDictionary *byAppDict = [NSMutableDictionary dictionary];
- NSMutableDictionary *byReportDict = [NSMutableDictionary dictionary];
-
-
- // Compile the query for retrieving book data. See insertNewBookIntoDatabase: for more detail.
- if (total_statement == nil) {
- // Note the '?' at the end of the query. This is a parameter which can be replaced by a bound variable.
- // This is a great way to optimize because frequently used queries can be compiled once, then with each
- // use new variable values can be bound to placeholders.
- const char *sql = "SELECT app_id, royalty_currency, sum(units), sum(units*royalty_price), report_id, min(report_type_id) FROM report r, sale s WHERE r.id = s.report_id and type_id=1 group by report_id, app_id, royalty_currency";
- if (sqlite3_prepare_v2(database, sql, -1, &total_statement, NULL) != SQLITE_OK) {
- NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
- }
- }
- // For this query, we bind the primary key to the first (and only) placeholder in the statement.
- // Note that the parameters are numbered from 1, not from 0.
- while (sqlite3_step(total_statement) == SQLITE_ROW)
- {
- NSUInteger app_id = sqlite3_column_int(total_statement, 0);
- NSString *currency_code = [NSString stringWithUTF8String:(char *)sqlite3_column_text(total_statement, 1)];
- NSUInteger units = sqlite3_column_int(total_statement, 2);
- double royalties = sqlite3_column_double(total_statement, 3);
- NSUInteger report_id = sqlite3_column_int(total_statement, 4);
- ReportType report_type_id = (ReportType)sqlite3_column_int(total_statement, 5);
-
-
- // sort the daily reports by app id
- if (report_type_id == ReportTypeDay)
- {
- // one dictionary per app, keys are currencies
- NSMutableDictionary *appDict = [byAppDict objectForKey:[NSNumber numberWithInt:app_id]];
-
- if (!appDict)
- {
- appDict = [NSMutableDictionary dictionary];
- [byAppDict setObject:appDict forKey:[NSNumber numberWithInt:app_id]];
- }
-
- NSMutableDictionary *sumsByCurrency = [appDict objectForKey:@"SumsByCurrency"];
- if (!sumsByCurrency)
- {
- sumsByCurrency = [NSMutableDictionary dictionary];
- [appDict setObject:sumsByCurrency forKey:@"SumsByCurrency"];
- }
-
- // save individual currencies
- double royalties_plus_previous = royalties + [[sumsByCurrency objectForKey:currency_code] doubleValue];
- [sumsByCurrency setObject:[NSNumber numberWithDouble:royalties_plus_previous] forKey:currency_code];
-
-
- if (!royalties)
- {
- // count as free
-
- NSNumber *unitsEntry = [appDict objectForKey:@"UnitsFree"];
-
- if (!unitsEntry)
- {
- unitsEntry = [NSNumber numberWithInt:units];
- }
- else
- {
- unitsEntry = [NSNumber numberWithInt:(units + [unitsEntry intValue])];
- }
-
- [appDict setObject:unitsEntry forKey:@"UnitsFree"];
-
- }
- else
- {
- // count as paid
-
- NSNumber *unitsEntry = [appDict objectForKey:@"UnitsPaid"];
-
- if (!unitsEntry)
- {
- unitsEntry = [NSNumber numberWithInt:units];
- }
- else
- {
- unitsEntry = [NSNumber numberWithInt:(units + [unitsEntry intValue])];
- }
-
- [appDict setObject:unitsEntry forKey:@"UnitsPaid"];
-
- }
- }
-
-
- // sort all other sums into another dictionary
- NSMutableDictionary *reportDict = [byReportDict objectForKey:[NSNumber numberWithInt:report_id]];
-
- if (!reportDict)
- {
- reportDict = [NSMutableDictionary dictionary];
- [byReportDict setObject:reportDict forKey:[NSNumber numberWithInt:report_id]];
- }
-
- NSMutableDictionary *sumsByCurrency = [reportDict objectForKey:@"SumsByCurrency"];
- if (!sumsByCurrency)
- {
- sumsByCurrency = [NSMutableDictionary dictionary];
- [reportDict setObject:sumsByCurrency forKey:@"SumsByCurrency"];
- }
-
- // save individual currencies
- double royalties_plus_previous = royalties + [[sumsByCurrency objectForKey:currency_code] doubleValue];
- [sumsByCurrency setObject:[NSNumber numberWithDouble:royalties_plus_previous] forKey:currency_code];
-
- if (!royalties)
- {
- // count as free
-
- NSNumber *unitsEntry = [reportDict objectForKey:@"UnitsFree"];
-
- if (!unitsEntry)
- {
- unitsEntry = [NSNumber numberWithInt:units];
- }
- else
- {
- unitsEntry = [NSNumber numberWithInt:(units + [unitsEntry intValue])];
- }
-
- [reportDict setObject:unitsEntry forKey:@"UnitsFree"];
-
- }
- else
- {
- // count as paid
-
- NSNumber *unitsEntry = [reportDict objectForKey:@"UnitsPaid"];
-
- if (!unitsEntry)
- {
- unitsEntry = [NSNumber numberWithInt:units];
- }
- else
- {
- unitsEntry = [NSNumber numberWithInt:(units + [unitsEntry intValue])];
- }
-
- [reportDict setObject:unitsEntry forKey:@"UnitsPaid"];
-
- }
- }
- // Reset the statement for future reuse.
- sqlite3_reset(total_statement);
-
- NSDictionary *retDict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:byAppDict, byReportDict, nil] forKeys:[NSArray arrayWithObjects:@"ByApp", @"ByReport", nil]];
-
- NSLog([retDict description]);
- [[NSNotificationCenter defaultCenter] postNotificationName:@"AppTotalsUpdated" object:nil userInfo:(id)retDict];
-}
-
-@end
View
6 Classes/ASiSTAppDelegate.h
@@ -38,9 +38,6 @@
// preferences
BOOL convertSalesToMainCurrency;
- NSUInteger newApps;
- NSUInteger newReports;
-
IBOutlet UITabBarItem* appBadgeItem;
IBOutlet UITabBarItem* reportBadgeItem;
@@ -78,9 +75,8 @@
- (void)newAppNotification:(NSNotification *) notification;
- (void)newReportNotification:(NSNotification *) notification;
-
-
- (void) refreshButton:(id)sender;
+- (void) emptyCache;
@end
View
50 Classes/ASiSTAppDelegate.m
@@ -12,9 +12,8 @@
#import "ReportViewController.h"
#import "StatusInfoController.h"
-//#import "NSDataCompression.h"
#import "BirneConnect.h"
-#import "BirneConnect+Totals.h"
+#import "Database.h"
// for the HTTP server
#import "HTTPServer.h"
@@ -144,7 +143,7 @@ - (void)dealloc {
- (void)newFileInDocuments:(NSNotification *) notification
{
NSLog(@"New File");
- [self.itts importReportsFromDocumentsFolder];
+ [DB importReportsFromDocumentsFolder];
}
@@ -252,7 +251,7 @@ - (void)newReportNotification:(NSNotification *) notification
{
NSDictionary *tmpDict = [notification userInfo];
- newReports = [[tmpDict objectForKey:@"NewReports"] intValue];
+ int newReports = [[tmpDict objectForKey:@"NewReports"] intValue];
if (newReports)
{
@@ -287,7 +286,7 @@ - (void)newReportRead:(NSNotification *) notification
{
NSDictionary *tmpDict = [notification userInfo];
- newReports = [[tmpDict objectForKey:@"NewReports"] intValue];
+ int newReports = [[tmpDict objectForKey:@"NewReports"] intValue];
if (newReports)
{
@@ -312,7 +311,7 @@ - (void)newAppNotification:(NSNotification *) notification
{
NSDictionary *tmpDict = [notification userInfo];
- newApps = [[tmpDict objectForKey:@"NewApps"] intValue];
+ int newApps = [[tmpDict objectForKey:@"NewApps"] intValue];
if (newApps)
{
@@ -357,4 +356,43 @@ - (void)displayInfoUpdate:(NSNotification *) notification
info = [info stringByAppendingString:@"Web: No Connection\n"];
}
+#pragma mark Misc
+
+- (void) emptyCache
+{
+ NSFileManager *fileManager = [NSFileManager defaultManager];
+ // NSError *error;
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+
+ // get list of all files in document directory
+ NSArray *docs = [fileManager directoryContentsAtPath:documentsDirectory];
+ NSEnumerator *enu = [docs objectEnumerator];
+ NSString *aString;
+
+ NSError *error;
+
+ while (aString = [enu nextObject])
+ {
+ NSString *pathOfFile = [documentsDirectory stringByAppendingPathComponent:aString];
+
+ if ([aString isEqualToString:@"apps.db"]||[aString isEqualToString:@"settings.plist"]
+ ||[aString isEqualToString:@"Currencies.plist"]||[aString isEqualToString:@"simkeychain.plist"])
+ {
+ // excepted
+ }
+ else
+ {
+ NSLog(@"removed %@", pathOfFile);
+ // all others removed
+ [fileManager removeItemAtPath:pathOfFile error:&error];
+ }
+ }
+
+ // reload app icons
+ [DB reloadAllAppIcons];
+
+}
+
+
@end
View
14 Classes/AppViewController.m
@@ -112,10 +112,9 @@ - (UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryType
}
// Customize the number of rows in the table view.
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- ASiSTAppDelegate *appDelegate = (ASiSTAppDelegate *)[[UIApplication sharedApplication] delegate];
- int c = [[appDelegate.itts apps] count];
- return c;
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return [DB countOfApps];
}
@@ -130,10 +129,9 @@ - (AppCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPa
}
// Set up the cell...
- ASiSTAppDelegate *appDelegate = (ASiSTAppDelegate *)[[UIApplication sharedApplication] delegate];
- NSNumber *app_id = [[appDelegate.itts appKeysSortedBySales] objectAtIndex:indexPath.row];
- App *myApp = [appDelegate.itts.apps objectForKey:app_id];
- cell.app = myApp;
+ NSArray *sortedApps = [DB appsSortedBySales];
+ cell.app = [sortedApps objectAtIndex:indexPath.row];
+
return cell;
}
View
95 Classes/BirneConnect.h
@@ -7,11 +7,10 @@
//
#import <Foundation/Foundation.h>
-// This includes the header for the SQLite library.
-#import <sqlite3.h>
+#import "Database.h"
-typedef enum { ReportTypeDay = 0, ReportTypeWeek = 1, ReportTypeFinancial = 2, ReportTypeFree = 3 } ReportType;
-typedef enum { ReportRegionUnknown = 0, ReportRegionUSA = 1, ReportRegionEurope = 2, ReportRegionCanada = 3, ReportRegionAustralia = 4, ReportRegionUK = 5, ReportRegionJapan = 6, ReportRegionRestOfWorld} ReportRegion;
+//typedef enum { ReportTypeDay = 0, ReportTypeWeek = 1, ReportTypeFinancial = 2, ReportTypeFree = 3 } ReportType;
+//typedef enum { ReportRegionUnknown = 0, ReportRegionUSA = 1, ReportRegionEurope = 2, ReportRegionCanada = 3, ReportRegionAustralia = 4, ReportRegionUK = 5, ReportRegionJapan = 6, ReportRegionRestOfWorld} ReportRegion;
@class Report, App, YahooFinance;
@@ -25,17 +24,11 @@ typedef enum { ReportRegionUnknown = 0, ReportRegionUSA = 1, ReportRegionEurope
// for HTTP
NSMutableData *receivedData;
NSURLConnection *theConnection;
-
+
+ // for the state machine
NSString *loginPostURL;
int loginStep;
- // Opaque reference to the SQLite database.
- sqlite3 *database;
-
- // Currency converter
- YahooFinance *myYahoo;
-
-
NSString *downloadPostURL;
// array to hold available daily reports and index of currently loading report
@@ -48,107 +41,29 @@ typedef enum { ReportRegionUnknown = 0, ReportRegionUSA = 1, ReportRegionEurope
// Date formatter for reading dates in reports from apple
NSDateFormatter *dateFormatterToRead;
-
- // in-memory tables
- NSMutableDictionary *apps;
- NSMutableDictionary *reports;
-
- // indexes by type
- NSMutableArray *reportsByType;
- NSMutableArray *reportsDaily;
- NSMutableArray *reportsWeekly;
- NSMutableArray *reportsFinancial;
-
-
- NSMutableDictionary *latestReportsByType;
- // list of countries
- NSMutableDictionary *countries;
-
- // counters for new tags on tab icons
- int newApps;
- int newReports;
-
- NSMutableDictionary *newReportsByType;
BOOL syncing;
NSDate *lastSuccessfulLoginTime;
-
-
- NSMutableArray *dataToImport;
}
- (id) initWithLogin:(NSString *)user password:(NSString *)pass;
-
-
-
-- (void)refreshIndexes;
-
-
-- (void) addReportToDBfromString:(NSString *)string;
-//- (NSUInteger) getIDforApp:(NSString *)title vendor_identifier:(NSString *)vendor_identifier apple_identifier:(NSUInteger)apple_identifier company_name:(NSString *)company_name;
-- (void) insertReportLineForAppID:(NSUInteger)app_id type_id:(NSUInteger)type_id units:(NSUInteger)units
- royalty_price:(double)royalty_price royalty_currency:(NSString *)royalty_currency customer_price:(double)customer_price customer_currency:(NSString *)customer_currency country_code:(NSString *)country_code report_id:(NSUInteger)report_id;
-- (NSUInteger) reportIDForDate:(NSString *)dayString type:(ReportType)type;
-- (NSUInteger)insertReportForDate:(NSString *)dayString UntilDate:(NSString *)until_date type:(ReportType)type;
-
- (BOOL) requestDailyReport;
- (BOOL) requestWeeklyReport;
-
-@property (nonatomic, retain) NSMutableDictionary *apps;
-@property (nonatomic, retain) NSMutableDictionary *reports;
-@property (nonatomic, readonly) NSMutableArray *reportsByType;
-@property (nonatomic, readonly) NSMutableDictionary *countries;
-@property (nonatomic, readonly) NSMutableDictionary *latestReportsByType;
// login
@property (nonatomic, retain) NSString *username;
@property (nonatomic, retain) NSString *password;
@property (nonatomic, retain) NSDate *lastSuccessfulLoginTime;
-@property (nonatomic, readonly) sqlite3 *database;
-@property (nonatomic, retain) YahooFinance *myYahoo;
-
-@property (nonatomic, retain) NSMutableArray *dataToImport;
-
-
- (void) setStatus:(NSString *)message;
- (void) toggleNetworkIndicator:(BOOL)isON;
-- (void) importReportsFromDocumentsFolder;
-
-- (void) loadCountryList;
-- (NSArray *) salesCurrencies;
-
-- (NSString *) reportTextForID:(NSInteger)report_id;
-- (NSUInteger) reportIDForDate:(NSString *)dayString type:(ReportType)report_type;
-
-- (void)refreshIndexes;
-- (void)calcAvgRoyaltiesForApps;
- (void) loginAndSync;
- (void) sync;
-
-// to know where to animate row insertion and send program-wide notification
-- (NSIndexPath *) indexforApp:(App *)app;
-- (NSIndexPath *) indexforReport:(Report *)report;
-
-// to get the apps pre-sorted by the royalites field
-- (NSArray *) appKeysSortedBySales;
-- (NSArray *) appsSortedBySales;
-//- (NSArray *) reportsSortedByDate;
-
-- (NSString *) createZipFromReportsOfType:(ReportType)type;
-
-- (void) newReportRead:(Report *)report;
-
-- (NSUInteger) numberOfNewReportsOfType:(NSUInteger)reportType;
-- (void) emptyCache;
-
-- (void) initializeDatabase;
-
@end
View
933 Classes/BirneConnect.m
@@ -7,8 +7,6 @@
//
#import "BirneConnect.h"
-#import "BirneConnect+Totals.h"
-#import "YahooFinance.h"
#import "Database.h"
#import "DDData.h"
#import "ASiSTAppDelegate.h"
@@ -17,7 +15,6 @@
#import "Report.h"
#import "Country.h"
-#import "ZipArchive.h"
#import "NSString+Helpers.h"
@@ -27,8 +24,8 @@
// a class method will be invoked to "finalize" (delete) the compiled queries - this must happen before the database
// can be closed.
//static sqlite3_stmt *insert_statement = nil;
-static sqlite3_stmt *insert_statement_sale = nil;
-static sqlite3_stmt *reportid_statement = nil;
+//static sqlite3_stmt *insert_statement_sale = nil;
+//static sqlite3_stmt *reportid_statement = nil;
//static sqlite3_stmt *insertreport_statement = nil;
// private methods
@@ -43,47 +40,15 @@ - (BOOL) shouldAutoSync;
@implementation BirneConnect
-@synthesize apps, reports, reportsByType, latestReportsByType, countries, username, password, lastSuccessfulLoginTime, database;
-@synthesize myYahoo, dataToImport;
+@synthesize username, password, lastSuccessfulLoginTime;
- (id) init
{
- newApps = 0;
- newReports = 0;
- newReportsByType = [[NSMutableDictionary alloc] init];
syncing = NO;
- dataToImport = nil;
if (self = [super init])
{
- // set up local indexes
- reportsDaily = [NSMutableArray array];
- reportsWeekly = [NSMutableArray array];
- reportsFinancial = [NSMutableArray array];
-
- reportsByType = [[NSMutableArray alloc] initWithObjects:reportsDaily, reportsWeekly, reportsFinancial, nil];
-
- latestReportsByType = [[NSMutableDictionary alloc] init];
-
- database = [[Database sharedInstance] database];
- [self initializeDatabase];
-
-
- [self loadCountryList];
- [self getTotals];
-
- // subscribe to change of exchange rates
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exchangeRatesChanged:) name:@"ExchangeRatesChanged" object:nil];
-
-
- [self setStatus:@"Updating Currency Exchange Rates"];
- self.myYahoo = [YahooFinance sharedInstance];
- [self setStatus:nil];
-
- [self refreshIndexes];
- //[self calcAvgRoyaltiesForApps]; done at end of refresh
-
return self;
}
return nil;
@@ -195,7 +160,7 @@ - (void) loginAndSync
- (BOOL) shouldAutoSync
{
// only auto-sync if we did not already download a daily report today
- Report *lastDailyReport = [latestReportsByType objectForKey:[NSNumber numberWithInt:ReportTypeDay]];
+ Report *lastDailyReport = [[Database sharedInstance] latestReportOfType:ReportTypeDay];
NSCalendar *gregorian = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
NSDateComponents *lastComps = [gregorian components:NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit fromDate:lastDailyReport.downloadedDate];
@@ -205,18 +170,9 @@ - (BOOL) shouldAutoSync
}
- (void)dealloc {
- [[NSNotificationCenter defaultCenter] removeObserver:self];
-
- [dataToImport release];
- [myYahoo release];
[lastSuccessfulLoginTime release];
- [latestReportsByType release];
- [reportsByType release];
- [countries release];
[dateFormatterToRead release];
- [apps release];
- [reports release];
[weekOptions release];
[dayOptions release];
[loginPostURL release];
@@ -224,62 +180,6 @@ - (void)dealloc {
[super dealloc];
}
-#pragma mark Initialization
-
-- (void) loadCountryList
-{
- if (!countries)
- {
- countries = [[NSMutableDictionary alloc] init];
- }
- sqlite3_stmt *statement = nil;
-
- // we load all countries, because the country icon is only loaded if it is usedInReport
- const char *sql = "SELECT iso3 from country";
- if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) != SQLITE_OK)
- {
- NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
- }
-
- while (sqlite3_step(statement) == SQLITE_ROW)
- {
- NSString *cntry = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 0)];
- Country *tmpCountry = [[Country alloc] initWithISO3:cntry database:database];
- [countries setObject:tmpCountry forKey:tmpCountry.iso2];
- [tmpCountry release];
- }
-
- // Finalize the statement, no reuse.
- sqlite3_finalize(statement);
-}
-
-- (NSArray *) salesCurrencies
-{
- NSMutableArray *tmpArray = [[NSMutableArray alloc] init];
-
- sqlite3_stmt *statement = nil;
- const char *sql = "SELECT distinct customer_currency from sale";
- if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) != SQLITE_OK)
- {
- NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
-
- }
-
- while (sqlite3_step(statement) == SQLITE_ROW)
- {
- NSString *currency = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 0)];
- [tmpArray addObject:currency];
- }
-
- // Finalize the statement, no reuse.
- sqlite3_finalize(statement);
-
- NSArray *retArray = [NSArray arrayWithArray:tmpArray];
- [tmpArray release];
-
- return retArray;
-}
-
#pragma mark HTTP call back methods
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)response
{
@@ -290,7 +190,7 @@ - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLRe
// redirect, so each time we reset the data.
// receivedData is declared as a method instance elsewhere
[receivedData setLength:0];
-// NSLog(@"%d %@", [response statusCode], [[response allHeaderFields] objectForKey:@"Content-Type"]);
+ NSLog(@"%d %@", [response statusCode], [[response allHeaderFields] objectForKey:@"Content-Type"]);
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
@@ -312,16 +212,6 @@ - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)err
[self setStatus:[error localizedDescription]];
[self setStatus:nil];
syncing = NO;
-
- // NSLog(@"Connection failed! Error - %@ %@",
- // [error localizedDescription],
- // [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);
-
- /* if (myDelegate && [myDelegate respondsToSelector:@selector(sendingDone:)]) {
- (void) [myDelegate performSelector:@selector(sendingDone:)
- withObject:self];
- }
- */
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
@@ -330,8 +220,6 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
NSMutableURLRequest *theRequest;
NSMutableData *postBody;
-
-
NSString *sourceSt = [[[NSString alloc] initWithBytes:[receivedData bytes] length:[receivedData length] encoding:NSASCIIStringEncoding] autorelease];
//NSLog(sourceSt);
@@ -396,7 +284,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:URL]
cachePolicy:NSURLRequestUseProtocolCachePolicy
- timeoutInterval:30.0];
+ timeoutInterval:60.0]; // might take long
[theRequest setHTTPMethod:@"GET"];
//[theRequest addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField: @"Content-Type"];
@@ -582,11 +470,8 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSData *decompressed = [receivedData gzipInflate];
NSString *decompStr = [[NSString alloc] initWithBytes:[decompressed bytes] length:[decompressed length] encoding:NSASCIIStringEncoding];
-
- [self addReportToDBfromString:decompStr];
- [self refreshIndexes]; // this causes avgRoyalties calc
-
+ [DB insertReportFromText:decompStr];
[decompStr release];
if (![self requestDailyReport])
@@ -640,10 +525,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
NSData *decompressed = [receivedData gzipInflate];
NSString *decompStr = [[NSString alloc] initWithBytes:[decompressed bytes] length:[decompressed length] encoding:NSUTF8StringEncoding];
- [self addReportToDBfromString:decompStr];
- [self refreshIndexes]; // this causes avgRoyalties calc
-
-
+ [DB insertReportFromText:decompStr];
[decompStr release];
[self requestWeeklyReport];
@@ -683,54 +565,7 @@ - (void) toggleNetworkIndicator:(BOOL)isON
[appDelegate toggleNetworkIndicator:isON];
}
-- (void) insertAppNotification:(App *)app
-{
-
- NSIndexPath *tmpIndex = [self indexforApp:app];
-
- NSArray *insertIndexPaths = [NSArray arrayWithObjects:
- tmpIndex,
- nil];
-
- NSArray *values = [NSArray arrayWithObjects:insertIndexPaths, app, [NSNumber numberWithInt:tmpIndex.row], [NSNumber numberWithInt:newApps], nil];
- NSArray *keys = [NSArray arrayWithObjects:@"InsertIndexPaths", @"App", @"InsertionIndex", @"NewApps", nil];
-
- NSDictionary *tmpDict = [NSDictionary dictionaryWithObjects:values forKeys:keys];
- [[NSNotificationCenter defaultCenter] postNotificationName:@"NewAppAdded" object:nil userInfo:tmpDict];
-}
-- (void) insertReportNotification:(Report *)report
-{
-
- NSIndexPath *tmpIndex = [self indexforReport:report];
-
- NSArray *insertIndexPaths = [NSArray arrayWithObjects:
- tmpIndex,
- nil];
-
- NSArray *values = [NSArray arrayWithObjects:insertIndexPaths, report, [NSNumber numberWithInt:tmpIndex.row], [NSNumber numberWithInt:newReports], nil];
- NSArray *keys = [NSArray arrayWithObjects:@"InsertIndexPaths", @"Report", @"InsertionIndex", @"NewReports", nil];
-
- NSDictionary *tmpDict = [NSDictionary dictionaryWithObjects:values forKeys:keys];
-
- [[NSNotificationCenter defaultCenter] postNotificationName:@"NewReportAdded" object:nil userInfo:tmpDict];
-
-
- // local number of daily/weekly new Reports tracking
- NSNumber *typeKey = [NSNumber numberWithInt:report.reportType];
- NSNumber *theNum = [newReportsByType objectForKey:typeKey];
- if (!theNum)
- {
- theNum = [NSNumber numberWithInt:1];
- [newReportsByType setObject:theNum forKey:typeKey];
- }
- else
- {
- NSNumber *newNum = [NSNumber numberWithInt:[theNum intValue]+1];
- [newReportsByType setObject:newNum forKey:typeKey];
- }
-
-}
#pragma mark Report Downloading
@@ -742,7 +577,7 @@ - (BOOL) requestDailyReport
if ([dayOptions count]>dayOptionsIdx)
{
NSString *formDate = [[dayOptions objectAtIndex:dayOptionsIdx] stringByReplacingOccurrencesOfString:@"/" withString:@"%2F"];
- if ([self reportIDForDate:[dayOptions objectAtIndex:dayOptionsIdx] type:ReportTypeDay])
+ if ([DB reportIDForDateString:[dayOptions objectAtIndex:dayOptionsIdx] type:ReportTypeDay region:ReportRegionUnknown])
{
// Already downloaded this day
dayOptionsIdx++;
@@ -773,8 +608,6 @@ - (BOOL) requestDailyReport
}
else
{
- [self refreshIndexes]; // because at this point we have all reports
-
return NO;
}
}
@@ -787,7 +620,7 @@ - (BOOL) requestWeeklyReport
if ([weekOptions count]>weekOptionsIdx)
{
NSString *formDate = [[weekOptions objectAtIndex:weekOptionsIdx] stringByReplacingOccurrencesOfString:@"/" withString:@"%2F"];
- if ([self reportIDForDate:[weekOptions objectAtIndex:weekOptionsIdx] type:ReportTypeWeek])
+ if ([DB reportIDForDateString:[weekOptions objectAtIndex:weekOptionsIdx] type:ReportTypeWeek region:ReportRegionUnknown])
{
// Already downloaded this week
weekOptionsIdx++;
@@ -819,9 +652,6 @@ - (BOOL) requestWeeklyReport
}
else
{
- //NSLog(@"no more weeks");
- [self refreshIndexes]; // because at this point we have all reports
-
[self toggleNetworkIndicator:NO];
[self setStatus:@"Synchronization Done"];
[self setStatus:nil];
@@ -829,755 +659,14 @@ - (BOOL) requestWeeklyReport
syncing = NO;
// need to redo totals now
- [self getTotals];
+ [DB getTotals];
return NO;
}
}
-- (void) addReportToDBfromString:(NSString *)string;
-{
- NSUInteger report_id=0;
-
- NSArray *lines = [string componentsSeparatedByString:@"\n"];
- NSEnumerator *enu = [lines objectEnumerator];
- NSString *oneLine;
-
- // first line = headers
-
- oneLine = [enu nextObject];
- NSArray *column_names = [oneLine componentsSeparatedByString:@"\t"];
-
- NSString *prev_until_date = @"";
-
- while(oneLine = [enu nextObject])
- {
- NSString *from_date = [oneLine getValueForNamedColumn:@"Begin Date" headerNames:column_names];
- NSString *until_date = [oneLine getValueForNamedColumn:@"End Date" headerNames:column_names];
- NSUInteger appID = [[oneLine getValueForNamedColumn:@"Apple Identifier" headerNames:column_names] intValue];
- NSString *vendor_identifier = [oneLine getValueForNamedColumn:@"Vendor Identifier" headerNames:column_names];
- NSString *company_name = [oneLine getValueForNamedColumn:@"Artist / Show" headerNames:column_names];
- NSString *title = [oneLine getValueForNamedColumn:@"Title / Episode / Season" headerNames:column_names];
- NSUInteger type_id = [[oneLine getValueForNamedColumn:@"Product Type Identifier" headerNames:column_names] intValue];
- NSInteger units = [[oneLine getValueForNamedColumn:@"Units" headerNames:column_names] intValue];
- double royalty_price = [[oneLine getValueForNamedColumn:@"Royalty Price" headerNames:column_names] doubleValue];
- NSString *royalty_currency = [oneLine getValueForNamedColumn:@"Royalty Currency" headerNames:column_names];
- double customer_price = [[oneLine getValueForNamedColumn:@"Customer Price" headerNames:column_names] doubleValue];
- NSString *customer_currency = [oneLine getValueForNamedColumn:@"Customer Currency" headerNames:column_names];
- NSString *country_code = [oneLine getValueForNamedColumn:@"Country Code" headerNames:column_names];
-
- BOOL financial_report = NO;
-
- if ((!from_date)&&(!company_name)&&(!title)&&(!royalty_currency)&&(!royalty_price)&&(!country_code))
- {
- // probably monthly report
- from_date = [oneLine getValueForNamedColumn:@"Start Date" headerNames:column_names];
-
- units = [[oneLine getValueForNamedColumn:@"Quantity" headerNames:column_names] intValue];
- company_name = [oneLine getValueForNamedColumn:@"Artist/Show/Developer" headerNames:column_names];
- title = [oneLine getValueForNamedColumn:@"Title" headerNames:column_names];
- royalty_currency = [oneLine getValueForNamedColumn:@"Partner Share Currency" headerNames:column_names];
- royalty_price = [[oneLine getValueForNamedColumn:@"Partner Share" headerNames:column_names] doubleValue];
- country_code = [oneLine getValueForNamedColumn:@"Country Of Sale" headerNames:column_names];
-
- financial_report = YES;
- }
-
-
-
- if (from_date&&until_date&&appID&&vendor_identifier&&company_name&&title&&type_id&&units&&royalty_currency&&customer_currency&&country_code)
- {
- if ((!report_id)||(![prev_until_date isEqualToString:until_date])) // added: possibly multiple different rows from different reports
- { // detect report type from first line
-
- if (financial_report)
- {
- // is a monthly report
- report_id=[self insertReportForDate:from_date UntilDate:until_date type:ReportTypeFinancial];
- }
- else if ([from_date isEqualToString:until_date])
- { // day report
- report_id=[self insertReportForDate:from_date UntilDate:until_date type:ReportTypeDay];
- }
- else
- { // week report
- report_id=[self insertReportForDate:from_date UntilDate:until_date type:ReportTypeWeek];
- }
-
- if (!report_id)
- {
- //NSLog(@"Could not get a new report_id, probably already in DB");
- return;
- }
- }
-
- if (report_id)
- {
- NSNumber *app_key = [NSNumber numberWithInt:appID];
- if (![apps objectForKey:app_key])
- {
- App *app = [[App alloc] initWithTitle:title vendor_identifier:vendor_identifier apple_identifier:appID company_name:company_name database:database];
- newApps ++;
-
- [apps setObject:app forKey:app_key];
- [self insertAppNotification:app];
- [app release];
- }
-
-
- [self insertReportLineForAppID:appID type_id:type_id units:units royalty_price:royalty_price royalty_currency:royalty_currency customer_price:customer_price customer_currency:customer_currency country_code:country_code report_id:report_id];
- }
-
- }
- else
- {
- // lines that don't match the headers, most likey empty lines after the report
- }
-
- prev_until_date = until_date;
- }
-}
-
-- (NSUInteger)insertReportForDate:(NSString *)from_date UntilDate:(NSString *)until_date type:(ReportType)type
-{
- NSDate *tmp_from_date = [from_date dateFromString];
-
-
- NSDate *tmp_until_date = [until_date dateFromString];
- NSDate *tmp_downloaded_date = [NSDate date];
-
-
- if (!tmp_from_date || !tmp_until_date)
- {
- return 0;
- }
-
- if ([self reportIDForDate:until_date type:type])
- {
- //NSLog(@"Report for until_date %@ type %d already in DB", from_date, type);
- return 0;
- }
-
- NSUInteger primaryKey = 0;
- Report *tmp_report = [[Report alloc] initWithType:type from_date:tmp_from_date until_date:tmp_until_date downloaded_date:tmp_downloaded_date database:database];
- tmp_report.itts = self;
- primaryKey = tmp_report.primaryKey;
-
- // add to primary reports table
- [reports setObject:tmp_report forKey:[NSNumber numberWithInt:primaryKey]];
-
- // also add to the indexes
- switch (tmp_report.reportType)
- {
- case ReportTypeDay:
- [reportsDaily addObject:tmp_report];
- break;
- case ReportTypeWeek:
- [reportsWeekly addObject:tmp_report];
- break;
- case ReportTypeFinancial:
- [reportsFinancial addObject:tmp_report];
- break;
- default:
- break;
- }
- id:
- tmp_report.isNew = YES;
-
- newReports ++;
- [self insertReportNotification:tmp_report];
-
- [tmp_report release];
-
-
- return primaryKey;
-}
-
-- (void) insertReportLineForAppID:(NSUInteger)app_id type_id:(NSUInteger)type_id units:(NSUInteger)units
- royalty_price:(double)royalty_price royalty_currency:(NSString *)royalty_currency customer_price:(double)customer_price customer_currency:(NSString *)customer_currency country_code:(NSString *)country_code report_id:(NSUInteger)report_id
-{
- //NSUInteger primaryKey = 0;
- // This query may be performed many times during the run of the application. As an optimization, a static
- // variable is used to store the SQLite compiled byte-code for the query, which is generated one time - the first
- // time the method is executed by any Book object.
- if (insert_statement_sale == nil) {
- static char *sql = "REPLACE INTO sale(app_id, type_id, units, royalty_price, royalty_currency, customer_price , customer_currency , country_code, report_id) VALUES(?, ?, ?, ?, ?, ?, ?,?,?)";
- if (sqlite3_prepare_v2(database, sql, -1, &insert_statement_sale, NULL) != SQLITE_OK) {
- NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
- }
- }
-
- sqlite3_bind_int(insert_statement_sale, 1, app_id);
- sqlite3_bind_int(insert_statement_sale, 2, type_id);
- sqlite3_bind_int(insert_statement_sale, 3, units);
- sqlite3_bind_double(insert_statement_sale, 4, royalty_price);
- sqlite3_bind_text(insert_statement_sale, 5, [royalty_currency UTF8String], -1, SQLITE_TRANSIENT);
- sqlite3_bind_double(insert_statement_sale, 6, customer_price);
- sqlite3_bind_text(insert_statement_sale, 7, [customer_currency UTF8String], -1, SQLITE_TRANSIENT);
- sqlite3_bind_text(insert_statement_sale, 8, [country_code UTF8String], -1, SQLITE_TRANSIENT);
- sqlite3_bind_int(insert_statement_sale, 9, report_id);
-
- int success = sqlite3_step(insert_statement_sale);
-
- // Because we want to reuse the statement, we "reset" it instead of "finalizing" it.
- sqlite3_reset(insert_statement_sale);
- if (success == SQLITE_ERROR) {
- NSAssert1(0, @"Error: failed to insert into the database with message '%s'.", sqlite3_errmsg(database));
- } else {
- // SQLite provides a method which retrieves the value of the most recently auto-generated primary key sequence
- // in the database. To access this functionality, the table should have a column declared of type
- // "INTEGER PRIMARY KEY"
- //primaryKey = sqlite3_last_insert_rowid(database);
- }
- // All data for the book is already in memory, but has not be written to the database
- // Mark as hydrated to prevent empty/default values from overwriting what is in memory
- //hydrated = YES;
-
- //return primaryKey;
-
-}
-
-
-
-
-
-- (NSUInteger) reportIDForDate:(NSString *)dayString type:(ReportType)report_type
-{
- NSUInteger retID = 0;
- NSDate *tmpDate = [dayString dateFromString];
- // Compile the query for retrieving book data. See insertNewBookIntoDatabase: for more detail.
- if (reportid_statement == nil) {
- // Note the '?' at the end of the query. This is a parameter which can be replaced by a bound variable.
- // This is a great way to optimize because frequently used queries can be compiled once, then with each
- // use new variable values can be bound to placeholders.
- const char *sql = "SELECT [id] from report WHERE until_date like ? AND report_type_id = ?";
- if (sqlite3_prepare_v2(database, sql, -1, &reportid_statement, NULL) != SQLITE_OK) {
- NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
- }
- }
- // For this query, we bind the primary key to the first (and only) placeholder in the statement.
- // Note that the parameters are numbered from 1, not from 0.
-
- sqlite3_bind_text(reportid_statement, 1, [[NSString stringWithFormat:@"%@%%", [[tmpDate description] substringToIndex:10]] UTF8String], -1, SQLITE_TRANSIENT);
- sqlite3_bind_int(reportid_statement, 2, (int)report_type);
- if (sqlite3_step(reportid_statement) == SQLITE_ROW)
- {
- retID = sqlite3_column_int(reportid_statement, 0);
- } else {
- }
- // Reset the statement for future reuse.
- sqlite3_reset(reportid_statement);
- return retID;
-}
-
-
-
-
-- (NSIndexPath *) indexforApp:(App *)app
-{
- // now get the position in the table to animate insertion for
- NSArray *sortedKeys = [self appKeysSortedBySales];
-
- NSUInteger row, section;
-
- section = 0;
- row = [sortedKeys indexOfObject:[NSNumber numberWithInt:app.apple_identifier]];
-
- return [NSIndexPath indexPathForRow:row inSection:section];
-}
-
-
-- (NSIndexPath *) indexforReport:(Report *)report
-{
- // now get the position in the table to animate insertion for
- NSUInteger row, section;
-
- section = report.reportType; // 0 for days, 1 for weeks
-
- NSMutableArray *tmpArray = [reportsByType objectAtIndex:section];
-
- NSSortDescriptor *dateDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"fromDate" ascending:NO] autorelease];
- NSArray *sortDescriptors = [NSArray arrayWithObject:dateDescriptor];
- NSArray *sortedArray = [tmpArray sortedArrayUsingDescriptors:sortDescriptors];
-
- row = [sortedArray indexOfObject:report];
-
- return [NSIndexPath indexPathForRow:row inSection:section];
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-- (NSArray *) appKeysSortedBySales
-{
- NSArray *sortedKeys = [apps keysSortedByValueUsingSelector:@selector(compareBySales:)];
- return sortedKeys;
-}
-
-- (NSArray *) appsSortedBySales
-{
- NSArray *sortedKeys = [self appKeysSortedBySales];
- NSEnumerator *enu = [sortedKeys objectEnumerator];
- NSNumber *oneKey;
- NSMutableArray *tmpArray = [[NSMutableArray alloc] initWithCapacity:[sortedKeys count]];
-
-
- while (oneKey = [enu nextObject]) {
- App *oneApp = [apps objectForKey:oneKey];
- [tmpArray addObject:oneApp];
- }
-
- NSArray *ret = [NSArray arrayWithArray:tmpArray];
- [tmpArray release];
-
- return ret;
-}
-
-
-
-
-
-
-
-
-# pragma mark Post Synchronization
-
-
-// finds the latest daily and weekly report and saves it in lookup dictionary
-- (void)refreshIndexes
-{
- NSEnumerator *e = [reports objectEnumerator];
- Report *r;
-
- while (r = [e nextObject])
- {
- // track which is the latest report of each type
- Report *prevLatestReport = [latestReportsByType objectForKey:[NSNumber numberWithInt:r.reportType]];
- if (!prevLatestReport || [prevLatestReport.fromDate timeIntervalSinceDate:r.fromDate]<0)
- {
- [latestReportsByType setObject:r forKey:[NSNumber numberWithInt:r.reportType]];
-
- }
- }
-
- [self calcAvgRoyaltiesForApps];
-
- // this gets called after EACH report, so not a good place to do totals
-}
-
-- (void)calcAvgRoyaltiesForApps
-{
- // for calculations wee need the latest reports hydrated
- [[latestReportsByType objectForKey:[NSNumber numberWithInt:ReportTypeDay]] hydrate];