Use current dir as initial dir in showSaveAsDlg()

This commit is contained in:
Martchus 2016-11-18 17:59:53 +01:00
parent 84ba55a0df
commit 45b1d038c5
2 changed files with 13 additions and 2 deletions

View File

@ -490,7 +490,8 @@ void MainWindow::showOpenFileDlg()
*/
void MainWindow::showSaveAsDlg()
{
const QString path = QFileDialog::getSaveFileName(this, tr("Save changes as - ") + QCoreApplication::applicationName());
const QString path = QFileDialog::getSaveFileName(this, tr("Save changes as - ") + QCoreApplication::applicationName(),
m_ui->tagEditorWidget->currentDir());
if(!path.isEmpty()) {
m_ui->tagEditorWidget->fileInfo().setSaveFilePath(path.toLocal8Bit().data());
m_ui->tagEditorWidget->applyEntriesAndSaveChangings();

View File

@ -44,6 +44,7 @@ class TagEditorWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(QString currentPath READ currentPath NOTIFY currentPathChanged)
Q_PROPERTY(QString currentDir READ currentDir)
Q_PROPERTY(bool tagEditShown READ isTagEditShown)
Q_PROPERTY(QByteArray fileInfoHtml READ fileInfoHtml)
Q_PROPERTY(bool fileNameVisible READ isFileNameVisible WRITE setFileNameVisible)
@ -56,6 +57,7 @@ public:
public:
QMutex &fileOperationMutex();
const QString &currentPath() const;
const QString &currentDir() const;
Media::MediaFileInfo &fileInfo();
Media::NotificationList &originalNotifications();
bool isTagEditShown() const;
@ -141,7 +143,6 @@ private:
Media::MediaFileInfo m_fileInfo;
std::vector<Media::Tag *> m_tags;
QByteArray m_fileInfoHtml;
/// \brief This is the actual direcotry of the opened file which may differ from the directory selected in the tree view of the main window.
QString m_currentDir;
QString m_lastDir;
QString m_saveFilePath;
@ -169,6 +170,15 @@ inline const QString &TagEditorWidget::currentPath() const
return m_currentPath;
}
/*!
* \brief Returns the current directory.
* \remarks This is the actual direcotry of the opened file which may differ from the directory selected in the tree view of the main window.
*/
inline const QString &TagEditorWidget::currentDir() const
{
return m_currentDir;
}
/*!
* \brief Return file info.
*/