Add IsNetworkPath to kiplatform
This commit is contained in:
parent
7e2883df50
commit
33dbc8ccd1
|
@ -18,6 +18,10 @@ elseif( WIN32 )
|
||||||
msw/environment.cpp
|
msw/environment.cpp
|
||||||
msw/ui.cpp
|
msw/ui.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set( PLATFORM_LIBS
|
||||||
|
"Shlwapi"
|
||||||
|
)
|
||||||
elseif( UNIX )
|
elseif( UNIX )
|
||||||
set( PLATFORM_SRCS
|
set( PLATFORM_SRCS
|
||||||
gtk/app.cpp
|
gtk/app.cpp
|
||||||
|
|
|
@ -38,3 +38,10 @@ bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath )
|
||||||
|
{
|
||||||
|
// placeholder, we "nerf" behavior if its a network path so return false by default
|
||||||
|
return false;
|
||||||
|
}
|
|
@ -33,5 +33,15 @@ namespace KIPLATFORM
|
||||||
* @return true if the operation succeeds, false if it fails (see the contents of aError)
|
* @return true if the operation succeeds, false if it fails (see the contents of aError)
|
||||||
*/
|
*/
|
||||||
bool MoveToTrash( const wxString& aPath, wxString& aError );
|
bool MoveToTrash( const wxString& aPath, wxString& aError );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a given path is a network shared file apth
|
||||||
|
* On Windows for example, any form of path is accepted drive map or UNC
|
||||||
|
*
|
||||||
|
* @param aPath is any kind of file path to be tested
|
||||||
|
*
|
||||||
|
* @return true if given path is on a network location
|
||||||
|
*/
|
||||||
|
bool IsNetworkPath( const wxString& aPath );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
|
#include <shlwapi.h>
|
||||||
|
|
||||||
bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
|
bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
|
||||||
{
|
{
|
||||||
|
@ -49,3 +50,9 @@ bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath )
|
||||||
|
{
|
||||||
|
return ::PathIsNetworkPathW( aPath.wc_str() );
|
||||||
|
}
|
|
@ -43,3 +43,10 @@ bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath )
|
||||||
|
{
|
||||||
|
// placeholder, we "nerf" behavior if its a network path so return false by default
|
||||||
|
return false;
|
||||||
|
}
|
Loading…
Reference in New Issue