Skip to content

Commit

Permalink
Fixed bug regarding filenames that include period characters in their…
Browse files Browse the repository at this point in the history
… name.
  • Loading branch information
Goli4thus committed Feb 7, 2020
1 parent 28f47ce commit 2d72f41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/modelvstbuckets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,17 +330,15 @@ QVariant ModelVstBuckets::headerData(int section, Qt::Orientation orientation, i

void ModelVstBuckets::addVstBucket(const QStringList &filepaths_VstDll)
{
QString filepath;

// Clear 'newlyAdded' flags
for (auto vstBucket : mVstBuckets) {
vstBucket.newlyAdded = false;
}

// Start processing selection
for (int i = 0; i < filepaths_VstDll.size(); i++) {
filepath = filepaths_VstDll.at(i);
QString name = QFileInfo(filepath).baseName();
for (const auto &filepath : filepaths_VstDll) {
QString fileName = QFileInfo(filepath).fileName();
QString suffix = QFileInfo(filepath).suffix();
QByteArray filepath_Hash = dataHasher.calcFilepathHash(filepath);
QByteArray soFile_Hash = dataHasher.calcFilepathHash(filepath);

Expand Down Expand Up @@ -394,7 +392,8 @@ void ModelVstBuckets::addVstBucket(const QStringList &filepaths_VstDll)
*/

beginInsertRows(QModelIndex(), this->rowCount(), this->rowCount());
mVstBuckets.append(VstBucket(name,
// subtrace suffix including period fro filename
mVstBuckets.append(VstBucket(fileName.chopped(suffix.size() + 1),
filepath,
filepath_Hash,
soFile_Hash,
Expand Down
6 changes: 5 additions & 1 deletion src/scanhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ void ScanHandler::slotPerformScan()
verified = true;
emit (signalFoundVst3());
}
scanResults.append(ScanResult(QFileInfo(finding).baseName(),
// TODO: fix baseName problem here as well
QString fileName = QFileInfo(finding).fileName();
QString suffix = QFileInfo(finding).suffix();
// subtrace suffix including period fro filename
scanResults.append(ScanResult(fileName.chopped(suffix.size() + 1),
finding,
vstType,
verified,
Expand Down

0 comments on commit 2d72f41

Please sign in to comment.