https://bugs.kde.org/show_bug.cgi?id=414635

            Bug ID: 414635
           Summary: Very strange code at main.cpp
           Product: Spectacle
           Version: 19.11.80
          Platform: Debian stable
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: General
          Assignee: m...@baloneygeek.com
          Reporter: safinas...@mail.ru
                CC: k...@david-redondo.de
  Target Milestone: ---

I am attempting to understand how Spectacle works. So I read its code. I found
the following very strange code in Main.cpp in current master (
4370c5484972a02497bf4bb479f4cc1586b6924c ,
https://github.com/KDE/spectacle/blob/4370c5484972a02497bf4bb479f4cc1586b6924c/src/Main.cpp
):

    } else if (lCmdLineParser.isSet(QStringLiteral("windowundercursor"))) {
        lCaptureMode = Spectacle::CaptureMode::TransientWithParent;
    } else if (lCmdLineParser.isSet(QStringLiteral("transientonly"))) {
        lCaptureMode = Spectacle::CaptureMode::WindowUnderCursor;

This seems like a typo. It seems the following code should be:

    } else if (lCmdLineParser.isSet(QStringLiteral("windowundercursor"))) {
        lCaptureMode = Spectacle::CaptureMode::WindowUnderCursor;
    } else if (lCmdLineParser.isSet(QStringLiteral("transientonly"))) {
        lCaptureMode = Spectacle::CaptureMode::TransientWithParent;

Even if this is not typo, please add some comment, which will explain such
strange code. Or (better) rename something to help people, who read you code.

I am reading code of Spectacle, because I'm trying to capture video from screen
in my very unusual scenario, see https://bugs.kde.org/show_bug.cgi?id=412731 if
you are interested

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to