version text fix

This commit is contained in:
Hamed Masafi 2017-10-07 15:15:20 +03:30
parent d6a9e7c58d
commit e12f5fbea7
3 changed files with 31 additions and 15 deletions

41
include/header_copier Normal file → Executable file
View File

@ -1,27 +1,42 @@
#!/bin/bash
exec 3< <(egrep -o "class\sNUT_EXPORT\s(\S+)" ../src -R 2>&1)
src_dir="src"
namespace_name="nut"
pattern="\.\.\/src\/([a-z]+)\.h\:class\sNUT_EXPORT\s(\w+)"
ns=$(echo $namespace_name|awk '{print tolower($0)}')
Ns="Nut"
NS=$(echo $namespace_name|awk '{print toupper($0)}')
echo $NS
exit
echo "" > "Nut"
echo "" > "nut.h"
create_sub_folder=true
#mkdir -p Nut
exec 3< <(egrep -o "class\s${NS}_EXPORT\s(\S+)" "../$src_dir" -R 2>&1)
pattern="\.\.\/$src_dir\/([a-z]+)\.h\:class\s${NS}_EXPORT\s(\w+)"
echo "" > "$Ns"
echo "" > "$ns.h"
if [[ -z create_sub_folder ]]; then
mkdir -p $Ns
fi
while read line; do
if [[ $line =~ $pattern ]]; then
header=${BASH_REMATCH[1]}
class=${BASH_REMATCH[2]}
echo "#include \"../src/$header.h\"" > $class
echo "#include \"../src/$header.h\"" > "$header.h"
#echo "#include \"../src/$header.h\"" > "Nut/$class"
#echo "#include \"../src/$header.h\"" > "Nut/$header.h"
echo "#include \"../src/$header.h\"" >> "Nut"
echo "#include \"../src/$header.h\"" >> "nut.h"
echo "#include \"../$src_dir/$header.h\"" > $class
echo "#include \"../$src_dir/$header.h\"" > "$header.h"
if [[ -z create_sub_folder ]]; then
echo "#include \"../$src_dir/$header.h\"" > "$Ns/$class"
echo "#include \"../$src_dir/$header.h\"" > "$Ns/$header.h"
fi
echo "#include \"../$src_dir/$header.h\"" >> "$Ns"
echo "#include \"../$src_dir/$header.h\"" >> "$ns.h"
fi
done <&3
exec 3<&-

View File

@ -35,7 +35,8 @@
// Database
//TODO: remove minor version
#define NUT_DB_VERSION(major, minor) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX __nut_DB_VERSION), QT_STRINGIFY(#major "." #minor))
#define NUT_DB_VERSION(version) \
Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX __nut_DB_VERSION), #version))
#define NUT_DECLARE_TABLE(type, name) \
Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX __nut_TABLE " " #type), #name) \

View File

@ -141,7 +141,7 @@ QString SqlServerGenerator::selectCommand(
QString command = SqlGeneratorBase::selectCommand(t, agregateArg, wheres, orders, tableName, joinClassName, skip, take);
if (take != -1 && skip != -1)
command.append(QString("OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY")
command.append(QString("OFFSET %1 ROWS FETCH NEXT %2 ROWS ONLY")
.arg(skip)
.arg(take));
return command;