void* StellarPhoenixMAC
::InsertFoldersInTree(void* myEntry,
QString bFileName
) {
MyEntry = (DOSDIR*)myEntry;
QIcon Folder
(":/images/img_Folder.png");
QSize size
(18,
18);
//Set the size of the Item in treeWidget QFont lucidaFont
("Lucida Grande",
12);
unsigned int nListCnt = 0;
iProgressCounter++;
//Check if root already there or not
//if(!bDriveTree && bProcessStarted)
if(!m_dwDirLength)
{
m_dwDirLength++;
DOSDIR *firstDirLink=NULL;
firstDirLink = (DOSDIR*)calloc(1,sizeof(DOSDIR)); //For CreateDirTreeRootItem added here
if(firstDirLink)
{
firstDirLink->dwFileId = ROOTREFRENCE;
firstDirLink->bAttribute=0x10;
firstDirLink->bCheckStatus=UNCHECK;
//Root's ParentID is set to -1 so as to keep it unique
firstDirLink->dwParentId=0;
}
list.
append(new TREEITEM
((void*)firstDirLink,
QString::fromAscii((const char *)m_pDriveForSavingFiles
->VolumeLable,
-1)));
emit MacFileSysRootTree
(QString::fromAscii((const char *)m_pDriveForSavingFiles
->VolumeLable,
-1),qFileId.
setNum(ROOTREFRENCE
),
QString::number(0));
m_MacFileSys->MacFileSysThreadSleep();
if(list.count() > 0)
{
treeitem=list.first();
treeitem->ListViewItem=MacFileSysRootItem;
}
free(firstDirLink);
}///end of if(!m_dwDirLength)
m_dwDirLength++;
m_dwTotalDirs++;
if(!bFileName.isEmpty())
list.append(new TREEITEM((void*)MyEntry,bFileName)); //Item added to list
else
list.
append(new TREEITEM
((void*)MyEntry,
QString::number(MyEntry
->dwFileId
)));
//Item added to list
nListCnt = list.count();
//if(list.count() > 0)
// treeitem=list.last();
if(nListCnt)
treeitem = list.at(nListCnt-1);
//if(!TotalFilesAndFoldersInList.isEmpty())
// m_pTotalSizeReadLabel->setText(TotalFilesAndFoldersInList);
if(!bFileName.isEmpty())
treeViewItem->setText(0,bFileName);
else
{
if(!ID.isEmpty())
treeViewItem->setText(0,ID);
else
treeViewItem->setText(0,"NONAME");
}
if(!ID.isEmpty())
treeViewItem->setText(1,ID);
if(!parentId.isEmpty())
treeViewItem->setText(2,parentId);
//emit SetFolderTree((void*)treeViewItem,bFileName,QString::number(MyEntry->dwFileId),QString::number(MyEntry->dwParentId));
if(MacFileSysRootItem !=NULL && treeViewItem != NULL)
MacFileSysRootItem->insertChild(0,treeViewItem);
treeViewItem->setCheckState (0, Qt::Unchecked );
treeViewItem->setIcon (0, Folder );
if(treeitem != NULL && treeViewItem != NULL)
treeitem->ListViewItem= treeViewItem;
return( (void*)treeViewItem);
}
void StellarPhoenixMAC
::SetFolderTree (void* treeViewItem,
QString bFileName,
QString ID,
QString parentId
) {
QIcon Folder
(":/images/img_Folder.png");
QSize size
(18,
18);
//Set the size of the Item in treeWidget QFont lucidaFont
("Lucida Grande",
12);
if(!TotalFilesAndFoldersInList.isEmpty())
m_pTotalSizeReadLabel->setText(TotalFilesAndFoldersInList);
if(!bFileName.isEmpty())
else
{
if(!ID.isEmpty())
else
}
if(!ID.isEmpty())
if(!parentId.isEmpty())
//((QTreeWidgetItem*)treeViewItem)->setFont(0,lucidaFont);
//((QTreeWidgetItem*)treeViewItem)->setCheckState (0, Qt::Unchecked );
//((QTreeWidgetItem*)treeViewItem)->setIcon (0, Folder );
//((QTreeWidgetItem*)treeViewItem)->setSizeHint (0,size );
((QTreeWidgetItem*)treeViewItem
)->setFlags
(Qt
::ItemIsSelectable | Qt
::ItemIsEnabled | Qt
::ItemIsUserCheckable );
}
void* StellarPhoenixMAC::InsertFoldersInTree(void* myEntry,QString bFileName)
{
MyEntry = (DOSDIR*)myEntry;
QIcon Folder(":/images/img_Folder.png");
QSize size(18,18);//Set the size of the Item in treeWidget
QSize folderSize(16,16);
QFont lucidaFont("Lucida Grande", 12);
unsigned int nListCnt = 0;
QTreeWidgetItem *treeViewItem = NULL;
iProgressCounter++;
//Check if root already there or not
//if(!bDriveTree && bProcessStarted)
if(!m_dwDirLength)
{
m_dwDirLength++;
DOSDIR *firstDirLink=NULL;
firstDirLink = (DOSDIR*)calloc(1,sizeof(DOSDIR)); //For CreateDirTreeRootItem added here
if(firstDirLink)
{
firstDirLink->dwFileId = ROOTREFRENCE;
firstDirLink->bAttribute=0x10;
firstDirLink->bCheckStatus=UNCHECK;
//Root's ParentID is set to -1 so as to keep it unique
firstDirLink->dwParentId=0;
}
list.append(new TREEITEM((void*)firstDirLink,QString::fromAscii((const char *)m_pDriveForSavingFiles->VolumeLable,-1)));
emit MacFileSysRootTree(QString::fromAscii((const char *)m_pDriveForSavingFiles->VolumeLable,-1),qFileId.setNum(ROOTREFRENCE),QString::number(0));
m_MacFileSys->MacFileSysThreadSleep();
if(list.count() > 0)
{
treeitem=list.first();
treeitem->ListViewItem=MacFileSysRootItem;
}
free(firstDirLink);
}///end of if(!m_dwDirLength)
m_dwDirLength++;
m_dwTotalDirs++;
if(!bFileName.isEmpty())
list.append(new TREEITEM((void*)MyEntry,bFileName)); //Item added to list
else
list.append(new TREEITEM((void*)MyEntry,QString::number(MyEntry->dwFileId))); //Item added to list
nListCnt = list.count();
//if(list.count() > 0)
// treeitem=list.last();
if(nListCnt)
treeitem = list.at(nListCnt-1);
treeViewItem = new QTreeWidgetItem;
//if(!TotalFilesAndFoldersInList.isEmpty())
// m_pTotalSizeReadLabel->setText(TotalFilesAndFoldersInList);
QString ID = QString::number(MyEntry->dwFileId);
QString parentId = QString::number(MyEntry->dwParentId);
if(!bFileName.isEmpty())
treeViewItem->setText(0,bFileName);
else
{
if(!ID.isEmpty())
treeViewItem->setText(0,ID);
else
treeViewItem->setText(0,"NONAME");
}
if(!ID.isEmpty())
treeViewItem->setText(1,ID);
if(!parentId.isEmpty())
treeViewItem->setText(2,parentId);
//emit SetFolderTree((void*)treeViewItem,bFileName,QString::number(MyEntry->dwFileId),QString::number(MyEntry->dwParentId));
if(MacFileSysRootItem !=NULL && treeViewItem != NULL)
MacFileSysRootItem->insertChild(0,treeViewItem);
treeViewItem->setCheckState (0, Qt::Unchecked );
treeViewItem->setIcon (0, Folder );
if(treeitem != NULL && treeViewItem != NULL)
treeitem->ListViewItem= treeViewItem;
return( (void*)treeViewItem);
}
void StellarPhoenixMAC::SetFolderTree (void* treeViewItem,QString bFileName, QString ID,QString parentId)
{
QIcon Folder(":/images/img_Folder.png");
QSize size(18,18);//Set the size of the Item in treeWidget
QSize folderSize(16,16);
QFont lucidaFont("Lucida Grande", 12);
if(!TotalFilesAndFoldersInList.isEmpty())
m_pTotalSizeReadLabel->setText(TotalFilesAndFoldersInList);
if(!bFileName.isEmpty())
((QTreeWidgetItem*)treeViewItem)->setData(0,Qt::DisplayRole,bFileName);
else
{
if(!ID.isEmpty())
((QTreeWidgetItem*)treeViewItem)->setData(0,Qt::DisplayRole,ID);
else
((QTreeWidgetItem*)treeViewItem)->setData(0,Qt::DisplayRole,"NONAME");
}
if(!ID.isEmpty())
((QTreeWidgetItem*)treeViewItem)->setData(1,Qt::DisplayRole,ID);
if(!parentId.isEmpty())
((QTreeWidgetItem*)treeViewItem)->setData(2,Qt::DisplayRole,parentId);
//((QTreeWidgetItem*)treeViewItem)->setFont(0,lucidaFont);
//((QTreeWidgetItem*)treeViewItem)->setCheckState (0, Qt::Unchecked );
//((QTreeWidgetItem*)treeViewItem)->setIcon (0, Folder );
//((QTreeWidgetItem*)treeViewItem)->setSizeHint (0,size );
((QTreeWidgetItem*)treeViewItem)->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
}
To copy to clipboard, switch view to plain text mode
Bookmarks