Skip to content

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

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

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

Conversation

@john-philipp
Copy link

See #89.

Copy link
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.

@john-philipp
Copy link
Author

@jbehley back to you. Thanks. :)

@john-philipp john-philipp requested a review from jbehley January 2, 2025 13:35
std::string flag = argv[i];
if (flag == FLAG_OPEN_DIR) {
if (argc > i) {
parsedArgs[FLAG_OPEN_DIR] = argv[i++ + 1];
Copy link
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?

}

void Mainframe::open() {
this->open(nullptr);
Copy link
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.


QString retValue =
QString retValue;
if (dir == nullptr) {
Copy link
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


public slots:
void open();
void open(QString dir);
Copy link
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
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