Re: [GNC-dev] Reports Naming Problem

2019-08-12 Thread David T. via gnucash-devel
Actually, John, I was renaming the report in its options page and saving 
the result. I tried both the Save button and the Save As button without 
success (expecting in the latter case to get a second saved report under 
the new name, allowing me to delete the first).


In the olden days, the report title was the controlling aspect of a 
stored report, and I was changing that, expecting it to propagate 
through. Old habits die hard.


Best,

David

On 8/12/2019 11:41 PM, John Ralls wrote:



On Aug 12, 2019, at 9:23 AM, David T. via gnucash-devel 
 wrote:

Sending this to -Dev because of the technical aspect of the problem...

Over the years, my Saved Reports list had gotten unruly, with various one-off 
reports littering the folder. In an effort to figure out which reports were 
still valid, I undertook to open every report and delete those that were no 
longer useful to me.

However, the process was long, so I needed some way to flag the reports that I *had* 
vetted, and I chose to add an asterisk ("*") to the end of the report title. 
This postfix tagging worked fine; the tagged reports showed up in the list of reports 
with their new names, and they all ran just fine.

Now, having completed the process, I no longer need to keep track of which 
reports have been checked, and I thought I might remove these tags. 
Unfortunately, renaming the report (either by removing the text, or by adding 
some other text in its place) doesn't work; the asterisk remains regardless.

I realize that I can go into the saved-reports-2.8 file and manually rename 
them all, but that seemingly defeats the purpose of a user interface...

This is from the "saved report configurations" dialog using the "rename" button 
that looks like an edit icon?

I can add and remove asterisks from a report name there with no issues. It 
doesn't seem to matter whether I quit GnuCash between edits.

Regards,
John Ralls


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Rework GoogleTest integration

2019-08-12 Thread John Ralls



> On Aug 12, 2019, at 3:12 PM, Christian Gruber  
> wrote:
> 
> Following my previous thread "[GNC-dev] Contribute to GnuCash development" I 
> opened a new topic thread about reworking GoogleTest integration.
> 
> 
> At first some investigation results on bug 797344 
> .
> 
> In function gnc_gtest_configure() in file 
> common/cmake_modules/GncAddTest.cmake the two CMake variables 
> GTEST_INCLUDE_DIR and GMOCK_INCLUDE_DIR are set as follows:
> 
> find_path(GTEST_INCLUDE_DIR gtest/gtest.h HINTS ${GTEST_ROOT}/include 
> ${GMOCK_ROOT}/gtest/include /usr/include)
> find_path(GMOCK_INCLUDE_DIR gmock/gmock.h HINTS ${GMOCK_ROOT}/include 
> /usr/include)
> 
> This means, as long as GTEST_ROOT and GMOCK_ROOT are defined and refer to a 
> valid GoogleTest repository, header files gtest.h and gmock.h are found there 
> and the two variables GTEST_INCLUDE_DIR and GMOCK_INCLUDE_DIR will refer to 
> the include directories within this GoogleTest repository.
> 
> In contrast to that the four CMake variables GTEST_MAIN_LIB, 
> GTEST_SHARED_LIB, GMOCK_MAIN_LIB and GMOCK_SHARED_LIB are set in the same 
> function gnc_gtest_configure() as follows:
> 
> find_library(GTEST_MAIN_LIB gtest_main)
> find_library(GTEST_SHARED_LIB gtest)
> find_library(GMOCK_MAIN_LIB gmock_main)
> find_library(GMOCK_SHARED_LIB gmock)
> 
> This means, libraries are always searched in the default CMake search paths. 
> Therefore any preinstalled GoogleTest libraries will be found this way.
> 
> This explains the behaviour described in my bug report.
> 
> 
> Now let's come to my ideas regarding rework of GoogleTest integration. After 
> further studying CMake files I have two general questions at first.
> 
> 1. Why are library targets "gtest" and "gmock" defined in GnuCash build 
> system instead of importing them from GoogleTest build results?
> 
> In file common/test-core/CMakeLists.txt these two targets are defined via 
> add_library(). The same is done within GoogleTest build system in files 
> googletest/CMakeLists.txt and googlemock/CMakeLists.txt. So part of the CMake 
> build system from GoogleTest repository is copied into GnuCash build system.
> 
> My idea is to build and install GoogleTest completely independent from 
> GnuCash using its own build system and then importing targets via 
> find_package() into GnuCash build system. GoogleTest build system provides 
> CMake configuration files after installation ready for importing targets into 
> other projects.
> 
> CMake function find_package() is able to find package GTest via CMake 
> configuration files, i.e. prebuilt from source code repository, as well as 
> preinstalled libraries from distro using internal CMake module FindGTest 
> . Beginning from 
> CMake version 3.5 module FindGTest provides imported targets GTest::GTest and 
> GTest::Main.
> 
> This would avoid mixing of libraries and header files from different 
> locations.
> 
> Additionally the user doesn't have to define extra environment variables 
> GTEST_ROOT and GMOCK_ROOT anymore. Instead the user can configure CMake 
> search path using CMake variable CMAKE_PREFIX_PATH, if desired.
> 
> And the user can choose, which GoogleTest installation should be used by 
> influencing the CMake search path. So the requirement, that one can decide 
> whether to use preinstalled GoogleTest libraries from distro or GoogleTest 
> installation prebuilt from sources would be fulfilled.
> 
> 
> 2. Why is library target "gtest" not used directly instead of variables 
> GTEST_LIB, GTEST_INCLUDE_DIR?
> 
> Several test applications are defined via function gnc_add_test() by passing 
> a list of sources, include directories and libraries to that function. This 
> function gnc_add_test() is defined in file 
> common/cmake_modules/GncAddTest.cmake and passes the list of libraries 
> (TEST_LIBS_VAR_NAME) after resolving the variable names to CMake function 
> target_link_libraries().
> 
> My idea is to add library target "gtest" directly to that list of libraries 
> instead of variable GTEST_LIB, which is possible since CMake function 
> target_link_libraries() can handle libraries as well as CMake targets. The 
> advantage is, that you don't have to handle include directories separately on 
> your own. When passing CMake targets to function target_link_libraries() 
> CMake does all the stuff for you. Include directories defined for that target 
> are added automatically, i.e. target_include_directories() doesn't have to be 
> invoked to add GTEST_INCLUDE_DIR.
> 
> A further advantage is, that all test application targets depend on library 
> target "gtest". And if library target "gtest" is not an imported target, it 
> would be rebuilt automatically if necessary, when building test applications. 
> Currently after any change to GoogleTest sources, e.g. checking out another 
> version, you have to rebuilt GoogleTest libraries at first via 

Re: [GNC-dev] Contribute to GnuCash development

2019-08-12 Thread Christian Gruber

Am 12.08.19 um 00:48 schrieb John Ralls:



On Aug 11, 2019, at 3:31 PM, Christian Gruber  
wrote:

Hi,

I'm new on this mailing list. I'm using GnuCash for several months now and 
think, I can also spend some time for GnuCash bugfixing and maybe also 
development later on.

When I started to build GnuCash from source code the first time, I already 
detected two bugs, which I reported on Bugzilla:

* https://bugs.gnucash.org/show_bug.cgi?id=797342
* https://bugs.gnucash.org/show_bug.cgi?id=797344

Maybe I can fix the second bug at first. However I had a deeper look into the 
GnuCash CMake files regarding integration of GoogleTest into the GnuCash build 
system and it looked a little bit strange to me. From my CMake experience I 
would choose a different way. And I would say, that not only this bug should be 
fixed, but the whole GoogleTest integration should be updated.

If you like, we can discuss about that. I have several years of CMake 
experience.

Sure. The only constraint is that in spite of the Googletest recommendation to 
build directly from source for each application some of the Linux distro 
packagers insist that the packaged shared library from their distro must be 
used.

Regards,
John Ralls


Ok, I'll open a new topic thread.
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Reports Naming Problem

2019-08-12 Thread John Ralls



> On Aug 12, 2019, at 9:23 AM, David T. via gnucash-devel 
>  wrote:
> 
> Sending this to -Dev because of the technical aspect of the problem...
> 
> Over the years, my Saved Reports list had gotten unruly, with various one-off 
> reports littering the folder. In an effort to figure out which reports were 
> still valid, I undertook to open every report and delete those that were no 
> longer useful to me.
> 
> However, the process was long, so I needed some way to flag the reports that 
> I *had* vetted, and I chose to add an asterisk ("*") to the end of the report 
> title. This postfix tagging worked fine; the tagged reports showed up in the 
> list of reports with their new names, and they all ran just fine.
> 
> Now, having completed the process, I no longer need to keep track of which 
> reports have been checked, and I thought I might remove these tags. 
> Unfortunately, renaming the report (either by removing the text, or by adding 
> some other text in its place) doesn't work; the asterisk remains regardless.
> 
> I realize that I can go into the saved-reports-2.8 file and manually rename 
> them all, but that seemingly defeats the purpose of a user interface...

This is from the "saved report configurations" dialog using the "rename" button 
that looks like an edit icon?

I can add and remove asterisks from a report name there with no issues. It 
doesn't seem to matter whether I quit GnuCash between edits.

Regards,
John Ralls

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] Reports Naming Problem

2019-08-12 Thread David T. via gnucash-devel

Sending this to -Dev because of the technical aspect of the problem...

Over the years, my Saved Reports list had gotten unruly, with various 
one-off reports littering the folder. In an effort to figure out which 
reports were still valid, I undertook to open every report and delete 
those that were no longer useful to me.


However, the process was long, so I needed some way to flag the reports 
that I *had* vetted, and I chose to add an asterisk ("*") to the end of 
the report title. This postfix tagging worked fine; the tagged reports 
showed up in the list of reports with their new names, and they all ran 
just fine.


Now, having completed the process, I no longer need to keep track of 
which reports have been checked, and I thought I might remove these 
tags. Unfortunately, renaming the report (either by removing the text, 
or by adding some other text in its place) doesn't work; the asterisk 
remains regardless.


I realize that I can go into the saved-reports-2.8 file and manually 
rename them all, but that seemingly defeats the purpose of a user 
interface...


David

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel