summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-07-19 12:15:03 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-07-19 15:16:22 -0300
commitb8d7a7cb99a6123babf738d16743cc96ba8869be (patch)
tree5e4552a4d208a018fd62c176f9f25f9736af5419 /main.cpp
parente826abb238fcd991f4496cc896a8e0c45cc81a48 (diff)
downloadgeneratorrunner-b8d7a7cb99a6123babf738d16743cc96ba8869be.tar.gz
generatorrunner-b8d7a7cb99a6123babf738d16743cc96ba8869be.tar.xz
generatorrunner-b8d7a7cb99a6123babf738d16743cc96ba8869be.zip
Removed lib prefix from generators plugin.0.6.0
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index de61112..55e658a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -116,13 +116,12 @@ int main(int argc, char *argv[])
// Try to load a generator
QString generatorSet = args.value("generatorSet");
if (!generatorSet.isEmpty()) {
- QString generatorFile;
- if (generatorSet.contains(QDir::separator()))
- generatorFile = generatorSet;
- else
- generatorFile = QString(GENERATORRUNNER_PLUGIN_DIR) + "/lib" + generatorSet + "_generator";
+ QFileInfo generatorFile(generatorSet);
- QLibrary plugin(generatorFile);
+ if (generatorFile.baseName() == generatorSet)
+ generatorFile.setFile(QDir(GENERATORRUNNER_PLUGIN_DIR), generatorSet + "_generator");
+
+ QLibrary plugin(generatorFile.filePath());
getGeneratorsFunc getGenerators = (getGeneratorsFunc)plugin.resolve("getGenerators");
if (getGenerators)
getGenerators(&generators);