Code cleanups

This commit is contained in:
Amir Pakdel 2015-05-13 14:34:48 -04:00
parent d26cff520f
commit 0458dad6dc

View File

@ -453,20 +453,15 @@ void DatabaseWidget::openUrl()
void DatabaseWidget::openUrlForEntry(Entry* entry)
{
QString UrlString = entry->url();
QString UrlString = entry->resolvePlaceholders(entry->url());
if (UrlString.isEmpty())
return;
UrlString.replace("{TITLE}", entry->title(), Qt::CaseInsensitive);
UrlString.replace("{USERNAME}", entry->username(), Qt::CaseInsensitive);
UrlString.replace("{PASSWORD}", entry->password(), Qt::CaseInsensitive);
if (UrlString.startsWith("cmd://") && UrlString.length()>6){
QProcess::startDetached(UrlString.right(UrlString.length()-6));
return;
}
QProcess::startDetached(UrlString.mid(6));
} else {
QDesktopServices::openUrl(UrlString);
}
}