[Libreoffice-commits] core.git: vcl/unx

Julien Nabet serval2412 at yahoo.fr
Wed Jul 15 05:03:01 PDT 2015


 vcl/unx/kde4/KDE4FilePicker.cxx |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 5325c5b2bd8bae328f57bfda4f1e242b5133c79d
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Jul 13 23:33:53 2015 +0200

    getFiles refactoring: kde4 part
    
    before:
    getFiles retrieves all files with their url
    getSelectedFiles just returns getFiles result
    
    after:
    getSelectedFiles retrieves all files with their url
    getFiles uses getSelectedFiles and truncates to 1 entry if necessary
    
    See http://nabble.documentfoundation.org/Dev-f1639786.html for discussion
    
    Conflicts:
    	vcl/unx/kde4/KDE4FilePicker.cxx
    
    Change-Id: I56a0e2bc877f93e28f08d5ebaafd1826a92cef8b
    Reviewed-on: https://gerrit.libreoffice.org/17025
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index 9758253..0480189 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -333,15 +333,9 @@ uno::Sequence< OUString > SAL_CALL KDE4FilePicker::getFiles()
         SalYieldMutexReleaser release;
         return Q_EMIT getFilesSignal();
     }
-
-    KUrl::List urls = _dialog->selectedUrls();
-    uno::Sequence< OUString > seq( urls.size());
-    // multiselection doesn't really work
-    // so just retrieve the first url
+    uno::Sequence< OUString > seq = getSelectedFiles();
     if (seq.getLength() > 1)
         seq.realloc(1);
-    if (seq.getLength() == 1)
-        seq[0] = toOUString(urls.front().url());
     return seq;
 }
 
@@ -352,8 +346,12 @@ uno::Sequence< OUString > SAL_CALL KDE4FilePicker::getSelectedFiles()
         SalYieldMutexReleaser release;
         return Q_EMIT getSelectedFilesSignal();
     }
-
-    return getFiles();
+    KUrl::List urls = _dialog->selectedUrls();
+    uno::Sequence< OUString > seq( urls.size());
+    int i = 0;
+    foreach( const KUrl& url, urls )
+        seq[ i++ ]= toOUString( url.url());
+    return seq;
 }
 
 void SAL_CALL KDE4FilePicker::appendFilter( const OUString &title, const OUString &filter )


More information about the Libreoffice-commits mailing list