Re: Scroller and not apple's mouse

2021-04-13 Thread Allan Odgaard via Cocoa-dev
Probably two things relevant here. One is General in system preferences which look like this: ![](cid:2C16BC1B-F302-426F-9F6A-665F55C99045@simplit.com "PastedImage.png") A Magic Mouse may count as a “track pad” so if you have this setting to automatic, the scrollers will only be shown when s

Re: fileManagerWithAuthorization:

2021-03-17 Thread Allan Odgaard via Cocoa-dev
On 15 Mar 2021, at 16:24, Keary Suska wrote: That forum thread does not, as far as I can tell, say that you need a provisioning profile for non-sandboxed apps. In that thread, Quinn seems to acnknowledge that you need “special permission [from Apple] for local development” But he also says

Re: fileManagerWithAuthorization:

2021-03-14 Thread Allan Odgaard via Cocoa-dev
On 14 Mar 2021, at 19:44, Michael Tsai wrote: I think you need to apply to Apple and get a provisioning profile, even if the app isn't sandboxed: https://developer.apple.com/forums/thread/653890 Thanks, what a disappointing policy decision by Apple. Especially when they are trying to get ri

fileManagerWithAuthorization:

2021-03-14 Thread Allan Odgaard via Cocoa-dev
I’ve tried something like the code below to save a file not owned by current user. I have codesigned the application using hardened runtime and the `com.apple.developer.security.privileged-file-operations` entitlement (although this is outside App Store and no sandboxing). It doesn’t work an

Re: NSStream vs NSFileHandle

2021-03-09 Thread Allan Odgaard via Cocoa-dev
On 9 Mar 2021, at 12:10, Jean-Daniel wrote: If I had to write a new software that need read/write functions today, I would go for a modern async API, like dispatch_io. This came up while trying to generalize a few things I have that basically transform data, but where size is unknown, and the

NSStream vs NSFileHandle

2021-03-09 Thread Allan Odgaard via Cocoa-dev
We currently have two different systems that can’t easily be bridged, effectively doing the same thing, but supporting different sources: NSStream can work with files, data, and network streams (created by NSURLSession and other high-level API). NSFileHandle can work with files, pipes, stdin/

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-05-22 Thread Allan Odgaard via Cocoa-dev
On 22 May 2020, at 21:59, Aandi Inston wrote: 1. I wonder if your tests are in a non-English language system. No, running on a non-localized system, and the evidence is overwhelming that this is about SIP / AMFI (based on inspecting the stack trace, which clearly show communication between t

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-05-22 Thread Allan Odgaard via Cocoa-dev
On 23 Apr 2020, at 21:15, Rob Petrovec wrote: If what you say is correct then everyone would be seeing a delay since most people don’t have blazing fast internet connections. I do not think this is the normal behavior. I think it is specific to your system, otherwise there would be TONS of p

Re: Check if there are autosaved documents

2020-04-27 Thread Allan Odgaard via Cocoa-dev
On 27 Apr 2020, at 15:35, Georg Seifert via Cocoa-dev wrote: Is there a method/callback that is called when all loading is done (including the loading of documents). Have a look at applicationOpenUntitledFile: https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428491-appl

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-24 Thread Allan Odgaard via Cocoa-dev
On 24 Apr 2020, at 21:33, Gary L. Wade wrote: Here’s two web sites that should help you get the answer you want. Try one or both: https://feedbackassistant.apple.com/welcome https://www.apple.com/jobs/us/ You don’t get answers from filing bug reports with Apple, at best, the issue gets clos

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Allan Odgaard via Cocoa-dev
On 24 Apr 2020, at 11:49, Saagar Jha wrote: GateKeeper is basically Safari adding a quarantine flag […] Nit: not just Safari; other applications do this to at their discretion when appropriate (for example, if they too download files from the internet). Quarantine is just one part of GateKeepe

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Allan Odgaard via Cocoa-dev
On 24 Apr 2020, at 9:57, Rob Petrovec wrote: Also weird, why would it phone home for a shell script which has neither been stapled nor even code-signed? I think you answered the question just then… a "shell script which has neither been stapled nor even code-signed”. Google XProtect & Gateke

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Allan Odgaard via Cocoa-dev
On 24 Apr 2020, at 9:51, Gary L. Wade wrote: Have you tried a speed check with just iCloud turned off but internet on? I have tried with iCloud disabled, internet disabled, and SIP disabled. Only the latter two removes the delay. Also, the issue happens for ~/Downloads which is not an iCloud

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Allan Odgaard via Cocoa-dev
On 24 Apr 2020, at 2:28, Gabriel Zachmann via Cocoa-dev wrote: I believe that is why you are supposed to staple notarization tickets to your apps. Then, why would it "phone home" in case there is an internet connection? Also weird, why would it phone home for a shell script which has neither

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Allan Odgaard via Cocoa-dev
On 24 Apr 2020, at 2:18, Rob Petrovec wrote: I get a 1 second time for the first run and then a much quicker time for the second. I did some sampling and the longer time due to is Apple’s check for malware on first run of a process. This is a known, documented and advertised behavior. I wo

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Allan Odgaard via Cocoa-dev
On 23 Apr 2020, at 21:15, Rob Petrovec wrote: If what you say is correct then everyone would be seeing a delay since most people don’t have blazing fast internet connections. I do not think this is the normal behavior. Please try run this in a terminal and report the times: rm -f /tmp/t

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-22 Thread Allan Odgaard via Cocoa-dev
On 20 Apr 2020, at 0:11, Allan Odgaard via Cocoa-dev wrote: Unfortunately though I can’t figure out *what* the problem is; running `tccutil reset All` (and rebooting) did not fix it. It appears the problem is not with a local service, but that Apple actually “phones home” when a program asks

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-19 Thread Allan Odgaard via Cocoa-dev
On 20 Apr 2020, at 0:37, Rob Petrovec wrote: >> I think you are right about this being a permission / “sandbox” issue, because the 3 folders in question are all folders that macOS 10.15 now require special permission to read (even though in my case, I just request their display name). Yes, th

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-19 Thread Allan Odgaard via Cocoa-dev
On 19 Apr 2020, at 22:54, David M. Cotter wrote: i have discovered it may have to do with permissions / entitlements that have been granted the app by the user, and that resetting all perms to default will "fix" the problem I think you are right about this being a permission / “sandbox” issu

Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-19 Thread Allan Odgaard via Cocoa-dev
Starting with macOS 10.15 I have noticed that obtaining NSURLLocalizedNameKey, NSURLTagNamesKey, and even calling getxattr(), can cause a significant delay. The code below, which gets NSURLLocalizedNameKey for 3 folders, takes 1.9 seconds to execute on my system. It appears though that it is

Re: Catalina scroll view issues

2020-01-02 Thread Allan Odgaard via Cocoa-dev
On 1 Jan 2020, at 2:46, Rob Petrovec via Cocoa-dev wrote: drawRect is not deprecated. Correct. However, it is technically old fashioned. It is much more efficient to use layers. Layers can take better advantage of the video card especially during animations, and don’t require unnecessary redr

Re: Catalina scroll view issues

2019-12-26 Thread Allan Odgaard via Cocoa-dev
On 27 Dec 2019, at 13:03, Allan Odgaard via Cocoa-dev wrote: > I do change copiesOnScroll. Sorry, I meant that I do *not* change copiesOnScroll. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or modera

Re: Catalina scroll view issues

2019-12-26 Thread Allan Odgaard via Cocoa-dev
On 16 Dec 2019, at 16:35, Eyal Redler wrote: It does look very similar (except for the fact that in your example the text is also cut on the right. Do you have copiesOnScroll turned off as well? I do change copiesOnScroll. Apart from opting out of responsive scrolling, it’s should be a very

Re: How to check whether directory tree has changed?

2019-12-21 Thread Allan Odgaard via Cocoa-dev
On 22 Dec 2019, at 1:18, Gabriel Zachmann wrote: Right. I was hoping there is an easy way to do this. There is the File System Events API: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/FSEvents_ProgGuide/Introduction/Introduction.html __

Re: Catalina scroll view issues

2019-12-14 Thread Allan Odgaard via Cocoa-dev
On 14 Dec 2019, at 21:16, Redler Eyal via Cocoa-dev wrote: I'm getting reports from users complaining about a strange display issue on Catalina with my app. […] The problem is that when with some documents, sometimes, when the user scrolls down the document, some pages are not drawn or even pa

Re: manual item enabling

2019-11-25 Thread Allan Odgaard via Cocoa-dev
On 25 Nov 2019, at 7:36, Kurt Bigler via Cocoa-dev wrote: With a menu delegate you can lazily update the menu (menuNeedsUpdate:) or you can even bypass updating the menu for key events by implementing menuHasKeyEquivalent:forEvent:target:action:. I'm not sure that's relevant to my situation,

Re: manual item enabling

2019-11-24 Thread Allan Odgaard via Cocoa-dev
On 24 Nov 2019, at 22:28, Kurt Bigler via Cocoa-dev wrote: […] The idea for least inefficiency given the global updating pass is to defer (akin to lazy evaluation) the actual menu item updating until the last possible moment. The last possible moment for mouse access is when the user clicks i

Re: other developer lists

2019-11-15 Thread Allan Odgaard via Cocoa-dev
On 15 Nov 2019, at 0:53, Matthew Kozak via Cocoa-dev wrote: Another reason why there's really no harm -if not some truly topical good- in this kind of thread (even w/ some critiques/defenses) bubbling up here now and again... I don’t mind off-topic discussions, but the recent thread(s) have b

Re: Thoughts on ARC

2019-09-27 Thread Allan Odgaard via Cocoa-dev
On 27 Sep 2019, at 14:19, Turtle Creek Software via Cocoa-dev wrote: It makes sense that Cocoa programmers much prefer ARC to MRC. Doing it manually is easy to break and hard to debug. However, the fact that ARC is not exception-safe concerns me. Cocoa in general is not exception safe as th

Re: ARC problems

2019-09-03 Thread Allan Odgaard via Cocoa-dev
On 4 Sep 2019, at 0:18, Turtle Creek Software via Cocoa-dev wrote: The startup code was created 3 years ago when we were new to Cocoa, probably from one of the HIllegass books. Do you manually load nibs (as opposed to rely on the framework to load MainMenu.nib)? In a previous post you wrote

Re: NSLog displays inconsistent format for NSDate

2019-08-31 Thread Allan Odgaard via Cocoa-dev
On 31 Aug 2019, at 2:49, Carl Hoefs via Cocoa-dev wrote: Same result if I run it as a system daemon. So as you suggest it seems there could be some sort of environment sensitivity going on. If only I knew what env var to set in the shell... UTC really isn't what I'm looking for. The issue ap

Using a CATransition with the NSView animator proxy

2018-11-11 Thread Allan Odgaard
I am unable to make custom boolean properties animatable (via CATransition). Below is the source for a custom NSView subclass with a boolean property (`visible`). It implements `defaultAnimationForKey:` to return a CATransition instance which should be used when the property is changed (via

Re: C++ pointer to Cocoa object

2018-09-07 Thread Allan Odgaard
On 7 Sep 2018, at 19:46, Casey McDermott wrote: Problem is, with ARC turned on, the pointer is never nil, so it crashes. The void pointer somehow becomes an NSAtom instead of 0. Nil is nil, I think your issue is rather that you do not properly retain the pointer before storing it as void*.

Re: Why are the simplest things the hardest?

2018-07-06 Thread Allan Odgaard
On 7 Jul 2018, at 6:55, Rick Mann wrote: If I have view commands (like fixed perspectives in a 3D view) in a menu, I should be able to implement those on the view controller, don't you think? No-one is preventing you from implementing view commands in the view controller. But if you want t

Re: Why are the simplest things the hardest?

2018-07-05 Thread Allan Odgaard
On 5 Jul 2018, at 6:44, Rick Mann wrote: Annoying I have to have a first responder view just to allow even my Document to respond to menu commands. Quoting the [documentation](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchi

Re: Traceback from [SFLList removeItem:]

2016-10-26 Thread Allan Odgaard
On 26 Oct 2016, at 16:22, John Brownie wrote: Recently, I think since I updated to Sierra and Xcode 8, I get tracebacks like the following in the Xcode console on application close: […] Not exactly the same, but since 10.11 I have gotten crash reports like the one below, so it does seem like

Re: Getting/Setting FinderInfo attributes using native Cocoa API?

2016-10-15 Thread Allan Odgaard
On 14 Oct 2016, at 23:33, Stephane Sudre wrote: I ended up writing a category for NSManager to deal with this using the xattr.h APIs. […] If the goal is to copy extended attributes (as one post alluded to) then there is the `COPYFILE_METADATA` flag which can be used with x-man-page://3/copyf

Lifecycle for custom NSURLProtocol properties

2016-09-26 Thread Allan Odgaard
I am making use of NSURLProtocol’s `setProperty:forKey:inRequest:` but it seems that my custom properties outlive the URL request, and even if I explicitly call `removePropertyForKey:inRequest:` after my request is done, it would appear that my properties are still being retained by something.

Modern API to read textClipping files

2016-09-22 Thread Allan Odgaard
Is there any non-deprecated API to read textClipping files? FSOpenResFile() was deprecated in 10.8 but I haven’t found a way to replace it. There is the com.apple.ResourceFork extended file attribute, but it seems to be stored in some legacy format that I would rather not try to interpret. __

Re: How to Launch an App using the Bundle ID?

2016-09-20 Thread Allan Odgaard
On 20 Sep 2016, at 12:48, Dave wrote: I’m using launchApplication method from Shared Workspace, however, it accept an Application Name and all I have is the Bundle ID. How can I launch an App using the Bundle ID? There is `LSCopyApplicationURLsForBundleIdentifier` under Launch Services. ___

Re: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Allan Odgaard
about selected items). On 20 Sep 2016, at 9:37, Allan Odgaard wrote: Thanks, I’ll switch to using this category method for setting dynamic titles: - (void)setDynamicTitle:(NSString*)plainTitle { if(self.userKeyEquivalent && ![self.userKeyEquivalent isEqual

Re: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Allan Odgaard
On 20 Sep 2016, at 9:11, Dave Lyons wrote: (Ooh! I know that one!) The custom shortcut for Finder's File > Compress menu item continues to work, because Finder goes slightly out if its way to achieve it. The item's -title remains unchanged as ”Compress”, even when you see "Compress “foo”" o

NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-19 Thread Allan Odgaard
Some menu items use titles dynamically updated in validateMenuItem: (based on application state, like if there are selected content). This seems to be incompatible with System Preferences → Keyboard → Shortcuts → App Shortcuts, as the menu item check for custom bindings using their current tit

Re: setApplicationIconImage:

2015-01-21 Thread Allan Odgaard
On 22 Jan 2015, at 14:11, Jens Alfke wrote: Alter the app's Info.plist, I suppose (and then call LaunchServices to tell it to re-register, so it'll notice the changes.) For this to work, you need to exclude the Info.plist from the app bundle’s signature. If the OP insists on adapting the ic

Re: licence key validation method

2015-01-10 Thread Allan Odgaard
On 11 Jan 2015, at 13:34, 2551 wrote: any tutorial on...validating messages will do. Yes, that's precisely what I'm looking for […] I wrote one a decade ago: http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/ Previous thread here: http://prod.lists.apple.com/archive

Re: NSImage glowing

2014-11-11 Thread Allan Odgaard
On 11 Nov 2014, at 12:18, Uli Kusterer wrote: Now of course I can just create a hand-drawn selected version, but I like doing things like that in code. So I’d like to have code that takes the NSImage and makes it glow like Xcode here: https://www.dropbox.com/s/by642iw7xosnki7/Screenshot%202014

Re: Closing window on Yosemite crashes (isFlipped)

2014-11-06 Thread Allan Odgaard
On 6 Nov 2014, at 23:40, Graham Cox wrote: Looks like an object is not removing itself as an observer of window notifications prior to deallocation […] The crash happens when I re-use the window with the WebView, i.e. no (major) objects are released. The crash (almost) disappeared when I st

Re: best way to implement unlock features in app

2014-11-06 Thread Allan Odgaard
On 6 Nov 2014, at 16:53, sqwarqDev wrote: I didn't understand this bit though: If you do not need to encrypt a payload (as in my post) then I suggest making the license be just a serial number followed by a signature on that number (maybe include a short hash of the owner name) If anyone c

Re: best way to implement unlock features in app

2014-11-06 Thread Allan Odgaard
On 6 Nov 2014, at 15:00, sqwarqDev wrote: […] I can't find any guidance on exactly how do I generate and test for valid licence keys at run time? I wrote this post about the general principles of a secure license key scheme: http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-

Re: Closing window on Yosemite crashes (isFlipped)

2014-11-06 Thread Allan Odgaard
On 30 Oct 2014, at 17:26, Fritz Anderson wrote: I haven’t encountered this myself. This is stream-of-consciousness, adding the presence of convertRect:toView: in the trace as the immediate caller… Thanks for your thoughts on the issue. I haven’t pinpointed the exact cause of the crash, but I

Closing window on Yosemite crashes (isFlipped)

2014-10-30 Thread Allan Odgaard
Since Yosemite I have seen a lot of crash reports submitted where the crash is triggered by closing a window and it mostly ends with sending `isFlipped`, `_isLayerBacked`, or `transformRect:` to a wrong object. I have attached a sample crash report below. Does anyone else see this? Anyone know

Re: Custom layout and constraints

2014-09-24 Thread Allan Odgaard
On 21 Sep 2014, at 22:51, Allan Odgaard wrote: 4. If allowsImplicitAnimation is enabled then my custom layout implementation is called a dozen times after the first (true) layout pass. This is problematic because then I’ll do layout (again) and effectively suppress the animation (although

Re: Custom layout and constraints

2014-09-24 Thread Allan Odgaard
On 21 Sep 2014, at 18:18, Ken Thomases wrote: On Sep 21, 2014, at 9:10 AM, Allan Odgaard wrote: The problem seems to be that `layoutSubtreeIfNeeded` calls `resizeWithOldSuperviewSize:` (using the containing view’s size), but regardless of what’s passed to the view, it’ll set the entire

Re: How to obtain target view frame (when animations are running)

2014-09-24 Thread Allan Odgaard
On 24 Sep 2014, at 14:29, Allan Odgaard wrote: I have implicit animations enabled which means that when my NSView’s -layout or -resizeSubviewsWithOldSize: methods are called, the frame property of the view reflects the animation’s current value, which means I place subviews in wrong locations

How to obtain target view frame (when animations are running)

2014-09-24 Thread Allan Odgaard
I have implicit animations enabled which means that when my NSView’s -layout or -resizeSubviewsWithOldSize: methods are called, the frame property of the view reflects the animation’s current value, which means I place subviews in wrong locations. How should I obtain the actual (target) frame?

Re: Custom layout and constraints

2014-09-21 Thread Allan Odgaard
On 21 Sep 2014, at 16:44, Kyle Sluder wrote: […] how can I ensure the position I set for a subview’s frame in my `layout` override is not (implicitly) changed later? You need to turn on translatesAutoresizingMaskIntoConstraints for the subviews you position manually. That way Auto Layout know

Custom layout and constraints

2014-09-21 Thread Allan Odgaard
I am overriding `NSView`’s `layout` method to manually place one of my subviews. I can set the frame for this subview, and it works until someone calls `layoutSubtreeIfNeeded` on the subview (which sometimes happens automatically during display). The subview’s `needsLayout` property is `NO`

Re: return string that is the difference between two other strings

2014-09-20 Thread Allan Odgaard
On 21 Sep 2014, at 6:08, 2551 wrote: As I've been saying all along, this is such a common operation, I'd have thought there must be a common cocoa method or API for doing it. So the question is, can anyone tell me what that is? The general problem you’re dealing with is that of finding the lo

Padding for NSButton containing image

2014-08-28 Thread Allan Odgaard
I would like to create a button similiar to NSRuleEditor’s minus (remove) button. This is what I have tried: NSButton* remove = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 16, 16)]; [[remove cell] setControlSize:NSSmallControlSize]; remove.bezelStyle = NSRoundRectBezelSt

Re: performKeyEquivalent called twice for some key strokes

2013-08-26 Thread Allan Odgaard
On 26 Aug 2013, at 17:35, Ken Thomases wrote: On Aug 23, 2013, at 8:17 AM, Leonid Romanov wrote: > Pressing "Command +" results in two -performKeyEquivalent calls […] […] I'm not familiar with this particular one […] I believe the OP pressed ⌘= which is resent as ⌘+ because Apple show ⌘+ /

Re: Showing numpad key equivs in menu items

2013-05-08 Thread Allan Odgaard
On May 8, 2013, at 23:17, "David M. Cotter" wrote: >> TextMate also draws a custom string as key equivalent ... the only (user >> visible) shortcoming I have found is that it doesn’t left/right align the >> key/modifier glyphs > this was a requirement of ours, to have it actually be right align

Re: Showing numpad key equivs in menu items

2013-05-07 Thread Allan Odgaard
On May 8, 2013, at 9:28, Kyle Sluder wrote: >> […] sets the title as an attributed string using an NSTextTableBlock […] > Any reason you're not using a custom view-based NSMenuItem? It might be > easier to get good results that way. A custom view means you have to render everything yourself. Th

Re: Showing numpad key equivs in menu items

2013-05-07 Thread Allan Odgaard
On May 8, 2013, at 7:36, "David M. Cotter" wrote: > […] filed a DTS incident for (and got some help with) custom-drawing menu > items, for the express purpose of drawing an arbitrary string as the > "keyboard shortcut" in menus. and i can tell you the work around was a PITA > and is a bit fra

Re: Is there a pattern for creating an object with global scope?

2013-04-13 Thread Allan Odgaard
On Apr 14, 2013, at 10:51, Jens Alfke wrote: > C++ static initializers are evil, though, at least the ones that run code. > They run super early, in an undefined order, with no way to specify > dependencies between them; so if you’re not careful they can slow down launch > and/or cause weird n

Re: Callbacks from async blocks

2013-03-20 Thread Allan Odgaard
ock C wants 1. So where we should have ignored block A and accepted B and then C, we instead accept block B, A and ignore block C. On 16 Mar, 2013, at 23:13, Allan Odgaard wrote: On 16 Mar 2013, at 14:14, Roland King wrote: […] you have a simple counter member variable, 'curren

Re: Callbacks from async blocks

2013-03-19 Thread Allan Odgaard
On 16 Mar 2013, at 14:14, Roland King wrote: […] you have a simple counter member variable, 'currentOperation'. It's set to 0 when you have no operation and you increment it each time you make a new one. The code looks like this (typed in mail) […] if( currentOperation == cur