From 894310285dad37198fcf3cd0d3f9ddbadc4fc512 Mon Sep 17 00:00:00 2001 From: Furkan Uzumcu Date: Sun, 20 Nov 2011 17:41:18 +0100 Subject: Use title instead of URL when adding application shortcuts REVIEW: 103086 REVIEWED-BY: adjam,fritz_van_tom --- src/application.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index fcabc201..1b4e169e 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -466,8 +466,8 @@ void Application::removeMainWindow(MainWindow *window) // QApplication should quit as soon we have no mainwindow // But QtWebkit seems to create windows without Qt::WA_QuitOnClose attribute, // making rekonq keep running after last window is closed - if ( m_mainWindows.length() == 0 ) - QCoreApplication::quit (); + if (m_mainWindows.length() == 0) + QCoreApplication::quit(); } @@ -783,8 +783,9 @@ void Application::createWebAppShortcut() QWidget widget; wAppWidget.setupUi(&widget); + const QString title = mainWindow()->currentTab()->view()->title().remove("&"); wAppWidget.iconLabel->setPixmap(iconManager()->iconForUrl(u).pixmap(32)); - wAppWidget.titleLabel->setText(h); + wAppWidget.titleLabel->setText(title); wAppWidget.kcfg_createDesktopAppShortcut->setChecked(ReKonfig::createDesktopAppShortcut()); wAppWidget.kcfg_createMenuAppShortcut->setChecked(ReKonfig::createMenuAppShortcut()); @@ -811,7 +812,7 @@ void Application::createWebAppShortcut() if (ReKonfig::createDesktopAppShortcut()) { QString desktop = KGlobalSettings::desktopPath(); - QFile wAppFile(desktop + QL1C('/') + h + QL1S(".desktop")); + QFile wAppFile(desktop + QL1C('/') + title + QL1S(".desktop")); if (!wAppFile.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -829,7 +830,7 @@ void Application::createWebAppShortcut() if (ReKonfig::createMenuAppShortcut()) { QString appMenuDir = KStandardDirs::locateLocal("xdgdata-apps", QString()); - QFile wAppFile(appMenuDir + QL1C('/') + h + QL1S(".desktop")); + QFile wAppFile(appMenuDir + QL1C('/') + title + QL1S(".desktop")); if (!wAppFile.open(QIODevice::WriteOnly | QIODevice::Text)) { -- cgit v1.2.1