Menu

#166 Use default text editor to view sync log

1.2.4
Fixed
nobody
None
Low
Windows 7 Pro SP1
Enhancement
2016-10-08
2016-09-11
Flying Hawk
No

Could the log file "CryptSync.log" be opened by system default text editor?
I have Notepad++ set as my default text editor (for .txt .log etc.), but when I press the "Show log" button, notepad.exe is always used to open.
Minor annoyance, but would be nicer if the default editor could be used instead.

Discussion

  • xplay

    xplay - 2016-09-23

    in explorer, find the .log file, right click mouse, click "open with", select "other application", choose the program you like(such as Notepad++), and the most important, choose "always use this application to open .log file";
    then check the result: in explorer ,double click .log file , if it's opened by Notepad++ as the default action, that means ok.
    then, when you click "show log", it will open log file by Notepad++...

     
    • Flying Hawk

      Flying Hawk - 2016-09-23

      but I do have Notepad++ as my default program for .log files.

       
  • Flying Hawk

    Flying Hawk - 2016-09-23

    So I got curious about what @xplay said in their post, and checked CryptSync's source code. The problem appears to be slightly more involved than I expected.

    The apparent inconsistency between my situation and what @xplay described is due to the fact that I changed my default .log and .txt file viewer not the usual way, but by adding a new verb "open_with_Notepad++" to the registry entry and setting this verb as the default verb. The old "open" verb, however, still remains, and is still associated with notepad.exe.

    In CryptSync source code, line 142 of OptionsDlg.cpp, it shows that CryptSync is explicitly using the "open" verb. In my case, notepad.exe gets used.

    A straightforward solution would be setting shex.lpVerb to NULL. According to MSDN documentation, this would cause the default verb to be used, and still fall back to "open" if default unavailable.

    Furthermore, I think using the default verb instead of the hard coded "open" verb is more consistent with Windows platforms behavior. Because in "Control Panel\Programs\Default Programs\Set Associations", the "Current Default" listed by Windows for each file extenstion is determined according to the default verb, not the "open" verb.

     

    Last edit: Flying Hawk 2016-09-23
  • Flying Hawk

    Flying Hawk - 2016-09-23

    I just built CryptSync from source with one line of modification:

    Change line 142 of OptionsDlg.cpp from

    shex.lpVerb = L"open";
    

    to

    shex.lpVerb = NULL;
    

    Now CryptSync will use the true default program to open log file when "Show Log" button is pressed.

    I'm going to use this modified binary for myself.
    Would much appreciate it if this is included in the official build.

     

    Last edit: Flying Hawk 2016-09-23
  • xplay

    xplay - 2016-09-24

    I am using window 10, and not found the problem you mentioned. good luck!

     
  • Stefan Kueng

    Stefan Kueng - 2016-10-08
    • status: New --> Fixed
     
  • Stefan Kueng

    Stefan Kueng - 2016-10-08

    passing nullptr as the verb should do the trick.
    [r315]

     

    Related

    Commit: [r315]


Log in to post a comment.

MongoDB Logo MongoDB