Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2170

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/70/2170/1

Resolves: rhbz#910176 cannot select directory with gnome folder picker

<< gtk documentation
gtk_file_chooser_get_current_folder_uri ()

Gets the current folder of chooser as an URI.

Note that this is the folder that the file chooser is currently displaying ...
which is not the same as the currently-selected folder if the chooser is in
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode ... to get the currently-selected
folder in that mode, use gtk_file_chooser_get_uri() as the usual way to get the
selection.


<< offapi documentation
XFolderPicker

getDisplayDirectory:
    Returns the root directory that the FolderPicker is showing.
getDirectory
    Returns the selected directory


so  getDisplayDirectory <-> gtk_file_chooser_get_current_folder_uri
and getDirectory <-> gtk_file_chooser_get_uri

Change-Id: Iaa5ab16a250cd59fe5e8bd02149298eef6d1dec2
(cherry picked from commit 914de32b27c7fe164b21f9247275ee3117c0864b)
---
M vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
1 file changed, 11 insertions(+), 2 deletions(-)



diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
index 931f197..d062cda 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
@@ -95,7 +95,7 @@
 
     gchar* pCurrentFolder =
         gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ) );
-    ::rtl::OUString aCurrentFolderName = uritounicode(pCurrentFolder);
+    OUString aCurrentFolderName = uritounicode(pCurrentFolder);
     g_free( pCurrentFolder );
 
     return aCurrentFolderName;
@@ -103,7 +103,16 @@
 
 rtl::OUString SAL_CALL SalGtkFolderPicker::getDirectory() throw( uno::RuntimeException )
 {
-    return getDisplayDirectory();
+    SolarMutexGuard g;
+
+    OSL_ASSERT( m_pDialog != NULL );
+
+    gchar* pSelectedFolder =
+        gtk_file_chooser_get_uri( GTK_FILE_CHOOSER( m_pDialog ) );
+    OUString aSelectedFolderName = uritounicode(pSelectedFolder);
+    g_free( pSelectedFolder );
+
+    return aSelectedFolderName;
 }
 
 void SAL_CALL SalGtkFolderPicker::setDescription( const rtl::OUString& rDescription )

-- 
To view, visit https://gerrit.libreoffice.org/2170
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa5ab16a250cd59fe5e8bd02149298eef6d1dec2
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Caolán McNamara <caolanm@redhat.com>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.