KFileTreeViewItem* KFileTreeBranch::findTVIByURL( const KURL& url ) { KFileTreeViewItem *resultItem = 0; if( m_startURL.equals(url, true) ) { kdDebug(250) << "findByURL: Returning root as a parent !" << endl; resultItem = m_root; } else if( m_lastFoundURL.equals( url, true )) { kdDebug(250) << "findByURL: Returning from lastFoundURL!" << endl; resultItem = m_lastFoundItem; } else { kdDebug(250) << "findByURL: searching by dirlister: " << url.url() << endl; KFileItem *it = findByURL( url ); if( it ) { resultItem = static_cast<KFileTreeViewItem*>(it->extraData(this)); m_lastFoundItem = resultItem; m_lastFoundURL = url; } } return( resultItem ); }
bool RSSEditPopup::Create(void) { // Load the theme for this screen bool foundtheme = LoadWindowFromXML("netvision-ui.xml", "rsseditpopup", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_urlEdit, "url", &err); UIUtilE::Assign(this, m_titleEdit, "title", &err); UIUtilE::Assign(this, m_descEdit, "description", &err); UIUtilE::Assign(this, m_authorEdit, "author", &err); UIUtilE::Assign(this, m_download, "download", &err); UIUtilE::Assign(this, m_okButton, "ok", &err); UIUtilE::Assign(this, m_cancelButton, "cancel", &err); UIUtilE::Assign(this, m_thumbButton, "preview_browse", &err); UIUtilE::Assign(this, m_thumbImage, "preview", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'rsseditpopup'"); return false; } connect(m_okButton, SIGNAL(Clicked()), this, SLOT(ParseAndSave())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); connect(m_thumbButton, SIGNAL(Clicked()), this, SLOT(DoFileBrowser())); m_urlEdit->SetMaxLength(0); m_titleEdit->SetMaxLength(255); m_descEdit->SetMaxLength(0); m_authorEdit->SetMaxLength(255); if (m_editing) { m_site = findByURL(m_urlText, VIDEO_PODCAST); m_urlEdit->SetText(m_urlText); m_titleEdit->SetText(m_site->GetTitle()); m_descEdit->SetText(m_site->GetDescription()); m_authorEdit->SetText(m_site->GetAuthor()); QString thumb = m_site->GetImage(); if (!thumb.isEmpty()) { m_thumbImage->SetFilename(thumb); m_thumbImage->Load(); } if (m_site->GetDownload() == 1) m_download->SetCheckState(MythUIStateType::Full); } BuildFocusList(); return true; }
void KFileTreeBranch::slotDirlisterClearURL( const KURL& url ) { kdDebug(250)<< "*** Clear for URL !" << url.prettyURL() << endl; KFileItem *item = findByURL( url ); if( item ) { KFileTreeViewItem *ftvi = static_cast<KFileTreeViewItem *>(item->extraData( this )); deleteChildrenOf( ftvi ); } }