Commit 449fdd90 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

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

These are only in Qt5.14+; Konsole will be on Qt5.12 for LTS
for another year.

This reverts commit c0721005.
parent c0721005
......@@ -559,9 +559,7 @@ bool MainWindow::queryClose()
// Check what processes are running, excluding the shell
QStringList processesRunning;
const auto sessions = _viewManager->sessions();
const auto uniqueSessions = QSet<Session*>(sessions.begin(), sessions.end());
const auto uniqueSessions = QSet<Session*>::fromList(_viewManager->sessions());
for (Session *session : uniqueSessions) {
if ((session == nullptr) || !session->isForegroundProcessActive()) {
......
......@@ -131,9 +131,7 @@ QSet<QString> ProcessInfo::commonDirNames()
if (forTheFirstTime) {
const KSharedConfigPtr &config = KSharedConfig::openConfig();
const KConfigGroup &configGroup = config->group("ProcessInfo");
const QStringList groupDirNames = configGroup.readEntry("CommonDirNames", QStringList());
_commonDirNames = QSet<QString>(groupDirNames.begin(), groupDirNames.end());
_commonDirNames = QSet<QString>::fromList(configGroup.readEntry("CommonDirNames", QStringList()));
forTheFirstTime = false;
}
......
......@@ -309,7 +309,7 @@ void ProfileManager::saveSettings()
QList<Profile::Ptr> ProfileManager::sortedFavorites()
{
QList<Profile::Ptr> favorites = findFavorites().values();
QList<Profile::Ptr> favorites = findFavorites().toList();
sortProfiles(favorites);
return favorites;
......@@ -319,12 +319,12 @@ QList<Profile::Ptr> ProfileManager::allProfiles()
{
loadAllProfiles();
return _profiles.values();
return _profiles.toList();
}
QList<Profile::Ptr> ProfileManager::loadedProfiles() const
{
return _profiles.values();
return _profiles.toList();
}
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>(list.begin(), list.end());
favoriteSet = QSet<QString>::fromList(list);
}
// look for favorites among those already loaded
......
......@@ -1069,9 +1069,8 @@ void SessionController::copyInputToAllTabs()
// Find our window ...
const KXmlGuiWindow* myWindow = findWindow(_view);
auto sessions = SessionManager::instance()->sessions();
QSet<Session*> group = QSet<Session*>(sessions.begin(), sessions.end());
QSet<Session*> group =
QSet<Session*>::fromList(SessionManager::instance()->sessions());
for (auto session : group) {
// First, ensure that the session is removed
// (necessary to avoid duplicates on addSession()!)
......@@ -1100,9 +1099,7 @@ void SessionController::copyInputToSelectedTabs()
QPointer<CopyInputDialog> dialog = new CopyInputDialog(_view);
dialog->setMasterSession(_session);
auto sessions = _copyToGroup->sessions();
QSet<Session*> currentGroup = QSet<Session*>(sessions.begin(), sessions.end());
QSet<Session*> currentGroup = QSet<Session*>::fromList(_copyToGroup->sessions());
currentGroup.remove(_session);
dialog->setChosenSessions(currentGroup);
......@@ -1138,9 +1135,8 @@ void SessionController::copyInputToNone()
return;
}
auto sessions = SessionManager::instance()->sessions();
QSet<Session*> group = QSet<Session*>(sessions.begin(), sessions.end());
QSet<Session*> group =
QSet<Session*>::fromList(SessionManager::instance()->sessions());
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