On 19.04.19 г. 20:28 ч., Steven Rostedt wrote:
On Fri, 19 Apr 2019 16:50:32 +0300 Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> wrote:+char *KsPluginManager::_pluginLibFromName(const QString &plugin, int &n) +{ + QString path = QCoreApplication::applicationFilePath(); + std::string pluginStr = plugin.toStdString(); + char *lib; + + if (path.contains(KS_DIR)) {I'd rather not use the hardcoded path. If I build the code on one machine, tarball it up and move it to another machine and extract it, and then run that code from that machine, I want it to still use the plugins for that machine. I was hoping to test: string = cmdline_path() + "../../kernel-shark/lib/"; If that exists, then we know that we are in the source directory.
I don't thing this is a good idea. If we search for plugins in a path that is defined like this:
cmdline_path() + "/something/hard/coded/lib/" Then the GUI will do one thing when started like this: ./kernelshark and anther thing when started like this: bin/kernelshark and this can be very surprising behavior for the userThe other solution has it own weaknesses, but at least it sounds like a simple rule: "If you want to use the compiled version of the plugins you have to start the GUI from the source code directory used to build. Otherwise the installed version of the plugins will be used."
Thanks! Yordan
-- Steve+ n = asprintf(&lib, "%s/lib/plugin-%s.so", + KS_DIR, pluginStr.c_str()); + } else { + n = asprintf(&lib, "%s/lib/kshark/plugins/plugin-%s.so", + _INSTALL_PREFIX, pluginStr.c_str()); + } + + return lib; +} +