mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 05:55:59 +03:00
Add a utility function fsCasePreserving.
Returns true if the underlying file system is case preserving instead of case sensitive. That is true for Mac and Windows currently. Only Linux has a case sensitive file system usually.
This commit is contained in:
parent
18677dbc3f
commit
ef0a3c212e
2 changed files with 15 additions and 0 deletions
|
@ -348,6 +348,15 @@ static bool checkDolphinCanSelect()
|
|||
return p.readAll().contains("--select");
|
||||
}
|
||||
|
||||
bool Utility::fsCasePreserving()
|
||||
{
|
||||
bool re = false;
|
||||
if( isWindows() || isMac() ) {
|
||||
re = true;
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
||||
// inspired by Qt Creator's showInGraphicalShell();
|
||||
void Utility::showInFileManager(const QString &localPath)
|
||||
{
|
||||
|
|
|
@ -69,6 +69,12 @@ namespace Utility
|
|||
OWNCLOUDSYNC_EXPORT bool isUnix();
|
||||
OWNCLOUDSYNC_EXPORT bool isLinux(); // use with care
|
||||
|
||||
// Case preserving file system underneath?
|
||||
// if this function returns true, the file system is case preserving,
|
||||
// that means "test" means the same as "TEST" for filenames.
|
||||
// if false, the two cases are two different files.
|
||||
OWNCLOUDSYNC_EXPORT bool fsCasePreserving();
|
||||
|
||||
class StopWatch {
|
||||
private:
|
||||
QHash<QString, quint64> _lapTimes;
|
||||
|
|
Loading…
Reference in a new issue