本文整理汇总了C++中kio::UDSEntry::end方法的典型用法代码示例。如果您正苦于以下问题:C++ UDSEntry::end方法的具体用法?C++ UDSEntry::end怎么用?C++ UDSEntry::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::UDSEntry
的用法示例。
在下文中一共展示了UDSEntry::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
KIO::filesize_t K3b::filesize( const KURL& url )
{
if( url.isLocalFile() ) {
k3b_struct_stat buf;
if ( !k3b_stat( QFile::encodeName( url.path() ), &buf ) ) {
return (KIO::filesize_t)buf.st_size;
}
}
KIO::UDSEntry uds;
KIO::NetAccess::stat( url, uds, 0 );
for( KIO::UDSEntry::const_iterator it = uds.begin(); it != uds.end(); ++it ) {
if( (*it).m_uds == KIO::UDS_SIZE ) {
return (*it).m_long;
}
}
return ( KIO::filesize_t )0;
}
示例2: fromPathOrURL
KURL K3b::convertToLocalUrl( const KURL& url )
{
if( !url.isLocalFile() ) {
#if KDE_IS_VERSION(3,4,91)
return KIO::NetAccess::mostLocalURL( url, 0 );
#else
#ifndef UDS_LOCAL_PATH
#define UDS_LOCAL_PATH (72 | KIO::UDS_STRING)
#else
using namespace KIO;
#endif
KIO::UDSEntry e;
if( KIO::NetAccess::stat( url, e, 0 ) ) {
const KIO::UDSEntry::ConstIterator end = e.end();
for( KIO::UDSEntry::ConstIterator it = e.begin(); it != end; ++it ) {
if( (*it).m_uds == UDS_LOCAL_PATH && !(*it).m_str.isEmpty() )
return KURL::fromPathOrURL( (*it).m_str );
}
}
#endif
}
return url;
}
示例3: slotEntries
/*
* slotEntries
*
* Receive files listed by KIO and call addMatches()
*/
void KURLCompletion::slotEntries(KIO::Job *, const KIO::UDSEntryList &entries)
{
QStringList matches;
KIO::UDSEntryListConstIterator it = entries.begin();
KIO::UDSEntryListConstIterator end = entries.end();
QString filter = d->list_urls_filter;
int filter_len = filter.length();
// Iterate over all files
//
for(; it != end; ++it)
{
QString name;
QString url;
bool is_exe = false;
bool is_dir = false;
KIO::UDSEntry e = *it;
KIO::UDSEntry::ConstIterator it_2 = e.begin();
for(; it_2 != e.end(); it_2++)
{
switch((*it_2).m_uds)
{
case KIO::UDS_NAME:
name = (*it_2).m_str;
break;
case KIO::UDS_ACCESS:
is_exe = ((*it_2).m_long & MODE_EXE) != 0;
break;
case KIO::UDS_FILE_TYPE:
is_dir = ((*it_2).m_long & S_IFDIR) != 0;
break;
case KIO::UDS_URL:
url = (*it_2).m_str;
break;
}
}
if(!url.isEmpty())
{
// kdDebug() << "KURLCompletion::slotEntries url: " << url << endl;
name = KURL(url).fileName();
}
// kdDebug() << "KURLCompletion::slotEntries name: " << name << endl;
if(name[0] == '.' && (d->list_urls_no_hidden || name.length() == 1 || (name.length() == 2 && name[1] == '.')))
continue;
if(d->mode == DirCompletion && !is_dir)
continue;
if(filter_len == 0 || name.left(filter_len) == filter)
{
if(is_dir)
name.append('/');
if(is_exe || !d->list_urls_only_exe)
matches.append(name);
}
}
addMatches(matches);
}