-
Notifications
You must be signed in to change notification settings - Fork 164
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions.
75ae501
to
ca4e2be
Compare
@jbehley back to you. Thanks. :) |
std::string flag = argv[i]; | ||
if (flag == FLAG_OPEN_DIR) { | ||
if (argc > i) { | ||
parsedArgs[FLAG_OPEN_DIR] = argv[i++ + 1]; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
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("..")
just some more suggestions. |
See #89.