[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-0' - include/sfx2 sfx2/source

Zolnai Tamás tamas.zolnai at collabora.com
Mon Jan 13 02:56:37 PST 2014


 include/sfx2/recentdocsviewitem.hxx        |    3 +++
 sfx2/source/control/recentdocsviewitem.cxx |    8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit a23979349e7cf6d9d40577a37815d480c88d4c40
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Fri Jan 10 03:31:46 2014 +0100

    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 at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/include/sfx2/recentdocsviewitem.hxx b/include/sfx2/recentdocsviewitem.hxx
index be94b78..410e74b 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 2531da1..883b1fa 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: */


More information about the Libreoffice-commits mailing list