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


C++ Iterator::left方法代码示例

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


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

示例1: process

void MigrateDialog::process()
{
    unsigned size = 0;
    for (list<QCheckBox*>::iterator it = m_boxes.begin(); it != m_boxes.end(); ++it){
        if (!(*it)->isChecked())
            continue;
        QString path = user_file((*it)->text());
        path += '/';
        icqConf.close();
        clientsConf.close();
        contactsConf.close();
        icqConf.setFileName(path + "icq.conf");
        clientsConf.setFileName(path + "clients.conf");
        contactsConf.setFileName(path + "contacts.conf");
        lblStatus->setText(path + "icq.conf");
        if (!icqConf.open(QIODevice::ReadOnly)){
            error(i18n("Can't open %1") .arg(path + "icq.conf"));
            return;
        }
        if (!clientsConf.open(QIODevice::WriteOnly | QIODevice::Truncate)){
            error(i18n("Can't open %1") .arg(path + "clients.conf"));
            return;
        }
        if (!contactsConf.open(QIODevice::WriteOnly | QIODevice::Truncate)){
            error(i18n("Can't open %1") .arg(path + "contacts.conf"));
            return;
        }
        m_uin    = 0;
        m_passwd = "";
        m_state  = 0;
        m_grpId		= 0;
        m_contactId = 0;
        Buffer cfg;
        cfg.init(icqConf.size());
        icqConf.read(cfg.data(), icqConf.size());
        for (;;){
            QByteArray section = cfg.getSection();
            if (section.isEmpty())
                break;
            m_state = 3;
            if (section == "Group")
                m_state = 1;
            if (section == "User")
                m_state = 2;
            if (!m_bProcess)
                return;
            for (;;){
                QByteArray l = cfg.getLine();
                if (l.isEmpty())
                    break;
                QByteArray line = l;
                QByteArray name = getToken(line, '=');
                if (name == "UIN")
                    m_uin = line.toUInt();
                if (name == "EncryptPassword")
                    m_passwd = line;
                if (name == "Name")
                    m_name = line;
                if (name == "Alias")
                    m_name = line;
            }
            flush();
            barCnv->setValue(cfg.readPos());
            qApp->processEvents();
        }
        icqConf.close();
        clientsConf.close();
        contactsConf.close();
        m_state = 3;
        size += icqConf.size();
        if (!m_bProcess)
            return;
        barCnv->setValue(size);
        qApp->processEvents();
        QString h_path = path;
#ifdef WIN32
        h_path += "history\\";
#else
        h_path += "history/";
#endif
        QDir history(h_path);
        QStringList l = history.entryList(QStringList("*.history"), QDir::Files);
        for (QStringList::Iterator it = l.begin(); it != l.end(); ++it){
            hFrom.close();
            hTo.close();
            hFrom.setFileName(h_path + (*it));
            lblStatus->setText(h_path + (*it));
            hTo.setFileName(h_path + QString(m_owner) + '.' + it->left(it->indexOf('.')));
            if (!hFrom.open(QIODevice::ReadOnly)){
                error(i18n("Can't open %1") .arg(hFrom.fileName()));
                return;
            }
            if (!hTo.open(QIODevice::WriteOnly | QIODevice::Truncate)){
                error(i18n("Can't open %1") .arg(hTo.fileName()));
                return;
            }
            cfg.init(hFrom.size());
            hFrom.read(cfg.data(), hFrom.size());
            for (;;){
                QByteArray section = cfg.getSection();
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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