@@ -51,7 +51,7 @@ void FilesystemSidebar::reloadDrives() {
5151 });
5252
5353 for (const QStorageInfo& strg : storages) {
54- QString name_drive = strg.rootPath ();
54+ QString name_drive = QDir::toNativeSeparators ( strg.rootPath () );
5555
5656 if (!strg.name ().isEmpty ()) {
5757 name_drive += QString (" (%1)" ).arg (strg.name ());
@@ -63,7 +63,7 @@ void FilesystemSidebar::reloadDrives() {
6363
6464 m_cmbDrives->addItem (!strg.isReady () ?
6565 qApp->icons ()->fromTheme (QSL (" lock" )) :
66- qApp->icons ()->fromTheme (QSL (" media-flash" )), name_drive, strg.rootPath ());
66+ qApp->icons ()->fromTheme (QSL (" media-flash" )), name_drive, QDir::toNativeSeparators ( strg.rootPath () ));
6767 }
6868}
6969
@@ -149,11 +149,9 @@ void FilesystemSidebar::load() {
149149 connect (m_fsView, &QListView::activated, this , &FilesystemSidebar::openFileFolder);
150150 connect (m_fsView, &FilesystemView::rootIndexChanged, this , [this ](const QModelIndex& idx) {
151151 saveCurrentFolder (idx);
152- });
153- connect (m_lvFavorites, &QListWidget::activated, this , &FilesystemSidebar::openFavoriteItem);
154- connect (m_fsView, &FilesystemView::rootIndexChanged, this , [this ]() {
155152 m_fsView->setFocus ();
156153 });
154+ connect (m_lvFavorites, &QListWidget::activated, this , &FilesystemSidebar::openFavoriteItem);
157155
158156 QStringList saved_files = qApp->settings ()->value (m_settingsSection, QSL (" favorites" ), QStringList ()).toStringList ();
159157
@@ -180,6 +178,13 @@ void FilesystemSidebar::load() {
180178void FilesystemSidebar::saveCurrentFolder (const QString& path) {
181179 m_txtPath->setPlainText (path);
182180 m_txtPath->setToolTip (path);
181+
182+ int index_drive = m_cmbDrives->findData (QDir::toNativeSeparators (QStorageInfo (path).rootPath ()));
183+
184+ m_cmbDrives->blockSignals (true );
185+ m_cmbDrives->setCurrentIndex (index_drive);
186+ m_cmbDrives->blockSignals (false );
187+
183188 qApp->settings ()->setValue (m_settingsSection, QL1S (" current_folder_" ) + OS_ID_LOW, path);
184189}
185190
0 commit comments