|
|
|
@ -64,7 +64,7 @@ void GPFileItemContainer::addFolder(const TQString& folder, const TQString& subf
|
|
|
|
|
}
|
|
|
|
|
path += subfolder;
|
|
|
|
|
kdDebug() << "GPFileItemContainer: Adding folder " << path << endl;
|
|
|
|
|
if (!folderDict_.tqfind(path)) {
|
|
|
|
|
if (!folderDict_.find(path)) {
|
|
|
|
|
GPFolder *item = new GPFolder;
|
|
|
|
|
folderDict_.insert(path, item);
|
|
|
|
|
item->viewItem = folderView_->addFolder(folder, subfolder);
|
|
|
|
@ -75,7 +75,7 @@ void GPFileItemContainer::addFolder(const TQString& folder, const TQString& subf
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GPFileItemContainer::addFiles(const TQString& folder, const GPFileItemInfoList& infoList) {
|
|
|
|
|
GPFolder *folderItem = folderDict_.tqfind(folder);
|
|
|
|
|
GPFolder *folderItem = folderDict_.find(folder);
|
|
|
|
|
if (!folderItem) {
|
|
|
|
|
kdWarning() << "GPFileItemContainer: " << "Couldn't find Folder in Dict: " << folder << endl;
|
|
|
|
|
return;
|
|
|
|
@ -83,7 +83,7 @@ void GPFileItemContainer::addFiles(const TQString& folder, const GPFileItemInfoL
|
|
|
|
|
GPFileDict* fileDict = folderItem->fileDict;
|
|
|
|
|
GPFileItemInfoList::const_iterator it;
|
|
|
|
|
for (it = infoList.begin(); it != infoList.end(); ++it) {
|
|
|
|
|
GPFileItemInfo *fileInfo = fileDict->tqfind((*it).name);
|
|
|
|
|
GPFileItemInfo *fileInfo = fileDict->find((*it).name);
|
|
|
|
|
if (!fileInfo) {
|
|
|
|
|
// Hmm... Totally New file
|
|
|
|
|
fileInfo = new GPFileItemInfo((*it));
|
|
|
|
@ -113,13 +113,13 @@ void GPFileItemContainer::addFiles(const GPFileItemInfoList& infoList) {
|
|
|
|
|
for (it = infoList.begin(); it != infoList.end(); ++it) {
|
|
|
|
|
GPFileItemInfo info(*it);
|
|
|
|
|
|
|
|
|
|
GPFolder *folderItem = folderDict_.tqfind(info.folder);
|
|
|
|
|
GPFolder *folderItem = folderDict_.find(info.folder);
|
|
|
|
|
if (!folderItem) {
|
|
|
|
|
kdWarning() << "GPFileItemContainer: " << "Couldn't find Folder in Dict: " << info.folder << endl;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
GPFileDict* fileDict = folderItem->fileDict;
|
|
|
|
|
GPFileItemInfo *fileInfo = fileDict->tqfind((*it).name);
|
|
|
|
|
GPFileItemInfo *fileInfo = fileDict->find((*it).name);
|
|
|
|
|
if (!fileInfo) {
|
|
|
|
|
// Hmm... Totally New file
|
|
|
|
|
fileInfo = new GPFileItemInfo(info);
|
|
|
|
@ -139,13 +139,13 @@ void GPFileItemContainer::addFiles(const GPFileItemInfoList& infoList) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GPFileItemContainer::addFile(const TQString& folder, const GPFileItemInfo& info) {
|
|
|
|
|
GPFolder *folderItem = folderDict_.tqfind(folder);
|
|
|
|
|
GPFolder *folderItem = folderDict_.find(folder);
|
|
|
|
|
if (!folderItem) {
|
|
|
|
|
kdWarning() << "GPFileItemContainer: " << "Couldn't find Folder in Dict: " << folder << endl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
GPFileDict* fileDict = folderItem->fileDict;
|
|
|
|
|
GPFileItemInfo *fileInfo = fileDict->tqfind(info.name);
|
|
|
|
|
GPFileItemInfo *fileInfo = fileDict->find(info.name);
|
|
|
|
|
if (!fileInfo) {
|
|
|
|
|
// Hmm... Totally New file
|
|
|
|
|
fileInfo = new GPFileItemInfo(info);
|
|
|
|
@ -166,13 +166,13 @@ void GPFileItemContainer::addFile(const TQString& folder, const GPFileItemInfo&
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GPFileItemContainer::delFile(const TQString& folder, const TQString& name) {
|
|
|
|
|
GPFolder *folderItem = folderDict_.tqfind(folder);
|
|
|
|
|
GPFolder *folderItem = folderDict_.find(folder);
|
|
|
|
|
if (!folderItem) {
|
|
|
|
|
kdWarning() << "GPFileItemContainer: " << "Couldn't find Folder in Dict: " << folder << endl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
GPFileDict* fileDict = folderItem->fileDict;
|
|
|
|
|
GPFileItemInfo* fileInfo = fileDict->tqfind(name);
|
|
|
|
|
GPFileItemInfo* fileInfo = fileDict->find(name);
|
|
|
|
|
if (!fileInfo) {
|
|
|
|
|
kdWarning() << "GPFileItemContainer: " << "Couldn't File Item to Delete in Dict: " << name << endl;
|
|
|
|
|
return;
|
|
|
|
@ -193,13 +193,13 @@ void GPFileItemContainer::delFile(const TQString& folder, const TQString& name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CameraIconItem* GPFileItemContainer::findItem(const TQString& folder, const TQString& name) {
|
|
|
|
|
GPFolder *folderItem = folderDict_.tqfind(folder);
|
|
|
|
|
GPFolder *folderItem = folderDict_.find(folder);
|
|
|
|
|
if (!folderItem) {
|
|
|
|
|
kdWarning() << "GPFileItemContainer: " << "Couldn't find Folder in Dict: " << folder << endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
GPFileDict* fileDict = folderItem->fileDict;
|
|
|
|
|
GPFileItemInfo* fileInfo = fileDict->tqfind(name);
|
|
|
|
|
GPFileItemInfo* fileInfo = fileDict->find(name);
|
|
|
|
|
if (!fileInfo) {
|
|
|
|
|
kdWarning() << "GPFileItemContainer: " << "Couldn't File Item to Delete in Dict: " << name << endl;
|
|
|
|
|
return 0;
|
|
|
|
|