Kaydet (Commit) b40b6010 authored tarafından Caolán McNamara's avatar Caolán McNamara

ditch gnome-vfs2 support

Change-Id: I882c04fd3a255f55511b1884157de26e7574e6db
Reviewed-on: https://gerrit.libreoffice.org/18262Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst daa86922
......@@ -248,7 +248,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,gnome, \
$(if $(ENABLE_SYSTRAY_GTK),qstart_gtk) \
$(if $(ENABLE_GIO),losessioninstall) \
$(if $(ENABLE_GIO),ucpgio1) \
$(if $(ENABLE_GNOMEVFS),ucpgvfs1) \
))
$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,kde, \
......
......@@ -11,7 +11,6 @@ Settings about which X11 desktops have support enabled.
#define ENABLE_KDE 0
#define ENABLE_KDE4 0
#define ENABLE_TDE 0
#define ENABLE_GNOME_VFS 0
#define ENABLE_GIO 0
#endif
......@@ -1166,12 +1166,6 @@ AC_ARG_ENABLE(gconf,
[Determines whether to use the GConf support.]),
,enable_gconf=yes)
AC_ARG_ENABLE(gnome-vfs,
AS_HELP_STRING([--enable-gnome-vfs],
[Determines whether to use the Gnome Virtual Filing System on platforms
where that VFS is available.]),
,enable_gnome_vfs=no)
AC_ARG_ENABLE(gio,
AS_HELP_STRING([--disable-gio],
[Determines whether to use the GIO support.]),
......@@ -10069,25 +10063,6 @@ AC_SUBST(GCONF_LIBS)
AC_SUBST(GCONF_CFLAGS)
AC_SUBST(ENABLE_GCONF)
dnl ===================================================================
dnl Gnome VFS check
dnl ===================================================================
ENABLE_GNOMEVFS=""
AC_MSG_CHECKING([whether to enable GNOME VFS support])
if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
ENABLE_GNOMEVFS="TRUE"
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
GNOMEVFS_CFLAGS=$(printf '%s' "$GNOMEVFS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
AC_DEFINE(ENABLE_GNOME_VFS)
else
AC_MSG_RESULT([no])
fi
AC_SUBST(GNOMEVFS_LIBS)
AC_SUBST(GNOMEVFS_CFLAGS)
AC_SUBST(ENABLE_GNOMEVFS)
dnl ===================================================================
dnl check for dbus support
dnl ===================================================================
......@@ -10218,9 +10193,6 @@ if test "$test_gtk" = "yes"; then
AC_MSG_CHECKING([whether to enable GIO support])
if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
if test "$ENABLE_GNOMEVFS" = "TRUE"; then
AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
fi
dnl Need at least 2.26 for the dbus support.
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
[ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
......
......@@ -72,33 +72,6 @@ static void configureUcb()
// For backwards compatibility, in case some code still uses plain
// createInstance w/o args directly to obtain an instance:
UniversalContentBroker::create(comphelper::getProcessComponentContext());
#if ENABLE_GNOME_VFS
try {
// Instantiate GNOME-VFS UCP in the thread that initialized GNOME in order
// to avoid a deadlock that may occur in case the UCP gets initialized from
// a different thread (which may happen when calling remotely via UNO); this
// is not a fix, just a workaround:
Reference< XCurrentContext > xCurrentContext(getCurrentContext());
Any aValue(xCurrentContext->getValueByName("system.desktop-environment"));
OUString aDesktopEnvironment;
if ((aValue >>= aDesktopEnvironment) && aDesktopEnvironment == "GNOME")
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
UniversalContentBroker::create(xContext)
->registerContentProvider(
Reference<XContentProvider>(
xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.ucb.GnomeVFSContentProvider", xContext),
UNO_QUERY_THROW),
".*", false);
}
}
catch ( const Exception & )
{
SAL_WARN( "desktop.app", "missing gnome-vfs component to initialize thread workaround" );
}
#endif // ENABLE_GNOME_VFS
}
void Desktop::InitApplicationServiceManager()
......
......@@ -2,7 +2,6 @@
--disable-cairo-canvas
--disable-cups
--disable-gconf
--disable-gnome-vfs
--disable-gstreamer-0-10
--disable-gstreamer-1-0
--disable-liblangtag
......
......@@ -2,7 +2,6 @@
--disable-cairo-canvas
--disable-cups
--disable-gconf
--disable-gnome-vfs
--disable-gstreamer-0-10
--disable-gstreamer-1-0
--disable-liblangtag
......
......@@ -2,7 +2,6 @@
--disable-cairo-canvas
--disable-cups
--disable-gconf
--disable-gnome-vfs
--disable-gstreamer-0-10
--disable-gstreamer-1-0
--disable-liblangtag
......
--enable-assert-always-abort
--without-help
--enable-gio
--disable-gnome-vfs
--without-myspell-dicts
--disable-ccache
--disable-gstreamer-0-10
......
......@@ -27,7 +27,6 @@
--enable-gstreamer-0-10
--disable-gstreamer-1-0
--enable-evolution2
--disable-gnome-vfs
--enable-gio
--enable-scripting-beanshell
--enable-scripting-javascript
......
--disable-dbus
--disable-epm
--disable-gnome-vfs
--disable-kde
--disable-kde4
--disable-nss-module
......
......@@ -26,7 +26,6 @@
--enable-extra-font
--with-lang=en-US hu de fr it tr ka fi pl nl pt-BR es ja zh-CN sv cs ko sl
--enable-dbus
--enable-gnome-vfs
--enable-extensions
--enable-extension-integration
--enable-ext-wiki-publisher
......
......@@ -354,7 +354,6 @@ certain functionality.
@li @c ucb.ucp.file
@li @c ucb.ucp.ftp
@li @c ucb.ucp.gio
@li @c ucb.ucp.gvfs
@li @c ucb.ucp.webdav
@section unotools
......
......@@ -19,13 +19,6 @@
cat > /dev/null
[[ "${PLATFORMID}" == "linux_x86_64" ]] && mark64="()(64bit)"
if [[ "${ENABLE_GNOMEVFS}" == "TRUE" ]]; then
if [[ "${OS}" == "AIX" ]]; then
echo "libgnomevfs-2.a(libgnomevfs-2.so.0${mark64})"
else
echo "libgnomevfs-2.so.0${mark64}"
fi
fi
if [[ "${OS}" == "AIX" ]]; then
echo "libgconf-2.a(libgconf-2.so.4${mark64})"
else
......
......@@ -329,11 +329,6 @@ postprocess_DRIVERS += ado
endif
ifneq ($(WITH_WEBDAV),)
postprocess_FILES_main += $(postprocess_MOD)/org/openoffice/ucb/Configuration-webdav.xcu
ifeq ($(WITH_WEBDAV),neon)
ifeq ($(ENABLE_GNOMEVFS),TRUE)
postprocess_FILES_main += $(postprocess_MOD)/org/openoffice/ucb/Configuration-webdav_neon_gnomevfs.xcu
endif
endif
endif
ifeq ($(ENABLE_EVOAB2),TRUE)
postprocess_FILES_main += $(call gb_XcuModuleTarget_get_target,connectivity/registry/evoab2)/org/openoffice/Office/DataAccess/Drivers-evoab2.xcu
......
......@@ -199,9 +199,6 @@ $(eval $(call gb_Rdb_add_components,services,\
shell/source/sessioninstall/losessioninstall \
ucb/source/ucp/gio/ucpgio \
) \
$(if $(ENABLE_GNOMEVFS), \
ucb/source/ucp/gvfs/ucpgvfs \
) \
$(if $(ENABLE_GSTREAMER_1_0), \
avmedia/source/gstreamer/avmediagstreamer \
) \
......
......@@ -13,7 +13,6 @@ $(eval $(call gb_InstallModule_use_auto_install_libs,scp2/gnome,gnome))
$(eval $(call gb_InstallModule_define_if_set,scp2/gnome,\
ENABLE_GIO \
ENABLE_GNOMEVFS \
ENABLE_LOCKDOWN \
ENABLE_GTK \
))
......
......@@ -33,7 +33,7 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\
$(if $(WITH_EXTENSION_INTEGRATION),\
scp2/extensions \
) \
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GCONF) $(ENABLE_GNOMEVFS) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GCONF) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\
scp2/gnome \
) \
$(if $(filter TRUE,$(ENABLE_KDE) $(ENABLE_KDE4)),\
......
......@@ -39,7 +39,7 @@ $(eval $(call gb_Module_add_targets,scp2,\
InstallModule_winexplorerext \
) \
) \
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GCONF) $(ENABLE_GNOMEVFS) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GCONF) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\
InstallModule_gnome \
) \
$(if $(filter TRUE,$(ENABLE_KDE) $(ENABLE_KDE4)),\
......
......@@ -26,11 +26,8 @@ Module gid_Module_Optional_Gnome
PackageInfo = "packinfo_office.txt";
MOD_NAME_DESC(MODULE_OPTIONAL_GNOME);
Styles = ();
#ifdef ENABLE_GNOMEVFS
XpdCheckSolaris = "SUNWgnome-vfs";
#endif
Files = (auto_gnome_ALL,
#if (defined ENABLE_GNOMEVFS && defined ENABLE_LOCKDOWN) || defined ENABLE_GIO
#if defined ENABLE_GIO
gid_File_Share_Registry_Gnome_Xcd,
#endif
gid_File_Bin_Gnome_Open_Url
......
......@@ -12,8 +12,6 @@ include $(SRCDIR)/sysui/productlist.mk
ifeq ($(ENABLE_GIO),TRUE)
brand_URIPARAM := --urls
else ifeq ($(ENABLE_GNOMEVFS),TRUE)
brand_URIPARAM := --urls
else ifeq ($(ENABLE_TDE),TRUE)
brand_URIPARAM := --urls
else ifeq ($(ENABLE_KDE),TRUE)
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Library_Library,ucpgvfs1))
$(eval $(call gb_Library_set_componentfile,ucpgvfs1,ucb/source/ucp/gvfs/ucpgvfs))
$(eval $(call gb_Library_set_include,ucpgvfs1,\
$(GNOMEVFS_CFLAGS) \
$$(INCLUDE) \
))
$(eval $(call gb_Library_use_sdk_api,ucpgvfs1))
$(eval $(call gb_Library_add_libs,ucpgvfs1,\
$(GNOMEVFS_LIBS) \
))
$(eval $(call gb_Library_use_libraries,ucpgvfs1,\
comphelper \
cppu \
cppuhelper \
sal \
salhelper \
ucbhelper \
))
$(eval $(call gb_Library_add_exception_objects,ucpgvfs1,\
ucb/source/ucp/gvfs/gvfs_content \
ucb/source/ucp/gvfs/gvfs_directory \
ucb/source/ucp/gvfs/gvfs_provider \
ucb/source/ucp/gvfs/gvfs_stream \
))
# vim: set noet sw=4 ts=4:
......@@ -30,12 +30,6 @@ $(eval $(call gb_Module_add_targets,ucb,\
))
endif
ifeq ($(ENABLE_GNOMEVFS),TRUE)
$(eval $(call gb_Module_add_targets,ucb,\
Library_ucpgvfs1 \
))
endif
$(eval $(call gb_Module_add_subsequentcheck_targets,ucb,\
JunitTest_ucb_complex \
JunitTest_ucb_unoapi \
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_DIRECTORY_HXX
#define INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_DIRECTORY_HXX
#include <rtl/ref.hxx>
#include <ucbhelper/resultset.hxx>
#include <ucbhelper/resultsethelper.hxx>
#include "gvfs_content.hxx"
namespace gvfs {
class DynamicResultSet : public ::ucbhelper::ResultSetImplHelper
{
rtl::Reference< Content > m_xContent;
com::sun::star::uno::Reference<
com::sun::star::ucb::XCommandEnvironment > m_xEnv;
private:
virtual void initStatic() SAL_OVERRIDE;
virtual void initDynamic() SAL_OVERRIDE;
public:
DynamicResultSet( const com::sun::star::uno::Reference<
com::sun::star::uno::XComponentContext >& rxContext,
const rtl::Reference< Content >& rxContent,
const com::sun::star::ucb::OpenCommandArgument2& rCommand,
const com::sun::star::uno::Reference<
com::sun::star::ucb::XCommandEnvironment >& rxEnv );
};
struct DataSupplier_Impl;
class DataSupplier : public ucbhelper::ResultSetDataSupplier
{
private:
gvfs::DataSupplier_Impl *m_pImpl;
sal_Bool getData();
public:
DataSupplier(const rtl::Reference< Content >& rContent,
sal_Int32 nOpenMode);
virtual ~DataSupplier();
virtual OUString queryContentIdentifierString( sal_uInt32 nIndex ) SAL_OVERRIDE;
virtual com::sun::star::uno::Reference<
com::sun::star::ucb::XContentIdentifier >
queryContentIdentifier( sal_uInt32 nIndex ) SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
queryContent( sal_uInt32 nIndex ) SAL_OVERRIDE;
virtual bool getResult( sal_uInt32 nIndex ) SAL_OVERRIDE;
virtual sal_uInt32 totalCount() SAL_OVERRIDE;
virtual sal_uInt32 currentCount() SAL_OVERRIDE;
virtual bool isCountFinal() SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
queryPropertyValues( sal_uInt32 nIndex ) SAL_OVERRIDE;
virtual void releasePropertyValues( sal_uInt32 nIndex ) SAL_OVERRIDE;
virtual void close() SAL_OVERRIDE;
virtual void validate()
throw( com::sun::star::ucb::ResultSetException ) SAL_OVERRIDE;
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <libgnomevfs/gnome-vfs-init.h>
#include "gvfs_provider.hxx"
#include "gvfs_content.hxx"
using namespace com::sun::star;
using namespace gvfs;
// ContentProvider Implementation.
ContentProvider::ContentProvider(
const uno::Reference< uno::XComponentContext >& rxContext )
: ::ucbhelper::ContentProviderImplHelper( rxContext )
{
}
// sdafas
// virtual
ContentProvider::~ContentProvider()
{
}
// XInterface methods.
void SAL_CALL ContentProvider::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL ContentProvider::release()
throw()
{
OWeakObject::release();
}
css::uno::Any SAL_CALL ContentProvider::queryInterface( const css::uno::Type & rType )
throw( css::uno::RuntimeException, std::exception )
{
css::uno::Any aRet = cppu::queryInterface( rType,
(static_cast< lang::XTypeProvider* >(this)),
(static_cast< lang::XServiceInfo* >(this)),
(static_cast< css::ucb::XContentProvider* >(this))
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
// XTypeProvider methods.
XTYPEPROVIDER_IMPL_3( ContentProvider,
lang::XTypeProvider,
lang::XServiceInfo,
com::sun::star::ucb::XContentProvider );
// XServiceInfo methods.
XSERVICEINFO_IMPL_1_CTX( ContentProvider,
OUString( "com.sun.star.comp.GnomeVFSContentProvider" ),
OUString( "com.sun.star.ucb.GnomeVFSContentProvider" ) );
// Service factory implementation.
ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider );
// XContentProvider methods.
uno::Reference< com::sun::star::ucb::XContent > SAL_CALL
ContentProvider::queryContent(
const uno::Reference<
com::sun::star::ucb::XContentIdentifier >& Identifier )
throw( com::sun::star::ucb::IllegalIdentifierException,
uno::RuntimeException )
{
#if OSL_DEBUG_LEVEL > 1
g_warning ("QueryContent: '%s'",
OUStringToOString (Identifier->getContentIdentifier(),
RTL_TEXTENCODING_UTF8).getStr() );
#endif
osl::MutexGuard aGuard( m_aMutex );
// Check, if a content with given id already exists...
uno::Reference< com::sun::star::ucb::XContent > xContent
= queryExistingContent( Identifier ).get();
if ( xContent.is() )
return xContent;
try
{
xContent = new ::gvfs::Content( m_xContext, this, Identifier );
registerNewContent( xContent );
}
catch ( com::sun::star::ucb::ContentCreationException const & )
{
throw com::sun::star::ucb::IllegalIdentifierException();
}
if ( !xContent->getIdentifier().is() )
throw com::sun::star::ucb::IllegalIdentifierException();
return xContent;
}
//============================ shlib entry points =============================================
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ucpgvfs1_component_getFactory(
const sal_Char *pImplName, void* pServiceManager, void* /*pRegistryKey*/)
{
void * pRet = 0;
{
osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
if (!gnome_vfs_initialized ())
gnome_vfs_init ();
SAL_WNODEPRECATED_DECLARATIONS_PUSH
if (!auth_queue)
auth_queue = g_private_new( auth_queue_destroy );
SAL_WNODEPRECATED_DECLARATIONS_POP
}
uno::Reference< lang::XMultiServiceFactory > xSMgr
(reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
uno::Reference< lang::XSingleServiceFactory > xFactory;
if ( ::gvfs::ContentProvider::getImplementationName_Static().equalsAscii( pImplName ) )
xFactory = ::gvfs::ContentProvider::createServiceFactory( xSMgr );
if ( xFactory.is() ) {
xFactory->acquire();
pRet = xFactory.get();
}
return pRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_PROVIDER_HXX
#define INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_PROVIDER_HXX
#include <rtl/ref.hxx>
#include <com/sun/star/beans/Property.hpp>
#include <ucbhelper/providerhelper.hxx>
namespace gvfs {
class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
{
public:
explicit ContentProvider( const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~ContentProvider();
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual void SAL_CALL acquire()
throw() SAL_OVERRIDE;
virtual void SAL_CALL release()
throw() SAL_OVERRIDE;
// XTypeProvider
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName()
throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
static OUString getImplementationName_Static();
static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
static css::uno::Reference< css::lang::XSingleServiceFactory >
createServiceFactory( const css::uno::Reference<
css::lang::XMultiServiceFactory >& rxServiceMgr );
// XContentProvider
virtual ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XContent > SAL_CALL
queryContent( const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XContentIdentifier >& Identifier )
throw( ::com::sun::star::ucb::IllegalIdentifierException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
};
} /* namespace gvfs */
#endif // INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_PROVIDER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "gvfs_stream.hxx"
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <cppuhelper/queryinterface.hxx>
#include <libgnomevfs/gnome-vfs-ops.h>
using namespace cppu;
using namespace com::sun::star::io;
using namespace com::sun::star::uno;
using namespace com::sun::star::ucb;
using namespace gvfs;
Stream::Stream( GnomeVFSHandle *handle,
const GnomeVFSFileInfo *aInfo ) :
m_eof (sal_False),
m_bInputStreamCalled( sal_False ),
m_bOutputStreamCalled( sal_False )
{
m_handle = handle;
gnome_vfs_file_info_copy (&m_info, aInfo);
}
Stream::~Stream()
{
if (m_handle) {
gnome_vfs_close (m_handle);
m_handle = NULL;
}
}
Any Stream::queryInterface( const Type &type )
throw( RuntimeException )
{
Any aRet = ::cppu::queryInterface
( type,
static_cast< XStream * >( this ),
static_cast< XInputStream * >( this ),
static_cast< XOutputStream * >( this ),
static_cast< XSeekable * >( this ),
static_cast< XTruncate * >( this ) );
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( type );
}
// XStream
com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL
Stream::getInputStream( )
throw( com::sun::star::uno::RuntimeException )
{
{
osl::MutexGuard aGuard( m_aMutex );
m_bInputStreamCalled = true;
}
return Reference< XInputStream >( this );
}
com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > SAL_CALL
Stream::getOutputStream( )
throw( com::sun::star::uno::RuntimeException )
{
{
osl::MutexGuard aGuard( m_aMutex );
m_bOutputStreamCalled = true;
}
return Reference< XOutputStream >( this );
}
// XInputStream
sal_Int32 SAL_CALL Stream::readBytes(
Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException )
{
GnomeVFSResult result;
GnomeVFSFileSize nBytesRead = 0;
if( ! m_handle )
throw IOException();
if( m_eof ) {
aData.realloc( 0 );
return 0;
}
try {
aData.realloc( nBytesToRead );
} catch ( const Exception &e ) {
throw BufferSizeExceededException();
}
do {
result = gnome_vfs_read( m_handle, aData.getArray(),
nBytesToRead, &nBytesRead );
} while( result == GNOME_VFS_ERROR_INTERRUPTED );
if (result != GNOME_VFS_OK &&
result != GNOME_VFS_ERROR_EOF)
throwOnError( result );
if (result == GNOME_VFS_ERROR_EOF)
m_eof = sal_True;
aData.realloc( sal::static_int_cast<sal_uInt32>(nBytesRead) );
return sal::static_int_cast<sal_Int32>(nBytesRead);
}
sal_Int32 SAL_CALL Stream::readSomeBytes(
Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException )
{
// Again - having 2 methods here just sucks; cf. filinpstr.cxx
// This can never be an effective non-blocking API - so why bother ?
return readBytes( aData, nMaxBytesToRead );
}
void SAL_CALL Stream::skipBytes( sal_Int32 nBytesToSkip )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException )
{
GnomeVFSResult result;
if( ! m_handle )
throw IOException();
result = gnome_vfs_seek( m_handle, GNOME_VFS_SEEK_CURRENT, nBytesToSkip );
if ( result == GNOME_VFS_ERROR_BAD_PARAMETERS ||
result == GNOME_VFS_ERROR_NOT_SUPPORTED )
g_warning ("FIXME: just read them in ...");
throwOnError( result );
}
sal_Int32 SAL_CALL Stream::available( )
throw( NotConnectedException,
IOException,
RuntimeException )
{
return 0; // cf. filinpstr.cxx
}
void SAL_CALL Stream::closeInput()
throw( NotConnectedException,
IOException,
RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
m_bInputStreamCalled = false;
if( ! m_bOutputStreamCalled )
closeStream();
}
// XSeekable
void SAL_CALL Stream::seek( sal_Int64 location )
throw( ::com::sun::star::lang::IllegalArgumentException,
IOException,
RuntimeException )
{
GnomeVFSResult result;
if( ! m_handle )
throw IOException();
if ( location < 0 )
throw ::com::sun::star::lang::IllegalArgumentException();
m_eof = sal_False;
result = gnome_vfs_seek( m_handle, GNOME_VFS_SEEK_START, location );
if (result == GNOME_VFS_ERROR_EOF)
throw ::com::sun::star::lang::IllegalArgumentException();
throwOnError( result );
}
sal_Int64 SAL_CALL Stream::getPosition()
throw( IOException,
RuntimeException )
{
GnomeVFSFileSize nBytesIn = 0;
if( ! m_handle )
throw IOException();
throwOnError( gnome_vfs_tell( m_handle, &nBytesIn ) );
return nBytesIn;
}
sal_Int64 SAL_CALL Stream::getLength()
throw( IOException, RuntimeException )
{
// FIXME: so this sucks; it may be stale but ...
if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE)
return m_info.size;
else {
g_warning ("FIXME: No valid length");
return 0;
}
}
// XTruncate
void SAL_CALL Stream::truncate()
throw( com::sun::star::io::IOException,
com::sun::star::uno::RuntimeException )
{
if( ! m_handle )
throw IOException();
throwOnError( gnome_vfs_truncate_handle( m_handle, 0 ) );
}
// XOutputStream
void SAL_CALL Stream::writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData )
throw( com::sun::star::io::NotConnectedException,
com::sun::star::io::BufferSizeExceededException,
com::sun::star::io::IOException,
com::sun::star::uno::RuntimeException)
{
GnomeVFSResult result = GNOME_VFS_OK;
GnomeVFSFileSize toWrite = aData.getLength();
const sal_Int8 *p = aData.getConstArray();
if( ! m_handle )
throw IOException();
while( toWrite > 0) {
GnomeVFSFileSize bytesWritten = 0;
result = gnome_vfs_write( m_handle, p, toWrite, &bytesWritten );
if( result == GNOME_VFS_ERROR_INTERRUPTED )
continue;
throwOnError( result );
g_assert( bytesWritten <= toWrite );
toWrite -= bytesWritten;
p += bytesWritten;
}
}
void SAL_CALL Stream::flush()
throw( NotConnectedException, BufferSizeExceededException,
IOException, RuntimeException )
{
}
void SAL_CALL Stream::closeOutput()
throw( com::sun::star::io::NotConnectedException,
com::sun::star::io::IOException,
com::sun::star::uno::RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
m_bOutputStreamCalled = false;
if( ! m_bInputStreamCalled )
closeStream();
}
// Misc.
void Stream::closeStream()
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException )
{
if (m_handle) {
gnome_vfs_close (m_handle);
m_handle = NULL;
} else
throw IOException();
}
void Stream::throwOnError( GnomeVFSResult result )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException )
{
if( result != GNOME_VFS_OK ) {
OUString aMsg = OUString::createFromAscii
( gnome_vfs_result_to_string( result ) );
g_warning( "Input Stream exceptional result '%s' (%d)",
gnome_vfs_result_to_string( result ), result );
throw IOException( aMsg, static_cast< cppu::OWeakObject * >( this ) );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_STREAM_HXX
#define INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_STREAM_HXX
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <cppuhelper/weak.hxx>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XTruncate.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <libgnomevfs/gnome-vfs-handle.h>
namespace gvfs
{
class Stream : public ::com::sun::star::io::XStream,
public ::com::sun::star::io::XInputStream,
public ::com::sun::star::io::XOutputStream,
public ::com::sun::star::io::XTruncate,
public ::com::sun::star::io::XSeekable,
public ::cppu::OWeakObject
{
private:
GnomeVFSHandle *m_handle;
GnomeVFSFileInfo m_info;
osl::Mutex m_aMutex;
sal_Bool m_eof;
sal_Bool m_bInputStreamCalled;
sal_Bool m_bOutputStreamCalled;
void throwOnError( GnomeVFSResult result )
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::BufferSizeExceededException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException );
void closeStream()
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException );
public:
Stream ( GnomeVFSHandle *handle,
const GnomeVFSFileInfo *aInfo );
virtual ~Stream();
// XInterface
virtual com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & type )
throw( ::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual void SAL_CALL acquire()
throw () SAL_OVERRIDE
{ OWeakObject::acquire(); }
virtual void SAL_CALL release()
throw() SAL_OVERRIDE
{ OWeakObject::release(); }
// XStream
virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL getInputStream( )
throw( com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( )
throw( com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
// XInputStream
virtual sal_Int32 SAL_CALL readBytes(
::com::sun::star::uno::Sequence< sal_Int8 > & aData,
sal_Int32 nBytesToRead )
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::BufferSizeExceededException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual sal_Int32 SAL_CALL readSomeBytes(
::com::sun::star::uno::Sequence< sal_Int8 > & aData,
sal_Int32 nMaxBytesToRead )
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::BufferSizeExceededException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::BufferSizeExceededException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual sal_Int32 SAL_CALL available()
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual void SAL_CALL closeInput()
throw( ::com::sun::star::io::NotConnectedException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
// XSeekable
virtual void SAL_CALL seek( sal_Int64 location )
throw( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual sal_Int64 SAL_CALL getPosition()
throw( ::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual sal_Int64 SAL_CALL getLength()
throw( ::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
// XOutputStream
virtual void SAL_CALL writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData )
throw( com::sun::star::io::NotConnectedException,
com::sun::star::io::BufferSizeExceededException,
com::sun::star::io::IOException,
com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
virtual void SAL_CALL flush()
throw( com::sun::star::io::NotConnectedException,
com::sun::star::io::BufferSizeExceededException,
com::sun::star::io::IOException,
com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
virtual void SAL_CALL closeOutput()
throw( com::sun::star::io::NotConnectedException,
com::sun::star::io::IOException,
com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
// XTruncate
virtual void SAL_CALL truncate()
throw( com::sun::star::io::IOException,
com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
};
} // namespace gvfs
#endif // INCLUDED_UCB_SOURCE_UCP_GVFS_GVFS_STREAM_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="ucpgvfs1" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.GnomeVFSContentProvider">
<service name="com.sun.star.ucb.GnomeVFSContentProvider"/>
</implementation>
</component>
......@@ -126,7 +126,7 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference< uno::XComponentContext
gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT );
#if ENABLE_GNOME_VFS || ENABLE_GIO
#if ENABLE_GIO
gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), false );
#endif
gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), false );
......
......@@ -57,7 +57,7 @@ SalGtkFolderPicker::SalGtkFolderPicker( const uno::Reference< uno::XComponentCon
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, nullptr );
gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT );
#if ENABLE_GNOME_VFS || ENABLE_GIO
#if ENABLE_GIO
gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), false );
#endif
gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), false );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment