[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 2 commits - include/svtools svtools/source

Szymon Kłos eszkadev at gmail.com
Wed Jul 1 14:08:16 PDT 2015


 include/svtools/RemoteFilesDialog.hxx        |    3 ++-
 svtools/source/dialogs/RemoteFilesDialog.cxx |   24 +++++++++++++-----------
 2 files changed, 15 insertions(+), 12 deletions(-)

New commits:
commit 13541f7d48a990bbcf33f29516528d793e0f451f
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 1 23:06:42 2015 +0200

    access to the first entry of services listbox
    
    Change-Id: I1bd3fc13fd8258d27d0900b853e751af6eb9ef38

diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index 4594343..f4821ee 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -549,7 +549,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl )
 {
     int nPos = GetSelectedServicePos();
 
-    if( nPos > 0 )
+    if( nPos >= 0 )
     {
         OUString sURL = m_aServices[nPos]->GetUrl();
         OUString sName = m_aServices[nPos]->GetName();
@@ -578,7 +578,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
         unsigned int nSelected = m_pServices_lb->GetSelectEntryPos();
         int nPos = GetSelectedServicePos();
 
-        if( nPos > 0 )
+        if( nPos >= 0 )
         {
             ScopedVclPtrInstance< PlaceEditDialog > aDlg( this, m_aServices[nPos] );
             short aRetCode = aDlg->Execute();
@@ -609,7 +609,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
         unsigned int nSelected = m_pServices_lb->GetSelectEntryPos();
         int nPos = GetSelectedServicePos();
 
-        if( nPos > 0 )
+        if( nPos >= 0 )
         {
             // TODO: Confirm dialog
 
commit e69eb3303bf84777ee659923853f881bfbb6fdc1
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 1 17:43:10 2015 +0200

    RemoteFilesDialog: methods implementations
    
    Change-Id: I3938a17fe180273ec9845720290b1503d15bfcc3

diff --git a/include/svtools/RemoteFilesDialog.hxx b/include/svtools/RemoteFilesDialog.hxx
index c5f876a..43844ae 100644
--- a/include/svtools/RemoteFilesDialog.hxx
+++ b/include/svtools/RemoteFilesDialog.hxx
@@ -44,6 +44,7 @@ using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ucb;
 using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::ui::dialogs;
 using namespace ::comphelper;
 using namespace ::svt;
 
@@ -85,7 +86,7 @@ public:
 
     virtual SvtFileView* GetView();
 
-    virtual void SetHasFilename( bool bHasFilename );
+    virtual void SetHasFilename( bool );
     virtual void SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList );
     virtual const ::com::sun::star::uno::Sequence< OUString >& GetBlackList() const;
     virtual void SetStandardDir( const OUString& rStdDir );
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx
index 28c34dd..4594343 100644
--- a/svtools/source/dialogs/RemoteFilesDialog.cxx
+++ b/svtools/source/dialogs/RemoteFilesDialog.cxx
@@ -749,9 +749,8 @@ SvtFileView* RemoteFilesDialog::GetView()
     return m_pFileView;
 }
 
-void RemoteFilesDialog::SetHasFilename( bool bHasFilename )
+void RemoteFilesDialog::SetHasFilename( bool )
 {
-    // TODO
 }
 
 void RemoteFilesDialog::SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList )
@@ -846,6 +845,7 @@ const OUString& RemoteFilesDialog::GetPath()
 
 std::vector<OUString> RemoteFilesDialog::GetPathList() const
 {
+    // TODO
     std::vector<OUString> aPaths;
     aPaths.push_back(m_sPath);
     return aPaths;
@@ -853,8 +853,12 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const
 
 bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL )
 {
-    // TODO
-    return false;
+    Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+    Reference< XInteractionHandler > xInteractionHandler(
+                    InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW );
+    Reference< XCommandEnvironment > xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
+    ::ucbhelper::Content aContent( rURL, xEnv, xContext );
+    return aContent.isFolder();
 }
 
 sal_Int32 RemoteFilesDialog::getTargetColorDepth()
@@ -886,14 +890,12 @@ bool RemoteFilesDialog::getShowState()
     return false;
 }
 
-Control* RemoteFilesDialog::getControl( sal_Int16 _nControlId, bool _bLabelControl) const
+Control* RemoteFilesDialog::getControl( sal_Int16, bool) const
 {
-    // TODO
     return NULL;
 }
-void RemoteFilesDialog::enableControl( sal_Int16 _nControlId, bool _bEnable )
+void RemoteFilesDialog::enableControl( sal_Int16, bool )
 {
-    // TODO
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list