Use QString::truncate over assigning a left() snippet to self

GIT_SILENT
parent f6f783ac
......@@ -268,7 +268,7 @@ void ProjectSourcePage::locationChanged()
Q_ASSERT(m_locationWidget);
if(m_locationWidget->isCorrect()) {
QString currentUrl = m_ui->workingDir->text();
currentUrl = currentUrl.left(currentUrl.lastIndexOf(QLatin1Char('/'))+1);
currentUrl.truncate(currentUrl.lastIndexOf(QLatin1Char('/'))+1);
QUrl current = QUrl::fromUserInput(currentUrl + m_locationWidget->projectName());
m_ui->workingDir->setUrl(current);
......@@ -281,7 +281,7 @@ void ProjectSourcePage::projectChanged(const QString& name)
{
Q_ASSERT(m_providerWidget);
QString currentUrl = m_ui->workingDir->text();
currentUrl = currentUrl.left(currentUrl.lastIndexOf(QLatin1Char('/'))+1);
currentUrl.truncate(currentUrl.lastIndexOf(QLatin1Char('/'))+1);
QUrl current = QUrl::fromUserInput(currentUrl + name);
m_ui->workingDir->setUrl(current);
......
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