Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move most explicit getters in optionsmodel to header #1900

Merged
merged 1 commit into from Oct 11, 2012
Merged

move most explicit getters in optionsmodel to header #1900

merged 1 commit into from Oct 11, 2012

Conversation

Diapolo
Copy link

@Diapolo Diapolo commented Oct 2, 2012

  • is more consistent and saves quite some lines of code

@laanwj
Copy link
Member

laanwj commented Oct 2, 2012

OK to the changes, except the one that requires an "extern" global variable
in the header file.

The idea is to keep the communication with the bitcoin core limited to the
*model.cpp implementation files.

@Diapolo
Copy link
Author

Diapolo commented Oct 2, 2012

That one is easy to revert, I wasn't aware of the reason you mentioned above.
Edit: Updated!

@laanwj
Copy link
Member

laanwj commented Oct 2, 2012

It's violated in a few places, for example signmessage.cpp directly uses
core calls and data structures. That's very low-priority, and it's not
worth adding too much code for, but when I can I try to prevent it.

@@ -1,6 +1,8 @@
#ifndef OPTIONSMODEL_H
#define OPTIONSMODEL_H

#include "uint256.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one can go, too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I forgot to remove it while reverting the getTransactionFee() change, thanks for noticing!

- is more consistent and saves quite some lines of code
@Diapolo
Copy link
Author

Diapolo commented Oct 2, 2012

@laanwj Thanks for explaining the idea to limit core access to *model.cpp, but I have to ask what makes the difference between having them in a .cpp or a .h only in the end?

@laanwj
Copy link
Member

laanwj commented Oct 2, 2012

Compilation time, and it makes it easier to separate out the UI code, for example if we make the UI a separate process.

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/7bc65ff1083c726391923fddac86e5abc4b0f2db for binaries and test log.

@sipa
Copy link
Member

sipa commented Oct 7, 2012

Any reason why having the getters in .h is preferrable?

@laanwj
Copy link
Member

laanwj commented Oct 7, 2012

I'm neutral on this. This change is balancing on the ugly edges of C++, on one side this cuts down on the amount of boilerplate lines to compensate for the lack of properties, on the other hand this moves implementation details to the interface description which is also undesirable (but in many cases unavoidable, at least if you want to make full use of the language with templates and such).

@sipa
Copy link
Member

sipa commented Oct 7, 2012

@laanwj Ok, good to know. There has been a general trend towards moving code to .cpp files, but I wasn't sure to what extent we want to pursue this. I don't care about having such oneliners in .h files.

@laanwj
Copy link
Member

laanwj commented Oct 7, 2012

Right, in the case of non-type-parametrized and non-trivial code, the implementation should certainly be in the implementation file.

@Diapolo
Copy link
Author

Diapolo commented Oct 7, 2012

I found it rather hard to follow your discussion as I'm missing some tech-english here. In the end is such a change wanted or should it be avoided (ACK / NACK)?

Edit: And as a remainder, the getLanguage() function was already in the header :).

@sipa
Copy link
Member

sipa commented Oct 7, 2012

Yes, ACK.

@laanwj
Copy link
Member

laanwj commented Oct 7, 2012

ACK

laanwj added a commit that referenced this pull request Oct 11, 2012
move most explicit getters in optionsmodel to header
@laanwj laanwj merged commit fae3989 into bitcoin:master Oct 11, 2012
KolbyML pushed a commit to KolbyML/bitcoin that referenced this pull request Dec 5, 2020
35cc25c fix flags deprecation (furszy)

Pull request description:

  Removing an obsolete `QFlags` member. Not compiling in qt 5.15.
  Issue reported by @rhubarbarian in discord 👌   .

ACKs for top commit:
  random-zebra:
    ACK 35cc25c
  Fuzzbawls:
    utACK 35cc25c

Tree-SHA512: 3148774b0be552eb02740baa7cb697afe43d1396fee993f6a90808b8c97dae7fe990bfc81fc6598e202ee25762136556e573665b6abb8b916c1cb5b1c24feb27
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants