diff options
Diffstat (limited to 'src/history/historymodels.cpp')
-rw-r--r-- | src/history/historymodels.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/history/historymodels.cpp b/src/history/historymodels.cpp index cf8d1aed..e68eac42 100644 --- a/src/history/historymodels.cpp +++ b/src/history/historymodels.cpp @@ -4,7 +4,7 @@ * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved * Copyright (C) 2008 Benjamin C. Meyer <ben@meyerhome.net> -* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com> +* Copyright (C) 2008-2010 by Andrea Diamantini <adjam7 at gmail dot com> * * * This program is free software; you can redistribute it and/or @@ -12,9 +12,9 @@ * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved -* by the membership of KDE e.V.), which shall act as a proxy +* by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -118,6 +118,8 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const return item.dateTime.date(); case UrlRole: return QUrl(item.url); + case Qt::UserRole: + return KUrl(item.url); case UrlStringRole: return item.url; case Qt::DisplayRole: @@ -144,6 +146,12 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const { return Application::icon(item.url); } + case Qt::ToolTipRole: + QString tooltip = ""; + if (!item.title.isEmpty()) + tooltip = item.title + '\n'; + tooltip += item.dateTime.toString(Qt::SystemLocaleShortDate) + '\n' + item.url; + return tooltip; } return QVariant(); } @@ -688,7 +696,7 @@ QVariant HistoryTreeModel::data(const QModelIndex &index, int role) const QDate date = idx.data(HistoryModel::DateRole).toDate(); if (date == QDate::currentDate()) return i18n("Earlier Today"); - return date.toString(QLatin1String("dddd, MMMM d, yyyy")); + return date.toString(QL1S("dddd, MMMM d, yyyy")); } if (index.column() == 1) { |