summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-01-10 03:31:46 +0100
committerAndras Timar <andras.timar@collabora.com>2014-01-13 10:56:15 +0000
commita23979349e7cf6d9d40577a37815d480c88d4c40 (patch)
tree436bd678bbb782cfe53f182862d756aede6e664b
parent3dad1f2f6e863018c4f5d410944d73007630f16c (diff)
fdo#72947 Startcenter: display more userfriendly file urls in tooltips
Use INetURLObject to get a readable url (it displayes special characters too).Handle file urls and non-file urls on a different way (Thanks to Stephen Bergmann for the idea). (cherry picked from commit 31dfeee42e9b08ed7031b6c50d0c674122d5245c) Conflicts: sfx2/source/control/recentdocsviewitem.cxx Change-Id: I4aab5e2546ae70e5a3d85b12e26e021bfa244999 Reviewed-on: https://gerrit.libreoffice.org/7370 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--include/sfx2/recentdocsviewitem.hxx3
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx8
2 files changed, 10 insertions, 1 deletions
diff --git a/include/sfx2/recentdocsviewitem.hxx b/include/sfx2/recentdocsviewitem.hxx
index be94b78c5a45..410e74bea254 100644
--- a/include/sfx2/recentdocsviewitem.hxx
+++ b/include/sfx2/recentdocsviewitem.hxx
@@ -23,6 +23,9 @@ public:
virtual OUString getHelpText() const;
OUString maURL;
+
+private:
+ OUString m_sHelpText;
};
#endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index 2531da197a7e..883b1fa77996 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -21,6 +21,12 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR
{
OUString aTitle(rTitle);
INetURLObject aURLObj(rURL);
+
+ if( aURLObj.GetProtocol() == INET_PROT_FILE )
+ m_sHelpText = aURLObj.getFSysPath(INetURLObject::FSYS_DETECT);
+ if( m_sHelpText.isEmpty() )
+ m_sHelpText = aURLObj.GetURLNoPass();
+
RecentDocsView& rRecentView = dynamic_cast<RecentDocsView&>(rView);
long nThumbnailSize = rRecentView.GetThumbnailSize();
@@ -71,7 +77,7 @@ void RecentDocsViewItem::setEditTitle (bool edit, bool bChangeFocus)
OUString RecentDocsViewItem::getHelpText() const
{
- return maURL;
+ return m_sHelpText;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */