diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-04 14:11:07 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-04 14:38:05 -0300 |
commit | 879ca025fc24bb79c5744557fc4a14e186e9f61c (patch) | |
tree | c7baff3f83db9b17557ba2203ed6e5d6ec87bb92 | |
parent | 74ad15b93b2c3816850acb702c669be8ce0fc4ab (diff) |
When the user passes an absolute path as the plugin name,
generator runner will load the desired file instead of doing
a mess with the absolute path and the GENERATORRUNNER_PLUGIN_DIR
variable.
This is usefull to test generators plugins without installing them.
Reviewed by Renato Araújo
-rw-r--r-- | main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -120,7 +120,12 @@ int main(int argc, char *argv[]) // Try to load a generator QString generatorSet = args.value("generatorSet"); if (!generatorSet.isEmpty()) { - QString generatorFile = QString(GENERATORRUNNER_PUGIN_DIR) + "/lib" + generatorSet + "_generator"; + QString generatorFile; + if (generatorSet.contains(QDir::separator())) + generatorFile = generatorSet; + else + generatorFile = QString(GENERATORRUNNER_PUGIN_DIR) + "/lib" + generatorSet + "_generator"; + QLibrary plugin(generatorFile); getGeneratorsFunc getGenerators = reinterpret_cast<getGeneratorsFunc>(plugin.resolve("getGenerators")); if (getGenerators) |