diff --git a/src/output.cpp b/src/output.cpp --- a/src/output.cpp +++ b/src/output.cpp @@ -2,12 +2,12 @@ * * This file is part of the Virtual Leaf. * - * The Virtual Leaf is free software: you can redistribute it and/or modify + * VirtualLeaf is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * The Virtual Leaf is distributed in the hope that it will be useful, + * VirtualLeaf is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -319,4 +319,16 @@ void MakeDir(const char *dirname) { } +char* AppendHomeDirIfPathRelative(char *datadir) { + QDir dataDir(datadir); + if (dataDir.isRelative()){ + if (datadir) { + free(datadir); + } + QStringList path; + path << QDir::homePath() << dataDir.dirName(); + return strdup((char *) path.join("/").toStdString().c_str()); + } else return datadir; +} + /* finis */