To support this function, it was necessary to add detailed error results
to the WebPriceQuote class. In addition, some corrections to the output
of status and error messages were necessary.
CCBUG:388449
tbaumgart |
To support this function, it was necessary to add detailed error results
to the WebPriceQuote class. In addition, some corrections to the output
of status and error messages were necessary.
CCBUG:388449
compiled and test on linux
No Linters Available |
No Unit Test Coverage |
Buildable 68 | |
Build 68: arc lint + arc unit |
Can you provide a screen shot of the enhanced dialog?
kmymoney/converter/webpricequote.cpp | ||
---|---|---|
267 | This might not work (or-ing multiple errors) if you do not define them as bit-values but plain enums. Since you evaluate the bits in KSettingsOnlineQuotes::setupIcons(), I suggest you use class Errors { public: enum Type { None = 0x00000000, Data = 0x00000001, Date = 0x00000002, DateFormat = 0x00000004, Price = 0x00000008, Script = 0x00000010, Source = 0x00000020, Symbol = 0x00000040, Success = 0x00000080, URL = 0x00000100 }; as defintion for the enum. | |
kmymoney/dialogs/settings/ksettingsonlinequotes.cpp | ||
261 | Can we have named constants (enums) for the states please? | |
311 | I would write this function as: void KSettingsOnlineQuotes::slotLogQuote(const QString &id, const QString &symbol, const QString &date, double price) { slotLogStatus(QString("%1 %2 %3 %4").arg(id, symbol, date).arg(price)); } It avoid code duplication. The optimizer should take care of the alleged overhead here very well. | |
kmymoney/dialogs/settings/ksettingsonlinequotesdecl.ui | ||
36 | A hint to the forum at https://forum.kde.org/viewforum.php?f=69 might also be valuable. | |
84 | Does this really describe the date format? |
check result after pressing 'check source' from a working source
kmymoney/converter/webpricequote.cpp | ||
---|---|---|
267 | There is no issue here, because class Errors stores the enum values of type 'Type' in a QList<Type>, see webpriceqoute.h:140ff. The statement errors |= Errors:Symbol. is managed by class Errors operator |= and simply add the enum value to the internal list. | |
kmymoney/dialogs/settings/ksettingsonlinequotes.cpp | ||
261 | sure or I can use two methos clearIcons() and setupIcons(Errors errors) | |
311 | will change the implementation | |
kmymoney/dialogs/settings/ksettingsonlinequotesdecl.ui | ||
36 | I will check that | |
84 | I will check that too |
kmymoney/converter/webpricequote.cpp | ||
---|---|---|
56 | I see some potential problem here that once noError is used in a method call as default and an error occurs, noError will keep the error for as long as the application lives. Use a temporary in the case of default value for parameters to avoid this, e.g. bool launch(const QString& _symbol, const QString& _id, const QString& _source = QString(), Errors &_errors = Errors()); as you do with QStrings already. | |
267 | The fun of operator overloading. I did not spot this but you're right. Case closed. |
Just a question:
kmymoney/dialogs/settings/ksettingsonlinequotes.cpp | ||
---|---|---|
299 | If a URL contains'%2', I can trust that this is a query for a currency and otherwise a query for a security or similar? If that is the case, I cannot use "GBP" for the second case, but must use something else - Do you have a suggestion? |