Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 28a503b8 authored by Henrik Fehlauer's avatar Henrik Fehlauer

Improve opening the screenshots folder for missing config files

Summary:
If {nav Save As} was never used before and the {nav Save} button was
showing the {nav Save As} action, Spectacle would return `Pictures` by
default as the last used "Save As" location, while in all other cases it
would be `Folder/`. The missing `/` resulted in the filemanager
highlighting the folder only, instead of opening it.

The fix simply makes `lastSaveAsLocation()` consistently return URLs
with a `/` at the end.

Test Plan:
- `rm ~/.config/spectaclerc`
- Open Spectacle, {nav Tools > Open Screenshots Folder}
- Observe folder being opened instead of highlighted

Reviewers: #spectacle, gregormi, ngraham

Reviewed By: #spectacle, ngraham

Subscribers: ngraham

Differential Revision: https://phabricator.kde.org/D10559
parent 8dcc8644
......@@ -312,7 +312,7 @@ void KSMainWindow::openScreenshotsFolder()
location = QUrl::fromLocalFile(ExportManager::instance()->saveLocation() + QStringLiteral("/"));
break;
case SaveMode::SaveAs:
location = SpectacleConfig::instance()->lastSaveAsLocation();
location = SpectacleConfig::instance()->lastSaveAsLocation(); // already has a "/" at the end
break;
}
if (!ExportManager::instance()->isFileExists(location)) {
......
......@@ -43,7 +43,7 @@ SpectacleConfig* SpectacleConfig::instance()
QUrl SpectacleConfig::lastSaveAsLocation() const
{
return mGeneralConfig.readEntry(QStringLiteral("lastSaveAsLocation"),
QUrl::fromUserInput(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)));
QUrl::fromUserInput(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + QStringLiteral("/")));
}
void SpectacleConfig::setLastSaveAsLocation(const QUrl &location)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment