summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 7fe23f20..6b9b9490 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -803,9 +803,17 @@ void Application::clearPrivateData()
}
-void Application::createWebAppShortcut()
+void Application::createWebAppShortcut(const QString & urlString, const QString & titleString)
{
- KUrl u = rekonqWindow()->currentWebWindow()->url();
+ KUrl u;
+ if (urlString.isEmpty())
+ {
+ u = rekonqWindow()->currentWebWindow()->url();
+ }
+ else
+ {
+ u = KUrl(urlString);
+ }
QString h = u.host();
QPointer<KDialog> dialog = new KDialog(rekonqWindow());
@@ -819,7 +827,17 @@ void Application::createWebAppShortcut()
QWidget widget;
wAppWidget.setupUi(&widget);
- QString webAppTitle = rekonqWindow()->currentWebWindow()->title().remove('&');
+ QString webAppTitle;
+ if (titleString.isEmpty())
+ {
+ webAppTitle = rekonqWindow()->currentWebWindow()->title();
+ }
+ else
+ {
+ webAppTitle = titleString;
+ }
+ webAppTitle = webAppTitle.remove('&');
+
wAppWidget.nameLineEdit->setText(webAppTitle);
wAppWidget.kcfg_createDesktopAppShortcut->setChecked(ReKonfig::createDesktopAppShortcut());
wAppWidget.kcfg_createMenuAppShortcut->setChecked(ReKonfig::createMenuAppShortcut());