Example: If GitX started in stage view and the window was closed without ever looking at the history view, then [self view] will cause the history view's nib to be loaded which kicks off loading in the rev list. Wastes a lot of CPU cycles for no reason.
removeObserver: removes the controller from all notifications.
The PBWebHistoryController's super class registers it for "preferencesChangedWithNotification". This stops the controller from missing that notification and allows it to respond to changes in the preferences.
If the current branch filter is switched to "All" or "Local" the index that's
calculated as being the targeted index to scroll to visible, is off by the amount
in Y that the bottom split view separator is off from a multiple of rows.
-adjustScroll: on PBCommitList is called automatically whenever the list needs
laying out.
An ivar keeps track if we come from the -scrollSelectionToTopOfViewFrom: method
of PBGitHistoryController.
I'll leave the commented out NSLogs in there in case they're needed for debugging
again later.
André Berg pointed out that the "Open Image in New Window" and "Download Image" items from the contextual menu for images in the web view does not work and may cause crashes.
So limit the menu to either just show "Copy Image" or don't have a menu at all.
After the last line is read from the fileDescriptor the callee will call
readLine once last time. If the (uninitialized) buffer just happened to
contain '\r' then this method would increment bytesReceived, then
decrement it (because it has '\r' in it), then decrement it agin and
assign a null byte to the byte before the buffer (stepping on who knows
what). Then it would return the '\r'. Then, since it received something,
the callee would call readLine again, malloc would give the same buffer
it did before (with the '\r') and everything would repeat.
- initialize the buffer
- increment bytesReceived only if a byte is actually received
- don't do any work in the loop if there were no bytes received
- EINTR is a recoverable error, just reread
- give the actual reason for an error rather than some random string
- free the buffer when a newline is found or when there is an error
The text view was wrapping text well before it reached the edge of the view.
In PBGitHistory.xib in the textview for the file contents check the Resizable Horizontally checkbox in the Size Inspector
- only maintains one item, if multiple items are selected then only the first one will stay selected
- if the file is removed in the new commit then don't select anything, then if a new commit is selected that does have that file it will be selected again
- this does not maintain the expanded state of folders other than the one(s) that contain the selected file
- in PBGitHistory.xib Tree Controller turn off:
- Avoid Empty Selection
- Select Inserted Objects
In 10.6 Apple removed the private QL API that existed in 10.5 and added a new public API. However they did not port the new API back to 10.5 so we have to do some work to get it working in both.
This patch has GitX choose the correct version at run time.
- The delegate code is based on Apple's QuickLookDownloader example project
- added three of the public API methods to CWQuickLook.h to avoid warnings about unknown method calls
- In ApplicationController try to load the public API first then load the private one if it fails
- Created PBQLTextView, a subclass of NSTextView to allow the space key event to toggle the preview panel
- PBGitHistoryView.xib:
- set the text view's class to PBQLTextView
- connected the history controller to the controller outlet
- bound the quick look button's enabled binding to File's Owner.selectedCommitDetailsIndex
- added "Quick Look" to the quick look button's tooltip
- The commit list table view toggles the panel if the tree view is active
- changed name of the toggle IBAction method which caused MainMenu.xib and PBGitHistoryView.xib to update
If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns.
This will not show any labels that don't fit.
EINTR errors are recoverable, just need to read() again.
Randomly while looking at files in the file browser the contents view will be empty or files will not be shown when clicking a discloser triangle. Seems to happen more when running in XCode than when running by itself.
When the Subject column is not the first column in the git history table the contextual menu for refs and dragging and dropping refs don't work.
Offset the mouse click's x value by the x origin of the Subject column.
In PBRefController look up the column index of the subject column and check that it's the clicked column (don't assume it's the first one).
Use the cached commit list to avoid asking git for the info. This is used to update GUI buttons and when opening the contextual menu so making it fast is important. It wasn't possible before because we weren't storing all the commits.
- filters for All, Local/Remote, and the selected branch
- "Local" includes both branches and tags
- "Remote" includes all branches from the same remote as the selected remote branch (i.e. not other remotes)
Changes to make the above work:
- add a history list class between the repository and rev list
- store a project rev list with all the commits from the project
- use the project rev list to graph the history for individual branches when there have been no changes
- use a different rev list to show non-simple revs (history of a file, revs from the gitx tool)
- update the commits in chunks to a mutable array so the table view's array controller has less work to do
- only update the project rev list from git when actually necessary
- don't add the All Branches and Local Branches revs to the branches array
- some changes related to forcing the project's rev list to update when changes are made
- some changes related to not causing updates too often
- store the selected filter in user defaults
- when the graphing is done select the commit for the branch
In reloadRefs:
- check for any branches that are no longer in the repo and delete them
- except the detached HEAD and the "other" revs
- send KVO notice for the refs ivar changing
- get rid of the BOOL return value as it's not being used
- get rid of the outdated comments
- clean things up a bit
It was no longer opening the tree view because the index in setTreeView: was wrong.
Removing the raw view was started in 34394d056b. Finish removing the raw view stuff and clean things up.
- remove the rawCommit property
- fix the incorrect index of the tree view setter
- define symbols for the indexes
- rename the selectedTab property to indicate what is being selected
- rename realCommit to selectedCommit to better indicate what it's for
- define a key for the defaults
- NSCopying
- change isEqualTo: to isEqual: so that it works well with NSArray's (containsObject: and removeObject: will use isEqual: instead of pointer equality)
- add hash to go with isEqual:
- pre-calculate the isSimpleRef value. The rangeOf... methods are very slow and have a major effect on the tight loop in reloadRefs.
NSURL's don't play nice with NSDistantObject, use the newly created NSURL instead of the NSDistantObject proxy.
This fixes problems with rev specifiers created using the gitx tool crashing GitX the second time they are viewed because the NSConnection to the tool has been closed.
If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns.
This will not show any labels that don't fit.