aardappel / procrastitracker

a Windows time tracking application
http://strlen.com/procrastitracker/
500 stars 53 forks source link

I want to use MinGW to compile it; mouse wheel tracing bug #22

Open jt-fuw opened 7 years ago

jt-fuw commented 7 years ago

Seems the MS Visual C (or Studio) Community Edition cannot be installed on Windows XP.

I prepared a DIFF file containing modifications necessary to adapt procrastitracker for MinGW. pt4mingw_diff.zip To apply it, one need use 'patch' utility - get the DIFF fiile from the ZIP, enter 'src' directory and run "patch < (path)\pt4mingw.diff"; then can use 'make' command to compile the procrastitracker.

Working on port to the MinGW I discovered an bug in procrastitracker - the mouse wheel moves were not counted because incorrect structure was used. 'pt4mingw.diff' fixes it, too.

Request for tests: (1) compile procrastitracker with my modifications (see if these sources can be compiled using newest Visual Studio Community Edition), and (2) try how my changes affect counting mouse wheel moves (I noticed they were ignored with the structure used previously and they are counted correctly after the change I did, after compiling by MinGW).

I tested the resultant EXE and found it writes correct db.PT files; I did not test its graphical interface - possibly need do something to get it working. I also asked someone to compile modified sources using an older Visual Studio - they could be compiled without more changes

Important: MinGW and older MS Visual Studio do not support 'auto' type for variables. All their occurrences (there are 3 of them now) must be replaced with the correct type, and adding 'auto' type variables should be avoided for compatibility with other compilers.

In my environment, I have gcc-g++ and libz (so I do not use the included zlib), and posiibly some other MinGW libs or utils - it is hard to find if a package was installed manually or automatically. Full list of packages in my MinGW environment: mingw32-base, mingw32-binutils (bin), mingw32-gcc (bin+lic), mingw32-gcc-g++ (bin+dev), mingw32-gdb (bin), mingw32-libatomic (dll), mingw32-libgcc (dll), mingw32-libgmp (dll), mingw32-libgcmp (dll), mingw32-libiconv (dll), mingw32-libintl (dll), mingw32-libmpc (dll), mingw32-libmpfr (dll), mingw32-libthreadgc (dev+dll), mingw32-libquadmath (dll), mingw32-libssp (dll), mingw32-libstdc++ (dll), mingw32-libz (dev+dll), mingw32-make (bin), mingw32-mingw-get (bin+gui+lic), mingw32-mingwrt (dev+dll), mingw32-tcl (bin+dev+dll+doc), mingw32-tk (bin+dev+dll+doc), mingw32-w32api (dev), mingw32-zlib (lic), msys-base (bin), msys-bash (bin), msys-bzip2 (bin), msys-core (bin+doc+ext+lic), msys-coreutils (bin), msys-diffutils (bin), msys-dos2unix (bin), msys-file (bin), msys-findutils (bin), msys-gawk (bin), msys-grcp (bin), msys-gzip (bin), msys-less (bin), msys-libbz2 (dll), msys-libiconv (dll), msys-libintl (dll), msys-liblzma (dll), msys-libmagic (dll), msys-libregex (dll), msys-libtermcap (dll), msys-make (bin), msys-patch (bin), msys-sed (bin), msys-tar (bin), msys-termcap (bin), msys-texinfo (bin), msys-unzip (bin), msys-xz (bin)

aardappel commented 7 years ago

The way to do patches here on github is a "pull request". That way I can look at it, comment on it etc, and then merge it all conveniently.

Especially since I don't have mingw installed.

It's best to do one PR per issue, i.e. mousewheel fix could be its own PR.

I'm surprised it works on XP at all. The reason I still have a 1.4 download on the site is because PT use a bunch of OS calls that were new with Vista. I presume you've found workaround for them?

The graphical interface is unchanged since XP (heck, it would work on Windows 95 :) but testing it is a good idea.

jt-fuw commented 7 years ago

Yes, I got it working (on Win XP SP3) - however, I needed to change Makefile so it compiled .rc file to get GUI working, the patch I had put here 9h ago makes a non-GUI application.

jt-fuw commented 7 years ago

I do not know how to do a pull request. The tutorial I found on github.com tells about many things, but I do not know which of them are applicable in this case. I spent 2 hours without result. Can you please point me in the right direction?

I assume I need: "git clone" and "git checkout -b " to get files and create a new branch, then modify file(s), then "git add file(s)", and "git commit -m ". Then I have the modification in local copy of the repository. What I am to do to sent the change to github.com? "git push origin " fails - permission denied.

Jerzy Tarasiuk

W dniu 2016-11-12 18:21, Wouter van Oortmerssen napisał(a):

The way to do patches here on github is a "pull request". That way I can look at it, comment on it etc, and then merge it all conveniently.

Especially since I don't have mingw installed.

It's best to do one PR per issue, i.e. mousewheel fix could be its own PR.

I'm surprised it works on XP at all. The reason I still have a 1.4 download on the site is because PT use a bunch of OS calls that were new with Vista. I presume you've found workaround for them?

The graphical interface is unchanged since XP (heck, it would work on Windows 95 :) but testing it is a good idea.

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [1], or mute the thread [2].

*

Links:

[1] https://github.com/aardappel/procrastitracker/issues/22#issuecomment-260135166 [2] https://github.com/notifications/unsubscribe-auth/AGZVcS442_sE6JV7HBzMAp_ENFrIX9B7ks5q9fWFgaJpZM4KwboV

jt-fuw commented 7 years ago

Well, I found how to do a pull request and did one, this for the mouse wheel. https://github.com/aardappel/procrastitracker/pull/23 https://github.com/jt-fuw/procrastitracker

I uploaded also files for the MinGW adaptation, but I would like to test the change before I send a pull request for it - I hope I will do it tonight. https://github.com/jt-fuw/procrastitracker/tree/mingw

aardappel commented 7 years ago

Sorry for the late reply, seems you managed. See my comments there.

jt-fuw commented 7 years ago

Yet another thing discovered, related to MinGW adaptation: seems SetTimer is called incorrectly.

I needed to change arg2 from NULL to 0 in order to compile using MinGW and assumed it to be a MinGW bug. I reported two MinGW and got info the SetTimer is defined correctly in the MinGW - I did some investigation (settimer.txt) and found it is used incorrectly in procrastitracker. The arg2 type is defined by MS as INT_PTR, but the type is not a pointer - it is an integer of size enough to hold a pointer. In MinGW it is UINT and it matches MS definition for 32-bit code.

aardappel commented 7 years ago

Yes, looks like the arg should be 0. I shouldn't matter, as the same code will be generated either way.