Skip to content

Adding --open-dir flag, hotkeys, many screenshots.#90

Open
john-philipp wants to merge 2 commits into
jbehley:masterfrom
john-philipp:89-open-dir-etc
Open

Adding --open-dir flag, hotkeys, many screenshots.#90
john-philipp wants to merge 2 commits into
jbehley:masterfrom
john-philipp:89-open-dir-etc

Conversation

@john-philipp
Copy link
Copy Markdown

See #89.

Copy link
Copy Markdown
Owner

@jbehley jbehley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions.

Comment thread src/labeler.cpp Outdated
Comment thread src/labeler.cpp Outdated
Comment thread src/labeler.cpp Outdated
@john-philipp
Copy link
Copy Markdown
Author

@jbehley back to you. Thanks. :)

@john-philipp john-philipp requested a review from jbehley January 2, 2025 13:35
Comment thread src/labeler.cpp
std::string flag = argv[i];
if (flag == FLAG_OPEN_DIR) {
if (argc > i) {
parsedArgs[FLAG_OPEN_DIR] = argv[i++ + 1];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks confusing with the i++ (and probably also wrong?) should it be just i+1?

Comment thread src/widget/Mainframe.cpp
}

void Mainframe::open() {
this->open(nullptr);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this->open(nullptr);
this->open(QString());

Don't use different semantics, even if it works. The QString() is probably what you want to express, like a null or empty string.

Comment thread src/widget/Mainframe.cpp

QString retValue =
QString retValue;
if (dir == nullptr) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (dir == nullptr) {
if (dir.isNull()) {

See https://doc.qt.io/qt-6/qstring.html#distinction-between-null-and-empty-strings

Comment thread src/widget/Mainframe.h

public slots:
void open();
void open(QString dir);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better would be to avoid the redifinition, and just have open with as default; i.e.,

void open(QString dir = Qstring())

Then you can get rid of void open() and still can call open() and open(QString:fromStdString("..")

@jbehley
Copy link
Copy Markdown
Owner

jbehley commented Jan 2, 2025

just some more suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants