I have a QStringList
full of file path. But these file path isn't in normal format, i have environment variable in the file path, for example %PATH_OF_VAR%/GEN/abc.txt
. I am using fileName
but apparently it doesn't work. What I want to do is, I need to get only fileName out of this and save it in another QStringList
. When any fileName is deleted from 2nd QStringList
respective filepath needs to be automatically deleted from he 1st QStringList
EDIT:
Xmlget.load(String);
QStringList list;
QStringList preset_scr;
QString name;
xmlget.findAndDescend("INIT_SKRIPTE");
while(xmlget.findNext("SKRIPT"))
{
preset_scr.append(xmlget.getString());
}
for(int i=0;i<preset_scr.count();i++)
{
QFile file(preset_scr.at(i));
name = file.fileName();
list.append(name);
}
qDebug()<<list;
EDIT2: I got trimming working by using QFileInfo
instead of QFile
, i have no clue how to update 1st QStringList
when there is some changes in 2nd QStringList