Use current dir as initial dir in showSaveAsDlg()
This commit is contained in:
parent
84ba55a0df
commit
45b1d038c5
|
@ -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();
|
||||
|
|
|
@ -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 ¤tPath() const;
|
||||
const QString ¤tDir() 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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue