Skip to content

Commit

Permalink
Support basic zipped plugin file name version suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jun 8, 2024
1 parent 6690c68 commit 02a7858
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ void PluginManager::installFromUrl( const QString &url )
// Insure no previous version is running
disableAppPlugin( fileInfo.completeBaseName() );

QDir pluginDirectory = QStringLiteral( "%1/plugins/%2" ).arg( dataDir, fileInfo.completeBaseName() );
// Remove the .zip suffix as well as version information (e.g. myplugin-v1.0.zip becomes myplugin)
const QString pluginDirectoryName = fileName.replace( QRegularExpression( "(-v?\\d+(\\.\\d+)*)?.zIP$", QRegularExpression::CaseInsensitiveOption ), QString() );
QDir pluginDirectory = QStringLiteral( "%1/plugins/%2" ).arg( dataDir, pluginDirectoryName );
if ( pluginDirectory.exists() )
{
pluginDirectory.removeRecursively();
Expand Down

1 comment on commit 02a7858

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.