本文整理汇总了C++中QStringList::removeAll方法的典型用法代码示例。如果您正苦于以下问题:C++ QStringList::removeAll方法的具体用法?C++ QStringList::removeAll怎么用?C++ QStringList::removeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStringList
的用法示例。
在下文中一共展示了QStringList::removeAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QString
static QString getEmail2(const KContacts::Addressee &addressee)
{
// preferred might not be the first one, so remove it and take the first of
// the remaining instead of always taking the second one
QStringList emails = addressee.emails();
emails.removeAll(addressee.preferredEmail());
if (!emails.isEmpty()) {
return emails.at( 0 );
}
return QString();
}
示例2: RemoveDeskPlugin
void LDesktop::RemoveDeskPlugin(QString ID){
//This is called after a plugin is manually removed by the user
// just need to ensure that the plugin is also removed from the settings file
QStringList plugs = settings->value(DPREFIX+"pluginlist", QStringList()).toStringList();
if(plugs.contains(ID)){
plugs.removeAll(ID);
issyncing=true; //don't let the change cause a refresh
settings->setValue(DPREFIX+"pluginlist", plugs);
settings->sync();
QTimer::singleShot(200, this, SLOT(UnlockSettings()) );
}
}
示例3: applyGtkStyles
// -----------------------------------------------------------------------------
static void applyGtkStyles(bool active, int version)
{
QString gtkkde = KStandardDirs::locateLocal("config", 2==version?"gtkrc-2.0":"gtkrc");
QByteArray gtkrc = getenv(gtkEnvVar(version));
QStringList list = QFile::decodeName(gtkrc).split( ':');
QString userHomeGtkrc = QDir::homePath()+userGtkrc(version);
if (!list.contains(userHomeGtkrc))
list.prepend(userHomeGtkrc);
QLatin1String systemGtkrc = QLatin1String(sysGtkrc(version));
if (!list.contains(systemGtkrc))
list.prepend(systemGtkrc);
list.removeAll("");
list.removeAll(gtkkde);
list.append(gtkkde);
// Pass env. var to kdeinit.
QString name = gtkEnvVar(version);
QString value = list.join(":");
org::kde::KLauncher klauncher(QStringLiteral("org.kde.klauncher5"), QStringLiteral("/KLauncher"), QDBusConnection::sessionBus());
klauncher.setLaunchEnv(name, value);
}
示例4: removeProfile
void QtSettingsProvider::removeProfile(const std::string& profile) {
QString profileStart(QString(profile.c_str()) + ":");
for (auto&& key : settings_.allKeys()) {
if (key.startsWith(profileStart)) {
settings_.remove(key);
}
}
QStringList stringList = settings_.value("profileList").toStringList();
stringList.removeAll(profile.c_str());
settings_.setValue("profileList", stringList);
updatePermissions();
}
示例5: xtsettingsValue
void login2::updateRecentOptions()
{
//if (_cloudOption->isChecked())
// return;
QStringList list = xtsettingsValue("/xTuple/_recentOptionsList").toStringList();
_recent->setEnabled(list.size());
list.removeAll(_databaseURL);
list.prepend(_databaseURL);
xtsettingsSetValue("/xTuple/_recentOptionsList", list);
xtsettingsSetValue("/xTuple/_databaseURL", _databaseURL);
}
示例6: _scan
void CClientExtractor::_scan(const string& dir)
{
QDir directory(dir);
if (!directory.exists())
return;
const QStringList files = directory.entryList(QStringList("*.res"), QDir::Files);
for (int i = 0; i < files.size(); i++)
m_files.append(dir % '/' % files[i]);
QStringList subDirs = directory.entryList(QDir::Dirs);
if (subDirs.size() > 0)
{
subDirs.removeAll(".");
subDirs.removeAll("..");
for (int i = 0; i < subDirs.size(); i++)
_scan(dir % '/' % subDirs[i]);
}
}
示例7: extraFiles
QStringList PortStruct::extraFiles(){
QDir dir(basepath);
QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
QStringList main = this->mainFiles();
for(int i=0; i<main.length(); i++){ files.removeAll(main[i]); }
if(dir.exists("files")){
dir.cd("files");
QStringList NF = dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
for(int i=0; i<NF.length(); i++){ files << "files/"+NF[i]; }
}
return files;
}
示例8: QString
static QString getEmail2(const KABC::Addressee &addressee)
{
// preferred might not be the first one, so remove it and take the first of
// the remaining instead of always taking the second one
QStringList emails = addressee.emails();
emails.removeAll(addressee.preferredEmail());
if (emails.count() >= 1) {
return emails[ 0 ];
}
return QString();
}
示例9: removeAccount
void Protocol::removeAccount(Account *account, RemoveFlag flags)
{
Config general = config().group("general");
QStringList accounts = general.value("accounts",QStringList());
accounts.removeAll(account->id());
general.setValue("accounts",accounts);
general.sync();
emit accountRemoved(account);
if (flags & DeleteAccount)
account->deleteLater();
}
示例10: addRecentFile
void GLShaderDev::addRecentFile(const QString& filename)
{
QSettings settings;
QStringList recentFiles = settings.value("recentFiles").toStringList();
recentFiles.removeAll(filename);
recentFiles.prepend(filename);
while (recentFiles.size() > MaxRecentFiles)
recentFiles.removeLast();
settings.setValue("recentFiles", recentFiles);
updateRecentFiles();
}
示例11: getUninstalledPlugins
QStringList Plugins::getUninstalledPlugins() const
{
QStringList plugins;
// Gets all the plugins
this->_findPlugins(Configurations::c().pluginsPath, "", plugins);
// Removes the plugins installed
QStringListIterator it(this->getInstalledPlugins());
while (it.hasNext())
plugins.removeAll(it.next());
return (plugins);
}
示例12: getUnloadedPlugins
QStringList Plugins::getUnloadedPlugins() const
{
QStringList plugins;
// Gets all the installed plugins
plugins = this->getInstalledPlugins();
// Removes the plugins loaded
QStringListIterator it(this->getLoadedPlugins());
while (it.hasNext())
plugins.removeAll(it.next());
return (plugins);
}
示例13: addToRecentProjects
void MainWindow::addToRecentProjects(const QString& fileName)
{
QSettings settings;
QStringList files = settings.value("recentProjectList").toStringList();
files.removeAll(fileName);
files.prepend(fileName);
while (files.size() > MAX_RECENT_FILES)
files.removeLast();
settings.setValue("recentProjectList", files);
updateRecentProjectActions();
}
示例14: Search
Media::IPendingAudioSearch* Plugin::Search (const Media::AudioSearchRequest& req)
{
auto realReq = req;
if (realReq.FreeForm_.isEmpty ())
{
QStringList parts = { req.Artist_, req.Album_, req.Title_ };
parts.removeAll (QString ());
realReq.FreeForm_ = parts.join (" - ");
}
return new AudioSearch (Proxy_, realReq, AuthMgr_, Queue_);
}
示例15: setAudioConfiguration
void PlayerComponent::setAudioConfiguration()
{
QStringList ao_defaults;
QString deviceType = SettingsComponent::Get().value(SETTINGS_SECTION_AUDIO, "devicetype").toString();
if (SettingsComponent::Get().value(SETTINGS_SECTION_AUDIO, "exclusive").toBool())
{
ao_defaults << "wasapi:exclusive=yes";
ao_defaults << "coreaudio:exclusive=yes";
}
mpv::qt::set_option_variant(m_mpv, "ao-defaults", ao_defaults.join(','));
// set the audio device
QVariant device = SettingsComponent::Get().value(SETTINGS_SECTION_AUDIO, "device");
mpv::qt::set_property_variant(m_mpv, "audio-device", device);
QString resampleOpts = "";
bool normalize = SettingsComponent::Get().value(SETTINGS_SECTION_AUDIO, "normalize").toBool();
resampleOpts += QString(":normalize=") + (normalize ? "yes" : "no");
// Make downmix more similar to PHT.
resampleOpts += ":o=[surround_mix_level=1,lfe_mix_level=1]";
mpv::qt::set_option_variant(m_mpv, "af-defaults", "lavrresample" + resampleOpts);
QString passthroughCodecs;
// passthrough doesn't make sense with basic type
if (deviceType != AUDIO_DEVICE_TYPE_BASIC)
{
QStringList enabledCodecs;
SettingsSection* audioSection = SettingsComponent::Get().getSection(SETTINGS_SECTION_AUDIO);
QStringList codecs;
if (deviceType == AUDIO_DEVICE_TYPE_SPDIF)
codecs = AudioCodecsSPDIF();
else if (deviceType == AUDIO_DEVICE_TYPE_HDMI && audioSection->value("advanced").toBool())
codecs = AudioCodecsAll();
foreach (const QString& key, codecs)
{
if (audioSection->value("passthrough." + key).toBool())
enabledCodecs << key;
}
// dts-hd includes dts, but listing dts before dts-hd may disable dts-hd.
if (enabledCodecs.indexOf("dts-hd") != -1)
enabledCodecs.removeAll("dts");
passthroughCodecs = enabledCodecs.join(",");
}