当前位置: 首页>>代码示例>>C++>>正文


C++ QFileInfo::owner方法代码示例

本文整理汇总了C++中QFileInfo::owner方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileInfo::owner方法的具体用法?C++ QFileInfo::owner怎么用?C++ QFileInfo::owner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QFileInfo的用法示例。


在下文中一共展示了QFileInfo::owner方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addFileNode

  tlp::node addFileNode(const QFileInfo &infos, tlp::Graph *g) {
    tlp::node n = g->addNode();
    _absolutePaths->setNodeValue(n,tlp::QStringToTlpString(infos.absoluteFilePath()));
    _baseNames->setNodeValue(n,tlp::QStringToTlpString(infos.baseName()));
    _createdDates->setNodeValue(n,tlp::QStringToTlpString(infos.created().toString()));
    _fileNames->setNodeValue(n,tlp::QStringToTlpString(infos.fileName()));
    _isDir->setNodeValue(n,infos.isDir());
    _isExecutable->setNodeValue(n,infos.isExecutable());
    _isReadable->setNodeValue(n,infos.isReadable());
    _isSymlink->setNodeValue(n,infos.isSymLink());
    _isWritable->setNodeValue(n,infos.isWritable());
    _lastModifiedDates->setNodeValue(n,tlp::QStringToTlpString(infos.lastModified().toString()));
    _lastReadDates->setNodeValue(n,tlp::QStringToTlpString(infos.lastRead().toString()));
    _owners->setNodeValue(n,tlp::QStringToTlpString(infos.owner()));
    _permissions->setNodeValue(n,(int)(infos.permissions()));
    _suffixes->setNodeValue(n,tlp::QStringToTlpString(infos.suffix()));
    _sizes->setNodeValue(n,infos.size());

    if (_useIcons) {
      std::string extension = infos.suffix().toStdString();

      if (infos.isDir()) {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FolderO);
        tlp::ColorProperty *viewColor = graph->getProperty<tlp::ColorProperty>("viewColor");
        viewColor->setNodeValue(n, dirColor);
      }
      else if (std::find(commonTextFilesExt.begin(), commonTextFilesExt.end(), extension) != commonTextFilesExt.end()) {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileTextO);
      }
      else if (std::find(commonArchiveFilesExt.begin(), commonArchiveFilesExt.end(), extension) != commonArchiveFilesExt.end()) {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileArchiveO);
      }
      else if (std::find(commonAudioFilesExt.begin(), commonAudioFilesExt.end(), extension) != commonAudioFilesExt.end()) {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileAudioO);
      }
      else if (std::find(commonImageFilesExt.begin(), commonImageFilesExt.end(), extension) != commonImageFilesExt.end()) {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileImageO);
      }
      else if (std::find(commonVideoFilesExt.begin(), commonVideoFilesExt.end(), extension) != commonVideoFilesExt.end()) {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileVideoO);
      }
      else if (std::find(commonDevFilesExt.begin(), commonDevFilesExt.end(), extension) != commonDevFilesExt.end()) {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileCodeO);
      }
      else if (extension == "pdf") {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FilePdfO);
      }
      else if (extension == "doc" || extension == "docx") {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileWordO);
      }
      else if (extension == "xls" || extension == "xlsx") {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FileExcelO);
      }
      else if (extension == "ppt" || extension == "pptx") {
        _fontAwesomeIcon->setNodeValue(n, tlp::TulipFontAwesome::FilePowerpointO);
      }
    }

    return n;
  }
开发者ID:mneumann,项目名称:tulip,代码行数:60,代码来源:FileSystem.cpp

示例2: ListFilesInDirectoryTest

QMultiMap<QString,FileAttributes> ListFilesInDirectoryTest(QDir dir, bool Hash)
{
    extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
    qt_ntfs_permission_lookup++; // turn checking on
    QMultiMap<QString, FileAttributes> fileAttHashTable; //making hash table to store file attributes
    dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
    dir.setSorting(QDir::Name);
    QFileInfoList list = dir.entryInfoList();
    for (int i = 0; i < list.size(); ++i)
    {
       QFileInfo fileInfo = list.at(i);
       if (fileInfo.isFile())
       {
           FileAttributes tempFileAttributes;
           QDateTime date = fileInfo.lastModified();
           QString lastModified = date.toString();

            tempFileAttributes.absoluteFilePath = fileInfo.absoluteFilePath();
            tempFileAttributes.fileName = fileInfo.fileName();
            tempFileAttributes.filePath= fileInfo.path();
            if (Hash) tempFileAttributes.md5Hash = GetFileMd5hash(fileInfo.absoluteFilePath());
            tempFileAttributes.lastModified  = fileInfo.lastModified();
            tempFileAttributes.lastRead = fileInfo.lastRead();
            tempFileAttributes.created = fileInfo.created();
            tempFileAttributes.isHidden =  fileInfo.isHidden();
            tempFileAttributes.size = fileInfo.size();
            tempFileAttributes.owner = fileInfo.owner();
            fileAttHashTable.insert(fileInfo.absoluteFilePath(),tempFileAttributes);
       }

    }
return fileAttHashTable;
}
开发者ID:szkrawcz,项目名称:aInf,代码行数:33,代码来源:dirgrinder.cpp

示例3: name

MyDirEntry::MyDirEntry(const QFileInfo& info) : 
  name(info.fileName()),
  owner(info.owner()), 
  group(info.group()), 
  lastModified(info.lastModified()),
  permissions(info.permissions()),
  lastModifiedBy(hostName),
  parent(0)
{};
开发者ID:porphyr,项目名称:SyncBox,代码行数:9,代码来源:mydirentry.cpp

示例4: info

TEST(codegen, DISABLED_reference)
{
  soft::Reference reference;
  QFileInfo info ("/tmp/thermo-edited.dat");
  reference.uri = "file://" + info.absoluteFilePath().toStdString();
  reference.created = info.created().toString("dd-mm-yyyy").toStdString();
  reference.owner = info.owner().toStdString();
  reference.lastModified = info.lastModified().toString("dd-mm-yyyy").toStdString();
  reference.sha1 = toStdBlob(sha1(info.absoluteFilePath()));

  soft::Storage storage("mongo2", "mongodb://localhost", "db=codegentest;coll=reference");
  storage.save(&reference);
}
开发者ID:NanoSim,项目名称:Porto,代码行数:13,代码来源:codegen-test.cpp

示例5: main

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
//    QDir * _dir=new QDir();
//   // _dir->mkdir("tmp//audio");
//    _dir->mkpath("tmp/audio");

  /**/
    QDir directory(this->getPath());
    qDebug()<<"getIOSFilePath,m    :"<<this->getPath();
    QFileInfoList fileInfoList;
    if (this->hiddenFiles)
    {
        fileInfoList = directory.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System);
    }
    else
    {
        fileInfoList = directory.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot);
    }
    QFileInfo fileInfo;
    File file;
    QList<File> *fileList = new QList<File>;
    QFileIconProvider *provider = new QFileIconProvider;
    while (!fileInfoList.isEmpty())
    {
        if (this->procesEvents)
            qApp->processEvents();
        fileInfo = fileInfoList.takeFirst();

        file.fileIcon = provider->icon(fileInfo);
        file.fileName = fileInfo.fileName();
        qDebug()<<"IOSFileName:"<<file.fileName;
        file.fileSize = QString::number(fileInfo.size());
        file.fileDate = fileInfo.lastModified().toString("MMM dd yyyy");
        file.filePath = fileInfo.absoluteFilePath();
        file.filePermissions = "";
        file.fileOwner = fileInfo.owner();
        if (fileInfo.isDir())
            file.fileType = "dir";
        else
            file.fileType = "file";

        fileList->append(file);
    }
    delete provider;
    return fileList;
    return a.exec();
}
开发者ID:JustFFunny,项目名称:WorkSpace,代码行数:48,代码来源:main.cpp

示例6: QWidget

//! [7]
PermissionsTab::PermissionsTab(const QFileInfo &fileInfo, QWidget *parent)
    : QWidget(parent)
{
    QGroupBox *permissionsGroup = new QGroupBox(tr("Permissions"));

    QCheckBox *readable = new QCheckBox(tr("Readable"));
    if (fileInfo.isReadable())
        readable->setChecked(true);

    QCheckBox *writable = new QCheckBox(tr("Writable"));
    if ( fileInfo.isWritable() )
        writable->setChecked(true);

    QCheckBox *executable = new QCheckBox(tr("Executable"));
    if ( fileInfo.isExecutable() )
        executable->setChecked(true);

    QGroupBox *ownerGroup = new QGroupBox(tr("Ownership"));

    QLabel *ownerLabel = new QLabel(tr("Owner"));
    QLabel *ownerValueLabel = new QLabel(fileInfo.owner());
    ownerValueLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);

    QLabel *groupLabel = new QLabel(tr("Group"));
    QLabel *groupValueLabel = new QLabel(fileInfo.group());
    groupValueLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);

    QVBoxLayout *permissionsLayout = new QVBoxLayout;
    permissionsLayout->addWidget(readable);
    permissionsLayout->addWidget(writable);
    permissionsLayout->addWidget(executable);
    permissionsGroup->setLayout(permissionsLayout);

    QVBoxLayout *ownerLayout = new QVBoxLayout;
    ownerLayout->addWidget(ownerLabel);
    ownerLayout->addWidget(ownerValueLabel);
    ownerLayout->addWidget(groupLabel);
    ownerLayout->addWidget(groupValueLabel);
    ownerGroup->setLayout(ownerLayout);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(permissionsGroup);
    mainLayout->addWidget(ownerGroup);
    mainLayout->addStretch(1);
    setLayout(mainLayout);
}
开发者ID:KDE,项目名称:android-qt5-qtbase,代码行数:47,代码来源:tabdialog.cpp

示例7: loadSchemes

void TupThemeSelector::loadSchemes()
{
    QDir themeDir(SHARE_DIR + "themes");
    
    if (themeDir.exists()) {
        m_allSchemes->clear();
        QFileInfoList files = themeDir.entryInfoList(QStringList() <<"*.tupt");
        
        for (int i = 0; i < files.count(); i++) {
             QFileInfo iterator = files[i];
             QTreeWidgetItem *item = new QTreeWidgetItem(m_allSchemes);
             item->setText(0, iterator.fileName());
             item->setText(1, iterator.owner());
             item->setText(2, iterator.created().toString());
        }
    }
}
开发者ID:KDE,项目名称:tupi,代码行数:17,代码来源:tupthemeselector.cpp

示例8: operationListChildren

void QLocalFs::operationListChildren( QNetworkOperation *op )
{
#ifdef QLOCALFS_DEBUG
    qDebug( "QLocalFs: operationListChildren" );
#endif
    op->setState( StInProgress );

    dir = QDir( url()->path() );
    dir.setNameFilter( url()->nameFilter() );
    dir.setMatchAllDirs( TRUE );
    if ( !dir.isReadable() ) {
	QString msg = tr( "Could not read directory\n%1" ).arg( url()->path() );
	op->setState( StFailed );
	op->setProtocolDetail( msg );
	op->setErrorCode( (int)ErrListChildren );
	emit finished( op );
	return;
    }

    const QFileInfoList *filist = dir.entryInfoList( QDir::All | QDir::Hidden | QDir::System );
    if ( !filist ) {
	QString msg = tr( "Could not read directory\n%1" ).arg( url()->path() );
	op->setState( StFailed );
	op->setProtocolDetail( msg );
	op->setErrorCode( (int)ErrListChildren );
	emit finished( op );
	return;
    }

    emit start( op );

    QFileInfoListIterator it( *filist );
    QFileInfo *fi;
    QValueList<QUrlInfo> infos;
    while ( ( fi = it.current() ) != 0 ) {
	++it;
	infos << QUrlInfo( fi->fileName(), convertPermissions(fi), fi->owner(), fi->group(),
			   fi->size(), fi->lastModified(), fi->lastRead(), fi->isDir(), fi->isFile(),
			   fi->isSymLink(), fi->isWritable(), fi->isReadable(), fi->isExecutable() );
    }
    emit newChildren( infos, op );
    op->setState( StDone );
    emit finished( op );
}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:44,代码来源:qlocalfs.cpp

示例9: QGroupBox

////////////////////////////////////////////////////////////////////////////////
//
// GeneralTab
//
////////////////////////////////////////////////////////////////////////////////
PermissionTab::PermissionTab(const QFileInfo& fileInfo, QWidget* parent)
{
  auto permissionGroup = new QGroupBox(tr("Permissions"));
  auto readable = new QCheckBox(tr("Readable"));
  if (fileInfo.isReadable())
    readable->setChecked(true);

  auto writable = new QCheckBox(tr("Writable"));
  if (fileInfo.isWritable())
    writable->setChecked(true);

  auto executable = new QCheckBox(tr("Executable"));
  if (fileInfo.isWritable())
    executable->setChecked(true);

  auto ownerLabel = new QLabel(tr("Owner"));
  auto ownerValueLabel = new QLabel(fileInfo.owner());
       ownerValueLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);

  auto groupLabel = new QLabel(tr("Group"));
  auto groupValueLabel = new QLabel(fileInfo.group());
       groupValueLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);

  auto permissionLayout = new QVBoxLayout;
  permissionLayout->addWidget(readable);
  permissionLayout->addWidget(writable);
  permissionLayout->addWidget(executable);
  permissionGroup->setLayout(permissionLayout);

  auto ownerGroup = new QGroupBox(tr("Ownership"));
  auto ownerLaout = new QVBoxLayout;
  ownerLaout->addWidget(ownerLabel);
  ownerLaout->addWidget(ownerValueLabel);
  ownerLaout->addWidget(groupLabel);
  ownerLaout->addWidget(groupValueLabel);
  ownerGroup->setLayout(ownerLaout);

  auto layout = new QVBoxLayout();
  layout->addWidget(permissionGroup);
  layout->addWidget(ownerGroup);
  layout->addStretch(1);

  this->setLayout(layout);
}
开发者ID:yielding,项目名称:code,代码行数:49,代码来源:tabdialog.cpp

示例10: finished

void Q3LocalFs::operationListChildren( Q3NetworkOperation *op )
{
#ifdef QLOCALFS_DEBUG
    qDebug( "Q3LocalFs: operationListChildren" );
#endif
    op->setState( StInProgress );

    dir = QDir( url()->path() );
    dir.setNameFilter( url()->nameFilter() );
    dir.setMatchAllDirs( true );
    if ( !dir.isReadable() ) {
	QString msg = tr( "Could not read directory\n%1" ).arg( url()->path() );
	op->setState( StFailed );
	op->setProtocolDetail( msg );
	op->setErrorCode( (int)ErrListChildren );
	emit finished( op );
	return;
    }

    QFileInfoList filist = dir.entryInfoList(QDir::All | QDir::Hidden | QDir::System);
    if ( filist.isEmpty() ) {
	QString msg = tr( "Could not read directory\n%1" ).arg( url()->path() );
	op->setState( StFailed );
	op->setProtocolDetail( msg );
	op->setErrorCode( (int)ErrListChildren );
	emit finished( op );
	return;
    }

    emit start( op );

    Q3ValueList<QUrlInfo> infos;
    for (int i = 0; i < filist.size(); ++i) {
        QFileInfo fi = filist.at(i);
	infos << QUrlInfo( fi.fileName(), convertPermissions(&fi), fi.owner(), fi.group(),
			   fi.size(), fi.lastModified(), fi.lastRead(), fi.isDir(), fi.isFile(),
			   fi.isSymLink(), fi.isWritable(), fi.isReadable(), fi.isExecutable() );
    }
    emit newChildren( infos, op );
    op->setState( StDone );
    emit finished( op );
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:42,代码来源:q3localfs.cpp

示例11: directory

QList<File> *Computer::getFileList()
{
    QDir directory(this->getPath());
    QFileInfoList fileInfoList;
    if (this->hiddenFiles)
    {
        fileInfoList = directory.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System);
    }
    else
    {
        fileInfoList = directory.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot);
    }
    QFileInfo fileInfo;
    File file;
    QList<File> *fileList = new QList<File>;
    QFileIconProvider *provider = new QFileIconProvider;
    while (!fileInfoList.isEmpty())
    {
        if (this->procesEvents)
            qApp->processEvents();
        fileInfo = fileInfoList.takeFirst();

        file.fileIcon = provider->icon(fileInfo);
        file.fileName = fileInfo.fileName();
        file.fileSize = QString::number(fileInfo.size());
        file.fileDate = fileInfo.lastModified().toString("MMM dd yyyy");
        file.filePath = fileInfo.absoluteFilePath();
        file.filePermissions = "";
        file.fileOwner = fileInfo.owner();
        if (fileInfo.isDir())
            file.fileType = "dir";
        else
            file.fileType = "file";

        fileList->append(file);
    }
    delete provider;
    return fileList;
}
开发者ID:liushuo0826,项目名称:my-qt-adbtool,代码行数:39,代码来源:computer.cpp

示例12: di

FileTreeItem::FileTreeItem(const QFileInfo & fileInfo,const FileTreeItem * parentItem,
                           bool scan_subdirs,bool encripted) {
    m_path = (parentItem->rootItem?"":parentItem->archivePath()) + fileInfo.fileName();
    if (fileInfo.isDir()) m_path += "/";
    m_perms = permissions(fileInfo);
    m_user = fileInfo.owner();
    m_group = fileInfo.group();
    m_link_to = fileInfo.symLinkTarget();
    m_file_size = fileInfo.size();
    m_date = fileInfo.lastModified();
    m_parentItem = (FileTreeItem *)parentItem;
    m_encripted = encripted;
    rootItem = false;
    if (is_dir()) {
        if (scan_subdirs) {
            QDirIterator di(fileInfo.filePath(),QDir::AllEntries | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot);
            while (di.hasNext()) {
                di.next();
                appendChild(new FileTreeItem(QFileInfo(di.filePath()),this,true,encripted));
            }
        }
    }
}
开发者ID:AlexLevkovich,项目名称:SimpleArch,代码行数:23,代码来源:filetreeitem.cpp

示例13: equals

bool MyDirEntry::equals(const QFileInfo& info) const{
  return (  isDir() == info.isDir()
    && owner == info.owner()
    && lastModified == info.lastModified()
    && permissions == info.permissions());
}
开发者ID:porphyr,项目名称:SyncBox,代码行数:6,代码来源:mydirentry.cpp

示例14: dir

/** Creates the \c ls command result 
  *
  * It creates it in the packetData string.
  *
  */
void RainbruRPG::Network::Ftp::FtpTransfer::lsResult(){
  LOGI("LIST command result :");
  packetData="";
  unsigned int childs=1;

  QDir dir(currentDirectory );
  dir.setFilter(QDir::Dirs| QDir::Files| QDir::NoSymLinks);
  dir.setSorting(QDir::Name);

  QFileInfoList list = dir.entryInfoList();

  LOGCATS("Sending ");
  LOGCATI(list.size());
  LOGCATS(" files.");
  LOGCAT();

  for (int i = 0; i < list.size(); ++i) {
    QFileInfo fileInfo = list.at(i);

    // ====== User permissions
    // Diretory ?
    if (fileInfo.isDir()){
      packetData+="d";

      QDir dir2(fileInfo.absoluteFilePath());
      childs=dir2.count();

    }
    else{
      packetData+="-";
      childs=1;
    }

    packetData+=filePermissions(fileInfo.isReadable(),fileInfo.isWritable(),
				fileInfo.isExecutable());

    packetData+=filePermissions(fileInfo.permission(QFile::ReadGroup),
				fileInfo.permission(QFile::WriteGroup),
				fileInfo.permission(QFile::ExeGroup));

    packetData+=filePermissions(fileInfo.permission(QFile::ReadOther),
				fileInfo.permission(QFile::WriteOther),
				fileInfo.permission(QFile::ExeOther));

    // Child number
    QString sChild;
    sChild.setNum(childs);
    sChild=sChild.rightJustified(5);
    packetData+=sChild;

    // Owner and group names
    packetData+=' ';
    QString sOwner=fileInfo.owner();
    sOwner=sOwner.leftJustified(9);
    packetData+=sOwner;
    QString sGroup=fileInfo.group();
    sGroup=sGroup.leftJustified(9);
    packetData+=sGroup;

    // File size
    qint64 size=fileInfo.size();

    QString sSize=fileSizeToString(size);
    sSize=sSize.rightJustified(8);
    packetData+=sSize;

    // Last modified time
    packetData+=" ";
    QDateTime dt=fileInfo.lastModified();
    packetData+=dt.toString("yyyy-MM-dd hh:mm");

    // File name and EOL
    packetData+=" ";
    packetData+=fileInfo.fileName();
    packetData+="\n";
  }
  LOGI("PacketData done. LIST result can be sent");
  int i=  packetData.size();
  LOGCATS("PacketData lenght :");
  LOGCATI(i);
  LOGCAT();
}
开发者ID:dreamsxin,项目名称:rainbrurpg,代码行数:87,代码来源:ftptransfer.cpp

示例15: Load

void CFileList::Load( QString *in_cwd )
{
#ifdef QT_V4LAYOUT
	Q3ListViewItem	*pListViewItem;
#else
	QListViewItem	*pListViewItem;
#endif
    QDir d;
	
	clear();
    if ( in_cwd )
    {
        cwd = *in_cwd;
    }

    d.setFilter( QDir::Files | QDir::Hidden );
    d.cd( cwd );
    d.setNameFilter("*.dsn");

#ifdef QT_V4LAYOUT
    const QFileInfoList list = d.entryInfoList();
    QFileInfo fi;                          // pointer for traversing

	for ( int i = 0; i < list.size(); i ++ ) {
        QString perm, size;
        char driver[ 128 ];

		fi = list.at(i);

        perm = "-";
        perm += fi.permission( QFileInfo::ReadUser ) ? "r" : "-";
        perm += fi.permission( QFileInfo::WriteUser ) ? "w" : "-";
        perm += fi.permission( QFileInfo::ExeUser ) ? "x" : "-";
        perm += fi.permission( QFileInfo::ReadGroup ) ? "r" : "-";
        perm += fi.permission( QFileInfo::WriteGroup ) ? "w" : "-";
        perm += fi.permission( QFileInfo::ExeGroup ) ? "x" : "-";
        perm += fi.permission( QFileInfo::ReadOther ) ? "r" : "-";
        perm += fi.permission( QFileInfo::WriteOther ) ? "w" : "-";
        perm += fi.permission( QFileInfo::ExeOther ) ? "x" : "-";

        size.sprintf( "%d bytes", fi.size());

        pListViewItem = new Q3ListViewItem( this, fi.fileName(), perm, fi.owner(), fi.group(), size );
    }
#else
    const QFileInfoList *list = d.entryInfoList();
    QFileInfoListIterator it( *list );      // create list iterator
    QFileInfo *fi;                          // pointer for traversing

    while ( (fi=it.current()) ) 
    {           // for each file...

        QString perm, size;
        char driver[ 128 ];

        perm = "-";
        perm += fi->permission( QFileInfo::ReadUser ) ? "r" : "-";
        perm += fi->permission( QFileInfo::WriteUser ) ? "w" : "-";
        perm += fi->permission( QFileInfo::ExeUser ) ? "x" : "-";
        perm += fi->permission( QFileInfo::ReadGroup ) ? "r" : "-";
        perm += fi->permission( QFileInfo::WriteGroup ) ? "w" : "-";
        perm += fi->permission( QFileInfo::ExeGroup ) ? "x" : "-";
        perm += fi->permission( QFileInfo::ReadOther ) ? "r" : "-";
        perm += fi->permission( QFileInfo::WriteOther ) ? "w" : "-";
        perm += fi->permission( QFileInfo::ExeOther ) ? "x" : "-";

        size.sprintf( "%d bytes", fi->size());

        pListViewItem = new QListViewItem( this, fi->fileName(), perm, fi->owner(), fi->group(), size );

        ++it;                               // goto next list element
    }
#endif
}
开发者ID:ystk,项目名称:debian-unixodbc,代码行数:74,代码来源:CFileList.cpp


注:本文中的QFileInfo::owner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。