Chris7/Mudlet2 — pull request #31 by SlySven (2014-03-21 04:14:24+00:00)
Title: Mudlet dev file location

My last pull request might cause problems if the lua files are not in a subdirectory of the src directory alongside the executable. This branch fixes that by doing a user guided search any time the main lua loader for the mudlet lua files can't be found. As a side effect of the work with the lua package.path and the lfs current directory stuff Mudlet can now handle the lua files being anywhere within the accessible file-system - so shadow builds are definitely working now!

Also, because of the need/ability to put a sensible default in for where to start looking for the lua files it is quite easy to provide installation commands in the project file to put the files in that place. So, on *nix, Mudlet is now "deployable" i.e. "make install" inside Qt Creator is now a workable proposition - provided a non-root user has sudo & install commands and a /etc/sudo.conf with a "Path askpass = ..." line or an environmental variable SUDO_ASKPASS pointing to something like /usr/bin/ssh-askpass so they can enter the relevant password. A conventional "make install" directly in the build directory should also work as well.

The path to the main lua file is stored in a human readable format in the "Mudlet 1.0.conf" file accessed via QSettings . The key is "systemLuaFilesPath" which can be deleted to prompt the search again the next time a profile is started (or reconnected).

Unfortunately there was an obsolete "all-in-one" LuaGlobal.lua file in the root of the source directory; to avoid confusion this commit deletes it and because of the significant size difference this code explains to the user in the details why the file they need to find has to be less than 10K (it is 4-5K presently) and not 60K bytes in size.

It might be useful if we could merge the mac_src.pro contents into the main src.pro - this commit does not touch the former file but the changes should still be compatible with all operating systems.