Commit c0721005 authored by João Eudes Lima's avatar João Eudes Lima Committed by Kurt Hindenburg
Browse files

Replace deprecated QSet::toList and QSet::fromList()

'fromList' is deprecated: Use QSet(list.begin(), list.end()) instead.
'toList' is deprecated: Use values() instead.
parent ab0636de
......@@ -559,7 +559,9 @@ bool MainWindow::queryClose()
// Check what processes are running, excluding the shell
QStringList processesRunning;
const auto uniqueSessions = QSet<Session*>::fromList(_viewManager->sessions());
const auto sessions = _viewManager->sessions();
const auto uniqueSessions = QSet<Session*>(sessions.begin(), sessions.end());
for (Session *session : uniqueSessions) {
if ((session == nullptr) || !session->isForegroundProcessActive()) {
......
......@@ -131,7 +131,9 @@ QSet<QString> ProcessInfo::commonDirNames()
if (forTheFirstTime) {
const KSharedConfigPtr &config = KSharedConfig::openConfig();
const KConfigGroup &configGroup = config->group("ProcessInfo");
_commonDirNames = QSet<QString>::fromList(configGroup.readEntry("CommonDirNames", QStringList()));
const QStringList groupDirNames = configGroup.readEntry("CommonDirNames", QStringList());
_commonDirNames = QSet<QString>(groupDirNames.begin(), groupDirNames.end());
forTheFirstTime = false;
}
......
......@@ -309,7 +309,7 @@ void ProfileManager::saveSettings()
QList<Profile::Ptr> ProfileManager::sortedFavorites()
{
QList<Profile::Ptr> favorites = findFavorites().toList();
QList<Profile::Ptr> favorites = findFavorites().values();
sortProfiles(favorites);
return favorites;
......@@ -319,12 +319,12 @@ QList<Profile::Ptr> ProfileManager::allProfiles()
{
loadAllProfiles();
return _profiles.toList();
return _profiles.values();
}
QList<Profile::Ptr> ProfileManager::loadedProfiles() const
{
return _profiles.toList();
return _profiles.values();
}
Profile::Ptr ProfileManager::defaultProfile() const
......@@ -641,7 +641,7 @@ void ProfileManager::loadFavorites()
if (favoriteGroup.hasKey("Favorites")) {
QStringList list = favoriteGroup.readEntry("Favorites", QStringList());
favoriteSet = QSet<QString>::fromList(list);
favoriteSet = QSet<QString>(list.begin(), list.end());
}
// look for favorites among those already loaded
......
......@@ -1069,8 +1069,9 @@ void SessionController::copyInputToAllTabs()
// Find our window ...
const KXmlGuiWindow* myWindow = findWindow(_view);
QSet<Session*> group =
QSet<Session*>::fromList(SessionManager::instance()->sessions());
auto sessions = SessionManager::instance()->sessions();
QSet<Session*> group = QSet<Session*>(sessions.begin(), sessions.end());
for (auto session : group) {
// First, ensure that the session is removed
// (necessary to avoid duplicates on addSession()!)
......@@ -1099,7 +1100,9 @@ void SessionController::copyInputToSelectedTabs()
QPointer<CopyInputDialog> dialog = new CopyInputDialog(_view);
dialog->setMasterSession(_session);
QSet<Session*> currentGroup = QSet<Session*>::fromList(_copyToGroup->sessions());
auto sessions = _copyToGroup->sessions();
QSet<Session*> currentGroup = QSet<Session*>(sessions.begin(), sessions.end());
currentGroup.remove(_session);
dialog->setChosenSessions(currentGroup);
......@@ -1135,8 +1138,9 @@ void SessionController::copyInputToNone()
return;
}
QSet<Session*> group =
QSet<Session*>::fromList(SessionManager::instance()->sessions());
auto sessions = SessionManager::instance()->sessions();
QSet<Session*> group = QSet<Session*>(sessions.begin(), sessions.end());
for (auto iterator : group) {
Session* session = iterator;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment