Add IsNetworkPath to kiplatform

This commit is contained in:
Marek Roszko 2020-12-15 19:28:58 -05:00
parent 7e2883df50
commit 33dbc8ccd1
5 changed files with 35 additions and 0 deletions

View File

@ -18,6 +18,10 @@ elseif( WIN32 )
msw/environment.cpp
msw/ui.cpp
)
set( PLATFORM_LIBS
"Shlwapi"
)
elseif( UNIX )
set( PLATFORM_SRCS
gtk/app.cpp

View File

@ -38,3 +38,10 @@ bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
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;
}

View File

@ -33,5 +33,15 @@ namespace KIPLATFORM
* @return true if the operation succeeds, false if it fails (see the contents of 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 );
}
}

View File

@ -24,6 +24,7 @@
#include <Windows.h>
#include <shellapi.h>
#include <shlwapi.h>
bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
{
@ -49,3 +50,9 @@ bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
return true;
}
bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath )
{
return ::PathIsNetworkPathW( aPath.wc_str() );
}

View File

@ -43,3 +43,10 @@ bool KIPLATFORM::ENV::MoveToTrash( const wxString& aPath, wxString& aError )
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;
}