Re: IDE: Accessing main settings outside of ScIDE::Main class
[email protected] Fri, 06 Apr 2018 17:28:38 +0800
| Newsgroups | gmane.comp.audio.supercollider.devel |
|---|---|
| Message-ID | <[email protected]> |
---- On Thu, 05 Apr 2018 16:36:29 +0800 <[email protected]> wrote ---- > - I still can't access the settings object. OK, here's a (potentially...?) more specific question that maybe someone can answer. In MainWindow::restoreWindowState(), I tried deferring the restoreDetachedState() calls in a QTimer. But the behavior is different: saved state is ignored. The same code retrieves the docklets' detached settings in both restoreWindowState() and the deferred function, but: - Settings object memory address: Same in both places - detachedData memory address: Different in the two places MainWindow::restoreWindowState settings address = 0xbf8ad0 (passed as an argument from main()) detachedData address = 0x7ffdad2f9590 MainWindow::restoreDocksDetachedStates settings address = 0xbf8ad0 (Main::instance()->settings()) detachedData address = 0x7ffdad2f9530 <<-- wait, what, 0x60 lower? So we have the same settings object, accessed by the same series of (I assume) deterministic operations (and presumably read-only operations), but the result is not the same. That means the deferred operations are not finding the correct saved state. I can think of two explanations: - something modifies the settings in between the two accesses (but, in my last test, I'm deferring by 0 ms...); - or, there's something special about doing it from the argument-passed pointer rather than getting it from the instance. Any insight into this? (Well, I realize I'm talking to myself here... and I'm just about out of holiday time, so probably this will get dropped for another few months...) hjh _______________________________________________ sc-dev mailing list info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/ search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/