diff options
author | Furkan Uzumcu <furkanuzumcu@gmail.com> | 2011-11-20 17:41:18 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-11-20 17:41:18 +0100 |
commit | 894310285dad37198fcf3cd0d3f9ddbadc4fc512 (patch) | |
tree | 8fa1ab56e71349221dfca13e294a6a6c4165685f /src/application.cpp | |
parent | have tabPreviews of KParts also (diff) | |
download | rekonq-894310285dad37198fcf3cd0d3f9ddbadc4fc512.tar.xz |
Use title instead of URL when adding application shortcuts
REVIEW: 103086
REVIEWED-BY: adjam,fritz_van_tom
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 11 |
1 files 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)) { |