QDesktopServices::storageLocation() calls to QStandardPaths.

This commit is contained in:
Felix Geyer 2015-07-22 17:19:48 +02:00
parent c714fc89f1
commit 5ad9edc3fd
3 changed files with 7 additions and 6 deletions

View file

@ -23,6 +23,7 @@
#include <QDesktopServices>
#include <QStackedLayout>
#include <QStandardPaths>
#include <QMenu>
#include <QSortFilterProxyModel>
#include <QTemporaryFile>
@ -589,7 +590,7 @@ void EditEntryWidget::insertAttachment()
QString defaultDir = config()->get("LastAttachmentDir").toString();
if (defaultDir.isEmpty() || !QDir(defaultDir).exists()) {
defaultDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
defaultDir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).value(0);
}
QString filename = fileDialog()->getOpenFileName(this, tr("Select file"), defaultDir);
if (filename.isEmpty() || !QFile::exists(filename)) {
@ -623,7 +624,7 @@ void EditEntryWidget::saveCurrentAttachment()
QString filename = m_attachmentsModel->keyByIndex(index);
QString defaultDirName = config()->get("LastAttachmentDir").toString();
if (defaultDirName.isEmpty() || !QDir(defaultDirName).exists()) {
defaultDirName = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
defaultDirName = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
}
QDir dir(defaultDirName);
QString savePath = fileDialog()->getSaveFileName(this, tr("Save attachment"),