-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add "Reload File" feature #625
Conversation
@@ -68,7 +68,7 @@ QVImageCore::QVImageCore(QObject *parent) : QObject(parent) | |||
settingsUpdated(); | |||
} | |||
|
|||
void QVImageCore::loadFile(const QString &fileName) | |||
void QVImageCore::loadFile(const QString &fileName, bool isReloading) |
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.
The cache key includes the file size, but this ensures it handles situations in which the size doesn't change (e.g. an uncompressed BMP was re-saved).
src/qvimagecore.h
Outdated
@@ -60,7 +60,7 @@ class QVImageCore : public QObject | |||
|
|||
explicit QVImageCore(QObject *parent = nullptr); | |||
|
|||
void loadFile(const QString &fileName); | |||
void loadFile(const QString &fileName, bool isReloaing = false); |
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.
Typo here
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.
Fixed!
@@ -44,6 +44,7 @@ void ShortcutManager::initializeShortcutsList() | |||
{ | |||
shortcutsList.append({tr("Open"), "open", keyBindingsToStringList(QKeySequence::Open), {}}); | |||
shortcutsList.append({tr("Open URL"), "openurl", QStringList(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_O).toString()), {}}); | |||
shortcutsList.append({tr("Reload File"), "reloadfile", keyBindingsToStringList(QKeySequence::Refresh), {}}); |
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.
indeed this is cmd+r on macOS, but this conflicts with rename. I don't know which should be prioritized--maybe refresh is more important.
Make sure this doesn't conflict on other platforms too.
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.
Good catch, you can take a look at my latest commit and see if you like that idea or have a different suggestion perhaps.
Great |
Implements #587