Пример #1
0
    void ScanFolderPrefPage::loadSettings()
    {
        kcfg_actionMove->setEnabled(!ScanFolderPluginSettings::actionDelete());

        m_group->clear();

        GroupManager* gman = m_plugin->getCore()->getGroupManager();
        QStringList grps;
        GroupManager::Itr it = gman->begin();
        int current = 0;
        int cnt = 0;
        //now custom ones
        while (it != gman->end())
        {
            if (it->second->groupFlags() & Group::CUSTOM_GROUP)
            {
                grps << it->first;
                if (it->first == ScanFolderPluginSettings::group())
                    current = cnt;
                cnt++;
            }
            ++it;
        }
        m_group->addItems(grps);
        m_group->setEnabled(ScanFolderPluginSettings::addToGroup() && grps.count() > 0);
        m_group->setCurrentIndex(current);
        kcfg_addToGroup->setEnabled(grps.count() > 0);

        m_folders->clear();
        folders = ScanFolderPluginSettings::folders();
        foreach (const QString& f, folders)
        {
            m_folders->addItem(new QListWidgetItem(QIcon::fromTheme("folder"), f));
        }
Пример #2
0
    void TorrentCreatorDlg::loadGroups()
    {
        GroupManager* gman = core->getGroupManager();
        GroupManager::Itr it = gman->begin();

        QStringList grps;

        //First default group
        grps << i18n("All Torrents");

        //now custom ones
        while (it != gman->end())
        {
            if (!it->second->isStandardGroup())
                grps << it->first;
            ++it;
        }

        m_group->addItems(grps);
    }