Commit 692a48cb authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Alter how newSession profile directory is coded

Use a loop and break out when the first profile match is found.
parent 564e5f5f
......@@ -977,16 +977,14 @@ int ViewManager::newSession()
int ViewManager::newSession(QString profile, QString directory)
{
QList<Profile::Ptr> profilelist = ProfileManager::instance()->allProfiles();
QList<Profile::Ptr>::iterator i = profilelist.begin();
const QList<Profile::Ptr> profilelist = ProfileManager::instance()->allProfiles();
Profile::Ptr profileptr = ProfileManager::instance()->defaultProfile();
while (i != profilelist.end()) {
Profile::Ptr ptr = *i;
if (ptr->name().compare(profile) == 0)
profileptr = ptr;
i++;
for (int i = 0; i < profilelist.size(); ++i) {
if (profilelist.at(i)->name() == profile) {
profileptr = profilelist.at(i);
break;
}
}
Session* session = SessionManager::instance()->createSession(profileptr);
......
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