From 0458dad6dc606149ca20ddc127bbfdcdfd4422e4 Mon Sep 17 00:00:00 2001 From: Amir Pakdel Date: Wed, 13 May 2015 14:34:48 -0400 Subject: [PATCH] Code cleanups --- src/gui/DatabaseWidget.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 6303d094e..0b5e1545d 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -453,21 +453,16 @@ 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); } - QDesktopServices::openUrl(UrlString); - } void DatabaseWidget::createGroup()