diff --git a/pip b/pip index a5809d5..21f8a03 160000 --- a/pip +++ b/pip @@ -1 +1 @@ -Subproject commit a5809d5f39b79d2d4855657401faaa78788e1a77 +Subproject commit 21f8a035d8ca050bd535a2fdc00058a9be2679f9 diff --git a/qad/CMakeLists.txt b/qad/CMakeLists.txt index ef416c2..5fb0ea8 100644 --- a/qad/CMakeLists.txt +++ b/qad/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_policy(SET CMP0017 NEW) # need include() with .cmake project(qad) set(_QAD_MAJOR 1) set(_QAD_MINOR 2) -set(_QAD_REVISION 0) +set(_QAD_REVISION 1) set(_QAD_SUFFIX beta) set(_QAD_COMPANY SHS) set(_QAD_DOMAIN org.SHS) diff --git a/qad/utils/qpiconfig.cpp b/qad/utils/qpiconfig.cpp index 785b3cb..e415072 100644 --- a/qad/utils/qpiconfig.cpp +++ b/qad/utils/qpiconfig.cpp @@ -243,6 +243,7 @@ QPIConfig::QPIConfig(const QString & path, QIODevice::OpenMode mode, QPIConfig:: type = type_; if (!path.isEmpty()) { open(mode); + incdirs << QFileInfo(path).absoluteDir().path(); parse(); } } @@ -253,6 +254,7 @@ QPIConfig::QPIConfig(const QString & path, QIODevice::OpenMode mode): QFile(path type = Config; if (!path.isEmpty()) { open(mode); + incdirs << QFileInfo(path).absoluteDir().path(); parse(); } } @@ -263,6 +265,7 @@ QPIConfig::QPIConfig(const QString & path, QPIConfig::FileType type_): QFile(pat type = type_; if (!path.isEmpty()) { open(QIODevice::ReadWrite); + incdirs << QFileInfo(path).absoluteDir().path(); parse(); } } @@ -748,9 +751,9 @@ void QPIConfig::parse(QString content) { root.clear(); QString src, str, tab, comm, all, name, type, prefix, tprefix; QStringList tree; - Entry * entry, * te, * ce; + Entry * entry = 0, * te = 0, * ce = 0; int ind, sind; - bool isNew, isPrefix; + bool isNew = false, isPrefix = false, wasMultiline = false, isMultiline = false; foreach (QPIConfig * c, inc_devs) delete c; inc_devs.clear(); @@ -781,22 +784,42 @@ void QPIConfig::parse(QString content) { tab = str.left(str.indexOf(str.trimmed().left(1))); str = str.trimmed(); all = str; + + sind = str.indexOf('#'); + if (sind > 0) { + comm = str.mid(sind + 1).trimmed(); + if (comm.length() > 0) { + type = comm[0]; + comm = comm.mid(1).trimmed(); + } else type = "s"; + str = str.left(sind).trimmed(); + } else { + type = "s"; + comm = ""; + } + + if (str.endsWith("\\")) { + isMultiline = true; + str.chop(1); + str = str.trimmed(); + } else + isMultiline = false; + + if (wasMultiline) { + wasMultiline = false; + if (ce) { + ce->_value += str; + ce->_all += "\\\n" + all; + } + str.clear(); + } + wasMultiline = isMultiline; + ind = str.indexOf('='); if ((ind > 0) && !(str[0] == '#')) { - sind = str.indexOf('#'); - if (sind > 0) { - comm = str.right(str.length() - sind - 1).trimmed(); - if (comm.length() > 0) type = comm[0]; - else type = "s"; - comm = comm.right(comm.length() - 1).trimmed(); - str = str.left(sind); - } else { - type = "s"; - comm = ""; - } tree = (prefix + str.left(ind).trimmed()).split(delim); if (tree.front() == "include") { - name = str.right(str.length() - ind - 1).trimmed(); + name = str.mid(ind + 1).trimmed(); QPIConfig * iconf = new QPIConfig(name, incdirs); if (!iconf->dev) { delete iconf; @@ -832,7 +855,7 @@ void QPIConfig::parse(QString content) { ce->delim = delim; ce->_tab = tab; ce->_name = name; - ce->_value = str.right(str.length() - ind - 1).trimmed(); + ce->_value = str.mid(ind + 1).trimmed(); ce->_type = type; ce->_comment = comm; ce->_line = lines;