fix extension loading bug

This commit is contained in:
Akash Mozumdar 2019-08-06 11:43:04 -04:00
parent 703fc47972
commit e20f16da80

View File

@ -144,9 +144,9 @@ void ExtenWindow::dropEvent(QDropEvent* event)
{ {
QFileInfo extenFile = file.toLocalFile(); QFileInfo extenFile = file.toLocalFile();
if (extenFile.suffix() != "dll") continue; if (extenFile.suffix() != "dll") continue;
if (QFile::exists(extenFile.fileName()) && extenFile.absolutePath() != QDir::currentPath()) if (extenFile.absolutePath() != QDir::currentPath())
{ {
if (QMessageBox::question(this, EXTENSIONS, CONFIRM_EXTENSION_OVERWRITE) == QMessageBox::Yes) QFile::remove(extenFile.fileName()); if (QFile::exists(extenFile.fileName()) && QMessageBox::question(this, EXTENSIONS, CONFIRM_EXTENSION_OVERWRITE) == QMessageBox::Yes) QFile::remove(extenFile.fileName());
if (!QFile::copy(extenFile.absoluteFilePath(), extenFile.fileName())) QMessageBox::warning(this, EXTENSIONS, EXTENSION_WRITE_ERROR); if (!QFile::copy(extenFile.absoluteFilePath(), extenFile.fileName())) QMessageBox::warning(this, EXTENSIONS, EXTENSION_WRITE_ERROR);
} }
if (Load(extenFile.completeBaseName())) Sync(); if (Load(extenFile.completeBaseName())) Sync();