Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samplers, crates, playlists: fix storing import/export paths #4699

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/library/baseplaylistfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void BasePlaylistFeature::slotImportPlaylist() {

// Update the import/export playlist directory
QString fileDirectory(playlistFile);
fileDirectory.truncate(playlistFile.lastIndexOf(QDir::separator()));
fileDirectory.truncate(playlistFile.lastIndexOf("/"));
m_pConfig->set(kConfigKeyLastImportExportPlaylistDirectory,
ConfigValue(fileDirectory));

Expand Down Expand Up @@ -412,7 +412,7 @@ void BasePlaylistFeature::slotCreateImportPlaylist() {

// Set last import directory
QString fileDirectory(playlistFiles.first());
fileDirectory.truncate(playlistFiles.first().lastIndexOf(QDir::separator()));
fileDirectory.truncate(playlistFiles.first().lastIndexOf("/"));
m_pConfig->set(kConfigKeyLastImportExportPlaylistDirectory,
ConfigValue(fileDirectory));

Expand Down Expand Up @@ -483,7 +483,7 @@ void BasePlaylistFeature::slotExportPlaylist() {

// Update the import/export playlist directory
QString fileDirectory(fileLocation);
fileDirectory.truncate(fileLocation.lastIndexOf(QDir::separator()));
fileDirectory.truncate(fileLocation.lastIndexOf("/"));
m_pConfig->set(kConfigKeyLastImportExportPlaylistDirectory,
ConfigValue(fileDirectory));

Expand Down
6 changes: 3 additions & 3 deletions src/library/crate/cratefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ void CrateFeature::slotImportPlaylist() {

// Update the import/export crate directory
QString fileDirectory(playlistFile);
fileDirectory.truncate(playlistFile.lastIndexOf(QDir::separator()));
fileDirectory.truncate(playlistFile.lastIndexOf("/"));
m_pConfig->set(kConfigKeyLastImportExportCrateDirectoryKey,
ConfigValue(fileDirectory));

Expand Down Expand Up @@ -614,7 +614,7 @@ void CrateFeature::slotCreateImportCrate() {

// Set last import directory
QString fileDirectory(playlistFiles.first());
fileDirectory.truncate(playlistFiles.first().lastIndexOf(QDir::separator()));
fileDirectory.truncate(playlistFiles.first().lastIndexOf("/"));
m_pConfig->set(kConfigKeyLastImportExportCrateDirectoryKey,
ConfigValue(fileDirectory));

Expand Down Expand Up @@ -706,7 +706,7 @@ void CrateFeature::slotExportPlaylist() {
}
// Update the import/export crate directory
QString fileDirectory(fileLocation);
fileDirectory.truncate(fileLocation.lastIndexOf(QDir::separator()));
fileDirectory.truncate(fileLocation.lastIndexOf("/"));
m_pConfig->set(kConfigKeyLastImportExportCrateDirectoryKey,
ConfigValue(fileDirectory));

Expand Down
4 changes: 2 additions & 2 deletions src/mixer/samplerbank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void SamplerBank::slotSaveSamplerBank(double v) {

// Update the import/export directory
QString fileDirectory(samplerBankPath);
fileDirectory.truncate(samplerBankPath.lastIndexOf(QDir::separator()));
fileDirectory.truncate(samplerBankPath.lastIndexOf("/"));
m_pConfig->set(kConfigkeyLastImportExportDirectory,
ConfigValue(fileDirectory));

Expand Down Expand Up @@ -154,7 +154,7 @@ void SamplerBank::slotLoadSamplerBank(double v) {

// Update the import/export directory
QString fileDirectory(samplerBankPath);
fileDirectory.truncate(samplerBankPath.lastIndexOf(QDir::separator()));
fileDirectory.truncate(samplerBankPath.lastIndexOf("/"));
m_pConfig->set(kConfigkeyLastImportExportDirectory,
ConfigValue(fileDirectory));

Expand Down