GSoC'20 progress : Phase I related - deprecated functions
Ralf Habacker
ralf.habacker at freenet.de
Fri Aug 21 11:28:05 BST 2020
Am 11.08.20 um 07:39 schrieb Prasun Kumar:
> Hi Ralf,
> I have generated the export header files and tested the
> KTOBLZCHECK_DEPRECATED macro by using it on a
> required method which generated DEPRECATED warnings at build time. So,
> this works as intended.
>
> Can you list those functions ?
>
> I'm coming later back to this, as you need to add the above
> mentioned stuff before we can decorate them.
>
>
> If you can now confirm whether the methods I listed are okay to be
> deprecated, I could then mark them using
> this and open some merge requests.
>
I think that the following functions are candicates for tagging as
deprecated as we now support a "all time" database.
std::time_t dataValidStartDate() const { return data_valid_start; }
std::time_t dataValidEndDate() const { return data_valid_end; }
bool isDataValidForDate(std::time_t date) const;
bool isValidDataAvailable(std::time_t date) const;
std::time_t closestValidData(std::time_t date) const;
bool loadDataForDate(std::time_t date);
std::string getFilenameClosestDateToday() const;
By inspecting those methods I recognized some issues:
1. the variables used by the following functions are not set in the code.
std::time_t dataValidStartDate() const { return data_valid_start; }
std::time_t dataValidEndDate() const { return data_valid_end; }
which let the following functions return a wrong state.
bool isDataValidForDate(std::time_t date) const;
bool isValidDataAvailable(std::time_t date) const;
std::time_t closestValidData(std::time_t date) const;
To fix them I think that dataValidStartDate() should return 0 and
dataValidEndDate() the actual time.
2. std::string getFilenameClosestDateToday() const;
As we do not have only one filename, it should return always the current
file. The class member dated_files seems to be obsolete now and could be
removed.
3. There is a function existDatabase() to check the existance of the
database and there is now validSQLite(const std::string &filename).
I suggest to rename that function to isValidDataBase() or similar to
follow the present naming scheme.
Regards
Ralf
More information about the Kde-finance-apps
mailing list