Kaydet (Commit) 6c605575 authored tarafından Matúš Kukan's avatar Matúš Kukan

move onlinecheck.cxx from sal to extensions

üst 166f974c
...@@ -51,6 +51,11 @@ ifeq ($(OS),WNT) ...@@ -51,6 +51,11 @@ ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_linked_libs,updchk,\ $(eval $(call gb_Library_add_linked_libs,updchk,\
ole32 \ ole32 \
shell32 \ shell32 \
wininet \
))
$(eval $(call gb_Library_add_exception_objects,updchk,\
extensions/source/update/check/onlinecheck \
)) ))
endif # OS WNT endif # OS WNT
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include <tchar.h> #include <tchar.h>
// #i71984 // #i71984
extern "C" sal_Bool SAL_CALL hasInternetConnection() extern "C" bool SAL_CALL WNT_hasInternetConnection()
{ {
DWORD dwFlags; DWORD dwFlags;
TCHAR szConnectionName[1024]; TCHAR szConnectionName[1024];
...@@ -57,11 +57,11 @@ extern "C" sal_Bool SAL_CALL hasInternetConnection() ...@@ -57,11 +57,11 @@ extern "C" sal_Bool SAL_CALL hasInternetConnection()
SAL_N_ELEMENTS(szConnectionName), SAL_N_ELEMENTS(szConnectionName),
0 ); 0 );
return fIsConnected ? sal_True : sal_False; return fIsConnected ? true : false;
#ifndef __MINGW32__ #ifndef __MINGW32__
} __except( EXCEPTION_EXECUTE_HANDLER ) { } __except( EXCEPTION_EXECUTE_HANDLER ) {
return sal_False; return false;
} }
#endif #endif
} }
......
...@@ -85,6 +85,7 @@ namespace uno = com::sun::star::uno ; ...@@ -85,6 +85,7 @@ namespace uno = com::sun::star::uno ;
#define PROPERTY_DEFAULT_TEXT UNISTRING("DefaultText") #define PROPERTY_DEFAULT_TEXT UNISTRING("DefaultText")
#define PROPERTY_SHOW_MENUICON UNISTRING("MenuIconVisible") #define PROPERTY_SHOW_MENUICON UNISTRING("MenuIconVisible")
extern "C" bool SAL_CALL WNT_hasInternetConnection();
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Returns the URL of the release note for the given position // Returns the URL of the release note for the given position
...@@ -267,9 +268,11 @@ private: ...@@ -267,9 +268,11 @@ private:
/* Used to avoid dialup login windows (on platforms we know how to double this) */ /* Used to avoid dialup login windows (on platforms we know how to double this) */
inline bool hasInternetConnection() const inline bool hasInternetConnection() const
{ {
if(m_pHasInternetConnection != NULL ) #ifdef WNT
return (sal_True == m_pHasInternetConnection()); return WNT_hasInternetConnection();
#else
return true; return true;
#endif
} }
/* Creates a new instance of UpdateInformationProvider and returns this instance */ /* Creates a new instance of UpdateInformationProvider and returns this instance */
...@@ -295,10 +298,6 @@ protected: ...@@ -295,10 +298,6 @@ protected:
osl::Condition& m_aCondition; osl::Condition& m_aCondition;
private: private:
// const
OnlineCheckFunc m_pHasInternetConnection;
const uno::Reference<uno::XComponentContext> m_xContext; const uno::Reference<uno::XComponentContext> m_xContext;
uno::Reference<deployment::XUpdateInformationProvider> m_xProvider; uno::Reference<deployment::XUpdateInformationProvider> m_xProvider;
}; };
...@@ -373,30 +372,8 @@ private: ...@@ -373,30 +372,8 @@ private:
UpdateCheckThread::UpdateCheckThread( osl::Condition& rCondition, UpdateCheckThread::UpdateCheckThread( osl::Condition& rCondition,
const uno::Reference<uno::XComponentContext>& xContext ) : const uno::Reference<uno::XComponentContext>& xContext ) :
m_aCondition(rCondition), m_aCondition(rCondition),
m_pHasInternetConnection(NULL),
m_xContext(xContext) m_xContext(xContext)
{ {
#ifdef WNT
rtl::OUString aPath;
if( osl_getExecutableFile(&aPath.pData) == osl_Process_E_None )
{
sal_uInt32 lastIndex = aPath.lastIndexOf('/');
if ( lastIndex > 0 )
{
aPath = aPath.copy( 0, lastIndex+1 );
aPath += UNISTRING( "onlinecheck" );
}
if ( m_aModule.load(aPath) )
{
m_pHasInternetConnection =
reinterpret_cast < OnlineCheckFunc > (
m_aModule.getFunctionSymbol( UNISTRING("hasInternetConnection")));
}
}
#endif
createSuspended(); createSuspended();
// actually run the thread // actually run the thread
......
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
PRJ=..$/..$/..
PRJNAME=sal
TARGET=onlinecheck
USE_DEFFILE=TRUE
LIBTARGET=NO
# --- Settings ----------------------------------
.INCLUDE : settings.mk
CFLAGS+= $(LFS_CFLAGS)
CXXFLAGS+= $(LFS_CFLAGS)
# --- Targets ----------------------------------
.IF "$(GUI)"=="WNT"
.IF "$(COMEX)"=="9"
.IF "$(PSDK_HOME)"!=""
# Since the 02/2003 PSDK the "new" linker is needed here.
LINK=$(WRAPCMD) "$(PSDK_HOME)$/Bin$/Win64$/LINK.EXE"
.ENDIF
.ENDIF
SLOFILES=\
$(SLO)$/onlinecheck.obj
SHL1TARGET=$(TARGET)
SHL1IMPLIB=$(SHL1TARGET)
SHL1DEF=$(MISC)/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
DEF1EXPORTFILE=$(SHL1TARGET).dxp
DEF1DEPN=\
$(DEF1EXPORTFILE)\
makefile.mk
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
$(KERNEL32LIB)\
$(LIBCMT)\
$(WININETLIB)
.ENDIF
.INCLUDE : target.mk
;*************************************************************************
;
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; Copyright 2000, 2010 Oracle and/or its affiliates.
;
; OpenOffice.org - a multi-platform office productivity suite
;
; This file is part of OpenOffice.org.
;
; OpenOffice.org is free software: you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License version 3
; only, as published by the Free Software Foundation.
;
; OpenOffice.org is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Lesser General Public License version 3 for more details
; (a copy is included in the LICENSE file that accompanied this code).
;
; You should have received a copy of the GNU Lesser General Public License
; version 3 along with OpenOffice.org. If not, see
; <http://www.openoffice.org/license.html>
; for a copy of the LGPLv3 License.
;
;*************************************************************************
hasInternetConnection
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