Opened 3 days ago

Last modified 3 days ago

#19326 new bug

Unify Screenshot application and Screenshot CLI

Reported by: waddlesplash Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Applications/Screenshot Version: R1/beta5
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

It doesn't make much sense to compile the same code twice into one binary. It even looks like there's two main()s, so which one even gets picked?

It appears the current MIME signatures date to hrev37059, while the fact that there are two versions of essentially the same tool was done in hrev37017.

Change History (1)

comment:1 by pulkomandy, 3 days ago

I'm confused by your comment, the only code shared by the two is Utility.cpp. That does not contain a main() function, so obviously the app gets its main from ScreenshotApp.cpp and the cli tool from Screenshot.cpp? (you can check that in their respective rules in the Jamfile).

They are not the same tool at all, the cli one works by command line arguments, while the app doesn't, and instead shows the configuration window.

There are some situations where the cli app starts the GUI one when asked to do so (instead of putting the screenshot directly in the clipboard or in a file). There are also situations where the GUI app starts the command line tool to take screenshots, I think initially it worked exclusively like that, but then it grew the capability to take screenshots by itself by reusing the code in Utility.cpp.

So, there isn't really any duplicated functionality, but both tools call into each other, and at that point it's questionable wether we really need two different ones.

Note: See TracTickets for help on using tickets.