Commit a1b64d79 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Revert "Profile shortcuts switch profile instead of opening new tab"

This reverts commit d689ba54.

I should have tested this more; this breaks a number of things as
switching doesn't execute the 'Command'.  Since the next release is
close, let's just revert for now.

FIXED-IN: 19.08
CCBUG: 319926
parent ce7b20e7
......@@ -135,7 +135,7 @@ MainWindow::MainWindow() :
// emulator (as they are reserved for use by terminal applications)
correctStandardShortcuts();
setProfileList(new ProfileList(false, this));
setProfileList(new ProfileList(true, this));
// this must come at the end
applyKonsoleSettings();
......
......@@ -76,7 +76,6 @@ ProfileManager::ProfileManager()
, _loadedAllProfiles(false)
, _loadedFavorites(false)
, _shortcuts(QMap<QKeySequence, ShortcutData>())
, _profileList(nullptr)
{
//load fallback profile
_fallbackProfile = Profile::Ptr(new Profile());
......@@ -698,10 +697,3 @@ QKeySequence ProfileManager::shortcut(Profile::Ptr profile) const
return QKeySequence();
}
ProfileList *ProfileManager::getProfileList()
{
if (_profileList == nullptr) {
_profileList = new ProfileList(true, this);
}
return _profileList;
}
......@@ -33,7 +33,6 @@
// Konsole
#include "Profile.h"
#include "ProfileList.h"
namespace Konsole {
/**
......@@ -212,7 +211,6 @@ public:
*/
Profile::Ptr findByShortcut(const QKeySequence &shortcut);
ProfileList *getProfileList();
Q_SIGNALS:
/** Emitted when a profile is added to the manager. */
......@@ -290,8 +288,6 @@ private:
// finds out if it's a internal profile or an external one,
// fixing the path to point to the correct location for the profile.
QString normalizePath(const QString& path) const;
ProfileList *_profileList;
};
/**
......
......@@ -97,6 +97,7 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q
, _session(session)
, _view(view)
, _copyToGroup(nullptr)
, _profileList(nullptr)
, _sessionIcon(QIcon())
, _sessionIconName(QString())
, _previousState(-1)
......@@ -222,10 +223,6 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q
_bookmarkValidProgramsToClear << QStringLiteral("tcsh") << QStringLiteral("zsh");
setupSearchBar();
_searchBar->setVisible(_isSearchBarEnabled);
_profileList = ProfileManager::instance()->getProfileList();
connect(_profileList, &ProfileList::actionsChanged, this, &Konsole::SessionController::prepareSwitchProfileMenu);
prepareSwitchProfileMenu();
}
SessionController::~SessionController()
......@@ -507,9 +504,6 @@ bool SessionController::eventFilter(QObject* watched , QEvent* event)
// second, connect the newly focused view to listen for the session's bell signal
connect(_session.data(), &Konsole::Session::bellRequest, _view.data(), &Konsole::TerminalDisplay::bell);
disconnect(_profileList, &Konsole::ProfileList::profileSelected, nullptr, nullptr);
connect(_profileList, &Konsole::ProfileList::profileSelected, this, &Konsole::SessionController::switchProfile);
if ((_copyInputToAllTabsAction != nullptr) && _copyInputToAllTabsAction->isChecked()) {
// A session with "Copy To All Tabs" has come into focus:
// Ensure that newly created sessions are included in _copyToGroup!
......@@ -637,6 +631,7 @@ void SessionController::setupCommonActions()
_switchProfileMenu = new KActionMenu(i18n("Switch Profile"), this);
collection->addAction(QStringLiteral("switch-profile"), _switchProfileMenu);
connect(_switchProfileMenu->menu(), &QMenu::aboutToShow, this, &Konsole::SessionController::prepareSwitchProfileMenu);
// History
_findAction = KStandardAction::find(this, SLOT(searchBarEvent()), collection);
......@@ -798,16 +793,17 @@ void SessionController::setupExtraActions()
void SessionController::switchProfile(const Profile::Ptr &profile)
{
if (isReadOnly()) {
return;
}
SessionManager::instance()->setSessionProfile(_session, profile);
updateFilterList(profile);
}
void SessionController::prepareSwitchProfileMenu()
{
if (_switchProfileMenu->menu()->isEmpty()) {
_profileList = new ProfileList(false, this);
connect(_profileList, &Konsole::ProfileList::profileSelected, this, &Konsole::SessionController::switchProfile);
}
_switchProfileMenu->menu()->clear();
_switchProfileMenu->menu()->addActions(_profileList->actions());
}
......
......@@ -162,10 +162,6 @@ void SessionManager::setSessionProfile(Session *session, Profile::Ptr profile)
Q_ASSERT(profile);
if (_sessionProfiles[session] == profile) {
return;
}
_sessionProfiles[session] = profile;
applyProfile(session, profile, false);
......
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