Fix to detect file conponent from path properly in Makefile generator

It should be either `path.right(path.length() - sep_pos - 1)` or
`path.mid(sep_pos + 1)`.

Signed-off-by: OBATA Akio <obache@wizdas.com>
pull/34/head
OBATA Akio 4 years ago
parent a31f05cb8e
commit 5c270c3e26

@ -1183,7 +1183,7 @@ MakefileGenerator::init()
Option::fixPathToTargetOS(imgfile); Option::fixPathToTargetOS(imgfile);
if(!project->isEmpty("UI_DIR") || !project->isEmpty("UI_SOURCES_DIR")) { if(!project->isEmpty("UI_DIR") || !project->isEmpty("UI_SOURCES_DIR")) {
if(imgfile.find(Option::dir_sep) != -1) if(imgfile.find(Option::dir_sep) != -1)
imgfile = imgfile.right(imgfile.findRev(Option::dir_sep) + 1); imgfile = imgfile.mid(imgfile.findRev(Option::dir_sep) + 1);
imgfile.prepend( (project->isEmpty("UI_DIR") ? project->first("UI_SOURCES_DIR") : imgfile.prepend( (project->isEmpty("UI_DIR") ? project->first("UI_SOURCES_DIR") :
project->first("UI_DIR")) ); project->first("UI_DIR")) );
v["QMAKE_IMAGE_COLLECTION"] = TQStringList(imgfile); v["QMAKE_IMAGE_COLLECTION"] = TQStringList(imgfile);
@ -1433,7 +1433,7 @@ MakefileGenerator::write()
TQString prl = var("TARGET"); TQString prl = var("TARGET");
int slsh = prl.findRev(Option::dir_sep); int slsh = prl.findRev(Option::dir_sep);
if(slsh != -1) if(slsh != -1)
prl = prl.right(prl.length() - slsh); prl = prl.right(prl.length() - slsh - 1);
int dot = prl.find('.'); int dot = prl.find('.');
if(dot != -1) if(dot != -1)
prl = prl.left(dot); prl = prl.left(dot);

@ -763,7 +763,7 @@ UnixMakefileGenerator::defaultInstall(const TQString &t)
TQString src_lt = var("QMAKE_ORIG_TARGET"); TQString src_lt = var("QMAKE_ORIG_TARGET");
int slsh = src_lt.findRev(Option::dir_sep); int slsh = src_lt.findRev(Option::dir_sep);
if(slsh != -1) if(slsh != -1)
src_lt = src_lt.right(src_lt.length() - slsh); src_lt = src_lt.right(src_lt.length() - slsh - 1);
int dot = src_lt.find('.'); int dot = src_lt.find('.');
if(dot != -1) if(dot != -1)
src_lt = src_lt.left(dot); src_lt = src_lt.left(dot);
@ -786,7 +786,7 @@ UnixMakefileGenerator::defaultInstall(const TQString &t)
TQString src_pc = var("QMAKE_ORIG_TARGET"); TQString src_pc = var("QMAKE_ORIG_TARGET");
int slsh = src_pc.findRev(Option::dir_sep); int slsh = src_pc.findRev(Option::dir_sep);
if(slsh != -1) if(slsh != -1)
src_pc = src_pc.right(src_pc.length() - slsh); src_pc = src_pc.right(src_pc.length() - slsh - 1);
int dot = src_pc.find('.'); int dot = src_pc.find('.');
if(dot != -1) if(dot != -1)
src_pc = src_pc.left(dot); src_pc = src_pc.left(dot);

@ -1428,7 +1428,7 @@ UnixMakefileGenerator::libtoolFileName()
TQString ret = var("TARGET"); TQString ret = var("TARGET");
int slsh = ret.findRev(Option::dir_sep); int slsh = ret.findRev(Option::dir_sep);
if(slsh != -1) if(slsh != -1)
ret = ret.right(ret.length() - slsh); ret = ret.right(ret.length() - slsh - 1);
int dot = ret.find('.'); int dot = ret.find('.');
if(dot != -1) if(dot != -1)
ret = ret.left(dot); ret = ret.left(dot);
@ -1512,7 +1512,7 @@ UnixMakefileGenerator::pkgConfigFileName()
TQString ret = var("TARGET"); TQString ret = var("TARGET");
int slsh = ret.findRev(Option::dir_sep); int slsh = ret.findRev(Option::dir_sep);
if(slsh != -1) if(slsh != -1)
ret = ret.right(ret.length() - slsh); ret = ret.right(ret.length() - slsh - 1);
if(ret.startsWith("lib")) if(ret.startsWith("lib"))
ret = ret.mid(3); ret = ret.mid(3);
int dot = ret.find('.'); int dot = ret.find('.');

Loading…
Cancel
Save