Ejemplo n.º 1
0
QString Folder::path()
{
QString s = "/" + fName + "/";
Folder *parentFolder = (Folder *)parent();
while (parentFolder)
	{
	s.prepend("/"+parentFolder->folderName());
	parentFolder = (Folder *)parentFolder->parent();
	}
return s;
}
Ejemplo n.º 2
0
QStringList Folder::subfolders()
{
QStringList lst = QStringList();
QObjectList* folderLst = (QObjectList*)children();
if (!folderLst)
	return lst;

if (folderLst)
	{
	Folder *f;
	for (f = (Folder*)folderLst->first(); f; f = (Folder*)folderLst->next())
		lst << f->folderName();
	}
return lst;
}
Ejemplo n.º 3
0
Folder* Folder::findSubfolder(const QString& s, bool caseSensitive, bool partialMatch)
{
QObjectList* folderLst = (QObjectList*)children();
if (folderLst)
	{
	Folder *f;
	for (f = (Folder*)folderLst->first(); f; f = (Folder*)folderLst->next())
		{
		QString name = f->folderName();
		if (partialMatch && name.startsWith(s, caseSensitive))
			return f;
		else if (caseSensitive && name == s)
			return f;
		else 
			{
			QString text = s;
			if (name == text.lower())
				return f;
			}
		}
	}
return 0;
}