Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

src/labeler.cpp Outdated Show resolved Hide resolved
src/labeler.cpp Outdated Show resolved Hide resolved
src/labeler.cpp Outdated Show resolved Hide resolved
@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?

@@ -505,6 +523,10 @@ void Mainframe::closeEvent(QCloseEvent* event) {
}

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.

@@ -520,8 +542,13 @@ void Mainframe::open() {
}
}

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

@@ -25,12 +25,14 @@ class Mainframe : public QMainWindow {

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