Commit 11987c7a authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Minor code optimisation

Pass Profile::Ptr by reference. Make some local vars const.
parent 12c236c5
......@@ -1264,7 +1264,7 @@ void SessionController::searchClosed()
searchHistory(false);
}
void SessionController::updateFilterList(Profile::Ptr profile)
void SessionController::updateFilterList(const Profile::Ptr &profile)
{
if (profile != SessionManager::instance()->sessionProfile(_sessionDisplayConnection->session())) {
return;
......@@ -1274,7 +1274,7 @@ void SessionController::updateFilterList(Profile::Ptr profile)
static QString _wordChars = currentWordCharacters;
//TODO: Refactor this code.
bool underlineFiles = profile->underlineFilesEnabled();
const bool underlineFiles = profile->underlineFilesEnabled();
FilterChain *filterChain = _sessionDisplayConnection->view()->filterChain();
if (!underlineFiles && (_fileFilter != nullptr)) {
filterChain->removeFilter(_fileFilter);
......@@ -1294,7 +1294,7 @@ void SessionController::updateFilterList(Profile::Ptr profile)
}
}
bool underlineLinks = profile->underlineLinksEnabled();
const bool underlineLinks = profile->underlineLinksEnabled();
if (!underlineLinks && (_urlFilter != nullptr)) {
filterChain->removeFilter(_urlFilter);
delete _urlFilter;
......
......@@ -261,7 +261,7 @@ private Q_SLOTS:
void searchTextChanged(const QString &text);
void searchCompleted(bool success);
void updateFilterList(QExplicitlySharedDataPointer<Profile> profile); // Called when the profile has changed, so we might need to change the list of filters
void updateFilterList(const QExplicitlySharedDataPointer<Profile> &profile); // Called when the profile has changed, so we might need to change the list of filters
void viewFocusChangeHandler(bool focused);
void interactionHandler();
......
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