diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 9af90182..46ba29ae 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -155,14 +155,14 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S outputFolderView->header()->hideSection(3); outputFolderView->setHeaderHidden(true); outputFolderView->setAnimated(true); - outputFolderView->installEventFilter(this); outputFolderView->setMouseTracking(false); outputFolderView->setContextMenuPolicy(Qt::CustomContextMenu); while(saveToSourceFolderCheckBox->isChecked() != m_settings->outputToSourceDir()) saveToSourceFolderCheckBox->click(); prependRelativePathCheckBox->setChecked(m_settings->prependRelativeSourcePath()); connect(outputFolderView, SIGNAL(clicked(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex))); connect(outputFolderView, SIGNAL(activated(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex))); - connect(outputFolderView, SIGNAL(entered(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex))); + connect(outputFolderView, SIGNAL(pressed(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex))); + connect(outputFolderView, SIGNAL(entered(QModelIndex)), this, SLOT(outputFolderViewMoved(QModelIndex))); outputFolderView->setCurrentIndex(m_fileSystemModel->index(m_settings->outputDir())); outputFolderViewClicked(outputFolderView->currentIndex()); connect(buttonMakeFolder, SIGNAL(clicked()), this, SLOT(makeFolderButtonClicked())); @@ -459,10 +459,6 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QTimer::singleShot(250, this, SLOT(restoreCursor())); } - else if(obj == outputFolderView && (event->type() == QEvent::KeyRelease || event->type() == QEvent::KeyPress)) - { - outputFolderViewClicked(outputFolderView->currentIndex()); - } return false; } @@ -882,7 +878,7 @@ void MainWindow::styleActionActivated(QAction *action) } /* - * Output folder changed + * Output folder changed (mouse clicked) */ void MainWindow::outputFolderViewClicked(const QModelIndex &index) { @@ -896,6 +892,17 @@ void MainWindow::outputFolderViewClicked(const QModelIndex &index) m_settings->outputDir(selectedDir); } +/* + * Output folder changed (mouse moved) + */ +void MainWindow::outputFolderViewMoved(const QModelIndex &index) +{ + if(QApplication::mouseButtons() & Qt::LeftButton) + { + outputFolderViewClicked(index); + } +} + /* * Goto desktop button */ diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index 4a49f382..2596263b 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -61,6 +61,7 @@ private slots: void tabActionActivated(QAction *action); void styleActionActivated(QAction *action); void outputFolderViewClicked(const QModelIndex &index); + void outputFolderViewMoved(const QModelIndex &index); void makeFolderButtonClicked(void); void gotoHomeFolderButtonClicked(void); void gotoDesktopButtonClicked(void);